diff options
-rw-r--r-- | engines/director/lingo/lingo-code.cpp | 14 | ||||
-rw-r--r-- | engines/director/lingo/lingo-codegen.cpp | 1 | ||||
-rw-r--r-- | engines/director/lingo/lingo-gr.cpp | 983 | ||||
-rw-r--r-- | engines/director/lingo/lingo-gr.y | 15 | ||||
-rw-r--r-- | engines/director/lingo/lingo.h | 1 |
5 files changed, 528 insertions, 486 deletions
diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp index 014cec5a78..8c199bb0df 100644 --- a/engines/director/lingo/lingo-code.cpp +++ b/engines/director/lingo/lingo-code.cpp @@ -92,6 +92,7 @@ static struct FuncDescr { { Lingo::c_repeatwhilecode,"c_repeatwhilecode","oo" }, { Lingo::c_repeatwithcode,"c_repeatwithcode","ooooos" }, { Lingo::c_ifcode, "c_ifcode", "oooi" }, + { Lingo::c_whencode, "c_whencode", "os" }, { Lingo::c_goto, "c_goto", "" }, { Lingo::c_gotoloop, "c_gotoloop", "" }, { Lingo::c_gotonext, "c_gotonext", "" }, @@ -721,6 +722,19 @@ void Lingo::c_ifcode() { debug(8, "Skipped end"); } +void Lingo::c_whencode() { + Datum d; + int start = g_lingo->_pc + 1; + int end = READ_UINT32(&(*g_lingo->_currentScript)[start]); + Common::String eventname((char *)&(*g_lingo->_currentScript)[start]); + + start += g_lingo->calcStringAlignment(eventname.c_str()); + + warning("STUB: c_whencode([%5d][%5d], %s)", start, end, eventname.c_str()); + + g_lingo->_pc = end; +} + //************************ // Built-in functions //************************ diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp index 9390a8b7f9..ac90e62688 100644 --- a/engines/director/lingo/lingo-codegen.cpp +++ b/engines/director/lingo/lingo-codegen.cpp @@ -78,6 +78,7 @@ Common::String Lingo::decodeInstruction(int pc) { inst i; while (*pars) { + warning("--- %d of %d -- %s", pc, _currentScript->size(), res.c_str()); switch (*pars++) { case 'i': { diff --git a/engines/director/lingo/lingo-gr.cpp b/engines/director/lingo/lingo-gr.cpp index ab857b6c0c..89c0e3cbfe 100644 --- a/engines/director/lingo/lingo-gr.cpp +++ b/engines/director/lingo/lingo-gr.cpp @@ -486,18 +486,18 @@ union yyalloc #endif /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 87 +#define YYFINAL 88 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 921 +#define YYLAST 931 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 83 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 35 +#define YYNNTS 36 /* YYNRULES -- Number of rules. */ -#define YYNRULES 124 +#define YYNRULES 125 /* YYNRULES -- Number of states. */ -#define YYNSTATES 259 +#define YYNSTATES 261 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -551,69 +551,69 @@ static const yytype_uint16 yyprhs[] = { 0, 0, 3, 7, 9, 12, 14, 15, 17, 19, 21, 23, 25, 30, 35, 40, 46, 51, 56, 62, - 64, 66, 68, 70, 79, 91, 104, 109, 118, 130, - 142, 149, 160, 171, 172, 176, 179, 181, 184, 186, - 193, 195, 201, 203, 207, 211, 214, 218, 220, 222, - 223, 224, 225, 228, 231, 233, 235, 237, 239, 244, - 246, 248, 251, 253, 257, 261, 265, 269, 273, 277, - 281, 285, 289, 293, 297, 300, 304, 308, 312, 316, - 319, 322, 326, 331, 336, 339, 341, 343, 345, 348, - 351, 354, 356, 359, 364, 367, 369, 373, 376, 379, - 382, 385, 389, 392, 395, 397, 401, 404, 407, 410, - 414, 417, 418, 427, 430, 431, 440, 441, 443, 447, - 452, 453, 457, 458, 460 + 64, 66, 68, 70, 79, 91, 104, 108, 117, 129, + 141, 148, 159, 170, 171, 175, 178, 180, 183, 185, + 192, 194, 200, 202, 206, 210, 213, 217, 219, 221, + 222, 223, 224, 227, 230, 234, 236, 238, 240, 242, + 247, 249, 251, 254, 256, 260, 264, 268, 272, 276, + 280, 284, 288, 292, 296, 300, 303, 307, 311, 315, + 319, 322, 325, 329, 334, 339, 342, 344, 346, 348, + 351, 354, 357, 359, 362, 367, 370, 372, 376, 379, + 382, 385, 388, 392, 395, 398, 400, 404, 407, 410, + 413, 417, 420, 421, 430, 433, 434, 443, 444, 446, + 450, 455, 456, 460, 461, 463 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { 84, 0, -1, 84, 85, 86, -1, 86, -1, 1, - 85, -1, 76, -1, -1, 111, -1, 105, -1, 116, - -1, 87, -1, 89, -1, 40, 104, 33, 21, -1, - 42, 21, 70, 104, -1, 42, 13, 70, 104, -1, - 42, 14, 104, 70, 104, -1, 42, 21, 44, 104, - -1, 42, 13, 44, 104, -1, 42, 14, 104, 44, - 104, -1, 104, -1, 105, -1, 88, -1, 90, -1, + 85, -1, 76, -1, -1, 112, -1, 106, -1, 117, + -1, 87, -1, 89, -1, 40, 105, 33, 21, -1, + 42, 21, 70, 105, -1, 42, 13, 70, 105, -1, + 42, 14, 105, 70, 105, -1, 42, 21, 44, 105, + -1, 42, 13, 44, 105, -1, 42, 14, 105, 44, + 105, -1, 105, -1, 106, -1, 88, -1, 90, -1, 97, 77, 96, 78, 103, 102, 27, 41, -1, 98, - 70, 104, 102, 44, 104, 102, 103, 102, 27, 41, - -1, 98, 70, 104, 102, 24, 44, 104, 102, 103, - 102, 27, 41, -1, 45, 21, 43, 104, -1, 99, - 96, 43, 85, 103, 102, 27, 32, -1, 99, 96, - 43, 85, 103, 102, 48, 103, 102, 27, 32, -1, - 99, 96, 43, 85, 103, 102, 101, 92, 102, 27, - 32, -1, 99, 96, 43, 101, 88, 102, -1, 99, - 96, 43, 101, 88, 102, 48, 101, 88, 102, -1, - 99, 96, 43, 101, 88, 102, 93, 102, 91, 102, - -1, -1, 48, 101, 88, -1, 92, 95, -1, 95, - -1, 93, 94, -1, 94, -1, 100, 96, 43, 101, - 89, 102, -1, 93, -1, 100, 96, 43, 103, 102, - -1, 104, -1, 104, 70, 104, -1, 77, 96, 78, - -1, 41, 47, -1, 41, 46, 21, -1, 32, -1, - 26, -1, -1, -1, -1, 103, 85, -1, 103, 89, - -1, 12, -1, 15, -1, 22, -1, 17, -1, 21, - 77, 117, 78, -1, 21, -1, 13, -1, 14, 104, - -1, 87, -1, 104, 71, 104, -1, 104, 72, 104, - -1, 104, 73, 104, -1, 104, 74, 104, -1, 104, - 79, 104, -1, 104, 80, 104, -1, 104, 60, 104, - -1, 104, 55, 104, -1, 104, 56, 104, -1, 104, - 61, 104, -1, 104, 62, 104, -1, 63, 104, -1, - 104, 81, 104, -1, 104, 64, 104, -1, 104, 65, - 104, -1, 104, 66, 104, -1, 71, 104, -1, 72, - 104, -1, 77, 104, 78, -1, 67, 104, 68, 104, - -1, 67, 104, 69, 104, -1, 40, 104, -1, 107, - -1, 110, -1, 28, -1, 30, 106, -1, 19, 104, - -1, 18, 104, -1, 18, -1, 20, 117, -1, 51, - 104, 46, 104, -1, 51, 104, -1, 21, -1, 106, - 82, 21, -1, 31, 34, -1, 31, 37, -1, 31, - 39, -1, 31, 108, -1, 31, 108, 109, -1, 31, - 109, -1, 29, 104, -1, 104, -1, 38, 36, 104, - -1, 36, 104, -1, 52, 53, -1, 52, 108, -1, - 52, 108, 109, -1, 52, 109, -1, -1, 35, 21, - 112, 101, 114, 85, 115, 103, -1, 49, 21, -1, - -1, 50, 21, 113, 101, 114, 85, 115, 103, -1, - -1, 21, -1, 114, 82, 21, -1, 114, 85, 82, - 21, -1, -1, 21, 101, 117, -1, -1, 104, -1, - 117, 82, 104, -1 + 70, 105, 102, 44, 105, 102, 103, 102, 27, 41, + -1, 98, 70, 105, 102, 24, 44, 105, 102, 103, + 102, 27, 41, -1, 104, 105, 102, -1, 99, 96, + 43, 85, 103, 102, 27, 32, -1, 99, 96, 43, + 85, 103, 102, 48, 103, 102, 27, 32, -1, 99, + 96, 43, 85, 103, 102, 101, 92, 102, 27, 32, + -1, 99, 96, 43, 101, 88, 102, -1, 99, 96, + 43, 101, 88, 102, 48, 101, 88, 102, -1, 99, + 96, 43, 101, 88, 102, 93, 102, 91, 102, -1, + -1, 48, 101, 88, -1, 92, 95, -1, 95, -1, + 93, 94, -1, 94, -1, 100, 96, 43, 101, 89, + 102, -1, 93, -1, 100, 96, 43, 103, 102, -1, + 105, -1, 105, 70, 105, -1, 77, 96, 78, -1, + 41, 47, -1, 41, 46, 21, -1, 32, -1, 26, + -1, -1, -1, -1, 103, 85, -1, 103, 89, -1, + 45, 21, 43, -1, 12, -1, 15, -1, 22, -1, + 17, -1, 21, 77, 118, 78, -1, 21, -1, 13, + -1, 14, 105, -1, 87, -1, 105, 71, 105, -1, + 105, 72, 105, -1, 105, 73, 105, -1, 105, 74, + 105, -1, 105, 79, 105, -1, 105, 80, 105, -1, + 105, 60, 105, -1, 105, 55, 105, -1, 105, 56, + 105, -1, 105, 61, 105, -1, 105, 62, 105, -1, + 63, 105, -1, 105, 81, 105, -1, 105, 64, 105, + -1, 105, 65, 105, -1, 105, 66, 105, -1, 71, + 105, -1, 72, 105, -1, 77, 105, 78, -1, 67, + 105, 68, 105, -1, 67, 105, 69, 105, -1, 40, + 105, -1, 108, -1, 111, -1, 28, -1, 30, 107, + -1, 19, 105, -1, 18, 105, -1, 18, -1, 20, + 118, -1, 51, 105, 46, 105, -1, 51, 105, -1, + 21, -1, 107, 82, 21, -1, 31, 34, -1, 31, + 37, -1, 31, 39, -1, 31, 109, -1, 31, 109, + 110, -1, 31, 110, -1, 29, 105, -1, 105, -1, + 38, 36, 105, -1, 36, 105, -1, 52, 53, -1, + 52, 109, -1, 52, 109, 110, -1, 52, 110, -1, + -1, 35, 21, 113, 101, 115, 85, 116, 103, -1, + 49, 21, -1, -1, 50, 21, 114, 101, 115, 85, + 116, 103, -1, -1, 21, -1, 115, 82, 21, -1, + 115, 85, 82, 21, -1, -1, 21, 101, 118, -1, + -1, 105, -1, 118, 82, 105, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -621,17 +621,17 @@ static const yytype_uint16 yyrline[] = { 0, 103, 103, 104, 105, 108, 113, 114, 115, 116, 117, 118, 121, 127, 133, 141, 149, 155, 163, 172, - 173, 175, 176, 181, 192, 208, 220, 225, 232, 241, - 250, 260, 270, 281, 282, 285, 286, 289, 290, 293, - 301, 302, 310, 311, 312, 314, 316, 322, 328, 335, - 337, 339, 340, 341, 344, 345, 348, 351, 355, 358, - 362, 369, 375, 376, 377, 378, 379, 380, 381, 382, - 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 399, 400, 401, 402, 404, 405, - 408, 411, 414, 415, 416, 419, 420, 431, 432, 433, - 434, 437, 440, 445, 446, 449, 450, 453, 454, 457, - 460, 490, 490, 496, 499, 499, 504, 505, 506, 507, - 509, 513, 521, 522, 523 + 173, 175, 176, 181, 192, 208, 220, 228, 235, 244, + 253, 263, 273, 284, 285, 288, 289, 292, 293, 296, + 304, 305, 313, 314, 315, 317, 319, 325, 331, 338, + 340, 342, 343, 344, 347, 353, 354, 357, 360, 364, + 367, 371, 378, 384, 385, 386, 387, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 408, 409, 410, 411, 413, + 414, 417, 420, 423, 424, 425, 428, 429, 440, 441, + 442, 443, 446, 449, 454, 455, 458, 459, 462, 463, + 466, 469, 499, 499, 505, 508, 508, 513, 514, 515, + 516, 518, 522, 530, 531, 532 }; #endif @@ -655,9 +655,9 @@ static const char *const yytname[] = "programline", "asgn", "stmtoneliner", "stmt", "ifstmt", "elsestmtoneliner", "elseifstmt", "elseifstmtoneliner", "elseifstmtoneliner1", "elseifstmt1", "cond", "repeatwhile", - "repeatwith", "if", "elseif", "begin", "end", "stmtlist", "expr", "func", - "globallist", "gotofunc", "gotoframe", "gotomovie", "playfunc", "defn", - "@1", "@2", "argdef", "argstore", "macro", "arglist", 0 + "repeatwith", "if", "elseif", "begin", "end", "stmtlist", "when", "expr", + "func", "globallist", "gotofunc", "gotoframe", "gotomovie", "playfunc", + "defn", "@1", "@2", "argdef", "argstore", "macro", "arglist", 0 }; #endif @@ -686,14 +686,14 @@ static const yytype_uint8 yyr1[] = 88, 89, 89, 89, 89, 89, 89, 90, 90, 90, 90, 90, 90, 91, 91, 92, 92, 93, 93, 94, 95, 95, 96, 96, 96, 97, 98, 99, 100, 101, - 102, 103, 103, 103, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 105, 105, 105, 105, 105, 105, - 105, 105, 105, 105, 105, 106, 106, 107, 107, 107, - 107, 107, 107, 108, 108, 109, 109, 110, 110, 110, - 110, 112, 111, 111, 113, 111, 114, 114, 114, 114, - 115, 116, 117, 117, 117 + 102, 103, 103, 103, 104, 105, 105, 105, 105, 105, + 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, + 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, + 105, 105, 105, 105, 105, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 107, 107, 108, 108, + 108, 108, 108, 108, 109, 109, 110, 110, 111, 111, + 111, 111, 113, 112, 112, 114, 112, 115, 115, 115, + 115, 116, 117, 118, 118, 118 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -701,17 +701,17 @@ static const yytype_uint8 yyr2[] = { 0, 2, 3, 1, 2, 1, 0, 1, 1, 1, 1, 1, 4, 4, 4, 5, 4, 4, 5, 1, - 1, 1, 1, 8, 11, 12, 4, 8, 11, 11, + 1, 1, 1, 8, 11, 12, 3, 8, 11, 11, 6, 10, 10, 0, 3, 2, 1, 2, 1, 6, 1, 5, 1, 3, 3, 2, 3, 1, 1, 0, - 0, 0, 2, 2, 1, 1, 1, 1, 4, 1, - 1, 2, 1, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, - 2, 3, 4, 4, 2, 1, 1, 1, 2, 2, - 2, 1, 2, 4, 2, 1, 3, 2, 2, 2, - 2, 3, 2, 2, 1, 3, 2, 2, 2, 3, - 2, 0, 8, 2, 0, 8, 0, 1, 3, 4, - 0, 3, 0, 1, 3 + 0, 0, 2, 2, 3, 1, 1, 1, 1, 4, + 1, 1, 2, 1, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, + 2, 2, 3, 4, 4, 2, 1, 1, 1, 2, + 2, 2, 1, 2, 4, 2, 1, 3, 2, 2, + 2, 2, 3, 2, 2, 1, 3, 2, 2, 2, + 3, 2, 0, 8, 2, 0, 8, 0, 1, 3, + 4, 0, 3, 0, 1, 3 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -719,259 +719,263 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 0, 0, 54, 60, 0, 55, 57, 91, 0, 122, - 49, 56, 87, 0, 0, 47, 0, 0, 0, 0, + 0, 0, 55, 61, 0, 56, 58, 92, 0, 123, + 49, 57, 88, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 3, 62, 21, 11, 22, 0, 0, 0, 19, - 8, 85, 86, 7, 9, 5, 4, 59, 0, 62, - 61, 90, 89, 123, 92, 122, 122, 95, 88, 0, - 97, 0, 98, 0, 99, 104, 100, 102, 111, 84, - 0, 45, 0, 0, 0, 0, 113, 114, 94, 107, - 108, 110, 74, 0, 79, 80, 0, 1, 6, 0, - 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, + 0, 3, 63, 21, 11, 22, 0, 0, 0, 0, + 19, 8, 86, 87, 7, 9, 5, 4, 60, 0, + 63, 62, 91, 90, 124, 93, 123, 123, 96, 89, + 0, 98, 0, 99, 0, 100, 105, 101, 103, 112, + 85, 0, 45, 0, 0, 0, 0, 114, 115, 95, + 108, 109, 111, 75, 0, 80, 81, 0, 1, 6, + 0, 0, 0, 0, 42, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 121, 0, 103, 106, 0, 101, 49, 0, - 46, 0, 0, 0, 0, 0, 0, 49, 0, 109, - 0, 0, 81, 2, 0, 50, 0, 0, 49, 0, - 70, 71, 69, 72, 73, 76, 77, 78, 63, 64, - 65, 66, 67, 68, 75, 124, 58, 96, 105, 116, - 12, 17, 14, 0, 0, 16, 13, 26, 116, 93, - 82, 83, 51, 0, 44, 51, 0, 43, 117, 0, - 18, 15, 0, 50, 0, 0, 50, 50, 20, 0, - 120, 120, 52, 53, 0, 0, 50, 49, 30, 118, - 0, 51, 51, 0, 50, 51, 0, 51, 0, 48, - 49, 50, 38, 0, 119, 112, 115, 23, 51, 50, - 27, 50, 50, 40, 36, 0, 0, 37, 33, 0, - 50, 0, 0, 35, 0, 0, 50, 49, 50, 49, - 0, 0, 0, 0, 49, 31, 0, 32, 0, 0, - 24, 28, 29, 50, 34, 50, 25, 41, 39 + 0, 0, 0, 0, 122, 0, 104, 107, 0, 102, + 49, 0, 46, 0, 0, 0, 0, 0, 54, 49, + 0, 110, 0, 0, 82, 2, 0, 50, 0, 0, + 49, 0, 26, 71, 72, 70, 73, 74, 77, 78, + 79, 64, 65, 66, 67, 68, 69, 76, 125, 59, + 97, 106, 117, 12, 17, 14, 0, 0, 16, 13, + 117, 94, 83, 84, 51, 0, 44, 51, 0, 43, + 118, 0, 18, 15, 0, 50, 0, 0, 50, 50, + 20, 0, 121, 121, 52, 53, 0, 0, 50, 49, + 30, 119, 0, 51, 51, 0, 50, 51, 0, 51, + 0, 48, 49, 50, 38, 0, 120, 113, 116, 23, + 51, 50, 27, 50, 50, 40, 36, 0, 0, 37, + 33, 0, 50, 0, 0, 35, 0, 0, 50, 49, + 50, 49, 0, 0, 0, 0, 49, 31, 0, 32, + 0, 0, 24, 28, 29, 50, 34, 50, 25, 41, + 39 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 30, 192, 31, 49, 33, 193, 35, 238, 222, - 223, 212, 224, 92, 36, 37, 38, 213, 248, 173, - 183, 39, 188, 58, 41, 66, 67, 42, 43, 118, - 127, 179, 201, 44, 54 + -1, 30, 194, 31, 50, 33, 195, 35, 240, 224, + 225, 214, 226, 93, 36, 37, 38, 215, 250, 142, + 185, 39, 40, 190, 59, 42, 67, 68, 43, 44, + 120, 129, 181, 203, 45, 55 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -198 +#define YYPACT_NINF -195 static const yytype_int16 yypact[] = { - 243, -53, -198, -198, 385, -198, -198, 385, 385, 385, - 791, -198, -198, 18, 573, -198, 22, 385, 7, 6, - 26, 31, 36, 385, 613, 385, 385, 385, 385, 385, - 4, -198, 5, -198, -198, -198, -48, -8, 512, 769, - -198, -198, -198, -198, -198, -198, -198, -14, 385, -198, - 769, 769, 769, 769, -21, 385, 385, -198, -4, 385, - -198, 385, -198, 38, -198, 769, 8, -198, -198, 151, - 54, -198, -37, 385, -29, 39, -198, -198, 649, -198, - 8, -198, 840, 671, 840, 840, 720, -198, 341, 512, - 385, 512, 40, 747, 385, 385, 385, 385, 385, 385, - 385, 385, 385, 385, 385, 385, 385, 385, 385, 151, - 385, -57, -21, 63, 769, 769, 385, -198, -198, 64, - -198, 385, 385, 627, 385, 385, 385, -198, 385, -198, - 385, 385, -198, -198, 9, 769, 14, 693, -53, 385, - 769, 769, 769, 769, 769, 769, 769, 769, 818, 818, - 840, 840, 769, 769, 769, 769, -198, -198, 769, 65, - -198, 769, 769, 385, 385, 769, 769, 769, 65, 769, - 769, 769, -198, -12, -198, -198, 529, 769, -198, -58, - 769, 769, -58, 402, 49, 385, 402, -198, -198, 73, - 13, 13, -198, -198, 71, 385, 769, -11, -17, -198, - 78, -198, -198, 60, 769, -198, 72, -198, 77, -198, - -198, 77, -198, 512, -198, 402, 402, -198, -198, 402, - -198, 402, 77, 77, -198, 512, 529, -198, 57, 67, - 402, 79, 80, -198, 81, 68, -198, -198, -198, -198, - 85, 74, 84, 87, -16, -198, 529, -198, 468, 76, - -198, -198, -198, 402, -198, -198, -198, -198, -198 + 254, -59, -195, -195, 364, -195, -195, 364, 364, 364, + 801, -195, -195, 14, 552, -195, 23, 364, 10, 6, + 30, 32, 39, 364, 592, 364, 364, 364, 364, 364, + 4, -195, 5, -195, -195, -195, -51, 1, 491, 364, + 779, -195, -195, -195, -195, -195, -195, -195, -5, 364, + -195, 779, 779, 779, 779, -8, 364, 364, -195, -3, + 364, -195, 364, -195, 37, -195, 779, 12, -195, -195, + 606, 61, -195, -31, 364, -30, 40, -195, -195, 659, + -195, 12, -195, 850, 681, 850, 850, 730, -195, 320, + 491, 364, 491, 41, 757, 779, 364, 364, 364, 364, + 364, 364, 364, 364, 364, 364, 364, 364, 364, 364, + 364, 606, 364, -57, -8, 64, 779, 779, 364, -195, + -195, 65, -195, 364, 364, 637, 364, 364, -195, -195, + 364, -195, 364, 364, -195, -195, 15, 779, 18, 703, + -59, 364, -195, 779, 779, 779, 779, 779, 779, 779, + 779, 828, 828, 850, 850, 779, 779, 779, 779, -195, + -195, 779, 67, -195, 779, 779, 364, 364, 779, 779, + 67, 779, 779, 779, -195, -1, -195, -195, 508, 779, + -195, -58, 779, 779, -58, 381, 46, 364, 381, -195, + -195, 76, 17, 17, -195, -195, 74, 364, 779, -20, + -11, -195, 81, -195, -195, 62, 779, -195, 72, -195, + 79, -195, -195, 79, -195, 491, -195, 381, 381, -195, + -195, 381, -195, 381, 79, 79, -195, 491, 508, -195, + 58, 66, 381, 80, 83, -195, 86, 71, -195, -195, + -195, -195, 88, 75, 85, 87, -17, -195, 508, -195, + 447, 77, -195, -195, -195, 381, -195, -195, -195, -195, + -195 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -198, -198, 12, 25, 2, -170, 0, -198, -198, -198, - -78, -197, -101, -61, -198, -198, -198, -186, -9, 113, - -167, 41, 3, -198, -198, 98, -7, -198, -198, -198, - -198, -45, -67, -198, 16 + -195, -195, 11, 19, 2, -170, 0, -195, -195, -195, + -79, -191, -102, -61, -195, -195, -195, -194, -9, -12, + -171, -195, 38, 3, -195, -195, 99, -13, -195, -195, + -195, -195, -46, -67, -195, 13 }; /* 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 -60 +#define YYTABLE_NINF -61 static const yytype_int16 yytable[] = { - 34, 56, 32, 40, 87, -10, 187, 121, 186, 209, - -51, -51, 184, 46, 227, 124, 206, 81, 45, 72, - 73, 156, 225, 45, 189, 110, 227, 74, 134, 89, - 136, 210, 185, 122, 215, 216, 225, 207, 219, 57, - 221, 125, 88, 68, 61, 50, 63, 75, 51, 52, - 53, 230, 76, 70, 71, 65, 236, 77, 69, 117, - -51, 110, 90, 55, 78, 65, 82, 83, 84, 85, - 86, 111, 112, 129, 116, 120, 254, 253, 113, 93, - 45, -10, 126, 138, 157, 160, 178, 172, 34, 109, - 32, 40, 174, 195, 199, 200, 53, 53, 203, 214, - 114, 217, 115, 209, 220, 237, 241, 242, 243, 159, - 239, 244, 249, 133, 123, 250, 251, 256, 168, 252, - 211, 233, 80, 182, 202, 0, 0, 0, 0, 176, - 93, 135, 137, 0, 0, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 175, 155, 229, 0, 0, 0, 0, 158, 0, 0, - 0, 0, 161, 162, 235, 165, 166, 167, 0, 169, - 0, 170, 171, 0, 0, 0, 0, 0, 0, 0, - 177, 0, 0, 0, 119, 0, 0, 0, 208, 0, - 0, 190, 0, 0, 191, 0, 0, 0, 0, 0, - 0, 226, 0, 0, 180, 181, 94, 95, 0, 0, - 0, 96, 97, 98, 0, 99, 100, 101, 0, 0, - 0, 0, 102, 103, 104, 105, 196, 0, 246, 0, - 106, 107, 108, 0, 0, 0, 204, 0, 0, 0, - 0, 0, 0, -6, 1, 0, 0, 0, 255, 0, - 0, 0, 0, 0, 93, 2, 3, 4, 5, 0, - 6, 7, 8, 9, 10, 11, 93, 0, 0, 0, - 0, 12, 0, 13, 14, 15, 0, 0, 16, 0, - 0, 0, 0, 17, 18, 19, 0, 0, 20, 0, - 0, 0, 21, 22, 23, 24, 194, 0, 0, 197, - 198, 0, 0, 0, 0, 0, 25, 0, 0, 205, - 26, 0, 0, 0, 27, 28, 0, 218, 0, -6, - 29, 0, 0, 0, 228, 0, 0, 0, 0, 0, - 0, 0, 231, 0, 232, 234, 0, 0, 0, 0, - 0, 0, 0, 240, 0, 0, 0, 0, 0, 245, - 0, 247, 0, 2, 3, 4, 5, 0, 6, 7, - 8, 9, 10, 11, 0, 0, 257, 0, 258, 12, - 0, 13, 14, 15, 0, 0, 16, 0, 0, 0, - 0, 17, 18, 19, 0, 0, 20, 0, 0, 0, - 21, 22, 23, 24, 0, 0, 0, 2, 3, 4, - 5, 0, 6, 0, 25, 0, 47, 11, 26, 0, - 0, 0, 27, 28, 2, 3, 4, 5, 29, 6, - 7, 8, 9, 47, 11, 48, 0, 19, 0, 0, - 12, 0, 13, 14, 15, 0, 0, 0, 0, 0, - 0, 0, 17, 18, 19, 0, 0, 20, 25, 0, - 0, 0, 26, 23, 24, 0, 27, 28, 0, 0, - 0, 0, 29, 0, 0, 25, 0, 0, 0, 26, - 0, 0, 0, 27, 28, 0, 0, 0, 45, 29, - 2, 3, 4, 5, 0, 6, 7, 8, 9, 47, - 11, 0, 0, 0, 0, 0, 12, 0, 13, 14, - 15, 0, 0, 0, 0, 0, 0, 0, 17, 18, - 19, 0, 0, 20, 0, 0, 0, 0, 0, 23, - 24, 0, 0, 0, 2, 3, 4, 5, 0, 6, - 0, 25, 0, 47, 11, 26, 0, 0, 0, 27, - 28, 2, 3, 4, 5, 29, 6, 7, 8, 9, - 47, 11, 48, 0, 19, 0, 0, 12, 0, 13, - 14, 0, 0, 0, 0, 0, 0, 0, 0, 17, - 0, 19, 0, 0, 0, 25, 0, 0, 0, 26, - 23, 24, 0, 27, 28, 2, 3, 4, 5, 91, - 6, 0, 25, 0, 47, 11, 26, 0, 0, 0, - 27, 28, 59, 0, 0, 0, 29, 60, 0, 61, - 62, 63, 64, 48, 0, 19, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 2, 3, 4, 5, 0, - 6, 0, 0, 0, 47, 11, 25, 0, 0, 0, - 26, 0, 59, 0, 27, 28, 0, 0, 0, 61, - 29, 63, 0, 48, 0, 19, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 79, 0, 0, 0, - 0, 163, 0, 0, 0, 0, 25, 0, 0, 0, - 26, 0, 94, 95, 27, 28, 0, 96, 97, 98, - 29, 99, 100, 101, 0, 128, 0, 164, 102, 103, - 104, 105, 0, 0, 94, 95, 106, 107, 108, 96, - 97, 98, 0, 99, 100, 101, 0, 0, 0, 0, - 102, 103, 104, 105, 0, 0, 94, 95, 106, 107, - 108, 96, 97, 98, 0, 99, 100, 101, 0, 130, - 131, 0, 102, 103, 104, 105, 0, 0, 94, 95, - 106, 107, 108, 96, 97, 98, 0, 99, 100, 101, - 0, 0, 0, 139, 102, 103, 104, 105, 0, 0, - 0, 132, 106, 107, 108, 94, 95, 0, 0, 0, - 96, 97, 98, 0, 99, 100, 101, 0, 0, 0, - 0, 102, 103, 104, 105, 0, 0, 0, 132, 106, - 107, 108, 94, 95, 0, 0, 0, 96, 97, 98, - 0, 99, 100, 101, 0, 0, 0, 139, 102, 103, - 104, 105, 0, 0, 94, 95, 106, 107, 108, 96, - 97, 98, 0, 99, 100, 101, 0, 0, 0, 0, - 102, 103, 104, 105, 0, 0, -59, -59, 106, 107, - 108, -59, -59, -59, 0, -59, -59, -59, 0, 0, - 0, 0, 0, 0, -59, -59, 0, 0, 55, 0, - -59, -59, -59, 94, 95, 0, 0, 0, 96, 97, - 98, 0, 99, 100, 101, 0, 0, 0, 0, 0, - 0, 104, 105, 0, 0, 94, 95, 106, 107, 108, - 96, 97, 98, 0, 99, 100, 101, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 106, - 107, 108 + 34, 57, 32, 41, 88, -10, 188, 208, 189, -51, + -51, 82, 47, 123, 126, 211, 227, 46, 46, 73, + 74, 159, 229, 186, 191, 112, 90, 75, 209, 136, + 227, 138, 217, 218, 229, 58, 221, 212, 223, 124, + 127, 89, 51, 187, 69, 52, 53, 54, 62, 232, + 64, 76, 66, 77, 119, 70, 71, 72, 238, -51, + 78, 79, 66, 83, 84, 85, 86, 87, 131, 113, + 114, 91, 56, 118, 112, 255, 94, 95, 256, 115, + 46, -10, 122, 128, 140, 160, 163, 111, 180, 34, + 197, 32, 41, 174, 54, 54, 176, 201, 116, 202, + 117, 205, 216, 219, 222, 211, 239, 243, 135, 241, + 244, 162, 125, 245, 246, 251, 252, 253, 258, 254, + 170, 213, 235, 81, 184, 175, 204, 0, 94, 137, + 139, 178, 0, 0, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 0, + 158, 177, 0, 0, 231, 0, 161, 0, 0, 0, + 0, 164, 165, 0, 168, 169, 237, 0, 171, 0, + 172, 173, 0, 196, 0, 0, 199, 200, 0, 179, + 0, 0, 0, 0, 0, 0, 207, 0, 0, 0, + 210, 0, 192, 0, 220, 193, 0, 0, 0, 0, + 0, 230, 0, 228, 182, 183, 0, 0, 0, 233, + 0, 234, 236, 0, 0, 0, 0, 0, 0, 0, + 242, 0, 0, 0, 0, 198, 247, 0, 249, 0, + 248, 0, 0, 0, 0, 206, 0, 0, 0, 0, + 0, 0, 0, 259, 0, 260, 0, 0, 0, 0, + 257, 0, 0, 94, -6, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 94, 2, 3, 4, 5, + 0, 6, 7, 8, 9, 10, 11, 0, 0, 0, + 0, 0, 12, 0, 13, 14, 15, 0, 0, 16, + 0, 0, 0, 0, 17, 18, 19, 0, 0, 20, + 0, 0, 0, 21, 22, 23, 24, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, + 0, 26, 0, 0, 0, 27, 28, 0, 0, 0, + -6, 29, 2, 3, 4, 5, 0, 6, 7, 8, + 9, 10, 11, 0, 0, 0, 0, 0, 12, 0, + 13, 14, 15, 0, 0, 16, 0, 0, 0, 0, + 17, 18, 19, 0, 0, 20, 0, 0, 0, 21, + 22, 23, 24, 0, 0, 0, 2, 3, 4, 5, + 0, 6, 0, 25, 0, 48, 11, 26, 0, 0, + 0, 27, 28, 2, 3, 4, 5, 29, 6, 7, + 8, 9, 48, 11, 49, 0, 19, 0, 0, 12, + 0, 13, 14, 15, 0, 0, 0, 0, 0, 0, + 0, 17, 18, 19, 0, 0, 20, 25, 0, 0, + 0, 26, 23, 24, 0, 27, 28, 0, 0, 0, + 0, 29, 0, 0, 25, 0, 0, 0, 26, 0, + 0, 0, 27, 28, 0, 0, 0, 46, 29, 2, + 3, 4, 5, 0, 6, 7, 8, 9, 48, 11, + 0, 0, 0, 0, 0, 12, 0, 13, 14, 15, + 0, 0, 0, 0, 0, 0, 0, 17, 18, 19, + 0, 0, 20, 0, 0, 0, 0, 0, 23, 24, + 0, 0, 0, 2, 3, 4, 5, 0, 6, 0, + 25, 0, 48, 11, 26, 0, 0, 0, 27, 28, + 2, 3, 4, 5, 29, 6, 7, 8, 9, 48, + 11, 49, 0, 19, 0, 0, 12, 0, 13, 14, + 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, + 19, 0, 0, 0, 25, 0, 0, 0, 26, 23, + 24, 0, 27, 28, 2, 3, 4, 5, 92, 6, + 0, 25, 0, 48, 11, 26, 0, 0, 0, 27, + 28, 60, 0, 0, 0, 29, 61, 0, 62, 63, + 64, 65, 49, 0, 19, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 3, 4, 5, 0, 6, + 0, 0, 0, 48, 11, 25, 0, 0, 0, 26, + 0, 60, 0, 27, 28, 0, 0, 0, 62, 29, + 64, 0, 49, 0, 19, 0, 0, 0, 0, 121, + 0, 0, 0, 0, 0, 80, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 25, 0, 0, 0, 26, + 0, 96, 97, 27, 28, 0, 98, 99, 100, 29, + 101, 102, 103, 0, 0, 0, 0, 104, 105, 106, + 107, 166, 0, 0, 0, 108, 109, 110, 0, 0, + 0, 0, 96, 97, 0, 0, 0, 98, 99, 100, + 0, 101, 102, 103, 0, 130, 0, 167, 104, 105, + 106, 107, 0, 0, 96, 97, 108, 109, 110, 98, + 99, 100, 0, 101, 102, 103, 0, 0, 0, 0, + 104, 105, 106, 107, 0, 0, 96, 97, 108, 109, + 110, 98, 99, 100, 0, 101, 102, 103, 0, 132, + 133, 0, 104, 105, 106, 107, 0, 0, 96, 97, + 108, 109, 110, 98, 99, 100, 0, 101, 102, 103, + 0, 0, 0, 141, 104, 105, 106, 107, 0, 0, + 0, 134, 108, 109, 110, 96, 97, 0, 0, 0, + 98, 99, 100, 0, 101, 102, 103, 0, 0, 0, + 0, 104, 105, 106, 107, 0, 0, 0, 134, 108, + 109, 110, 96, 97, 0, 0, 0, 98, 99, 100, + 0, 101, 102, 103, 0, 0, 0, 141, 104, 105, + 106, 107, 0, 0, 96, 97, 108, 109, 110, 98, + 99, 100, 0, 101, 102, 103, 0, 0, 0, 0, + 104, 105, 106, 107, 0, 0, -60, -60, 108, 109, + 110, -60, -60, -60, 0, -60, -60, -60, 0, 0, + 0, 0, 0, 0, -60, -60, 0, 0, 56, 0, + -60, -60, -60, 96, 97, 0, 0, 0, 98, 99, + 100, 0, 101, 102, 103, 0, 0, 0, 0, 0, + 0, 106, 107, 0, 0, 96, 97, 108, 109, 110, + 98, 99, 100, 0, 101, 102, 103, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 108, + 109, 110 }; static const yytype_int16 yycheck[] = { - 0, 10, 0, 0, 0, 0, 176, 44, 175, 26, - 26, 27, 24, 1, 211, 44, 27, 24, 76, 13, - 14, 78, 208, 76, 82, 82, 223, 21, 89, 77, - 91, 48, 44, 70, 201, 202, 222, 48, 205, 21, - 207, 70, 30, 21, 36, 4, 38, 21, 7, 8, - 9, 218, 21, 46, 47, 14, 226, 21, 17, 66, - 76, 82, 70, 77, 23, 24, 25, 26, 27, 28, - 29, 55, 56, 80, 36, 21, 246, 244, 82, 38, - 76, 76, 43, 43, 21, 21, 21, 78, 88, 48, - 88, 88, 78, 44, 21, 82, 55, 56, 27, 21, - 59, 41, 61, 26, 32, 48, 27, 27, 27, 118, - 43, 43, 27, 88, 73, 41, 32, 41, 127, 32, - 198, 222, 24, 168, 191, -1, -1, -1, -1, 138, - 89, 90, 91, -1, -1, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 138, 110, 213, -1, -1, -1, -1, 116, -1, -1, - -1, -1, 121, 122, 225, 124, 125, 126, -1, 128, - -1, 130, 131, -1, -1, -1, -1, -1, -1, -1, - 139, -1, -1, -1, 33, -1, -1, -1, 197, -1, - -1, 179, -1, -1, 182, -1, -1, -1, -1, -1, - -1, 210, -1, -1, 163, 164, 55, 56, -1, -1, - -1, 60, 61, 62, -1, 64, 65, 66, -1, -1, - -1, -1, 71, 72, 73, 74, 185, -1, 237, -1, - 79, 80, 81, -1, -1, -1, 195, -1, -1, -1, - -1, -1, -1, 0, 1, -1, -1, -1, 248, -1, - -1, -1, -1, -1, 213, 12, 13, 14, 15, -1, - 17, 18, 19, 20, 21, 22, 225, -1, -1, -1, - -1, 28, -1, 30, 31, 32, -1, -1, 35, -1, - -1, -1, -1, 40, 41, 42, -1, -1, 45, -1, - -1, -1, 49, 50, 51, 52, 183, -1, -1, 186, - 187, -1, -1, -1, -1, -1, 63, -1, -1, 196, - 67, -1, -1, -1, 71, 72, -1, 204, -1, 76, - 77, -1, -1, -1, 211, -1, -1, -1, -1, -1, - -1, -1, 219, -1, 221, 222, -1, -1, -1, -1, - -1, -1, -1, 230, -1, -1, -1, -1, -1, 236, - -1, 238, -1, 12, 13, 14, 15, -1, 17, 18, - 19, 20, 21, 22, -1, -1, 253, -1, 255, 28, - -1, 30, 31, 32, -1, -1, 35, -1, -1, -1, - -1, 40, 41, 42, -1, -1, 45, -1, -1, -1, - 49, 50, 51, 52, -1, -1, -1, 12, 13, 14, - 15, -1, 17, -1, 63, -1, 21, 22, 67, -1, - -1, -1, 71, 72, 12, 13, 14, 15, 77, 17, - 18, 19, 20, 21, 22, 40, -1, 42, -1, -1, - 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, - -1, -1, 40, 41, 42, -1, -1, 45, 63, -1, - -1, -1, 67, 51, 52, -1, 71, 72, -1, -1, - -1, -1, 77, -1, -1, 63, -1, -1, -1, 67, - -1, -1, -1, 71, 72, -1, -1, -1, 76, 77, - 12, 13, 14, 15, -1, 17, 18, 19, 20, 21, - 22, -1, -1, -1, -1, -1, 28, -1, 30, 31, - 32, -1, -1, -1, -1, -1, -1, -1, 40, 41, - 42, -1, -1, 45, -1, -1, -1, -1, -1, 51, - 52, -1, -1, -1, 12, 13, 14, 15, -1, 17, + 0, 10, 0, 0, 0, 0, 177, 27, 178, 26, + 27, 24, 1, 44, 44, 26, 210, 76, 76, 13, + 14, 78, 213, 24, 82, 82, 77, 21, 48, 90, + 224, 92, 203, 204, 225, 21, 207, 48, 209, 70, + 70, 30, 4, 44, 21, 7, 8, 9, 36, 220, + 38, 21, 14, 21, 67, 17, 46, 47, 228, 76, + 21, 23, 24, 25, 26, 27, 28, 29, 81, 56, + 57, 70, 77, 36, 82, 246, 38, 39, 248, 82, + 76, 76, 21, 43, 43, 21, 21, 49, 21, 89, + 44, 89, 89, 78, 56, 57, 78, 21, 60, 82, + 62, 27, 21, 41, 32, 26, 48, 27, 89, 43, + 27, 120, 74, 27, 43, 27, 41, 32, 41, 32, + 129, 200, 224, 24, 170, 137, 193, -1, 90, 91, + 92, 140, -1, -1, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, -1, + 112, 140, -1, -1, 215, -1, 118, -1, -1, -1, + -1, 123, 124, -1, 126, 127, 227, -1, 130, -1, + 132, 133, -1, 185, -1, -1, 188, 189, -1, 141, + -1, -1, -1, -1, -1, -1, 198, -1, -1, -1, + 199, -1, 181, -1, 206, 184, -1, -1, -1, -1, + -1, 213, -1, 212, 166, 167, -1, -1, -1, 221, + -1, 223, 224, -1, -1, -1, -1, -1, -1, -1, + 232, -1, -1, -1, -1, 187, 238, -1, 240, -1, + 239, -1, -1, -1, -1, 197, -1, -1, -1, -1, + -1, -1, -1, 255, -1, 257, -1, -1, -1, -1, + 250, -1, -1, 215, 0, 1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 227, 12, 13, 14, 15, + -1, 17, 18, 19, 20, 21, 22, -1, -1, -1, + -1, -1, 28, -1, 30, 31, 32, -1, -1, 35, + -1, -1, -1, -1, 40, 41, 42, -1, -1, 45, + -1, -1, -1, 49, 50, 51, 52, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 63, -1, -1, + -1, 67, -1, -1, -1, 71, 72, -1, -1, -1, + 76, 77, 12, 13, 14, 15, -1, 17, 18, 19, + 20, 21, 22, -1, -1, -1, -1, -1, 28, -1, + 30, 31, 32, -1, -1, 35, -1, -1, -1, -1, + 40, 41, 42, -1, -1, 45, -1, -1, -1, 49, + 50, 51, 52, -1, -1, -1, 12, 13, 14, 15, + -1, 17, -1, 63, -1, 21, 22, 67, -1, -1, + -1, 71, 72, 12, 13, 14, 15, 77, 17, 18, + 19, 20, 21, 22, 40, -1, 42, -1, -1, 28, + -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, + -1, 40, 41, 42, -1, -1, 45, 63, -1, -1, + -1, 67, 51, 52, -1, 71, 72, -1, -1, -1, + -1, 77, -1, -1, 63, -1, -1, -1, 67, -1, + -1, -1, 71, 72, -1, -1, -1, 76, 77, 12, + 13, 14, 15, -1, 17, 18, 19, 20, 21, 22, + -1, -1, -1, -1, -1, 28, -1, 30, 31, 32, + -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, + -1, -1, 45, -1, -1, -1, -1, -1, 51, 52, + -1, -1, -1, 12, 13, 14, 15, -1, 17, -1, + 63, -1, 21, 22, 67, -1, -1, -1, 71, 72, + 12, 13, 14, 15, 77, 17, 18, 19, 20, 21, + 22, 40, -1, 42, -1, -1, 28, -1, 30, 31, + -1, -1, -1, -1, -1, -1, -1, -1, 40, -1, + 42, -1, -1, -1, 63, -1, -1, -1, 67, 51, + 52, -1, 71, 72, 12, 13, 14, 15, 77, 17, -1, 63, -1, 21, 22, 67, -1, -1, -1, 71, - 72, 12, 13, 14, 15, 77, 17, 18, 19, 20, - 21, 22, 40, -1, 42, -1, -1, 28, -1, 30, - 31, -1, -1, -1, -1, -1, -1, -1, -1, 40, - -1, 42, -1, -1, -1, 63, -1, -1, -1, 67, - 51, 52, -1, 71, 72, 12, 13, 14, 15, 77, - 17, -1, 63, -1, 21, 22, 67, -1, -1, -1, - 71, 72, 29, -1, -1, -1, 77, 34, -1, 36, - 37, 38, 39, 40, -1, 42, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 12, 13, 14, 15, -1, - 17, -1, -1, -1, 21, 22, 63, -1, -1, -1, - 67, -1, 29, -1, 71, 72, -1, -1, -1, 36, - 77, 38, -1, 40, -1, 42, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 53, -1, -1, -1, - -1, 44, -1, -1, -1, -1, 63, -1, -1, -1, - 67, -1, 55, 56, 71, 72, -1, 60, 61, 62, - 77, 64, 65, 66, -1, 46, -1, 70, 71, 72, + 72, 29, -1, -1, -1, 77, 34, -1, 36, 37, + 38, 39, 40, -1, 42, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 12, 13, 14, 15, -1, 17, + -1, -1, -1, 21, 22, 63, -1, -1, -1, 67, + -1, 29, -1, 71, 72, -1, -1, -1, 36, 77, + 38, -1, 40, -1, 42, -1, -1, -1, -1, 33, + -1, -1, -1, -1, -1, 53, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 63, -1, -1, -1, 67, + -1, 55, 56, 71, 72, -1, 60, 61, 62, 77, + 64, 65, 66, -1, -1, -1, -1, 71, 72, 73, + 74, 44, -1, -1, -1, 79, 80, 81, -1, -1, + -1, -1, 55, 56, -1, -1, -1, 60, 61, 62, + -1, 64, 65, 66, -1, 46, -1, 70, 71, 72, 73, 74, -1, -1, 55, 56, 79, 80, 81, 60, 61, 62, -1, 64, 65, 66, -1, -1, -1, -1, 71, 72, 73, 74, -1, -1, 55, 56, 79, 80, @@ -1005,28 +1009,29 @@ static const yytype_uint8 yystos[] = 21, 22, 28, 30, 31, 32, 35, 40, 41, 42, 45, 49, 50, 51, 52, 63, 67, 71, 72, 77, 84, 86, 87, 88, 89, 90, 97, 98, 99, 104, - 105, 107, 110, 111, 116, 76, 85, 21, 40, 87, - 104, 104, 104, 104, 117, 77, 101, 21, 106, 29, - 34, 36, 37, 38, 39, 104, 108, 109, 21, 104, - 46, 47, 13, 14, 21, 21, 21, 21, 104, 53, - 108, 109, 104, 104, 104, 104, 104, 0, 85, 77, - 70, 77, 96, 104, 55, 56, 60, 61, 62, 64, - 65, 66, 71, 72, 73, 74, 79, 80, 81, 104, - 82, 117, 117, 82, 104, 104, 36, 109, 112, 33, - 21, 44, 70, 104, 44, 70, 43, 113, 46, 109, - 68, 69, 78, 86, 96, 104, 96, 104, 43, 70, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 78, 21, 104, 101, - 21, 104, 104, 44, 70, 104, 104, 104, 101, 104, - 104, 104, 78, 102, 78, 85, 101, 104, 21, 114, - 104, 104, 114, 103, 24, 44, 103, 88, 105, 82, - 85, 85, 85, 89, 102, 44, 104, 102, 102, 21, - 82, 115, 115, 27, 104, 102, 27, 48, 101, 26, - 48, 93, 94, 100, 21, 103, 103, 41, 102, 103, - 32, 103, 92, 93, 95, 100, 101, 94, 102, 96, - 103, 102, 102, 95, 102, 96, 88, 48, 91, 43, - 102, 27, 27, 27, 43, 102, 101, 102, 101, 27, - 41, 32, 32, 103, 88, 89, 41, 102, 102 + 105, 106, 108, 111, 112, 117, 76, 85, 21, 40, + 87, 105, 105, 105, 105, 118, 77, 101, 21, 107, + 29, 34, 36, 37, 38, 39, 105, 109, 110, 21, + 105, 46, 47, 13, 14, 21, 21, 21, 21, 105, + 53, 109, 110, 105, 105, 105, 105, 105, 0, 85, + 77, 70, 77, 96, 105, 105, 55, 56, 60, 61, + 62, 64, 65, 66, 71, 72, 73, 74, 79, 80, + 81, 105, 82, 118, 118, 82, 105, 105, 36, 110, + 113, 33, 21, 44, 70, 105, 44, 70, 43, 114, + 46, 110, 68, 69, 78, 86, 96, 105, 96, 105, + 43, 70, 102, 105, 105, 105, 105, 105, 105, 105, + 105, 105, 105, 105, 105, 105, 105, 105, 105, 78, + 21, 105, 101, 21, 105, 105, 44, 70, 105, 105, + 101, 105, 105, 105, 78, 102, 78, 85, 101, 105, + 21, 115, 105, 105, 115, 103, 24, 44, 103, 88, + 106, 82, 85, 85, 85, 89, 102, 44, 105, 102, + 102, 21, 82, 116, 116, 27, 105, 102, 27, 48, + 101, 26, 48, 93, 94, 100, 21, 103, 103, 41, + 102, 103, 32, 103, 92, 93, 95, 100, 101, 94, + 102, 96, 103, 102, 102, 95, 102, 96, 88, 48, + 91, 43, 102, 27, 27, 27, 43, 102, 101, 102, + 101, 27, 41, 32, 32, 103, 88, 89, 41, 102, + 102 }; #define yyerrok (yyerrstatus = 0) @@ -1986,12 +1991,15 @@ yyreduce: case 26: #line 220 "engines/director/lingo/lingo-gr.y" { - g_lingo->code1(g_lingo->c_ifcode); + inst end = 0; + WRITE_UINT32(&end, (yyvsp[(3) - (3)].code)); + g_lingo->code1(g_lingo->c_whencode); + (*g_lingo->_currentScript)[(yyvsp[(1) - (3)].code) + 1] = end; ;} break; case 27: -#line 225 "engines/director/lingo/lingo-gr.y" +#line 228 "engines/director/lingo/lingo-gr.y" { inst then = 0, end = 0; WRITE_UINT32(&then, (yyvsp[(5) - (8)].code)); @@ -2002,7 +2010,7 @@ yyreduce: break; case 28: -#line 232 "engines/director/lingo/lingo-gr.y" +#line 235 "engines/director/lingo/lingo-gr.y" { inst then = 0, else1 = 0, end = 0; WRITE_UINT32(&then, (yyvsp[(5) - (11)].code)); @@ -2015,7 +2023,7 @@ yyreduce: break; case 29: -#line 241 "engines/director/lingo/lingo-gr.y" +#line 244 "engines/director/lingo/lingo-gr.y" { inst then = 0, else1 = 0, end = 0; WRITE_UINT32(&then, (yyvsp[(5) - (11)].code)); @@ -2028,7 +2036,7 @@ yyreduce: break; case 30: -#line 250 "engines/director/lingo/lingo-gr.y" +#line 253 "engines/director/lingo/lingo-gr.y" { inst then = 0, else1 = 0, end = 0; WRITE_UINT32(&then, (yyvsp[(4) - (6)].code)); @@ -2042,7 +2050,7 @@ yyreduce: break; case 31: -#line 260 "engines/director/lingo/lingo-gr.y" +#line 263 "engines/director/lingo/lingo-gr.y" { inst then = 0, else1 = 0, end = 0; WRITE_UINT32(&then, (yyvsp[(4) - (10)].code)); @@ -2056,7 +2064,7 @@ yyreduce: break; case 32: -#line 270 "engines/director/lingo/lingo-gr.y" +#line 273 "engines/director/lingo/lingo-gr.y" { inst then = 0, else1 = 0, end = 0; WRITE_UINT32(&then, (yyvsp[(4) - (10)].code)); @@ -2070,17 +2078,17 @@ yyreduce: break; case 33: -#line 281 "engines/director/lingo/lingo-gr.y" +#line 284 "engines/director/lingo/lingo-gr.y" { (yyval.code) = 0; ;} break; case 34: -#line 282 "engines/director/lingo/lingo-gr.y" +#line 285 "engines/director/lingo/lingo-gr.y" { (yyval.code) = (yyvsp[(2) - (3)].code); ;} break; case 39: -#line 293 "engines/director/lingo/lingo-gr.y" +#line 296 "engines/director/lingo/lingo-gr.y" { inst then = 0; WRITE_UINT32(&then, (yyvsp[(4) - (6)].code)); @@ -2090,7 +2098,7 @@ yyreduce: break; case 41: -#line 302 "engines/director/lingo/lingo-gr.y" +#line 305 "engines/director/lingo/lingo-gr.y" { inst then = 0; WRITE_UINT32(&then, (yyvsp[(4) - (5)].code)); @@ -2100,22 +2108,22 @@ yyreduce: break; case 42: -#line 310 "engines/director/lingo/lingo-gr.y" +#line 313 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(STOP); ;} break; case 43: -#line 311 "engines/director/lingo/lingo-gr.y" +#line 314 "engines/director/lingo/lingo-gr.y" { g_lingo->code2(g_lingo->c_eq, STOP); ;} break; case 45: -#line 314 "engines/director/lingo/lingo-gr.y" +#line 317 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code3(g_lingo->c_repeatwhilecode, STOP, STOP); ;} break; case 46: -#line 316 "engines/director/lingo/lingo-gr.y" +#line 319 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code3(g_lingo->c_repeatwithcode, STOP, STOP); g_lingo->code3(STOP, STOP, STOP); @@ -2124,7 +2132,7 @@ yyreduce: break; case 47: -#line 322 "engines/director/lingo/lingo-gr.y" +#line 325 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_ifcode); g_lingo->code3(STOP, STOP, STOP); @@ -2133,7 +2141,7 @@ yyreduce: break; case 48: -#line 328 "engines/director/lingo/lingo-gr.y" +#line 331 "engines/director/lingo/lingo-gr.y" { inst skipEnd; WRITE_UINT32(&skipEnd, 1); // We have to skip end to avoid multiple executions @@ -2143,64 +2151,73 @@ yyreduce: break; case 49: -#line 335 "engines/director/lingo/lingo-gr.y" +#line 338 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->_currentScript->size(); ;} break; case 50: -#line 337 "engines/director/lingo/lingo-gr.y" +#line 340 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(STOP); (yyval.code) = g_lingo->_currentScript->size(); ;} break; case 51: -#line 339 "engines/director/lingo/lingo-gr.y" +#line 342 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->_currentScript->size(); ;} break; case 54: -#line 344 "engines/director/lingo/lingo-gr.y" - { (yyval.code) = g_lingo->codeConst((yyvsp[(1) - (1)].i)); ;} +#line 347 "engines/director/lingo/lingo-gr.y" + { + (yyval.code) = g_lingo->code1(g_lingo->c_whencode); + g_lingo->code1(STOP); + g_lingo->codeString((yyvsp[(2) - (3)].s)->c_str()); + delete (yyvsp[(2) - (3)].s); ;} break; case 55: -#line 345 "engines/director/lingo/lingo-gr.y" +#line 353 "engines/director/lingo/lingo-gr.y" + { (yyval.code) = g_lingo->codeConst((yyvsp[(1) - (1)].i)); ;} + break; + + case 56: +#line 354 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_fconstpush); g_lingo->codeFloat((yyvsp[(1) - (1)].f)); ;} break; - case 56: -#line 348 "engines/director/lingo/lingo-gr.y" + case 57: +#line 357 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_stringpush); g_lingo->codeString((yyvsp[(1) - (1)].s)->c_str()); ;} break; - case 57: -#line 351 "engines/director/lingo/lingo-gr.y" + case 58: +#line 360 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->_handlers[*(yyvsp[(1) - (1)].s)]->u.func); g_lingo->codeConst(0); // Put dummy value delete (yyvsp[(1) - (1)].s); ;} break; - case 58: -#line 355 "engines/director/lingo/lingo-gr.y" + case 59: +#line 364 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->codeFunc((yyvsp[(1) - (4)].s), (yyvsp[(3) - (4)].narg)); delete (yyvsp[(1) - (4)].s); ;} break; - case 59: -#line 358 "engines/director/lingo/lingo-gr.y" + case 60: +#line 367 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_eval); g_lingo->codeString((yyvsp[(1) - (1)].s)->c_str()); delete (yyvsp[(1) - (1)].s); ;} break; - case 60: -#line 362 "engines/director/lingo/lingo-gr.y" + case 61: +#line 371 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->codeConst(0); // Put dummy id g_lingo->code1(g_lingo->c_theentitypush); @@ -2210,8 +2227,8 @@ yyreduce: g_lingo->code2(e, f); ;} break; - case 61: -#line 369 "engines/director/lingo/lingo-gr.y" + case 62: +#line 378 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_theentitypush); inst e = 0, f = 0; @@ -2220,237 +2237,237 @@ yyreduce: g_lingo->code2(e, f); ;} break; - case 63: -#line 376 "engines/director/lingo/lingo-gr.y" + case 64: +#line 385 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_add); ;} break; - case 64: -#line 377 "engines/director/lingo/lingo-gr.y" + case 65: +#line 386 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_sub); ;} break; - case 65: -#line 378 "engines/director/lingo/lingo-gr.y" + case 66: +#line 387 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_mul); ;} break; - case 66: -#line 379 "engines/director/lingo/lingo-gr.y" + case 67: +#line 388 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_div); ;} break; - case 67: -#line 380 "engines/director/lingo/lingo-gr.y" + case 68: +#line 389 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gt); ;} break; - case 68: -#line 381 "engines/director/lingo/lingo-gr.y" + case 69: +#line 390 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_lt); ;} break; - case 69: -#line 382 "engines/director/lingo/lingo-gr.y" + case 70: +#line 391 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_neq); ;} break; - case 70: -#line 383 "engines/director/lingo/lingo-gr.y" + case 71: +#line 392 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_ge); ;} break; - case 71: -#line 384 "engines/director/lingo/lingo-gr.y" + case 72: +#line 393 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_le); ;} break; - case 72: -#line 385 "engines/director/lingo/lingo-gr.y" + case 73: +#line 394 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_and); ;} break; - case 73: -#line 386 "engines/director/lingo/lingo-gr.y" + case 74: +#line 395 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_or); ;} break; - case 74: -#line 387 "engines/director/lingo/lingo-gr.y" + case 75: +#line 396 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_not); ;} break; - case 75: -#line 388 "engines/director/lingo/lingo-gr.y" + case 76: +#line 397 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_ampersand); ;} break; - case 76: -#line 389 "engines/director/lingo/lingo-gr.y" + case 77: +#line 398 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_concat); ;} break; - case 77: -#line 390 "engines/director/lingo/lingo-gr.y" + case 78: +#line 399 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_contains); ;} break; - case 78: -#line 391 "engines/director/lingo/lingo-gr.y" + case 79: +#line 400 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_starts); ;} break; - case 79: -#line 392 "engines/director/lingo/lingo-gr.y" + case 80: +#line 401 "engines/director/lingo/lingo-gr.y" { (yyval.code) = (yyvsp[(2) - (2)].code); ;} break; - case 80: -#line 393 "engines/director/lingo/lingo-gr.y" + case 81: +#line 402 "engines/director/lingo/lingo-gr.y" { (yyval.code) = (yyvsp[(2) - (2)].code); g_lingo->code1(g_lingo->c_negate); ;} break; - case 81: -#line 394 "engines/director/lingo/lingo-gr.y" + case 82: +#line 403 "engines/director/lingo/lingo-gr.y" { (yyval.code) = (yyvsp[(2) - (3)].code); ;} break; - case 82: -#line 395 "engines/director/lingo/lingo-gr.y" + case 83: +#line 404 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_intersects); ;} break; - case 83: -#line 396 "engines/director/lingo/lingo-gr.y" + case 84: +#line 405 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_within); ;} break; - case 84: -#line 399 "engines/director/lingo/lingo-gr.y" + case 85: +#line 408 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_printtop); ;} break; - case 87: -#line 402 "engines/director/lingo/lingo-gr.y" + case 88: +#line 411 "engines/director/lingo/lingo-gr.y" { g_lingo->codeConst(0); // Push fake value on stack g_lingo->code1(g_lingo->c_procret); ;} break; - case 89: -#line 405 "engines/director/lingo/lingo-gr.y" + case 90: +#line 414 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->_handlers[*(yyvsp[(1) - (2)].s)]->u.func); delete (yyvsp[(1) - (2)].s); ;} break; - case 90: -#line 408 "engines/director/lingo/lingo-gr.y" + case 91: +#line 417 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->_handlers[*(yyvsp[(1) - (2)].s)]->u.func); delete (yyvsp[(1) - (2)].s); ;} break; - case 91: -#line 411 "engines/director/lingo/lingo-gr.y" + case 92: +#line 420 "engines/director/lingo/lingo-gr.y" { g_lingo->code2(g_lingo->c_voidpush, g_lingo->_handlers[*(yyvsp[(1) - (1)].s)]->u.func); delete (yyvsp[(1) - (1)].s); ;} break; - case 92: -#line 414 "engines/director/lingo/lingo-gr.y" + case 93: +#line 423 "engines/director/lingo/lingo-gr.y" { g_lingo->codeFunc((yyvsp[(1) - (2)].s), (yyvsp[(2) - (2)].narg)); ;} break; - case 93: -#line 415 "engines/director/lingo/lingo-gr.y" + case 94: +#line 424 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_open); ;} break; - case 94: -#line 416 "engines/director/lingo/lingo-gr.y" + case 95: +#line 425 "engines/director/lingo/lingo-gr.y" { g_lingo->code2(g_lingo->c_voidpush, g_lingo->c_open); ;} break; - case 95: -#line 419 "engines/director/lingo/lingo-gr.y" + case 96: +#line 428 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_global); g_lingo->codeString((yyvsp[(1) - (1)].s)->c_str()); delete (yyvsp[(1) - (1)].s); ;} break; - case 96: -#line 420 "engines/director/lingo/lingo-gr.y" + case 97: +#line 429 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_global); g_lingo->codeString((yyvsp[(3) - (3)].s)->c_str()); delete (yyvsp[(3) - (3)].s); ;} break; - case 97: -#line 431 "engines/director/lingo/lingo-gr.y" + case 98: +#line 440 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gotoloop); ;} break; - case 98: -#line 432 "engines/director/lingo/lingo-gr.y" + case 99: +#line 441 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gotonext); ;} break; - case 99: -#line 433 "engines/director/lingo/lingo-gr.y" + case 100: +#line 442 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gotoprevious); ;} break; - case 100: -#line 434 "engines/director/lingo/lingo-gr.y" + case 101: +#line 443 "engines/director/lingo/lingo-gr.y" { g_lingo->codeConst(1); g_lingo->code1(g_lingo->c_goto); ;} break; - case 101: -#line 437 "engines/director/lingo/lingo-gr.y" + case 102: +#line 446 "engines/director/lingo/lingo-gr.y" { g_lingo->codeConst(3); g_lingo->code1(g_lingo->c_goto); ;} break; - case 102: -#line 440 "engines/director/lingo/lingo-gr.y" + case 103: +#line 449 "engines/director/lingo/lingo-gr.y" { g_lingo->codeConst(2); g_lingo->code1(g_lingo->c_goto); ;} break; - case 107: -#line 453 "engines/director/lingo/lingo-gr.y" + case 108: +#line 462 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_playdone); ;} break; - case 108: -#line 454 "engines/director/lingo/lingo-gr.y" + case 109: +#line 463 "engines/director/lingo/lingo-gr.y" { g_lingo->codeConst(1); g_lingo->code1(g_lingo->c_play); ;} break; - case 109: -#line 457 "engines/director/lingo/lingo-gr.y" + case 110: +#line 466 "engines/director/lingo/lingo-gr.y" { g_lingo->codeConst(3); g_lingo->code1(g_lingo->c_play); ;} break; - case 110: -#line 460 "engines/director/lingo/lingo-gr.y" + case 111: +#line 469 "engines/director/lingo/lingo-gr.y" { g_lingo->codeConst(2); g_lingo->code1(g_lingo->c_play); ;} break; - case 111: -#line 490 "engines/director/lingo/lingo-gr.y" + case 112: +#line 499 "engines/director/lingo/lingo-gr.y" { g_lingo->_indef = true; g_lingo->_currentFactory.clear(); ;} break; - case 112: -#line 491 "engines/director/lingo/lingo-gr.y" + case 113: +#line 500 "engines/director/lingo/lingo-gr.y" { g_lingo->codeConst(0); // Push fake value on stack g_lingo->code1(g_lingo->c_procret); @@ -2458,53 +2475,53 @@ yyreduce: g_lingo->_indef = false; ;} break; - case 113: -#line 496 "engines/director/lingo/lingo-gr.y" + case 114: +#line 505 "engines/director/lingo/lingo-gr.y" { g_lingo->codeFactory(*(yyvsp[(2) - (2)].s)); ;} break; - case 114: -#line 499 "engines/director/lingo/lingo-gr.y" + case 115: +#line 508 "engines/director/lingo/lingo-gr.y" { g_lingo->_indef = true; ;} break; - case 115: -#line 500 "engines/director/lingo/lingo-gr.y" + case 116: +#line 509 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_procret); g_lingo->define(*(yyvsp[(2) - (8)].s), (yyvsp[(4) - (8)].code), (yyvsp[(5) - (8)].narg) + 1, &g_lingo->_currentFactory); g_lingo->_indef = false; ;} break; - case 116: -#line 504 "engines/director/lingo/lingo-gr.y" + case 117: +#line 513 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = 0; ;} break; - case 117: -#line 505 "engines/director/lingo/lingo-gr.y" + case 118: +#line 514 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArg((yyvsp[(1) - (1)].s)); (yyval.narg) = 1; ;} break; - case 118: -#line 506 "engines/director/lingo/lingo-gr.y" + case 119: +#line 515 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArg((yyvsp[(3) - (3)].s)); (yyval.narg) = (yyvsp[(1) - (3)].narg) + 1; ;} break; - case 119: -#line 507 "engines/director/lingo/lingo-gr.y" + case 120: +#line 516 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArg((yyvsp[(4) - (4)].s)); (yyval.narg) = (yyvsp[(1) - (4)].narg) + 1; ;} break; - case 120: -#line 509 "engines/director/lingo/lingo-gr.y" + case 121: +#line 518 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArgStore(); ;} break; - case 121: -#line 513 "engines/director/lingo/lingo-gr.y" + case 122: +#line 522 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_call); g_lingo->codeString((yyvsp[(1) - (3)].s)->c_str()); @@ -2513,24 +2530,24 @@ yyreduce: g_lingo->code1(numpar); ;} break; - case 122: -#line 521 "engines/director/lingo/lingo-gr.y" + case 123: +#line 530 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = 0; ;} break; - case 123: -#line 522 "engines/director/lingo/lingo-gr.y" + case 124: +#line 531 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = 1; ;} break; - case 124: -#line 523 "engines/director/lingo/lingo-gr.y" + case 125: +#line 532 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = (yyvsp[(1) - (3)].narg) + 1; ;} break; /* Line 1267 of yacc.c. */ -#line 2534 "engines/director/lingo/lingo-gr.cpp" +#line 2551 "engines/director/lingo/lingo-gr.cpp" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -2744,6 +2761,6 @@ yyreturn: } -#line 526 "engines/director/lingo/lingo-gr.y" +#line 535 "engines/director/lingo/lingo-gr.y" diff --git a/engines/director/lingo/lingo-gr.y b/engines/director/lingo/lingo-gr.y index 3b04ed05c7..6b16385f44 100644 --- a/engines/director/lingo/lingo-gr.y +++ b/engines/director/lingo/lingo-gr.y @@ -90,7 +90,7 @@ void yyerror(char *s) { %token tCONCAT tCONTAINS tSTARTS %token tSPRITE tINTERSECTS tWITHIN -%type<code> asgn begin elseif elsestmtoneliner end expr if repeatwhile repeatwith stmtlist +%type<code> asgn begin elseif elsestmtoneliner end expr if when repeatwhile repeatwith stmtlist %type<narg> argdef arglist %right '=' @@ -217,8 +217,11 @@ stmt: stmtoneliner (*g_lingo->_currentScript)[$1 + 3] = body; /* body of loop */ (*g_lingo->_currentScript)[$1 + 4] = inc; /* increment */ (*g_lingo->_currentScript)[$1 + 5] = end; } /* end, if cond fails */ - | tWHEN ID tTHEN expr { - g_lingo->code1(g_lingo->c_ifcode); + | when expr end { + inst end = 0; + WRITE_UINT32(&end, $3); + g_lingo->code1(g_lingo->c_whencode); + (*g_lingo->_currentScript)[$1 + 1] = end; } ; @@ -341,6 +344,12 @@ stmtlist: /* nothing */ { $$ = g_lingo->_currentScript->size(); } | stmtlist stmt ; +when: tWHEN ID tTHEN { + $$ = g_lingo->code1(g_lingo->c_whencode); + g_lingo->code1(STOP); + g_lingo->codeString($2->c_str()); + delete $2; } + expr: INT { $$ = g_lingo->codeConst($1); } | FLOAT { $$ = g_lingo->code1(g_lingo->c_fconstpush); diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h index 254030e9b7..e674b22265 100644 --- a/engines/director/lingo/lingo.h +++ b/engines/director/lingo/lingo.h @@ -267,6 +267,7 @@ public: static void c_repeatwhilecode(); static void c_repeatwithcode(); static void c_ifcode(); + static void c_whencode(); static void c_eq(); static void c_neq(); static void c_gt(); |