Construction of LR Table:
Items
20/42
Definition:
Let G = (N, T, P, S) be a CFG,
A ® x Î P, x =
yz. Then, A ® y·z is
an item.
Example: Consider E ® E+T
All items
for E ® E+T
are:
E ® ·E+T, E ® E·+T, E ® E+·T, E ® E+T·
Gist: Item is a rule of CFG with · in the right
side of rule.
Meaning: A ® y·z means that if
y appears on the pushdown
top and a prefix of the input is eventually reduced to z, then yz (=
x) as a handle can be
reduced to A according to
A ® x.