Files
Construction-of-Compilers/Project-02/parser.out
2025-11-20 15:10:38 +01:00

1134 lines
33 KiB
Plaintext

Created by PLY version 3.11 (http://www.dabeaz.com/ply)
Grammar
Rule 0 S' -> E
Rule 1 E -> LET D IN E
Rule 2 E -> ID
Rule 3 E -> ID LPAREN A RPAREN
Rule 4 E -> E AOP E
Rule 5 E -> LPAREN E RPAREN
Rule 6 E -> CONST
Rule 7 E -> ID ASSIGN E
Rule 8 E -> E SEMICOLON E
Rule 9 E -> IF LPAREN B RPAREN THEN E ELSE E
Rule 10 E -> WHILE LPAREN B RPAREN DO LBRACE E RBRACE
Rule 11 A -> E
Rule 12 A -> A COMMA E
Rule 13 D -> ID LPAREN V RPAREN LBRACE E RBRACE
Rule 14 D -> D D
Rule 15 V -> ID
Rule 16 V -> V COMMA ID
Rule 17 B -> E EQOP E
Rule 18 B -> E COMP E
Rule 19 B -> B EQOP B
Rule 20 B -> B LOP B
Rule 21 B -> TRUE
Rule 22 B -> FALSE
Rule 23 B -> LPAREN B RPAREN
Terminals, with rules where they appear
AOP : 4
ASSIGN : 7
COMMA : 12 16
COMP : 18
CONST : 6
DO : 10
ELSE : 9
EQOP : 17 19
FALSE : 22
ID : 2 3 7 13 15 16
IF : 9
IN : 1
LBRACE : 10 13
LET : 1
LOP : 20
LPAREN : 3 5 9 10 13 23
RBRACE : 10 13
RPAREN : 3 5 9 10 13 23
SEMICOLON : 8
THEN : 9
TRUE : 21
WHILE : 10
error :
Nonterminals, with rules where they appear
A : 3 12
B : 9 10 19 19 20 20 23
D : 1 14 14
E : 1 4 4 5 7 8 8 9 9 10 11 12 13 17 17 18 18 0
V : 13 16
Parsing method: LALR
state 0
(0) S' -> . E
(1) E -> . LET D IN E
(2) E -> . ID
(3) E -> . ID LPAREN A RPAREN
(4) E -> . E AOP E
(5) E -> . LPAREN E RPAREN
(6) E -> . CONST
(7) E -> . ID ASSIGN E
(8) E -> . E SEMICOLON E
(9) E -> . IF LPAREN B RPAREN THEN E ELSE E
(10) E -> . WHILE LPAREN B RPAREN DO LBRACE E RBRACE
LET shift and go to state 2
ID shift and go to state 3
LPAREN shift and go to state 4
CONST shift and go to state 5
IF shift and go to state 6
WHILE shift and go to state 7
E shift and go to state 1
state 1
(0) S' -> E .
(4) E -> E . AOP E
(8) E -> E . SEMICOLON E
AOP shift and go to state 8
SEMICOLON shift and go to state 9
state 2
(1) E -> LET . D IN E
(13) D -> . ID LPAREN V RPAREN LBRACE E RBRACE
(14) D -> . D D
ID shift and go to state 11
D shift and go to state 10
state 3
(2) E -> ID .
(3) E -> ID . LPAREN A RPAREN
(7) E -> ID . ASSIGN E
AOP reduce using rule 2 (E -> ID .)
SEMICOLON reduce using rule 2 (E -> ID .)
$end reduce using rule 2 (E -> ID .)
RPAREN reduce using rule 2 (E -> ID .)
COMMA reduce using rule 2 (E -> ID .)
EQOP reduce using rule 2 (E -> ID .)
COMP reduce using rule 2 (E -> ID .)
LOP reduce using rule 2 (E -> ID .)
ELSE reduce using rule 2 (E -> ID .)
RBRACE reduce using rule 2 (E -> ID .)
LPAREN shift and go to state 12
ASSIGN shift and go to state 13
state 4
(5) E -> LPAREN . E RPAREN
(1) E -> . LET D IN E
(2) E -> . ID
(3) E -> . ID LPAREN A RPAREN
(4) E -> . E AOP E
(5) E -> . LPAREN E RPAREN
(6) E -> . CONST
(7) E -> . ID ASSIGN E
(8) E -> . E SEMICOLON E
(9) E -> . IF LPAREN B RPAREN THEN E ELSE E
(10) E -> . WHILE LPAREN B RPAREN DO LBRACE E RBRACE
LET shift and go to state 2
ID shift and go to state 3
LPAREN shift and go to state 4
CONST shift and go to state 5
IF shift and go to state 6
WHILE shift and go to state 7
E shift and go to state 14
state 5
(6) E -> CONST .
AOP reduce using rule 6 (E -> CONST .)
SEMICOLON reduce using rule 6 (E -> CONST .)
$end reduce using rule 6 (E -> CONST .)
RPAREN reduce using rule 6 (E -> CONST .)
COMMA reduce using rule 6 (E -> CONST .)
EQOP reduce using rule 6 (E -> CONST .)
COMP reduce using rule 6 (E -> CONST .)
LOP reduce using rule 6 (E -> CONST .)
ELSE reduce using rule 6 (E -> CONST .)
RBRACE reduce using rule 6 (E -> CONST .)
state 6
(9) E -> IF . LPAREN B RPAREN THEN E ELSE E
LPAREN shift and go to state 15
state 7
(10) E -> WHILE . LPAREN B RPAREN DO LBRACE E RBRACE
LPAREN shift and go to state 16
state 8
(4) E -> E AOP . E
(1) E -> . LET D IN E
(2) E -> . ID
(3) E -> . ID LPAREN A RPAREN
(4) E -> . E AOP E
(5) E -> . LPAREN E RPAREN
(6) E -> . CONST
(7) E -> . ID ASSIGN E
(8) E -> . E SEMICOLON E
(9) E -> . IF LPAREN B RPAREN THEN E ELSE E
(10) E -> . WHILE LPAREN B RPAREN DO LBRACE E RBRACE
LET shift and go to state 2
ID shift and go to state 3
LPAREN shift and go to state 4
CONST shift and go to state 5
IF shift and go to state 6
WHILE shift and go to state 7
E shift and go to state 17
state 9
(8) E -> E SEMICOLON . E
(1) E -> . LET D IN E
(2) E -> . ID
(3) E -> . ID LPAREN A RPAREN
(4) E -> . E AOP E
(5) E -> . LPAREN E RPAREN
(6) E -> . CONST
(7) E -> . ID ASSIGN E
(8) E -> . E SEMICOLON E
(9) E -> . IF LPAREN B RPAREN THEN E ELSE E
(10) E -> . WHILE LPAREN B RPAREN DO LBRACE E RBRACE
LET shift and go to state 2
ID shift and go to state 3
LPAREN shift and go to state 4
CONST shift and go to state 5
IF shift and go to state 6
WHILE shift and go to state 7
E shift and go to state 18
state 10
(1) E -> LET D . IN E
(14) D -> D . D
(13) D -> . ID LPAREN V RPAREN LBRACE E RBRACE
(14) D -> . D D
IN shift and go to state 20
ID shift and go to state 11
D shift and go to state 19
state 11
(13) D -> ID . LPAREN V RPAREN LBRACE E RBRACE
LPAREN shift and go to state 21
state 12
(3) E -> ID LPAREN . A RPAREN
(11) A -> . E
(12) A -> . A COMMA E
(1) E -> . LET D IN E
(2) E -> . ID
(3) E -> . ID LPAREN A RPAREN
(4) E -> . E AOP E
(5) E -> . LPAREN E RPAREN
(6) E -> . CONST
(7) E -> . ID ASSIGN E
(8) E -> . E SEMICOLON E
(9) E -> . IF LPAREN B RPAREN THEN E ELSE E
(10) E -> . WHILE LPAREN B RPAREN DO LBRACE E RBRACE
LET shift and go to state 2
ID shift and go to state 3
LPAREN shift and go to state 4
CONST shift and go to state 5
IF shift and go to state 6
WHILE shift and go to state 7
A shift and go to state 22
E shift and go to state 23
state 13
(7) E -> ID ASSIGN . E
(1) E -> . LET D IN E
(2) E -> . ID
(3) E -> . ID LPAREN A RPAREN
(4) E -> . E AOP E
(5) E -> . LPAREN E RPAREN
(6) E -> . CONST
(7) E -> . ID ASSIGN E
(8) E -> . E SEMICOLON E
(9) E -> . IF LPAREN B RPAREN THEN E ELSE E
(10) E -> . WHILE LPAREN B RPAREN DO LBRACE E RBRACE
LET shift and go to state 2
ID shift and go to state 3
LPAREN shift and go to state 4
CONST shift and go to state 5
IF shift and go to state 6
WHILE shift and go to state 7
E shift and go to state 24
state 14
(5) E -> LPAREN E . RPAREN
(4) E -> E . AOP E
(8) E -> E . SEMICOLON E
RPAREN shift and go to state 25
AOP shift and go to state 8
SEMICOLON shift and go to state 9
state 15
(9) E -> IF LPAREN . B RPAREN THEN E ELSE E
(17) B -> . E EQOP E
(18) B -> . E COMP E
(19) B -> . B EQOP B
(20) B -> . B LOP B
(21) B -> . TRUE
(22) B -> . FALSE
(23) B -> . LPAREN B RPAREN
(1) E -> . LET D IN E
(2) E -> . ID
(3) E -> . ID LPAREN A RPAREN
(4) E -> . E AOP E
(5) E -> . LPAREN E RPAREN
(6) E -> . CONST
(7) E -> . ID ASSIGN E
(8) E -> . E SEMICOLON E
(9) E -> . IF LPAREN B RPAREN THEN E ELSE E
(10) E -> . WHILE LPAREN B RPAREN DO LBRACE E RBRACE
TRUE shift and go to state 29
FALSE shift and go to state 30
LPAREN shift and go to state 26
LET shift and go to state 2
ID shift and go to state 3
CONST shift and go to state 5
IF shift and go to state 6
WHILE shift and go to state 7
B shift and go to state 27
E shift and go to state 28
state 16
(10) E -> WHILE LPAREN . B RPAREN DO LBRACE E RBRACE
(17) B -> . E EQOP E
(18) B -> . E COMP E
(19) B -> . B EQOP B
(20) B -> . B LOP B
(21) B -> . TRUE
(22) B -> . FALSE
(23) B -> . LPAREN B RPAREN
(1) E -> . LET D IN E
(2) E -> . ID
(3) E -> . ID LPAREN A RPAREN
(4) E -> . E AOP E
(5) E -> . LPAREN E RPAREN
(6) E -> . CONST
(7) E -> . ID ASSIGN E
(8) E -> . E SEMICOLON E
(9) E -> . IF LPAREN B RPAREN THEN E ELSE E
(10) E -> . WHILE LPAREN B RPAREN DO LBRACE E RBRACE
TRUE shift and go to state 29
FALSE shift and go to state 30
LPAREN shift and go to state 26
LET shift and go to state 2
ID shift and go to state 3
CONST shift and go to state 5
IF shift and go to state 6
WHILE shift and go to state 7
B shift and go to state 31
E shift and go to state 28
state 17
(4) E -> E AOP E .
(4) E -> E . AOP E
(8) E -> E . SEMICOLON E
AOP reduce using rule 4 (E -> E AOP E .)
SEMICOLON reduce using rule 4 (E -> E AOP E .)
$end reduce using rule 4 (E -> E AOP E .)
RPAREN reduce using rule 4 (E -> E AOP E .)
COMMA reduce using rule 4 (E -> E AOP E .)
EQOP reduce using rule 4 (E -> E AOP E .)
COMP reduce using rule 4 (E -> E AOP E .)
LOP reduce using rule 4 (E -> E AOP E .)
ELSE reduce using rule 4 (E -> E AOP E .)
RBRACE reduce using rule 4 (E -> E AOP E .)
! AOP [ shift and go to state 8 ]
! SEMICOLON [ shift and go to state 9 ]
state 18
(8) E -> E SEMICOLON E .
(4) E -> E . AOP E
(8) E -> E . SEMICOLON E
! shift/reduce conflict for AOP resolved as shift
! shift/reduce conflict for SEMICOLON resolved as shift
$end reduce using rule 8 (E -> E SEMICOLON E .)
RPAREN reduce using rule 8 (E -> E SEMICOLON E .)
COMMA reduce using rule 8 (E -> E SEMICOLON E .)
EQOP reduce using rule 8 (E -> E SEMICOLON E .)
COMP reduce using rule 8 (E -> E SEMICOLON E .)
LOP reduce using rule 8 (E -> E SEMICOLON E .)
ELSE reduce using rule 8 (E -> E SEMICOLON E .)
RBRACE reduce using rule 8 (E -> E SEMICOLON E .)
AOP shift and go to state 8
SEMICOLON shift and go to state 9
! AOP [ reduce using rule 8 (E -> E SEMICOLON E .) ]
! SEMICOLON [ reduce using rule 8 (E -> E SEMICOLON E .) ]
state 19
(14) D -> D D .
(14) D -> D . D
(13) D -> . ID LPAREN V RPAREN LBRACE E RBRACE
(14) D -> . D D
! shift/reduce conflict for ID resolved as shift
IN reduce using rule 14 (D -> D D .)
ID shift and go to state 11
! ID [ reduce using rule 14 (D -> D D .) ]
D shift and go to state 19
state 20
(1) E -> LET D IN . E
(1) E -> . LET D IN E
(2) E -> . ID
(3) E -> . ID LPAREN A RPAREN
(4) E -> . E AOP E
(5) E -> . LPAREN E RPAREN
(6) E -> . CONST
(7) E -> . ID ASSIGN E
(8) E -> . E SEMICOLON E
(9) E -> . IF LPAREN B RPAREN THEN E ELSE E
(10) E -> . WHILE LPAREN B RPAREN DO LBRACE E RBRACE
LET shift and go to state 2
ID shift and go to state 3
LPAREN shift and go to state 4
CONST shift and go to state 5
IF shift and go to state 6
WHILE shift and go to state 7
E shift and go to state 32
state 21
(13) D -> ID LPAREN . V RPAREN LBRACE E RBRACE
(15) V -> . ID
(16) V -> . V COMMA ID
ID shift and go to state 33
V shift and go to state 34
state 22
(3) E -> ID LPAREN A . RPAREN
(12) A -> A . COMMA E
RPAREN shift and go to state 35
COMMA shift and go to state 36
state 23
(11) A -> E .
(4) E -> E . AOP E
(8) E -> E . SEMICOLON E
RPAREN reduce using rule 11 (A -> E .)
COMMA reduce using rule 11 (A -> E .)
AOP shift and go to state 8
SEMICOLON shift and go to state 9
state 24
(7) E -> ID ASSIGN E .
(4) E -> E . AOP E
(8) E -> E . SEMICOLON E
! shift/reduce conflict for AOP resolved as shift
! shift/reduce conflict for SEMICOLON resolved as shift
$end reduce using rule 7 (E -> ID ASSIGN E .)
RPAREN reduce using rule 7 (E -> ID ASSIGN E .)
COMMA reduce using rule 7 (E -> ID ASSIGN E .)
EQOP reduce using rule 7 (E -> ID ASSIGN E .)
COMP reduce using rule 7 (E -> ID ASSIGN E .)
LOP reduce using rule 7 (E -> ID ASSIGN E .)
ELSE reduce using rule 7 (E -> ID ASSIGN E .)
RBRACE reduce using rule 7 (E -> ID ASSIGN E .)
AOP shift and go to state 8
SEMICOLON shift and go to state 9
! AOP [ reduce using rule 7 (E -> ID ASSIGN E .) ]
! SEMICOLON [ reduce using rule 7 (E -> ID ASSIGN E .) ]
state 25
(5) E -> LPAREN E RPAREN .
AOP reduce using rule 5 (E -> LPAREN E RPAREN .)
SEMICOLON reduce using rule 5 (E -> LPAREN E RPAREN .)
$end reduce using rule 5 (E -> LPAREN E RPAREN .)
RPAREN reduce using rule 5 (E -> LPAREN E RPAREN .)
COMMA reduce using rule 5 (E -> LPAREN E RPAREN .)
EQOP reduce using rule 5 (E -> LPAREN E RPAREN .)
COMP reduce using rule 5 (E -> LPAREN E RPAREN .)
LOP reduce using rule 5 (E -> LPAREN E RPAREN .)
ELSE reduce using rule 5 (E -> LPAREN E RPAREN .)
RBRACE reduce using rule 5 (E -> LPAREN E RPAREN .)
state 26
(23) B -> LPAREN . B RPAREN
(5) E -> LPAREN . E RPAREN
(17) B -> . E EQOP E
(18) B -> . E COMP E
(19) B -> . B EQOP B
(20) B -> . B LOP B
(21) B -> . TRUE
(22) B -> . FALSE
(23) B -> . LPAREN B RPAREN
(1) E -> . LET D IN E
(2) E -> . ID
(3) E -> . ID LPAREN A RPAREN
(4) E -> . E AOP E
(5) E -> . LPAREN E RPAREN
(6) E -> . CONST
(7) E -> . ID ASSIGN E
(8) E -> . E SEMICOLON E
(9) E -> . IF LPAREN B RPAREN THEN E ELSE E
(10) E -> . WHILE LPAREN B RPAREN DO LBRACE E RBRACE
TRUE shift and go to state 29
FALSE shift and go to state 30
LPAREN shift and go to state 26
LET shift and go to state 2
ID shift and go to state 3
CONST shift and go to state 5
IF shift and go to state 6
WHILE shift and go to state 7
B shift and go to state 37
E shift and go to state 38
state 27
(9) E -> IF LPAREN B . RPAREN THEN E ELSE E
(19) B -> B . EQOP B
(20) B -> B . LOP B
RPAREN shift and go to state 39
EQOP shift and go to state 40
LOP shift and go to state 41
state 28
(17) B -> E . EQOP E
(18) B -> E . COMP E
(4) E -> E . AOP E
(8) E -> E . SEMICOLON E
EQOP shift and go to state 42
COMP shift and go to state 43
AOP shift and go to state 8
SEMICOLON shift and go to state 9
state 29
(21) B -> TRUE .
RPAREN reduce using rule 21 (B -> TRUE .)
EQOP reduce using rule 21 (B -> TRUE .)
LOP reduce using rule 21 (B -> TRUE .)
state 30
(22) B -> FALSE .
RPAREN reduce using rule 22 (B -> FALSE .)
EQOP reduce using rule 22 (B -> FALSE .)
LOP reduce using rule 22 (B -> FALSE .)
state 31
(10) E -> WHILE LPAREN B . RPAREN DO LBRACE E RBRACE
(19) B -> B . EQOP B
(20) B -> B . LOP B
RPAREN shift and go to state 44
EQOP shift and go to state 40
LOP shift and go to state 41
state 32
(1) E -> LET D IN E .
(4) E -> E . AOP E
(8) E -> E . SEMICOLON E
! shift/reduce conflict for AOP resolved as shift
! shift/reduce conflict for SEMICOLON resolved as shift
$end reduce using rule 1 (E -> LET D IN E .)
RPAREN reduce using rule 1 (E -> LET D IN E .)
COMMA reduce using rule 1 (E -> LET D IN E .)
EQOP reduce using rule 1 (E -> LET D IN E .)
COMP reduce using rule 1 (E -> LET D IN E .)
LOP reduce using rule 1 (E -> LET D IN E .)
ELSE reduce using rule 1 (E -> LET D IN E .)
RBRACE reduce using rule 1 (E -> LET D IN E .)
AOP shift and go to state 8
SEMICOLON shift and go to state 9
! AOP [ reduce using rule 1 (E -> LET D IN E .) ]
! SEMICOLON [ reduce using rule 1 (E -> LET D IN E .) ]
state 33
(15) V -> ID .
RPAREN reduce using rule 15 (V -> ID .)
COMMA reduce using rule 15 (V -> ID .)
state 34
(13) D -> ID LPAREN V . RPAREN LBRACE E RBRACE
(16) V -> V . COMMA ID
RPAREN shift and go to state 45
COMMA shift and go to state 46
state 35
(3) E -> ID LPAREN A RPAREN .
AOP reduce using rule 3 (E -> ID LPAREN A RPAREN .)
SEMICOLON reduce using rule 3 (E -> ID LPAREN A RPAREN .)
$end reduce using rule 3 (E -> ID LPAREN A RPAREN .)
RPAREN reduce using rule 3 (E -> ID LPAREN A RPAREN .)
COMMA reduce using rule 3 (E -> ID LPAREN A RPAREN .)
EQOP reduce using rule 3 (E -> ID LPAREN A RPAREN .)
COMP reduce using rule 3 (E -> ID LPAREN A RPAREN .)
LOP reduce using rule 3 (E -> ID LPAREN A RPAREN .)
ELSE reduce using rule 3 (E -> ID LPAREN A RPAREN .)
RBRACE reduce using rule 3 (E -> ID LPAREN A RPAREN .)
state 36
(12) A -> A COMMA . E
(1) E -> . LET D IN E
(2) E -> . ID
(3) E -> . ID LPAREN A RPAREN
(4) E -> . E AOP E
(5) E -> . LPAREN E RPAREN
(6) E -> . CONST
(7) E -> . ID ASSIGN E
(8) E -> . E SEMICOLON E
(9) E -> . IF LPAREN B RPAREN THEN E ELSE E
(10) E -> . WHILE LPAREN B RPAREN DO LBRACE E RBRACE
LET shift and go to state 2
ID shift and go to state 3
LPAREN shift and go to state 4
CONST shift and go to state 5
IF shift and go to state 6
WHILE shift and go to state 7
E shift and go to state 47
state 37
(23) B -> LPAREN B . RPAREN
(19) B -> B . EQOP B
(20) B -> B . LOP B
RPAREN shift and go to state 48
EQOP shift and go to state 40
LOP shift and go to state 41
state 38
(5) E -> LPAREN E . RPAREN
(17) B -> E . EQOP E
(18) B -> E . COMP E
(4) E -> E . AOP E
(8) E -> E . SEMICOLON E
RPAREN shift and go to state 25
EQOP shift and go to state 42
COMP shift and go to state 43
AOP shift and go to state 8
SEMICOLON shift and go to state 9
state 39
(9) E -> IF LPAREN B RPAREN . THEN E ELSE E
THEN shift and go to state 49
state 40
(19) B -> B EQOP . B
(17) B -> . E EQOP E
(18) B -> . E COMP E
(19) B -> . B EQOP B
(20) B -> . B LOP B
(21) B -> . TRUE
(22) B -> . FALSE
(23) B -> . LPAREN B RPAREN
(1) E -> . LET D IN E
(2) E -> . ID
(3) E -> . ID LPAREN A RPAREN
(4) E -> . E AOP E
(5) E -> . LPAREN E RPAREN
(6) E -> . CONST
(7) E -> . ID ASSIGN E
(8) E -> . E SEMICOLON E
(9) E -> . IF LPAREN B RPAREN THEN E ELSE E
(10) E -> . WHILE LPAREN B RPAREN DO LBRACE E RBRACE
TRUE shift and go to state 29
FALSE shift and go to state 30
LPAREN shift and go to state 26
LET shift and go to state 2
ID shift and go to state 3
CONST shift and go to state 5
IF shift and go to state 6
WHILE shift and go to state 7
B shift and go to state 50
E shift and go to state 28
state 41
(20) B -> B LOP . B
(17) B -> . E EQOP E
(18) B -> . E COMP E
(19) B -> . B EQOP B
(20) B -> . B LOP B
(21) B -> . TRUE
(22) B -> . FALSE
(23) B -> . LPAREN B RPAREN
(1) E -> . LET D IN E
(2) E -> . ID
(3) E -> . ID LPAREN A RPAREN
(4) E -> . E AOP E
(5) E -> . LPAREN E RPAREN
(6) E -> . CONST
(7) E -> . ID ASSIGN E
(8) E -> . E SEMICOLON E
(9) E -> . IF LPAREN B RPAREN THEN E ELSE E
(10) E -> . WHILE LPAREN B RPAREN DO LBRACE E RBRACE
TRUE shift and go to state 29
FALSE shift and go to state 30
LPAREN shift and go to state 26
LET shift and go to state 2
ID shift and go to state 3
CONST shift and go to state 5
IF shift and go to state 6
WHILE shift and go to state 7
B shift and go to state 51
E shift and go to state 28
state 42
(17) B -> E EQOP . E
(1) E -> . LET D IN E
(2) E -> . ID
(3) E -> . ID LPAREN A RPAREN
(4) E -> . E AOP E
(5) E -> . LPAREN E RPAREN
(6) E -> . CONST
(7) E -> . ID ASSIGN E
(8) E -> . E SEMICOLON E
(9) E -> . IF LPAREN B RPAREN THEN E ELSE E
(10) E -> . WHILE LPAREN B RPAREN DO LBRACE E RBRACE
LET shift and go to state 2
ID shift and go to state 3
LPAREN shift and go to state 4
CONST shift and go to state 5
IF shift and go to state 6
WHILE shift and go to state 7
E shift and go to state 52
state 43
(18) B -> E COMP . E
(1) E -> . LET D IN E
(2) E -> . ID
(3) E -> . ID LPAREN A RPAREN
(4) E -> . E AOP E
(5) E -> . LPAREN E RPAREN
(6) E -> . CONST
(7) E -> . ID ASSIGN E
(8) E -> . E SEMICOLON E
(9) E -> . IF LPAREN B RPAREN THEN E ELSE E
(10) E -> . WHILE LPAREN B RPAREN DO LBRACE E RBRACE
LET shift and go to state 2
ID shift and go to state 3
LPAREN shift and go to state 4
CONST shift and go to state 5
IF shift and go to state 6
WHILE shift and go to state 7
E shift and go to state 53
state 44
(10) E -> WHILE LPAREN B RPAREN . DO LBRACE E RBRACE
DO shift and go to state 54
state 45
(13) D -> ID LPAREN V RPAREN . LBRACE E RBRACE
LBRACE shift and go to state 55
state 46
(16) V -> V COMMA . ID
ID shift and go to state 56
state 47
(12) A -> A COMMA E .
(4) E -> E . AOP E
(8) E -> E . SEMICOLON E
RPAREN reduce using rule 12 (A -> A COMMA E .)
COMMA reduce using rule 12 (A -> A COMMA E .)
AOP shift and go to state 8
SEMICOLON shift and go to state 9
state 48
(23) B -> LPAREN B RPAREN .
RPAREN reduce using rule 23 (B -> LPAREN B RPAREN .)
EQOP reduce using rule 23 (B -> LPAREN B RPAREN .)
LOP reduce using rule 23 (B -> LPAREN B RPAREN .)
state 49
(9) E -> IF LPAREN B RPAREN THEN . E ELSE E
(1) E -> . LET D IN E
(2) E -> . ID
(3) E -> . ID LPAREN A RPAREN
(4) E -> . E AOP E
(5) E -> . LPAREN E RPAREN
(6) E -> . CONST
(7) E -> . ID ASSIGN E
(8) E -> . E SEMICOLON E
(9) E -> . IF LPAREN B RPAREN THEN E ELSE E
(10) E -> . WHILE LPAREN B RPAREN DO LBRACE E RBRACE
LET shift and go to state 2
ID shift and go to state 3
LPAREN shift and go to state 4
CONST shift and go to state 5
IF shift and go to state 6
WHILE shift and go to state 7
E shift and go to state 57
state 50
(19) B -> B EQOP B .
(19) B -> B . EQOP B
(20) B -> B . LOP B
RPAREN reduce using rule 19 (B -> B EQOP B .)
EQOP reduce using rule 19 (B -> B EQOP B .)
LOP reduce using rule 19 (B -> B EQOP B .)
! EQOP [ shift and go to state 40 ]
! LOP [ shift and go to state 41 ]
state 51
(20) B -> B LOP B .
(19) B -> B . EQOP B
(20) B -> B . LOP B
! shift/reduce conflict for EQOP resolved as shift
! shift/reduce conflict for LOP resolved as shift
RPAREN reduce using rule 20 (B -> B LOP B .)
EQOP shift and go to state 40
LOP shift and go to state 41
! EQOP [ reduce using rule 20 (B -> B LOP B .) ]
! LOP [ reduce using rule 20 (B -> B LOP B .) ]
state 52
(17) B -> E EQOP E .
(4) E -> E . AOP E
(8) E -> E . SEMICOLON E
RPAREN reduce using rule 17 (B -> E EQOP E .)
EQOP reduce using rule 17 (B -> E EQOP E .)
LOP reduce using rule 17 (B -> E EQOP E .)
AOP shift and go to state 8
SEMICOLON shift and go to state 9
state 53
(18) B -> E COMP E .
(4) E -> E . AOP E
(8) E -> E . SEMICOLON E
RPAREN reduce using rule 18 (B -> E COMP E .)
EQOP reduce using rule 18 (B -> E COMP E .)
LOP reduce using rule 18 (B -> E COMP E .)
AOP shift and go to state 8
SEMICOLON shift and go to state 9
state 54
(10) E -> WHILE LPAREN B RPAREN DO . LBRACE E RBRACE
LBRACE shift and go to state 58
state 55
(13) D -> ID LPAREN V RPAREN LBRACE . E RBRACE
(1) E -> . LET D IN E
(2) E -> . ID
(3) E -> . ID LPAREN A RPAREN
(4) E -> . E AOP E
(5) E -> . LPAREN E RPAREN
(6) E -> . CONST
(7) E -> . ID ASSIGN E
(8) E -> . E SEMICOLON E
(9) E -> . IF LPAREN B RPAREN THEN E ELSE E
(10) E -> . WHILE LPAREN B RPAREN DO LBRACE E RBRACE
LET shift and go to state 2
ID shift and go to state 3
LPAREN shift and go to state 4
CONST shift and go to state 5
IF shift and go to state 6
WHILE shift and go to state 7
E shift and go to state 59
state 56
(16) V -> V COMMA ID .
RPAREN reduce using rule 16 (V -> V COMMA ID .)
COMMA reduce using rule 16 (V -> V COMMA ID .)
state 57
(9) E -> IF LPAREN B RPAREN THEN E . ELSE E
(4) E -> E . AOP E
(8) E -> E . SEMICOLON E
ELSE shift and go to state 60
AOP shift and go to state 8
SEMICOLON shift and go to state 9
state 58
(10) E -> WHILE LPAREN B RPAREN DO LBRACE . E RBRACE
(1) E -> . LET D IN E
(2) E -> . ID
(3) E -> . ID LPAREN A RPAREN
(4) E -> . E AOP E
(5) E -> . LPAREN E RPAREN
(6) E -> . CONST
(7) E -> . ID ASSIGN E
(8) E -> . E SEMICOLON E
(9) E -> . IF LPAREN B RPAREN THEN E ELSE E
(10) E -> . WHILE LPAREN B RPAREN DO LBRACE E RBRACE
LET shift and go to state 2
ID shift and go to state 3
LPAREN shift and go to state 4
CONST shift and go to state 5
IF shift and go to state 6
WHILE shift and go to state 7
E shift and go to state 61
state 59
(13) D -> ID LPAREN V RPAREN LBRACE E . RBRACE
(4) E -> E . AOP E
(8) E -> E . SEMICOLON E
RBRACE shift and go to state 62
AOP shift and go to state 8
SEMICOLON shift and go to state 9
state 60
(9) E -> IF LPAREN B RPAREN THEN E ELSE . E
(1) E -> . LET D IN E
(2) E -> . ID
(3) E -> . ID LPAREN A RPAREN
(4) E -> . E AOP E
(5) E -> . LPAREN E RPAREN
(6) E -> . CONST
(7) E -> . ID ASSIGN E
(8) E -> . E SEMICOLON E
(9) E -> . IF LPAREN B RPAREN THEN E ELSE E
(10) E -> . WHILE LPAREN B RPAREN DO LBRACE E RBRACE
LET shift and go to state 2
ID shift and go to state 3
LPAREN shift and go to state 4
CONST shift and go to state 5
IF shift and go to state 6
WHILE shift and go to state 7
E shift and go to state 63
state 61
(10) E -> WHILE LPAREN B RPAREN DO LBRACE E . RBRACE
(4) E -> E . AOP E
(8) E -> E . SEMICOLON E
RBRACE shift and go to state 64
AOP shift and go to state 8
SEMICOLON shift and go to state 9
state 62
(13) D -> ID LPAREN V RPAREN LBRACE E RBRACE .
IN reduce using rule 13 (D -> ID LPAREN V RPAREN LBRACE E RBRACE .)
ID reduce using rule 13 (D -> ID LPAREN V RPAREN LBRACE E RBRACE .)
state 63
(9) E -> IF LPAREN B RPAREN THEN E ELSE E .
(4) E -> E . AOP E
(8) E -> E . SEMICOLON E
! shift/reduce conflict for AOP resolved as shift
! shift/reduce conflict for SEMICOLON resolved as shift
$end reduce using rule 9 (E -> IF LPAREN B RPAREN THEN E ELSE E .)
RPAREN reduce using rule 9 (E -> IF LPAREN B RPAREN THEN E ELSE E .)
COMMA reduce using rule 9 (E -> IF LPAREN B RPAREN THEN E ELSE E .)
EQOP reduce using rule 9 (E -> IF LPAREN B RPAREN THEN E ELSE E .)
COMP reduce using rule 9 (E -> IF LPAREN B RPAREN THEN E ELSE E .)
LOP reduce using rule 9 (E -> IF LPAREN B RPAREN THEN E ELSE E .)
ELSE reduce using rule 9 (E -> IF LPAREN B RPAREN THEN E ELSE E .)
RBRACE reduce using rule 9 (E -> IF LPAREN B RPAREN THEN E ELSE E .)
AOP shift and go to state 8
SEMICOLON shift and go to state 9
! AOP [ reduce using rule 9 (E -> IF LPAREN B RPAREN THEN E ELSE E .) ]
! SEMICOLON [ reduce using rule 9 (E -> IF LPAREN B RPAREN THEN E ELSE E .) ]
state 64
(10) E -> WHILE LPAREN B RPAREN DO LBRACE E RBRACE .
AOP reduce using rule 10 (E -> WHILE LPAREN B RPAREN DO LBRACE E RBRACE .)
SEMICOLON reduce using rule 10 (E -> WHILE LPAREN B RPAREN DO LBRACE E RBRACE .)
$end reduce using rule 10 (E -> WHILE LPAREN B RPAREN DO LBRACE E RBRACE .)
RPAREN reduce using rule 10 (E -> WHILE LPAREN B RPAREN DO LBRACE E RBRACE .)
COMMA reduce using rule 10 (E -> WHILE LPAREN B RPAREN DO LBRACE E RBRACE .)
EQOP reduce using rule 10 (E -> WHILE LPAREN B RPAREN DO LBRACE E RBRACE .)
COMP reduce using rule 10 (E -> WHILE LPAREN B RPAREN DO LBRACE E RBRACE .)
LOP reduce using rule 10 (E -> WHILE LPAREN B RPAREN DO LBRACE E RBRACE .)
ELSE reduce using rule 10 (E -> WHILE LPAREN B RPAREN DO LBRACE E RBRACE .)
RBRACE reduce using rule 10 (E -> WHILE LPAREN B RPAREN DO LBRACE E RBRACE .)
WARNING:
WARNING: Conflicts:
WARNING:
WARNING: shift/reduce conflict for AOP in state 18 resolved as shift
WARNING: shift/reduce conflict for SEMICOLON in state 18 resolved as shift
WARNING: shift/reduce conflict for ID in state 19 resolved as shift
WARNING: shift/reduce conflict for AOP in state 24 resolved as shift
WARNING: shift/reduce conflict for SEMICOLON in state 24 resolved as shift
WARNING: shift/reduce conflict for AOP in state 32 resolved as shift
WARNING: shift/reduce conflict for SEMICOLON in state 32 resolved as shift
WARNING: shift/reduce conflict for EQOP in state 51 resolved as shift
WARNING: shift/reduce conflict for LOP in state 51 resolved as shift
WARNING: shift/reduce conflict for AOP in state 63 resolved as shift
WARNING: shift/reduce conflict for SEMICOLON in state 63 resolved as shift