Fix V->V rule

This commit is contained in:
Jan-Niclas Loosen
2025-11-25 16:30:48 +01:00
parent ee0e5b0b4c
commit 3cf18b9678
3 changed files with 24 additions and 16 deletions

View File

@@ -18,7 +18,7 @@ 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 16 V -> V COMMA V
Rule 17 B -> E EQOP E
Rule 18 B -> E COMP E
Rule 19 B -> B EQOP B
@@ -38,7 +38,7 @@ DO : 10
ELSE : 9
EQOP : 17 19
FALSE : 22
ID : 2 3 7 13 15 16
ID : 2 3 7 13 15
IF : 9
IN : 1
LBRACE : 10 13
@@ -59,7 +59,7 @@ 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
V : 13 16 16
Parsing method: LALR
@@ -541,7 +541,7 @@ state 25
(13) D -> ID LPAREN . V RPAREN LBRACE E RBRACE
(15) V -> . ID
(16) V -> . V COMMA ID
(16) V -> . V COMMA V
ID shift and go to state 39
@@ -815,7 +815,7 @@ state 39
state 40
(13) D -> ID LPAREN V . RPAREN LBRACE E RBRACE
(16) V -> V . COMMA ID
(16) V -> V . COMMA V
RPAREN shift and go to state 50
COMMA shift and go to state 51
@@ -980,10 +980,13 @@ state 50
state 51
(16) V -> V COMMA . ID
(16) V -> V COMMA . V
(15) V -> . ID
(16) V -> . V COMMA V
ID shift and go to state 56
ID shift and go to state 39
V shift and go to state 56
state 52
@@ -1056,10 +1059,14 @@ state 55
state 56
(16) V -> V COMMA ID .
(16) V -> V COMMA V .
(16) V -> V . COMMA V
RPAREN reduce using rule 16 (V -> V COMMA ID .)
COMMA reduce using rule 16 (V -> V COMMA ID .)
! shift/reduce conflict for COMMA resolved as shift
RPAREN reduce using rule 16 (V -> V COMMA V .)
COMMA shift and go to state 51
! COMMA [ reduce using rule 16 (V -> V COMMA V .) ]
state 57
@@ -1135,5 +1142,6 @@ WARNING: shift/reduce conflict for AOP in state 38 resolved as shift
WARNING: shift/reduce conflict for SEMICOLON in state 38 resolved as shift
WARNING: shift/reduce conflict for EQOP in state 45 resolved as shift
WARNING: shift/reduce conflict for LOP in state 45 resolved as shift
WARNING: shift/reduce conflict for COMMA in state 56 resolved as shift
WARNING: shift/reduce conflict for AOP in state 57 resolved as shift
WARNING: shift/reduce conflict for SEMICOLON in state 57 resolved as shift