Skip to content

Commit

Permalink
Changed some tokens and precedence rules to avoid conflicts of the pa…
Browse files Browse the repository at this point in the history
…rser.
  • Loading branch information
peunsu committed May 12, 2024
1 parent e5c75aa commit 3339b93
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 91 deletions.
2 changes: 1 addition & 1 deletion ftb_snbt_lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
from .tag import *
from .write import *

__version__ = '0.2.3'
__version__ = '0.3.0'
__all__ = ['parse', 'tag', 'write']
4 changes: 2 additions & 2 deletions ftb_snbt_lib/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def p_list(p):
p[0] = List(p[2])

def p_array(p):
"""array : LBRACKET NAME SEMICOLON values RBRACKET
| LBRACKET NAME SEMICOLON RBRACKET"""
"""array : LBRACKET TYPE SEMICOLON values RBRACKET
| LBRACKET TYPE SEMICOLON RBRACKET"""
if len(p) == 4:
p[0] = Array(p[2], [])
else:
Expand Down
113 changes: 57 additions & 56 deletions ftb_snbt_lib/parser.out
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Rule 18 value -> INTEGER
Rule 19 value -> STRING
Rule 20 list -> LBRACKET values RBRACKET
Rule 21 list -> LBRACKET RBRACKET
Rule 22 array -> LBRACKET NAME SEMICOLON values RBRACKET
Rule 23 array -> LBRACKET NAME SEMICOLON RBRACKET
Rule 22 array -> LBRACKET TYPE SEMICOLON values RBRACKET
Rule 23 array -> LBRACKET TYPE SEMICOLON RBRACKET
Rule 24 values -> values value
Rule 25 values -> values COMMA value
Rule 26 values -> value
Expand All @@ -42,12 +42,13 @@ INTEGER : 18
LBRACE : 2 3
LBRACKET : 20 21 22 23
LONG : 17
NAME : 7 22 23
NAME : 7
RBRACE : 2 3
RBRACKET : 20 21 22 23
SEMICOLON : 22 23
SHORT : 14
STRING : 8 19
TYPE : 22 23
error :

Nonterminals, with rules where they appear
Expand Down Expand Up @@ -225,8 +226,8 @@ state 12
(3) compound -> . LBRACE RBRACE
(20) list -> . LBRACKET values RBRACKET
(21) list -> . LBRACKET RBRACKET
(22) array -> . LBRACKET NAME SEMICOLON values RBRACKET
(23) array -> . LBRACKET NAME SEMICOLON RBRACKET
(22) array -> . LBRACKET TYPE SEMICOLON values RBRACKET
(23) array -> . LBRACKET TYPE SEMICOLON RBRACKET

BOOL shift and go to state 19
BYTE shift and go to state 20
Expand Down Expand Up @@ -262,8 +263,8 @@ state 13
(3) compound -> . LBRACE RBRACE
(20) list -> . LBRACKET values RBRACKET
(21) list -> . LBRACKET RBRACKET
(22) array -> . LBRACKET NAME SEMICOLON values RBRACKET
(23) array -> . LBRACKET NAME SEMICOLON RBRACKET
(22) array -> . LBRACKET TYPE SEMICOLON values RBRACKET
(23) array -> . LBRACKET TYPE SEMICOLON RBRACKET

BOOL shift and go to state 19
BYTE shift and go to state 20
Expand Down Expand Up @@ -525,8 +526,8 @@ state 27

(20) list -> LBRACKET . values RBRACKET
(21) list -> LBRACKET . RBRACKET
(22) array -> LBRACKET . NAME SEMICOLON values RBRACKET
(23) array -> LBRACKET . NAME SEMICOLON RBRACKET
(22) array -> LBRACKET . TYPE SEMICOLON values RBRACKET
(23) array -> LBRACKET . TYPE SEMICOLON RBRACKET
(24) values -> . values value
(25) values -> . values COMMA value
(26) values -> . value
Expand All @@ -545,11 +546,11 @@ state 27
(3) compound -> . LBRACE RBRACE
(20) list -> . LBRACKET values RBRACKET
(21) list -> . LBRACKET RBRACKET
(22) array -> . LBRACKET NAME SEMICOLON values RBRACKET
(23) array -> . LBRACKET NAME SEMICOLON RBRACKET
(22) array -> . LBRACKET TYPE SEMICOLON values RBRACKET
(23) array -> . LBRACKET TYPE SEMICOLON RBRACKET

