📄 rule.c
字号:
559, 581, 609, 639, 677, 678, 682, 683, 687, 711, 712, 713, 714, 715, 719, 746, 745, 789, 813, 812, 846, 851, 855, 856, 860, 885, 910, 914, 921, 925, 926, 927, 931, 932, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 949, 1022, 1037, 1021, 1065, 1064, 1105, 1121, 1120, 1139, 1149, 1148, 1172, 1194, 1193, 1214, 1220, 1233, 1213, 1274, 1278, 1273, 1285, 1286, 1291, 1290, 1320, 1333, 1319, 1374, 1409, 1373, 1473, 1477, 1485, 1503, 1510, 1484, 1550, 1551, 1556, 1579, 1555, 1593, 1627, 1592, 1642, 1646, 1664, 1691, 1690, 1707, 1706, 1723, 1722, 1740, 1739, 1756, 1755, 1772, 1771, 1787, 1798, 1797, 1813, 1812, 1828, 1827, 1842, 1851, 1850, 1866, 1865, 1881, 1880, 1897, 1896, 1913, 1912, 1927, 1933, 1976, 1975, 1994, 2005, 2004, 2021, 2049, 2058, 2067, 2077, 2076, 2107, 2134, 2152};#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", "kAND", "kARRAY", "kBEGIN", "kCASE", "kCONST", "kDIV", "kDO", "kDOWNTO", "kELSE", "kEND", "kFILE", "kFOR", "kFUNCTION", "kGOTO", "kIF", "kIN", "kLABEL", "kMOD", "kNIL", "kNOT", "kOF", "kOR", "kPACKED", "kPROCEDURE", "kPROGRAM", "kRECORD", "kREPEAT", "kSET", "kTHEN", "kTO", "kTYPE", "kUNTIL", "kVAR", "kWHILE", "kWITH", "SYS_CON", "cFALSE", "cTRUE", "cMAXINT", "cSTRING", "cINTEGER", "cREAL", "cCHAR", "cBOOLEAN", "SYS_TYPE", "tINTEGER", "tCHAR", "tREAL", "tBOOLEAN", "tTEXT", "SYS_FUNCT", "fABS", "fCHR", "fODD", "fORD", "fPRED", "fSQR", "fSQRT", "fSUCC", "SYS_PROC", "pREAD", "pREADLN", "pWRITE", "pWRITELN", "oPLUS", "oMINUS", "oMUL", "oDIV", "oEQUAL", "oASSIGN", "oUNEQU", "oLT", "oLE", "oGT", "oGE", "oCOMMA", "oSEMI", "oCOLON", "oQUOTE", "oDOT", "oDOTDOT", "oARROW", "oLP", "oRP", "oLB", "oRB", "oLC", "oRC", "yNAME", "$accept", "program", "first_act_at_prog", "program_head", "sub_program", "@1", "name_list", "sub_routine", "routine_head", "label_part", "const_part", "const_expr_list", "const_value", "type_part", "type_decl_list", "type_definition", "type_decl", "array_type_decl", "record_type_decl", "field_decl_list", "field_decl", "simple_type_decl", "var_part", "var_decl_list", "var_decl", "routine_part", "function_decl", "function_head", "@2", "procedure_decl", "procedure_head", "@3", "parameters", "para_decl_list", "para_type_list", "val_para_list", "var_para_list", "routine_body", "stmt_list", "stmt", "non_label_stmt", "assign_stmt", "@4", "@5", "@6", "proc_stmt", "@7", "@8", "compound_stmt", "@9", "if_stmt", "@10", "@11", "@12", "@13", "@14", "else_clause", "repeat_stmt", "@15", "while_stmt", "@16", "@17", "for_stmt", "@18", "@19", "direction", "case_stmt", "@20", "@21", "@22", "case_expr_list", "case_expr", "@23", "@24", "@25", "@26", "goto_stmt", "expression_list", "expression", "@27", "@28", "@29", "@30", "@31", "@32", "expr", "@33", "@34", "@35", "term", "@36", "@37", "@38", "@39", "@40", "factor", "@41", "@42", "@43", "args_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, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346};# endif/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */static const yytype_uint8 yyr1[] ={ 0, 92, 93, 94, 95, 95, 97, 96, 98, 98, 98, 98, 99, 100, 101, 102, 102, 103, 103, 104, 104, 104, 104, 104, 105, 105, 106, 106, 107, 108, 108, 108, 109, 110, 111, 111, 112, 113, 113, 113, 113, 113, 113, 113, 114, 114, 115, 115, 116, 117, 117, 117, 117, 117, 118, 120, 119, 121, 123, 122, 124, 124, 125, 125, 126, 126, 127, 128, 129, 130, 130, 130, 131, 131, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 133, 134, 135, 133, 136, 133, 137, 138, 137, 137, 139, 137, 137, 141, 140, 143, 144, 145, 142, 146, 147, 142, 148, 148, 150, 149, 152, 153, 151, 155, 156, 154, 157, 157, 159, 160, 161, 158, 162, 162, 164, 165, 163, 166, 167, 163, 168, 169, 169, 171, 170, 172, 170, 173, 170, 174, 170, 175, 170, 176, 170, 170, 178, 177, 179, 177, 180, 177, 177, 182, 181, 183, 181, 184, 181, 185, 181, 186, 181, 181, 187, 188, 187, 187, 189, 187, 187, 187, 187, 187, 190, 187, 187, 191, 191};/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */static const yytype_uint8 yyr2[] ={ 0, 2, 4, 0, 3, 2, 0, 3, 3, 1, 3, 3, 2, 5, 0, 2, 0, 5, 4, 1, 1, 1, 1, 1, 2, 0, 2, 1, 4, 1, 1, 1, 6, 3, 2, 1, 4, 1, 1, 3, 3, 4, 5, 3, 2, 0, 2, 1, 4, 2, 2, 1, 1, 0, 4, 0, 6, 4, 0, 4, 3, 0, 3, 1, 3, 3, 1, 2, 1, 3, 3, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 3, 0, 0, 8, 0, 6, 1, 0, 5, 1, 0, 5, 4, 0, 4, 0, 0, 0, 8, 0, 0, 7, 2, 0, 0, 5, 0, 0, 6, 0, 0, 10, 1, 1, 0, 0, 0, 8, 2, 1, 0, 0, 6, 0, 0, 6, 2, 3, 1, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 1, 0, 4, 0, 4, 0, 4, 1, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 1, 1, 0, 5, 1, 0, 5, 1, 3, 2, 2, 0, 5, 3, 3, 1};/* 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, 0, 1, 0, 0, 14, 5, 0, 0, 6, 16, 4, 2, 0, 0, 25, 97, 7, 68, 0, 15, 0, 45, 71, 0, 0, 0, 24, 27, 0, 53, 0, 23, 22, 19, 20, 21, 0, 0, 0, 26, 0, 0, 44, 47, 55, 58, 13, 51, 0, 52, 0, 0, 118, 98, 0, 0, 0, 108, 110, 0, 93, 0, 90, 0, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 18, 0, 0, 0, 37, 0, 0, 38, 0, 0, 30, 31, 29, 0, 0, 0, 46, 0, 0, 49, 50, 14, 14, 70, 0, 0, 130, 103, 0, 71, 0, 83, 0, 0, 0, 0, 85, 0, 69, 17, 0, 0, 0, 35, 0, 0, 0, 0, 28, 11, 10, 8, 0, 61, 61, 0, 0, 0, 0, 167, 0, 0, 164, 170, 133, 145, 152, 163, 0, 0, 133, 0, 133, 72, 0, 0, 84, 88, 0, 0, 0, 0, 33, 34, 0, 39, 43, 40, 48, 0, 0, 59, 54, 12, 57, 172, 0, 173, 133, 0, 174, 0, 119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 113, 104, 100, 0, 111, 0, 132, 96, 0, 133, 178, 0, 0, 0, 0, 41, 0, 66, 0, 63, 0, 0, 0, 0, 171, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 83, 109, 83, 0, 95, 0, 86, 0, 92, 0, 36, 42, 67, 0, 60, 0, 0, 56, 0, 133, 0, 127, 124, 120, 123, 134, 136, 138, 140, 142, 144, 147, 149, 151, 154, 156, 158, 160, 162, 117, 116, 0, 107, 101, 112, 131, 89, 0, 177, 32, 62, 64, 65, 169, 175, 166, 0, 0, 0, 122, 133, 83, 105, 107, 0, 83, 83, 121, 114, 106, 102, 87, 128, 125, 83, 0, 0, 115, 129, 126};/* YYDEFGOTO[NTERM-NUM]. */static const yytype_int16 yydefgoto[] ={ -1, 1, 2, 6, 9, 14, 43, 131, 132, 11, 16, 21, 139, 23, 28, 29, 85, 86, 87, 118, 119, 88, 31, 44, 45, 48, 49, 50, 93, 51, 52, 94, 166, 211, 212, 213, 214, 18, 32, 65, 66, 67, 154, 285, 201, 68, 113, 108, 69, 24, 70, 104, 238, 301, 145, 237, 300, 71, 105, 72, 106, 240, 73, 236, 312, 279, 74, 100, 221, 296, 261, 262, 295, 314, 294, 313, 75, 198, 203, 179, 180, 181, 182, 183, 184, 141, 185, 186, 187, 142, 188, 189, 190, 191, 192, 143, 177, 172, 219, 204};/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */#define YYPACT_NINF -178static const yytype_int16 yypact[] ={ -178, 65, 19, -178, -9, -13, -178, -178, 15, 29, -178, 93, -178, -178, 111, 26, 86, -178, -178, -178, 50, 33, 45, 102, -178, 284, 68, 69, 45, -178, 52, 6, 11, -178, -178, -178, -178, -178, 62, 284, 121, -178, 7, -56, 52, -178, -178, -178, 6, -178, 66, -178, 71, 72, -178, -178, 61, 110, 70, -178, -178, 76, 75, 77, 126, 78, -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, 88, 83, 52, -178, 284, 52, 100, 101, 107, -178, -178, -178, -26, 104, 121, -178, 108, 119, -178, -178, -178, -178, -178, 204, 129, -178, -178, 204, -178, 204, 188, 106, 204, 204, 124, -178, 140, -178, -178, 222, 21, -3, -178, 144, -28, 139, 284, -178, -178, -178, -178, 152, 147, 147, 156, 111, 158, 204, 154, 204, 204, -18, -178, 200, -6, 189, -178, 204, 210, 207, 43, 98, -178, 204, 157, 259, -178, 204, 204, 164, 121, -178, -178, 249, -178, -178, -178, -178, -16, 174, -178, -178, -178, -178, -178, 170, -178, 245, 165, -178, 176, -178, 186, 192, 195, 203, 213, 212, 219, 220, 272, 229, 233, 296, 285, 309, 259, -178, -178, 204, -178, -2, 259, -178, 243, 226, 259, 17, 301, 246, 284, -178, 52, 265, -53, -178, 264, 266, 222, 204, -178, -178, 204, 204, -8, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 31, 171, 171, 259, 171, 204, -178, 204, -178, 204, -178, 121, -178, -178, 265, -16, -178, 222, 222, -178, 18, 235, 32, -178, -178, -8, -178, -6, -6, -6, -6, -6, -6, 189, 189, 189, -178, -178, -178, -178, -178, -178, -178, 204, 334, -178, -178, 259, 259, 275, 259, -178, -178, -178, -178, -178, -178, -178, 268, 269, 338, -178, 145, 171, -178, 334, 204, 171, 171, -178, -178, -178, -178, 259, -178, -178, 171, 273, 274, -178, -178, -178};/* YYPGOTO[NTERM-NUM]. */static const yytype_int16 yypgoto[] ={ -178, -178, -178, -178, -178, -178, -76, 253, 348, -178, -178, -178, -25, -178, -178, 327, -89, -178, -178, -178, 238, -106, -178, -178, 313, -178, 310, -178, -178, 311, -178, -178, 230, -178, 112, -178, -178, 232, 256, -59, 255, -178, -178, -178, -178, -178, -178, -178, -1, -178, -178, -178, -178, -178, -178, -178, 64, -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, 105, -178, -178, -178, -178, -178, -178, -99, -178, -178, -178, -178, -178, -178, 115, -178, -178, -178, -148, -178, -178, -178, -178, -178, -105, -178, -178, -178, -177};/* 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 -169static const yytype_int16 yytable[] ={ 38, 140, 128, 117, 151, 146, 121, 148, 89, 158, 156, 152, 53, 19, 77, 84, 17, 54, -150, 209, 4, 46, 90, 55, 91, 56, 251, 57, 58, 171, 33, 173, 47, 252, 34, 35, 36, 37, 174, 256, 59, 277, 117, 258, 53, 193, 5, 60, 17, 54, 90, 199, 125, 126, 61, 202, 120, 56, 161, 57, 58, -146, -148, 278, 175, 3, 84, -165, 206, 176, 7, 103, 59, 62, 63, 42, 241, 196, 8, 60, 269, 270, 271, 259, 242, -9, 61, -9, 42, 210, -83, 84, -99, -9, 12, 245, 245, 239, 163, 90, 15, 157, 64, 246, 291, 62, 63, 197, -99, 255, 245, 13, -99, -99, -99, -99, 17, 20, 293, 22, 257, 25, -83, -99, 26, 78, 272, 273, 274, 275, 276, 19, 84, 250, 64, 208, 27, 30, -99, 39, 40, 76, 283, 42, 284, 97, 286, 289, 290, 79, 98, 99, 101, 102, 306, -99, 107, 114, 287, 33, -94, -99, 109, 34, 35, 36, 37, 115, 80, -141, 116, -143, -139, -137, -135, 210, 17, 54, 280, 281, 298, 282, 249, 122, 123, 56, 124, 57, 58, 81, 84, 150, -161, 17, 54, 127, 260, -157, 110, 129, 59, 144, 56, 309, 57, 58, 82, 60, 111, -159, 130, -91, 83, 112, 61, 153, -141, 59, -143, -139, -137, -135, 84, 178, 60, 155, 134, 160, 84, 84, 162, 164, 165, 62, 63, 168, 260, 170, 195, -168, 307, 194, 33, 200, 310, 311, 34, 35, 36, 37, 62, 63, 205, 315, 215, 216, 218, 135, -153, -155, 33, 220, 64, 222, 34, 35, 36, 37, 223, 80, 224, -141, 136, -143, -139, -137, -135, 225, -141, 64, -143, -139, -137, -135, 226, 227, 228, 33, 229, 137, 81, 34, 35, 36, 37, 138, 230, -141, 231, -143, -139, -137, -135, 232, 233, 234, -141, 82, -143, -139, -137, -135, 235, 83, 244, 243, -141, 207, -143, -139, -137, -135, 33, 292, 247, 248, 34, 35, 36, 37, -141, 217, -143, -139, -137, -135, -133, 263, 264, 265, 266, 267, 268, 90, 253, 299, 254, 302, 303, 304, 305, 133, 316, 317, 10, 41, 159, 92, 95, 96, 167, 147, 149, 288, 169, 308, 297};static const yytype_uint16 yycheck[] ={ 25, 100, 91, 79, 109, 104, 82, 106, 1, 12, 116, 110, 1, 14, 39, 40, 5, 6, 24, 35, 1, 15, 78, 12, 80, 14, 79, 16, 17, 134, 38, 136, 26, 86, 42, 43, 44, 45, 137, 216, 29, 10, 118, 220, 1, 144, 27, 36, 5, 6, 78, 150, 78, 79, 43, 154, 81, 14, 86, 16, 17, 67, 68, 32, 82, 0, 91, 85, 157, 87, 79, 1, 29, 62, 63, 91, 78, 34, 91, 36, 228, 229, 230, 91, 86, 78, 43, 80, 91, 165, 79, 116, 22, 86, 79, 78, 78, 196, 123, 78, 7, 80, 91, 86, 86, 62, 63, 9, 38, 215, 78, 82, 42, 43, 44, 45, 5, 91, 86, 33, 219, 71, 79, 53, 91, 4, 231, 232, 233, 234, 235, 132, 157, 209, 91, 160, 91, 35, 68, 71, 71, 79, 241, 91, 243, 79, 245, 253, 254, 28, 79, 79, 91, 43, 9, 85, 80, 79, 247, 38, 85, 91, 85, 42, 43, 44, 45, 79, 47, 71, 87, 73, 74, 75, 76, 251, 5, 6, 237, 238, 279, 240, 207, 83, 83, 14, 79, 16, 17, 68, 215, 85, 3, 5, 6, 91, 221, 8, 72, 91, 29, 72, 14, 302, 16, 17, 85, 36, 82, 20, 91, 85, 91, 87, 43, 91, 71, 29, 73, 74, 75, 76, 247, 23, 36, 85, 22, 83, 253, 254, 91, 79, 85, 62, 63, 79, 261, 79, 31, 85, 299, 31, 38, 86, 303, 304, 42, 43, 44, 45, 62, 63, 88, 312, 80, 85, 91, 53, 69, 70, 38, 85, 91, 77, 42, 43, 44, 45, 76, 47, 75, 71, 68, 73, 74, 75, 76, 74, 71, 91, 73, 74, 75, 76, 71, 73, 67, 38, 68, 85, 68, 42, 43, 44, 45, 91, 24, 71, 69, 73, 74, 75, 76, 70, 8, 20, 71, 85, 73, 74, 75, 76, 3, 91, 88, 72, 71, 68, 73, 74, 75, 76, 38, 88, 23, 79, 42, 43, 44, 45, 71, 86, 73, 74, 75, 76, 77, 222, 223, 224, 225, 226, 227, 78, 80, 11, 80, 72, 80, 80, 12, 98, 79, 79, 6, 28, 118, 44, 48, 48, 130, 105, 107, 251, 132, 301, 261};/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */static const yytype_uint8 yystos[] ={ 0, 93, 94, 0, 1, 27, 95, 79, 91, 96, 100, 101, 79, 82, 97, 7, 102, 5, 129, 140, 91, 103, 33, 105, 141, 71, 91, 91, 106, 107, 35, 114, 130, 38, 42, 43, 44, 45, 104, 71, 71, 107, 91, 98, 115, 116, 15, 26, 117, 118, 119, 121, 122, 1, 6, 12, 14, 16, 17, 29, 36, 43, 62, 63, 91, 131, 132, 133, 137, 140, 142, 149, 151, 154, 158, 168, 79, 104, 4, 28, 47, 68, 85, 91, 104, 108, 109, 110, 113, 1, 78, 80, 116, 120, 123, 118, 121, 79, 79, 79, 159, 91, 43, 1, 143, 150, 152, 80, 139, 85, 72, 82, 87, 138, 79, 79, 87, 98, 111, 112, 104, 98, 83, 83, 79, 78, 79, 91, 108, 91, 91, 99, 100, 99, 22, 53, 68, 85, 91, 104, 170, 177, 181, 187, 72, 146, 170, 130, 170, 132, 85, 187, 170, 91, 134, 85, 113, 80, 12, 112, 83, 86, 91, 104, 79, 85, 124, 124, 79, 129, 79, 187, 189, 187, 170, 82, 87, 188, 23, 171, 172, 173, 174, 175, 176, 178, 179, 180, 182, 183, 184, 185, 186, 170, 31, 31, 34, 9, 169, 170, 86, 136, 170, 170, 191, 88, 108, 68, 104, 35, 98, 125, 126, 127, 128, 80, 85, 86, 91, 190, 85, 160, 77, 76, 75, 74, 71, 73, 67, 68, 24, 69, 70, 8, 20, 3, 155, 147, 144, 170, 153, 78, 86, 72, 88, 78, 86, 23, 79, 104, 98, 79, 86, 80, 80, 113, 191, 170, 191, 91, 104, 162, 163, 177, 177, 177, 177, 177, 177, 181, 181, 181, 187, 187, 187, 187, 187, 10, 32, 157, 131, 131, 131, 170, 170, 135, 170, 108, 126, 113, 113, 86, 88, 86, 166, 164, 161, 163, 170, 11, 148, 145, 72, 80, 80, 12, 9, 131, 148, 170, 131, 131, 156, 167, 165, 131, 79, 79};#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 to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */#define YYFAIL goto yyerrlab#define YYRECOVERING() (!!yyerrstatus)#define YYBACKUP(Token, Value) \do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -