Homework Help Question & Answers

Give an unambiguous grammar for the same language generated by the grammar: <fruit>* : -<yellow» | <red&gt...

Give an unambiguous grammar for the same language generated by the grammar:

<fruit>* : -<yellow» | <red> <yellow» banana |mango | <empty> <red> ::- cherry | apple | <empty>

Same language means that the unambiguous grammar can generate exactly the same set of strings as the ambiguous grammar. No

* : -
0 0
Next > < Previous
ReportAnswer #1

Answer:

Unambiguous grammar for the given ambiguous grammar is as below:

<fruit>* : : = <yellow> | <red> | <empty>

<yellow> : : = banana | mango

<red> : : = cherry | apple

For this grammar, to generate a particular string only one parse tree can be constructed, hence above grammar is unambiguous

Add Homework Help Answer
Add Answer of:
Give an unambiguous grammar for the same language generated by the grammar: <fruit>* : -<yellow» | <red&gt...
Your Answer: Your Name: What's your source?
Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
More Homework Help Questions Additional questions in this topic.
Need Online Homework Help?
Ask a Question
Get FREE EXPERT Answers
WITHIN MINUTES
Related Questions