Question

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
Add a comment Improve this question Transcribed image text
Answer #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 a comment
Know the answer?
Add Answer to:
Give an unambiguous grammar for the same language generated by the grammar: <fruit>* : -<yellow» | <red&gt...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Read about Cokes strategy in Africa in the article below and discuss the ethics of selling...

    Read about Cokes strategy in Africa in the article below and discuss the ethics of selling soft drinks to very poor people. Is this an issue that a company like Coke should consider? Africa: Coke's Last Frontier Sales are flat in developed countries. For Coke to keep growing, Africa is it By Duane Stanford Piles of trash are burning outside the Mamakamau Shop in Uthiru, a suburb of Nairobi, Kenya. Sewage trickles by in an open trench. Across the street,...

  • How can we assess whether a project is a success or a failure? This case presents...

    How can we assess whether a project is a success or a failure? This case presents two phases of a large business transformation project involving the implementation of an ERP system with the aim of creating an integrated company. The case illustrates some of the challenges associated with integration. It also presents the obstacles facing companies that undertake projects involving large information technology projects. Bombardier and Its Environment Joseph-Armand Bombardier was 15 years old when he built his first snowmobile...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT