[antlr-interest] lexer rule precedence

Ryan Brown ribrdb at google.com
Fri Mar 18 20:14:47 PDT 2011


I have a lexer with rules like this:

TRUE : 'true';
IDENTIFIER : 'a'..'z'+;

The text "true" parses as IDENTIFIER.  How do I get it to parse as TRUE? Do
I need to add not and all my keywords to the IDENTIFIER rule? I don't see
anything like that in the java grammar.

-- Ryan Brown


More information about the antlr-interest mailing list