[antlr-interest] AntLR grammar problems.

Terence Parr parrt at cs.usfca.edu
Fri Mar 26 11:47:55 PST 2004


On Mar 26, 2004, at 8:16 AM, Bharath S wrote:

> Hi Ter,
>
> I am not running my antlr project on CVS yet. So its

Well, something (not ANTLR and not Java) is telling you something about 
it being out of sync.  This would explain how two grammar files could 
be out of date.  The token types need to be the same across lexer and 
parser so that 32 means the same token in each, for example.

Ter

> not a revision control issue. Does token disconnect
> mean that I am referring to the token wrongly in my
> parser? (For eg, defining a token called INT and
> trying to parse INTEGER, which has not been defined?)
>
> Please let me know. Another funny observation is that,
> when I have my lex rule as
> ---------------------------------------------------
> IDENTIFIER options{testLiterals=true;}:
> ('_'(LETTER|INT))|(LETTER'_'LETTER);
> ---------------------------------------------------
> it works. But if i change the (LETTER'_'LETTER) in the
> above rule to just (LETTER)+, it says "expecting
> identifier, found "abcd"; LETTER: ('0'..'9'); by the
> way.
>
> Thanks.
>
> --- Terence Parr <parrt at cs.usfca.edu> wrote:
>>
>> On Mar 25, 2004, at 12:23 PM, Bharath S wrote:
>>> This happened earlier but the mistake disappeared
>> by
>>> itself. Also, when i try delete the lexer so that
>> i
>>> would recreate the lexer instead of overwriting
>> it, it
>>> often says "OUT OF SYNC WITH THE SYSTEM".
>>
>> Hi. :)  To start with it sounds like you have a
>> revision control issue.
>>
>> Then for your grammar, you probably have a token
>> type disconnect
>> between lexer and parser.
>>
>> Ter
>> --
>> Professor Comp. Sci., University of San Francisco
>> Creator, ANTLR Parser Generator,
>> http://www.antlr.org
>> Cofounder, http://www.jguru.com
>> Cofounder, http://www.knowspam.net enjoy email
>> again!
>> Cofounder, http://www.peerscope.com pure link
>> sharing
>>
>>
>>
>>
>>
>>
>> Yahoo! Groups Links
>>
>>
>>      antlr-interest-unsubscribe at yahoogroups.com
>>
>>
>>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Finance Tax Center - File online. File on time.
> http://taxes.yahoo.com/filing.html
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
--
Professor Comp. Sci., University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Cofounder, http://www.jguru.com
Cofounder, http://www.knowspam.net enjoy email again!
Cofounder, http://www.peerscope.com pure link sharing





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list