|
|
E -> E + T | T, T -> T * F | F, F -> (E) | Atom,where
Atom is a variable that derives operands with no + or * or parentheses.
Extend this context-free grammar to cover a new operator @ that has higher precedence than * and that has the property that x @ y @ z is interpreted as x @ (y @ z) and not as (x @ y) @z. You needn't give any rules for the variable Atom.
Extra credit (2 points): Can you think of a mathematical operator that should behave this way?