I'm following the algorithm for left recursion elimination from a grammar. It says remove the epsilon production if there is any.I have the grammar$\qquad S \to Aa \mid b$$\qquad A \to Ac \mid Sd \mid \varepsilon$I can see after removing the epsilon productions the grammer becomes$\qquad S \to Aa \mid a \mid b$$\qquad A \to Ac \mid Sd \mid c \mid d$ I'm confused where the $a \mid b$ for $S$ and $c \mid d$ for $A$ come from.Can someone explain this?
Eliminating $\varepsilon$-productions during elimination of left recursion
context free;formal grammars;compilers;left recursion