Question: Modify the grammar below to add a new operator: A unary minus operator (-) that has precedence higher than any of *, +, or binary
Modify the grammar below to add a new operator: A unary minus operator (-) that has precedence higher than any of *, +, or binary minus.

The questions in this section are based on the grammar given as the following prog -> assign / expr assign->id -expr expr->expr+term / expr-term / term term ->factor | factor * term factor -> (expr) / id / num id->A | B | C num->o/1/2 /3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
