forked from solijonovam/fp0406-language-sam-madina
-
Notifications
You must be signed in to change notification settings - Fork 0
/
parsetab.py
53 lines (46 loc) · 5.72 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
# parsetab.py
# This file is automatically generated. Do not edit.
# pylint: disable=W,C,R
_tabversion = '3.10'
_lr_method = 'LALR'
_lr_signature = 'programleft+-left*/left^rightUMINUSUPOSITIVEAGAR AYT BOSHQA COMMA DQ_STRING FUNKTSIYASI NAME NUMBER PASS SEMICOLON SQ_STRING UCHUN YUGURprogram : statement_liststatement_list : statement_list statementstatement_list : statementstatement : simple_statement SEMICOLONstatement : SEMICOLONsimple_statement : PASSsimple_statement : NAME "=" expressionsimple_statement : AYT \'(\' expression \')\'expression : expression \'+\' expression\n | expression \'-\' expression\n | expression \'*\' expression\n | expression \'/\' expression\n | expression \'^\' expressionexpression : \'-\' expression %prec UMINUSexpression : \'+\' expression %prec UPOSITIVEexpression : \'(\' expression \')\'expression : NUMBERexpression : DQ_STRINGexpression : SQ_STRINGexpression : NAMEstatement : FUNKTSIYASI NAME statement_block statement : YUGUR NAME statement_block : \'{\' statement_list \'}\' '
_lr_action_items = {'SEMICOLON':([0,2,3,4,5,9,11,12,15,17,18,19,20,24,25,26,28,34,35,37,38,39,40,41,42,43,44,],[5,5,-3,12,-5,-6,-2,-4,-22,-21,5,-20,-7,-17,-18,-19,5,-15,-14,-8,-23,-9,-10,-11,-12,-13,-16,]),'FUNKTSIYASI':([0,2,3,5,11,12,15,17,18,28,38,],[6,6,-3,-5,-2,-4,-22,-21,6,6,-23,]),'YUGUR':([0,2,3,5,11,12,15,17,18,28,38,],[8,8,-3,-5,-2,-4,-22,-21,8,8,-23,]),'PASS':([0,2,3,5,11,12,15,17,18,28,38,],[9,9,-3,-5,-2,-4,-22,-21,9,9,-23,]),'NAME':([0,2,3,5,6,8,11,12,14,15,16,17,18,21,22,23,28,29,30,31,32,33,38,],[7,7,-3,-5,13,15,-2,-4,19,-22,19,-21,7,19,19,19,7,19,19,19,19,19,-23,]),'AYT':([0,2,3,5,11,12,15,17,18,28,38,],[10,10,-3,-5,-2,-4,-22,-21,10,10,-23,]),'$end':([1,2,3,5,11,12,15,17,38,],[0,-1,-3,-5,-2,-4,-22,-21,-23,]),'}':([3,5,11,12,15,17,28,38,],[-3,-5,-2,-4,-22,-21,38,-23,]),'=':([7,],[14,]),'(':([10,14,16,21,22,23,29,30,31,32,33,],[16,23,23,23,23,23,23,23,23,23,23,]),'{':([13,],[18,]),'-':([14,16,19,20,21,22,23,24,25,26,27,29,30,31,32,33,34,35,36,39,40,41,42,43,44,],[22,22,-20,30,22,22,22,-17,-18,-19,30,22,22,22,22,22,-15,-14,30,-9,-10,-11,-12,-13,-16,]),'+':([14,16,19,20,21,22,23,24,25,26,27,29,30,31,32,33,34,35,36,39,40,41,42,43,44,],[21,21,-20,29,21,21,21,-17,-18,-19,29,21,21,21,21,21,-15,-14,29,-9,-10,-11,-12,-13,-16,]),'NUMBER':([14,16,21,22,23,29,30,31,32,33,],[24,24,24,24,24,24,24,24,24,24,]),'DQ_STRING':([14,16,21,22,23,29,30,31,32,33,],[25,25,25,25,25,25,25,25,25,25,]),'SQ_STRING':([14,16,21,22,23,29,30,31,32,33,],[26,26,26,26,26,26,26,26,26,26,]),'*':([19,20,24,25,26,27,34,35,36,39,40,41,42,43,44,],[-20,31,-17,-18,-19,31,-15,-14,31,31,31,-11,-12,-13,-16,]),'/':([19,20,24,25,26,27,34,35,36,39,40,41,42,43,44,],[-20,32,-17,-18,-19,32,-15,-14,32,32,32,-11,-12,-13,-16,]),'^':([19,20,24,25,26,27,34,35,36,39,40,41,42,43,44,],[-20,33,-17,-18,-19,33,-15,-14,33,33,33,33,33,-13,-16,]),')':([19,24,25,26,27,34,35,36,39,40,41,42,43,44,],[-20,-17,-18,-19,37,-15,-14,44,-9,-10,-11,-12,-13,-16,]),}
_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 = {'program':([0,],[1,]),'statement_list':([0,18,],[2,28,]),'statement':([0,2,18,28,],[3,11,3,11,]),'simple_statement':([0,2,18,28,],[4,4,4,4,]),'statement_block':([13,],[17,]),'expression':([14,16,21,22,23,29,30,31,32,33,],[20,27,34,35,36,39,40,41,42,43,]),}
_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 -> statement_list','program',1,'p_program','mini.py',179),
('statement_list -> statement_list statement','statement_list',2,'p_statement_list2','mini.py',185),
('statement_list -> statement','statement_list',1,'p_statement_list','mini.py',190),
('statement -> simple_statement SEMICOLON','statement',2,'p_statement_no_comment','mini.py',200),
('statement -> SEMICOLON','statement',1,'p_statement_no_code_no_comment','mini.py',205),
('simple_statement -> PASS','simple_statement',1,'p_simple_statement_pass','mini.py',211),
('simple_statement -> NAME = expression','simple_statement',3,'p_simple_statement_assign','mini.py',216),
('simple_statement -> AYT ( expression )','simple_statement',4,'p_simple_statement_ayt','mini.py',221),
('expression -> expression + expression','expression',3,'p_expression_binop','mini.py',227),
('expression -> expression - expression','expression',3,'p_expression_binop','mini.py',228),
('expression -> expression * expression','expression',3,'p_expression_binop','mini.py',229),
('expression -> expression / expression','expression',3,'p_expression_binop','mini.py',230),
('expression -> expression ^ expression','expression',3,'p_expression_binop','mini.py',231),
('expression -> - expression','expression',2,'p_expression_uminus','mini.py',237),
('expression -> + expression','expression',2,'p_expression_upositive','mini.py',243),
('expression -> ( expression )','expression',3,'p_expression_group','mini.py',248),
('expression -> NUMBER','expression',1,'p_expression_number','mini.py',253),
('expression -> DQ_STRING','expression',1,'p_expression_dq_string','mini.py',265),
('expression -> SQ_STRING','expression',1,'p_expression_sq_string','mini.py',270),
('expression -> NAME','expression',1,'p_expression_name','mini.py',275),
('statement -> FUNKTSIYASI NAME statement_block','statement',3,'p_statement_subroutine','mini.py',279),
('statement -> YUGUR NAME','statement',2,'p_statement_call','mini.py',284),
('statement_block -> { statement_list }','statement_block',3,'p_statement_block','mini.py',288),
]