-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathparsetab.py
76 lines (69 loc) · 8.6 KB
/
parsetab.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# D:\junk\try2\cvx4py\parsetab.py
# This file is automatically generated. Do not edit.
_tabversion = '3.5'
_lr_method = 'LALR'
_lr_signature = '7FF1E0DEB3BA3B9A64F246F91CF98414'
_lr_action_items = {'GREATERTHANEQUAL':([11,13,14,15,24,25,29,35,55,58,59,62,66,67,],[-47,-46,-45,36,-47,-43,36,-44,-42,-39,-40,-41,-37,-38,]),'LESSTHAN':([11,13,14,15,24,25,29,35,55,58,59,62,66,67,],[-47,-46,-45,38,-47,-43,38,-44,-42,-39,-40,-41,-37,-38,]),'DUAL':([0,17,18,20,71,83,],[2,2,2,2,-13,-14,]),'MINUS':([0,3,8,11,13,14,15,17,18,19,20,23,24,25,29,32,34,35,36,37,38,39,40,41,42,48,53,55,58,59,60,61,62,63,64,65,66,67,71,83,],[3,3,3,-47,-46,-45,42,3,3,3,3,3,-47,-43,42,3,3,-44,3,3,3,3,3,3,3,42,42,-42,-39,-40,42,42,-41,42,42,42,-37,-38,-13,-14,]),'NL':([0,4,6,7,9,12,13,14,17,18,20,24,25,30,31,35,43,44,45,46,47,48,50,51,52,54,55,57,58,59,60,61,62,63,64,65,66,67,68,71,72,73,78,80,83,],[-4,-9,26,-12,-11,-10,-46,-45,-4,-4,-4,-47,-43,-15,-20,-44,-23,-16,69,-12,70,71,-17,-18,-29,-35,-42,-36,-39,-40,-31,-32,-41,-33,-34,-30,-37,-38,-22,-13,-28,-21,-19,83,-14,]),'SEMICOLON':([0,1,4,6,7,9,12,13,14,20,24,25,26,27,30,31,35,43,44,46,49,50,51,52,54,55,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,78,83,],[-4,17,-9,27,-12,-11,-10,-46,-45,-4,-47,-43,-5,-6,-15,-20,-44,-23,-16,-12,17,-17,-18,-29,-35,-42,-36,-39,-40,-31,-32,-41,-33,-34,-30,-37,-38,-22,-7,-8,-13,-28,-21,-19,-14,]),'VARIABLES':([0,2,17,18,20,71,83,],[16,22,16,16,16,-13,-14,]),'LESSTHANEQUAL':([11,13,14,15,24,25,29,35,55,58,59,62,66,67,],[-47,-46,-45,34,-47,-43,34,-44,-42,-39,-40,-41,-37,-38,]),'TRANSPOSE':([11,13,14,15,24,25,29,35,48,53,55,58,59,60,61,62,63,64,65,66,67,],[-47,-46,-45,35,-47,-43,35,-44,35,35,-42,-39,-40,35,35,-41,35,35,35,-37,-38,]),'PLUS':([11,13,14,15,24,25,29,35,48,53,55,58,59,60,61,62,63,64,65,66,67,],[-47,-46,-45,41,-47,-43,41,-44,41,41,-42,-39,-40,41,41,-41,41,41,41,-37,-38,]),'TO':([77,],[80,]),'COLON':([11,],[32,]),'LOGICALEQUAL':([11,13,14,15,24,25,29,35,55,58,59,62,66,67,],[-47,-46,-45,40,-47,-43,40,-44,-42,-39,-40,-41,-37,-38,]),'COMMA':([1,26,27,49,69,70,74,75,76,81,82,],[18,-5,-6,18,-7,-8,-26,79,-27,-25,-24,]),'$end':([0,5,7,20,26,27,49,69,70,71,83,],[-4,0,-3,-2,-5,-6,-1,-7,-8,-13,-14,]),'DIVIDE':([11,13,14,15,24,25,29,35,48,53,55,58,59,60,61,62,63,64,65,66,67,],[-47,-46,-45,33,-47,-43,33,-44,33,33,-42,-39,-40,33,33,-41,33,33,33,33,33,]),'TIMES':([11,13,14,15,24,25,29,35,48,53,55,58,59,60,61,62,63,64,65,66,67,],[-47,-46,-45,37,-47,-43,37,-44,37,37,-42,-39,-40,37,37,-41,37,37,37,37,37,]),'GREATERTHAN':([11,13,14,15,24,25,29,35,55,58,59,62,66,67,],[-47,-46,-45,39,-47,-43,39,-44,-42,-39,-40,-41,-37,-38,]),'LPAREN':([0,3,8,17,18,19,20,23,31,32,34,36,37,38,39,40,41,42,71,83,],[8,23,8,8,8,23,8,23,56,8,23,23,23,23,23,23,23,23,-13,-14,]),'VARIABLE':([0,2,17,18,20,71,83,],[10,21,10,10,10,-13,-14,]),'RPAREN':([13,14,24,25,28,29,35,53,54,55,56,58,59,60,61,62,63,64,65,66,67,74,75,76,81,82,],[-46,-45,-47,-43,54,55,-44,55,-35,-42,73,-39,-40,-31,-32,-41,-33,-34,-30,-37,-38,-26,78,-27,-25,-24,]),'ID':([0,3,8,10,16,17,18,19,20,21,22,23,31,32,34,36,37,38,39,40,41,42,43,44,51,52,56,68,71,72,73,78,79,83,],[11,24,24,31,31,11,11,24,11,50,52,24,-20,24,24,24,24,24,24,24,24,24,-23,31,72,-29,76,-22,-13,-28,-21,-19,82,-14,]),'INT':([0,3,8,17,18,19,20,23,32,33,34,36,37,38,39,40,41,42,56,71,79,83,],[13,13,13,13,13,13,13,13,13,58,13,13,13,13,13,13,13,13,74,-13,81,-14,]),'FLOAT':([0,3,8,17,18,19,20,23,32,33,34,36,37,38,39,40,41,42,71,83,],[14,14,14,14,14,14,14,14,14,59,14,14,14,14,14,14,14,14,-13,-14,]),'SENSE':([1,26,27,69,70,],[19,-5,-6,-7,-8,]),'SUBJECT':([71,],[77,]),}
_lr_action = {}
for _k, _v in _lr_action_items.items():
for _x,_y in zip(_v[0],_v[1]):
if not _x in _lr_action: _lr_action[_x] = {}
_lr_action[_x][_k] = _y
del _lr_action_items
_lr_goto_items = {'statements':([0,20,],[1,49,]),'idlist':([22,],[51,]),'constraint':([0,8,17,18,20,32,],[12,28,12,12,12,57,]),'create':([0,17,18,20,],[4,4,4,4,]),'dimlist':([56,],[75,]),'program':([0,],[5,]),'statement':([0,17,18,20,],[6,45,47,6,]),'dual_constraint':([0,17,18,20,],[9,9,9,9,]),'objective':([1,],[20,]),'array':([10,16,44,],[30,43,68,]),'expression':([0,3,8,17,18,19,20,23,32,34,36,37,38,39,40,41,42,],[15,25,29,15,15,48,15,53,15,60,61,62,63,64,65,66,67,]),'arraylist':([16,],[44,]),'empty':([0,17,18,20,],[7,46,46,46,]),}
_lr_goto = {}
for _k, _v in _lr_goto_items.items():
for _x, _y in zip(_v[0], _v[1]):
if not _x in _lr_goto: _lr_goto[_x] = {}
_lr_goto[_x][_k] = _y
del _lr_goto_items
_lr_productions = [
("S' -> program","S'",1,None,None,None),
('program -> statements objective statements','program',3,'p_program','cvxParser.py',54),
('program -> statements objective','program',2,'p_program','cvxParser.py',55),
('program -> empty','program',1,'p_program_empty','cvxParser.py',64),
('empty -> <empty>','empty',0,'p_empty','cvxParser.py',68),
('statements -> statement NL','statements',2,'p_statements_statement','cvxParser.py',73),
('statements -> statement SEMICOLON','statements',2,'p_statements_statement','cvxParser.py',74),
('statements -> statements SEMICOLON statement NL','statements',4,'p_statements_many_statement','cvxParser.py',78),
('statements -> statements COMMA statement NL','statements',4,'p_statements_many_statement','cvxParser.py',79),
('statement -> create','statement',1,'p_statement','cvxParser.py',86),
('statement -> constraint','statement',1,'p_statement','cvxParser.py',87),
('statement -> dual_constraint','statement',1,'p_statement','cvxParser.py',88),
('statement -> empty','statement',1,'p_statement','cvxParser.py',89),
('objective -> SENSE expression NL','objective',3,'p_objective','cvxParser.py',97),
('objective -> SENSE expression NL SUBJECT TO NL','objective',6,'p_objective','cvxParser.py',98),
('create -> VARIABLE array','create',2,'p_create_identifier','cvxParser.py',104),
('create -> VARIABLES arraylist','create',2,'p_create_identifiers','cvxParser.py',110),
('create -> DUAL VARIABLE ID','create',3,'p_create_dual_variable','cvxParser.py',115),
('create -> DUAL VARIABLES idlist','create',3,'p_create_dual_variables','cvxParser.py',120),
('array -> ID LPAREN dimlist RPAREN','array',4,'p_array_identifier','cvxParser.py',124),
('array -> ID','array',1,'p_array_identifier_scalar','cvxParser.py',129),
('array -> ID LPAREN RPAREN','array',3,'p_array_identifier_scalar','cvxParser.py',130),
('arraylist -> arraylist array','arraylist',2,'p_arraylist_list','cvxParser.py',136),
('arraylist -> array','arraylist',1,'p_arraylist_array','cvxParser.py',140),
('dimlist -> dimlist COMMA ID','dimlist',3,'p_dimlist_list','cvxParser.py',147),
('dimlist -> dimlist COMMA INT','dimlist',3,'p_dimlist_list','cvxParser.py',148),
('dimlist -> INT','dimlist',1,'p_dimlist_singleton','cvxParser.py',154),
('dimlist -> ID','dimlist',1,'p_dimlist_singleton','cvxParser.py',155),
('idlist -> idlist ID','idlist',2,'p_idlist_list','cvxParser.py',162),
('idlist -> ID','idlist',1,'p_idlist_id','cvxParser.py',167),
('constraint -> expression LOGICALEQUAL expression','constraint',3,'p_constraint','cvxParser.py',174),
('constraint -> expression LESSTHANEQUAL expression','constraint',3,'p_constraint','cvxParser.py',175),
('constraint -> expression GREATERTHANEQUAL expression','constraint',3,'p_constraint','cvxParser.py',176),
('constraint -> expression LESSTHAN expression','constraint',3,'p_constraint','cvxParser.py',177),
('constraint -> expression GREATERTHAN expression','constraint',3,'p_constraint','cvxParser.py',178),
('constraint -> LPAREN constraint RPAREN','constraint',3,'p_constraint_parens','cvxParser.py',192),
('dual_constraint -> ID COLON constraint','dual_constraint',3,'p_dual_constraint','cvxParser.py',197),
('expression -> expression PLUS expression','expression',3,'p_expression_add','cvxParser.py',210),
('expression -> expression MINUS expression','expression',3,'p_expression_minus','cvxParser.py',214),
('expression -> expression DIVIDE INT','expression',3,'p_expression_divide','cvxParser.py',219),
('expression -> expression DIVIDE FLOAT','expression',3,'p_expression_divide','cvxParser.py',220),
('expression -> expression TIMES expression','expression',3,'p_expression_multiply','cvxParser.py',228),
('expression -> LPAREN expression RPAREN','expression',3,'p_expression_group','cvxParser.py',232),
('expression -> MINUS expression','expression',2,'p_expression_negate','cvxParser.py',236),
('expression -> expression TRANSPOSE','expression',2,'p_expression_transpose','cvxParser.py',241),
('expression -> FLOAT','expression',1,'p_expression_constant','cvxParser.py',246),
('expression -> INT','expression',1,'p_expression_constant','cvxParser.py',247),
('expression -> ID','expression',1,'p_expression_constant','cvxParser.py',248),
]