What is an ambiguous grammar?
20 views
- A grammar that generates multiple parse trees for the same sentence (Correct Answer)
- A grammar that generates only one parse tree for each sentence
- A grammar that generates only regular languages
- None of the above
Explanation
Answer: a) A grammar that generates multiple parse trees for the same sentence.
Explanation: An ambiguous grammar is a context-free grammar that generates multiple parse trees for the same sentence. This can lead to ambiguity in the interpretation of the sentence, as different parse trees may correspond to different meanings.