-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparsetab.py
105 lines (98 loc) · 19.8 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# parsetab.py
# This file is automatically generated. Do not edit.
# pylint: disable=W,C,R
_tabversion = '3.10'
_lr_method = 'LALR'
_lr_signature = 'AND ASSIGN COLON COMMA COMMENT DIVIDE DO DOT ELSE END EQ EXIT FLOAT GT GTE ID IF INT INTEGER LPAREN LT LTE MINUS NEQ OR PLUS PRINT PROGRAM READ REAL RPAREN SEMICOLON STRING SUBROUTINE THEN TIMESlanguage : mathpy\n\tmathpy : PROGRAM ID COLON declarations subroutines blocks END\n\t\t | PROGRAM ID COLON declarations subroutines blocks END PROGRAM\n\t\t | PROGRAM ID COLON declarations subroutines blocks END PROGRAM ID\n\t\n\tdeclarations : type COLON COLON variables declarations\n\t\t\t\t | empty\n\t\n\ttype : INTEGER\n\t\t | REAL\n\t\n\tvariables : variables COMMA ID\n\t\t\t | variables COMMA ID LPAREN INT RPAREN\n\t\t\t | variables COMMA ID LPAREN INT COMMA INT RPAREN\n\t\t\t | ID\n\t\t\t | ID LPAREN INT RPAREN\n\t\t\t | ID LPAREN INT COMMA INT RPAREN\n\t\n\tmatrix : ID\n\t\t | ID LPAREN INT RPAREN\n\t\t | ID LPAREN INT COMMA INT RPAREN\n\t\t | ID LPAREN ID RPAREN\n\t\t | ID LPAREN ID COMMA ID RPAREN\n\t\n\tindex : arithmetic COMMA arithmetic\n\t\t | arithmetic\n\t\n\tsubroutines : subroutines SUBROUTINE id_subroutine LPAREN RPAREN blocks END\n\t\t\t\t| subroutines SUBROUTINE id_subroutine LPAREN RPAREN blocks END SUBROUTINE\n\t\t\t\t| subroutines SUBROUTINE id_subroutine LPAREN RPAREN blocks END SUBROUTINE ID\n\t\t\t\t| empty\n\t\n\tid_subroutine : ID\n\t\n\tblocks : blocks assignment\n\t\t | blocks if comparison then_if blocks conditionals END IF\n\t\t | blocks do blocks IF comparison then_if blocks exit END IF blocks END DO\n\t\t | blocks do assignment_do COMMA arithmetic colon blocks END DO\n\t\t | blocks do assignment_do COMMA arithmetic colon IF comparison then_if blocks exit END IF blocks END DO\n\t\t | blocks ID LPAREN RPAREN\n\t\t | blocks READ TIMES COMMA matrix\n\t\t | blocks PRINT TIMES COMMA matrix\n\t\t | blocks PRINT TIMES COMMA STRING\n\t\t | empty\n\t\n\tdo : DO\n\t\n\tcolon : COLON\n\t\n\tassignment_do : ID ASSIGN arithmetic\n\t\n\texit : EXIT\n\t\n\tif : IF\n\t\n\tthen_if : THEN\n\t\n\tconditionals : else blocks\n\t\t\t\t | else IF comparison then_if blocks conditionals\n\t\t\t\t | else\n\t\n\telse : ELSE\n\t\t | empty\n\t\n\tassignment : matrix ASSIGN arithmetic\n\t\n\tarithmetic : arithmetic PLUS term\n\t\t\t | arithmetic MINUS term\n\t\t\t | term\n\t\n\tterm : term TIMES factor\n\t\t | term DIVIDE factor\n\t\t | factor\n\t\n\tfactor : INT\n\t\t | FLOAT\n\t\t | matrix\n\t\t | LPAREN arithmetic RPAREN\n\t\n\tcomparison : comparison OR comparisontwo\n\t\t\t | comparisontwo\n\t\n\tcomparisontwo : comparisontwo AND comparisonthree\n\t\t\t\t | comparisonthree\n\t\n\tcomparisonthree : comparisonthree EQ comparisonfour\n\t\t\t\t\t| comparisonthree NEQ comparisonfour\n\t\t\t\t\t| comparisonthree LT comparisonfour\n\t\t\t\t\t| comparisonthree GT comparisonfour\n\t\t\t\t\t| comparisonthree LTE comparisonfour\n\t\t\t \t\t| comparisonthree GTE comparisonfour\n\t\t\t \t\t| comparisonfour\n\t\n\tcomparisonfour : INT\n\t\t | FLOAT\n\t\t | matrix\n\t\t | LPAREN arithmetic RPAREN\n\t\t | LPAREN comparison RPAREN\n\tempty :'
_lr_action_items = {'PROGRAM':([0,19,],[3,33,]),'$end':([1,2,19,33,56,],[0,-1,-2,-3,-4,]),'ID':([3,5,6,8,11,12,14,15,16,17,20,21,22,23,24,30,31,32,33,41,42,43,47,50,51,54,57,58,59,60,61,62,63,64,65,66,67,70,71,75,76,77,78,79,80,81,82,83,84,85,86,87,89,90,91,93,104,105,107,108,112,114,115,116,118,123,124,125,127,128,129,130,131,132,133,134,135,138,139,141,142,143,144,145,146,148,149,150,156,158,160,161,162,163,164,165,167,171,172,173,175,],[4,-75,-75,-6,-75,-25,18,29,-36,31,-27,42,-41,45,-37,-75,-12,53,56,42,-15,18,42,-5,87,-32,-75,42,-42,42,42,42,42,42,42,42,42,-51,-54,53,42,42,42,42,-57,-48,-55,-56,42,42,-75,-9,-18,120,-16,18,42,42,42,42,-33,-34,-35,18,-13,-75,-46,-47,-49,-50,-52,-53,-75,-75,-38,-58,-22,-19,-17,18,42,18,18,42,156,-10,-14,-28,-24,-75,-30,-75,-11,18,-75,18,18,-29,-75,18,-31,]),'COLON':([4,7,9,10,13,42,70,71,80,82,83,89,91,110,127,128,129,130,134,138,139,],[5,13,-7,-8,17,-15,-51,-54,-57,-55,-56,-18,-16,133,-49,-50,-52,-53,-58,-19,-17,]),'INTEGER':([5,30,31,87,118,148,149,162,],[9,9,-12,-9,-13,-10,-14,-11,]),'REAL':([5,30,31,87,118,148,149,162,],[10,10,-12,-9,-13,-10,-14,-11,]),'SUBROUTINE':([5,6,8,11,12,30,31,50,87,118,135,146,148,149,156,162,],[-75,-75,-6,15,-25,-75,-12,-5,-9,-13,146,-23,-10,-14,-24,-11,]),'END':([5,6,8,11,12,14,16,20,30,31,42,50,54,57,59,70,71,80,81,82,83,86,87,89,91,93,112,114,115,116,118,122,123,124,125,127,128,129,130,132,133,134,135,138,139,141,144,146,148,149,150,152,153,156,158,160,162,163,164,166,167,168,171,172,173,175,],[-75,-75,-6,-75,-25,19,-36,-27,-75,-12,-15,-5,-32,-75,-42,-51,-54,-57,-48,-55,-56,-75,-9,-18,-16,-75,-33,-34,-35,135,-13,140,-45,-46,-47,-49,-50,-52,-53,-75,-38,-58,-22,-19,-17,-43,154,-23,-10,-14,-28,159,-40,-24,-75,-30,-11,-75,-75,-44,169,170,-29,-75,174,-31,]),'READ':([5,6,8,11,12,14,16,20,23,24,30,31,42,43,50,54,57,59,70,71,80,81,82,83,86,87,89,91,93,112,114,115,116,118,123,124,125,127,128,129,130,131,132,133,134,135,138,139,141,143,144,146,148,149,150,156,158,160,161,162,163,164,165,167,171,172,173,175,],[-75,-75,-6,-75,-25,25,-36,-27,-75,-37,-75,-12,-15,25,-5,-32,-75,-42,-51,-54,-57,-48,-55,-56,-75,-9,-18,-16,25,-33,-34,-35,25,-13,-75,-46,-47,-49,-50,-52,-53,-75,-75,-38,-58,-22,-19,-17,25,25,25,-23,-10,-14,-28,-24,-75,-30,-75,-11,25,-75,25,25,-29,-75,25,-31,]),'PRINT':([5,6,8,11,12,14,16,20,23,24,30,31,42,43,50,54,57,59,70,71,80,81,82,83,86,87,89,91,93,112,114,115,116,118,123,124,125,127,128,129,130,131,132,133,134,135,138,139,141,143,144,146,148,149,150,156,158,160,161,162,163,164,165,167,171,172,173,175,],[-75,-75,-6,-75,-25,27,-36,-27,-75,-37,-75,-12,-15,27,-5,-32,-75,-42,-51,-54,-57,-48,-55,-56,-75,-9,-18,-16,27,-33,-34,-35,27,-13,-75,-46,-47,-49,-50,-52,-53,-75,-75,-38,-58,-22,-19,-17,27,27,27,-23,-10,-14,-28,-24,-75,-30,-75,-11,27,-75,27,27,-29,-75,27,-31,]),'IF':([5,6,8,11,12,14,16,20,23,24,30,31,42,43,50,54,57,59,70,71,80,81,82,83,86,87,89,91,93,112,114,115,116,118,123,124,125,127,128,129,130,131,132,133,134,135,138,139,140,141,143,144,146,148,149,150,156,158,159,160,161,162,163,164,165,167,170,171,172,173,175,],[-75,-75,-6,-75,-25,22,-36,-27,-75,-37,-75,-12,-15,76,-5,-32,-75,-42,-51,-54,-57,-48,-55,-56,-75,-9,-18,-16,22,-33,-34,-35,22,-13,142,-46,-47,-49,-50,-52,-53,-75,145,-38,-58,-22,-19,-17,150,22,22,22,-23,-10,-14,-28,-24,-75,164,-30,-75,-11,22,-75,22,22,172,-29,-75,22,-31,]),'DO':([5,6,8,11,12,14,16,20,23,24,30,31,42,43,50,54,57,59,70,71,80,81,82,83,86,87,89,91,93,112,114,115,116,118,123,124,125,127,128,129,130,131,132,133,134,135,138,139,141,143,144,146,148,149,150,154,156,158,160,161,162,163,164,165,167,169,171,172,173,174,175,],[-75,-75,-6,-75,-25,24,-36,-27,-75,-37,-75,-12,-15,24,-5,-32,-75,-42,-51,-54,-57,-48,-55,-56,-75,-9,-18,-16,24,-33,-34,-35,24,-13,-75,-46,-47,-49,-50,-52,-53,-75,-75,-38,-58,-22,-19,-17,24,24,24,-23,-10,-14,-28,160,-24,-75,-30,-75,-11,24,-75,24,24,171,-29,-75,24,175,-31,]),'ELSE':([16,20,42,54,57,59,70,71,80,81,82,83,89,91,93,112,114,115,127,128,129,130,134,138,139,150,158,160,163,171,175,],[-36,-27,-15,-32,-75,-42,-51,-54,-57,-48,-55,-56,-18,-16,124,-33,-34,-35,-49,-50,-52,-53,-58,-19,-17,-28,-75,-30,124,-29,-31,]),'EXIT':([16,20,42,54,59,70,71,80,81,82,83,89,91,112,114,115,127,128,129,130,131,134,138,139,143,150,160,161,165,171,175,],[-36,-27,-15,-32,-42,-51,-54,-57,-48,-55,-56,-18,-16,-33,-34,-35,-49,-50,-52,-53,-75,-58,-19,-17,153,-28,-30,-75,153,-29,-31,]),'LPAREN':([18,21,22,28,29,31,41,42,47,58,60,61,62,63,64,65,66,67,76,77,78,84,87,104,105,107,108,142,145,],[32,41,-41,49,-26,52,67,75,84,41,41,41,41,41,41,41,41,67,41,84,84,84,117,84,84,84,84,41,41,]),'ASSIGN':([18,26,45,89,91,138,139,],[-15,47,78,-18,-16,-19,-17,]),'INT':([21,22,32,41,47,52,58,60,61,62,63,64,65,66,67,75,76,77,78,84,92,104,105,107,108,117,119,142,145,147,],[38,-41,55,72,82,88,38,38,38,38,38,38,38,38,72,55,38,82,82,82,121,82,82,82,82,136,137,38,38,157,]),'FLOAT':([21,22,41,47,58,60,61,62,63,64,65,66,67,76,77,78,84,104,105,107,108,142,145,],[39,-41,73,83,39,39,39,39,39,39,39,39,73,39,83,83,83,83,83,83,83,39,39,]),'TIMES':([25,27,42,70,71,72,73,74,80,82,83,89,91,126,127,128,129,130,134,138,139,],[46,48,-15,107,-54,-55,-56,-57,-57,-55,-56,-18,-16,-58,107,107,-52,-53,-58,-19,-17,]),'COMMA':([30,31,42,44,46,48,53,55,70,71,80,82,83,87,88,89,91,111,118,127,128,129,130,134,136,138,139,148,149,162,],[51,-12,-15,77,79,85,90,92,-51,-54,-57,-55,-56,-9,119,-18,-16,-39,-13,-49,-50,-52,-53,-58,147,-19,-17,-10,-14,-11,]),'RPAREN':([32,35,36,37,38,39,40,42,49,53,55,68,69,70,71,72,73,74,80,82,83,88,89,91,94,95,96,97,98,99,100,101,102,103,106,113,120,121,126,127,128,129,130,134,136,137,138,139,157,],[54,-60,-62,-69,-70,-71,-72,-15,86,89,91,103,106,-51,-54,-55,-56,-57,-57,-55,-56,118,-18,-16,-59,-61,-63,-64,-65,-66,-67,-68,126,-73,-74,134,138,139,-58,-49,-50,-52,-53,-58,148,149,-19,-17,162,]),'OR':([34,35,36,37,38,39,40,42,69,72,73,74,89,91,94,95,96,97,98,99,100,101,103,106,109,126,138,139,151,155,],[58,-60,-62,-69,-70,-71,-72,-15,58,-70,-71,-72,-18,-16,-59,-61,-63,-64,-65,-66,-67,-68,-73,-74,58,-73,-19,-17,58,58,]),'THEN':([34,35,36,37,38,39,40,42,89,91,94,95,96,97,98,99,100,101,103,106,109,138,139,151,155,],[59,-60,-62,-69,-70,-71,-72,-15,-18,-16,-59,-61,-63,-64,-65,-66,-67,-68,-73,-74,59,-19,-17,59,59,]),'AND':([35,36,37,38,39,40,42,72,73,74,89,91,94,95,96,97,98,99,100,101,103,106,126,138,139,],[60,-62,-69,-70,-71,-72,-15,-70,-71,-72,-18,-16,60,-61,-63,-64,-65,-66,-67,-68,-73,-74,-73,-19,-17,]),'EQ':([36,37,38,39,40,42,72,73,74,89,91,95,96,97,98,99,100,101,103,106,126,138,139,],[61,-69,-70,-71,-72,-15,-70,-71,-72,-18,-16,61,-63,-64,-65,-66,-67,-68,-73,-74,-73,-19,-17,]),'NEQ':([36,37,38,39,40,42,72,73,74,89,91,95,96,97,98,99,100,101,103,106,126,138,139,],[62,-69,-70,-71,-72,-15,-70,-71,-72,-18,-16,62,-63,-64,-65,-66,-67,-68,-73,-74,-73,-19,-17,]),'LT':([36,37,38,39,40,42,72,73,74,89,91,95,96,97,98,99,100,101,103,106,126,138,139,],[63,-69,-70,-71,-72,-15,-70,-71,-72,-18,-16,63,-63,-64,-65,-66,-67,-68,-73,-74,-73,-19,-17,]),'GT':([36,37,38,39,40,42,72,73,74,89,91,95,96,97,98,99,100,101,103,106,126,138,139,],[64,-69,-70,-71,-72,-15,-70,-71,-72,-18,-16,64,-63,-64,-65,-66,-67,-68,-73,-74,-73,-19,-17,]),'LTE':([36,37,38,39,40,42,72,73,74,89,91,95,96,97,98,99,100,101,103,106,126,138,139,],[65,-69,-70,-71,-72,-15,-70,-71,-72,-18,-16,65,-63,-64,-65,-66,-67,-68,-73,-74,-73,-19,-17,]),'GTE':([36,37,38,39,40,42,72,73,74,89,91,95,96,97,98,99,100,101,103,106,126,138,139,],[66,-69,-70,-71,-72,-15,-70,-71,-72,-18,-16,66,-63,-64,-65,-66,-67,-68,-73,-74,-73,-19,-17,]),'DIVIDE':([42,70,71,72,73,74,80,82,83,89,91,126,127,128,129,130,134,138,139,],[-15,108,-54,-55,-56,-57,-57,-55,-56,-18,-16,-58,108,108,-52,-53,-58,-19,-17,]),'PLUS':([42,68,70,71,72,73,74,80,81,82,83,89,91,102,110,111,113,126,127,128,129,130,134,138,139,],[-15,104,-51,-54,-55,-56,-57,-57,104,-55,-56,-18,-16,104,104,104,104,-58,-49,-50,-52,-53,-58,-19,-17,]),'MINUS':([42,68,70,71,72,73,74,80,81,82,83,89,91,102,110,111,113,126,127,128,129,130,134,138,139,],[-15,105,-51,-54,-55,-56,-57,-57,105,-55,-56,-18,-16,105,105,105,105,-58,-49,-50,-52,-53,-58,-19,-17,]),'STRING':([85,],[115,]),}
_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 = {'language':([0,],[1,]),'mathpy':([0,],[2,]),'declarations':([5,30,],[6,50,]),'type':([5,30,],[7,7,]),'empty':([5,6,11,23,30,57,86,93,123,131,132,158,161,163,164,172,],[8,12,16,16,8,16,16,125,16,16,16,16,16,125,16,16,]),'subroutines':([6,],[11,]),'blocks':([11,23,57,86,123,131,132,158,161,164,172,],[14,43,93,116,141,143,144,163,165,167,173,]),'assignment':([14,43,93,116,141,143,144,163,165,167,173,],[20,20,20,20,20,20,20,20,20,20,20,]),'if':([14,43,93,116,141,143,144,163,165,167,173,],[21,21,21,21,21,21,21,21,21,21,21,]),'do':([14,43,93,116,141,143,144,163,165,167,173,],[23,23,23,23,23,23,23,23,23,23,23,]),'matrix':([14,21,41,43,47,58,60,61,62,63,64,65,66,67,76,77,78,79,84,85,93,104,105,107,108,116,141,142,143,144,145,163,165,167,173,],[26,40,74,26,80,40,40,40,40,40,40,40,40,74,40,80,80,112,80,114,26,80,80,80,80,26,26,40,26,26,40,26,26,26,26,]),'id_subroutine':([15,],[28,]),'variables':([17,],[30,]),'comparison':([21,41,67,76,142,145,],[34,69,69,109,151,155,]),'comparisontwo':([21,41,58,67,76,142,145,],[35,35,94,35,35,35,35,]),'comparisonthree':([21,41,58,60,67,76,142,145,],[36,36,36,95,36,36,36,36,]),'comparisonfour':([21,41,58,60,61,62,63,64,65,66,67,76,142,145,],[37,37,37,37,96,97,98,99,100,101,37,37,37,37,]),'assignment_do':([23,],[44,]),'then_if':([34,109,151,155,],[57,131,158,161,]),'arithmetic':([41,47,67,77,78,84,],[68,81,102,110,111,113,]),'term':([41,47,67,77,78,84,104,105,],[70,70,70,70,70,70,127,128,]),'factor':([41,47,67,77,78,84,104,105,107,108,],[71,71,71,71,71,71,71,71,129,130,]),'conditionals':([93,163,],[122,166,]),'else':([93,163,],[123,123,]),'colon':([110,],[132,]),'exit':([143,165,],[152,168,]),}
_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' -> language","S'",1,None,None,None),
('language -> mathpy','language',1,'p_language','mathpy_yacc.py',197),
('mathpy -> PROGRAM ID COLON declarations subroutines blocks END','mathpy',7,'p_mathpy','mathpy_yacc.py',202),
('mathpy -> PROGRAM ID COLON declarations subroutines blocks END PROGRAM','mathpy',8,'p_mathpy','mathpy_yacc.py',203),
('mathpy -> PROGRAM ID COLON declarations subroutines blocks END PROGRAM ID','mathpy',9,'p_mathpy','mathpy_yacc.py',204),
('declarations -> type COLON COLON variables declarations','declarations',5,'p_declarations','mathpy_yacc.py',210),
('declarations -> empty','declarations',1,'p_declarations','mathpy_yacc.py',211),
('type -> INTEGER','type',1,'p_type','mathpy_yacc.py',217),
('type -> REAL','type',1,'p_type','mathpy_yacc.py',218),
('variables -> variables COMMA ID','variables',3,'p_variables','mathpy_yacc.py',225),
('variables -> variables COMMA ID LPAREN INT RPAREN','variables',6,'p_variables','mathpy_yacc.py',226),
('variables -> variables COMMA ID LPAREN INT COMMA INT RPAREN','variables',8,'p_variables','mathpy_yacc.py',227),
('variables -> ID','variables',1,'p_variables','mathpy_yacc.py',228),
('variables -> ID LPAREN INT RPAREN','variables',4,'p_variables','mathpy_yacc.py',229),
('variables -> ID LPAREN INT COMMA INT RPAREN','variables',6,'p_variables','mathpy_yacc.py',230),
('matrix -> ID','matrix',1,'p_matrix','mathpy_yacc.py',253),
('matrix -> ID LPAREN INT RPAREN','matrix',4,'p_matrix','mathpy_yacc.py',254),
('matrix -> ID LPAREN INT COMMA INT RPAREN','matrix',6,'p_matrix','mathpy_yacc.py',255),
('matrix -> ID LPAREN ID RPAREN','matrix',4,'p_matrix','mathpy_yacc.py',256),
('matrix -> ID LPAREN ID COMMA ID RPAREN','matrix',6,'p_matrix','mathpy_yacc.py',257),
('index -> arithmetic COMMA arithmetic','index',3,'p_index','mathpy_yacc.py',271),
('index -> arithmetic','index',1,'p_index','mathpy_yacc.py',272),
('subroutines -> subroutines SUBROUTINE id_subroutine LPAREN RPAREN blocks END','subroutines',7,'p_subroutines','mathpy_yacc.py',278),
('subroutines -> subroutines SUBROUTINE id_subroutine LPAREN RPAREN blocks END SUBROUTINE','subroutines',8,'p_subroutines','mathpy_yacc.py',279),
('subroutines -> subroutines SUBROUTINE id_subroutine LPAREN RPAREN blocks END SUBROUTINE ID','subroutines',9,'p_subroutines','mathpy_yacc.py',280),
('subroutines -> empty','subroutines',1,'p_subroutines','mathpy_yacc.py',281),
('id_subroutine -> ID','id_subroutine',1,'p_id_subroutine','mathpy_yacc.py',290),
('blocks -> blocks assignment','blocks',2,'p_blocks','mathpy_yacc.py',297),
('blocks -> blocks if comparison then_if blocks conditionals END IF','blocks',8,'p_blocks','mathpy_yacc.py',298),
('blocks -> blocks do blocks IF comparison then_if blocks exit END IF blocks END DO','blocks',13,'p_blocks','mathpy_yacc.py',299),
('blocks -> blocks do assignment_do COMMA arithmetic colon blocks END DO','blocks',9,'p_blocks','mathpy_yacc.py',300),
('blocks -> blocks do assignment_do COMMA arithmetic colon IF comparison then_if blocks exit END IF blocks END DO','blocks',16,'p_blocks','mathpy_yacc.py',301),
('blocks -> blocks ID LPAREN RPAREN','blocks',4,'p_blocks','mathpy_yacc.py',302),
('blocks -> blocks READ TIMES COMMA matrix','blocks',5,'p_blocks','mathpy_yacc.py',303),
('blocks -> blocks PRINT TIMES COMMA matrix','blocks',5,'p_blocks','mathpy_yacc.py',304),
('blocks -> blocks PRINT TIMES COMMA STRING','blocks',5,'p_blocks','mathpy_yacc.py',305),
('blocks -> empty','blocks',1,'p_blocks','mathpy_yacc.py',306),
('do -> DO','do',1,'p_do','mathpy_yacc.py',361),
('colon -> COLON','colon',1,'p_colon','mathpy_yacc.py',367),
('assignment_do -> ID ASSIGN arithmetic','assignment_do',3,'p_assignment_do','mathpy_yacc.py',381),
('exit -> EXIT','exit',1,'p_exit','mathpy_yacc.py',392),
('if -> IF','if',1,'p_if','mathpy_yacc.py',402),
('then_if -> THEN','then_if',1,'p_then_if','mathpy_yacc.py',408),
('conditionals -> else blocks','conditionals',2,'p_conditionals','mathpy_yacc.py',416),
('conditionals -> else IF comparison then_if blocks conditionals','conditionals',6,'p_conditionals','mathpy_yacc.py',417),
('conditionals -> else','conditionals',1,'p_conditionals','mathpy_yacc.py',418),
('else -> ELSE','else',1,'p_else','mathpy_yacc.py',423),
('else -> empty','else',1,'p_else','mathpy_yacc.py',424),
('assignment -> matrix ASSIGN arithmetic','assignment',3,'p_assignment','mathpy_yacc.py',433),
('arithmetic -> arithmetic PLUS term','arithmetic',3,'p_arithmetic','mathpy_yacc.py',442),
('arithmetic -> arithmetic MINUS term','arithmetic',3,'p_arithmetic','mathpy_yacc.py',443),
('arithmetic -> term','arithmetic',1,'p_arithmetic','mathpy_yacc.py',444),
('term -> term TIMES factor','term',3,'p_term','mathpy_yacc.py',455),
('term -> term DIVIDE factor','term',3,'p_term','mathpy_yacc.py',456),
('term -> factor','term',1,'p_term','mathpy_yacc.py',457),
('factor -> INT','factor',1,'p_factor','mathpy_yacc.py',468),
('factor -> FLOAT','factor',1,'p_factor','mathpy_yacc.py',469),
('factor -> matrix','factor',1,'p_factor','mathpy_yacc.py',470),
('factor -> LPAREN arithmetic RPAREN','factor',3,'p_factor','mathpy_yacc.py',471),
('comparison -> comparison OR comparisontwo','comparison',3,'p_comparison','mathpy_yacc.py',481),
('comparison -> comparisontwo','comparison',1,'p_comparison','mathpy_yacc.py',482),
('comparisontwo -> comparisontwo AND comparisonthree','comparisontwo',3,'p_comparisontwo','mathpy_yacc.py',493),
('comparisontwo -> comparisonthree','comparisontwo',1,'p_comparisontwo','mathpy_yacc.py',494),
('comparisonthree -> comparisonthree EQ comparisonfour','comparisonthree',3,'p_comparisonthree','mathpy_yacc.py',505),
('comparisonthree -> comparisonthree NEQ comparisonfour','comparisonthree',3,'p_comparisonthree','mathpy_yacc.py',506),
('comparisonthree -> comparisonthree LT comparisonfour','comparisonthree',3,'p_comparisonthree','mathpy_yacc.py',507),
('comparisonthree -> comparisonthree GT comparisonfour','comparisonthree',3,'p_comparisonthree','mathpy_yacc.py',508),
('comparisonthree -> comparisonthree LTE comparisonfour','comparisonthree',3,'p_comparisonthree','mathpy_yacc.py',509),
('comparisonthree -> comparisonthree GTE comparisonfour','comparisonthree',3,'p_comparisonthree','mathpy_yacc.py',510),
('comparisonthree -> comparisonfour','comparisonthree',1,'p_comparisonthree','mathpy_yacc.py',511),
('comparisonfour -> INT','comparisonfour',1,'p_comparisonfour','mathpy_yacc.py',522),
('comparisonfour -> FLOAT','comparisonfour',1,'p_comparisonfour','mathpy_yacc.py',523),
('comparisonfour -> matrix','comparisonfour',1,'p_comparisonfour','mathpy_yacc.py',524),
('comparisonfour -> LPAREN arithmetic RPAREN','comparisonfour',3,'p_comparisonfour','mathpy_yacc.py',525),
('comparisonfour -> LPAREN comparison RPAREN','comparisonfour',3,'p_comparisonfour','mathpy_yacc.py',526),
('empty -> <empty>','empty',0,'p_empty','mathpy_yacc.py',536),
]