Exercise: Grammar for arithmetic
Consider simple arithmetic expressions involving addition and multiplication, such as:
3 + 4
3 + 4 * 2
( 3 + 4 ) * 2
Write a CFG over the terminals \(\lbrace +, *, (, ),2,3,4\)} that generates such expressions.
Your grammar should assign more than one phrase structure to ambiguous
expressions like 3 + 4 * 2.