Page 1 of 1

Assume the conflicts part (a) of this question are resolved and an LALR (1) parser is generated for parsing arithmetic e

Posted: Thu Jul 14, 2022 9:07 am
by answerhappygod
E -> number Eval number val
E E .val E .VAL E .val
E # E E .val E .VAL E .val
;
a) Equal precedence and left associativity; expression is evaluated to 7
b) Equal precedence and right associativity, expression is evaluated to 9
c) Precedence of ‘x’ is higher than that of ‘+’, and both operators are left associative; expression is evaluated to 7
d) Precedence of ‘ # ‘ is higher than that of ‘#’, and both operators are left associative; expression is evaluated to 9