Java Reference
In-Depth Information
State 0
Goto
State 1
Goto
Start→•E $
3
E→T •
T→T • times num
E
→•
EplusT
3
7
E
→•
T
1
T
→•
Ttimesnum
1
T
→•
num
2
State 2
Goto
State 3
Goto
T
→
num
•
Start
→
E
•
$
5
E
→
E
•
plus T
4
State 4
Goto
State 5
Goto
E
→
Eplus
•
T
6
Start
→
E $
•
T
→•
Ttimesnum
6
T
→•
num
2
State 6
Goto
State 7
Goto
E
→
EplusT
•
T
→
Ttimes
•
num
8
T
→
T
•
times num
7
State 8
Goto
T→Ttimesnum•
0
Initial Configuration
Eplusnumtimesnum$
3
0
shift E
plus num times num $
plus
4
3
0
shift plus
num times num $
plus
4
3
nu
2
0
shift num
times num $
plus
4
3
0
Reduce num to T
Ttimesnum$
plus
4
3
6
0
shift T
times num $
Figure 6.22: LR(0) construction and parse leading to inadequate
State 6.