I might not be understanding how you want them both to be binary operators. But what if you have two different tokens for each operator, eg. 'X' and 'X NOT', and treat them as different operators?
--- On Mon, 7/13/09, Jennifer Cooper <[email protected]> wrote: From: Jennifer Cooper <[email protected]> Subject: [antlr-interest] two part operators To: [email protected] Date: Monday, July 13, 2009, 2:35 AM Hi everyone! I've just started using antlr and come upon a problem. T try to make lexer recognize two different operators: OP and OP NOT. I want to treat both of them as binary operators and not to treat NOT as unary operator. My current solution is: op_expr : expr (OP^ not_expr)* ; not_expr : expr | NOT^ expr ; but this one obviously doesn't treat NOT as part of the binary OP NOT operator. Any clues? Cheers, Jennifer -----Inline Attachment Follows----- 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 -~----------~----~----~----~------~----~------~--~---
List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
