I am having difficulty coming up with an example of a left recursive production and why a grammar must not require more than one token look ahead.
I am having difficulty coming up with an example of a left recursive
production and why a grammar must not require more than one token look ahead.
I understand that Left recursive has a nonterminal that can be expanded through productions into a string of symbols in which the left most symbol is the same nonterminal but I need a little more help with explaining and showing examples.
Following is the question:
There are two restrictions on the type of grammars that can be used with a recursive descent parser. The first is that the grammar cannot have any left recursive productions. Give an example of a left recursive production and explain why such productions would be a problem.
Need assignment help for this question?
If you need assistance with writing your essay, we are ready to help you!
OUR PROCESS
Order
Payment
Writing
Delivery
Why Choose Us: Cost-efficiency, Plagiarism free, Money Back Guarantee, On-time Delivery, Total Сonfidentiality, 24/7 Support, 100% originality
The second restriction is that the grammar must not require more than one token look ahead. Give an example of a production that does not have this property. Explain why this restriction is necessary for recursive descent parsing.