antlr4ng

Next Generation TypeScript runtime for ANTLR4

OTHER License

Downloads
241.8K
Stars
71
antlr4ng - New point release Latest Release

Published by mike-lischke 7 months ago

  • Fixed visitor example in this readme file and added build instructions.
  • Added back all debug output in the simulators and the prediction context. Useful for finding low level problems.
  • Fixed bug #47 Antlr4ng fails to parse codeql/examples/alias.qll
  • Fixed bug #46 ParserRulecontext.parent() incorrectly typed
antlr4ng - New point release

Published by mike-lischke 8 months ago

  • Had to make Lexer.modeStack public again and allow reading and writing the current lexer mode.
  • Also fixed a number of spelling errors.
antlr4ng - New major release

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.

antlr4ng - New major release CLI

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:

  • Renamed class members (_type -> type, _channel -> channel, _mode -> mode, _parseListeners -> parseListeners).
  • Specialized getText methods for the token stream, to avoid frequent parameter checking in method overloading.
  • Merged the class RuleContext into ParserRuleContext. It's not used anywhere else, so why keeping it around?
  • ParserRuleContext.exception has been removed and it is no longer set in generated code (only relevant for error conditions, where a proper exception is passed to error listeners.
  • More non-null assertions and null-safety checks have been added (mostly relevant for local rule variables and return values).
antlr4ng - v2.0.11

Published by mike-lischke 8 months ago

  • Fixed bug #30 ReferenceError: Super constructor may only be called once
  • The entire runtime test library from the Java runtime has now been ported to TypeScript and is used from now on to check the correctness of this runtime.
  • The bit set class used bigint to store the values, which is a problem with bundlers like webpack that have no support for bigint. For this reason that type has been replaced (PR #40 feat: replace bigint and BigUint64Array).
  • The bundle is no longer minified and hence larger than before. Bundling a minfied bundle with other bundlers (like terser) in dependent projects might cause trouble. Additionally, minifying a bundle has no benefit in execution time, it's just a size difference (related bugs: #31, #34, #38).
antlr4ng - New point release

Published by mike-lischke 9 months ago

  • Fix bug #26 getRuleContext is incompatible with generated code (2.0.5)
  • Fixed ProfilingATNSimulator code.
  • Made Token constants explicitly to number, to avoid TSC narrowing them.
antlr4ng - New point release

Published by mike-lischke 9 months ago

  • Added exports for the profiling classes.
  • Reverted some changes that failed the Java runtime tests.
antlr4ng - New point release

Published by mike-lischke 9 months ago

  • Added RuleContext.toStringTree overload.
  • Added an InterpreterDataReader implementation (copied from the vscode-antlr4 extension).
  • Benchmark values listed here are now computed from 5 runs, instead just one.
  • Added RuleContext.toStringTree() overload.
antlr4ng - New point release

Published by mike-lischke 9 months ago

  • Optimizations in HashMap and HashSet (from Peter van Gulik). This can have dramatic speed improvements, depending on the grammar. In the unit tests this shows mostly by a faster cold start.
  • Added CommonJS builds back. Especially when running unit tests using Node.js a CommonJS variant is simpler to handle.
  • Added clearDFA() methods in the simulators.
antlr4ng - New point release

Published by mike-lischke 10 months ago

  • Profiler port (from backspace [email protected])
  • Changed context getters in ParserRuleContext for retrieving sub contexts to accept any constructor parameter, for more flexibility.
antlr4ng - New point release

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.

antlr4ng - New point release

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.
  • ParserRuleContext.getChild now accepts any constructor type.
antlr4ng - New point release

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:

  • Removed last reference to a Node.js specific type (Buffer), which avoids the automatic reference to the Node.js typings and an "resolution-mode" assertion for "require" (CommonJS).
  • The tool now produces optional attributes in rule contexts. For example such a rule:
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.

antlr4ng - New point release

Published by mike-lischke 12 months ago

  • There are changes in the package content (typings are now in the dist folder too, instead of source).
  • There are now index.ts files in every folder and used for the final export index.ts. This makes it easier to see if something is missing and to include new or renamed files.
  • And there are some build changes/fixes as preparation for profiling the runtime.
antlr4ng - New major release

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.

antlr4ng - New point release of the tool generator

Published by mike-lischke 12 months ago

Code generation changes:

  • More locations where the override keyword is needed in generated classes.
  • ParserRuleContext._ctx was renamed to ParserRuleContext.context in the runtime.
  • Optional null result for listener/walker methods.
  • TokenStream.getText no longer needs a temporary interval as parameter, but can directly work with start and stop values.
antlr4ng - New Point Release

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.

antlr4ng - New Point Release

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.

antlr4ng - New Minor Release

Published by mike-lischke about 1 year ago

This release includes a lot of cleanup.

  • Generated parser rules that can appear as either returning a single parse context or a list of that no longer use the __list() appendix in their name. Instead method overloading is used now to distinguish between the two cases.
  • The members getTypedRuleContext and getTypedRuleContexts have been renamed to getRuleContext and getRuleContexts respectively, just as in the Java runtime.
  • There are more renames (_errHandler -> 'errorHandler, _input->inputStream` and more).
  • The package has been stripped down to just a single bundle file. This is an ESM module now, so it can be used in both, node and browser environments. No differentiation is made anymore between the two.
  • The internal folder structure has been changed to match the Java runtime.
  • Extended some classes, added new type definitions and exported some more classes.
  • Improved BitSet to use less memory.
antlr4ng -

Published by mike-lischke about 1 year ago

This release contains a number of bug fixes that show up only under certain circumstances (manual token creation, XPath use).