[antlr-interest] Ignoring lexer rules

Paul J. Lucas dude at darkfigure.org
Wed Oct 23 10:05:14 PDT 2002


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/ 



More information about the antlr-interest mailing list