Repository navigation
Changes
REx 7.0 is a major release, because it changes the parsing event handler interfaces in an incompatible way. It also includes all changes of REx 6.3, released earlier today.
Breaking Changes
- Event handlers receive codes instead of names -
startNonterminal,endNonterminal,terminalandnonterminalnow pass an integeridinstead of the symbol name, in all target languages.Symbol.nameis replaced byid. Names are available from theNONTERMINALandTOKENarrays of the generated parser, which are public when-treeis specified (TOKENalso with-nolexer), and from the new accessorsgetNonterminalName(id)andgetTerminalName(id)(GetNonterminalNameandGetTerminalNamein Go). Codes are specific to the grammar they were generated for, and should not be stored or compared across parsers. See Migrating from Names to Codes - GLR ambiguity reporting - with
-glror-glalrand-ambiguity reject, the additional nonterminalsALTERNATIVE,AMBIGUOUSandUNAMBIGUOUShave the fixed codes -2, -3 and -4. They are not entries of theNONTERMINALarray, so usegetNonterminalName(id)for them - Java
-interface NAME- since such parsers share handler interfaces,getNonterminalNameandgetTerminalNameare instance methods,Symbol.getName()takes the parser as an argument, and the standard serializers take the parser as an additional constructor argument, e.g.new XmlSerializer(writer, indent, parser)
Improvements
- Parse tree handling without string handling - applications can dispatch on integer codes and look up names only when needed
- Test requirements - running the tests requires a Java 21 JDK, as announced in 6.3. The test dependencies are BaseX 13.0 and Gradle 9.9.0