[antlr-interest] AntLR grammar problems.

Bharath S payasam79 at yahoo.com
Fri Mar 26 08:16:03 PST 2004


Hi Ter,

I am not running my antlr project on CVS yet. So its
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

<*> 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