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.21, p. 228) 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