[antlr-interest] Re: Premature lexer matching

Paul J. Lucas dude at darkfigure.org
Wed Nov 13 10:23:10 PST 2002


--- In antlr-interest at y..., "Silvain Piree" <s.piree at e...> wrote:
> You should merge rules FOO and BAR, e.g.
> 
> FOO
> : ("foo" "::") => "foo" { $setType( FOO_1 ); }
> | ("foo" '(') => "foo" { $setType( FOO_2 ); }
> | BAR { $setType( BAR ); }
> ;
> 
> private BAR
> : ('a'..'z')+
> ;

But BAR is a valid token in the grammar; hence it can not be private.

- Paul


 

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



More information about the antlr-interest mailing list