To test class generation from command line, go to antlr installation directory containing $ANTLR_HOME
- antlr-4.7.2-complete.jar
- antlr4.bat
- grun.bat
Then rely on resource found [here|]
- Copy to $ANTLR_HOME grammar files PlSqlLexer.g4 and PlSqlParser.g4
- Copy to $ANTLR_HOME Lexer and Parser Java classes from here
- Run
antlr4 PlSqlLexer.g4 java org.antlr.v4.Tool PlSqlLexer.g4 antlr4 PlSqlParser.g4 java org.antlr.v4.Tool PlSqlParser.g4 javac Pl*.java
Then you can test via
grun PlSql r -tree
or grun PlSql r -gui
It prompts you for an input you can enter as follows
java org.antlr.v4.gui.TestRig PlSql r -gui
SELECT FIELD1 FROM TABLE1;
^Z