RBRACKET shift and go to state 30
NAME shift and go to state 31
TYPE shift and go to state 31
BOOL shift and go to state 19
BYTE shift and go to state 20
SHORT shift and go to state 21
Expand Down Expand Up @@ -597,8 +598,8 @@ state 29
(3) compound -> . LBRACE RBRACE
(20) list -> . LBRACKET values RBRACKET
(21) list -> . LBRACKET RBRACKET
(22) array -> . LBRACKET NAME SEMICOLON values RBRACKET
(23) array -> . LBRACKET NAME SEMICOLON RBRACKET
(22) array -> . LBRACKET TYPE SEMICOLON values RBRACKET
(23) array -> . LBRACKET TYPE SEMICOLON RBRACKET

RBRACKET shift and go to state 33
COMMA shift and go to state 35
Expand Down Expand Up @@ -640,8 +641,8 @@ state 30

state 31

(22) array -> LBRACKET NAME . SEMICOLON values RBRACKET
(23) array -> LBRACKET NAME . SEMICOLON RBRACKET
(22) array -> LBRACKET TYPE . SEMICOLON values RBRACKET
(23) array -> LBRACKET TYPE . SEMICOLON RBRACKET

SEMICOLON shift and go to state 36

Expand Down Expand Up @@ -720,8 +721,8 @@ state 35
(3) compound -> . LBRACE RBRACE
(20) list -> . LBRACKET values RBRACKET
(21) list -> . LBRACKET RBRACKET
(22) array -> . LBRACKET NAME SEMICOLON values RBRACKET
(23) array -> . LBRACKET NAME SEMICOLON RBRACKET
(22) array -> . LBRACKET TYPE SEMICOLON values RBRACKET
(23) array -> . LBRACKET TYPE SEMICOLON RBRACKET

BOOL shift and go to state 19
BYTE shift and go to state 20
Expand All @@ -741,8 +742,8 @@ state 35

state 36

(22) array -> LBRACKET NAME SEMICOLON . values RBRACKET
(23) array -> LBRACKET NAME SEMICOLON . RBRACKET
(22) array -> LBRACKET TYPE SEMICOLON . values RBRACKET
(23) array -> LBRACKET TYPE SEMICOLON . RBRACKET
(24) values -> . values value
(25) values -> . values COMMA value
(26) values -> . value
Expand All @@ -761,8 +762,8 @@ state 36
(3) compound -> . LBRACE RBRACE
(20) list -> . LBRACKET values RBRACKET
(21) list -> . LBRACKET RBRACKET
(22) array -> . LBRACKET NAME SEMICOLON values RBRACKET
(23) array -> . LBRACKET NAME SEMICOLON RBRACKET
(22) array -> . LBRACKET TYPE SEMICOLON values RBRACKET
(23) array -> . LBRACKET TYPE SEMICOLON RBRACKET

RBRACKET shift and go to state 39
BOOL shift and go to state 19
Expand Down Expand Up @@ -802,7 +803,7 @@ state 37

state 38

(22) array -> LBRACKET NAME SEMICOLON values . RBRACKET
(22) array -> LBRACKET TYPE SEMICOLON values . RBRACKET
(24) values -> values . value
(25) values -> values . COMMA value
(9) value -> . compound
Expand All @@ -820,8 +821,8 @@ state 38
(3) compound -> . LBRACE RBRACE
(20) list -> . LBRACKET values RBRACKET
(21) list -> . LBRACKET RBRACKET
(22) array -> . LBRACKET NAME SEMICOLON values RBRACKET
(23) array -> . LBRACKET NAME SEMICOLON RBRACKET
(22) array -> . LBRACKET TYPE SEMICOLON values RBRACKET
(23) array -> . LBRACKET TYPE SEMICOLON RBRACKET

RBRACKET shift and go to state 40
COMMA shift and go to state 35
Expand All @@ -843,40 +844,40 @@ state 38

state 39

(23) array -> LBRACKET NAME SEMICOLON RBRACKET .
(23) array -> LBRACKET TYPE SEMICOLON RBRACKET .

