input grammar: egg.y
0 $accept → EXPRESSION $end 1 EXPRESSION → EXPRESSION ADDOP TERM 2 | TERM 3 TERM → TERM MULTOP FACTOR 4 | FACTOR 5 FACTOR → OPENPAREN EXPRESSION CLOSEPAREN 6 | INTEGER
0 $accept → • EXPRESSION $end 1 EXPRESSION → • EXPRESSION ADDOP TERM 2 | • TERM 3 TERM → • TERM MULTOP FACTOR 4 | • FACTOR 5 FACTOR → • OPENPAREN EXPRESSION CLOSEPAREN 6 | • INTEGER INTEGER shift, and go to state 1 OPENPAREN shift, and go to state 2 EXPRESSION go to state 3 TERM go to state 4 FACTOR go to state 5
6 FACTOR → INTEGER • [$end, ADDOP, MULTOP, CLOSEPAREN] $end reduce using rule 6 (FACTOR) ADDOP reduce using rule 6 (FACTOR) MULTOP reduce using rule 6 (FACTOR) CLOSEPAREN reduce using rule 6 (FACTOR)
1 EXPRESSION → • EXPRESSION ADDOP TERM 2 | • TERM 3 TERM → • TERM MULTOP FACTOR 4 | • FACTOR 5 FACTOR → • OPENPAREN EXPRESSION CLOSEPAREN 5 | OPENPAREN • EXPRESSION CLOSEPAREN 6 | • INTEGER INTEGER shift, and go to state 1 OPENPAREN shift, and go to state 2 EXPRESSION go to state 6 TERM go to state 4 FACTOR go to state 5
0 $accept → EXPRESSION • $end 1 EXPRESSION → EXPRESSION • ADDOP TERM $end shift, and go to state 7 ADDOP shift, and go to state 8
2 EXPRESSION → TERM • [$end, ADDOP, CLOSEPAREN] 3 TERM → TERM • MULTOP FACTOR MULTOP shift, and go to state 9 $end reduce using rule 2 (EXPRESSION) ADDOP reduce using rule 2 (EXPRESSION) CLOSEPAREN reduce using rule 2 (EXPRESSION)
4 TERM → FACTOR • [$end, ADDOP, MULTOP, CLOSEPAREN] $end reduce using rule 4 (TERM) ADDOP reduce using rule 4 (TERM) MULTOP reduce using rule 4 (TERM) CLOSEPAREN reduce using rule 4 (TERM)
1 EXPRESSION → EXPRESSION • ADDOP TERM 5 FACTOR → OPENPAREN EXPRESSION • CLOSEPAREN ADDOP shift, and go to state 8 CLOSEPAREN shift, and go to state 10
0 $accept → EXPRESSION $end • $default accept
1 EXPRESSION → EXPRESSION ADDOP • TERM 3 TERM → • TERM MULTOP FACTOR 4 | • FACTOR 5 FACTOR → • OPENPAREN EXPRESSION CLOSEPAREN 6 | • INTEGER INTEGER shift, and go to state 1 OPENPAREN shift, and go to state 2 TERM go to state 11 FACTOR go to state 5
3 TERM → TERM MULTOP • FACTOR 5 FACTOR → • OPENPAREN EXPRESSION CLOSEPAREN 6 | • INTEGER INTEGER shift, and go to state 1 OPENPAREN shift, and go to state 2 FACTOR go to state 12
5 FACTOR → OPENPAREN EXPRESSION CLOSEPAREN • [$end, ADDOP, MULTOP, CLOSEPAREN] $end reduce using rule 5 (FACTOR) ADDOP reduce using rule 5 (FACTOR) MULTOP reduce using rule 5 (FACTOR) CLOSEPAREN reduce using rule 5 (FACTOR)
1 EXPRESSION → EXPRESSION ADDOP TERM • [$end, ADDOP, CLOSEPAREN] 3 TERM → TERM • MULTOP FACTOR MULTOP shift, and go to state 9 $end reduce using rule 1 (EXPRESSION) ADDOP reduce using rule 1 (EXPRESSION) CLOSEPAREN reduce using rule 1 (EXPRESSION)
3 TERM → TERM MULTOP FACTOR • [$end, ADDOP, MULTOP, CLOSEPAREN] $end reduce using rule 3 (TERM) ADDOP reduce using rule 3 (TERM) MULTOP reduce using rule 3 (TERM) CLOSEPAREN reduce using rule 3 (TERM)