1 exp: . exp OP exp
2 | . NUM
- NUM shift, and go to state 1
-
- exp go to state 2
+ NUM shift, and go to state 1
+ exp go to state 2
state 1
2 exp: NUM .
- $default reduce using rule 2 (exp)
-
+ $default reduce using rule 2 (exp)
state 2
0 $axiom: exp . $
1 exp: exp . OP exp
- $ shift, and go to state 3
- OP shift, and go to state 4
-
+ $ shift, and go to state 3
+ OP shift, and go to state 4
state 3
1 | exp OP . exp
2 | . NUM
- NUM shift, and go to state 1
-
- exp go to state 5
+ NUM shift, and go to state 1
+ exp go to state 5
state 5
1 exp: exp . OP exp [$, OP]
1 | exp OP exp . [$, OP]
- OP shift, and go to state 4
-
- OP [reduce using rule 1 (exp)]
- $default reduce using rule 1 (exp)
-
-
+ OP shift, and go to state 4
+ OP [reduce using rule 1 (exp)]
+ $default reduce using rule 1 (exp)
]])
AT_CLEANUP
1 exp: . exp OP exp
2 | . NUM
- NUM shift, and go to state 1
-
- exp go to state 2
+ NUM shift, and go to state 1
+ exp go to state 2
state 1
2 exp: NUM .
- $default reduce using rule 2 (exp)
-
+ $default reduce using rule 2 (exp)
state 2
0 $axiom: exp . $
1 exp: exp . OP exp
- $ shift, and go to state 3
- OP shift, and go to state 4
-
+ $ shift, and go to state 3
+ OP shift, and go to state 4
state 3
1 | exp OP . exp
2 | . NUM
- NUM shift, and go to state 1
-
- exp go to state 5
+ NUM shift, and go to state 1
+ exp go to state 5
state 5
1 exp: exp . OP exp [$, OP]
1 | exp OP exp . [$, OP]
-
- $default reduce using rule 1 (exp)
-
+ $default reduce using rule 1 (exp)
Conflict between rule 2 and token OP resolved as shift (%left OP).
-
-
]])
AT_CLEANUP
3 num: . '0'
4 id: . '0'
- '0' shift, and go to state 1
-
- exp go to state 2
- num go to state 3
- id go to state 4
+ '0' shift, and go to state 1
+ exp go to state 2
+ num go to state 3
+ id go to state 4
state 1
3 num: '0' . [$]
4 id: '0' . [$]
- $ reduce using rule 3 (num)
- $ [reduce using rule 4 (id)]
- $default reduce using rule 3 (num)
-
+ $ reduce using rule 3 (num)
+ $ [reduce using rule 4 (id)]
+ $default reduce using rule 3 (num)
state 2
0 $axiom: exp . $
- $ shift, and go to state 5
-
+ $ shift, and go to state 5
state 3
1 exp: num .
- $default reduce using rule 1 (exp)
-
+ $default reduce using rule 1 (exp)
state 4
2 exp: id .
- $default reduce using rule 2 (exp)
-
+ $default reduce using rule 2 (exp)
state 5
0 $axiom: exp $ .
$default accept
-
-
]])
AT_CLEANUP