RBRACE reduce using rule 23 (array -> LBRACKET NAME SEMICOLON RBRACKET .)
COMMA reduce using rule 23 (array -> LBRACKET NAME SEMICOLON RBRACKET .)
NAME reduce using rule 23 (array -> LBRACKET NAME SEMICOLON RBRACKET .)
STRING reduce using rule 23 (array -> LBRACKET NAME SEMICOLON RBRACKET .)
RBRACKET reduce using rule 23 (array -> LBRACKET NAME SEMICOLON RBRACKET .)
BOOL reduce using rule 23 (array -> LBRACKET NAME SEMICOLON RBRACKET .)
BYTE reduce using rule 23 (array -> LBRACKET NAME SEMICOLON RBRACKET .)
SHORT reduce using rule 23 (array -> LBRACKET NAME SEMICOLON RBRACKET .)
FLOAT reduce using rule 23 (array -> LBRACKET NAME SEMICOLON RBRACKET .)
DOUBLE reduce using rule 23 (array -> LBRACKET NAME SEMICOLON RBRACKET .)
LONG reduce using rule 23 (array -> LBRACKET NAME SEMICOLON RBRACKET .)
INTEGER reduce using rule 23 (array -> LBRACKET NAME SEMICOLON RBRACKET .)
LBRACE reduce using rule 23 (array -> LBRACKET NAME SEMICOLON RBRACKET .)
LBRACKET reduce using rule 23 (array -> LBRACKET NAME SEMICOLON RBRACKET .)
RBRACE reduce using rule 23 (array -> LBRACKET TYPE SEMICOLON RBRACKET .)
COMMA reduce using rule 23 (array -> LBRACKET TYPE SEMICOLON RBRACKET .)
NAME reduce using rule 23 (array -> LBRACKET TYPE SEMICOLON RBRACKET .)
STRING reduce using rule 23 (array -> LBRACKET TYPE SEMICOLON RBRACKET .)
RBRACKET reduce using rule 23 (array -> LBRACKET TYPE SEMICOLON RBRACKET .)
BOOL reduce using rule 23 (array -> LBRACKET TYPE SEMICOLON RBRACKET .)
BYTE reduce using rule 23 (array -> LBRACKET TYPE SEMICOLON RBRACKET .)
SHORT reduce using rule 23 (array -> LBRACKET TYPE SEMICOLON RBRACKET .)
FLOAT reduce using rule 23 (array -> LBRACKET TYPE SEMICOLON RBRACKET .)
DOUBLE reduce using rule 23 (array -> LBRACKET TYPE SEMICOLON RBRACKET .)
LONG reduce using rule 23 (array -> LBRACKET TYPE SEMICOLON RBRACKET .)
INTEGER reduce using rule 23 (array -> LBRACKET TYPE SEMICOLON RBRACKET .)
LBRACE reduce using rule 23 (array -> LBRACKET TYPE SEMICOLON RBRACKET .)
LBRACKET reduce using rule 23 (array -> LBRACKET TYPE SEMICOLON RBRACKET .)


state 40

(22) array -> LBRACKET NAME SEMICOLON values RBRACKET .

RBRACE reduce using rule 22 (array -> LBRACKET NAME SEMICOLON values RBRACKET .)
COMMA reduce using rule 22 (array -> LBRACKET NAME SEMICOLON values RBRACKET .)
NAME reduce using rule 22 (array -> LBRACKET NAME SEMICOLON values RBRACKET .)
STRING reduce using rule 22 (array -> LBRACKET NAME SEMICOLON values RBRACKET .)
RBRACKET reduce using rule 22 (array -> LBRACKET NAME SEMICOLON values RBRACKET .)
BOOL reduce using rule 22 (array -> LBRACKET NAME SEMICOLON values RBRACKET .)
BYTE reduce using rule 22 (array -> LBRACKET NAME SEMICOLON values RBRACKET .)
SHORT reduce using rule 22 (array -> LBRACKET NAME SEMICOLON values RBRACKET .)
FLOAT reduce using rule 22 (array -> LBRACKET NAME SEMICOLON values RBRACKET .)
DOUBLE reduce using rule 22 (array -> LBRACKET NAME SEMICOLON values RBRACKET .)
LONG reduce using rule 22 (array -> LBRACKET NAME SEMICOLON values RBRACKET .)
INTEGER reduce using rule 22 (array -> LBRACKET NAME SEMICOLON values RBRACKET .)
LBRACE reduce using rule 22 (array -> LBRACKET NAME SEMICOLON values RBRACKET .)
LBRACKET reduce using rule 22 (array -> LBRACKET NAME SEMICOLON values RBRACKET .)
(22) array -> LBRACKET TYPE SEMICOLON values RBRACKET .

