• Input: G = (N, T, P, S); First(X) & Empty(X) for
every X Î N È T; x = X1X2…Xn, where x Î (N È T)+
• Output: First(X1X2…Xn)
• Method:
• First(X1X2…Xn) := First(X1)
• Apply the following rule until nothing can be
added
to First(X1X2 … Xk-1 Xk …Xn):
• if Empty(Xi) = {e} for all i = 1,…,k-1, where k £ n
then add all
symbols from First(Xk) to First(X1X2…Xn)