Consider the following grammar:
A → BC
B → Ba | epsilon
C → bD | epsilon
D → …
…
The problem here is that the rule Bcan also output epsilonleft recursive.
To find FIRST(A), I am looking FIRST(B).
But I'm stuck on FIRST(B)because it is left-recursive.
So what is it FIRST(B)? And FIRST(A)?
My version:
FIRST(B) → {a, epsilon}
FIRST(A) → {a, b, epsilon}
Is it correct?
source
share