Skip to content

Changes

Summary

  1. Add a formal grammar using ANTLR (details)
  2. Fixes (details)
  3. WIP see if Jenkins strips CLASSPATH env.var (details)
  4. WIP set CLASSPATH (details)
  5. WIP add . to CLASSPATH (details)
  6. Change grammar for function calls back to as written in the specification (details)
  7. fix .CI/Jenkinsfile conflict (details)
Commit 6a829249a663bdfe8f19da146748367620f7965b by adrian.pop
Add a formal grammar using ANTLR

This uses a combined ANTLR3 and ANTLR4 grammar (the differences are
converted from ANTLR3 to ANTLR4). ANTLR4 is used to run the grammar
easily, and ANTLR3 to analyze the grammar to verify it is LL(k=2).

- `extends_clause` was fixed compared to the 3.4 grammar
- `array_arguments`: Changed to use iteration as the rest of the grammar
- `function_call_args` have been rewritten due to #2250 and also resolves
  ambiguity with named arg or expression
  f(a, b=3) ANTLR4 said "f(a, b" parsed, expecting ")"
- `der_class_specifier` was merged into `short_class_specifier` to get
  k=2 instead of k=3.
- TODO: `equation` resolved the ambiguity by allowing simple expressions
  stand-alone. This is easy to implement for all tools, might be OK for
  flat Modelica, but is usually a user error... How to resolve it? Use
  ANTLR backtracking or predicates? Create a simple_expression_no_cref?
The file was addedgrammar/Modelica.g
The file was addedgrammar/.gitignore
The file was addedgrammar/Main.java
The file was addedgrammar/build.sh
Commit 6c34ea829b2eab752a04c131333e61e156f854fa by adrian.pop
Fixes

- [ ] Changed `import_clause` to include `.*` explicitly as it is
  a different lexical token than `.` `*`.
- Fixed S_CHAR to be a fragment (broke during ANTLR 4 to 3 conversion)
- Added a docker image with some libraries to test the parser on
The file was modified .CI/Jenkinsfile (diff)
The file was addedgrammar/Makefile
The file was modified grammar/Main.java (diff)
The file was addedgrammar/test.mo
The file was modified grammar/.gitignore (diff)
The file was modified grammar/Modelica.g (diff)
The file was modified grammar/build.sh (diff)
The file was modified .gitignore (diff)
The file was added.CI/antlr/Dockerfile
Commit 849369b690f374033482faecc731be3b28f3f411 by adrian.pop
WIP see if Jenkins strips CLASSPATH env.var
The file was modified .CI/Jenkinsfile (diff)
The file was modified .CI/antlr/Dockerfile (diff)
The file was modified grammar/build.sh (diff)
The file was modified .CI/Jenkinsfile (diff)
Commit 24909d7d5e4d76555dd602e932aea19ace2522e3 by adrian.pop
WIP add . to CLASSPATH
The file was modified .CI/Jenkinsfile (diff)
Commit fad849ee8d29fe7062960b53ed7636096de95e40 by adrian.pop
Change grammar for function calls back to as written in the specification
The file was modified grammar/Modelica.g (diff)
Commit f68d0d8b67585615dfb26310f4197ceeccb06749 by adrian.pop
fix .CI/Jenkinsfile conflict
The file was modified .CI/Jenkinsfile (diff)