[antlr-interest] Syntactic predicate for single alternatives
prashant.deva at gmail.com
Wed Jan 11 20:43:40 PST 2006
> At the program rule I think statement2 is an alternative to statement1 in
> the following construct: (statement1)* statement2
No, statement2 is not an alternative in this case. It just follows
statement1. Which is why you get the syntactic predicate ignored warning,
cause there is no need for it.
To make statement2 an alternative, write the rule like this -
(DO THIS)=> (statement1)*
Notice the '|' operator which separates 2 alternatives.
Creator, ANTLR Studio
Founder, Placid Systems, www.placidsystems.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the antlr-interest