On Fri, Aug 26, 2011 at 1:40 PM, Adam Adamski <[email protected]>wrote:
> Dear all ANTLR users, > Hi Adam, Is it a mistake to use variable like I used? I mean: > > rule: > IDN typ=(type1|type2|typ3) > ; > Yes, you can't do that. Try this instead: rule : (ARRAY_OF)* intermediate -> ^(TYPE ^(ARRAY_OFLIST ARRAY_OF*) intermediate) ; intermediate : simpleType | systemType | objectType ; > My final question: is it wrong to use same var name for many rules ? I > used variable 'typ' in 4 rules. (I don't think It cause the problem, but > I'm not sure) No, there's nothing wrong with that. Regards, Bart. 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.
