-
Notifications
You must be signed in to change notification settings - Fork 0
/
parsetab.py
92 lines (85 loc) · 20.2 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
# parsetab.py
# This file is automatically generated. Do not edit.
# pylint: disable=W,C,R
_tabversion = '3.10'
_lr_method = 'LALR'
_lr_signature = 'AND ARROW AS ASSIGN BEGIN BOOL_TYPE COLON COMMA COMMENT DBL_COLON DBL_QT DIVIDE DIVIDE_EQ DO ELSE END ENTER EQUAL EXIT FALSE FN FOR_LOOP GREATER_THAN GREATER_THAN_EQUAL IDENTIFIER IF INT_TYPE LBRACKET LCURLYBR LENGTH LESS_THAN LESS_THAN_EQUAL LIST LPAREN MINUS MINUS_EQ MOD NOT NOT_EQUAL NULL_TYPE NUMBER OR PLUS PLUS_EQ PRINT QUESTION_MARK RBRACKET RCURLYBR RETURN RPAREN SCAN SEMI_COLON SINGLE_QT STR_TYPE TIMES TIMES_EQ TO TRUE VECTOR_TYPE WHILE_LOOPprog : func prog\n | emptyfunc : FN IDENTIFIER LPAREN flist RPAREN LESS_THAN type GREATER_THAN LCURLYBR body RCURLYBR\n | FN IDENTIFIER LPAREN flist RPAREN LESS_THAN type GREATER_THAN ARROW RETURN expr SEMI_COLONstmt : expr SEMI_COLON\n | defvar SEMI_COLON\n | func\n | IF LBRACKET expr RBRACKET stmt\n | IF LBRACKET expr RBRACKET stmt ELSE stmt\n | WHILE_LOOP LBRACKET expr RBRACKET stmt\n | DO stmt WHILE_LOOP LBRACKET expr RBRACKET SEMI_COLON\n | FOR_LOOP LPAREN IDENTIFIER ASSIGN expr TO expr RPAREN stmt\n | BEGIN body END\n | RETURN expr SEMI_COLONexpr : expr LBRACKET expr RBRACKET\n | LBRACKET clist RBRACKET\n | expr QUESTION_MARK expr COLON expr\n | expr PLUS expr\n | expr MINUS expr\n | expr TIMES expr\n | expr DIVIDE expr\n | expr GREATER_THAN expr\n | expr LESS_THAN expr\n | expr EQUAL expr\n | expr GREATER_THAN_EQUAL expr\n | expr LESS_THAN_EQUAL expr\n | expr NOT_EQUAL expr\n | expr OR expr\n | expr AND expr\n | NOT expr\n | PLUS expr\n | MINUS expr\n | IDENTIFIER\n | IDENTIFIER ASSIGN expr\n | IDENTIFIER LPAREN clist RPAREN\n | NUMBERflist : empty\n | param_decl\n | param_decl COMMA flistclist : expr\n | expr COMMA clistparam_decl : IDENTIFIER AS typetype : INT_TYPE\n | STR_TYPE\n | VECTOR_TYPE\n | BOOL_TYPEbody : statement_liststatement_list : statement\n | statement statement_liststatement : expr SEMI_COLON\n | defvar SEMI_COLON\n | func\n | RETURN expr SEMI_COLON\n | IF LBRACKET expr RBRACKET stmt\n | IF LBRACKET expr RBRACKET stmt ELSE stmt\n | WHILE_LOOP LBRACKET expr RBRACKET stmt\n | DO stmt WHILE_LOOP LBRACKET expr RBRACKET SEMI_COLON\n | FOR_LOOP LPAREN IDENTIFIER ASSIGN expr TO expr RPAREN stmt\n | BEGIN body ENDdefvar : IDENTIFIER DBL_COLON type\n | IDENTIFIER DBL_COLON type ASSIGN exprempty :'
_lr_action_items = {'FN':([0,2,24,29,32,37,39,48,50,65,72,77,80,105,113,114,120,121,126,128,134,135,139,140,143,144,147,150,151,154,156,157,160,161,163,164,165,166,],[4,4,4,4,-52,4,4,-3,-50,-51,4,-7,4,-53,-5,-6,-59,-4,4,4,-13,-14,-54,-56,4,4,4,-10,-8,-55,-57,4,-11,-9,4,4,-58,-12,]),'$end':([0,1,2,3,5,48,121,],[-62,0,-62,-2,-1,-3,-4,]),'IDENTIFIER':([4,7,14,24,29,32,33,35,37,39,40,41,42,44,45,46,48,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,68,71,72,77,80,81,82,105,108,112,113,114,115,116,120,121,123,125,126,128,130,134,135,136,139,140,141,143,144,145,147,150,151,153,154,156,157,158,160,161,163,164,165,166,],[6,8,8,26,26,-52,67,67,26,26,67,67,67,67,67,67,-3,-50,67,67,67,67,67,67,67,67,67,67,67,67,67,67,-51,67,67,26,-7,26,67,119,-53,67,67,-5,-6,67,133,-59,-4,67,67,26,26,67,-13,-14,67,-54,-56,67,26,26,67,26,-10,-8,67,-55,-57,26,67,-11,-9,26,26,-58,-12,]),'LPAREN':([6,26,38,67,79,],[7,46,82,46,116,]),'RPAREN':([7,9,10,11,14,15,16,17,18,19,21,43,67,70,84,85,86,88,89,93,94,95,96,97,98,99,100,101,102,103,104,107,122,124,127,138,159,162,],[-62,13,-37,-38,-62,-42,-43,-44,-45,-46,-39,-36,-33,-40,-31,-32,-30,-34,122,-18,-19,-20,-21,-22,-23,-24,-25,-26,-27,-28,-29,-16,-35,-15,-41,-17,163,164,]),'AS':([8,],[12,]),'COMMA':([11,15,16,17,18,19,43,67,70,84,85,86,88,93,94,95,96,97,98,99,100,101,102,103,104,107,122,124,138,],[14,-42,-43,-44,-45,-46,-36,-33,108,-31,-32,-30,-34,-18,-19,-20,-21,-22,-23,-24,-25,-26,-27,-28,-29,-16,-35,-15,-17,]),'INT_TYPE':([12,20,47,],[16,16,16,]),'STR_TYPE':([12,20,47,],[17,17,17,]),'VECTOR_TYPE':([12,20,47,],[18,18,18,]),'BOOL_TYPE':([12,20,47,],[19,19,19,]),'LESS_THAN':([13,26,30,43,66,67,70,75,84,85,86,87,88,91,92,93,94,95,96,97,98,99,100,101,102,103,104,106,107,109,118,122,124,131,132,137,138,142,146,148,152,159,162,],[20,-33,58,-36,58,-33,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,-16,58,58,-35,-15,58,58,58,58,58,58,58,58,58,58,]),'GREATER_THAN':([16,17,18,19,22,26,30,43,66,67,70,75,84,85,86,87,88,91,92,93,94,95,96,97,98,99,100,101,102,103,104,106,107,109,118,122,124,131,132,137,138,142,146,148,152,159,162,],[-43,-44,-45,-46,23,-33,57,-36,57,-33,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,-16,57,57,-35,-15,57,57,57,57,57,57,57,57,57,57,]),'ASSIGN':([16,17,18,19,26,67,90,119,133,],[-43,-44,-45,-46,45,45,123,136,145,]),'SEMI_COLON':([16,17,18,19,26,30,31,43,66,67,75,76,84,85,86,87,88,90,93,94,95,96,97,98,99,100,101,102,103,104,107,118,122,124,137,138,149,155,],[-43,-44,-45,-46,-33,50,65,-36,105,-33,113,114,-31,-32,-30,121,-34,-60,-18,-19,-20,-21,-22,-23,-24,-25,-26,-27,-28,-29,-16,135,-35,-15,-61,-17,156,160,]),'LCURLYBR':([23,],[24,]),'ARROW':([23,],[25,]),'RETURN':([24,25,29,32,37,39,48,50,65,72,77,80,105,113,114,120,121,126,128,134,135,139,140,143,144,147,150,151,154,156,157,160,161,163,164,165,166,],[33,44,33,-52,81,33,-3,-50,-51,81,-7,33,-53,-5,-6,-59,-4,81,81,-13,-14,-54,-56,81,81,81,-10,-8,-55,-57,81,-11,-9,81,81,-58,-12,]),'IF':([24,29,32,37,39,48,50,65,72,77,80,105,113,114,120,121,126,128,134,135,139,140,143,144,147,150,151,154,156,157,160,161,163,164,165,166,],[34,34,-52,78,34,-3,-50,-51,78,-7,34,-53,-5,-6,-59,-4,78,78,-13,-14,-54,-56,78,78,78,-10,-8,-55,-57,78,-11,-9,78,78,-58,-12,]),'WHILE_LOOP':([24,29,32,37,39,48,50,65,72,73,77,80,105,110,113,114,120,121,126,128,134,135,139,140,143,144,147,150,151,154,156,157,160,161,163,164,165,166,],[36,36,-52,74,36,-3,-50,-51,74,111,-7,36,-53,129,-5,-6,-59,-4,74,74,-13,-14,-54,-56,74,74,74,-10,-8,-55,-57,74,-11,-9,74,74,-58,-12,]),'DO':([24,29,32,37,39,48,50,65,72,77,80,105,113,114,120,121,126,128,134,135,139,140,143,144,147,150,151,154,156,157,160,161,163,164,165,166,],[37,37,-52,72,37,-3,-50,-51,72,-7,37,-53,-5,-6,-59,-4,72,72,-13,-14,-54,-56,72,72,72,-10,-8,-55,-57,72,-11,-9,72,72,-58,-12,]),'FOR_LOOP':([24,29,32,37,39,48,50,65,72,77,80,105,113,114,120,121,126,128,134,135,139,140,143,144,147,150,151,154,156,157,160,161,163,164,165,166,],[38,38,-52,79,38,-3,-50,-51,79,-7,38,-53,-5,-6,-59,-4,79,79,-13,-14,-54,-56,79,79,79,-10,-8,-55,-57,79,-11,-9,79,79,-58,-12,]),'BEGIN':([24,29,32,37,39,48,50,65,72,77,80,105,113,114,120,121,126,128,134,135,139,140,143,144,147,150,151,154,156,157,160,161,163,164,165,166,],[39,39,-52,80,39,-3,-50,-51,80,-7,39,-53,-5,-6,-59,-4,80,80,-13,-14,-54,-56,80,80,80,-10,-8,-55,-57,80,-11,-9,80,80,-58,-12,]),'LBRACKET':([24,26,29,30,32,33,34,35,36,37,39,40,41,42,43,44,45,46,48,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,70,71,72,74,75,77,78,80,81,84,85,86,87,88,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,118,120,121,122,123,124,125,126,128,129,130,131,132,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,150,151,152,153,154,156,157,158,159,160,161,162,163,164,165,166,],[35,-33,35,51,-52,35,68,35,71,35,35,35,35,35,-36,35,35,35,-3,-50,35,35,35,35,35,35,35,35,35,35,35,35,35,35,-51,51,-33,35,51,35,35,112,51,-7,115,35,35,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,-53,51,-16,35,51,130,35,-5,-6,35,51,-59,-4,-35,35,-15,35,35,35,141,35,51,51,-13,-14,35,51,51,-54,-56,35,51,35,35,35,51,35,51,-10,-8,51,35,-55,-57,35,35,51,-11,-9,51,35,35,-58,-12,]),'NOT':([24,29,32,33,35,37,39,40,41,42,44,45,46,48,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,68,71,72,77,80,81,105,108,112,113,114,115,120,121,123,125,126,128,130,134,135,136,139,140,141,143,144,145,147,150,151,153,154,156,157,158,160,161,163,164,165,166,],[42,42,-52,42,42,42,42,42,42,42,42,42,42,-3,-50,42,42,42,42,42,42,42,42,42,42,42,42,42,42,-51,42,42,42,-7,42,42,-53,42,42,-5,-6,42,-59,-4,42,42,42,42,42,-13,-14,42,-54,-56,42,42,42,42,42,-10,-8,42,-55,-57,42,42,-11,-9,42,42,-58,-12,]),'PLUS':([24,26,29,30,32,33,35,37,39,40,41,42,43,44,45,46,48,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,70,71,72,75,77,80,81,84,85,86,87,88,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,112,113,114,115,118,120,121,122,123,124,125,126,128,130,131,132,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,150,151,152,153,154,156,157,158,159,160,161,162,163,164,165,166,],[40,-33,40,53,-52,40,40,40,40,40,40,40,-36,40,40,40,-3,-50,40,40,40,40,40,40,40,40,40,40,40,40,40,40,-51,53,-33,40,53,40,40,53,-7,40,40,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,-53,53,-16,40,53,40,-5,-6,40,53,-59,-4,-35,40,-15,40,40,40,40,53,53,-13,-14,40,53,53,-54,-56,40,53,40,40,40,53,40,53,-10,-8,53,40,-55,-57,40,40,53,-11,-9,53,40,40,-58,-12,]),'MINUS':([24,26,29,30,32,33,35,37,39,40,41,42,43,44,45,46,48,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,70,71,72,75,77,80,81,84,85,86,87,88,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,112,113,114,115,118,120,121,122,123,124,125,126,128,130,131,132,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,150,151,152,153,154,156,157,158,159,160,161,162,163,164,165,166,],[41,-33,41,54,-52,41,41,41,41,41,41,41,-36,41,41,41,-3,-50,41,41,41,41,41,41,41,41,41,41,41,41,41,41,-51,54,-33,41,54,41,41,54,-7,41,41,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,-53,54,-16,41,54,41,-5,-6,41,54,-59,-4,-35,41,-15,41,41,41,41,54,54,-13,-14,41,54,54,-54,-56,41,54,41,41,41,54,41,54,-10,-8,54,41,-55,-57,41,41,54,-11,-9,54,41,41,-58,-12,]),'NUMBER':([24,29,32,33,35,37,39,40,41,42,44,45,46,48,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,68,71,72,77,80,81,105,108,112,113,114,115,120,121,123,125,126,128,130,134,135,136,139,140,141,143,144,145,147,150,151,153,154,156,157,158,160,161,163,164,165,166,],[43,43,-52,43,43,43,43,43,43,43,43,43,43,-3,-50,43,43,43,43,43,43,43,43,43,43,43,43,43,43,-51,43,43,43,-7,43,43,-53,43,43,-5,-6,43,-59,-4,43,43,43,43,43,-13,-14,43,-54,-56,43,43,43,43,43,-10,-8,43,-55,-57,43,43,-11,-9,43,43,-58,-12,]),'QUESTION_MARK':([26,30,43,66,67,70,75,84,85,86,87,88,91,92,93,94,95,96,97,98,99,100,101,102,103,104,106,107,109,118,122,124,131,132,137,138,142,146,148,152,159,162,],[-33,52,-36,52,-33,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,-16,52,52,-35,-15,52,52,52,52,52,52,52,52,52,52,]),'TIMES':([26,30,43,66,67,70,75,84,85,86,87,88,91,92,93,94,95,96,97,98,99,100,101,102,103,104,106,107,109,118,122,124,131,132,137,138,142,146,148,152,159,162,],[-33,55,-36,55,-33,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,-16,55,55,-35,-15,55,55,55,55,55,55,55,55,55,55,]),'DIVIDE':([26,30,43,66,67,70,75,84,85,86,87,88,91,92,93,94,95,96,97,98,99,100,101,102,103,104,106,107,109,118,122,124,131,132,137,138,142,146,148,152,159,162,],[-33,56,-36,56,-33,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,-16,56,56,-35,-15,56,56,56,56,56,56,56,56,56,56,]),'EQUAL':([26,30,43,66,67,70,75,84,85,86,87,88,91,92,93,94,95,96,97,98,99,100,101,102,103,104,106,107,109,118,122,124,131,132,137,138,142,146,148,152,159,162,],[-33,59,-36,59,-33,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,-16,59,59,-35,-15,59,59,59,59,59,59,59,59,59,59,]),'GREATER_THAN_EQUAL':([26,30,43,66,67,70,75,84,85,86,87,88,91,92,93,94,95,96,97,98,99,100,101,102,103,104,106,107,109,118,122,124,131,132,137,138,142,146,148,152,159,162,],[-33,60,-36,60,-33,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,-16,60,60,-35,-15,60,60,60,60,60,60,60,60,60,60,]),'LESS_THAN_EQUAL':([26,30,43,66,67,70,75,84,85,86,87,88,91,92,93,94,95,96,97,98,99,100,101,102,103,104,106,107,109,118,122,124,131,132,137,138,142,146,148,152,159,162,],[-33,61,-36,61,-33,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,-16,61,61,-35,-15,61,61,61,61,61,61,61,61,61,61,]),'NOT_EQUAL':([26,30,43,66,67,70,75,84,85,86,87,88,91,92,93,94,95,96,97,98,99,100,101,102,103,104,106,107,109,118,122,124,131,132,137,138,142,146,148,152,159,162,],[-33,62,-36,62,-33,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,-16,62,62,-35,-15,62,62,62,62,62,62,62,62,62,62,]),'OR':([26,30,43,66,67,70,75,84,85,86,87,88,91,92,93,94,95,96,97,98,99,100,101,102,103,104,106,107,109,118,122,124,131,132,137,138,142,146,148,152,159,162,],[-33,63,-36,63,-33,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,-16,63,63,-35,-15,63,63,63,63,63,63,63,63,63,63,]),'AND':([26,30,43,66,67,70,75,84,85,86,87,88,91,92,93,94,95,96,97,98,99,100,101,102,103,104,106,107,109,118,122,124,131,132,137,138,142,146,148,152,159,162,],[-33,64,-36,64,-33,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,-16,64,64,-35,-15,64,64,64,64,64,64,64,64,64,64,]),'DBL_COLON':([26,],[47,]),'RCURLYBR':([27,28,29,32,48,49,50,65,77,105,113,114,120,121,134,135,139,140,150,151,154,156,160,161,165,166,],[48,-47,-48,-52,-3,-49,-50,-51,-7,-53,-5,-6,-59,-4,-13,-14,-54,-56,-10,-8,-55,-57,-11,-9,-58,-12,]),'END':([28,29,32,48,49,50,65,77,83,105,113,114,117,120,121,134,135,139,140,150,151,154,156,160,161,165,166,],[-47,-48,-52,-3,-49,-50,-51,-7,120,-53,-5,-6,134,-59,-4,-13,-14,-54,-56,-10,-8,-55,-57,-11,-9,-58,-12,]),'RBRACKET':([43,67,69,70,84,85,86,88,91,93,94,95,96,97,98,99,100,101,102,103,104,106,107,109,122,124,127,131,132,138,142,148,],[-36,-33,107,-40,-31,-32,-30,-34,124,-18,-19,-20,-21,-22,-23,-24,-25,-26,-27,-28,-29,126,-16,128,-35,-15,-41,143,144,-17,149,155,]),'COLON':([43,67,84,85,86,88,92,93,94,95,96,97,98,99,100,101,102,103,104,107,122,124,138,],[-36,-33,-31,-32,-30,-34,125,-18,-19,-20,-21,-22,-23,-24,-25,-26,-27,-28,-29,-16,-35,-15,-17,]),'TO':([43,67,84,85,86,88,93,94,95,96,97,98,99,100,101,102,103,104,107,122,124,138,146,152,],[-36,-33,-31,-32,-30,-34,-18,-19,-20,-21,-22,-23,-24,-25,-26,-27,-28,-29,-16,-35,-15,-17,153,158,]),'ELSE':([48,77,113,114,121,134,135,139,150,151,160,161,166,],[-3,-7,-5,-6,-4,-13,-14,147,-10,157,-11,-9,-12,]),}
_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 = {'prog':([0,2,],[1,5,]),'func':([0,2,24,29,37,39,72,80,126,128,143,144,147,157,163,164,],[2,2,32,32,77,32,77,32,77,77,77,77,77,77,77,77,]),'empty':([0,2,7,14,],[3,3,10,10,]),'flist':([7,14,],[9,21,]),'param_decl':([7,14,],[11,11,]),'type':([12,20,47,],[15,22,90,]),'body':([24,39,80,],[27,83,117,]),'statement_list':([24,29,39,80,],[28,49,28,28,]),'statement':([24,29,39,80,],[29,29,29,29,]),'expr':([24,29,33,35,37,39,40,41,42,44,45,46,51,52,53,54,55,56,57,58,59,60,61,62,63,64,68,71,72,80,81,108,112,115,123,125,126,128,130,136,141,143,144,145,147,153,157,158,163,164,],[30,30,66,70,75,30,84,85,86,87,88,70,91,92,93,94,95,96,97,98,99,100,101,102,103,104,106,109,75,30,118,70,131,132,137,138,75,75,142,146,148,75,75,152,75,159,75,162,75,75,]),'defvar':([24,29,37,39,72,80,126,128,143,144,147,157,163,164,],[31,31,76,31,76,31,76,76,76,76,76,76,76,76,]),'clist':([35,46,108,],[69,89,127,]),'stmt':([37,72,126,128,143,144,147,157,163,164,],[73,110,139,140,150,151,154,161,165,166,]),}
_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' -> prog","S'",1,None,None,None),
('prog -> func prog','prog',2,'p_prog','parser.py',21),
('prog -> empty','prog',1,'p_prog','parser.py',22),
('func -> FN IDENTIFIER LPAREN flist RPAREN LESS_THAN type GREATER_THAN LCURLYBR body RCURLYBR','func',11,'p_func','parser.py',30),
('func -> FN IDENTIFIER LPAREN flist RPAREN LESS_THAN type GREATER_THAN ARROW RETURN expr SEMI_COLON','func',12,'p_func','parser.py',31),
('stmt -> expr SEMI_COLON','stmt',2,'p_stmt','parser.py',39),
('stmt -> defvar SEMI_COLON','stmt',2,'p_stmt','parser.py',40),
('stmt -> func','stmt',1,'p_stmt','parser.py',41),
('stmt -> IF LBRACKET expr RBRACKET stmt','stmt',5,'p_stmt','parser.py',42),
('stmt -> IF LBRACKET expr RBRACKET stmt ELSE stmt','stmt',7,'p_stmt','parser.py',43),
('stmt -> WHILE_LOOP LBRACKET expr RBRACKET stmt','stmt',5,'p_stmt','parser.py',44),
('stmt -> DO stmt WHILE_LOOP LBRACKET expr RBRACKET SEMI_COLON','stmt',7,'p_stmt','parser.py',45),
('stmt -> FOR_LOOP LPAREN IDENTIFIER ASSIGN expr TO expr RPAREN stmt','stmt',9,'p_stmt','parser.py',46),
('stmt -> BEGIN body END','stmt',3,'p_stmt','parser.py',47),
('stmt -> RETURN expr SEMI_COLON','stmt',3,'p_stmt','parser.py',48),
('expr -> expr LBRACKET expr RBRACKET','expr',4,'p_expr','parser.py',53),
('expr -> LBRACKET clist RBRACKET','expr',3,'p_expr','parser.py',54),
('expr -> expr QUESTION_MARK expr COLON expr','expr',5,'p_expr','parser.py',55),
('expr -> expr PLUS expr','expr',3,'p_expr','parser.py',56),
('expr -> expr MINUS expr','expr',3,'p_expr','parser.py',57),
('expr -> expr TIMES expr','expr',3,'p_expr','parser.py',58),
('expr -> expr DIVIDE expr','expr',3,'p_expr','parser.py',59),
('expr -> expr GREATER_THAN expr','expr',3,'p_expr','parser.py',60),
('expr -> expr LESS_THAN expr','expr',3,'p_expr','parser.py',61),
('expr -> expr EQUAL expr','expr',3,'p_expr','parser.py',62),
('expr -> expr GREATER_THAN_EQUAL expr','expr',3,'p_expr','parser.py',63),
('expr -> expr LESS_THAN_EQUAL expr','expr',3,'p_expr','parser.py',64),
('expr -> expr NOT_EQUAL expr','expr',3,'p_expr','parser.py',65),
('expr -> expr OR expr','expr',3,'p_expr','parser.py',66),
('expr -> expr AND expr','expr',3,'p_expr','parser.py',67),
('expr -> NOT expr','expr',2,'p_expr','parser.py',68),
('expr -> PLUS expr','expr',2,'p_expr','parser.py',69),
('expr -> MINUS expr','expr',2,'p_expr','parser.py',70),
('expr -> IDENTIFIER','expr',1,'p_expr','parser.py',71),
('expr -> IDENTIFIER ASSIGN expr','expr',3,'p_expr','parser.py',72),
('expr -> IDENTIFIER LPAREN clist RPAREN','expr',4,'p_expr','parser.py',73),
('expr -> NUMBER','expr',1,'p_expr','parser.py',74),
('flist -> empty','flist',1,'p_flist','parser.py',84),
('flist -> param_decl','flist',1,'p_flist','parser.py',85),
('flist -> param_decl COMMA flist','flist',3,'p_flist','parser.py',86),
('clist -> expr','clist',1,'p_clist','parser.py',94),
('clist -> expr COMMA clist','clist',3,'p_clist','parser.py',95),
('param_decl -> IDENTIFIER AS type','param_decl',3,'p_param_decl','parser.py',103),
('type -> INT_TYPE','type',1,'p_type','parser.py',108),
('type -> STR_TYPE','type',1,'p_type','parser.py',109),
('type -> VECTOR_TYPE','type',1,'p_type','parser.py',110),
('type -> BOOL_TYPE','type',1,'p_type','parser.py',111),
('body -> statement_list','body',1,'p_body','parser.py',115),
('statement_list -> statement','statement_list',1,'p_statement_list','parser.py',120),
('statement_list -> statement statement_list','statement_list',2,'p_statement_list','parser.py',121),
('statement -> expr SEMI_COLON','statement',2,'p_statement','parser.py',129),
('statement -> defvar SEMI_COLON','statement',2,'p_statement','parser.py',130),
('statement -> func','statement',1,'p_statement','parser.py',131),
('statement -> RETURN expr SEMI_COLON','statement',3,'p_statement','parser.py',132),
('statement -> IF LBRACKET expr RBRACKET stmt','statement',5,'p_statement','parser.py',133),
('statement -> IF LBRACKET expr RBRACKET stmt ELSE stmt','statement',7,'p_statement','parser.py',134),
('statement -> WHILE_LOOP LBRACKET expr RBRACKET stmt','statement',5,'p_statement','parser.py',135),
('statement -> DO stmt WHILE_LOOP LBRACKET expr RBRACKET SEMI_COLON','statement',7,'p_statement','parser.py',136),
('statement -> FOR_LOOP LPAREN IDENTIFIER ASSIGN expr TO expr RPAREN stmt','statement',9,'p_statement','parser.py',137),
('statement -> BEGIN body END','statement',3,'p_statement','parser.py',138),
('defvar -> IDENTIFIER DBL_COLON type','defvar',3,'p_defvar','parser.py',143),
('defvar -> IDENTIFIER DBL_COLON type ASSIGN expr','defvar',5,'p_defvar','parser.py',144),
('empty -> <empty>','empty',0,'p_empty','parser.py',152),
]