[antlr-interest] lexer doesn't see super constructor & inherited variable

Johan Grande johan.grande at crans.org
Mon Jul 21 11:07:39 PDT 2008


Hello,


I'm working on generating ASTs for the Java (v1.5) language using ANTLR 
(v3.1b2) and the grammar written by Terence Parr (v1.0.6).

I get a strange error during the compilation of the generated lexer. 
(ANTLR itself gives no error). Javac outputs a lot of errors.

The first is :
| [...]/JavaLexer.java:325: cannot find symbol
| symbol  : constructor 
Lexer(org.antlr.runtime.CharStream,org.antlr.runtime.RecognizerSharedState)
| location: class org.antlr.runtime.Lexer
|         super(input,state);
|         ^

And all the following look like the second :
| [...]/JavaLexer.java:343: cannot find symbol
| symbol  : variable state
| location: class parser.JavaLexer
|             state.type = _type;
|             ^

I think my CLASSPATH is good : it contains the JARs of ANTLR v3.1b2 and 
of no other ANTLR version.

I verified : the generated lexer imports org.antlr.runtime.* .
I even verified : constructor and the "state" variable do exist in the 
inherited classes.

I'm not an expert in Java programming, and I don't see from where the 
problem can come. Any idea ?


Sorry for English mistakes (I'm French),
Thank you for your help,
Johan Grande



More information about the antlr-interest mailing list