Home

A new release of the ANTLR4 grammar parsing service (antlr4-graps) NodeJS module has been published. Besides some bug fixing a big new feature was added: ATN graphs. This is something especially useful for core ANTLR4 developers (target writers or those working directly on ANTLR4) as it generates data about the internal ATN that can be visualized for a better understanding about it's structure (see also the ANTLR4 grammar support extension in vscode for such a visualization).

 Another big feature is that the module now comes with ANTLR4 jars. Yes, plural. There are 2 of them:

  • The typescript target jar, a snapshot jar generated from the antlr4ts repository. This jar can only create .ts files and uses a slightly different ANTLR4 backend.
  • The main ANTLR4 ja, also a snapshot, not the official download, created from the antlr4 repository.

These jars allow antlr4-graps to generate parsers, lexers, listeners and visitors for you. And not only that. The main jar snapshot contains a patch to export serialized ATN data when generating a parser, which can be used to set up interpreters in other target languages than Java. This is the preparation for grammar debugging, planned as one of the next features in antlr4-graps. Unfortunately, the ATN export is not available in the typescript target jar (would require a patch also in the optimized ANTLR4 version created by Sam Harwell).

This code generation also allows to use the full error reporting from ANTLR4. Once done all warnings and errors from the jar will replace the internally collected diagnostics and will hence will give you also informations about problems which require a detailed semantic analysis (something a bit too much for antlr4-graps).