Eliminating Epsilon Production for Left Recursion Elimination

2.3k Views Asked by At

Im following the algorithm for left recursion elimination from a grammar.It says remove the epsilon production if there is any

I have the following grammer

S-->Aa/b

A-->Ac/Sd/∈

I can see after removing the epsilon productions the grammer becomes

  1) S-->Aa/a/b

  2)A-->Ac/Sd/c/d

Im confused where the a/b comes in 1) and c/d comes in 2) Can someone explain this?