Factorization
A
x
y
1
A
x
y
n
…
A
x
y
1
x
y
n
…
A
’
A
’
Example:
<stat>
®
write
id
<stat>
®
write
int
Illustration:
Idea:
Replace rule
s
of the form
A
®
x
y
1
,
A
®
x
y
2
,
…
,
A
®
x
y
n
with
A
®
x
A
’
,
A
’
®
y
1
,
A
’
®
y
2
,
…
,
A
’
®
y
n
,
where
A
’
is a new nonterminal
A
<stat>
®
write
<item>
<item>
®
id
<item>
®
int
12/57