Starting parse Entering state 0 Reducing stack by rule 5 (line 56): -> $$ = nterm stmtlist () Stack now 0 Entering state 2 Reading a token: Next token is token ID () Shifting token ID () Entering state 5 Reading a token: Next token is token EQUALS () Shifting token EQUALS () Entering state 10 Reading a token: Next token is token NUMBER () Shifting token NUMBER () Entering state 13 Reducing stack by rule 14 (line 92): $1 = token NUMBER () -> $$ = nterm exp () Stack now 0 2 5 10 Entering state 17 Reading a token: Next token is token NEWLINE () Reducing stack by rule 6 (line 59): $1 = token ID () $2 = token EQUALS () $3 = nterm exp () >>> 10 -> $$ = nterm stmt () Stack now 0 2 Entering state 8 Next token is token NEWLINE () Shifting token NEWLINE () Entering state 12 Reducing stack by rule 3 (line 54): $1 = nterm stmtlist () $2 = nterm stmt () $3 = token NEWLINE () -> $$ = nterm stmtlist () Stack now 0 Entering state 2 Reading a token: Next token is token ID () Shifting token ID () Entering state 5 Reading a token: Next token is token EQUALS () Shifting token EQUALS () Entering state 10 Reading a token: Next token is token NUMBER () Shifting token NUMBER () Entering state 13 Reducing stack by rule 14 (line 92): $1 = token NUMBER () -> $$ = nterm exp () Stack now 0 2 5 10 Entering state 17 Reading a token: Next token is token NEWLINE () Reducing stack by rule 6 (line 59): $1 = token ID () $2 = token EQUALS () $3 = nterm exp () >>> 20 -> $$ = nterm stmt () Stack now 0 2 Entering state 8 Next token is token NEWLINE () Shifting token NEWLINE () Entering state 12 Reducing stack by rule 3 (line 54): $1 = nterm stmtlist () $2 = nterm stmt () $3 = token NEWLINE () -> $$ = nterm stmtlist () Stack now 0 Entering state 2 Reading a token: Next token is token ID () Shifting token ID () Entering state 5 Reading a token: Next token is token EQUALS () Shifting token EQUALS () Entering state 10 Reading a token: Next token is token ID () Shifting token ID () Entering state 14 Reducing stack by rule 15 (line 95): $1 = token ID () -> $$ = nterm exp () Stack now 0 2 5 10 Entering state 17 Reading a token: Next token is token PLUS () Shifting token PLUS () Entering state 21 Reading a token: Next token is token ID () Shifting token ID () Entering state 14 Reducing stack by rule 15 (line 95): $1 = token ID () -> $$ = nterm exp () Stack now 0 2 5 10 17 21 Entering state 26 Reading a token: Next token is token NEWLINE () Reducing stack by rule 9 (line 77): $1 = nterm exp () $2 = token PLUS () $3 = nterm exp () -> $$ = nterm exp () Stack now 0 2 5 10 Entering state 17 Next token is token NEWLINE () Reducing stack by rule 6 (line 59): $1 = token ID () $2 = token EQUALS () $3 = nterm exp () >>> 30 -> $$ = nterm stmt () Stack now 0 2 Entering state 8 Next token is token NEWLINE () Shifting token NEWLINE () Entering state 12 Reducing stack by rule 3 (line 54): $1 = nterm stmtlist () $2 = nterm stmt () $3 = token NEWLINE () -> $$ = nterm stmtlist () Stack now 0 Entering state 2 Reading a token: Next token is token ID () Shifting token ID () Entering state 5 Reading a token: Next token is token EQUALS () Shifting token EQUALS () Entering state 10 Reading a token: Next token is token LPAREN () Shifting token LPAREN () Entering state 16 Reading a token: Next token is token ID () Shifting token ID () Entering state 14 Reducing stack by rule 15 (line 95): $1 = token ID () -> $$ = nterm exp () Stack now 0 2 5 10 16 Entering state 19 Reading a token: Next token is token PLUS () Shifting token PLUS () Entering state 21 Reading a token: Next token is token ID () Shifting token ID () Entering state 14 Reducing stack by rule 15 (line 95): $1 = token ID () -> $$ = nterm exp () Stack now 0 2 5 10 16 19 21 Entering state 26 Reading a token: Next token is token RPAREN () Reducing stack by rule 9 (line 77): $1 = nterm exp () $2 = token PLUS () $3 = nterm exp () -> $$ = nterm exp () Stack now 0 2 5 10 16 Entering state 19 Next token is token RPAREN () Shifting token RPAREN () Entering state 24 Reducing stack by rule 13 (line 89): $1 = token LPAREN () $2 = nterm exp () $3 = token RPAREN () -> $$ = nterm exp () Stack now 0 2 5 10 Entering state 17 Reading a token: Next token is token TIMES () Shifting token TIMES () Entering state 23 Reading a token: Next token is token ID () Shifting token ID () Entering state 14 Reducing stack by rule 15 (line 95): $1 = token ID () -> $$ = nterm exp () Stack now 0 2 5 10 17 23 Entering state 28 Reducing stack by rule 11 (line 83): $1 = nterm exp () $2 = token TIMES () $3 = nterm exp () -> $$ = nterm exp () Stack now 0 2 5 10 Entering state 17 Reading a token: Next token is token NEWLINE () Reducing stack by rule 6 (line 59): $1 = token ID () $2 = token EQUALS () $3 = nterm exp () >>> 900 -> $$ = nterm stmt () Stack now 0 2 Entering state 8 Next token is token NEWLINE () Shifting token NEWLINE () Entering state 12 Reducing stack by rule 3 (line 54): $1 = nterm stmtlist () $2 = nterm stmt () $3 = token NEWLINE () -> $$ = nterm stmtlist () Stack now 0 Entering state 2 Reading a token: Next token is token ID () Shifting token ID () Entering state 5 Reading a token: Next token is token EQUALS () Shifting token EQUALS () Entering state 10 Reading a token: Next token is token ID () Shifting token ID () Entering state 14 Reducing stack by rule 15 (line 95): $1 = token ID () -> $$ = nterm exp () Stack now 0 2 5 10 Entering state 17 Reading a token: Next token is token DIVIDE () Shifting token DIVIDE () Entering state 22 Reading a token: Next token is token ID () Shifting token ID () Entering state 14 Reducing stack by rule 15 (line 95): $1 = token ID () -> $$ = nterm exp () Stack now 0 2 5 10 17 22 Entering state 27 Reducing stack by rule 12 (line 86): $1 = nterm exp () $2 = token DIVIDE () $3 = nterm exp () -> $$ = nterm exp () Stack now 0 2 5 10 Entering state 17 Reading a token: Next token is token NEWLINE () Reducing stack by rule 6 (line 59): $1 = token ID () $2 = token EQUALS () $3 = nterm exp () >>> 90 -> $$ = nterm stmt () Stack now 0 2 Entering state 8 Next token is token NEWLINE () Shifting token NEWLINE () Entering state 12 Reducing stack by rule 3 (line 54): $1 = nterm stmtlist () $2 = nterm stmt () $3 = token NEWLINE () -> $$ = nterm stmtlist () Stack now 0 Entering state 2 Reading a token: Now at end of input. Reducing stack by rule 1 (line 50): $1 = nterm stmtlist () -> $$ = nterm program () Stack now 0 Entering state 1 Now at end of input. Stack now 0 1 Cleanup: popping nterm program () >>>