5 questions to test your understanding
The grammar E → E + E | E × E | a is used to parse 'a + a × a.' A parser produces two different parse trees for this string. What is the correct conclusion?
What is the key difference between 'an ambiguous grammar' and 'an inherently ambiguous language'?
A leftmost derivation and a rightmost derivation of the same string can correspond to the same parse tree, because the parse tree captures structural relationships rather than the sequence of rule applications.
If a grammar is ambiguous, it is extremely difficult to generate an unambiguous grammar for the same language.
Why does ambiguity in a grammar matter for compilers and programming languages? What goes wrong if an ambiguous grammar is used?