Java Reference
In-Depth Information
Parse
Action
Remaining
Stack
Input
S
abbdc$
Apply 1: S
→
AC$
$CA
abbdc$
Apply 4: A
→
aBCd
$CdCBa
abbdc$
Match
$CdCB
bbdc$
Apply 6: B
→
bB
$CdCBb
bbdc$
Match
$CdCB
bdc$
Apply 6: B
→
bB
$CdCBb
bdc$
Match
$CdCB
dc$
Apply 7: B
→λ
$CdC
dc$
Apply 3: C
→λ
$Cd
dc$
Match
$C
c$
Apply 2: C
→
c
$c
c$
Match
$
$
Accept
Figure 5.11: Tr a c e o f an LL (1) parse. The stack is shown in the left
column, with top-of-stack as the rightmost character. The
input string is shown in the right column, processed from left
to right.