How to create an ANTLR code generation target

Is there a version of ANTLR4 "How to create an ANTLR code generation target". I know there is a version of ANTLR3, but it seems to be out of date.

+4
source share
1 answer

The only real resource at the moment is storage for ANTLR 4 C # target . It includes the document Creating Target Objects , but it is not updated, and some sections (in particular, the Release Structure) are incorrect. The Git story for the project shows how I implemented the C # goal, starting with the Java runtime.

You should note the following:

  • Despite removing the AST and StringTemplate functions from the ANTLR runtime, the ANTLR 4 runtime is very complicated due to the addition of the ALL (*) parsing algorithm. You must be well versed in data structures, concurrent programming, Java code semantics, and target language semantics / libraries before attempting to create an ANTLR 4 target.
  • Creating and maintaining a C # target is extremely simplified by using a modified version of Sharpen to automate much of Java-to-C #.
+4
source

Source: https://habr.com/ru/post/1492973/


All Articles