On Feb 8, 2009, at 2:48 AM, Vitaliy wrote:
> root                        : statements EOF;
> statements            : (statement)+;
> statement             : label
>                                   | keyword
>                                   | variable
>                                   ;
>
> identifier               : Identifier;
> label                       : identifier COLON;
> keyword                : KEYWORD (identifier)?;
> variable                 : identifier;


"keyword label:" will always match rule keyword and then fail.  ANTLR  
will match greedily because you told it to shut up and backtrack.   
It's hiding the warning that identifier can match now or later (during  
statements loop).

Ter
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

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

Reply via email to