A grammar that produces more than one parse tree for the same sentence is…
2025
A grammar that produces more than one parse tree for the same sentence is called:
Answer: B. Ambiguous — A context-free grammar is ambiguous when at least one sentence in its language has more than one parse tree. Equivalently, that sentence can have more than…
- A.
Contiguous
- B.
Ambiguous
- C.
Unambiguous
- D.
Regular
Attempted by 270 students.
Show answer & explanation
Correct answer: B
A context-free grammar is ambiguous when at least one sentence in its language has more than one parse tree. Equivalently, that sentence can have more than one leftmost or rightmost derivation. The question states exactly this condition, so the grammar is called ambiguous.
Loading lesson…