• if A ® X1X2 … Xk-1Xk …Xn Î P then
Previous Algorithm: Illustration
1) for each a Î T: First(a) := {a} because a Þ0 a
2) for each A Î N: First(A) := Æ (inicialization)
 e
a Î First(Xk)
a Î First(A)
e
e
e
…
3b) if Empty(Xi) = {e} for all i = 1,…, k-1, where k < n
      then add all symbols from First(Xk) to First(A):
A
X1
X2
Xk-1
…
Xn
Xk
…
3b:
3) Apply the following rules until no First set or Empty
    set can be changed:
… 
a
21/57
a Î First(Xk)
a Î First(A)
… 
a
3a:
A
X1
X2
…
Xn
3a) add all symbols from First(X1) to First(A)