📄 calc_yacc.c
字号:
/* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */# define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (YYID (0))#endif/* YYFINAL -- State number of the termination state. */#define YYFINAL 3/* YYLAST -- Last index in YYTABLE. */#define YYLAST 638/* YYNTOKENS -- Number of terminals. */#define YYNTOKENS 65/* YYNNTS -- Number of nonterminals. */#define YYNNTS 10/* YYNRULES -- Number of rules. */#define YYNRULES 63/* YYNRULES -- Number of states. */#define YYNSTATES 140/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */#define YYUNDEFTOK 2#define YYMAXUTOK 300#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */static const yytype_uint8 yytranslate[] ={ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 53, 2, 2, 2, 52, 39, 2, 61, 62, 50, 48, 64, 49, 2, 51, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 63, 58, 43, 2, 42, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 38, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 59, 37, 60, 54, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 40, 41, 44, 45, 46, 47, 55, 56, 57};#if YYDEBUG/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */static const yytype_uint16 yyprhs[] ={ 0, 0, 3, 5, 6, 9, 11, 14, 16, 18, 20, 22, 26, 32, 40, 48, 54, 64, 73, 82, 90, 99, 107, 115, 122, 125, 128, 132, 136, 138, 140, 142, 144, 146, 150, 154, 158, 162, 166, 170, 174, 178, 182, 186, 190, 194, 198, 202, 206, 210, 214, 218, 222, 225, 228, 231, 234, 237, 240, 243, 247, 252, 256, 258};/* YYRHS -- A `-1'-separated list of the rules' RHS. */static const yytype_int8 yyrhs[] ={ 66, 0, -1, 67, -1, -1, 67, 68, -1, 58, -1, 73, 58, -1, 69, -1, 70, -1, 71, -1, 72, -1, 59, 67, 60, -1, 9, 61, 73, 62, 68, -1, 9, 61, 73, 62, 68, 11, 68, -1, 12, 68, 14, 61, 73, 62, 58, -1, 14, 61, 73, 62, 68, -1, 13, 61, 74, 58, 73, 58, 74, 62, 68, -1, 13, 61, 74, 58, 73, 58, 62, 68, -1, 13, 61, 74, 58, 58, 74, 62, 68, -1, 13, 61, 74, 58, 58, 62, 68, -1, 13, 61, 58, 73, 58, 74, 62, 68, -1, 13, 61, 58, 73, 58, 62, 68, -1, 13, 61, 58, 58, 74, 62, 68, -1, 13, 61, 58, 58, 62, 68, -1, 15, 58, -1, 16, 58, -1, 17, 3, 58, -1, 3, 63, 68, -1, 7, -1, 6, -1, 5, -1, 4, -1, 3, -1, 3, 8, 73, -1, 73, 35, 73, -1, 73, 36, 73, -1, 73, 37, 73, -1, 73, 38, 73, -1, 73, 39, 73, -1, 73, 41, 73, -1, 73, 40, 73, -1, 73, 44, 73, -1, 73, 45, 73, -1, 73, 43, 73, -1, 73, 42, 73, -1, 73, 47, 73, -1, 73, 46, 73, -1, 73, 48, 73, -1, 73, 49, 73, -1, 73, 50, 73, -1, 73, 51, 73, -1, 73, 52, 73, -1, 53, 73, -1, 54, 73, -1, 49, 73, -1, 57, 3, -1, 56, 3, -1, 3, 57, -1, 3, 56, -1, 3, 61, 62, -1, 3, 61, 74, 62, -1, 61, 73, 62, -1, 73, -1, 74, 64, 73, -1};/* YYRLINE[YYN] -- source line where rule number YYN was defined. */static const yytype_uint8 yyrline[] ={ 0, 89, 89, 93, 94, 98, 99, 100, 101, 102, 103, 104, 108, 109, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 126, 127, 131, 132, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 173, 174};#endif#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */static const char *const yytname[] ={ "$end", "error", "$undefined", "IDENTIFIER", "CONSTANT_S", "CONSTANT_C", "CONSTANT_I", "CONSTANT_R", "ASS", "IF", "IFX", "ELSE", "DO", "FOR", "WHILE", "BREAK", "CONTI", "GOTO", "LABEL", "CALL", "INCB", "INCA", "DECB", "DECA", "ASSSHR", "ASSSHL", "ASSOOR", "ASSXOR", "ASSAND", "ASSBAL", "ASSDIV", "ASSMUL", "ASSSUB", "ASSADD", "ASSIGN", "OOR", "AND", "'|'", "'^'", "'&'", "CNE", "CEQ", "'>'", "'<'", "CLE", "CGE", "SHR", "SHL", "'+'", "'-'", "'*'", "'/'", "'%'", "'!'", "'~'", "UMI", "DEC", "INC", "';'", "'{'", "'}'", "'('", "')'", "':'", "','", "$accept", "procedure", "stmt_list", "stmt_item", "ifxx_stmt", "loop_stmt", "ctrl_stmt", "goxx_stmt", "expr_item", "expr_list", 0};#endif# ifdef YYPRINT/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */static const yytype_uint16 yytoknum[] ={ 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 124, 94, 38, 292, 293, 62, 60, 294, 295, 296, 297, 43, 45, 42, 47, 37, 33, 126, 298, 299, 300, 59, 123, 125, 40, 41, 58, 44};# endif/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */static const yytype_uint8 yyr1[] ={ 0, 65, 66, 67, 67, 68, 68, 68, 68, 68, 68, 68, 69, 69, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 71, 71, 72, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 74, 74};/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */static const yytype_uint8 yyr2[] ={ 0, 2, 1, 0, 2, 1, 2, 1, 1, 1, 1, 3, 5, 7, 7, 5, 9, 8, 8, 7, 8, 7, 7, 6, 2, 2, 3, 3, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 3, 4, 3, 1, 3};/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */static const yytype_uint8 yydefact[] ={ 3, 0, 2, 1, 32, 31, 30, 29, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 3, 0, 4, 7, 8, 9, 10, 0, 0, 58, 57, 0, 0, 0, 0, 0, 0, 24, 25, 0, 32, 54, 52, 53, 56, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 33, 59, 62, 0, 27, 0, 0, 0, 0, 0, 26, 11, 61, 34, 35, 36, 37, 38, 40, 39, 44, 43, 41, 42, 46, 45, 47, 48, 49, 50, 51, 60, 0, 0, 0, 0, 0, 0, 0, 63, 12, 0, 0, 0, 0, 0, 0, 15, 0, 0, 23, 0, 0, 0, 0, 0, 0, 13, 14, 22, 21, 0, 19, 0, 0, 0, 20, 18, 17, 0, 16};/* YYDEFGOTO[NTERM-NUM]. */static const yytype_int8 yydefgoto[] ={ -1, 1, 2, 24, 25, 26, 27, 28, 29, 72};/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */#define YYPACT_NINF -58static const yytype_int16 yypact[] ={ -58, 6, 242, -58, 4, -58, -58, -58, -58, -40, 242, 2, 5, -44, 12, 71, 328, 328, 328, 74, 83, -58, -58, 328, -58, -58, -58, -58, -58, 439, 328, -58, -58, 77, 242, 328, 75, 257, 328, -58, -58, 30, 15, -58, -58, -58, -58, -58, 227, 301, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, -58, 511, -58, 511, -51, -58, 355, 33, 263, -57, 383, -58, -58, -58, 528, 544, 559, 573, 586, -11, -11, 129, 129, 129, 129, -32, -32, -47, -47, -58, -58, -58, -58, 328, 242, 328, 137, 463, 322, 242, 511, 80, 411, 242, -36, 147, 157, 487, -58, 242, 41, -58, 242, 242, 0, 242, 11, 167, -58, -58, -58, -58, 242, -58, 242, 242, 23, -58, -58, -58, 242, -58};/* YYPGOTO[NTERM-NUM]. */static const yytype_int8 yypgoto[] ={ -58, -58, 78, -10, -58, -58, -58, -58, -8, -35};/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */#define YYTABLE_NINF -1static const yytype_uint8 yytable[] ={ 36, 106, 77, 65, 66, 67, 3, 101, 43, 44, 45, 100, 30, 101, 39, 49, 63, 64, 65, 66, 67, 35, 69, 30, 73, 71, 120, 74, 101, 71, 78, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 31, 32, 130, 37, 101, 33, 38, 34, 105, 112, 40, 31, 32, 132, 41, 101, 33, 46, 122, 124, 42, 5, 6, 7, 8, 138, 47, 101, 79, 75, 134, 117, 109, 108, 103, 110, 71, 116, 115, 127, 48, 119, 0, 0, 0, 71, 71, 126, 0, 0, 128, 129, 0, 131, 0, 0, 0, 71, 0, 0, 135, 0, 136, 137, 0, 0, 16, 0, 139, 0, 17, 18, 0, 19, 20, 0, 0, 0, 23, 70, 42, 5, 6, 7, 8, 0, 0, 0, 0, 0, 42, 5, 6, 7, 8, 0, 0, 0, 0, 0, 42, 5, 6, 7, 8, 0, 0, 0, 0, 0, 42, 5, 6, 7, 8, 61, 62, 63, 64, 65, 66, 67, 0, 0, 0, 0, 16, 0, 0, 0, 17, 18, 0, 19, 20, 0, 16, 0, 23, 111, 17, 18, 0, 19, 20, 0, 16, 0, 23, 121, 17, 18, 0, 19, 20, 0, 16, 0, 23, 123, 17, 18, 0, 19, 20, 0, 0, 0, 23, 133, 4, 5, 6, 7, 8, 0, 9, 0, 0, 10, 11, 12, 13, 14, 15, 4, 5, 6, 7, 8, 0, 9, 0, 0, 10, 11, 12, 13, 14, 15, 42, 5, 6, 7, 8, 0, 42, 5, 6, 7, 8, 0, 0, 0, 0, 0, 16, 0, 0, 0, 17, 18, 0, 19, 20, 21, 22, 80, 23, 0, 0, 16, 0, 0, 0, 17, 18, 0, 19, 20, 21, 22, 0, 23, 0, 0, 16, 0, 0, 0, 17, 18, 16, 19, 20, 76, 17, 18, 23, 19, 20, 104, 0, 0, 23, 42, 5, 6, 7, 8, 0, 42, 5, 6, 7, 8, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 17, 18, 16, 19, 20, 114, 17, 18, 23, 19, 20, 0, 0, 0, 23, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 102, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 118, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 0, 0, 0, 0, 0, 68, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 0, 0, 0, 0, 0, 113, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 0, 0, 0, 0, 0, 125, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67};static const yytype_int16 yycheck[] ={ 10, 58, 37, 50, 51, 52, 0, 64, 16, 17, 18, 62, 8, 64, 58, 23, 48, 49, 50, 51, 52, 61, 30, 8, 34, 33, 62, 35, 64, 37, 38, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 56, 57, 62, 61, 64, 61, 61, 63, 76, 104, 58, 56, 57, 62, 3, 64, 61, 3, 113, 114, 3, 4, 5, 6, 7, 62, 3, 64, 58, 14, 125, 11, 102, 101, 61, 103, 104, 107, 106, 58, 22, 111, -1, -1, -1, 113, 114, 117, -1, -1, 120, 121, -1, 123, -1, -1, -1, 125, -1, -1, 130, -1, 132, 133, -1, -1, 49, -1, 138, -1, 53, 54, -1, 56, 57, -1, -1, -1, 61, 62, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 3, 4, 5, 6, 7, 46, 47, 48, 49, 50, 51, 52, -1, -1, -1, -1, 49, -1, -1, -1, 53, 54, -1, 56, 57, -1, 49, -1, 61, 62, 53, 54, -1, 56, 57, -1, 49, -1, 61, 62, 53, 54, -1, 56, 57, -1, 49, -1, 61, 62, 53, 54, -1, 56, 57, -1, -1, -1, 61, 62, 3, 4, 5, 6, 7, -1, 9, -1, -1, 12, 13, 14, 15, 16, 17, 3, 4, 5, 6, 7, -1, 9, -1, -1, 12, 13, 14, 15, 16, 17, 3, 4, 5, 6, 7, -1, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 49, -1, -1, -1, 53, 54, -1, 56, 57, 58, 59, 60, 61, -1, -1, 49, -1, -1, -1, 53, 54, -1, 56, 57, 58, 59, -1, 61, -1, -1, 49, -1, -1, -1, 53, 54, 49, 56, 57, 58, 53, 54, 61, 56, 57, 58, -1, -1, 61, 3, 4, 5, 6, 7, -1, 3, 4, 5, 6, 7, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, -1, -1, -1, -1, 49, -1, -1, -1, 53, 54, 49, 56, 57, 58, 53, 54, 61, 56, 57, -1, -1, -1, 61, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, -1, -1, -1, -1, -1, 58, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, -1, -1, -1, -1, -1, 58, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, -1, -1, -1, -1, -1, 58, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52};/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */static const yytype_uint8 yystos[] ={ 0, 66, 67, 0, 3, 4, 5, 6, 7, 9, 12, 13, 14, 15, 16, 17, 49, 53, 54, 56, 57, 58, 59, 61, 68, 69, 70, 71, 72, 73, 8, 56, 57, 61, 63, 61, 68, 61, 61, 58, 58, 3, 3, 73, 73, 73, 3, 3, 67, 73, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 58, 73, 62, 73, 74, 68, 73, 14, 58, 74, 73, 58, 60, 62, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 62, 64, 62, 61, 58, 73, 58, 62, 73, 68, 73, 62, 74, 58, 58, 73, 68, 11, 62, 68, 62, 62, 74, 62, 74, 58, 68, 58, 68, 68, 62, 68, 62, 62, 74, 68, 68, 68, 62, 68};#define yyerrok (yyerrstatus = 0)#define yyclearin (yychar = YYEMPTY)#define YYEMPTY (-2)#define YYEOF 0#define YYACCEPT goto yyacceptlab#define YYABORT goto yyabortlab#define YYERROR goto yyerrorlab/* Like YYERROR except do call yyerror. This remains here temporarily
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -