Next Generation TypeScript runtime for ANTLR4
OTHER License
Published by mike-lischke 8 months ago
Lexer.modeStack
public again and allow reading and writing the current lexer mode.Published by mike-lischke 8 months ago
This release completes the conversion of the Java (and JavaScript) ANTRL4 runtime to TypeScript. It's a significant improvement over the existing TS (and JS) runtimes, as it includes now all relevant parts from the Java runtime and has been optimized for performance. It's now twice as fast for cold runs and 20% faster with a warm parser/lexer.
Published by mike-lischke 8 months ago
This is the next major release of the code generator, after an overhaul of the antlr4ng runtime. It introduces a number of API changes, but no changes to the original working mechanism. The other targets (C++, Java, etc.) are not affected by this release. All changes in this release are to support the new antlr4ng major release 3.0.0:
Published by mike-lischke 8 months ago
Published by mike-lischke 9 months ago
Published by mike-lischke 9 months ago
Published by mike-lischke 9 months ago
RuleContext.toStringTree()
overload.Published by mike-lischke 9 months ago
Published by mike-lischke 10 months ago
ParserRuleContext
for retrieving sub contexts to accept any constructor parameter, for more flexibility.Published by mike-lischke 11 months ago
Code generation improvements, especially for local rule attributes. Attributes in a rule (which are implemented as local variables in the generated code) can be unassigned and need extra null-safety checks (the ? operator) or non-null assertions. The code generator now adds these checks automatically.
Published by mike-lischke 11 months ago
ParserRuleContext.getChild
now accepts any constructor type.Published by mike-lischke 11 months ago
This is a combined release of the antlr4ng runtime and the cli tool for it. It combines 2 small changes:
switchLabel
: CASE (constantExpression=expression | enumConstantName=IDENTIFIER | typeType varName=identifier) ':'
| DEFAULT ':'
;
contains some attributes (e.g. enumConstantName
) which generate a local variables in the SwitchLabelContext
. However, they aren't always assigned a value (depending on the path taken in that rule), so they must be optional or you get an error from tsc about not initialised variables.
Published by mike-lischke 12 months ago
Published by mike-lischke 12 months ago
The entire runtime now exclusively uses TypeScript. It was tested with the standard ANTLR4 runtime tests and completed the test suite successfully.
Published by mike-lischke 12 months ago
Code generation changes:
override
keyword is needed in generated classes.ParserRuleContext._ctx
was renamed to ParserRuleContext.context
in the runtime.TokenStream.getText
no longer needs a temporary interval as parameter, but can directly work with start and stop values.Published by mike-lischke about 1 year ago
Fixed bug #8
Also, releases will no longer be marked as pre-release. They are fine to be used where standard antlr4 and antlr4ts were used before.
Published by mike-lischke about 1 year ago
This release contain mostly internal changes. The antlr4ng-cli tool dependency has been updated to the latest version and build + test processes has been improved (esbuild instead of webpack, Jest instead of Jasmine).
There are also some smaller fixes in Interval
and ParseTreeVisitor
. The latter now has the same implementation as the Java runtime.
Published by mike-lischke about 1 year ago
This release includes a lot of cleanup.
__list()
appendix in their name. Instead method overloading is used now to distinguish between the two cases.getTypedRuleContext
and getTypedRuleContexts
have been renamed to getRuleContext
and getRuleContexts
respectively, just as in the Java runtime._errHandler
-> 'errorHandler,
_input->
inputStream` and more).BitSet
to use less memory.