input grammar: parser.y
0 $accept → input $end 1 input → %empty 2 | expr 3 expr → NUMBER 4 | '(' expr ')' 5 | expr PLUS expr 6 | expr MINUS expr 7 | expr MULT expr 8 | expr DIV expr
$end (0) 0 '(' (40) 4 ')' (41) 4 error (256) NUMBER (258) 3 PLUS (259) 5 MINUS (260) 6 MULT (261) 7 DIV (262) 8
$accept (10) on left: 0 input (11) on left: 1 2 on right: 0 expr (12) on left: 3 4 5 6 7 8 on right: 2 4 5 6 7 8
0 $accept → . input $end 1 input → . %empty [$end] 2 | . expr 3 expr → . NUMBER 4 | . '(' expr ')' 5 | . expr PLUS expr 6 | . expr MINUS expr 7 | . expr MULT expr 8 | . expr DIV expr NUMBER shift, and go to state 1 '(' shift, and go to state 2 $default reduce using rule 1 (input) input go to state 3 expr go to state 4
3 expr → NUMBER . $default reduce using rule 3 (expr)
3 expr → . NUMBER 4 | . '(' expr ')' 4 | '(' . expr ')' 5 | . expr PLUS expr 6 | . expr MINUS expr 7 | . expr MULT expr 8 | . expr DIV expr NUMBER shift, and go to state 1 '(' shift, and go to state 2 expr go to state 5
0 $accept → input . $end $end shift, and go to state 6
2 input → expr . [$end] 5 expr → expr . PLUS expr 6 | expr . MINUS expr 7 | expr . MULT expr 8 | expr . DIV expr PLUS shift, and go to state 7 MINUS shift, and go to state 8 MULT shift, and go to state 9 DIV shift, and go to state 10 $default reduce using rule 2 (input)
4 expr → '(' expr . ')' 5 | expr . PLUS expr 6 | expr . MINUS expr 7 | expr . MULT expr 8 | expr . DIV expr PLUS shift, and go to state 7 MINUS shift, and go to state 8 MULT shift, and go to state 9 DIV shift, and go to state 10 ')' shift, and go to state 11
0 $accept → input $end . $default accept
3 expr → . NUMBER 4 | . '(' expr ')' 5 | . expr PLUS expr 5 | expr PLUS . expr 6 | . expr MINUS expr 7 | . expr MULT expr 8 | . expr DIV expr NUMBER shift, and go to state 1 '(' shift, and go to state 2 expr go to state 12
3 expr → . NUMBER 4 | . '(' expr ')' 5 | . expr PLUS expr 6 | . expr MINUS expr 6 | expr MINUS . expr 7 | . expr MULT expr 8 | . expr DIV expr NUMBER shift, and go to state 1 '(' shift, and go to state 2 expr go to state 13
3 expr → . NUMBER 4 | . '(' expr ')' 5 | . expr PLUS expr 6 | . expr MINUS expr 7 | . expr MULT expr 7 | expr MULT . expr 8 | . expr DIV expr NUMBER shift, and go to state 1 '(' shift, and go to state 2 expr go to state 14
3 expr → . NUMBER 4 | . '(' expr ')' 5 | . expr PLUS expr 6 | . expr MINUS expr 7 | . expr MULT expr 8 | . expr DIV expr 8 | expr DIV . expr NUMBER shift, and go to state 1 '(' shift, and go to state 2 expr go to state 15
4 expr → '(' expr ')' . $default reduce using rule 4 (expr)
5 expr → expr . PLUS expr 5 | expr PLUS expr . [$end, PLUS, MINUS, ')'] 6 | expr . MINUS expr 7 | expr . MULT expr 8 | expr . DIV expr MULT shift, and go to state 9 DIV shift, and go to state 10 $default reduce using rule 5 (expr) Conflict between rule 5 and token PLUS resolved as reduce (%left PLUS). Conflict between rule 5 and token MINUS resolved as reduce (%left MINUS). Conflict between rule 5 and token MULT resolved as shift (PLUS < MULT). Conflict between rule 5 and token DIV resolved as shift (PLUS < DIV).
5 expr → expr . PLUS expr 6 | expr . MINUS expr 6 | expr MINUS expr . [$end, PLUS, MINUS, ')'] 7 | expr . MULT expr 8 | expr . DIV expr MULT shift, and go to state 9 DIV shift, and go to state 10 $default reduce using rule 6 (expr) Conflict between rule 6 and token PLUS resolved as reduce (%left PLUS). Conflict between rule 6 and token MINUS resolved as reduce (%left MINUS). Conflict between rule 6 and token MULT resolved as shift (MINUS < MULT). Conflict between rule 6 and token DIV resolved as shift (MINUS < DIV).
5 expr → expr . PLUS expr 6 | expr . MINUS expr 7 | expr . MULT expr 7 | expr MULT expr . [$end, PLUS, MINUS, MULT, DIV, ')'] 8 | expr . DIV expr $default reduce using rule 7 (expr) Conflict between rule 7 and token PLUS resolved as reduce (PLUS < MULT). Conflict between rule 7 and token MINUS resolved as reduce (MINUS < MULT). Conflict between rule 7 and token MULT resolved as reduce (%left MULT). Conflict between rule 7 and token DIV resolved as reduce (%left DIV).
5 expr → expr . PLUS expr 6 | expr . MINUS expr 7 | expr . MULT expr 8 | expr . DIV expr 8 | expr DIV expr . [$end, PLUS, MINUS, MULT, DIV, ')'] $default reduce using rule 8 (expr) Conflict between rule 8 and token PLUS resolved as reduce (PLUS < DIV). Conflict between rule 8 and token MINUS resolved as reduce (MINUS < DIV). Conflict between rule 8 and token MULT resolved as reduce (%left MULT). Conflict between rule 8 and token DIV resolved as reduce (%left DIV).