119k views
1 vote
Give an example of a left recursive production and explain why such productions would be a problem.

User SSR
by
6.7k points

1 Answer

3 votes

Answer:

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. The Second Restriction Is That The Grammar Must Not Require More Than One Token Look

This problem has been solved!See the answer

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.

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.

User Ivan Baev
by
6.6k points