1. Assume the following rules of associativity and precedence for expressions:
Precedence
Highest *,
/, not
+ , - , &, mod
- (unary)
= , / = , 6 , 6 = , 7 = , 7
and
Lowest
or,
xor
Associativity
Left to right
Assume the only operands are the names a,b,c,d, and e. Write a BNF description of the precedence and associativity rules defined for such expressions.
Assume the following rules of associativity and precedence for expressions:
Precedence-
Highest:
*,/, not
+ , - , &, mod
-(unary)
=,/=,<,<=, >=, >
and
Lowest:
or, xor
Associativity-
Left to right
Show the order of evaluation of the following expressions by parenthe sizing all subexpressions and placing a superscript on the right parenthesis sis to indicate order. For example, for the expression
a + b * c + d
the order of evaluation would be represented as
((a + (b * c)')? + d)
Get Answers For Free
Most questions answered within 1 hours.