Repository navigation
Release 3.7.0
Release 3.7.0 adds opt-in indirect left-recursion support to the interpreted parser, explicit start-rule selection, and the initial G4Plus grammar syntax.
Interpreted parsing
- Add
trparse --indirect-left-recursionfor mutually/indirectly left-recursive interp grammars. Fixed-point, seed-growing evaluation reconstructs the original grammar-rule nesting in the parse tree. - Detect indirect left recursion when the option is absent and report an error instead of entering a nonterminating parse. The opt-in mode cannot currently be combined with context-aware lexing.
- Add
trparse --start-rulefor selecting the entry rule, including interpreted parsing. Maketrgenreport multiple EOF-terminated start-rule candidates unless an explicit start rule is supplied; honortrgen --start-rulein that case.
G4Plus syntax
- Add the built-in G4Plus grammar, selected automatically for
.g4pand.g4+files or explicitly withtrparse -t G4Plus. - Unify rule syntax and remove capitalization restrictions on rule names and references. Grammar declarations determine rule kind: lexer grammar rules are lexer rules; parser and combined grammar rules are parser rules. Accept
fragmentsyntactically in each grammar kind. - Add set-difference syntax, such as
Identifier : IdentifierChars - (ReservedKeyword | BooleanLiteral | NullLiteral);, with an example. - Preserve the ability to parse existing ANTLR4 grammar syntax, including arguments, character sets, actions, and lexer commands. Add corpus compatibility tests and mixed-case rule tests.
G4Plus support in this release parses grammar source only. Generating .interp tables from G4Plus, enforcing set-difference matching, and the shared backend for additional EBNF front ends are deferred to 4.0.0.
Examples and generated tests
- Add
examples/ixml-to-antlr4/convert-ixml-to-antlr4.sh, which accepts an iXML file and writes an ANTLR4 grammar to stdout. It locates its XQuery scripts relative to itself, so it can run from another working directory;run-example.shuses the reusable converter. - Update CSharp Bash and PowerShell test templates to run
.trqassertions withtrash xquery -q. Nonempty assertion output or an unsuccessful query makes the test fail. - Refresh iXML grammar formatting and remove temporary and bundled test artifacts; update the kotlin-formal test setup to specify its start rule.
Regression coverage
Add tests for indirect recursion acceptance, reconstructed trees, and rejection without the option; explicit start-rule selection and diagnostics; and G4Plus syntax and CLI integration. The G4Plus verification run passed 76 tests, including 64 existing .g4 corpus files.
Full changes: 3.6.0...3.7.0
Pull request: #728