Commit
6a829249a663bdfe8f19da146748367620f7965b
by adrian.popAdd 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?