At 16:27 21/08/2009, Elnur Cabarov wrote:
>And when I change literals to lexer rules I get:
>The following token definitions can never be matched because 
>prior tokens match the same input: IMPORT,STATIC

Well, as the error message indicates, you need to re-order your 
lexer rules.

In case of ambiguity, ANTLR's lexer will generally choose the 
longest match; failing that it will pick whichever rule is listed 
first.

Most likely in this case there is a conflict between your 
IMPORT/STATIC rules and some kind of identifier rule.  Since the 
identifier rule is more generic, ensure that it is listed after 
the IMPORT/STATIC rules, which are more specific.  (This applies 
in other cases too -- the most generic lexer rule should be the 
last one.)


List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to