[antlr-interest] Java parser not compiling

Robin diabeteman at gmail.com
Thu Mar 15 05:19:39 PDT 2012


Hello list,

I'm trying to use this grammar
http://www.antlr.org/grammar/1207932239307/Java1_5Grammars with antlr-3.4

The grammar compiles into java classes without problems:

$ java -cp /c/integ/antlr/antlr-3.4-complete.jar org.antlr.Tool Java.g
$ ls -l *.java
-rw-r--r--    1 S0030382 Administ     159k Mar 15 11:15 JavaLexer.java
-rw-r--r--    1 S0030382 Administ     1.0M Mar 15 11:15 JavaParser.java


But the generated parser has compile errors:

$ javac -cp antlr-3.4-complete.jar JavaParser.java
JavaParser.java:23842: illegal start of expression
        void  =null;
        ^
1 error


I guess the grammar must be updated in order to work with antlr 3.4.

Can you tell me what must be done?

Thanks in advance :)
Robin


More information about the antlr-interest mailing list