Open laeubi opened 5 years ago
Never had to compile the grammar before. Using the maven plugin didn't work for me at all. However, using antlr2 directly from command-line worked:
runantlr -o target/generated-sources/antlr/org/jcamp/parser src/main/antlr/ASDFLexer.g
runantlr -o target/generated-sources/antlr/org/jcamp/parser src/main/antlr/ASDFParser.g
NB: You will end up with duplicate classes, namely ASDFLexer
, ASDFLexerTokenTypes
, ASDFParser
, ASDFParserTokenTypes
. The original authors must have moved these classes manually into src/main/java
.
Yeah my goal was to configure the plugin so it places the classes into src/main/generated or something and remove them from src/main/java and let them compile on every run. Do you think it is worth to try upgrading the antlr plugin to antlr4?
I also noticed that antlr seem to generate the required source into the directory (in fact it is only a warning) but since the build is marked as a failure this does not help much. Do you get any warnings on the commandline? What version of antlr are you using?
I get the same warnings like you do. However, I don't consider warnings a failure. ;-)
For these kind of things I like to treat warnings as errors :-)
Because exactly the ASDF is causing problems here #3 with parsing failed expecting EOL, found '-7'
and the parser complains about an nondeterminism of k==1:'+','-','0'..'9'
and k==2:<end-of-token>,'0'..'9'
Running mvn antlr:generate produce the following output: