I read a lot in the antlr4 doc on github and I kind of understood how it works. The thing is I am not a pro java coder, I am trying to use antlr4 with python.
Anyway I reached a deadend on the step to execute this
antlr4 -Dlanguage=Python2 Hello.g4
I downloaded the antlr4 complete.jar but I don't know how to setup or use it. so any help?
I found the -jar paramater easiest to use, so my command line (in a batch file) looks so:
set LOCATION=antlr4-4.5.4-SNAPSHOT.jar
java -jar %LOCATION% -Dlanguage=Cpp -listener -visitor -o generated/ -package antlrcpptest TLexer.g4 TParser.g4
taken from the C++ ANTLR runtime demo. You don't need to change your classpath, nor have to add any environment variables (or doskeys).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With