Skip to content

Release 3.7.0 - #728

Merged
kaby76 merged 14 commits into
mainfrom
trash-release-3.7.0
Sep 26, 2026
Merged

kaby76 merged 14 commits into
mainfrom
trash-release-3.7.0

Conversation

@kaby76

@kaby76 kaby76 commented Sep 19, 2026 •

Copy link
Copy Markdown
Owner

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-recursion for 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-rule for selecting the entry rule, including interpreted parsing. Make trgen report multiple EOF-terminated start-rule candidates unless an explicit start rule is supplied; honor trgen --start-rule in that case.

G4Plus syntax

  • Add the built-in G4Plus grammar, selected automatically for .g4p and .g4+ files or explicitly with trparse -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 fragment syntactically 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.sh uses the reusable converter.
  • Update CSharp Bash and PowerShell test templates to run .trq assertions with trash 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

@kaby76
kaby76 marked this pull request as ready for review September 26, 2026 09:48
Copilot AI lite review requested due to automatic review settings September 26, 2026 09:48
Copilot stopped reviewing on behalf of kaby76 due to an error September 26, 2026 10:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@kaby76
kaby76 merged commit 34e9261 into main Sep 26, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants