• Input: G = (N, T, P, S) without e-rules
• Output: First(X) for every X Î N È T
• Method:
• for each a Î T: First(a) := {a}
• Apply the following rule until no First set
   can be changed:
• if A ® X1X2…Xn Î P, then add First(X1) to First(A)
Algorithm: First(X)
1) for each a Î T:
    First(a) := {a}
    because a Þ0 a
Illustration:
a Î First(A)
A
X1
X2
…
Xn
2)
a Î First(X1)
… 
a
7/57