diff --git a/.gitignore b/.gitignore index 9700745..352986c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,23 +1,27 @@ *.dll +*.log *.so *.zip -lib/parser/autom4te.cache/ -lib/parser/configure -lib/parser/config.guess -lib/parser/config.log -lib/parser/config.sub -lib/parser/config.status -lib/parser/install-sh -lib/parser/Makefile +Manifest.toml +confdefs* +conftest.* lib/3rdParty/antlr/3.2/libantlr3c-3.2/.deps/ lib/3rdParty/antlr/3.2/libantlr3c-3.2/Makefile lib/3rdParty/antlr/3.2/libantlr3c-3.2/antlr3config.h +lib/3rdParty/antlr/3.2/libantlr3c-3.2/autom4te.cache/ lib/3rdParty/antlr/3.2/libantlr3c-3.2/config.log lib/3rdParty/antlr/3.2/libantlr3c-3.2/config.status +lib/3rdParty/antlr/3.2/libantlr3c-3.2/configure.ac~ +lib/3rdParty/antlr/3.2/libantlr3c-3.2/configure~ lib/3rdParty/antlr/3.2/libantlr3c-3.2/libtool lib/3rdParty/antlr/3.2/libantlr3c-3.2/stamp-h1 lib/build/ +lib/ext/ubuntu-latest-library.tar +lib/ext/ubuntu-latest-library.tar.gz +lib/ext/windows-latest-library.tar +lib/ext/windows-latest-library.tar.gz lib/parser/BaseModelica_Lexer.tokens +lib/parser/Makefile lib/parser/MetaModelicaJuliaLayer.o lib/parser/MetaModelica_Lexer.c lib/parser/MetaModelica_Lexer.h @@ -46,7 +50,12 @@ lib/parser/ParModelica_Lexer.tokens lib/parser/ParModelica_Lexer_BaseModelica_Lexer.c lib/parser/ParModelica_Lexer_BaseModelica_Lexer.h lib/parser/Parser_jl.o +lib/parser/autom4te.cache/ +lib/parser/config.guess +lib/parser/config.log +lib/parser/config.status +lib/parser/config.sub +lib/parser/configure +lib/parser/install-sh lib/parser/libomantlr3.a -lib/parser/libomparse-julia.a -confdefs* -conftest.* +lib/parser/libomparse-julia.a \ No newline at end of file diff --git a/Project.toml b/Project.toml index c182a87..974fd96 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "OMParser" uuid = "11f87224-cae7-4e99-a924-e50d12f62c59" authors = ["Adrian Pop "] -version = "0.0.2" +version = "0.0.3" [deps] Absyn = "ce2f92e2-a952-11e9-0543-8b443f216f1d" diff --git a/deps/build.jl b/deps/build.jl index 2b585e4..384154c 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -37,6 +37,12 @@ end using HTTP #=Extern path=# PATH_TO_EXT = realpath("$(pwd())/../lib/ext") + + +@static if v"1.10.0" < VERSION + throw("precompilation is currently only supported for Julia version 1.10 or greater. For prior versions of Julia please download and extract the libraries available at https://github.com/OpenModelica/OMParser.jl/releases") +end + @static if Sys.iswindows() #= Download shared libraries (DLLS for Windows)=# extractTar("windows-latest-library"; @@ -51,4 +57,3 @@ else#= Throw error for other variants =# @error "Non Linux/Windows systems are currently not supported" throw("Unsupported system error") end - diff --git a/src/OMParser.jl b/src/OMParser.jl index ebeb371..338b113 100644 --- a/src/OMParser.jl +++ b/src/OMParser.jl @@ -59,11 +59,12 @@ function _locateSharedParserLibrary(directoryToSearchIn) end """ - This function finds precompiled paths + This function finds precompiled paths """ function locateSharedParserLibrary(directoryToSearchIn) local res = Glob.glob("*", joinpath(directoryToSearchIn, "shared")) local results = [] + println() for p in res push!(results, Glob.glob("*", joinpath(directoryToSearchIn, p))) end @@ -75,7 +76,7 @@ function locateSharedParserLibrary(directoryToSearchIn) return p end end - end + end elseif Sys.iswindows() for r in results for p in r @@ -129,7 +130,10 @@ end # ("3.4", 34), ("3.5", 35), ("latest",1000), ("experimental", 9999) # acceptedGram: # 1=Modelica, 2=MetaModelica, 3=ParModelica, 4=Optimica, 5=PdeModelica -function parseString(contents::String, interactiveFileName::String = "", acceptedGram::Int64 = 1, languageStandard::Int64 = 1000)::Absyn.Program +function parseString(contents::String, + interactiveFileName::String = "", + acceptedGram::Int64 = 1, + languageStandard::Int64 = 1000)::Absyn.Program local res = ccall((:parseString, installedLibPath), Any, (String, String, Int64, Int64), contents, interactiveFileName, acceptedGram, languageStandard) if res == nothing throw(ParseError()) @@ -142,7 +146,7 @@ end # ("3.4", 34), ("3.5", 35), ("latest",1000), ("experimental", 9999) # acceptedGram: # 1=Modelica, 2=MetaModelica, 3=ParModelica, 4=Optimica, 5=PdeModelica -function parseFile(fileName::String, acceptedGram::Int64 = 1, languageStandard::Int64 = 1000)::Absyn.Program +function parseFile(fileName::String, acceptedGram::Int64 = 1, languageStandard::Int64 = 9999)::Absyn.Program local res = ccall((:parseFile, installedLibPath), Any, (String, Int64, Int64), fileName, acceptedGram, languageStandard) if res == nothing throw(ParseError()) @@ -150,5 +154,4 @@ function parseFile(fileName::String, acceptedGram::Int64 = 1, languageStandard:: res end - end