[antlr-interest] ANSI C grammar for ANTLR v3: compilation problem with versions higer than 3.0.1

Tired Ofsubscriptions vsubscr at gmail.com
Tue Jul 8 04:31:54 PDT 2008


Ok, I found that channel should be change to $channel in the grammar, but
the main problem was caused by my mistake in Makefile, which add an old
version of ANTLR to classpath at later stages.

Thanks!
Vlad

2008/7/8 Johannes Luber <jaluber at gmx.de>:

> Tired Ofsubscriptions schrieb:
>
>> Hi!
>>
>> I am trying to compile **ANSI C grammar for ANTLR v3* <
>> http://www.antlr.org/grammar/1153358328744/c.g>* with newer versions (>
>> 3.0.1) of ANTLR.
>>
>> There is a problem in the generated lexer file when I compile my user
>> program:
>> ==============================
>> ===========
>> CParserLexer.java:2942: cannot find symbol
>> symbol  : variable channel
>> location: class CParserLexer
>>            channel=99;
>>            ^
>> CParserLexer.java:3003: cannot find symbol
>> symbol  : variable channel
>> location: class CParserLexer
>>            channel=99;
>>            ^
>> CParserLexer.java:3077: cannot find symbol
>> symbol  : variable channel
>> location: class CParserLexer
>>            channel=99;
>>            ^
>> CParserLexer.java:3150: cannot find symbol
>> symbol  : variable channel
>> location: class CParserLexer
>>            channel=99;
>>            ^
>> =========================================
>> I tried it with versions antlr-3.1b1 and antlr-2008-06-26.17.
>>
>> Should I change something in the grammar file to adapt it to newer version
>> or is it a bug in the antlr code?
>>
>> Thanks for help,
>> Vlad
>>
>
> channel has been moved into a RecognizerSharedState object. I believe this
> object is called state, but I'm not sure about this. Effectively, you have
> change channel into state.channel.
>
> Johannes
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080708/ddb4e03c/attachment.html 


More information about the antlr-interest mailing list