Determine whether the following grammar is an ll grammar by


Part 1-

Answer this question with examples

• 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.
--------------------------------------

Part 2

1. Determine whether the following grammar is an LL grammar by performing the pairwise disjointness test, showing the FIRST sets of each RHS of each nonterminal:
A -> aAb | bBB
B -> aB | bA | Cc
C -> aaB | c | caB
In the above productions upper case letters are nonterminals and lower case letters are terminal symbols.
2. Write a Java method that perform a recursive descent parse of the following production:
-> FOR ID = TO DO
-------------------------
Part 3 - Ask one question related to chapter or homework

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Determine whether the following grammar is an ll grammar by
Reference No:- TGS01219647

Expected delivery within 24 Hours