expr ::= expr MINUS expr.
expr ::= MINUS expr.
I need to set different associativity for the 2 MINUS tokens. But I can't twice set associativity for MINUS.
%left PLUS MINUS. // + -
%right NOT MINUS. // ! - // error!
expr ::= expr MINUS expr.
expr ::= MINUS expr.
I need to set different associativity for the 2 MINUS tokens. But I can't twice set associativity for MINUS.
%left PLUS MINUS. // + -
%right NOT MINUS. // ! - // error!
Copyright © 2021 Jogjafile Inc.
This is answered in the Lemon documentation, which provide an example of that specific requirement:
The above example assumes you have a token
NOTwhich you have placed in the correct order in your precedence list.