Franck Pommereau

fixed heratic parsing error, minor changes

......@@ -69,7 +69,7 @@ tokens = (
'DOUBLE_MINUS',
'PLUS',
'MINUS',
'TIMES',
# 'TIMES',
'DIV',
'MODULO',
'DOUBLE_AMPERSAND',
......@@ -169,7 +169,7 @@ t_DOUBLE_PLUS = r'\+\+'
t_DOUBLE_MINUS = r'--'
t_PLUS = r'\+'
t_MINUS = r'-'
t_TIMES = r'\*'
# t_TIMES = r'\*'
t_DIV = r'/(?!\*)'
t_MODULO = r'%'
t_DOUBLE_AMPERSAND = r'&&'
......
......@@ -755,9 +755,7 @@ def p_empty(t):
pass
def p_error(t):
print("You've got a syntax error somewhere in your code.")
print("It could be around line %d." % t.lineno)
print("Good luck finding it.")
print("[%s:%s] syntax error" % (t.lineno, t.lexpos))
raise ParseError()
yacc.yacc(debug=1)
......
......@@ -2,6 +2,15 @@ import argparse, sys, os.path
import ply.yacc as yacc
from . import cparse, cvisitors, cx86
cttc = cx86
ARCH = {"x86" : cx86,
"ttc" : cttc}
ARCHDOC = """supported target architectures:
x86 Intel 80x86 assembly (in GNU Assemble format)
ttc The Tiny Computer assembly
"""
class CompileError (Exception) :
"Exception raised when there's been a compilation error."
......@@ -11,7 +20,8 @@ class Compiler (object) :
"""This object encapsulates the front-end for the compiler and
serves as a facade interface to the 'meat' of the compiler
underneath."""
def __init__ (self) :
def __init__ (self, arch) :
self.arch = arch
self.total_errors = 0
self.total_warnings = 0
def _parse (self) :
......@@ -31,12 +41,15 @@ class Compiler (object) :
self._compile_phase(cvisitors.SymtabVisitor())
self._compile_phase(cvisitors.TypeCheckVisitor())
self._compile_phase(cvisitors.FlowControlVisitor())
self._compile_phase(cx86.CodeGenVisitor(outfile))
self._compile_phase(self.arch.CodeGenVisitor(outfile))
if ast_file is not None:
self._compile_phase(cvisitors.ASTPrinterVisitor(ast_file))
def _print_stats (self) :
"Prints the total number of errors/warnings from compilation."
print("%d errors, %d warnings." % (self.total_errors, self.total_warnings))
if self.total_errors :
print("%d errors" % self.total_errors)
if self.total_warnings :
print("%s warnings" % self.total_warnings)
def compile (self, code, outfile, show_ast) :
"Compiles the given code string to the given file object."
self.code = code
......@@ -54,21 +67,32 @@ class Compiler (object) :
return 0
def main (args=None) :
parser = argparse.ArgumentParser(prog="cct")
parser = argparse.ArgumentParser(prog="cct",
epilog=ARCHDOC,
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument("-o", action="store", metavar="PATH",
type=argparse.FileType('w'), default=sys.stdout,
help="write output to PATH")
parser.add_argument("--ast", action="store_true", default=False,
help="dump AST for each C file")
parser.add_argument("--arch", action="store", choices=list(ARCH),
default="ttc",
help="output assembly for specified architecture (default 'ttc')")
parser.add_argument("-t", "--ttc", action="store_const", const="ttc",
dest="arch", help="output TTC assembly")
parser.add_argument("source", nargs="+", metavar="PATH",
help="C source files(s) to compile")
args = parser.parse_args(args)
for src in args.source :
print("Compiling %r" % src)
if args.ast :
ast_file = open(os.path.splitext(src)[0] + ".ast", "w")
ast_path = os.path.splitext(src)[0] + ".ast"
print("Dumping AST to %r" % ast_path)
ast_file = open(ast_path, "w")
else :
ast_file = None
retval = Compiler().compile(open(src).read(), args.o, ast_file)
code = "\n".join(open(src).readlines())
retval = Compiler(ARCH[args.arch]).compile(code, args.o, ast_file)
if ast_file is not None :
ast_file.close()
if retval != 0 :
......
......@@ -6,9 +6,9 @@ _tabversion = '3.10'
_lr_method = 'LALR'
_lr_signature = 'rightELSEAMPERSAND ARROW ASSIGN ASTERISK AUTO BREAK CARET CASE CHAR CHARACTER COLON COMMA CONST CONTINUE DEFAULT DIV DO DOT DOUBLE DOUBLE_AMPERSAND DOUBLE_MINUS DOUBLE_PIPE DOUBLE_PLUS ELLIPSIS ELSE ENUM EQ EQ_AMPERSAND EQ_CARET EQ_DIV EQ_MINUS EQ_MODULO EQ_PIPE EQ_PLUS EQ_SHIFT_LEFT EQ_SHIFT_RIGHT EQ_TIMES EXCLAMATION EXTERN FLOAT FNUMBER FOR GOTO GREATER GREATER_EQ ID IF INT INUMBER LBRACE LBRACKET LESS LESS_EQ LONG LPAREN MINUS MODULO NOT_EQ PIPE PLUS POUND QUESTION RBRACE RBRACKET REGISTER RETURN RPAREN SEMICOLON SHIFT_LEFT SHIFT_RIGHT SHORT SIGNED SIZEOF STATIC STRING STRUCT SWITCH TILDE TIMES TYPEDEF UNION UNSIGNED VOID VOLATILE WHILEtranslation_unit : external_declarationtranslation_unit : translation_unit external_declarationexternal_declaration : function_definition\n | declarationfunction_definition : type_specifier declarator compound_statementfunction_definition : STATIC type_specifier declarator compound_statementdeclaration : type_specifier declarator SEMICOLONdeclaration : EXTERN type_specifier declarator SEMICOLONdeclaration_list_opt : emptydeclaration_list_opt : declaration_listdeclaration_list : declarationdeclaration_list : declaration_list declarationtype_specifier : INT\n | CHARdeclarator : direct_declaratordeclarator : ASTERISK declaratordirect_declarator : IDdirect_declarator : direct_declarator LPAREN parameter_type_list RPARENdirect_declarator : direct_declarator LPAREN RPARENparameter_type_list : parameter_listparameter_type_list : parameter_list COMMA ELLIPSISparameter_list : parameter_declarationparameter_list : parameter_list COMMA parameter_declarationparameter_declaration : type_specifier declaratorcompound_statement : LBRACE declaration_list_opt statement_list RBRACEcompound_statement : LBRACE declaration_list_opt RBRACEexpression_statement : expression SEMICOLONexpression : equality_expressionexpression : equality_expression ASSIGN expression\n | equality_expression EQ_PLUS expression\n | equality_expression EQ_MINUS expressionequality_expression : relational_expressionequality_expression : equality_expression EQ relational_expression\n | equality_expression NOT_EQ relational_expressionrelational_expression : additive_expressionrelational_expression : relational_expression LESS additive_expression\n | relational_expression GREATER additive_expression\n | relational_expression LESS_EQ additive_expression\n | relational_expression GREATER_EQ additive_expressionpostfix_expression : primary_expressionpostfix_expression : postfix_expression LPAREN argument_expression_list RPARENpostfix_expression : postfix_expression LPAREN RPARENpostfix_expression : postfix_expression LBRACKET expression RBRACKETargument_expression_list : expressionargument_expression_list : argument_expression_list COMMA expressionunary_expression : postfix_expressionunary_expression : MINUS unary_expressionunary_expression : EXCLAMATION unary_expressionunary_expression : ASTERISK unary_expressionunary_expression : AMPERSAND unary_expressionmult_expression : unary_expressionmult_expression : mult_expression ASTERISK unary_expression\n | mult_expression DIV unary_expression\n | mult_expression MODULO unary_expressionadditive_expression : mult_expressionadditive_expression : additive_expression PLUS mult_expression\n | additive_expression MINUS mult_expressionprimary_expression : IDprimary_expression : INUMBERprimary_expression : FNUMBERprimary_expression : CHARACTERprimary_expression : string_literalprimary_expression : LPAREN expression RPARENstring_literal : STRINGstring_literal : string_literal STRINGstatement : compound_statement\n | expression_statement\n | selection_statement\n | iteration_statement\n | jump_statementjump_statement : RETURN SEMICOLONjump_statement : RETURN expression SEMICOLONjump_statement : BREAK SEMICOLONjump_statement : CONTINUE SEMICOLONiteration_statement : WHILE LPAREN expression RPAREN statementiteration_statement : FOR LPAREN expression_statement expression_statement expression RPAREN statementselection_statement : IF LPAREN expression RPAREN statementselection_statement : IF LPAREN expression RPAREN statement ELSE statementstatement_list : statementstatement_list : statement_list statementempty :'
_lr_signature = 'rightELSEAMPERSAND ARROW ASSIGN ASTERISK AUTO BREAK CARET CASE CHAR CHARACTER COLON COMMA CONST CONTINUE DEFAULT DIV DO DOT DOUBLE DOUBLE_AMPERSAND DOUBLE_MINUS DOUBLE_PIPE DOUBLE_PLUS ELLIPSIS ELSE ENUM EQ EQ_AMPERSAND EQ_CARET EQ_DIV EQ_MINUS EQ_MODULO EQ_PIPE EQ_PLUS EQ_SHIFT_LEFT EQ_SHIFT_RIGHT EQ_TIMES EXCLAMATION EXTERN FLOAT FNUMBER FOR GOTO GREATER GREATER_EQ ID IF INT INUMBER LBRACE LBRACKET LESS LESS_EQ LONG LPAREN MINUS MODULO NOT_EQ PIPE PLUS POUND QUESTION RBRACE RBRACKET REGISTER RETURN RPAREN SEMICOLON SHIFT_LEFT SHIFT_RIGHT SHORT SIGNED SIZEOF STATIC STRING STRUCT SWITCH TILDE TYPEDEF UNION UNSIGNED VOID VOLATILE WHILEtranslation_unit : external_declarationtranslation_unit : translation_unit external_declarationexternal_declaration : function_definition\n | declarationfunction_definition : type_specifier declarator compound_statementfunction_definition : STATIC type_specifier declarator compound_statementdeclaration : type_specifier declarator SEMICOLONdeclaration : EXTERN type_specifier declarator SEMICOLONdeclaration_list_opt : emptydeclaration_list_opt : declaration_listdeclaration_list : declarationdeclaration_list : declaration_list declarationtype_specifier : INT\n | CHARdeclarator : direct_declaratordeclarator : ASTERISK declaratordirect_declarator : IDdirect_declarator : direct_declarator LPAREN parameter_type_list RPARENdirect_declarator : direct_declarator LPAREN RPARENparameter_type_list : parameter_listparameter_type_list : parameter_list COMMA ELLIPSISparameter_list : parameter_declarationparameter_list : parameter_list COMMA parameter_declarationparameter_declaration : type_specifier declaratorcompound_statement : LBRACE declaration_list_opt statement_list RBRACEcompound_statement : LBRACE declaration_list_opt RBRACEexpression_statement : expression SEMICOLONexpression : equality_expressionexpression : equality_expression ASSIGN expression\n | equality_expression EQ_PLUS expression\n | equality_expression EQ_MINUS expressionequality_expression : relational_expressionequality_expression : equality_expression EQ relational_expression\n | equality_expression NOT_EQ relational_expressionrelational_expression : additive_expressionrelational_expression : relational_expression LESS additive_expression\n | relational_expression GREATER additive_expression\n | relational_expression LESS_EQ additive_expression\n | relational_expression GREATER_EQ additive_expressionpostfix_expression : primary_expressionpostfix_expression : postfix_expression LPAREN argument_expression_list RPARENpostfix_expression : postfix_expression LPAREN RPARENpostfix_expression : postfix_expression LBRACKET expression RBRACKETargument_expression_list : expressionargument_expression_list : argument_expression_list COMMA expressionunary_expression : postfix_expressionunary_expression : MINUS unary_expressionunary_expression : EXCLAMATION unary_expressionunary_expression : ASTERISK unary_expressionunary_expression : AMPERSAND unary_expressionmult_expression : unary_expressionmult_expression : mult_expression ASTERISK unary_expression\n | mult_expression DIV unary_expression\n | mult_expression MODULO unary_expressionadditive_expression : mult_expressionadditive_expression : additive_expression PLUS mult_expression\n | additive_expression MINUS mult_expressionprimary_expression : IDprimary_expression : INUMBERprimary_expression : FNUMBERprimary_expression : CHARACTERprimary_expression : string_literalprimary_expression : LPAREN expression RPARENstring_literal : STRINGstring_literal : string_literal STRINGstatement : compound_statement\n | expression_statement\n | selection_statement\n | iteration_statement\n | jump_statementjump_statement : RETURN SEMICOLONjump_statement : RETURN expression SEMICOLONjump_statement : BREAK SEMICOLONjump_statement : CONTINUE SEMICOLONiteration_statement : WHILE LPAREN expression RPAREN statementiteration_statement : FOR LPAREN expression_statement expression_statement expression RPAREN statementselection_statement : IF LPAREN expression RPAREN statementselection_statement : IF LPAREN expression RPAREN statement ELSE statementstatement_list : statementstatement_list : statement_list statementempty :'
_lr_action_items = {'RBRACE':([19,21,25,26,27,28,29,36,42,43,51,55,61,63,65,69,78,88,92,94,97,98,119,137,139,143,144,],[-81,-7,-8,-9,-11,36,-10,-26,-70,-67,-69,-79,-66,97,-68,-12,-74,-71,-73,-27,-25,-80,-72,-77,-75,-78,-76,]),'ASSIGN':([38,45,47,48,52,54,59,60,62,64,66,67,68,81,87,90,91,93,109,110,111,114,115,116,117,118,120,121,122,126,128,135,136,],[-55,-59,-32,-64,-61,-62,-40,-35,-51,100,-46,-58,-60,-49,-50,-47,-65,-48,-54,-52,-53,-63,-39,-37,-36,-38,-57,-56,-34,-33,-42,-41,-43,]),'STATIC':([0,1,2,5,9,16,20,21,24,25,36,97,],[4,-4,-1,-3,4,-2,-5,-7,-6,-8,-26,-25,]),'CHARACTER':([19,21,25,26,27,28,29,36,42,43,44,46,49,50,51,53,55,57,61,63,65,69,74,75,76,77,78,79,80,83,84,85,86,88,92,94,95,96,97,98,99,100,101,102,103,104,105,112,119,131,132,133,134,137,139,141,142,143,144,],[-81,-7,-8,-9,-11,52,-10,-26,-70,-67,52,52,52,52,-69,52,-79,52,-66,52,-68,-12,52,52,52,52,-74,52,52,52,52,52,52,-71,-73,-27,52,52,-25,-80,52,52,52,52,52,52,52,52,-72,52,52,52,52,-77,-75,52,52,-78,-76,]),'IF':([19,21,25,26,27,28,29,36,42,43,51,55,61,63,65,69,78,88,92,94,97,98,119,131,133,137,139,141,142,143,144,],[-81,-7,-8,-9,-11,37,-10,-26,-70,-67,-69,-79,-66,37,-68,-12,-74,-71,-73,-27,-25,-80,-72,37,37,-77,-75,37,37,-78,-76,]),'RETURN':([19,21,25,26,27,28,29,36,42,43,51,55,61,63,65,69,78,88,92,94,97,98,119,131,133,137,139,141,142,143,144,],[-81,-7,-8,-9,-11,50,-10,-26,-70,-67,-69,-79,-66,50,-68,-12,-74,-71,-73,-27,-25,-80,-72,50,50,-77,-75,50,50,-78,-76,]),'AMPERSAND':([19,21,25,26,27,28,29,36,42,43,44,46,49,50,51,53,55,57,61,63,65,69,74,75,76,77,78,79,80,83,84,85,86,88,92,94,95,96,97,98,99,100,101,102,103,104,105,112,119,131,132,133,134,137,139,141,142,143,144,],[-81,-7,-8,-9,-11,49,-10,-26,-70,-67,49,49,49,49,-69,49,-79,49,-66,49,-68,-12,49,49,49,49,-74,49,49,49,49,49,49,-71,-73,-27,49,49,-25,-80,49,49,49,49,49,49,49,49,-72,49,49,49,49,-77,-75,49,49,-78,-76,]),'CONTINUE':([19,21,25,26,27,28,29,36,42,43,51,55,61,63,65,69,78,88,92,94,97,98,119,131,133,137,139,141,142,143,144,],[-81,-7,-8,-9,-11,39,-10,-26,-70,-67,-69,-79,-66,39,-68,-12,-74,-71,-73,-27,-25,-80,-72,39,39,-77,-75,39,39,-78,-76,]),'FOR':([19,21,25,26,27,28,29,36,42,43,51,55,61,63,65,69,78,88,92,94,97,98,119,131,133,137,139,141,142,143,144,],[-81,-7,-8,-9,-11,40,-10,-26,-70,-67,-69,-79,-66,40,-68,-12,-74,-71,-73,-27,-25,-80,-72,40,40,-77,-75,40,40,-78,-76,]),'MINUS':([19,21,25,26,27,28,29,36,38,42,43,44,45,46,48,49,50,51,52,53,54,55,57,59,60,61,62,63,65,66,67,68,69,74,75,76,77,78,79,80,81,83,84,85,86,87,88,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,109,110,111,112,114,115,116,117,118,119,120,121,128,131,132,133,134,135,136,137,139,141,142,143,144,],[-81,-7,-8,-9,-11,53,-10,-26,-55,-70,-67,53,-59,53,-64,53,53,-69,-61,53,-62,-79,53,-40,95,-66,-51,53,-68,-46,-58,-60,-12,53,53,53,53,-74,53,53,-49,53,53,53,53,-50,-71,-47,-65,-73,-48,-27,53,53,-25,-80,53,53,53,53,53,53,53,-54,-52,-53,53,-63,95,95,95,95,-72,-57,-56,-42,53,53,53,53,-41,-43,-77,-75,53,53,-78,-76,]),'WHILE':([19,21,25,26,27,28,29,36,42,43,51,55,61,63,65,69,78,88,92,94,97,98,119,131,133,137,139,141,142,143,144,],[-81,-7,-8,-9,-11,41,-10,-26,-70,-67,-69,-79,-66,41,-68,-12,-74,-71,-73,-27,-25,-80,-72,41,41,-77,-75,41,41,-78,-76,]),'LBRACE':([12,13,14,17,19,21,23,25,26,27,28,29,33,36,42,43,51,55,61,63,65,69,71,78,88,92,94,97,98,119,131,133,137,139,141,142,143,144,],[19,-17,-15,19,-81,-7,-16,-8,-9,-11,19,-10,-19,-26,-70,-67,-69,-79,-66,19,-68,-12,-18,-74,-71,-73,-27,-25,-80,-72,19,19,-77,-75,19,19,-78,-76,]),'EQ':([38,45,47,48,52,54,59,60,62,64,66,67,68,81,87,90,91,93,109,110,111,114,115,116,117,118,120,121,122,126,128,135,136,],[-55,-59,-32,-64,-61,-62,-40,-35,-51,103,-46,-58,-60,-49,-50,-47,-65,-48,-54,-52,-53,-63,-39,-37,-36,-38,-57,-56,-34,-33,-42,-41,-43,]),'MODULO':([38,45,48,52,54,59,62,66,67,68,81,87,90,91,93,109,110,111,114,120,121,128,135,136,],[75,-59,-64,-61,-62,-40,-51,-46,-58,-60,-49,-50,-47,-65,-48,-54,-52,-53,-63,75,75,-42,-41,-43,]),'GREATER':([38,45,47,48,52,54,59,60,62,66,67,68,81,87,90,91,93,109,110,111,114,115,116,117,118,120,121,122,126,128,135,136,],[-55,-59,84,-64,-61,-62,-40,-35,-51,-46,-58,-60,-49,-50,-47,-65,-48,-54,-52,-53,-63,-39,-37,-36,-38,-57,-56,84,84,-42,-41,-43,]),'LBRACKET':([45,48,52,54,59,66,67,68,91,114,128,135,136,],[-59,-64,-61,-62,-40,105,-58,-60,-65,-63,-42,-41,-43,]),'DIV':([38,45,48,52,54,59,62,66,67,68,81,87,90,91,93,109,110,111,114,120,121,128,135,136,],[77,-59,-64,-61,-62,-40,-51,-46,-58,-60,-49,-50,-47,-65,-48,-54,-52,-53,-63,77,77,-42,-41,-43,]),'LESS':([38,45,47,48,52,54,59,60,62,66,67,68,81,87,90,91,93,109,110,111,114,115,116,117,118,120,121,122,126,128,135,136,],[-55,-59,85,-64,-61,-62,-40,-35,-51,-46,-58,-60,-49,-50,-47,-65,-48,-54,-52,-53,-63,-39,-37,-36,-38,-57,-56,85,85,-42,-41,-43,]),'RPAREN':([13,14,22,23,31,32,33,35,38,45,47,48,52,54,59,60,62,64,66,67,68,71,72,81,82,87,90,91,93,104,106,107,108,109,110,111,113,114,115,116,117,118,120,121,122,123,124,125,126,127,128,129,135,136,138,140,],[-17,-15,33,-16,-22,71,-19,-20,-55,-59,-32,-64,-61,-62,-40,-35,-51,-28,-46,-58,-60,-18,-24,-49,114,-50,-47,-65,-48,128,-23,-21,131,-54,-52,-53,133,-63,-39,-37,-36,-38,-57,-56,-34,-29,-30,-31,-33,135,-42,-44,-41,-43,142,-45,]),'EQ_MINUS':([38,45,47,48,52,54,59,60,62,64,66,67,68,81,87,90,91,93,109,110,111,114,115,116,117,118,120,121,122,126,128,135,136,],[-55,-59,-32,-64,-61,-62,-40,-35,-51,102,-46,-58,-60,-49,-50,-47,-65,-48,-54,-52,-53,-63,-39,-37,-36,-38,-57,-56,-34,-33,-42,-41,-43,]),'SEMICOLON':([12,13,14,18,23,33,38,39,45,47,48,50,52,54,56,58,59,60,62,64,66,67,68,70,71,81,87,89,90,91,93,109,110,111,114,115,116,117,118,120,121,122,123,124,125,126,128,135,136,],[21,-17,-15,25,-16,-19,-55,78,-59,-32,-64,88,-61,-62,92,94,-40,-35,-51,-28,-46,-58,-60,21,-18,-49,-50,119,-47,-65,-48,-54,-52,-53,-63,-39,-37,-36,-38,-57,-56,-34,-29,-30,-31,-33,-42,-41,-43,]),'BREAK':([19,21,25,26,27,28,29,36,42,43,51,55,61,63,65,69,78,88,92,94,97,98,119,131,133,137,139,141,142,143,144,],[-81,-7,-8,-9,-11,56,-10,-26,-70,-67,-69,-79,-66,56,-68,-12,-74,-71,-73,-27,-25,-80,-72,56,56,-77,-75,56,56,-78,-76,]),'ASTERISK':([3,6,8,10,11,15,19,21,25,26,27,28,29,30,34,36,38,42,43,44,45,46,48,49,50,51,52,53,54,55,57,59,61,62,63,65,66,67,68,69,74,75,76,77,78,79,80,81,83,84,85,86,87,88,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,109,110,111,112,114,119,120,121,128,131,132,133,134,135,136,137,139,141,142,143,144,],[-13,-14,15,15,15,15,-81,-7,-8,-9,-11,44,-10,15,15,-26,76,-70,-67,44,-59,44,-64,44,44,-69,-61,44,-62,-79,44,-40,-66,-51,44,-68,-46,-58,-60,-12,44,44,44,44,-74,44,44,-49,44,44,44,44,-50,-71,-47,-65,-73,-48,-27,44,44,-25,-80,44,44,44,44,44,44,44,-54,-52,-53,44,-63,-72,76,76,-42,44,44,44,44,-41,-43,-77,-75,44,44,-78,-76,]),'INUMBER':([19,21,25,26,27,28,29,36,42,43,44,46,49,50,51,53,55,57,61,63,65,69,74,75,76,77,78,79,80,83,84,85,86,88,92,94,95,96,97,98,99,100,101,102,103,104,105,112,119,131,132,133,134,137,139,141,142,143,144,],[-81,-7,-8,-9,-11,45,-10,-26,-70,-67,45,45,45,45,-69,45,-79,45,-66,45,-68,-12,45,45,45,45,-74,45,45,45,45,45,45,-71,-73,-27,45,45,-25,-80,45,45,45,45,45,45,45,45,-72,45,45,45,45,-77,-75,45,45,-78,-76,]),'GREATER_EQ':([38,45,47,48,52,54,59,60,62,66,67,68,81,87,90,91,93,109,110,111,114,115,116,117,118,120,121,122,126,128,135,136,],[-55,-59,83,-64,-61,-62,-40,-35,-51,-46,-58,-60,-49,-50,-47,-65,-48,-54,-52,-53,-63,-39,-37,-36,-38,-57,-56,83,83,-42,-41,-43,]),'LPAREN':([13,14,19,21,25,26,27,28,29,33,36,37,40,41,42,43,44,45,46,48,49,50,51,52,53,54,55,57,59,61,63,65,66,67,68,69,71,74,75,76,77,78,79,80,83,84,85,86,88,91,92,94,95,96,97,98,99,100,101,102,103,104,105,112,114,119,128,131,132,133,134,135,136,137,139,141,142,143,144,],[-17,22,-81,-7,-8,-9,-11,46,-10,-19,-26,74,79,80,-70,-67,46,-59,46,-64,46,46,-69,-61,46,-62,-79,46,-40,-66,46,-68,104,-58,-60,-12,-18,46,46,46,46,-74,46,46,46,46,46,46,-71,-65,-73,-27,46,46,-25,-80,46,46,46,46,46,46,46,46,-63,-72,-42,46,46,46,46,-41,-43,-77,-75,46,46,-78,-76,]),'LESS_EQ':([38,45,47,48,52,54,59,60,62,66,67,68,81,87,90,91,93,109,110,111,114,115,116,117,118,120,121,122,126,128,135,136,],[-55,-59,86,-64,-61,-62,-40,-35,-51,-46,-58,-60,-49,-50,-47,-65,-48,-54,-52,-53,-63,-39,-37,-36,-38,-57,-56,86,86,-42,-41,-43,]),'COMMA':([13,14,23,31,33,35,38,45,47,48,52,54,59,60,62,64,66,67,68,71,72,81,87,90,91,93,106,109,110,111,114,115,116,117,118,120,121,122,123,124,125,126,127,128,129,135,136,140,],[-17,-15,-16,-22,-19,73,-55,-59,-32,-64,-61,-62,-40,-35,-51,-28,-46,-58,-60,-18,-24,-49,-50,-47,-65,-48,-23,-54,-52,-53,-63,-39,-37,-36,-38,-57,-56,-34,-29,-30,-31,-33,134,-42,-44,-41,-43,-45,]),'ELSE':([36,42,43,51,61,65,78,88,92,94,97,119,137,139,143,144,],[-26,-70,-67,-69,-66,-68,-74,-71,-73,-27,-25,-72,141,-75,-78,-76,]),'INT':([0,1,2,4,5,7,9,16,19,20,21,22,24,25,27,29,36,69,73,97,],[3,-4,-1,3,-3,3,3,-2,3,-5,-7,3,-6,-8,-11,3,-26,-12,3,-25,]),'NOT_EQ':([38,45,47,48,52,54,59,60,62,64,66,67,68,81,87,90,91,93,109,110,111,114,115,116,117,118,120,121,122,126,128,135,136,],[-55,-59,-32,-64,-61,-62,-40,-35,-51,99,-46,-58,-60,-49,-50,-47,-65,-48,-54,-52,-53,-63,-39,-37,-36,-38,-57,-56,-34,-33,-42,-41,-43,]),'PLUS':([38,45,48,52,54,59,60,62,66,67,68,81,87,90,91,93,109,110,111,114,115,116,117,118,120,121,128,135,136,],[-55,-59,-64,-61,-62,-40,96,-51,-46,-58,-60,-49,-50,-47,-65,-48,-54,-52,-53,-63,96,96,96,96,-57,-56,-42,-41,-43,]),'STRING':([19,21,25,26,27,28,29,36,42,43,44,46,48,49,50,51,53,54,55,57,61,63,65,69,74,75,76,77,78,79,80,83,84,85,86,88,91,92,94,95,96,97,98,99,100,101,102,103,104,105,112,119,131,132,133,134,137,139,141,142,143,144,],[-81,-7,-8,-9,-11,48,-10,-26,-70,-67,48,48,-64,48,48,-69,48,91,-79,48,-66,48,-68,-12,48,48,48,48,-74,48,48,48,48,48,48,-71,-65,-73,-27,48,48,-25,-80,48,48,48,48,48,48,48,48,-72,48,48,48,48,-77,-75,48,48,-78,-76,]),'$end':([1,2,5,9,16,20,21,24,25,36,97,],[-4,-1,-3,0,-2,-5,-7,-6,-8,-26,-25,]),'CHAR':([0,1,2,4,5,7,9,16,19,20,21,22,24,25,27,29,36,69,73,97,],[6,-4,-1,6,-3,6,6,-2,6,-5,-7,6,-6,-8,-11,6,-26,-12,6,-25,]),'EXTERN':([0,1,2,5,9,16,19,20,21,24,25,27,29,36,69,97,],[7,-4,-1,-3,7,-2,7,-5,-7,-6,-8,-11,7,-26,-12,-25,]),'RBRACKET':([38,45,47,48,52,54,59,60,62,64,66,67,68,81,87,90,91,93,109,110,111,114,115,116,117,118,120,121,122,123,124,125,126,128,130,135,136,],[-55,-59,-32,-64,-61,-62,-40,-35,-51,-28,-46,-58,-60,-49,-50,-47,-65,-48,-54,-52,-53,-63,-39,-37,-36,-38,-57,-56,-34,-29,-30,-31,-33,-42,136,-41,-43,]),'FNUMBER':([19,21,25,26,27,28,29,36,42,43,44,46,49,50,51,53,55,57,61,63,65,69,74,75,76,77,78,79,80,83,84,85,86,88,92,94,95,96,97,98,99,100,101,102,103,104,105,112,119,131,132,133,134,137,139,141,142,143,144,],[-81,-7,-8,-9,-11,68,-10,-26,-70,-67,68,68,68,68,-69,68,-79,68,-66,68,-68,-12,68,68,68,68,-74,68,68,68,68,68,68,-71,-73,-27,68,68,-25,-80,68,68,68,68,68,68,68,68,-72,68,68,68,68,-77,-75,68,68,-78,-76,]),'ELLIPSIS':([73,],[107,]),'EQ_PLUS':([38,45,47,48,52,54,59,60,62,64,66,67,68,81,87,90,91,93,109,110,111,114,115,116,117,118,120,121,122,126,128,135,136,],[-55,-59,-32,-64,-61,-62,-40,-35,-51,101,-46,-58,-60,-49,-50,-47,-65,-48,-54,-52,-53,-63,-39,-37,-36,-38,-57,-56,-34,-33,-42,-41,-43,]),'EXCLAMATION':([19,21,25,26,27,28,29,36,42,43,44,46,49,50,51,53,55,57,61,63,65,69,74,75,76,77,78,79,80,83,84,85,86,88,92,94,95,96,97,98,99,100,101,102,103,104,105,112,119,131,132,133,134,137,139,141,142,143,144,],[-81,-7,-8,-9,-11,57,-10,-26,-70,-67,57,57,57,57,-69,57,-79,57,-66,57,-68,-12,57,57,57,57,-74,57,57,57,57,57,57,-71,-73,-27,57,57,-25,-80,57,57,57,57,57,57,57,57,-72,57,57,57,57,-77,-75,57,57,-78,-76,]),'ID':([3,6,8,10,11,15,19,21,25,26,27,28,29,30,34,36,42,43,44,46,49,50,51,53,55,57,61,63,65,69,74,75,76,77,78,79,80,83,84,85,86,88,92,94,95,96,97,98,99,100,101,102,103,104,105,112,119,131,132,133,134,137,139,141,142,143,144,],[-13,-14,13,13,13,13,-81,-7,-8,-9,-11,67,-10,13,13,-26,-70,-67,67,67,67,67,-69,67,-79,67,-66,67,-68,-12,67,67,67,67,-74,67,67,67,67,67,67,-71,-73,-27,67,67,-25,-80,67,67,67,67,67,67,67,67,-72,67,67,67,67,-77,-75,67,67,-78,-76,]),}
_lr_action_items = {'ASSIGN':([41,42,43,47,48,50,52,55,59,61,63,67,71,76,81,90,95,96,108,109,110,111,112,113,114,117,120,121,122,125,128,132,134,],[-32,-62,-35,-51,-64,-59,-46,-55,-60,-58,-40,-61,102,-48,-65,-50,-49,-47,-39,-36,-38,-37,-56,-57,-63,-42,-52,-54,-53,-33,-34,-43,-41,]),'BREAK':([19,21,30,32,33,34,35,44,46,51,53,56,57,66,69,73,86,87,98,99,100,106,130,131,136,137,140,141,142,143,144,],[-81,-7,-9,-11,65,-10,-8,-79,-26,65,-68,-70,-66,-67,-69,-12,-80,-25,-73,-74,-27,-71,-72,65,65,-75,-77,65,65,-76,-78,]),'LESS':([41,42,43,47,48,50,52,55,59,61,63,67,76,81,90,95,96,108,109,110,111,112,113,114,117,120,121,122,125,128,132,134,],[78,-62,-35,-51,-64,-59,-46,-55,-60,-58,-40,-61,-48,-65,-50,-49,-47,-39,-36,-38,-37,-56,-57,-63,-42,-52,-54,-53,78,78,-43,-41,]),'IF':([19,21,30,32,33,34,35,44,46,51,53,56,57,66,69,73,86,87,98,99,100,106,130,131,136,137,140,141,142,143,144,],[-81,-7,-9,-11,64,-10,-8,-79,-26,64,-68,-70,-66,-67,-69,-12,-80,-25,-73,-74,-27,-71,-72,64,64,-75,-77,64,64,-76,-78,]),'NOT_EQ':([41,42,43,47,48,50,52,55,59,61,63,67,71,76,81,90,95,96,108,109,110,111,112,113,114,117,120,121,122,125,128,132,134,],[-32,-62,-35,-51,-64,-59,-46,-55,-60,-58,-40,-61,104,-48,-65,-50,-49,-47,-39,-36,-38,-37,-56,-57,-63,-42,-52,-54,-53,-33,-34,-43,-41,]),'FOR':([19,21,30,32,33,34,35,44,46,51,53,56,57,66,69,73,86,87,98,99,100,106,130,131,136,137,140,141,142,143,144,],[-81,-7,-9,-11,58,-10,-8,-79,-26,58,-68,-70,-66,-67,-69,-12,-80,-25,-73,-74,-27,-71,-72,58,58,-75,-77,58,58,-76,-78,]),'MINUS':([19,21,30,32,33,34,35,40,42,43,44,45,46,47,48,50,51,52,53,54,55,56,57,59,60,61,62,63,66,67,69,72,73,76,77,78,79,80,81,82,83,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,108,109,110,111,112,113,114,117,120,121,122,123,130,131,132,133,134,135,136,137,140,141,142,143,144,],[-81,-7,-9,-11,62,-10,-8,62,-62,83,-79,62,-26,-51,-64,-59,62,-46,-68,62,-55,-70,-66,-60,62,-58,62,-40,-67,-61,-69,62,-12,-48,62,62,62,62,-65,62,62,62,-80,-25,62,62,-50,62,62,62,62,-49,-47,62,-73,-74,-27,62,62,62,62,62,-71,83,83,83,83,-56,-57,-63,-42,-52,-54,-53,62,-72,62,-43,62,-41,62,62,-75,-77,62,62,-76,-78,]),'GREATER':([41,42,43,47,48,50,52,55,59,61,63,67,76,81,90,95,96,108,109,110,111,112,113,114,117,120,121,122,125,128,132,134,],[80,-62,-35,-51,-64,-59,-46,-55,-60,-58,-40,-61,-48,-65,-50,-49,-47,-39,-36,-38,-37,-56,-57,-63,-42,-52,-54,-53,80,80,-43,-41,]),'COMMA':([12,15,22,26,27,28,36,38,41,42,43,47,48,50,52,55,59,61,63,67,71,75,76,81,90,95,96,108,109,110,111,112,113,114,117,118,119,120,121,122,125,126,127,128,129,132,134,138,],[-15,-17,-16,37,-19,-22,-24,-18,-32,-62,-35,-51,-64,-59,-46,-55,-60,-58,-40,-61,-28,-23,-48,-65,-50,-49,-47,-39,-36,-38,-37,-56,-57,-63,-42,-44,133,-52,-54,-53,-33,-29,-31,-34,-30,-43,-41,-45,]),'RPAREN':([12,15,18,22,26,27,28,29,36,38,41,42,43,47,48,50,52,55,59,61,63,67,71,74,75,76,81,84,89,90,95,96,108,109,110,111,112,113,114,115,117,118,119,120,121,122,124,125,126,127,128,129,132,134,138,139,],[-15,-17,27,-16,-20,-19,-22,38,-24,-18,-32,-62,-35,-51,-64,-59,-46,-55,-60,-58,-40,-61,-28,-21,-23,-48,-65,114,117,-50,-49,-47,-39,-36,-38,-37,-56,-57,-63,131,-42,-44,134,-52,-54,-53,136,-33,-29,-31,-34,-30,-43,-41,-45,141,]),'LESS_EQ':([41,42,43,47,48,50,52,55,59,61,63,67,76,81,90,95,96,108,109,110,111,112,113,114,117,120,121,122,125,128,132,134,],[79,-62,-35,-51,-64,-59,-46,-55,-60,-58,-40,-61,-48,-65,-50,-49,-47,-39,-36,-38,-37,-56,-57,-63,-42,-52,-54,-53,79,79,-43,-41,]),'EQ_MINUS':([41,42,43,47,48,50,52,55,59,61,63,67,71,76,81,90,95,96,108,109,110,111,112,113,114,117,120,121,122,125,128,132,134,],[-32,-62,-35,-51,-64,-59,-46,-55,-60,-58,-40,-61,103,-48,-65,-50,-49,-47,-39,-36,-38,-37,-56,-57,-63,-42,-52,-54,-53,-33,-34,-43,-41,]),'ASTERISK':([4,5,8,11,14,16,19,21,25,30,31,32,33,34,35,40,42,44,45,46,47,48,50,51,52,53,54,55,56,57,59,60,61,62,63,66,67,69,72,73,76,77,78,79,80,81,82,83,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,112,113,114,117,120,121,122,123,130,131,132,133,134,135,136,137,140,141,142,143,144,],[14,-13,-14,14,14,14,-81,-7,14,-9,14,-11,60,-10,-8,60,-62,-79,60,-26,-51,-64,-59,60,-46,-68,60,91,-70,-66,-60,60,-58,60,-40,-67,-61,-69,60,-12,-48,60,60,60,60,-65,60,60,60,-80,-25,60,60,-50,60,60,60,60,-49,-47,60,-73,-74,-27,60,60,60,60,60,-71,91,91,-63,-42,-52,-54,-53,60,-72,60,-43,60,-41,60,60,-75,-77,60,60,-76,-78,]),'EQ':([41,42,43,47,48,50,52,55,59,61,63,67,71,76,81,90,95,96,108,109,110,111,112,113,114,117,120,121,122,125,128,132,134,],[-32,-62,-35,-51,-64,-59,-46,-55,-60,-58,-40,-61,101,-48,-65,-50,-49,-47,-39,-36,-38,-37,-56,-57,-63,-42,-52,-54,-53,-33,-34,-43,-41,]),'CHAR':([0,1,2,3,6,7,9,10,18,19,20,21,24,32,34,35,37,46,73,87,],[8,8,-3,8,-4,-1,8,-2,8,8,-5,-7,-6,-11,8,-8,8,-26,-12,-25,]),'LPAREN':([12,15,19,21,27,30,32,33,34,35,38,40,42,44,45,46,48,49,50,51,52,53,54,56,57,58,59,60,61,62,63,64,66,67,69,72,73,77,78,79,80,81,82,83,85,86,87,88,89,91,92,93,94,97,98,99,100,101,102,103,104,105,106,114,117,123,130,131,132,133,134,135,136,137,140,141,142,143,144,],[18,-17,-81,-7,-19,-9,-11,45,-10,-8,-18,45,-62,-79,45,-26,-64,85,-59,45,89,-68,45,-70,-66,94,-60,45,-58,45,-40,97,-67,-61,-69,45,-12,45,45,45,45,-65,45,45,45,-80,-25,45,45,45,45,45,45,45,-73,-74,-27,45,45,45,45,45,-71,-63,-42,45,-72,45,-43,45,-41,45,45,-75,-77,45,45,-76,-78,]),'EXTERN':([0,1,2,6,7,10,19,20,21,24,32,34,35,46,73,87,],[9,9,-3,-4,-1,-2,9,-5,-7,-6,-11,9,-8,-26,-12,-25,]),'MODULO':([42,47,48,50,52,55,59,61,63,67,76,81,90,95,96,112,113,114,117,120,121,122,132,134,],[-62,-51,-64,-59,-46,92,-60,-58,-40,-61,-48,-65,-50,-49,-47,92,92,-63,-42,-52,-54,-53,-43,-41,]),'RBRACE':([19,21,30,32,33,34,35,44,46,51,53,56,57,66,69,73,86,87,98,99,100,106,130,137,140,143,144,],[-81,-7,-9,-11,46,-10,-8,-79,-26,87,-68,-70,-66,-67,-69,-12,-80,-25,-73,-74,-27,-71,-72,-75,-77,-76,-78,]),'$end':([1,2,6,7,10,20,21,24,35,46,87,],[0,-3,-4,-1,-2,-5,-7,-6,-8,-26,-25,]),'EQ_PLUS':([41,42,43,47,48,50,52,55,59,61,63,67,71,76,81,90,95,96,108,109,110,111,112,113,114,117,120,121,122,125,128,132,134,],[-32,-62,-35,-51,-64,-59,-46,-55,-60,-58,-40,-61,105,-48,-65,-50,-49,-47,-39,-36,-38,-37,-56,-57,-63,-42,-52,-54,-53,-33,-34,-43,-41,]),'ID':([4,5,8,11,14,16,19,21,25,30,31,32,33,34,35,40,44,45,46,51,53,54,56,57,60,62,66,69,72,73,77,78,79,80,82,83,85,86,87,88,89,91,92,93,94,97,98,99,100,101,102,103,104,105,106,123,130,131,133,135,136,137,140,141,142,143,144,],[15,-13,-14,15,15,15,-81,-7,15,-9,15,-11,61,-10,-8,61,-79,61,-26,61,-68,61,-70,-66,61,61,-67,-69,61,-12,61,61,61,61,61,61,61,-80,-25,61,61,61,61,61,61,61,-73,-74,-27,61,61,61,61,61,-71,61,-72,61,61,61,61,-75,-77,61,61,-76,-78,]),'STRING':([19,21,30,32,33,34,35,40,42,44,45,46,48,51,53,54,56,57,60,62,66,69,72,73,77,78,79,80,81,82,83,85,86,87,88,89,91,92,93,94,97,98,99,100,101,102,103,104,105,106,123,130,131,133,135,136,137,140,141,142,143,144,],[-81,-7,-9,-11,48,-10,-8,48,81,-79,48,-26,-64,48,-68,48,-70,-66,48,48,-67,-69,48,-12,48,48,48,48,-65,48,48,48,-80,-25,48,48,48,48,48,48,48,-73,-74,-27,48,48,48,48,48,-71,48,-72,48,48,48,48,-75,-77,48,48,-76,-78,]),'PLUS':([42,43,47,48,50,52,55,59,61,63,67,76,81,90,95,96,108,109,110,111,112,113,114,117,120,121,122,132,134,],[-62,82,-51,-64,-59,-46,-55,-60,-58,-40,-61,-48,-65,-50,-49,-47,82,82,82,82,-56,-57,-63,-42,-52,-54,-53,-43,-41,]),'GREATER_EQ':([41,42,43,47,48,50,52,55,59,61,63,67,76,81,90,95,96,108,109,110,111,112,113,114,117,120,121,122,125,128,132,134,],[77,-62,-35,-51,-64,-59,-46,-55,-60,-58,-40,-61,-48,-65,-50,-49,-47,-39,-36,-38,-37,-56,-57,-63,-42,-52,-54,-53,77,77,-43,-41,]),'WHILE':([19,21,30,32,33,34,35,44,46,51,53,56,57,66,69,73,86,87,98,99,100,106,130,131,136,137,140,141,142,143,144,],[-81,-7,-9,-11,49,-10,-8,-79,-26,49,-68,-70,-66,-67,-69,-12,-80,-25,-73,-74,-27,-71,-72,49,49,-75,-77,49,49,-76,-78,]),'INUMBER':([19,21,30,32,33,34,35,40,44,45,46,51,53,54,56,57,60,62,66,69,72,73,77,78,79,80,82,83,85,86,87,88,89,91,92,93,94,97,98,99,100,101,102,103,104,105,106,123,130,131,133,135,136,137,140,141,142,143,144,],[-81,-7,-9,-11,50,-10,-8,50,-79,50,-26,50,-68,50,-70,-66,50,50,-67,-69,50,-12,50,50,50,50,50,50,50,-80,-25,50,50,50,50,50,50,50,-73,-74,-27,50,50,50,50,50,-71,50,-72,50,50,50,50,-75,-77,50,50,-76,-78,]),'LBRACKET':([42,48,50,52,59,61,63,67,81,114,117,132,134,],[-62,-64,-59,88,-60,-58,-40,-61,-65,-63,-42,-43,-41,]),'EXCLAMATION':([19,21,30,32,33,34,35,40,44,45,46,51,53,54,56,57,60,62,66,69,72,73,77,78,79,80,82,83,85,86,87,88,89,91,92,93,94,97,98,99,100,101,102,103,104,105,106,123,130,131,133,135,136,137,140,141,142,143,144,],[-81,-7,-9,-11,40,-10,-8,40,-79,40,-26,40,-68,40,-70,-66,40,40,-67,-69,40,-12,40,40,40,40,40,40,40,-80,-25,40,40,40,40,40,40,40,-73,-74,-27,40,40,40,40,40,-71,40,-72,40,40,40,40,-75,-77,40,40,-76,-78,]),'SEMICOLON':([12,13,15,22,23,27,38,39,41,42,43,47,48,50,52,55,59,61,63,65,67,68,70,71,72,76,81,90,95,96,107,108,109,110,111,112,113,114,117,120,121,122,125,126,127,128,129,132,134,],[-15,21,-17,-16,35,-19,-18,21,-32,-62,-35,-51,-64,-59,-46,-55,-60,-58,-40,98,-61,99,100,-28,106,-48,-65,-50,-49,-47,130,-39,-36,-38,-37,-56,-57,-63,-42,-52,-54,-53,-33,-29,-31,-34,-30,-43,-41,]),'STATIC':([0,1,2,6,7,10,20,21,24,35,46,87,],[3,3,-3,-4,-1,-2,-5,-7,-6,-8,-26,-25,]),'CHARACTER':([19,21,30,32,33,34,35,40,44,45,46,51,53,54,56,57,60,62,66,69,72,73,77,78,79,80,82,83,85,86,87,88,89,91,92,93,94,97,98,99,100,101,102,103,104,105,106,123,130,131,133,135,136,137,140,141,142,143,144,],[-81,-7,-9,-11,67,-10,-8,67,-79,67,-26,67,-68,67,-70,-66,67,67,-67,-69,67,-12,67,67,67,67,67,67,67,-80,-25,67,67,67,67,67,67,67,-73,-74,-27,67,67,67,67,67,-71,67,-72,67,67,67,67,-75,-77,67,67,-76,-78,]),'ELLIPSIS':([37,],[74,]),'CONTINUE':([19,21,30,32,33,34,35,44,46,51,53,56,57,66,69,73,86,87,98,99,100,106,130,131,136,137,140,141,142,143,144,],[-81,-7,-9,-11,68,-10,-8,-79,-26,68,-68,-70,-66,-67,-69,-12,-80,-25,-73,-74,-27,-71,-72,68,68,-75,-77,68,68,-76,-78,]),'AMPERSAND':([19,21,30,32,33,34,35,40,44,45,46,51,53,54,56,57,60,62,66,69,72,73,77,78,79,80,82,83,85,86,87,88,89,91,92,93,94,97,98,99,100,101,102,103,104,105,106,123,130,131,133,135,136,137,140,141,142,143,144,],[-81,-7,-9,-11,54,-10,-8,54,-79,54,-26,54,-68,54,-70,-66,54,54,-67,-69,54,-12,54,54,54,54,54,54,54,-80,-25,54,54,54,54,54,54,54,-73,-74,-27,54,54,54,54,54,-71,54,-72,54,54,54,54,-75,-77,54,54,-76,-78,]),'FNUMBER':([19,21,30,32,33,34,35,40,44,45,46,51,53,54,56,57,60,62,66,69,72,73,77,78,79,80,82,83,85,86,87,88,89,91,92,93,94,97,98,99,100,101,102,103,104,105,106,123,130,131,133,135,136,137,140,141,142,143,144,],[-81,-7,-9,-11,59,-10,-8,59,-79,59,-26,59,-68,59,-70,-66,59,59,-67,-69,59,-12,59,59,59,59,59,59,59,-80,-25,59,59,59,59,59,59,59,-73,-74,-27,59,59,59,59,59,-71,59,-72,59,59,59,59,-75,-77,59,59,-76,-78,]),'INT':([0,1,2,3,6,7,9,10,18,19,20,21,24,32,34,35,37,46,73,87,],[5,5,-3,5,-4,-1,5,-2,5,5,-5,-7,-6,-11,5,-8,5,-26,-12,-25,]),'RBRACKET':([41,42,43,47,48,50,52,55,59,61,63,67,71,76,81,90,95,96,108,109,110,111,112,113,114,116,117,120,121,122,125,126,127,128,129,132,134,],[-32,-62,-35,-51,-64,-59,-46,-55,-60,-58,-40,-61,-28,-48,-65,-50,-49,-47,-39,-36,-38,-37,-56,-57,-63,132,-42,-52,-54,-53,-33,-29,-31,-34,-30,-43,-41,]),'LBRACE':([12,13,15,17,19,21,22,27,30,32,33,34,35,38,44,46,51,53,56,57,66,69,73,86,87,98,99,100,106,130,131,136,137,140,141,142,143,144,],[-15,19,-17,19,-81,-7,-16,-19,-9,-11,19,-10,-8,-18,-79,-26,19,-68,-70,-66,-67,-69,-12,-80,-25,-73,-74,-27,-71,-72,19,19,-75,-77,19,19,-76,-78,]),'ELSE':([46,53,56,57,66,69,87,98,99,100,106,130,137,140,143,144,],[-26,-68,-70,-66,-67,-69,-25,-73,-74,-27,-71,-72,-75,142,-76,-78,]),'RETURN':([19,21,30,32,33,34,35,44,46,51,53,56,57,66,69,73,86,87,98,99,100,106,130,131,136,137,140,141,142,143,144,],[-81,-7,-9,-11,72,-10,-8,-79,-26,72,-68,-70,-66,-67,-69,-12,-80,-25,-73,-74,-27,-71,-72,72,72,-75,-77,72,72,-76,-78,]),'DIV':([42,47,48,50,52,55,59,61,63,67,76,81,90,95,96,112,113,114,117,120,121,122,132,134,],[-62,-51,-64,-59,-46,93,-60,-58,-40,-61,-48,-65,-50,-49,-47,93,93,-63,-42,-52,-54,-53,-43,-41,]),}
_lr_action = {}
for _k, _v in _lr_action_items.items():
......@@ -17,7 +17,7 @@ for _k, _v in _lr_action_items.items():
_lr_action[_x][_k] = _y
del _lr_action_items
_lr_goto_items = {'mult_expression':([28,46,50,63,74,79,80,83,84,85,86,95,96,99,100,101,102,103,104,105,112,131,132,133,134,141,142,],[38,38,38,38,38,38,38,38,38,38,38,120,121,38,38,38,38,38,38,38,38,38,38,38,38,38,38,]),'declarator':([8,10,11,15,30,34,],[12,17,18,23,70,72,]),'translation_unit':([0,],[9,]),'additive_expression':([28,46,50,63,74,79,80,83,84,85,86,99,100,101,102,103,104,105,112,131,132,133,134,141,142,],[60,60,60,60,60,60,60,115,116,117,118,60,60,60,60,60,60,60,60,60,60,60,60,60,60,]),'jump_statement':([28,63,131,133,141,142,],[42,42,42,42,42,42,]),'declaration_list_opt':([19,],[28,]),'string_literal':([28,44,46,49,50,53,57,63,74,75,76,77,79,80,83,84,85,86,95,96,99,100,101,102,103,104,105,112,131,132,133,134,141,142,],[54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,]),'iteration_statement':([28,63,131,133,141,142,],[51,51,51,51,51,51,]),'argument_expression_list':([104,],[127,]),'declaration_list':([19,],[29,]),'parameter_type_list':([22,],[32,]),'expression_statement':([28,63,79,112,131,133,141,142,],[43,43,112,132,43,43,43,43,]),'statement':([28,63,131,133,141,142,],[55,98,137,139,143,144,]),'parameter_list':([22,],[35,]),'declaration':([0,9,19,29,],[1,1,27,69,]),'expression':([28,46,50,63,74,79,80,100,101,102,104,105,112,131,132,133,134,141,142,],[58,82,89,58,108,58,113,123,124,125,129,130,58,58,138,58,140,58,58,]),'primary_expression':([28,44,46,49,50,53,57,63,74,75,76,77,79,80,83,84,85,86,95,96,99,100,101,102,103,104,105,112,131,132,133,134,141,142,],[59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,]),'empty':([19,],[26,]),'compound_statement':([12,17,28,63,131,133,141,142,],[20,24,61,61,61,61,61,61,]),'unary_expression':([28,44,46,49,50,53,57,63,74,75,76,77,79,80,83,84,85,86,95,96,99,100,101,102,103,104,105,112,131,132,133,134,141,142,],[62,81,62,87,62,90,93,62,62,109,110,111,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,]),'external_declaration':([0,9,],[2,16,]),'selection_statement':([28,63,131,133,141,142,],[65,65,65,65,65,65,]),'relational_expression':([28,46,50,63,74,79,80,99,100,101,102,103,104,105,112,131,132,133,134,141,142,],[47,47,47,47,47,47,47,122,47,47,47,126,47,47,47,47,47,47,47,47,47,]),'function_definition':([0,9,],[5,5,]),'parameter_declaration':([22,73,],[31,106,]),'statement_list':([28,],[63,]),'postfix_expression':([28,44,46,49,50,53,57,63,74,75,76,77,79,80,83,84,85,86,95,96,99,100,101,102,103,104,105,112,131,132,133,134,141,142,],[66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,]),'direct_declarator':([8,10,11,15,30,34,],[14,14,14,14,14,14,]),'type_specifier':([0,4,7,9,19,22,29,73,],[8,10,11,8,30,34,30,34,]),'equality_expression':([28,46,50,63,74,79,80,100,101,102,104,105,112,131,132,133,134,141,142,],[64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,]),}
_lr_goto_items = {'string_literal':([33,40,45,51,54,60,62,72,77,78,79,80,82,83,85,88,89,91,92,93,94,97,101,102,103,104,105,123,131,133,135,136,141,142,],[42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,]),'declaration_list_opt':([19,],[33,]),'empty':([19,],[30,]),'parameter_declaration':([18,37,],[28,75,]),'function_definition':([0,1,],[2,2,]),'relational_expression':([33,45,51,72,85,88,89,94,97,101,102,103,104,105,123,131,133,135,136,141,142,],[41,41,41,41,41,41,41,41,41,125,41,41,128,41,41,41,41,41,41,41,41,]),'compound_statement':([13,17,33,51,131,136,141,142,],[20,24,57,57,57,57,57,57,]),'additive_expression':([33,45,51,72,77,78,79,80,85,88,89,94,97,101,102,103,104,105,123,131,133,135,136,141,142,],[43,43,43,43,108,109,110,111,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,]),'argument_expression_list':([89,],[119,]),'postfix_expression':([33,40,45,51,54,60,62,72,77,78,79,80,82,83,85,88,89,91,92,93,94,97,101,102,103,104,105,123,131,133,135,136,141,142,],[52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,]),'translation_unit':([0,],[1,]),'declaration':([0,1,19,34,],[6,6,32,73,]),'primary_expression':([33,40,45,51,54,60,62,72,77,78,79,80,82,83,85,88,89,91,92,93,94,97,101,102,103,104,105,123,131,133,135,136,141,142,],[63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,]),'statement':([33,51,131,136,141,142,],[44,86,137,140,143,144,]),'parameter_type_list':([18,],[29,]),'unary_expression':([33,40,45,51,54,60,62,72,77,78,79,80,82,83,85,88,89,91,92,93,94,97,101,102,103,104,105,123,131,133,135,136,141,142,],[47,76,47,47,90,95,96,47,47,47,47,47,47,47,47,47,47,120,121,122,47,47,47,47,47,47,47,47,47,47,47,47,47,47,]),'declarator':([4,11,14,16,25,31,],[13,17,22,23,36,39,]),'parameter_list':([18,],[26,]),'statement_list':([33,],[51,]),'expression_statement':([33,51,94,123,131,136,141,142,],[66,66,123,135,66,66,66,66,]),'type_specifier':([0,1,3,9,18,19,34,37,],[4,4,11,16,25,31,31,25,]),'jump_statement':([33,51,131,136,141,142,],[56,56,56,56,56,56,]),'direct_declarator':([4,11,14,16,25,31,],[12,12,12,12,12,12,]),'selection_statement':([33,51,131,136,141,142,],[53,53,53,53,53,53,]),'mult_expression':([33,45,51,72,77,78,79,80,82,83,85,88,89,94,97,101,102,103,104,105,123,131,133,135,136,141,142,],[55,55,55,55,55,55,55,55,112,113,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,]),'iteration_statement':([33,51,131,136,141,142,],[69,69,69,69,69,69,]),'expression':([33,45,51,72,85,88,89,94,97,102,103,105,123,131,133,135,136,141,142,],[70,84,70,107,115,116,118,70,124,126,127,129,70,70,138,139,70,70,70,]),'declaration_list':([19,],[34,]),'external_declaration':([0,1,],[7,10,]),'equality_expression':([33,45,51,72,85,88,89,94,97,102,103,105,123,131,133,135,136,141,142,],[71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,]),}
_lr_goto = {}
for _k, _v in _lr_goto_items.items():
......