Eliminate all left recursion (direct and indirect) from the following grammar:

S -> S a | B c | d B -> S e | f

For the following grammar

S -> ( L ) | a L -> S T T -> ε | , L

- Construct the FIRST and FOLLOW sets.
- Construct the predictive parsing table.
- Show (in the style of Figure 4.16, p. 188) the actions of the
predictive parser on input
`((a,a),a)`

.

Is the following grammar LL(1)? Explain how you know. Also, if the grammar is not LL(1), write an LL(1) grammar for the same language.

S -> a | b C C -> S | a d

Course web site: http://www.gustavus.edu/+max/courses/S2006/MCS-388/

Instructor: Max Hailperin <max@gustavus.edu>