Jennifer Cooper wrote:
You have not really explained anything about what you want to achieve, but at a guess you want this: tokens { OP_NOT; } op_expr : expr (op_or_not^ expr)* ; op_or_not : OP ( NOT -> OP_NOT[OP] | -> OP ) ; However, it is just as easy to deal with the optional presence of NOT I would think, unless there is some definite difference between operators with trailing NOT. Hence perhaps you are looking at the problem incorrectly? I don't know of any language where what you are ding makes sense. Perhaps your operators are not specified correctly in the lexer? OP : '+'; OP_NOT: '+!' ; Hope that helps but you really need to supply comprehensive information for anyone to give you a definitive answer on this one. Jim --~--~---------~--~----~------------~-------~--~----~ 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
