[antlr-interest] Premature lexer matching

Silvain Piree s.piree at enneya.com
Tue Nov 12 21:56:06 PST 2002


> Why does this not do what I want and how can I fix it?

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')+
;

Silvain


 

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



More information about the antlr-interest mailing list