Antlr-4.10.1-complete.jar

0 views
Skip to first unread message

Arabella Kochanski

unread,
Aug 4, 2024, 2:44:00 PM8/4/24
to creattovecor
Firstrun main.go in the project root directory, convert PostgreSQLLexer.g4 and PostgreSQLParser.g4 into a formsuitable for Golang, the converted directory is stored in other directories, and the default is stored in the projectroot directory Golang directory under .

The original g4 file is compatible with Java and C#, but some features of Java and C# cannot be adapted in Golang. Forexample, in the member method of a class in Java, this can be omitted to call the same class or parent class. method,but not in Golang, you must manually specify the receiver, and other problems such as package paths in golang aredifferent from other languages, but you don't want to change the original g4 file, because once Changing g4 cannotguarantee the correctness of Java and C#. It is very stressful to ensure support for so many languages ine the single g4file, so I chose to perform it based on the characteristics of golang based on the original file. Tweaked the generatednew file so that it could adapt to Golang's syntax


Then use antlr-4.10.1-complete.jar to generate the corresponding code from the converted lexical file and grammarfile. The name of the jar package may be different in different versions, please replace it with your own version.

3a8082e126
Reply all
Reply to author
Forward
0 new messages