diff options
Diffstat (limited to 'src/map/magic-interpreter-parser.c')
-rw-r--r-- | src/map/magic-interpreter-parser.c | 1143 |
1 files changed, 592 insertions, 551 deletions
diff --git a/src/map/magic-interpreter-parser.c b/src/map/magic-interpreter-parser.c index 3472da0..66fb120 100644 --- a/src/map/magic-interpreter-parser.c +++ b/src/map/magic-interpreter-parser.c @@ -199,6 +199,9 @@ intern_id(char *id_name); static expr_t * fun_expr(char *name, int args_nr, expr_t **args, int line, int column); +static expr_t * +dot_expr(expr_t *lhs, int id); + #define BIN_EXPR(x, name, arg1, arg2, line, column) { expr_t *e[2]; e[0] = arg1; e[1] = arg2; x = fun_expr(name, 2, e, line, column); } static int failed_flag = 0; @@ -271,7 +274,7 @@ find_constant(char *name); #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 71 "magic-interpreter-parser.y" +#line 74 "magic-interpreter-parser.y" { int i; char *s; @@ -293,7 +296,7 @@ typedef union YYSTYPE proc_t *proc; } /* Line 187 of yacc.c. */ -#line 297 "magic-interpreter-parser.c" +#line 300 "magic-interpreter-parser.c" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -318,7 +321,7 @@ typedef struct YYLTYPE /* Line 216 of yacc.c. */ -#line 322 "magic-interpreter-parser.c" +#line 325 "magic-interpreter-parser.c" #ifdef short # undef short @@ -535,16 +538,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 18 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 968 +#define YYLAST 1029 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 73 +#define YYNTOKENS 74 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 32 /* YYNRULES -- Number of rules. */ -#define YYNRULES 109 +#define YYNRULES 110 /* YYNRULES -- Number of states. */ -#define YYNSTATES 249 +#define YYNSTATES 251 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -559,16 +562,16 @@ 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, 2, 2, 2, 2, 14, 22, 2, - 71, 72, 12, 10, 16, 11, 2, 13, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 17, 18, + 2, 2, 2, 2, 2, 2, 2, 14, 23, 2, + 72, 73, 12, 10, 16, 11, 17, 13, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 18, 19, 8, 7, 9, 2, 15, 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, 20, 2, 21, 23, 2, 2, 2, 2, 2, + 2, 21, 2, 22, 24, 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, 19, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 20, 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, @@ -582,11 +585,11 @@ static const yytype_uint8 yytranslate[] = 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, 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 + 5, 6, 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 }; #if YYDEBUG @@ -599,72 +602,75 @@ static const yytype_uint16 yyprhs[] = 65, 71, 73, 75, 77, 79, 81, 83, 85, 87, 91, 95, 99, 103, 107, 111, 115, 119, 123, 127, 131, 135, 139, 143, 147, 151, 155, 159, 163, 168, - 172, 173, 175, 177, 181, 190, 192, 201, 211, 213, - 218, 220, 224, 228, 230, 234, 238, 242, 247, 248, - 251, 252, 255, 257, 261, 265, 267, 271, 274, 277, - 280, 283, 286, 290, 292, 296, 300, 302, 304, 306, - 308, 310, 312, 314, 316, 320, 323, 326, 329, 332, - 337, 345, 354, 361, 366, 370, 376, 378, 385, 386 + 172, 176, 177, 179, 181, 185, 194, 196, 205, 215, + 217, 222, 224, 228, 232, 234, 238, 242, 246, 251, + 252, 255, 256, 259, 261, 265, 269, 271, 275, 278, + 281, 284, 287, 290, 294, 296, 300, 304, 306, 308, + 310, 312, 314, 316, 318, 320, 324, 327, 330, 333, + 336, 341, 349, 358, 365, 370, 374, 380, 382, 389, + 390 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { - 74, 0, -1, -1, 78, 75, 74, -1, -1, 75, - 18, -1, -1, 77, -1, 5, -1, 77, 16, 5, - -1, 5, 7, 83, -1, 24, 5, 7, 83, -1, - 41, 5, 17, 83, 7, 83, -1, 25, 5, 71, - 76, 72, 7, 104, -1, 79, 42, 5, 80, 17, - 83, 7, 88, -1, -1, 28, 79, -1, 29, 79, - -1, 27, 79, -1, -1, 71, 5, 17, 81, 72, - -1, 59, -1, 47, -1, 6, -1, 3, -1, 4, - -1, 82, -1, 5, -1, 87, -1, 83, 10, 83, - -1, 83, 11, 83, -1, 83, 12, 83, -1, 83, - 14, 83, -1, 83, 13, 83, -1, 83, 8, 83, - -1, 83, 9, 83, -1, 83, 22, 83, -1, 83, - 23, 83, -1, 83, 19, 83, -1, 83, 30, 83, - -1, 83, 31, 83, -1, 83, 35, 83, -1, 83, - 34, 83, -1, 83, 36, 83, -1, 83, 37, 83, - -1, 83, 32, 83, -1, 83, 7, 83, -1, 83, - 33, 83, -1, 5, 71, 84, 72, -1, 71, 83, - 72, -1, -1, 85, -1, 83, -1, 85, 16, 83, - -1, 15, 71, 83, 16, 83, 16, 83, 72, -1, - 86, -1, 86, 15, 10, 71, 83, 16, 83, 72, - -1, 86, 40, 83, 17, 71, 83, 16, 83, 72, - -1, 91, -1, 43, 89, 44, 91, -1, 75, -1, - 89, 90, 75, -1, 5, 7, 83, -1, 92, -1, - 92, 19, 91, -1, 95, 46, 92, -1, 71, 91, - 72, -1, 56, 104, 93, 94, -1, -1, 58, 104, - -1, -1, 57, 104, -1, 97, -1, 95, 70, 95, - -1, 71, 96, 72, -1, 95, -1, 95, 16, 96, - -1, 48, 83, -1, 49, 98, -1, 50, 98, -1, - 51, 83, -1, 52, 83, -1, 20, 99, 21, -1, - 100, -1, 99, 16, 100, -1, 3, 12, 101, -1, - 101, -1, 4, -1, 3, -1, 59, -1, 60, -1, - 61, -1, 42, -1, 62, -1, 71, 104, 72, -1, - 53, 18, -1, 54, 18, -1, 45, 18, -1, 55, - 18, -1, 5, 7, 83, 18, -1, 66, 102, 5, - 44, 83, 68, 103, -1, 67, 5, 7, 83, 39, - 83, 68, 103, -1, 63, 83, 64, 103, 65, 103, - -1, 63, 83, 64, 103, -1, 69, 83, 18, -1, - 5, 71, 84, 72, 18, -1, 38, -1, 26, 5, - 71, 84, 72, 18, -1, -1, 103, 75, 104, -1 + 75, 0, -1, -1, 79, 76, 75, -1, -1, 76, + 19, -1, -1, 78, -1, 5, -1, 78, 16, 5, + -1, 5, 7, 84, -1, 25, 5, 7, 84, -1, + 42, 5, 18, 84, 7, 84, -1, 26, 5, 72, + 77, 73, 7, 105, -1, 80, 43, 5, 81, 18, + 84, 7, 89, -1, -1, 29, 80, -1, 30, 80, + -1, 28, 80, -1, -1, 72, 5, 18, 82, 73, + -1, 60, -1, 48, -1, 6, -1, 3, -1, 4, + -1, 83, -1, 5, -1, 88, -1, 84, 10, 84, + -1, 84, 11, 84, -1, 84, 12, 84, -1, 84, + 14, 84, -1, 84, 13, 84, -1, 84, 8, 84, + -1, 84, 9, 84, -1, 84, 23, 84, -1, 84, + 24, 84, -1, 84, 20, 84, -1, 84, 31, 84, + -1, 84, 32, 84, -1, 84, 36, 84, -1, 84, + 35, 84, -1, 84, 37, 84, -1, 84, 38, 84, + -1, 84, 33, 84, -1, 84, 7, 84, -1, 84, + 34, 84, -1, 5, 72, 85, 73, -1, 72, 84, + 73, -1, 84, 17, 5, -1, -1, 86, -1, 84, + -1, 86, 16, 84, -1, 15, 72, 84, 16, 84, + 16, 84, 73, -1, 87, -1, 87, 15, 10, 72, + 84, 16, 84, 73, -1, 87, 41, 84, 18, 72, + 84, 16, 84, 73, -1, 92, -1, 44, 90, 45, + 92, -1, 76, -1, 90, 91, 76, -1, 5, 7, + 84, -1, 93, -1, 93, 20, 92, -1, 96, 47, + 93, -1, 72, 92, 73, -1, 57, 105, 94, 95, + -1, -1, 59, 105, -1, -1, 58, 105, -1, 98, + -1, 96, 71, 96, -1, 72, 97, 73, -1, 96, + -1, 96, 16, 97, -1, 49, 84, -1, 50, 99, + -1, 51, 99, -1, 52, 84, -1, 53, 84, -1, + 21, 100, 22, -1, 101, -1, 100, 16, 101, -1, + 3, 12, 102, -1, 102, -1, 4, -1, 3, -1, + 60, -1, 61, -1, 62, -1, 43, -1, 63, -1, + 72, 105, 73, -1, 54, 19, -1, 55, 19, -1, + 46, 19, -1, 56, 19, -1, 5, 7, 84, 19, + -1, 67, 103, 5, 45, 84, 69, 104, -1, 68, + 5, 7, 84, 40, 84, 69, 104, -1, 64, 84, + 65, 104, 66, 104, -1, 64, 84, 65, 104, -1, + 70, 84, 19, -1, 5, 72, 85, 73, 19, -1, + 39, -1, 27, 5, 72, 85, 73, 19, -1, -1, + 104, 76, 105, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 207, 207, 208, 214, 215, 221, 222, 226, 232, - 239, 250, 256, 267, 276, 289, 290, 295, 300, 308, - 309, 315, 317, 322, 325, 328, 334, 337, 348, 351, - 353, 355, 357, 359, 361, 363, 365, 367, 369, 371, - 373, 375, 377, 379, 381, 383, 385, 387, 390, 395, - 400, 401, 406, 411, 418, 422, 426, 432, 442, 444, - 453, 457, 466, 479, 481, 490, 492, 494, 505, 506, - 512, 513, 518, 520, 526, 531, 533, 538, 542, 546, - 550, 554, 561, 566, 570, 577, 579, 584, 593, 598, - 600, 602, 604, 606, 611, 613, 615, 617, 619, 621, - 632, 639, 646, 652, 658, 662, 666, 673, 680, 681 + 0, 212, 212, 213, 219, 220, 226, 227, 231, 237, + 244, 255, 261, 272, 281, 294, 295, 300, 305, 313, + 314, 320, 322, 327, 330, 333, 339, 342, 353, 356, + 358, 360, 362, 364, 366, 368, 370, 372, 374, 376, + 378, 380, 382, 384, 386, 388, 390, 392, 395, 400, + 402, 407, 408, 413, 418, 425, 429, 433, 439, 449, + 451, 460, 464, 473, 486, 488, 497, 499, 501, 512, + 513, 519, 520, 525, 527, 533, 538, 540, 545, 549, + 553, 557, 561, 568, 573, 577, 584, 586, 591, 600, + 605, 607, 609, 611, 613, 618, 620, 622, 624, 626, + 628, 639, 646, 653, 659, 665, 669, 673, 680, 687, + 688 }; #endif @@ -674,21 +680,21 @@ static const yytype_uint16 yyrline[] = static const char *const yytname[] = { "$end", "error", "$undefined", "INT", "STRING", "ID", "DIR", "'='", - "'<'", "'>'", "'+'", "'-'", "'*'", "'/'", "'%'", "'@'", "','", "':'", - "';'", "'|'", "'['", "']'", "'&'", "'^'", "CONST", "PROCEDURE", "CALL", - "SILENT", "LOCAL", "NONMAGIC", "SHL", "SHR", "EQ", "NEQ", "GTE", "LTE", - "ANDAND", "OROR", "SCRIPT_DATA", "TO", "TOWARDS", "TELEPORT_ANCHOR", - "SPELL", "LET", "IN", "END", "DARROW", "STRING_TY", "REQUIRE", - "CATALYSTS", "COMPONENTS", "MANA", "CASTTIME", "SKIP", "ABORT", "BREAK", - "EFFECT", "ATEND", "ATTRIGGER", "PC_F", "MOB_F", "ENTITY_F", "TARGET_F", - "IF", "THEN", "ELSE", "FOREACH", "FOR", "DO", "SLEEP", "OR", "'('", - "')'", "$accept", "spellconf", "semicolons", "proc_formals_list", - "proc_formals_list_ne", "spellconf_option", "spell_flags", "argopt", - "arg_ty", "value", "expr", "arg_list", "arg_list_ne", "location", "area", - "spelldef", "defs", "def", "spellbody_list", "spellbody", - "maybe_trigger", "maybe_end", "spellguard", "spellguard_list", "prereq", - "items", "item_list", "item", "item_name", "selection", "effect", - "effect_list", 0 + "'<'", "'>'", "'+'", "'-'", "'*'", "'/'", "'%'", "'@'", "','", "'.'", + "':'", "';'", "'|'", "'['", "']'", "'&'", "'^'", "CONST", "PROCEDURE", + "CALL", "SILENT", "LOCAL", "NONMAGIC", "SHL", "SHR", "EQ", "NEQ", "GTE", + "LTE", "ANDAND", "OROR", "SCRIPT_DATA", "TO", "TOWARDS", + "TELEPORT_ANCHOR", "SPELL", "LET", "IN", "END", "DARROW", "STRING_TY", + "REQUIRE", "CATALYSTS", "COMPONENTS", "MANA", "CASTTIME", "SKIP", + "ABORT", "BREAK", "EFFECT", "ATEND", "ATTRIGGER", "PC_F", "MOB_F", + "ENTITY_F", "TARGET_F", "IF", "THEN", "ELSE", "FOREACH", "FOR", "DO", + "SLEEP", "OR", "'('", "')'", "$accept", "spellconf", "semicolons", + "proc_formals_list", "proc_formals_list_ne", "spellconf_option", + "spell_flags", "argopt", "arg_ty", "value", "expr", "arg_list", + "arg_list_ne", "location", "area", "spelldef", "defs", "def", + "spellbody_list", "spellbody", "maybe_trigger", "maybe_end", + "spellguard", "spellguard_list", "prereq", "items", "item_list", "item", + "item_name", "selection", "effect", "effect_list", 0 }; #endif @@ -698,30 +704,31 @@ static const char *const yytname[] = static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 61, 60, 62, - 43, 45, 42, 47, 37, 64, 44, 58, 59, 124, - 91, 93, 38, 94, 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, 40, 41 + 43, 45, 42, 47, 37, 64, 44, 46, 58, 59, + 124, 91, 93, 38, 94, 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, 40, 41 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 73, 74, 74, 75, 75, 76, 76, 77, 77, - 78, 78, 78, 78, 78, 79, 79, 79, 79, 80, - 80, 81, 81, 82, 82, 82, 83, 83, 83, 83, - 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, - 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, - 84, 84, 85, 85, 86, 87, 87, 87, 88, 88, - 89, 89, 90, 91, 91, 92, 92, 92, 93, 93, - 94, 94, 95, 95, 95, 96, 96, 97, 97, 97, - 97, 97, 98, 99, 99, 100, 100, 101, 101, 102, - 102, 102, 102, 102, 103, 103, 103, 103, 103, 103, - 103, 103, 103, 103, 103, 103, 103, 103, 104, 104 + 0, 74, 75, 75, 76, 76, 77, 77, 78, 78, + 79, 79, 79, 79, 79, 80, 80, 80, 80, 81, + 81, 82, 82, 83, 83, 83, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 85, 85, 86, 86, 87, 88, 88, 88, 89, + 89, 90, 90, 91, 92, 92, 93, 93, 93, 94, + 94, 95, 95, 96, 96, 96, 97, 97, 98, 98, + 98, 98, 98, 99, 100, 100, 101, 101, 102, 102, + 103, 103, 103, 103, 103, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 105, + 105 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -732,12 +739,13 @@ static const yytype_uint8 yyr2[] = 5, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, - 0, 1, 1, 3, 8, 1, 8, 9, 1, 4, - 1, 3, 3, 1, 3, 3, 3, 4, 0, 2, - 0, 2, 1, 3, 3, 1, 3, 2, 2, 2, - 2, 2, 3, 1, 3, 3, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 2, 2, 2, 2, 4, - 7, 8, 6, 4, 3, 5, 1, 6, 0, 3 + 3, 0, 1, 1, 3, 8, 1, 8, 9, 1, + 4, 1, 3, 3, 1, 3, 3, 3, 4, 0, + 2, 0, 2, 1, 3, 3, 1, 3, 2, 2, + 2, 2, 2, 3, 1, 3, 3, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 2, 2, 2, 2, + 4, 7, 8, 6, 4, 3, 5, 1, 6, 0, + 3 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -747,79 +755,81 @@ static const yytype_uint8 yydefact[] = { 2, 0, 0, 0, 15, 15, 15, 0, 0, 4, 0, 0, 0, 0, 18, 16, 17, 0, 1, 2, - 0, 24, 25, 27, 23, 0, 0, 26, 10, 55, - 28, 0, 6, 0, 5, 3, 19, 50, 0, 0, + 0, 24, 25, 27, 23, 0, 0, 26, 10, 56, + 28, 0, 6, 0, 5, 3, 19, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 11, 8, 0, 7, 0, 0, 0, 52, 0, - 51, 0, 49, 46, 34, 35, 29, 30, 31, 33, - 32, 38, 36, 37, 39, 40, 45, 47, 42, 41, - 43, 44, 0, 0, 0, 0, 0, 0, 0, 48, - 0, 0, 0, 0, 108, 9, 46, 0, 0, 53, - 0, 0, 0, 0, 0, 106, 0, 0, 0, 0, - 0, 0, 0, 0, 108, 4, 13, 22, 21, 0, - 0, 0, 0, 0, 0, 50, 0, 97, 95, 96, - 98, 0, 92, 89, 90, 91, 93, 0, 0, 0, - 0, 108, 20, 4, 0, 0, 0, 0, 0, 108, - 0, 14, 58, 63, 0, 72, 0, 0, 0, 0, - 0, 50, 0, 0, 0, 104, 94, 109, 60, 0, - 77, 0, 78, 79, 80, 81, 68, 0, 75, 0, - 0, 0, 0, 54, 56, 0, 99, 0, 0, 103, - 0, 0, 0, 0, 4, 88, 87, 0, 83, 86, - 108, 70, 66, 0, 74, 0, 64, 65, 0, 73, - 57, 105, 0, 0, 0, 0, 0, 59, 61, 0, - 0, 82, 69, 108, 67, 75, 76, 107, 102, 0, - 0, 62, 88, 85, 84, 71, 100, 0, 101 + 0, 0, 11, 8, 0, 7, 0, 0, 0, 53, + 0, 52, 0, 49, 46, 34, 35, 29, 30, 31, + 33, 32, 50, 38, 36, 37, 39, 40, 45, 47, + 42, 41, 43, 44, 0, 0, 0, 0, 0, 0, + 0, 48, 0, 0, 0, 0, 109, 9, 46, 0, + 0, 54, 0, 0, 0, 0, 0, 107, 0, 0, + 0, 0, 0, 0, 0, 0, 109, 4, 13, 22, + 21, 0, 0, 0, 0, 0, 0, 51, 0, 98, + 96, 97, 99, 0, 93, 90, 91, 92, 94, 0, + 0, 0, 0, 109, 20, 4, 0, 0, 0, 0, + 0, 109, 0, 14, 59, 64, 0, 73, 0, 0, + 0, 0, 0, 51, 0, 0, 0, 105, 95, 110, + 61, 0, 78, 0, 79, 80, 81, 82, 69, 0, + 76, 0, 0, 0, 0, 55, 57, 0, 100, 0, + 0, 104, 0, 0, 0, 0, 4, 89, 88, 0, + 84, 87, 109, 71, 67, 0, 75, 0, 65, 66, + 0, 74, 58, 106, 0, 0, 0, 0, 0, 60, + 62, 0, 0, 83, 70, 109, 68, 76, 77, 108, + 103, 0, 0, 63, 89, 86, 85, 72, 101, 0, + 102 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 8, 19, 63, 64, 9, 10, 67, 129, 27, - 68, 69, 70, 29, 30, 161, 179, 204, 187, 163, - 211, 234, 164, 189, 165, 182, 207, 208, 209, 147, - 125, 126 + -1, 8, 19, 64, 65, 9, 10, 68, 131, 27, + 69, 70, 71, 29, 30, 163, 181, 206, 189, 165, + 213, 236, 166, 191, 167, 184, 209, 210, 211, 149, + 127, 128 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -172 +#define YYPACT_NINF -174 static const yytype_int16 yypact[] = { - 137, 3, 9, 21, 37, 37, 37, 50, 59, -172, - 19, 1, 74, 17, -172, -172, -172, 60, -172, 482, - 81, -172, -172, 26, -172, 27, 1, -172, 756, 39, - -172, 1, 94, 1, -172, -172, 29, 1, 1, 215, + 56, 3, 12, 14, 72, 72, 72, 16, 26, -174, + -15, 1, 42, -12, -174, -174, -174, 45, -174, 524, + 60, -174, -174, -5, -174, 2, 1, -174, 819, 55, + -174, 1, 89, 1, -174, -174, 25, 1, 1, 247, + 1, 1, 1, 1, 1, 1, 1, 1, 99, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 93, - 1, 756, -172, 33, 90, 787, 103, 100, 756, 38, - 95, 539, -172, 111, 908, 908, 921, 921, 213, 213, - 213, 111, 111, 111, 111, 111, 908, 908, 908, 908, - 879, 849, 51, 570, 122, 123, 1, 114, 1, -172, - 1, 1, 1, 62, 150, -172, 461, -35, 818, 756, - 601, 632, 1, -4, 129, -172, 126, 132, 133, 134, - 1, 54, 148, 1, 150, -172, -172, -172, -172, 82, - 89, 1, 1, 663, 1, 1, 87, -172, -172, -172, - -172, 441, -172, -172, -172, -172, -172, 154, 160, 694, - 102, 130, -172, -172, 1, 161, 161, 1, 1, 150, - 121, -172, -172, 163, 14, -172, 246, 289, 1, 725, - 108, 1, 150, 142, 1, -172, -172, -172, 169, 6, - 756, 15, -172, -172, 756, 756, 136, 118, 12, 119, - 897, 897, 159, -172, -172, 320, -172, 180, 128, 141, - 1, 506, 195, 897, -172, 200, -172, -8, -172, -172, - 150, 174, -172, 159, -172, 897, -172, -172, 159, -172, - -172, -172, 221, 150, 363, 1, 1, -172, 169, 70, - 15, -172, -172, 150, -172, -7, -172, -172, -172, 150, - 402, 756, -172, -172, -172, -172, -172, 150, -172 + 95, 1, 819, -174, 39, 97, 851, 115, 108, 819, + 59, 122, 595, -174, 62, 976, 976, 997, 997, 245, + 245, 245, -174, 62, 62, 62, 62, 62, 976, 976, + 976, 976, 946, 915, 67, 627, 133, 152, 1, 140, + 1, -174, 1, 1, 1, 90, 181, -174, 516, -37, + 883, 819, 659, 691, 1, 5, 156, -174, 145, 153, + 154, 157, 1, 81, 166, 1, 181, -174, -174, -174, + -174, 105, 103, 1, 1, 723, 1, 1, 107, -174, + -174, -174, -174, 475, -174, -174, -174, -174, -174, 182, + 183, 755, 119, 158, -174, -174, 1, 172, 172, 1, + 1, 181, 131, -174, -174, 174, 19, -174, 279, 322, + 1, 787, 123, 1, 181, 150, 1, -174, -174, -174, + 179, 8, 819, 52, -174, -174, 819, 819, 141, 126, + 48, 128, 117, 117, 78, -174, -174, 354, -174, 186, + 129, 143, 1, 561, 199, 117, -174, 195, -174, -8, + -174, -174, 181, 160, -174, 78, -174, 117, -174, -174, + 78, -174, -174, -174, 191, 181, 397, 1, 1, -174, + 179, 68, 52, -174, -174, 181, -174, -13, -174, -174, + -174, 181, 436, 819, -174, -174, -174, -174, -174, 181, + -174 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -172, 199, -102, -172, -172, -172, 65, -172, -172, -172, - -11, -118, -172, -172, -172, -172, -172, -172, -128, 42, - -172, -172, -135, 28, -172, 84, -172, 31, 13, -172, - -171, -103 + -174, 192, -118, -174, -174, -174, 111, -174, -174, -174, + -11, -119, -174, -174, -174, -174, -174, -174, -130, 22, + -174, -174, -137, 4, -174, 63, -174, -9, -7, -174, + -173, -102 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -829,235 +839,248 @@ static const yytype_int16 yypgoto[] = #define YYTABLE_NINF -16 static const yytype_int16 yytable[] = { - 28, 199, 162, 134, 21, 22, 23, 24, 230, 213, - 11, 202, 127, 231, 12, 39, 25, 170, 205, 206, - 61, 150, 65, 151, 128, 188, 13, 71, 213, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 177, 93, - 203, 178, 238, 198, 59, 17, 186, 219, 191, 18, - 191, 20, 216, 192, 4, 5, 6, 135, 246, 14, - 15, 16, 26, 242, 206, 227, 248, 33, 235, 60, - 188, 31, 192, 235, 192, 106, 36, 108, 32, 109, - 110, 111, 21, 22, 23, 24, 142, 37, 38, 62, - 66, 133, 228, 92, 25, 94, 95, 232, 97, 141, - 99, 100, 149, 143, 144, 145, 146, 98, 40, 73, - 166, 167, 102, 169, 21, 22, 23, 24, 105, 104, - 245, 107, 153, 112, 136, 113, 25, 154, 155, 156, - 157, 158, 1, 180, 137, 159, 184, 185, 34, 39, - 138, 139, 140, 148, 152, 113, 114, 195, 171, 173, - 160, 2, 3, 201, 4, 5, 6, 174, 115, 154, - 155, 156, 157, 158, 176, 116, 114, 159, 7, -15, - 197, 181, 190, 117, 118, 119, 200, 34, 115, 224, - 212, 214, 160, 120, 210, 116, 121, 122, 221, 123, - 222, 124, 226, 117, 118, 119, 223, 154, 155, 156, - 157, 158, 229, 120, 240, 241, 121, 122, 35, 123, - 40, 124, 40, 41, 42, 43, 44, 45, 46, 47, - 218, 233, 48, 217, 48, 49, 50, 49, 50, 237, - 183, 236, 243, 51, 52, 51, 52, 53, 54, 55, - 56, 57, 58, 40, 41, 42, 43, 44, 45, 46, - 47, 244, 0, 0, 0, 48, 0, 0, 49, 50, - 0, 0, 0, 0, 0, 0, 51, 52, 53, 54, - 55, 56, 57, 58, 0, 0, 0, 72, 0, 0, - 0, 0, 0, 0, 0, 0, 40, 41, 42, 43, - 44, 45, 46, 47, 0, 0, 0, 0, 48, 0, - 0, 49, 50, 0, 0, 0, 0, 0, 193, 51, - 52, 53, 54, 55, 56, 57, 58, 40, 41, 42, - 43, 44, 45, 46, 47, 0, 0, 0, 0, 48, - 0, 0, 49, 50, 0, 0, 0, 0, 0, 0, - 51, 52, 53, 54, 55, 56, 57, 58, 0, 0, - 0, 194, 0, 0, 0, 0, 0, 0, 0, 0, - 40, 41, 42, 43, 44, 45, 46, 47, 0, 0, - 0, 0, 48, 0, 0, 49, 50, 0, 0, 0, - 0, 0, 220, 51, 52, 53, 54, 55, 56, 57, - 58, 0, 0, 0, 0, 0, 0, 0, 0, 40, - 41, 42, 43, 44, 45, 46, 47, 0, 0, 0, - 0, 48, 0, 0, 49, 50, 0, 0, 0, 0, - 0, 239, 51, 52, 53, 54, 55, 56, 57, 58, - 0, 0, 0, 0, 0, 0, 0, 0, 40, 41, - 42, 43, 44, 45, 46, 47, 0, 0, 0, 0, - 48, -12, 0, 49, 50, 0, -12, 0, 40, 0, - 247, 51, 52, 53, 54, 55, 56, 57, 58, -12, - 0, 0, 0, 0, 0, -12, -12, 1, -12, -12, - -12, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 34, 0, -12, -12, 0, 172, 2, 3, 0, 4, - 5, 6, 0, 40, 41, 42, 43, 44, 45, 46, - 47, 0, 0, 7, -15, 48, 0, 0, 49, 50, - 0, 0, 0, 0, 0, 0, 51, 52, 53, 54, - 55, 56, 57, 58, 0, 225, 40, 41, 42, 43, - 44, 45, 46, 47, 0, 101, 0, 0, 48, 0, - 0, 49, 50, 0, 0, 0, 0, 0, 0, 51, - 52, 53, 54, 55, 56, 57, 58, 40, 41, 42, - 43, 44, 45, 46, 47, 0, 0, 103, 0, 48, - 0, 0, 49, 50, 0, 0, 0, 0, 0, 0, - 51, 52, 53, 54, 55, 56, 57, 58, 40, 41, - 42, 43, 44, 45, 46, 47, 0, 131, 0, 0, - 48, 0, 0, 49, 50, 0, 0, 0, 0, 0, - 0, 51, 52, 53, 54, 55, 56, 57, 58, 40, - 41, 42, 43, 44, 45, 46, 47, 0, 132, 0, - 0, 48, 0, 0, 49, 50, 0, 0, 0, 0, - 0, 0, 51, 52, 53, 54, 55, 56, 57, 58, - 40, 41, 42, 43, 44, 45, 46, 47, 0, 168, - 0, 0, 48, 0, 0, 49, 50, 0, 0, 0, - 0, 0, 0, 51, 52, 53, 54, 55, 56, 57, - 58, 40, 41, 42, 43, 44, 45, 46, 47, 0, - 0, 0, 175, 48, 0, 0, 49, 50, 0, 0, - 0, 0, 0, 0, 51, 52, 53, 54, 55, 56, - 57, 58, 40, 41, 42, 43, 44, 45, 46, 47, - 0, 0, 0, 196, 48, 0, 0, 49, 50, 0, - 0, 0, 0, 0, 0, 51, 52, 53, 54, 55, + 28, 201, 164, 215, 21, 22, 23, 24, 232, 153, + 11, 129, 136, 204, 233, 39, 25, 12, 172, 13, + 62, 17, 66, 130, 152, 190, 18, 72, 20, 74, + 75, 76, 77, 78, 79, 80, 81, 180, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 31, + 95, 179, 240, 205, 200, 207, 208, 221, 194, 188, + 32, 1, 218, 33, 215, 36, 193, 37, 248, 40, + 60, 244, 208, 26, 38, 229, 250, 137, 237, 48, + 190, 2, 3, 237, 4, 5, 6, 108, 230, 110, + 194, 111, 112, 113, 63, 193, 61, 67, 7, -15, + 4, 5, 6, 135, 82, 94, 21, 22, 23, 24, + 234, 143, 96, 97, 151, 14, 15, 16, 25, 194, + 99, 74, 168, 169, 144, 171, 100, 156, 157, 158, + 159, 160, 101, 247, 21, 22, 23, 24, 102, 104, + 106, 145, 146, 147, 148, 182, 25, 155, 186, 187, + 220, 39, 156, 157, 158, 159, 160, 107, 109, 197, + 161, 138, 114, 115, 139, 203, 156, 157, 158, 159, + 160, 150, 140, 141, 161, 162, 142, 34, 154, 173, + 156, 157, 158, 159, 160, 116, 115, 175, 161, 217, + 176, 226, 178, 183, 192, 202, 199, 117, 34, 214, + 212, 216, 224, 162, 118, 223, 228, 231, 116, 225, + 239, 35, 119, 120, 121, 219, 242, 243, 235, 238, + 117, 185, 122, 246, 245, 123, 124, 118, 125, 0, + 126, 0, 0, 0, 0, 119, 120, 121, 0, 0, + 0, 0, 0, 0, 0, 122, 0, 0, 123, 124, + 0, 125, 40, 126, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 0, 48, 49, 0, 49, 50, 51, + 50, 51, 0, 0, 0, 0, 52, 53, 52, 53, + 54, 55, 56, 57, 58, 59, 40, 41, 42, 43, + 44, 45, 46, 47, 0, 0, 48, 0, 0, 49, + 0, 0, 50, 51, 0, 0, 0, 0, 0, 0, + 52, 53, 54, 55, 56, 57, 58, 59, 0, 0, + 73, 0, 0, 0, 0, 0, 0, 0, 0, 40, + 41, 42, 43, 44, 45, 46, 47, 0, 0, 48, + 0, 0, 49, 0, 0, 50, 51, 0, 0, 0, + 0, 0, 195, 52, 53, 54, 55, 56, 57, 58, + 59, 40, 41, 42, 43, 44, 45, 46, 47, 0, + 0, 48, 0, 0, 49, 0, 0, 50, 51, 0, + 0, 0, 0, 0, 0, 52, 53, 54, 55, 56, + 57, 58, 59, 0, 0, 196, 0, 0, 0, 0, + 0, 0, 0, 0, 40, 41, 42, 43, 44, 45, + 46, 47, 0, 0, 48, 0, 0, 49, 0, 0, + 50, 51, 0, 0, 0, 0, 0, 222, 52, 53, + 54, 55, 56, 57, 58, 59, 0, 0, 0, 0, + 0, 0, 0, 40, 41, 42, 43, 44, 45, 46, + 47, 0, 0, 48, 0, 0, 49, 0, 0, 50, + 51, 0, 0, 0, 0, 0, 241, 52, 53, 54, + 55, 56, 57, 58, 59, 0, 0, 0, 0, 0, + 0, 0, 40, 41, 42, 43, 44, 45, 46, 47, + 0, 0, 48, 0, 0, 49, 0, 0, 50, 51, + 0, 0, 0, 0, 0, 249, 52, 53, 54, 55, + 56, 57, 58, 59, 0, 0, -12, 0, 0, 0, + 0, -12, 0, 40, 0, 0, 0, 0, 0, 1, + 0, 0, 0, 48, 0, -12, 0, 0, 0, 0, + 174, -12, -12, 34, -12, -12, -12, 0, 0, 2, + 3, 0, 4, 5, 6, 0, 0, 0, -12, -12, + 0, 0, 0, 0, 0, 0, 7, -15, 40, 41, + 42, 43, 44, 45, 46, 47, 0, 0, 48, 0, + 0, 49, 0, 0, 50, 51, 0, 0, 0, 0, + 0, 0, 52, 53, 54, 55, 56, 57, 58, 59, + 0, 227, 40, 41, 42, 43, 44, 45, 46, 47, + 0, 103, 48, 0, 0, 49, 0, 0, 50, 51, + 0, 0, 0, 0, 0, 0, 52, 53, 54, 55, + 56, 57, 58, 59, 40, 41, 42, 43, 44, 45, + 46, 47, 0, 0, 48, 105, 0, 49, 0, 0, + 50, 51, 0, 0, 0, 0, 0, 0, 52, 53, + 54, 55, 56, 57, 58, 59, 40, 41, 42, 43, + 44, 45, 46, 47, 0, 133, 48, 0, 0, 49, + 0, 0, 50, 51, 0, 0, 0, 0, 0, 0, + 52, 53, 54, 55, 56, 57, 58, 59, 40, 41, + 42, 43, 44, 45, 46, 47, 0, 134, 48, 0, + 0, 49, 0, 0, 50, 51, 0, 0, 0, 0, + 0, 0, 52, 53, 54, 55, 56, 57, 58, 59, + 40, 41, 42, 43, 44, 45, 46, 47, 0, 170, + 48, 0, 0, 49, 0, 0, 50, 51, 0, 0, + 0, 0, 0, 0, 52, 53, 54, 55, 56, 57, + 58, 59, 40, 41, 42, 43, 44, 45, 46, 47, + 0, 0, 48, 0, 177, 49, 0, 0, 50, 51, + 0, 0, 0, 0, 0, 0, 52, 53, 54, 55, + 56, 57, 58, 59, 40, 41, 42, 43, 44, 45, + 46, 47, 0, 0, 48, 0, 198, 49, 0, 0, + 50, 51, 0, 0, 0, 0, 0, 0, 52, 53, + 54, 55, 56, 57, 58, 59, 40, 41, 42, 43, + 44, 45, 46, 47, 0, 0, 48, 0, 0, 49, + 0, 0, 50, 51, 0, 0, 0, 0, 0, 0, + 52, 53, 54, 55, 56, 57, 58, 59, 98, 41, + 42, 43, 44, 45, 46, 47, 0, 0, 48, 0, + 0, 49, 0, 0, 50, 51, 0, 0, 0, 0, + 0, 0, 52, 53, 54, 55, 56, 57, 58, 59, + 132, 41, 42, 43, 44, 45, 46, 47, 0, 0, + 48, 0, 0, 49, 0, 0, 50, 51, 0, 0, + 0, 0, 0, 0, 52, 53, 54, 55, 56, 57, + 58, 59, 40, 41, 42, 43, 44, 45, 46, 47, + 0, 0, 48, 0, 0, 49, 0, 0, 50, 51, + 0, 0, 0, 0, 0, 0, 52, 53, 54, 55, 56, 57, 58, 40, 41, 42, 43, 44, 45, 46, - 47, 0, 0, 0, 0, 48, 0, 0, 49, 50, - 0, 0, 0, 0, 0, 0, 51, 52, 53, 54, - 55, 56, 57, 58, 96, 41, 42, 43, 44, 45, - 46, 47, 0, 0, 0, 0, 48, 0, 0, 49, - 50, 0, 0, 0, 0, 0, 0, 51, 52, 53, - 54, 55, 56, 57, 58, 130, 41, 42, 43, 44, - 45, 46, 47, 0, 0, 0, 0, 48, 0, 0, - 49, 50, 0, 0, 0, 0, 0, 0, 51, 52, - 53, 54, 55, 56, 57, 58, 40, 41, 42, 43, - 44, 45, 46, 47, 0, 0, 0, 0, 48, 0, - 0, 49, 50, 0, 0, 0, 0, 0, 0, 51, - 52, 53, 54, 55, 56, 57, 40, 41, 42, 43, - 44, 45, 46, 47, 0, 0, 0, 0, 48, 0, - 0, 49, 50, 0, 0, 0, 0, 0, 0, 51, - 52, 53, 54, 55, 56, 40, 0, 0, 43, 44, - 45, 46, 47, 0, 0, 0, 0, 48, 40, 0, - 49, 50, 0, 45, 46, 47, 0, 0, 51, 52, - 48, 0, 0, 49, 50, 154, 155, 156, 157, 158, - 0, 51, 52, 159, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 215 + 47, 0, 0, 48, 0, 0, 49, 0, 0, 50, + 51, 0, 0, 0, 0, 0, 0, 52, 53, 54, + 55, 56, 57, 40, 0, 0, 43, 44, 45, 46, + 47, 0, 0, 48, 0, 0, 49, 0, 0, 50, + 51, 0, 0, 0, 40, 0, 0, 52, 53, 45, + 46, 47, 0, 0, 48, 0, 0, 49, 0, 0, + 50, 51, 0, 0, 0, 0, 0, 0, 52, 53 }; static const yytype_int16 yycheck[] = { - 11, 172, 130, 7, 3, 4, 5, 6, 16, 16, - 7, 5, 47, 21, 5, 26, 15, 135, 3, 4, - 31, 124, 33, 125, 59, 160, 5, 38, 16, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 151, 60, - 44, 153, 223, 171, 15, 5, 159, 192, 46, 0, - 46, 42, 190, 70, 27, 28, 29, 71, 239, 4, - 5, 6, 71, 3, 4, 203, 247, 17, 213, 40, - 215, 7, 70, 218, 70, 96, 5, 98, 71, 100, - 101, 102, 3, 4, 5, 6, 42, 71, 71, 5, - 71, 112, 204, 10, 15, 72, 16, 210, 5, 120, - 72, 16, 123, 59, 60, 61, 62, 17, 7, 130, - 131, 132, 71, 134, 3, 4, 5, 6, 5, 7, - 233, 17, 43, 71, 5, 5, 15, 48, 49, 50, - 51, 52, 5, 154, 18, 56, 157, 158, 18, 160, - 18, 18, 18, 5, 72, 5, 26, 168, 71, 5, - 71, 24, 25, 174, 27, 28, 29, 7, 38, 48, - 49, 50, 51, 52, 72, 45, 26, 56, 41, 42, - 72, 20, 19, 53, 54, 55, 44, 18, 38, 200, - 72, 72, 71, 63, 58, 45, 66, 67, 18, 69, - 72, 71, 7, 53, 54, 55, 65, 48, 49, 50, - 51, 52, 12, 63, 225, 226, 66, 67, 19, 69, - 7, 71, 7, 8, 9, 10, 11, 12, 13, 14, - 71, 57, 19, 191, 19, 22, 23, 22, 23, 18, - 156, 213, 229, 30, 31, 30, 31, 32, 33, 34, - 35, 36, 37, 7, 8, 9, 10, 11, 12, 13, - 14, 230, -1, -1, -1, 19, -1, -1, 22, 23, - -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, - 34, 35, 36, 37, -1, -1, -1, 72, -1, -1, - -1, -1, -1, -1, -1, -1, 7, 8, 9, 10, - 11, 12, 13, 14, -1, -1, -1, -1, 19, -1, - -1, 22, 23, -1, -1, -1, -1, -1, 72, 30, - 31, 32, 33, 34, 35, 36, 37, 7, 8, 9, - 10, 11, 12, 13, 14, -1, -1, -1, -1, 19, - -1, -1, 22, 23, -1, -1, -1, -1, -1, -1, - 30, 31, 32, 33, 34, 35, 36, 37, -1, -1, - -1, 72, -1, -1, -1, -1, -1, -1, -1, -1, - 7, 8, 9, 10, 11, 12, 13, 14, -1, -1, - -1, -1, 19, -1, -1, 22, 23, -1, -1, -1, - -1, -1, 72, 30, 31, 32, 33, 34, 35, 36, - 37, -1, -1, -1, -1, -1, -1, -1, -1, 7, - 8, 9, 10, 11, 12, 13, 14, -1, -1, -1, - -1, 19, -1, -1, 22, 23, -1, -1, -1, -1, - -1, 68, 30, 31, 32, 33, 34, 35, 36, 37, - -1, -1, -1, -1, -1, -1, -1, -1, 7, 8, - 9, 10, 11, 12, 13, 14, -1, -1, -1, -1, - 19, 0, -1, 22, 23, -1, 5, -1, 7, -1, - 68, 30, 31, 32, 33, 34, 35, 36, 37, 18, - -1, -1, -1, -1, -1, 24, 25, 5, 27, 28, - 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 18, -1, 41, 42, -1, 64, 24, 25, -1, 27, - 28, 29, -1, 7, 8, 9, 10, 11, 12, 13, - 14, -1, -1, 41, 42, 19, -1, -1, 22, 23, - -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, - 34, 35, 36, 37, -1, 39, 7, 8, 9, 10, - 11, 12, 13, 14, -1, 16, -1, -1, 19, -1, - -1, 22, 23, -1, -1, -1, -1, -1, -1, 30, - 31, 32, 33, 34, 35, 36, 37, 7, 8, 9, - 10, 11, 12, 13, 14, -1, -1, 17, -1, 19, - -1, -1, 22, 23, -1, -1, -1, -1, -1, -1, - 30, 31, 32, 33, 34, 35, 36, 37, 7, 8, - 9, 10, 11, 12, 13, 14, -1, 16, -1, -1, - 19, -1, -1, 22, 23, -1, -1, -1, -1, -1, - -1, 30, 31, 32, 33, 34, 35, 36, 37, 7, - 8, 9, 10, 11, 12, 13, 14, -1, 16, -1, - -1, 19, -1, -1, 22, 23, -1, -1, -1, -1, - -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, + 11, 174, 132, 16, 3, 4, 5, 6, 16, 127, + 7, 48, 7, 5, 22, 26, 15, 5, 137, 5, + 31, 5, 33, 60, 126, 162, 0, 38, 43, 40, + 41, 42, 43, 44, 45, 46, 47, 155, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 7, + 61, 153, 225, 45, 173, 3, 4, 194, 71, 161, + 72, 5, 192, 18, 16, 5, 47, 72, 241, 7, + 15, 3, 4, 72, 72, 205, 249, 72, 215, 17, + 217, 25, 26, 220, 28, 29, 30, 98, 206, 100, + 71, 102, 103, 104, 5, 47, 41, 72, 42, 43, + 28, 29, 30, 114, 5, 10, 3, 4, 5, 6, + 212, 122, 73, 16, 125, 4, 5, 6, 15, 71, + 5, 132, 133, 134, 43, 136, 18, 49, 50, 51, + 52, 53, 73, 235, 3, 4, 5, 6, 16, 72, + 7, 60, 61, 62, 63, 156, 15, 44, 159, 160, + 72, 162, 49, 50, 51, 52, 53, 5, 18, 170, + 57, 5, 72, 5, 19, 176, 49, 50, 51, 52, + 53, 5, 19, 19, 57, 72, 19, 19, 73, 72, + 49, 50, 51, 52, 53, 27, 5, 5, 57, 72, + 7, 202, 73, 21, 20, 45, 73, 39, 19, 73, + 59, 73, 73, 72, 46, 19, 7, 12, 27, 66, + 19, 19, 54, 55, 56, 193, 227, 228, 58, 215, + 39, 158, 64, 232, 231, 67, 68, 46, 70, -1, + 72, -1, -1, -1, -1, 54, 55, 56, -1, -1, + -1, -1, -1, -1, -1, 64, -1, -1, 67, 68, + -1, 70, 7, 72, 7, 8, 9, 10, 11, 12, + 13, 14, 17, -1, 17, 20, -1, 20, 23, 24, + 23, 24, -1, -1, -1, -1, 31, 32, 31, 32, + 33, 34, 35, 36, 37, 38, 7, 8, 9, 10, + 11, 12, 13, 14, -1, -1, 17, -1, -1, 20, + -1, -1, 23, 24, -1, -1, -1, -1, -1, -1, + 31, 32, 33, 34, 35, 36, 37, 38, -1, -1, + 73, -1, -1, -1, -1, -1, -1, -1, -1, 7, + 8, 9, 10, 11, 12, 13, 14, -1, -1, 17, + -1, -1, 20, -1, -1, 23, 24, -1, -1, -1, + -1, -1, 73, 31, 32, 33, 34, 35, 36, 37, + 38, 7, 8, 9, 10, 11, 12, 13, 14, -1, + -1, 17, -1, -1, 20, -1, -1, 23, 24, -1, + -1, -1, -1, -1, -1, 31, 32, 33, 34, 35, + 36, 37, 38, -1, -1, 73, -1, -1, -1, -1, + -1, -1, -1, -1, 7, 8, 9, 10, 11, 12, + 13, 14, -1, -1, 17, -1, -1, 20, -1, -1, + 23, 24, -1, -1, -1, -1, -1, 73, 31, 32, + 33, 34, 35, 36, 37, 38, -1, -1, -1, -1, + -1, -1, -1, 7, 8, 9, 10, 11, 12, 13, + 14, -1, -1, 17, -1, -1, 20, -1, -1, 23, + 24, -1, -1, -1, -1, -1, 69, 31, 32, 33, + 34, 35, 36, 37, 38, -1, -1, -1, -1, -1, + -1, -1, 7, 8, 9, 10, 11, 12, 13, 14, + -1, -1, 17, -1, -1, 20, -1, -1, 23, 24, + -1, -1, -1, -1, -1, 69, 31, 32, 33, 34, + 35, 36, 37, 38, -1, -1, 0, -1, -1, -1, + -1, 5, -1, 7, -1, -1, -1, -1, -1, 5, + -1, -1, -1, 17, -1, 19, -1, -1, -1, -1, + 65, 25, 26, 19, 28, 29, 30, -1, -1, 25, + 26, -1, 28, 29, 30, -1, -1, -1, 42, 43, + -1, -1, -1, -1, -1, -1, 42, 43, 7, 8, + 9, 10, 11, 12, 13, 14, -1, -1, 17, -1, + -1, 20, -1, -1, 23, 24, -1, -1, -1, -1, + -1, -1, 31, 32, 33, 34, 35, 36, 37, 38, + -1, 40, 7, 8, 9, 10, 11, 12, 13, 14, + -1, 16, 17, -1, -1, 20, -1, -1, 23, 24, + -1, -1, -1, -1, -1, -1, 31, 32, 33, 34, + 35, 36, 37, 38, 7, 8, 9, 10, 11, 12, + 13, 14, -1, -1, 17, 18, -1, 20, -1, -1, + 23, 24, -1, -1, -1, -1, -1, -1, 31, 32, + 33, 34, 35, 36, 37, 38, 7, 8, 9, 10, + 11, 12, 13, 14, -1, 16, 17, -1, -1, 20, + -1, -1, 23, 24, -1, -1, -1, -1, -1, -1, + 31, 32, 33, 34, 35, 36, 37, 38, 7, 8, + 9, 10, 11, 12, 13, 14, -1, 16, 17, -1, + -1, 20, -1, -1, 23, 24, -1, -1, -1, -1, + -1, -1, 31, 32, 33, 34, 35, 36, 37, 38, 7, 8, 9, 10, 11, 12, 13, 14, -1, 16, - -1, -1, 19, -1, -1, 22, 23, -1, -1, -1, - -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, - 37, 7, 8, 9, 10, 11, 12, 13, 14, -1, - -1, -1, 18, 19, -1, -1, 22, 23, -1, -1, - -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, - 36, 37, 7, 8, 9, 10, 11, 12, 13, 14, - -1, -1, -1, 18, 19, -1, -1, 22, 23, -1, - -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, + 17, -1, -1, 20, -1, -1, 23, 24, -1, -1, + -1, -1, -1, -1, 31, 32, 33, 34, 35, 36, + 37, 38, 7, 8, 9, 10, 11, 12, 13, 14, + -1, -1, 17, -1, 19, 20, -1, -1, 23, 24, + -1, -1, -1, -1, -1, -1, 31, 32, 33, 34, + 35, 36, 37, 38, 7, 8, 9, 10, 11, 12, + 13, 14, -1, -1, 17, -1, 19, 20, -1, -1, + 23, 24, -1, -1, -1, -1, -1, -1, 31, 32, + 33, 34, 35, 36, 37, 38, 7, 8, 9, 10, + 11, 12, 13, 14, -1, -1, 17, -1, -1, 20, + -1, -1, 23, 24, -1, -1, -1, -1, -1, -1, + 31, 32, 33, 34, 35, 36, 37, 38, 7, 8, + 9, 10, 11, 12, 13, 14, -1, -1, 17, -1, + -1, 20, -1, -1, 23, 24, -1, -1, -1, -1, + -1, -1, 31, 32, 33, 34, 35, 36, 37, 38, + 7, 8, 9, 10, 11, 12, 13, 14, -1, -1, + 17, -1, -1, 20, -1, -1, 23, 24, -1, -1, + -1, -1, -1, -1, 31, 32, 33, 34, 35, 36, + 37, 38, 7, 8, 9, 10, 11, 12, 13, 14, + -1, -1, 17, -1, -1, 20, -1, -1, 23, 24, + -1, -1, -1, -1, -1, -1, 31, 32, 33, 34, 35, 36, 37, 7, 8, 9, 10, 11, 12, 13, - 14, -1, -1, -1, -1, 19, -1, -1, 22, 23, - -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, - 34, 35, 36, 37, 7, 8, 9, 10, 11, 12, - 13, 14, -1, -1, -1, -1, 19, -1, -1, 22, - 23, -1, -1, -1, -1, -1, -1, 30, 31, 32, - 33, 34, 35, 36, 37, 7, 8, 9, 10, 11, - 12, 13, 14, -1, -1, -1, -1, 19, -1, -1, - 22, 23, -1, -1, -1, -1, -1, -1, 30, 31, - 32, 33, 34, 35, 36, 37, 7, 8, 9, 10, - 11, 12, 13, 14, -1, -1, -1, -1, 19, -1, - -1, 22, 23, -1, -1, -1, -1, -1, -1, 30, - 31, 32, 33, 34, 35, 36, 7, 8, 9, 10, - 11, 12, 13, 14, -1, -1, -1, -1, 19, -1, - -1, 22, 23, -1, -1, -1, -1, -1, -1, 30, - 31, 32, 33, 34, 35, 7, -1, -1, 10, 11, - 12, 13, 14, -1, -1, -1, -1, 19, 7, -1, - 22, 23, -1, 12, 13, 14, -1, -1, 30, 31, - 19, -1, -1, 22, 23, 48, 49, 50, 51, 52, - -1, 30, 31, 56, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 71 + 14, -1, -1, 17, -1, -1, 20, -1, -1, 23, + 24, -1, -1, -1, -1, -1, -1, 31, 32, 33, + 34, 35, 36, 7, -1, -1, 10, 11, 12, 13, + 14, -1, -1, 17, -1, -1, 20, -1, -1, 23, + 24, -1, -1, -1, 7, -1, -1, 31, 32, 12, + 13, 14, -1, -1, 17, -1, -1, 20, -1, -1, + 23, 24, -1, -1, -1, -1, -1, -1, 31, 32 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 5, 24, 25, 27, 28, 29, 41, 74, 78, - 79, 7, 5, 5, 79, 79, 79, 5, 0, 75, - 42, 3, 4, 5, 6, 15, 71, 82, 83, 86, - 87, 7, 71, 17, 18, 74, 5, 71, 71, 83, - 7, 8, 9, 10, 11, 12, 13, 14, 19, 22, - 23, 30, 31, 32, 33, 34, 35, 36, 37, 15, - 40, 83, 5, 76, 77, 83, 71, 80, 83, 84, - 85, 83, 72, 83, 83, 83, 83, 83, 83, 83, - 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, - 83, 83, 10, 83, 72, 16, 7, 5, 17, 72, - 16, 16, 71, 17, 7, 5, 83, 17, 83, 83, - 83, 83, 71, 5, 26, 38, 45, 53, 54, 55, - 63, 66, 67, 69, 71, 103, 104, 47, 59, 81, - 7, 16, 16, 83, 7, 71, 5, 18, 18, 18, - 18, 83, 42, 59, 60, 61, 62, 102, 5, 83, - 104, 75, 72, 43, 48, 49, 50, 51, 52, 56, - 71, 88, 91, 92, 95, 97, 83, 83, 16, 83, - 84, 71, 64, 5, 7, 18, 72, 104, 75, 89, - 83, 20, 98, 98, 83, 83, 104, 91, 95, 96, - 19, 46, 70, 72, 72, 83, 18, 72, 84, 103, - 44, 83, 5, 44, 90, 3, 4, 99, 100, 101, - 58, 93, 72, 16, 72, 71, 91, 92, 71, 95, - 72, 18, 72, 65, 83, 39, 7, 91, 75, 12, - 16, 21, 104, 57, 94, 95, 96, 18, 103, 68, - 83, 83, 3, 101, 100, 104, 103, 68, 103 + 0, 5, 25, 26, 28, 29, 30, 42, 75, 79, + 80, 7, 5, 5, 80, 80, 80, 5, 0, 76, + 43, 3, 4, 5, 6, 15, 72, 83, 84, 87, + 88, 7, 72, 18, 19, 75, 5, 72, 72, 84, + 7, 8, 9, 10, 11, 12, 13, 14, 17, 20, + 23, 24, 31, 32, 33, 34, 35, 36, 37, 38, + 15, 41, 84, 5, 77, 78, 84, 72, 81, 84, + 85, 86, 84, 73, 84, 84, 84, 84, 84, 84, + 84, 84, 5, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 10, 84, 73, 16, 7, 5, + 18, 73, 16, 16, 72, 18, 7, 5, 84, 18, + 84, 84, 84, 84, 72, 5, 27, 39, 46, 54, + 55, 56, 64, 67, 68, 70, 72, 104, 105, 48, + 60, 82, 7, 16, 16, 84, 7, 72, 5, 19, + 19, 19, 19, 84, 43, 60, 61, 62, 63, 103, + 5, 84, 105, 76, 73, 44, 49, 50, 51, 52, + 53, 57, 72, 89, 92, 93, 96, 98, 84, 84, + 16, 84, 85, 72, 65, 5, 7, 19, 73, 105, + 76, 90, 84, 21, 99, 99, 84, 84, 105, 92, + 96, 97, 20, 47, 71, 73, 73, 84, 19, 73, + 85, 104, 45, 84, 5, 45, 91, 3, 4, 100, + 101, 102, 59, 94, 73, 16, 73, 72, 92, 93, + 72, 96, 73, 19, 73, 66, 84, 40, 7, 92, + 76, 12, 16, 22, 105, 58, 95, 96, 97, 19, + 104, 69, 84, 84, 3, 102, 101, 105, 104, 69, + 104 }; #define yyerrok (yyerrstatus = 0) @@ -1894,37 +1917,37 @@ yyreduce: switch (yyn) { case 2: -#line 207 "magic-interpreter-parser.y" +#line 212 "magic-interpreter-parser.y" {;} break; case 3: -#line 209 "magic-interpreter-parser.y" +#line 214 "magic-interpreter-parser.y" {;} break; case 4: -#line 214 "magic-interpreter-parser.y" +#line 219 "magic-interpreter-parser.y" {;} break; case 5: -#line 216 "magic-interpreter-parser.y" +#line 221 "magic-interpreter-parser.y" {;} break; case 6: -#line 221 "magic-interpreter-parser.y" +#line 226 "magic-interpreter-parser.y" { (yyval.proc) = aCalloc(sizeof(proc_t), 1); ;} break; case 7: -#line 223 "magic-interpreter-parser.y" +#line 228 "magic-interpreter-parser.y" { (yyval.proc) = (yyvsp[(1) - (1)].proc); ;} break; case 8: -#line 227 "magic-interpreter-parser.y" +#line 232 "magic-interpreter-parser.y" { (yyval.proc) = aCalloc(sizeof(proc_t), 1); (yyval.proc)->args_nr = 1; (yyval.proc)->args = malloc(sizeof(int)); @@ -1933,7 +1956,7 @@ yyreduce: break; case 9: -#line 233 "magic-interpreter-parser.y" +#line 238 "magic-interpreter-parser.y" { (yyval.proc) = (yyvsp[(1) - (3)].proc); (yyval.proc)->args = realloc((yyval.proc)->args, sizeof(int) * (1 + (yyval.proc)->args_nr)); (yyval.proc)->args[(yyval.proc)->args_nr++] = intern_id((yyvsp[(3) - (3)].s)); @@ -1941,7 +1964,7 @@ yyreduce: break; case 10: -#line 240 "magic-interpreter-parser.y" +#line 245 "magic-interpreter-parser.y" { int var_id; if (find_constant((yyvsp[(1) - (3)].s))) { @@ -1955,7 +1978,7 @@ yyreduce: break; case 11: -#line 251 "magic-interpreter-parser.y" +#line 256 "magic-interpreter-parser.y" { val_t var; magic_eval(&magic_default_env, &var, (yyvsp[(4) - (4)].expr)); @@ -1964,7 +1987,7 @@ yyreduce: break; case 12: -#line 257 "magic-interpreter-parser.y" +#line 262 "magic-interpreter-parser.y" { teleport_anchor_t *anchor = calloc(sizeof(teleport_anchor_t), 1); anchor->name = (yyvsp[(2) - (6)].s); @@ -1978,7 +2001,7 @@ yyreduce: break; case 13: -#line 268 "magic-interpreter-parser.y" +#line 273 "magic-interpreter-parser.y" { proc_t *proc = (yyvsp[(4) - (7)].proc); proc->name = (yyvsp[(2) - (7)].s); @@ -1990,7 +2013,7 @@ yyreduce: break; case 14: -#line 277 "magic-interpreter-parser.y" +#line 282 "magic-interpreter-parser.y" { spell_t *spell = (yyvsp[(8) - (8)].spell); spell->name = (yyvsp[(3) - (8)].s); spell->invocation = magic_eval_str(&magic_default_env, (yyvsp[(6) - (8)].expr)); @@ -2004,12 +2027,12 @@ yyreduce: break; case 15: -#line 289 "magic-interpreter-parser.y" +#line 294 "magic-interpreter-parser.y" { (yyval.i) = 0; ;} break; case 16: -#line 291 "magic-interpreter-parser.y" +#line 296 "magic-interpreter-parser.y" { if ((yyvsp[(2) - (2)].i) & SPELL_FLAG_LOCAL) fail((yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column, "`LOCAL' specified more than once"); (yyval.i) = (yyvsp[(2) - (2)].i) | SPELL_FLAG_LOCAL; @@ -2017,7 +2040,7 @@ yyreduce: break; case 17: -#line 296 "magic-interpreter-parser.y" +#line 301 "magic-interpreter-parser.y" { if ((yyvsp[(2) - (2)].i) & SPELL_FLAG_NONMAGIC) fail((yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column, "`NONMAGIC' specified more than once"); (yyval.i) = (yyvsp[(2) - (2)].i) | SPELL_FLAG_NONMAGIC; @@ -2025,7 +2048,7 @@ yyreduce: break; case 18: -#line 301 "magic-interpreter-parser.y" +#line 306 "magic-interpreter-parser.y" { if ((yyvsp[(2) - (2)].i) & SPELL_FLAG_SILENT) fail((yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column, "`SILENT' specified more than once"); (yyval.i) = (yyvsp[(2) - (2)].i) | SPELL_FLAG_SILENT; @@ -2033,52 +2056,52 @@ yyreduce: break; case 19: -#line 308 "magic-interpreter-parser.y" +#line 313 "magic-interpreter-parser.y" { (yyval.spellarg_def).ty = SPELLARG_NONE; ;} break; case 20: -#line 310 "magic-interpreter-parser.y" +#line 315 "magic-interpreter-parser.y" { (yyval.spellarg_def).id = intern_id((yyvsp[(2) - (5)].s)); (yyval.spellarg_def).ty = (yyvsp[(4) - (5)].i); ;} break; case 21: -#line 316 "magic-interpreter-parser.y" +#line 321 "magic-interpreter-parser.y" { (yyval.i) = SPELLARG_PC; ;} break; case 22: -#line 318 "magic-interpreter-parser.y" +#line 323 "magic-interpreter-parser.y" { (yyval.i) = SPELLARG_STRING; ;} break; case 23: -#line 323 "magic-interpreter-parser.y" +#line 328 "magic-interpreter-parser.y" { (yyval.value).ty = TY_DIR; (yyval.value).v.v_int = (yyvsp[(1) - (1)].i); ;} break; case 24: -#line 326 "magic-interpreter-parser.y" +#line 331 "magic-interpreter-parser.y" { (yyval.value).ty = TY_INT; (yyval.value).v.v_int = (yyvsp[(1) - (1)].i); ;} break; case 25: -#line 329 "magic-interpreter-parser.y" +#line 334 "magic-interpreter-parser.y" { (yyval.value).ty = TY_STRING; (yyval.value).v.v_string = (yyvsp[(1) - (1)].s); ;} break; case 26: -#line 335 "magic-interpreter-parser.y" +#line 340 "magic-interpreter-parser.y" { (yyval.expr) = magic_new_expr(EXPR_VAL); (yyval.expr)->e.e_val = (yyvsp[(1) - (1)].value); ;} break; case 27: -#line 338 "magic-interpreter-parser.y" +#line 343 "magic-interpreter-parser.y" { val_t *val; if ((val = find_constant((yyvsp[(1) - (1)].s)))) { @@ -2092,109 +2115,109 @@ yyreduce: break; case 28: -#line 349 "magic-interpreter-parser.y" +#line 354 "magic-interpreter-parser.y" { (yyval.expr) = magic_new_expr(EXPR_AREA); (yyval.expr)->e.e_area = (yyvsp[(1) - (1)].area); ;} break; case 29: -#line 352 "magic-interpreter-parser.y" +#line 357 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "+", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 30: -#line 354 "magic-interpreter-parser.y" +#line 359 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "-", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 31: -#line 356 "magic-interpreter-parser.y" +#line 361 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "*", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 32: -#line 358 "magic-interpreter-parser.y" +#line 363 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "%", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 33: -#line 360 "magic-interpreter-parser.y" +#line 365 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "/", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 34: -#line 362 "magic-interpreter-parser.y" +#line 367 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), ">", (yyvsp[(3) - (3)].expr), (yyvsp[(1) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 35: -#line 364 "magic-interpreter-parser.y" +#line 369 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), ">", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 36: -#line 366 "magic-interpreter-parser.y" +#line 371 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "&", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 37: -#line 368 "magic-interpreter-parser.y" +#line 373 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "^", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 38: -#line 370 "magic-interpreter-parser.y" +#line 375 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "|", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 39: -#line 372 "magic-interpreter-parser.y" +#line 377 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "<<", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 40: -#line 374 "magic-interpreter-parser.y" +#line 379 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), ">>", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 41: -#line 376 "magic-interpreter-parser.y" +#line 381 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), ">=", (yyvsp[(3) - (3)].expr), (yyvsp[(1) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 42: -#line 378 "magic-interpreter-parser.y" +#line 383 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), ">=", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 43: -#line 380 "magic-interpreter-parser.y" +#line 385 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "&&", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 44: -#line 382 "magic-interpreter-parser.y" +#line 387 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "||", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 45: -#line 384 "magic-interpreter-parser.y" +#line 389 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "=", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 46: -#line 386 "magic-interpreter-parser.y" +#line 391 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "=", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 47: -#line 388 "magic-interpreter-parser.y" +#line 393 "magic-interpreter-parser.y" { BIN_EXPR((yyval.expr), "=", (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); (yyval.expr) = fun_expr("not", 1, &(yyval.expr), (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column); ;} break; case 48: -#line 391 "magic-interpreter-parser.y" +#line 396 "magic-interpreter-parser.y" { (yyval.expr) = fun_expr((yyvsp[(1) - (4)].s), (yyvsp[(3) - (4)].arg_list).args_nr, (yyvsp[(3) - (4)].arg_list).args, (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column); if ((yyvsp[(3) - (4)].arg_list).args) free((yyvsp[(3) - (4)].arg_list).args); @@ -2202,49 +2225,54 @@ yyreduce: break; case 49: -#line 396 "magic-interpreter-parser.y" +#line 401 "magic-interpreter-parser.y" { (yyval.expr) = (yyvsp[(2) - (3)].expr); ;} break; case 50: -#line 400 "magic-interpreter-parser.y" - { (yyval.arg_list).args_nr = 0; ;} +#line 403 "magic-interpreter-parser.y" + { (yyval.expr) = dot_expr((yyvsp[(1) - (3)].expr), intern_id((yyvsp[(3) - (3)].s))); ;} break; case 51: -#line 402 "magic-interpreter-parser.y" - { (yyval.arg_list) = (yyvsp[(1) - (1)].arg_list) ;} +#line 407 "magic-interpreter-parser.y" + { (yyval.arg_list).args_nr = 0; ;} break; case 52: -#line 407 "magic-interpreter-parser.y" +#line 409 "magic-interpreter-parser.y" + { (yyval.arg_list) = (yyvsp[(1) - (1)].arg_list) ;} + break; + + case 53: +#line 414 "magic-interpreter-parser.y" { (yyval.arg_list).args = aCalloc(sizeof(expr_t *), 1); (yyval.arg_list).args_nr = 1; (yyval.arg_list).args[0] = (yyvsp[(1) - (1)].expr); ;} break; - case 53: -#line 412 "magic-interpreter-parser.y" + case 54: +#line 419 "magic-interpreter-parser.y" { (yyval.arg_list).args = realloc((yyval.arg_list).args, (1 + (yyval.arg_list).args_nr) * sizeof(expr_t *)); (yyval.arg_list).args[(yyval.arg_list).args_nr++] = (yyvsp[(3) - (3)].expr); ;} break; - case 54: -#line 419 "magic-interpreter-parser.y" + case 55: +#line 426 "magic-interpreter-parser.y" { (yyval.location).m = (yyvsp[(3) - (8)].expr); (yyval.location).x = (yyvsp[(5) - (8)].expr); (yyval.location).y = (yyvsp[(7) - (8)].expr); ;} break; - case 55: -#line 423 "magic-interpreter-parser.y" + case 56: +#line 430 "magic-interpreter-parser.y" { (yyval.area).ty = AREA_LOCATION; (yyval.area).a.a_loc = (yyvsp[(1) - (1)].location); ;} break; - case 56: -#line 427 "magic-interpreter-parser.y" + case 57: +#line 434 "magic-interpreter-parser.y" { (yyval.area).ty = AREA_RECT; (yyval.area).a.a_rect.loc = (yyvsp[(1) - (8)].location); (yyval.area).a.a_rect.width = (yyvsp[(5) - (8)].expr); @@ -2252,8 +2280,8 @@ yyreduce: ;} break; - case 57: -#line 433 "magic-interpreter-parser.y" + case 58: +#line 440 "magic-interpreter-parser.y" { (yyval.area).ty = AREA_BAR; (yyval.area).a.a_bar.loc = (yyvsp[(1) - (9)].location); (yyval.area).a.a_bar.width = (yyvsp[(6) - (9)].expr); @@ -2262,13 +2290,13 @@ yyreduce: ;} break; - case 58: -#line 443 "magic-interpreter-parser.y" + case 59: +#line 450 "magic-interpreter-parser.y" { (yyval.spell) = new_spell((yyvsp[(1) - (1)].spellguard)); ;} break; - case 59: -#line 445 "magic-interpreter-parser.y" + case 60: +#line 452 "magic-interpreter-parser.y" { (yyval.spell) = new_spell((yyvsp[(4) - (4)].spellguard)); (yyval.spell)->letdefs_nr = (yyvsp[(2) - (4)].letdefs).letdefs_nr; (yyval.spell)->letdefs = (yyvsp[(2) - (4)].letdefs).letdefs; @@ -2276,15 +2304,15 @@ yyreduce: ;} break; - case 60: -#line 454 "magic-interpreter-parser.y" + case 61: +#line 461 "magic-interpreter-parser.y" { (yyval.letdefs).letdefs_nr = 0; (yyval.letdefs).letdefs = (letdef_t *) malloc(1); ;} break; - case 61: -#line 458 "magic-interpreter-parser.y" + case 62: +#line 465 "magic-interpreter-parser.y" { (yyval.letdefs) = (yyvsp[(1) - (3)].letdefs); (yyval.letdefs).letdefs_nr++; (yyval.letdefs).letdefs = realloc((yyval.letdefs).letdefs, sizeof(letdef_t) * (yyval.letdefs).letdefs_nr); @@ -2292,8 +2320,8 @@ yyreduce: ;} break; - case 62: -#line 467 "magic-interpreter-parser.y" + case 63: +#line 474 "magic-interpreter-parser.y" { if (find_constant((yyvsp[(1) - (3)].s))) { fail((yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column, "Attempt to re-define constant `%s' as LET-bound variable.\n", (yyvsp[(1) - (3)].s)); @@ -2305,13 +2333,13 @@ yyreduce: ;} break; - case 63: -#line 480 "magic-interpreter-parser.y" + case 64: +#line 487 "magic-interpreter-parser.y" { (yyval.spellguard) = (yyvsp[(1) - (1)].spellguard); ;} break; - case 64: -#line 482 "magic-interpreter-parser.y" + case 65: +#line 489 "magic-interpreter-parser.y" { spellguard_t *sg = new_spellguard(SPELLGUARD_CHOICE); sg->next = (yyvsp[(1) - (3)].spellguard); sg->s.s_alt = (yyvsp[(3) - (3)].spellguard); @@ -2319,18 +2347,18 @@ yyreduce: ;} break; - case 65: -#line 491 "magic-interpreter-parser.y" + case 66: +#line 498 "magic-interpreter-parser.y" { (yyval.spellguard) = spellguard_implication((yyvsp[(1) - (3)].spellguard), (yyvsp[(3) - (3)].spellguard)); ;} break; - case 66: -#line 493 "magic-interpreter-parser.y" + case 67: +#line 500 "magic-interpreter-parser.y" { (yyval.spellguard) = (yyvsp[(2) - (3)].spellguard); ;} break; - case 67: -#line 495 "magic-interpreter-parser.y" + case 68: +#line 502 "magic-interpreter-parser.y" { spellguard_t *sg = new_spellguard(SPELLGUARD_EFFECT); sg->s.s_effect.effect = (yyvsp[(2) - (4)].effect); sg->s.s_effect.at_trigger = (yyvsp[(3) - (4)].effect); @@ -2339,33 +2367,33 @@ yyreduce: ;} break; - case 68: -#line 505 "magic-interpreter-parser.y" + case 69: +#line 512 "magic-interpreter-parser.y" { (yyval.effect) = NULL; ;} break; - case 69: -#line 507 "magic-interpreter-parser.y" + case 70: +#line 514 "magic-interpreter-parser.y" { (yyval.effect) = (yyvsp[(2) - (2)].effect); ;} break; - case 70: -#line 512 "magic-interpreter-parser.y" + case 71: +#line 519 "magic-interpreter-parser.y" { (yyval.effect) = NULL; ;} break; - case 71: -#line 514 "magic-interpreter-parser.y" + case 72: +#line 521 "magic-interpreter-parser.y" { (yyval.effect) = (yyvsp[(2) - (2)].effect); ;} break; - case 72: -#line 519 "magic-interpreter-parser.y" + case 73: +#line 526 "magic-interpreter-parser.y" { (yyval.spellguard) = (yyvsp[(1) - (1)].spellguard); ;} break; - case 73: -#line 521 "magic-interpreter-parser.y" + case 74: +#line 528 "magic-interpreter-parser.y" { spellguard_t *sg = new_spellguard(SPELLGUARD_CHOICE); sg->next = (yyvsp[(1) - (3)].spellguard); sg->s.s_alt = (yyvsp[(3) - (3)].spellguard); @@ -2373,87 +2401,87 @@ yyreduce: ;} break; - case 74: -#line 527 "magic-interpreter-parser.y" + case 75: +#line 534 "magic-interpreter-parser.y" { (yyval.spellguard) = (yyvsp[(2) - (3)].spellguard); ;} break; - case 75: -#line 532 "magic-interpreter-parser.y" + case 76: +#line 539 "magic-interpreter-parser.y" { (yyval.spellguard) = (yyvsp[(1) - (1)].spellguard); ;} break; - case 76: -#line 534 "magic-interpreter-parser.y" + case 77: +#line 541 "magic-interpreter-parser.y" { (yyval.spellguard) = spellguard_implication ((yyvsp[(1) - (3)].spellguard), (yyvsp[(3) - (3)].spellguard)); ;} break; - case 77: -#line 539 "magic-interpreter-parser.y" + case 78: +#line 546 "magic-interpreter-parser.y" { (yyval.spellguard) = new_spellguard(SPELLGUARD_CONDITION); (yyval.spellguard)->s.s_condition = (yyvsp[(2) - (2)].expr); ;} break; - case 78: -#line 543 "magic-interpreter-parser.y" + case 79: +#line 550 "magic-interpreter-parser.y" { (yyval.spellguard) = new_spellguard(SPELLGUARD_CATALYSTS); (yyval.spellguard)->s.s_catalysts = (yyvsp[(2) - (2)].components); ;} break; - case 79: -#line 547 "magic-interpreter-parser.y" + case 80: +#line 554 "magic-interpreter-parser.y" { (yyval.spellguard) = new_spellguard(SPELLGUARD_COMPONENTS); (yyval.spellguard)->s.s_components = (yyvsp[(2) - (2)].components); ;} break; - case 80: -#line 551 "magic-interpreter-parser.y" + case 81: +#line 558 "magic-interpreter-parser.y" { (yyval.spellguard) = new_spellguard(SPELLGUARD_MANA); (yyval.spellguard)->s.s_mana = (yyvsp[(2) - (2)].expr); ;} break; - case 81: -#line 555 "magic-interpreter-parser.y" + case 82: +#line 562 "magic-interpreter-parser.y" { (yyval.spellguard) = new_spellguard(SPELLGUARD_CASTTIME); (yyval.spellguard)->s.s_casttime = (yyvsp[(2) - (2)].expr); ;} break; - case 82: -#line 562 "magic-interpreter-parser.y" + case 83: +#line 569 "magic-interpreter-parser.y" { (yyval.components) = (yyvsp[(2) - (3)].components); ;} break; - case 83: -#line 567 "magic-interpreter-parser.y" + case 84: +#line 574 "magic-interpreter-parser.y" { (yyval.components) = NULL; magic_add_component(&(yyval.components), (yyvsp[(1) - (1)].component).id, (yyvsp[(1) - (1)].component).count); ;} break; - case 84: -#line 571 "magic-interpreter-parser.y" + case 85: +#line 578 "magic-interpreter-parser.y" { (yyval.components) = (yyvsp[(1) - (3)].components); magic_add_component(&(yyval.components), (yyvsp[(3) - (3)].component).id, (yyvsp[(3) - (3)].component).count); ;} break; - case 85: -#line 578 "magic-interpreter-parser.y" + case 86: +#line 585 "magic-interpreter-parser.y" { (yyval.component).id = (yyvsp[(3) - (3)].i); (yyval.component).count = (yyvsp[(1) - (3)].i); ;} break; - case 86: -#line 580 "magic-interpreter-parser.y" + case 87: +#line 587 "magic-interpreter-parser.y" { (yyval.component).id = (yyvsp[(1) - (1)].i); (yyval.component).count = 1; ;} break; - case 87: -#line 585 "magic-interpreter-parser.y" + case 88: +#line 592 "magic-interpreter-parser.y" { struct item_data *item = itemdb_searchname((yyvsp[(1) - (1)].s)); if (!item) { fail ((yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column, "Unknown item `%s'\n", (yyvsp[(1) - (1)].s)); @@ -2464,63 +2492,63 @@ yyreduce: ;} break; - case 88: -#line 594 "magic-interpreter-parser.y" + case 89: +#line 601 "magic-interpreter-parser.y" { (yyval.i) = (yyvsp[(1) - (1)].i); ;} break; - case 89: -#line 599 "magic-interpreter-parser.y" + case 90: +#line 606 "magic-interpreter-parser.y" { (yyval.i) = FOREACH_FILTER_PC; ;} break; - case 90: -#line 601 "magic-interpreter-parser.y" + case 91: +#line 608 "magic-interpreter-parser.y" { (yyval.i) = FOREACH_FILTER_MOB; ;} break; - case 91: -#line 603 "magic-interpreter-parser.y" + case 92: +#line 610 "magic-interpreter-parser.y" { (yyval.i) = FOREACH_FILTER_ENTITY; ;} break; - case 92: -#line 605 "magic-interpreter-parser.y" + case 93: +#line 612 "magic-interpreter-parser.y" { (yyval.i) = FOREACH_FILTER_SPELL; ;} break; - case 93: -#line 607 "magic-interpreter-parser.y" + case 94: +#line 614 "magic-interpreter-parser.y" { (yyval.i) = FOREACH_FILTER_TARGET; ;} break; - case 94: -#line 612 "magic-interpreter-parser.y" + case 95: +#line 619 "magic-interpreter-parser.y" { (yyval.effect) = (yyvsp[(2) - (3)].effect); ;} break; - case 95: -#line 614 "magic-interpreter-parser.y" + case 96: +#line 621 "magic-interpreter-parser.y" { (yyval.effect) = new_effect(EFFECT_SKIP); ;} break; - case 96: -#line 616 "magic-interpreter-parser.y" + case 97: +#line 623 "magic-interpreter-parser.y" { (yyval.effect) = new_effect(EFFECT_ABORT); ;} break; - case 97: -#line 618 "magic-interpreter-parser.y" + case 98: +#line 625 "magic-interpreter-parser.y" { (yyval.effect) = new_effect(EFFECT_END); ;} break; - case 98: -#line 620 "magic-interpreter-parser.y" + case 99: +#line 627 "magic-interpreter-parser.y" { (yyval.effect) = new_effect(EFFECT_BREAK); ;} break; - case 99: -#line 622 "magic-interpreter-parser.y" + case 100: +#line 629 "magic-interpreter-parser.y" { if (find_constant((yyvsp[(1) - (4)].s))) { fail((yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column, "Attempt to re-define constant `%s' in assignment.", (yyvsp[(1) - (4)].s)); @@ -2533,8 +2561,8 @@ yyreduce: ;} break; - case 100: -#line 633 "magic-interpreter-parser.y" + case 101: +#line 640 "magic-interpreter-parser.y" { (yyval.effect) = new_effect(EFFECT_FOREACH); (yyval.effect)->e.e_foreach.id = intern_id((yyvsp[(3) - (7)].s)); (yyval.effect)->e.e_foreach.area = (yyvsp[(5) - (7)].expr); @@ -2543,8 +2571,8 @@ yyreduce: ;} break; - case 101: -#line 640 "magic-interpreter-parser.y" + case 102: +#line 647 "magic-interpreter-parser.y" { (yyval.effect) = new_effect(EFFECT_FOR); (yyval.effect)->e.e_for.id = intern_id((yyvsp[(2) - (8)].s)); (yyval.effect)->e.e_for.start = (yyvsp[(4) - (8)].expr); @@ -2553,8 +2581,8 @@ yyreduce: ;} break; - case 102: -#line 647 "magic-interpreter-parser.y" + case 103: +#line 654 "magic-interpreter-parser.y" { (yyval.effect) = new_effect(EFFECT_IF); (yyval.effect)->e.e_if.cond = (yyvsp[(2) - (6)].expr); (yyval.effect)->e.e_if.true_branch = (yyvsp[(4) - (6)].effect); @@ -2562,8 +2590,8 @@ yyreduce: ;} break; - case 103: -#line 653 "magic-interpreter-parser.y" + case 104: +#line 660 "magic-interpreter-parser.y" { (yyval.effect) = new_effect(EFFECT_IF); (yyval.effect)->e.e_if.cond = (yyvsp[(2) - (4)].expr); (yyval.effect)->e.e_if.true_branch = (yyvsp[(4) - (4)].effect); @@ -2571,22 +2599,22 @@ yyreduce: ;} break; - case 104: -#line 659 "magic-interpreter-parser.y" + case 105: +#line 666 "magic-interpreter-parser.y" { (yyval.effect) = new_effect(EFFECT_SLEEP); (yyval.effect)->e.e_sleep = (yyvsp[(2) - (3)].expr); ;} break; - case 105: -#line 663 "magic-interpreter-parser.y" + case 106: +#line 670 "magic-interpreter-parser.y" { (yyval.effect) = op_effect((yyvsp[(1) - (5)].s), (yyvsp[(3) - (5)].arg_list).args_nr, (yyvsp[(3) - (5)].arg_list).args, (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column); free((yyvsp[(1) - (5)].s)); ;} break; - case 106: -#line 667 "magic-interpreter-parser.y" + case 107: +#line 674 "magic-interpreter-parser.y" { (yyval.effect) = new_effect(EFFECT_SCRIPT); (yyval.effect)->e.e_script = parse_script((unsigned char *) (yyvsp[(1) - (1)].s), (yylsp[(1) - (1)]).first_line); free((yyvsp[(1) - (1)].s)); @@ -2595,26 +2623,26 @@ yyreduce: ;} break; - case 107: -#line 674 "magic-interpreter-parser.y" + case 108: +#line 681 "magic-interpreter-parser.y" { (yyval.effect) = call_proc((yyvsp[(2) - (6)].s), (yyvsp[(4) - (6)].arg_list).args_nr, (yyvsp[(4) - (6)].arg_list).args, (yylsp[(1) - (6)]).first_line, (yylsp[(1) - (6)]).first_column); free((yyvsp[(2) - (6)].s)); ;} break; - case 108: -#line 680 "magic-interpreter-parser.y" + case 109: +#line 687 "magic-interpreter-parser.y" { (yyval.effect) = new_effect(EFFECT_SKIP); ;} break; - case 109: -#line 682 "magic-interpreter-parser.y" + case 110: +#line 689 "magic-interpreter-parser.y" { (yyval.effect) = set_effect_continuation((yyvsp[(1) - (3)].effect), (yyvsp[(3) - (3)].effect)); ;} break; /* Line 1267 of yacc.c. */ -#line 2618 "magic-interpreter-parser.c" +#line 2646 "magic-interpreter-parser.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -2834,7 +2862,7 @@ yyreturn: } -#line 686 "magic-interpreter-parser.y" +#line 693 "magic-interpreter-parser.y" /* We do incremental realloc here to store our results. Since this happens only once @@ -2921,6 +2949,16 @@ fail(int line, int column, char *fmt, ...) } static expr_t * +dot_expr(expr_t *expr, int id) +{ + expr_t *retval = magic_new_expr(EXPR_SPELLFIELD); + retval->e.e_field.id = id; + retval->e.e_field.expr = expr; + + return retval; +} + +static expr_t * fun_expr(char *name, int args_nr, expr_t **args, int line, int column) { int id; @@ -2956,7 +2994,10 @@ fun_expr(char *name, int args_nr, expr_t **args, int line, int column) static spell_t * new_spell(spellguard_t *guard) { + static int spell_counter = 0; + spell_t *retval = calloc(1, sizeof(spell_t)); + retval->index = ++spell_counter; retval->spellguard = guard; return retval; } |