You are on page 1of 1

1. What is left recursion? Describe the algorithm used for eliminating left recursion?

2. Eliminate left recursion in the following:


E  E+T|T, T  T*F|F, Fid(E)
3. What is ambiguous grammar? Show that following grammar is ambiguous or not.
A→A+A|A−A|A*A|a
4. What is FIRST and FOLLOW? Explain the steps to compute FIRST and FOLLOW with an
example.
5. Test whether the grammar is LL(1) or not and construct a predictive parsing table for it?
S→AaAb|BaBa|a|b
A→€
b→€
6. Test whether the grammar is LL(1) or not and construct a predictive parsing table for it
S→iEtS|iEtSeS|a E→b
7. Verify whether the following grammar is LL(1) or not?
E  E+T|T, T  T*F|F, F(F)|a|b
8. Construct the LR(0) items for the following grammar:
S→ L=R|R
L→*R|id
R→L
9. Check whether the above grammar is LR(0) grammar or not.
10. Check whether the following grammar is SLR (1) or not. Explain your answer with Reasons.
S→ L=R S→R L→*R L→id R→L.
11. Consider the grammar.
E→E+T E→T T→T*F T→F F → (E) / id
12. Construct CLR parsing table for the above grammar. Give the moves of the CLR parser on id
* id + id.
13. Construct an LALR parsing table for the following grammar:
E→E+T|T T→T*F|F F→ (E) | id

You might also like