| <expr> * <expr> | ( <expr> ) | <id> 2nd Ambiguous Grammar Example Grammar Solution(s) for: 3 + 4 * 5 E E + E → E E * E → (left most - right most) E i → Derviation => E => E => E E => E E + * => E => E E E 3 + + * => E E => E E + + 3 * 3 * => E => E + + 3 4 * 3 4 * => => + + 3 4 * 5 3 4 * 5 3rd Ambiguous Grammar Example Grammar Solution(s) for: const – const / const <expr> <expr> <op> <expr> | const (left most - right most) <op> / | - if the Grammar is ambiguous there are some notable things to avoid not defining operator precedence further explained below, but you already know this have the SAME abstraction in a rule more than one Anything ambiguous can be re-written
| <expr> * <expr> | ( <expr> ) | <id> 2nd Ambiguous Grammar Example Grammar Solution(s) for: 3 + 4 * 5 E → E + E E → E * E E → i (left most - right most) Derviation => E => E + E => 3 + E => 3 + E * E => 3 + 4 * E => 3 + 4 * 5 => E => E * E => E + E * E => 3 + E * E => 3 + 4 * E => 3 + 4 * 5 3rd Ambiguous Grammar Example Grammar Solution(s) for: const – const / const <expr> <expr> <op> <expr> | const <op> / | - (left most - right most) if the Grammar is ambiguous there are some notable things to avoid not defining operator precedence further explained below, but you already know this have the SAME abstraction in a rule more than one Anything ambiguous can be re-written
GrammarsAndParseTrees(Syntax).docx