RBRACE reduce using rule 22 (array -> LBRACKET TYPE SEMICOLON values RBRACKET .)
COMMA reduce using rule 22 (array -> LBRACKET TYPE SEMICOLON values RBRACKET .)
NAME reduce using rule 22 (array -> LBRACKET TYPE SEMICOLON values RBRACKET .)
STRING reduce using rule 22 (array -> LBRACKET TYPE SEMICOLON values RBRACKET .)
RBRACKET reduce using rule 22 (array -> LBRACKET TYPE SEMICOLON values RBRACKET .)
BOOL reduce using rule 22 (array -> LBRACKET TYPE SEMICOLON values RBRACKET .)
BYTE reduce using rule 22 (array -> LBRACKET TYPE SEMICOLON values RBRACKET .)
SHORT reduce using rule 22 (array -> LBRACKET TYPE SEMICOLON values RBRACKET .)
FLOAT reduce using rule 22 (array -> LBRACKET TYPE SEMICOLON values RBRACKET .)
DOUBLE reduce using rule 22 (array -> LBRACKET TYPE SEMICOLON values RBRACKET .)
LONG reduce using rule 22 (array -> LBRACKET TYPE SEMICOLON values RBRACKET .)
INTEGER reduce using rule 22 (array -> LBRACKET TYPE SEMICOLON values RBRACKET .)
LBRACE reduce using rule 22 (array -> LBRACKET TYPE SEMICOLON values RBRACKET .)
LBRACKET reduce using rule 22 (array -> LBRACKET TYPE SEMICOLON values RBRACKET .)

8 changes: 4 additions & 4 deletions ftb_snbt_lib/parsetab.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

_lr_method = 'LALR'

_lr_signature = 'BOOL BYTE COLON COMMA DOUBLE FLOAT INTEGER LBRACE LBRACKET LONG NAME RBRACE RBRACKET SEMICOLON SHORT STRINGsnbt : compoundcompound : LBRACE key_value_pairs RBRACE\n | LBRACE RBRACEkey_value_pairs : key_value_pairs key_value_pair\n | key_value_pairs COMMA key_value_pair\n | key_value_pairkey_value_pair : NAME COLON value\n | STRING COLON valuevalue : compound\n | list\n | array\n | BOOL\n | BYTE\n | SHORT\n | FLOAT\n | DOUBLE\n | LONG\n | INTEGER\n | STRINGlist : LBRACKET values RBRACKET\n | LBRACKET RBRACKETarray : LBRACKET NAME SEMICOLON values RBRACKET\n | LBRACKET NAME SEMICOLON RBRACKETvalues : values value\n | values COMMA value\n | value'
_lr_signature = 'BOOL BYTE COLON COMMA DOUBLE FLOAT INTEGER LBRACE LBRACKET LONG NAME RBRACE RBRACKET SEMICOLON SHORT STRING TYPEsnbt : compoundcompound : LBRACE key_value_pairs RBRACE\n | LBRACE RBRACEkey_value_pairs : key_value_pairs key_value_pair\n | key_value_pairs COMMA key_value_pair\n | key_value_pairkey_value_pair : NAME COLON value\n | STRING COLON valuevalue : compound\n | list\n | array\n | BOOL\n | BYTE\n | SHORT\n | FLOAT\n | DOUBLE\n | LONG\n | INTEGER\n | STRINGlist : LBRACKET values RBRACKET\n | LBRACKET RBRACKETarray : LBRACKET TYPE SEMICOLON values RBRACKET\n | LBRACKET TYPE SEMICOLON RBRACKETvalues : values value\n | values COMMA value\n | value'

