Added precedences

master
Sanjar Ahmadov 4 years ago
parent e844793c02
commit 4cd3062255

@ -213,7 +213,6 @@ terminal String RBR;
terminal String ARROW; terminal String ARROW;
terminal String IS; terminal String IS;
/* Returned by the lexer for erroneous tokens. Since it does not appear in /* Returned by the lexer for erroneous tokens. Since it does not appear in
* the grammar, it indicates a syntax error. */ * the grammar, it indicates a syntax error. */
terminal UNRECOGNIZED; terminal UNRECOGNIZED;
@ -231,7 +230,13 @@ non terminal Expr expr, binary_expr;
/* Precedences (lowest to highest) for resolving what would otherwise be /* Precedences (lowest to highest) for resolving what would otherwise be
* ambiguities in the form of shift/reduce conflicts.. */ * ambiguities in the form of shift/reduce conflicts.. */
precedence left PLUS; precedence left OR;
precedence left AND;
precedence left NOT;
precedence nonassoc EQUAL, NEQ, LT, GT, LEQ, GEQ, IS;
precedence left PLUS, MINUS;
precedence left MUL, DIV, MOD;
precedence left DOT, COMMA, LBR, RBR;
/* The start symbol. */ /* The start symbol. */
start with program; start with program;

Loading…
Cancel
Save