
Syntax Analyzer 107
Now we have to consider what follows A in the sentential form if we take transition from state 1
to state 4. This qualified FOLLOW() we write as FOLLOW(1, A) = {d} = LA(3, A → e). As
FOLLOW(1, A) = {d} ∩ {c} = ∅, so if we take a look-ahead of 1 symbol and see ‘d’ after ‘e’, we
can reduce ‘e’ to A; otherwise, we should shift on ‘c’.
C
1
ec
d
A
reduce
C
4
(C
3
) (C
7
)
The technique we have just illustrated is known as look-ahead LR(1) or LALR(1) technique, which
is discussed more fully in the next sections.
4.3.10 Conflict Situations
Consider another example grammar:
0. S −> G # 4. E −> E + T
1. G −> E = E 5. T −> f
2. G −> f 6. T ...