_lr_action_items = {'LBRACE':([0,5,9,12,13,16,17,18,19,20,21,22,23,24,25,26,27,29,30,32,33,34,35,36,37,38,39,40,],[3,-3,-2,3,3,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,3,3,-21,-26,-20,-24,3,3,-25,3,-23,-22,]),'$end':([1,2,5,9,],[0,-1,-3,-2,]),'RBRACE':([3,4,5,6,9,10,14,15,16,17,18,19,20,21,22,23,24,25,26,28,30,33,39,40,],[5,9,-3,-6,-2,-4,-5,-7,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,-8,-21,-20,-23,-22,]),'NAME':([3,4,5,6,9,10,11,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,30,33,39,40,],[7,7,-3,-6,-2,-4,7,-5,-7,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,31,-8,-21,-20,-23,-22,]),'STRING':([3,4,5,6,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,],[8,8,-3,-6,-2,-4,8,26,26,-5,-7,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,26,-8,26,-21,-26,-20,-24,26,26,-25,26,-23,-22,]),'COMMA':([4,5,6,9,10,14,15,16,17,18,19,20,21,22,23,24,25,26,28,29,30,32,33,34,37,38,39,40,],[11,-3,-6,-2,-4,-5,-7,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,-8,35,-21,-26,-20,-24,-25,35,-23,-22,]),'RBRACKET':([5,9,16,17,18,19,20,21,22,23,24,25,26,27,29,30,32,33,34,36,37,38,39,40,],[-3,-2,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,30,33,-21,-26,-20,-24,39,-25,40,-23,-22,]),'BOOL':([5,9,12,13,16,17,18,19,20,21,22,23,24,25,26,27,29,30,32,33,34,35,36,37,38,39,40,],[-3,-2,19,19,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,19,19,-21,-26,-20,-24,19,19,-25,19,-23,-22,]),'BYTE':([5,9,12,13,16,17,18,19,20,21,22,23,24,25,26,27,29,30,32,33,34,35,36,37,38,39,40,],[-3,-2,20,20,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,20,20,-21,-26,-20,-24,20,20,-25,20,-23,-22,]),'SHORT':([5,9,12,13,16,17,18,19,20,21,22,23,24,25,26,27,29,30,32,33,34,35,36,37,38,39,40,],[-3,-2,21,21,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,21,21,-21,-26,-20,-24,21,21,-25,21,-23,-22,]),'FLOAT':([5,9,12,13,16,17,18,19,20,21,22,23,24,25,26,27,29,30,32,33,34,35,36,37,38,39,40,],[-3,-2,22,22,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,22,22,-21,-26,-20,-24,22,22,-25,22,-23,-22,]),'DOUBLE':([5,9,12,13,16,17,18,19,20,21,22,23,24,25,26,27,29,30,32,33,34,35,36,37,38,39,40,],[-3,-2,23,23,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,23,23,-21,-26,-20,-24,23,23,-25,23,-23,-22,]),'LONG':([5,9,12,13,16,17,18,19,20,21,22,23,24,25,26,27,29,30,32,33,34,35,36,37,38,39,40,],[-3,-2,24,24,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,24,24,-21,-26,-20,-24,24,24,-25,24,-23,-22,]),'INTEGER':([5,9,12,13,16,17,18,19,20,21,22,23,24,25,26,27,29,30,32,33,34,35,36,37,38,39,40,],[-3,-2,25,25,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,25,25,-21,-26,-20,-24,25,25,-25,25,-23,-22,]),'LBRACKET':([5,9,12,13,16,17,18,19,20,21,22,23,24,25,26,27,29,30,32,33,34,35,36,37,38,39,40,],[-3,-2,27,27,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,27,27,-21,-26,-20,-24,27,27,-25,27,-23,-22,]),'COLON':([7,8,],[12,13,]),'SEMICOLON':([31,],[36,]),}
_lr_action_items = {'LBRACE':([0,5,9,12,13,16,17,18,19,20,21,22,23,24,25,26,27,29,30,32,33,34,35,36,37,38,39,40,],[3,-3,-2,3,3,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,3,3,-21,-26,-20,-24,3,3,-25,3,-23,-22,]),'$end':([1,2,5,9,],[0,-1,-3,-2,]),'RBRACE':([3,4,5,6,9,10,14,15,16,17,18,19,20,21,22,23,24,25,26,28,30,33,39,40,],[5,9,-3,-6,-2,-4,-5,-7,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,-8,-21,-20,-23,-22,]),'NAME':([3,4,5,6,9,10,11,14,15,16,17,18,19,20,21,22,23,24,25,26,28,30,33,39,40,],[7,7,-3,-6,-2,-4,7,-5,-7,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,-8,-21,-20,-23,-22,]),'STRING':([3,4,5,6,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,],[8,8,-3,-6,-2,-4,8,26,26,-5,-7,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,26,-8,26,-21,-26,-20,-24,26,26,-25,26,-23,-22,]),'COMMA':([4,5,6,9,10,14,15,16,17,18,19,20,21,22,23,24,25,26,28,29,30,32,33,34,37,38,39,40,],[11,-3,-6,-2,-4,-5,-7,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,-8,35,-21,-26,-20,-24,-25,35,-23,-22,]),'RBRACKET':([5,9,16,17,18,19,20,21,22,23,24,25,26,27,29,30,32,33,34,36,37,38,39,40,],[-3,-2,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,30,33,-21,-26,-20,-24,39,-25,40,-23,-22,]),'BOOL':([5,9,12,13,16,17,18,19,20,21,22,23,24,25,26,27,29,30,32,33,34,35,36,37,38,39,40,],[-3,-2,19,19,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,19,19,-21,-26,-20,-24,19,19,-25,19,-23,-22,]),'BYTE':([5,9,12,13,16,17,18,19,20,21,22,23,24,25,26,27,29,30,32,33,34,35,36,37,38,39,40,],[-3,-2,20,20,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,20,20,-21,-26,-20,-24,20,20,-25,20,-23,-22,]),'SHORT':([5,9,12,13,16,17,18,19,20,21,22,23,24,25,26,27,29,30,32,33,34,35,36,37,38,39,40,],[-3,-2,21,21,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,21,21,-21,-26,-20,-24,21,21,-25,21,-23,-22,]),'FLOAT':([5,9,12,13,16,17,18,19,20,21,22,23,24,25,26,27,29,30,32,33,34,35,36,37,38,39,40,],[-3,-2,22,22,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,22,22,-21,-26,-20,-24,22,22,-25,22,-23,-22,]),'DOUBLE':([5,9,12,13,16,17,18,19,20,21,22,23,24,25,26,27,29,30,32,33,34,35,36,37,38,39,40,],[-3,-2,23,23,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,23,23,-21,-26,-20,-24,23,23,-25,23,-23,-22,]),'LONG':([5,9,12,13,16,17,18,19,20,21,22,23,24,25,26,27,29,30,32,33,34,35,36,37,38,39,40,],[-3,-2,24,24,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,24,24,-21,-26,-20,-24,24,24,-25,24,-23,-22,]),'INTEGER':([5,9,12,13,16,17,18,19,20,21,22,23,24,25,26,27,29,30,32,33,34,35,36,37,38,39,40,],[-3,-2,25,25,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,25,25,-21,-26,-20,-24,25,25,-25,25,-23,-22,]),'LBRACKET':([5,9,12,13,16,17,18,19,20,21,22,23,24,25,26,27,29,30,32,33,34,35,36,37,38,39,40,],[-3,-2,27,27,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,27,27,-21,-26,-20,-24,27,27,-25,27,-23,-22,]),'COLON':([7,8,],[12,13,]),'TYPE':([27,],[31,]),'SEMICOLON':([31,],[36,]),}

_lr_action = {}
for _k, _v in _lr_action_items.items():
Expand Down Expand Up @@ -48,8 +48,8 @@
('value -> STRING','value',1,'p_value','parse.py',46),
('list -> LBRACKET values RBRACKET','list',3,'p_list','parse.py',50),
('list -> LBRACKET RBRACKET','list',2,'p_list','parse.py',51),
('array -> LBRACKET NAME SEMICOLON values RBRACKET','array',5,'p_array','parse.py',58),
('array -> LBRACKET NAME SEMICOLON RBRACKET','array',4,'p_array','parse.py',59),
('array -> LBRACKET TYPE SEMICOLON values RBRACKET','array',5,'p_array','parse.py',58),
('array -> LBRACKET TYPE SEMICOLON RBRACKET','array',4,'p_array','parse.py',59),
('values -> values value','values',2,'p_values','parse.py',66),
('values -> values COMMA value','values',3,'p_values','parse.py',67),
('values -> value','values',1,'p_values','parse.py',68),
Expand Down
Loading

0 comments on commit 3339b93

Please sign in to comment.