Recall that in a CFG, an ε-production is a production in which the right-hand side is empty, and a nullable symbol is a variable symbol that generates the empty string.
- Under what conditions is it possible to remove ε-productions from a grammar G? That is, under what conditions can a CFG G' be found such that G' has no ε-productions and L(G') = L(G). You should be able to give both necessary and sufficient conditions.
- If G is the CFG with start symbol S and productions given below, which symbols are nullable in G?
- Show the result of removing ε-productions from this CFG G.
S → aBC | bCD | eE | aA
A → a | aaB
B → ε | bB
C → ε | CD
D → d | dD
E → e | BC