This release (along with changes from 0.23.16 and 0.23.15) correct and update the trgen code and templates. There were problems in generating code for some grammars, like grammars-v4/antlr/antlr4, which is the main issue being addressed with this release.
- All the templates were updated, and propagated to the grammars-v4 repo. Some of the updates had to deal with the new antlr-ng tool that will be required eventually by the Antlr4ng runtime. As of version 3.0.16, antlr4ng still has the patched Antlr4 tool .jar for Antlr4ng. But, we now use the new Antlr-ng tool for Antlr4ng runtime. (Eventually, there will be a way to specify which Antlr4 tool generator to use.) Other changes in templates had to do with a rename of an attribute.
- One of the big problems in grammars-v4 is "grammar forking." This is where someone takes a .g4 and replaces all the grammar "actions" in one programming language, like Java, with another, like C#. This is bad practice because we've found that people tend to work in one language and changes in one grammar are not propagated to another. Another type of "grammar forking" is copying one grammar, then changing it to parse a slightly different variant of the original language. This PR adds cross-grammar importing.
<imports>
in a desc.xml is the equivalent to the-lib
command-line option to the Antlr4 tool. An example grammar of its use is the TrapC grammar. I decided to implement the desc.xml this way rather than have a general way (e.g., "Here's a list of parameters to pass to the Antlr4 Tool."), not only because the command-line options between Antlr-ng and the Official Antlr4 Tool are different, but because I need to analyze the grammars specified in the paths. - The trgen tool now outputs a dependency graph for grammars, in order to understand what trgen is doing.
- Updated various Nuget package dependencies.