Set Follow
Definition: Let G = (N, T, P, S) be a CFG. For every A Î N, we define the set Follow(A) as
Follow(A) = {a: a Î T, S Þ* xAay, x, y Î (N È T)*}
        È {$: S Þ* xA, x Î (N È T)*}
 Gist:
Follow(A) is the set of all terminals that can come right after A in a sentential form of G
Illustration:
S Þ* xAz
a
y
S
A
 x
 z
Þ* xAay
A
 x
S
S Þ* xA
a Î Follow(A)
$ Î Follow(A)
…
$
28/57