Grammar 0 $accept: input $end 1 input: /* empty */ 2 | input line 3 line: exp EQUAL END 4 exp: NUMBER 5 | exp PLUS exp 6 | exp MINUS exp 7 | exp MULT exp 8 | exp DIV exp 9 | MINUS exp 10 | L_PAREN exp R_PAREN Terminals, with rules where they appear $end (0) 0 error (256) MULT (258) 7 DIV (259) 8 PLUS (260) 5 MINUS (261) 6 9 EQUAL (262) 3 L_PAREN (263) 10 R_PAREN (264) 10 END (265) 3 NUMBER (266) 4 UMINUS (267) Nonterminals, with rules where they appear $accept (13) on left: 0 input (14) on left: 1 2, on right: 0 2 line (15) on left: 3, on right: 2 exp (16) on left: 4 5 6 7 8 9 10, on right: 3 5 6 7 8 9 10 state 0 0 $accept: . input $end $default reduce using rule 1 (input) input go to state 1 state 1 0 $accept: input . $end 2 input: input . line $end shift, and go to state 2 MINUS shift, and go to state 3 L_PAREN shift, and go to state 4 NUMBER shift, and go to state 5 line go to state 6 exp go to state 7 state 2 0 $accept: input $end . $default accept state 3 9 exp: MINUS . exp MINUS shift, and go to state 3 L_PAREN shift, and go to state 4 NUMBER shift, and go to state 5 exp go to state 8 state 4 10 exp: L_PAREN . exp R_PAREN MINUS shift, and go to state 3 L_PAREN shift, and go to state 4 NUMBER shift, and go to state 5 exp go to state 9 state 5 4 exp: NUMBER . $default reduce using rule 4 (exp) state 6 2 input: input line . $default reduce using rule 2 (input) state 7 3 line: exp . EQUAL END 5 exp: exp . PLUS exp 6 | exp . MINUS exp 7 | exp . MULT exp 8 | exp . DIV exp MULT shift, and go to state 10 DIV shift, and go to state 11 PLUS shift, and go to state 12 MINUS shift, and go to state 13 EQUAL shift, and go to state 14 state 8 5 exp: exp . PLUS exp 6 | exp . MINUS exp 7 | exp . MULT exp 8 | exp . DIV exp 9 | MINUS exp . $default reduce using rule 9 (exp) state 9 5 exp: exp . PLUS exp 6 | exp . MINUS exp 7 | exp . MULT exp 8 | exp . DIV exp 10 | L_PAREN exp . R_PAREN MULT shift, and go to state 10 DIV shift, and go to state 11 PLUS shift, and go to state 12 MINUS shift, and go to state 13 R_PAREN shift, and go to state 15 state 10 7 exp: exp MULT . exp MINUS shift, and go to state 3 L_PAREN shift, and go to state 4 NUMBER shift, and go to state 5 exp go to state 16 state 11 8 exp: exp DIV . exp MINUS shift, and go to state 3 L_PAREN shift, and go to state 4 NUMBER shift, and go to state 5 exp go to state 17 state 12 5 exp: exp PLUS . exp MINUS shift, and go to state 3 L_PAREN shift, and go to state 4 NUMBER shift, and go to state 5 exp go to state 18 state 13 6 exp: exp MINUS . exp MINUS shift, and go to state 3 L_PAREN shift, and go to state 4 NUMBER shift, and go to state 5 exp go to state 19 state 14 3 line: exp EQUAL . END END shift, and go to state 20 state 15 10 exp: L_PAREN exp R_PAREN . $default reduce using rule 10 (exp) state 16 5 exp: exp . PLUS exp 6 | exp . MINUS exp 7 | exp . MULT exp 7 | exp MULT exp . 8 | exp . DIV exp $default reduce using rule 7 (exp) state 17 5 exp: exp . PLUS exp 6 | exp . MINUS exp 7 | exp . MULT exp 8 | exp . DIV exp 8 | exp DIV exp . $default reduce using rule 8 (exp) state 18 5 exp: exp . PLUS exp 5 | exp PLUS exp . 6 | exp . MINUS exp 7 | exp . MULT exp 8 | exp . DIV exp MULT shift, and go to state 10 DIV shift, and go to state 11 $default reduce using rule 5 (exp) state 19 5 exp: exp . PLUS exp 6 | exp . MINUS exp 6 | exp MINUS exp . 7 | exp . MULT exp 8 | exp . DIV exp MULT shift, and go to state 10 DIV shift, and go to state 11 $default reduce using rule 6 (exp) state 20 3 line: exp EQUAL END . $default reduce using rule 3 (line)