Set
Predict
Definition:
Let
G
= (
N
,
T
,
P
,
S
) be a CFG. For
every
A
®
x
Î
P
, we define
Predict
(
A
®
x
)
so that
·
if
Empty
(
x
) = {
e
}
then
Predict
(
A
®
x
) =
First
(
x
)
È
Follow
(
A
)
·
if
Empty
(
x
) =
Æ
then
Predict
(
A
®
x
) =
First
(
x
)
Gist:
Predict
(
A
®
x
) is the set of all terminals that
can begin a string obtained by a derivation
started
by using
A
®
x
.
34/57