[antlr-interest] Ignoring lexer rules

mzukowski at yci.com mzukowski at yci.com
Wed Oct 23 13:04:17 PDT 2002


That's not the regular antlr way of doing things.  See the documentation on
handling "literals".

Monty

> -----Original Message-----
> From: Paul J. Lucas [mailto:dude at darkfigure.org]
> Sent: Wednesday, October 23, 2002 10:05 AM
> To: antlr-interest at yahoogroups.com
> Subject: [antlr-interest] Ignoring lexer rules
> 
> 
> If I have the following in a lexer:
> 
> 	FOO
> 		: { isFoo() }? "foo"
> 		;
> 
> 	BAR
> 		: ('a'..'z')+
> 		;
> 
> What I want is that if isFoo() is false, then the more 
> generic rule BAR to be used.  Is the above sufficient or must 
> I do something like:
> 
> 	FOO
> 		: { isFoo() }? "foo"
> 		| BAR { $setType( BAR ); }
> 		;
> 
> 	BAR
> 		: ('a'..'z')+
> 		;
> 
> that?
> 
> - Paul
> 
> 
>  
> 
> Your use of Yahoo! Groups is subject to 
> http://docs.yahoo.com/info/terms/ 
> 
> 

 

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



More information about the antlr-interest mailing list