[antlr-interest] lexer doesn't see super constructor & inherited variable
Raphael Reitzig
r_reitzi at cs.uni-kl.de
Mon Jul 21 12:44:20 PDT 2008
Hi Johan!
Do you use Java 6 for compilation? I do not know if it makes a
difference here, but one never knows. I experienced some strange
behaviour trying to compile code with 1.5 that worked perfectly with 6.
Regards
Raphael
PS: Being a Frenchman is no excuse for bad English ;P
PPS: Your English is, at least, good enough for a German *giggle*
"Johan Grande" <johan.grande at crans.org> wrote (Mon Jul 21 20:07:39 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
>
>
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: PGP Digital Signature
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20080721/d6f18b90/attachment.bin
More information about the antlr-interest
mailing list