diff options
author | Eugene Sandulenko | 2019-12-06 23:54:16 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2019-12-06 23:54:16 +0100 |
commit | 2d7f1209b3bb5c584f850f650c06b7724bce1fee (patch) | |
tree | 7380f0e2791ec50c7728d988d19c03f2097725a7 /engines | |
parent | 458ad2a86f2abbcdc521cbee15ca293052fd4b1f (diff) | |
download | scummvm-rg350-2d7f1209b3bb5c584f850f650c06b7724bce1fee.tar.gz scummvm-rg350-2d7f1209b3bb5c584f850f650c06b7724bce1fee.tar.bz2 scummvm-rg350-2d7f1209b3bb5c584f850f650c06b7724bce1fee.zip |
DIRECTOR: LINGO: Finally fix 'if' grammar with prepocessing
Diffstat (limited to 'engines')
-rw-r--r-- | engines/director/lingo/lingo-gr.cpp | 1824 | ||||
-rw-r--r-- | engines/director/lingo/lingo-gr.h | 162 | ||||
-rw-r--r-- | engines/director/lingo/lingo-gr.y | 94 | ||||
-rw-r--r-- | engines/director/lingo/lingo-lex.cpp | 811 | ||||
-rw-r--r-- | engines/director/lingo/lingo-lex.l | 11 | ||||
-rw-r--r-- | engines/director/lingo/lingo.cpp | 169 | ||||
-rw-r--r-- | engines/director/lingo/tests/if.lingo | 9 |
7 files changed, 1524 insertions, 1556 deletions
diff --git a/engines/director/lingo/lingo-gr.cpp b/engines/director/lingo/lingo-gr.cpp index a4c727415c..d7f5066371 100644 --- a/engines/director/lingo/lingo-gr.cpp +++ b/engines/director/lingo/lingo-gr.cpp @@ -101,7 +101,7 @@ tPLAYACCEL = 290, tDOWN = 291, tELSE = 292, - tNLELSIF = 293, + tELSIF = 293, tEXIT = 294, tFRAME = 295, tGLOBAL = 296, @@ -118,44 +118,46 @@ tREPEAT = 307, tSET = 308, tTHEN = 309, - tTHENNL = 310, - tTO = 311, - tWHEN = 312, - tWITH = 313, - tWHILE = 314, - tNLELSE = 315, - tFACTORY = 316, - tMETHOD = 317, - tOPEN = 318, - tPLAY = 319, - tDONE = 320, - tINSTANCE = 321, - tGE = 322, - tLE = 323, - tGT = 324, - tLT = 325, - tEQ = 326, - tNEQ = 327, - tAND = 328, - tOR = 329, - tNOT = 330, - tMOD = 331, - tAFTER = 332, - tBEFORE = 333, - tCONCAT = 334, - tCONTAINS = 335, - tSTARTS = 336, - tCHAR = 337, - tITEM = 338, - tLINE = 339, - tWORD = 340, - tSPRITE = 341, - tINTERSECTS = 342, - tWITHIN = 343, - tTELL = 344, - tPROPERTY = 345, - tON = 346, - tME = 347 + tTO = 310, + tWHEN = 311, + tWITH = 312, + tWHILE = 313, + tNLELSE = 314, + tFACTORY = 315, + tMETHOD = 316, + tOPEN = 317, + tPLAY = 318, + tDONE = 319, + tINSTANCE = 320, + tGE = 321, + tLE = 322, + tGT = 323, + tLT = 324, + tEQ = 325, + tNEQ = 326, + tAND = 327, + tOR = 328, + tNOT = 329, + tMOD = 330, + tAFTER = 331, + tBEFORE = 332, + tCONCAT = 333, + tCONTAINS = 334, + tSTARTS = 335, + tCHAR = 336, + tITEM = 337, + tLINE = 338, + tWORD = 339, + tSPRITE = 340, + tINTERSECTS = 341, + tWITHIN = 342, + tTELL = 343, + tPROPERTY = 344, + tON = 345, + tME = 346, + tENDIF = 347, + tENDREPEAT = 348, + tENDTELL = 349 }; #endif /* Tokens. */ @@ -194,7 +196,7 @@ #define tPLAYACCEL 290 #define tDOWN 291 #define tELSE 292 -#define tNLELSIF 293 +#define tELSIF 293 #define tEXIT 294 #define tFRAME 295 #define tGLOBAL 296 @@ -211,44 +213,46 @@ #define tREPEAT 307 #define tSET 308 #define tTHEN 309 -#define tTHENNL 310 -#define tTO 311 -#define tWHEN 312 -#define tWITH 313 -#define tWHILE 314 -#define tNLELSE 315 -#define tFACTORY 316 -#define tMETHOD 317 -#define tOPEN 318 -#define tPLAY 319 -#define tDONE 320 -#define tINSTANCE 321 -#define tGE 322 -#define tLE 323 -#define tGT 324 -#define tLT 325 -#define tEQ 326 -#define tNEQ 327 -#define tAND 328 -#define tOR 329 -#define tNOT 330 -#define tMOD 331 -#define tAFTER 332 -#define tBEFORE 333 -#define tCONCAT 334 -#define tCONTAINS 335 -#define tSTARTS 336 -#define tCHAR 337 -#define tITEM 338 -#define tLINE 339 -#define tWORD 340 -#define tSPRITE 341 -#define tINTERSECTS 342 -#define tWITHIN 343 -#define tTELL 344 -#define tPROPERTY 345 -#define tON 346 -#define tME 347 +#define tTO 310 +#define tWHEN 311 +#define tWITH 312 +#define tWHILE 313 +#define tNLELSE 314 +#define tFACTORY 315 +#define tMETHOD 316 +#define tOPEN 317 +#define tPLAY 318 +#define tDONE 319 +#define tINSTANCE 320 +#define tGE 321 +#define tLE 322 +#define tGT 323 +#define tLT 324 +#define tEQ 325 +#define tNEQ 326 +#define tAND 327 +#define tOR 328 +#define tNOT 329 +#define tMOD 330 +#define tAFTER 331 +#define tBEFORE 332 +#define tCONCAT 333 +#define tCONTAINS 334 +#define tSTARTS 335 +#define tCHAR 336 +#define tITEM 337 +#define tLINE 338 +#define tWORD 339 +#define tSPRITE 340 +#define tINTERSECTS 341 +#define tWITHIN 342 +#define tTELL 343 +#define tPROPERTY 344 +#define tON 345 +#define tME 346 +#define tENDIF 347 +#define tENDREPEAT 348 +#define tENDTELL 349 @@ -316,7 +320,7 @@ typedef union YYSTYPE Common::Array<double> *arr; } /* Line 193 of yacc.c. */ -#line 320 "engines/director/lingo/lingo-gr.cpp" +#line 324 "engines/director/lingo/lingo-gr.cpp" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -329,7 +333,7 @@ typedef union YYSTYPE /* Line 216 of yacc.c. */ -#line 333 "engines/director/lingo/lingo-gr.cpp" +#line 337 "engines/director/lingo/lingo-gr.cpp" #ifdef short # undef short @@ -544,20 +548,20 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 126 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1563 +#define YYLAST 1700 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 107 +#define YYNTOKENS 109 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 41 +#define YYNNTS 40 /* YYNRULES -- Number of rules. */ -#define YYNRULES 163 +#define YYNRULES 154 /* YYNRULES -- Number of states. */ -#define YYNSTATES 358 +#define YYNSTATES 324 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 347 +#define YYMAXUTOK 349 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -566,15 +570,15 @@ union yyalloc static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 99, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 101, 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, 98, 93, 2, - 100, 101, 96, 94, 106, 95, 2, 97, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 100, 95, 2, + 102, 103, 98, 96, 108, 97, 2, 99, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 103, 2, 102, 2, 2, 2, 2, 2, 2, 2, + 105, 2, 104, 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, 104, 2, 105, 2, 2, 2, 2, 2, 2, + 2, 106, 2, 107, 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, @@ -599,7 +603,7 @@ static const yytype_uint8 yytranslate[] = 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92 + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94 }; #if YYDEBUG @@ -610,88 +614,81 @@ static const yytype_uint16 yyprhs[] = 0, 0, 3, 7, 9, 12, 13, 15, 17, 22, 27, 32, 37, 42, 47, 52, 57, 63, 69, 71, 73, 75, 77, 79, 85, 96, 108, 112, 119, 124, - 135, 142, 152, 159, 160, 163, 170, 177, 179, 189, - 195, 200, 206, 211, 214, 218, 220, 222, 223, 224, - 225, 228, 231, 235, 237, 239, 241, 243, 245, 247, - 249, 251, 253, 256, 259, 264, 266, 269, 271, 275, - 279, 283, 287, 291, 295, 299, 303, 307, 311, 315, - 319, 323, 326, 330, 334, 338, 342, 345, 348, 352, - 356, 361, 366, 371, 378, 383, 390, 395, 402, 407, - 414, 416, 419, 422, 424, 426, 429, 431, 434, 437, - 440, 442, 445, 448, 450, 453, 458, 465, 470, 473, - 477, 479, 483, 485, 489, 491, 495, 498, 501, 504, - 507, 511, 514, 517, 519, 523, 526, 529, 532, 536, - 539, 540, 544, 545, 554, 557, 558, 567, 576, 583, - 586, 587, 589, 593, 598, 599, 601, 605, 606, 609, - 610, 612, 616, 618 + 134, 146, 147, 150, 157, 160, 164, 166, 168, 169, + 170, 171, 174, 177, 181, 183, 185, 187, 189, 191, + 193, 195, 197, 199, 202, 205, 210, 212, 215, 217, + 221, 225, 229, 233, 237, 241, 245, 249, 253, 257, + 261, 265, 269, 272, 276, 280, 284, 288, 291, 294, + 298, 302, 307, 312, 317, 324, 329, 336, 341, 348, + 353, 360, 362, 365, 368, 370, 372, 375, 377, 380, + 383, 386, 388, 391, 394, 396, 399, 404, 411, 416, + 419, 423, 425, 429, 431, 435, 437, 441, 444, 447, + 450, 453, 457, 460, 463, 465, 469, 472, 475, 478, + 482, 485, 486, 490, 491, 500, 503, 504, 513, 522, + 529, 532, 533, 535, 539, 544, 545, 547, 551, 552, + 555, 556, 558, 562, 564 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int16 yyrhs[] = { - 108, 0, -1, 108, 99, 109, -1, 109, -1, 1, - 99, -1, -1, 138, -1, 112, -1, 51, 127, 44, - 30, -1, 51, 127, 44, 128, -1, 51, 127, 77, - 127, -1, 51, 127, 78, 127, -1, 53, 30, 71, - 127, -1, 53, 15, 71, 127, -1, 53, 30, 56, - 127, -1, 53, 15, 56, 127, -1, 53, 16, 127, - 56, 127, -1, 53, 16, 126, 71, 127, -1, 145, - -1, 127, -1, 129, -1, 111, -1, 113, -1, 117, - 127, 123, 122, 34, -1, 118, 71, 127, 122, 56, - 127, 122, 123, 122, 34, -1, 118, 71, 127, 122, - 36, 56, 127, 122, 123, 122, 34, -1, 124, 111, - 122, -1, 125, 127, 99, 123, 122, 34, -1, 125, - 127, 56, 127, -1, 119, 127, 54, 121, 111, 122, - 114, 122, 116, 122, -1, 119, 127, 54, 121, 111, - 122, -1, 119, 127, 55, 123, 122, 114, 122, 116, - 122, -1, 119, 127, 55, 123, 122, 34, -1, -1, - 115, 114, -1, 120, 127, 54, 121, 111, 122, -1, - 120, 127, 55, 121, 123, 122, -1, 34, -1, 120, - 127, 54, 121, 111, 122, 37, 111, 122, -1, 37, - 121, 123, 122, 34, -1, 37, 121, 111, 122, -1, - 60, 121, 123, 122, 34, -1, 60, 121, 111, 122, - -1, 52, 59, -1, 52, 58, 30, -1, 43, -1, - 38, -1, -1, -1, -1, 123, 99, -1, 123, 112, - -1, 57, 30, 54, -1, 89, -1, 12, -1, 17, - -1, 33, -1, 31, -1, 30, -1, 126, -1, 128, - -1, 25, -1, 26, 127, -1, 27, 147, -1, 30, - 100, 146, 101, -1, 15, -1, 16, 127, -1, 110, - -1, 127, 94, 127, -1, 127, 95, 127, -1, 127, - 96, 127, -1, 127, 97, 127, -1, 127, 76, 127, - -1, 127, 102, 127, -1, 127, 103, 127, -1, 127, - 71, 127, -1, 127, 72, 127, -1, 127, 67, 127, - -1, 127, 68, 127, -1, 127, 73, 127, -1, 127, - 74, 127, -1, 75, 127, -1, 127, 93, 127, -1, - 127, 79, 127, -1, 127, 80, 127, -1, 127, 81, - 127, -1, 94, 127, -1, 95, 127, -1, 100, 127, - 101, -1, 104, 146, 105, -1, 86, 127, 87, 127, - -1, 86, 127, 88, 127, -1, 82, 127, 49, 127, - -1, 82, 127, 56, 127, 49, 127, -1, 83, 127, - 49, 127, -1, 83, 127, 56, 127, 49, 127, -1, - 84, 127, 49, 127, -1, 84, 127, 56, 127, 49, - 127, -1, 85, 127, 49, 127, -1, 85, 127, 56, - 127, 49, 127, -1, 92, -1, 29, 127, -1, 51, - 127, -1, 133, -1, 136, -1, 39, 52, -1, 39, - -1, 41, 130, -1, 90, 131, -1, 66, 132, -1, - 19, -1, 21, 127, -1, 20, 127, -1, 20, -1, - 22, 147, -1, 92, 100, 30, 101, -1, 92, 100, - 30, 106, 146, 101, -1, 63, 127, 58, 127, -1, - 63, 127, -1, 23, 30, 146, -1, 30, -1, 130, - 106, 30, -1, 30, -1, 131, 106, 30, -1, 30, - -1, 132, 106, 30, -1, 42, 45, -1, 42, 48, - -1, 42, 50, -1, 42, 134, -1, 42, 134, 135, - -1, 42, 135, -1, 40, 127, -1, 127, -1, 49, - 47, 127, -1, 47, 127, -1, 64, 65, -1, 64, - 134, -1, 64, 134, 135, -1, 64, 135, -1, -1, - 35, 137, 146, -1, -1, 46, 30, 139, 121, 142, - 99, 144, 123, -1, 61, 30, -1, -1, 62, 30, - 140, 121, 142, 99, 144, 123, -1, 141, 121, 142, - 99, 144, 123, 34, 143, -1, 141, 121, 142, 99, - 144, 123, -1, 91, 30, -1, -1, 30, -1, 142, - 106, 30, -1, 142, 99, 106, 30, -1, -1, 30, - -1, 143, 106, 30, -1, -1, 30, 147, -1, -1, - 127, -1, 146, 106, 127, -1, 127, -1, 147, 106, - 127, -1 + 110, 0, -1, 110, 101, 111, -1, 111, -1, 1, + 101, -1, -1, 139, -1, 114, -1, 51, 128, 44, + 30, -1, 51, 128, 44, 129, -1, 51, 128, 76, + 128, -1, 51, 128, 77, 128, -1, 53, 30, 70, + 128, -1, 53, 15, 70, 128, -1, 53, 30, 55, + 128, -1, 53, 15, 55, 128, -1, 53, 16, 128, + 55, 128, -1, 53, 16, 127, 70, 128, -1, 146, + -1, 128, -1, 130, -1, 113, -1, 115, -1, 118, + 128, 124, 123, 93, -1, 119, 70, 128, 123, 55, + 128, 123, 124, 123, 93, -1, 119, 70, 128, 123, + 36, 55, 128, 123, 124, 123, 93, -1, 125, 113, + 123, -1, 126, 128, 101, 124, 123, 94, -1, 126, + 128, 55, 128, -1, 120, 128, 54, 122, 124, 123, + 116, 123, 92, -1, 120, 128, 54, 122, 124, 123, + 116, 123, 37, 124, 92, -1, -1, 117, 116, -1, + 121, 128, 54, 122, 124, 123, -1, 52, 58, -1, + 52, 57, 30, -1, 43, -1, 38, -1, -1, -1, + -1, 124, 101, -1, 124, 114, -1, 56, 30, 54, + -1, 88, -1, 12, -1, 17, -1, 33, -1, 31, + -1, 30, -1, 127, -1, 129, -1, 25, -1, 26, + 128, -1, 27, 148, -1, 30, 102, 147, 103, -1, + 15, -1, 16, 128, -1, 112, -1, 128, 96, 128, + -1, 128, 97, 128, -1, 128, 98, 128, -1, 128, + 99, 128, -1, 128, 75, 128, -1, 128, 104, 128, + -1, 128, 105, 128, -1, 128, 70, 128, -1, 128, + 71, 128, -1, 128, 66, 128, -1, 128, 67, 128, + -1, 128, 72, 128, -1, 128, 73, 128, -1, 74, + 128, -1, 128, 95, 128, -1, 128, 78, 128, -1, + 128, 79, 128, -1, 128, 80, 128, -1, 96, 128, + -1, 97, 128, -1, 102, 128, 103, -1, 106, 147, + 107, -1, 85, 128, 86, 128, -1, 85, 128, 87, + 128, -1, 81, 128, 49, 128, -1, 81, 128, 55, + 128, 49, 128, -1, 82, 128, 49, 128, -1, 82, + 128, 55, 128, 49, 128, -1, 83, 128, 49, 128, + -1, 83, 128, 55, 128, 49, 128, -1, 84, 128, + 49, 128, -1, 84, 128, 55, 128, 49, 128, -1, + 91, -1, 29, 128, -1, 51, 128, -1, 134, -1, + 137, -1, 39, 52, -1, 39, -1, 41, 131, -1, + 89, 132, -1, 65, 133, -1, 19, -1, 21, 128, + -1, 20, 128, -1, 20, -1, 22, 148, -1, 91, + 102, 30, 103, -1, 91, 102, 30, 108, 147, 103, + -1, 62, 128, 57, 128, -1, 62, 128, -1, 23, + 30, 147, -1, 30, -1, 131, 108, 30, -1, 30, + -1, 132, 108, 30, -1, 30, -1, 133, 108, 30, + -1, 42, 45, -1, 42, 48, -1, 42, 50, -1, + 42, 135, -1, 42, 135, 136, -1, 42, 136, -1, + 40, 128, -1, 128, -1, 49, 47, 128, -1, 47, + 128, -1, 63, 64, -1, 63, 135, -1, 63, 135, + 136, -1, 63, 136, -1, -1, 35, 138, 147, -1, + -1, 46, 30, 140, 122, 143, 101, 145, 124, -1, + 60, 30, -1, -1, 61, 30, 141, 122, 143, 101, + 145, 124, -1, 142, 122, 143, 101, 145, 124, 34, + 144, -1, 142, 122, 143, 101, 145, 124, -1, 90, + 30, -1, -1, 30, -1, 143, 108, 30, -1, 143, + 101, 108, 30, -1, -1, 30, -1, 144, 108, 30, + -1, -1, 30, 148, -1, -1, 128, -1, 147, 108, + 128, -1, 128, -1, 148, 108, 128, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -699,21 +696,20 @@ static const yytype_uint16 yyrline[] = { 0, 120, 120, 121, 122, 125, 126, 127, 130, 136, 139, 140, 141, 147, 154, 160, 167, 173, 181, 182, - 183, 186, 187, 192, 205, 223, 237, 242, 245, 250, - 260, 270, 280, 292, 293, 296, 302, 310, 311, 317, - 321, 324, 328, 332, 335, 342, 349, 357, 360, 363, - 364, 365, 368, 374, 378, 381, 384, 387, 390, 396, - 397, 398, 401, 404, 405, 408, 416, 422, 423, 424, - 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, - 455, 458, 463, 464, 465, 466, 467, 468, 469, 470, - 471, 474, 477, 480, 484, 485, 486, 487, 488, 489, - 492, 493, 496, 497, 500, 501, 512, 513, 514, 515, - 519, 523, 529, 530, 533, 534, 537, 538, 542, 546, - 550, 550, 580, 580, 585, 586, 586, 591, 598, 604, - 606, 607, 608, 609, 612, 613, 614, 617, 621, 629, - 630, 631, 634, 635 + 183, 186, 187, 192, 203, 220, 232, 237, 239, 244, + 254, 266, 267, 270, 278, 281, 288, 295, 303, 306, + 309, 310, 311, 314, 320, 324, 327, 330, 333, 336, + 342, 343, 344, 347, 350, 351, 354, 362, 368, 369, + 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, + 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, + 400, 401, 404, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 420, 423, 426, 430, 431, 432, 433, 434, + 435, 438, 439, 442, 443, 446, 447, 458, 459, 460, + 461, 465, 469, 475, 476, 479, 480, 483, 484, 488, + 492, 496, 496, 526, 526, 531, 532, 532, 537, 544, + 550, 552, 553, 554, 555, 558, 559, 560, 563, 567, + 575, 576, 577, 580, 581 }; #endif @@ -728,19 +724,19 @@ static const char *const yytname[] = "BLTINNOARGS", "BLTINNOARGSORONE", "BLTINONEARG", "BLTINARGLIST", "TWOWORDBUILTIN", "FBLTIN", "FBLTINNOARGS", "FBLTINONEARG", "FBLTINARGLIST", "RBLTIN", "RBLTINONEARG", "ID", "STRING", "HANDLER", - "SYMBOL", "ENDCLAUSE", "tPLAYACCEL", "tDOWN", "tELSE", "tNLELSIF", - "tEXIT", "tFRAME", "tGLOBAL", "tGO", "tIF", "tINTO", "tLOOP", "tMACRO", - "tMOVIE", "tNEXT", "tOF", "tPREVIOUS", "tPUT", "tREPEAT", "tSET", - "tTHEN", "tTHENNL", "tTO", "tWHEN", "tWITH", "tWHILE", "tNLELSE", - "tFACTORY", "tMETHOD", "tOPEN", "tPLAY", "tDONE", "tINSTANCE", "tGE", - "tLE", "tGT", "tLT", "tEQ", "tNEQ", "tAND", "tOR", "tNOT", "tMOD", - "tAFTER", "tBEFORE", "tCONCAT", "tCONTAINS", "tSTARTS", "tCHAR", "tITEM", - "tLINE", "tWORD", "tSPRITE", "tINTERSECTS", "tWITHIN", "tTELL", - "tPROPERTY", "tON", "tME", "'&'", "'+'", "'-'", "'*'", "'/'", "'%'", + "SYMBOL", "ENDCLAUSE", "tPLAYACCEL", "tDOWN", "tELSE", "tELSIF", "tEXIT", + "tFRAME", "tGLOBAL", "tGO", "tIF", "tINTO", "tLOOP", "tMACRO", "tMOVIE", + "tNEXT", "tOF", "tPREVIOUS", "tPUT", "tREPEAT", "tSET", "tTHEN", "tTO", + "tWHEN", "tWITH", "tWHILE", "tNLELSE", "tFACTORY", "tMETHOD", "tOPEN", + "tPLAY", "tDONE", "tINSTANCE", "tGE", "tLE", "tGT", "tLT", "tEQ", "tNEQ", + "tAND", "tOR", "tNOT", "tMOD", "tAFTER", "tBEFORE", "tCONCAT", + "tCONTAINS", "tSTARTS", "tCHAR", "tITEM", "tLINE", "tWORD", "tSPRITE", + "tINTERSECTS", "tWITHIN", "tTELL", "tPROPERTY", "tON", "tME", "tENDIF", + "tENDREPEAT", "tENDTELL", "'&'", "'+'", "'-'", "'*'", "'/'", "'%'", "'\\n'", "'('", "')'", "'>'", "'<'", "'['", "']'", "','", "$accept", "program", "programline", "asgn", "stmtoneliner", "stmt", "ifstmt", - "elseifstmtlist", "elseifstmt", "endifstmt", "repeatwhile", "repeatwith", - "if", "elseif", "begin", "end", "stmtlist", "when", "tell", "simpleexpr", + "elseifstmtlist", "elseifstmt", "repeatwhile", "repeatwith", "if", + "elseif", "begin", "end", "stmtlist", "when", "tell", "simpleexpr", "expr", "reference", "proc", "globallist", "propertylist", "instancelist", "gotofunc", "gotoframe", "gotomovie", "playfunc", "@1", "defn", "@2", "@3", "on", "argdef", "endargdef", "argstore", "macro", @@ -762,31 +758,30 @@ static const yytype_uint16 yytoknum[] = 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 38, 43, 45, 42, 47, 37, 10, - 40, 41, 62, 60, 91, 93, 44 + 345, 346, 347, 348, 349, 38, 43, 45, 42, 47, + 37, 10, 40, 41, 62, 60, 91, 93, 44 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 107, 108, 108, 108, 109, 109, 109, 110, 110, - 110, 110, 110, 110, 110, 110, 110, 110, 111, 111, - 111, 112, 112, 112, 112, 112, 112, 112, 112, 113, - 113, 113, 113, 114, 114, 115, 115, 116, 116, 116, - 116, 116, 116, 117, 118, 119, 120, 121, 122, 123, - 123, 123, 124, 125, 126, 126, 126, 126, 126, 127, - 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, - 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, - 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, - 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, - 127, 128, 129, 129, 129, 129, 129, 129, 129, 129, - 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, - 130, 130, 131, 131, 132, 132, 133, 133, 133, 133, - 133, 133, 134, 134, 135, 135, 136, 136, 136, 136, - 137, 136, 139, 138, 138, 140, 138, 138, 138, 141, - 142, 142, 142, 142, 143, 143, 143, 144, 145, 146, - 146, 146, 147, 147 + 0, 109, 110, 110, 110, 111, 111, 111, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 113, 113, + 113, 114, 114, 114, 114, 114, 114, 114, 114, 115, + 115, 116, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 124, 124, 125, 126, 127, 127, 127, 127, 127, + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 129, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 131, 131, 132, 132, 133, 133, 134, 134, 134, + 134, 134, 134, 135, 135, 136, 136, 137, 137, 137, + 137, 138, 137, 140, 139, 139, 141, 139, 139, 139, + 142, 143, 143, 143, 143, 144, 144, 144, 145, 146, + 147, 147, 147, 148, 148 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -794,21 +789,20 @@ static const yytype_uint8 yyr2[] = { 0, 2, 3, 1, 2, 0, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 1, 1, - 1, 1, 1, 5, 10, 11, 3, 6, 4, 10, - 6, 9, 6, 0, 2, 6, 6, 1, 9, 5, - 4, 5, 4, 2, 3, 1, 1, 0, 0, 0, - 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 2, 4, 1, 2, 1, 3, 3, + 1, 1, 1, 5, 10, 11, 3, 6, 4, 9, + 11, 0, 2, 6, 2, 3, 1, 1, 0, 0, + 0, 2, 2, 3, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 2, 2, 4, 1, 2, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 2, 3, 3, 3, 3, 2, 2, 3, 3, - 4, 4, 4, 6, 4, 6, 4, 6, 4, 6, - 1, 2, 2, 1, 1, 2, 1, 2, 2, 2, - 1, 2, 2, 1, 2, 4, 6, 4, 2, 3, - 1, 3, 1, 3, 1, 3, 2, 2, 2, 2, - 3, 2, 2, 1, 3, 2, 2, 2, 3, 2, - 0, 3, 0, 8, 2, 0, 8, 8, 6, 2, - 0, 1, 3, 4, 0, 1, 3, 0, 2, 0, - 1, 3, 1, 3 + 3, 3, 2, 3, 3, 3, 3, 2, 2, 3, + 3, 4, 4, 4, 6, 4, 6, 4, 6, 4, + 6, 1, 2, 2, 1, 1, 2, 1, 2, 2, + 2, 1, 2, 2, 1, 2, 4, 6, 4, 2, + 3, 1, 3, 1, 3, 1, 3, 2, 2, 2, + 2, 3, 2, 2, 1, 3, 2, 2, 2, 3, + 2, 0, 3, 0, 8, 2, 0, 8, 8, 6, + 2, 0, 1, 3, 4, 0, 1, 3, 0, 2, + 0, 1, 3, 1, 3 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -816,105 +810,97 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 0, 0, 54, 65, 0, 55, 110, 113, 0, 0, - 0, 61, 0, 0, 0, 58, 57, 56, 140, 106, - 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, - 0, 0, 100, 0, 0, 0, 159, 0, 3, 67, - 21, 7, 22, 0, 0, 0, 0, 0, 59, 19, - 60, 20, 103, 104, 6, 47, 18, 4, 58, 0, - 100, 66, 112, 111, 162, 114, 159, 62, 63, 101, - 159, 158, 159, 105, 120, 107, 0, 126, 0, 127, - 0, 128, 133, 129, 131, 142, 102, 0, 43, 0, - 0, 0, 0, 144, 145, 118, 136, 137, 139, 124, - 109, 81, 0, 0, 0, 0, 0, 122, 108, 149, - 0, 86, 87, 0, 160, 0, 1, 5, 49, 0, - 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 45, 56, 0, 46, 101, 104, 0, 0, + 0, 52, 0, 0, 0, 49, 48, 47, 131, 97, + 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, + 0, 0, 91, 0, 0, 0, 150, 0, 3, 58, + 21, 7, 22, 0, 0, 0, 0, 0, 50, 19, + 51, 20, 94, 95, 6, 38, 18, 4, 49, 0, + 91, 57, 103, 102, 153, 105, 150, 53, 54, 92, + 150, 149, 150, 96, 111, 98, 0, 117, 0, 118, + 0, 119, 124, 120, 122, 133, 93, 0, 34, 0, + 0, 0, 0, 135, 136, 109, 127, 128, 130, 115, + 100, 72, 0, 0, 0, 0, 0, 113, 99, 140, + 0, 77, 78, 0, 151, 0, 1, 5, 40, 0, + 0, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 150, 159, 0, 0, 119, 160, 0, 141, 0, 132, - 135, 0, 130, 47, 0, 0, 0, 44, 0, 0, - 59, 0, 0, 0, 52, 47, 0, 138, 0, 0, + 141, 150, 0, 0, 110, 151, 0, 132, 0, 123, + 126, 0, 121, 38, 0, 0, 0, 35, 0, 0, + 50, 0, 0, 0, 43, 38, 0, 129, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 88, 89, 0, 2, 48, 48, 47, 49, 26, - 0, 49, 77, 78, 75, 76, 79, 80, 72, 83, - 84, 85, 82, 68, 69, 70, 71, 73, 74, 151, - 0, 163, 64, 121, 134, 150, 8, 9, 10, 11, - 15, 13, 0, 0, 14, 12, 150, 117, 125, 92, - 0, 94, 0, 96, 0, 98, 0, 90, 91, 123, - 115, 159, 161, 50, 51, 0, 0, 0, 48, 28, - 48, 157, 0, 0, 17, 16, 0, 0, 0, 0, - 0, 0, 23, 0, 0, 48, 33, 0, 0, 49, - 152, 157, 157, 93, 95, 97, 99, 116, 0, 48, - 30, 32, 46, 48, 33, 0, 27, 153, 148, 49, - 49, 48, 49, 48, 0, 34, 0, 154, 143, 146, - 49, 48, 0, 37, 47, 47, 48, 0, 47, 47, - 155, 147, 48, 0, 48, 49, 49, 31, 0, 0, - 49, 0, 0, 24, 29, 48, 48, 48, 48, 47, - 48, 48, 156, 25, 40, 0, 42, 0, 0, 35, - 36, 39, 41, 48, 0, 0, 48, 38 + 0, 79, 80, 0, 2, 39, 39, 38, 26, 0, + 40, 68, 69, 66, 67, 70, 71, 63, 74, 75, + 76, 73, 59, 60, 61, 62, 64, 65, 142, 0, + 154, 55, 112, 125, 141, 8, 9, 10, 11, 15, + 13, 0, 0, 14, 12, 141, 108, 116, 83, 0, + 85, 0, 87, 0, 89, 0, 81, 82, 114, 106, + 150, 152, 41, 42, 0, 0, 40, 28, 39, 148, + 0, 0, 17, 16, 0, 0, 0, 0, 0, 0, + 23, 0, 0, 39, 0, 0, 40, 143, 148, 148, + 84, 86, 88, 90, 107, 0, 39, 31, 27, 144, + 139, 40, 40, 39, 40, 37, 39, 31, 0, 145, + 134, 137, 40, 39, 0, 32, 0, 146, 138, 39, + 0, 40, 29, 38, 0, 0, 24, 0, 40, 147, + 25, 30, 39, 33 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 47, 48, 49, 50, 254, 52, 293, 294, 316, - 53, 54, 55, 295, 150, 199, 195, 56, 57, 58, - 59, 60, 61, 85, 118, 110, 62, 93, 94, 63, - 82, 64, 163, 175, 65, 220, 321, 279, 66, 156, - 75 + -1, 47, 48, 49, 50, 253, 52, 296, 297, 53, + 54, 55, 298, 150, 198, 195, 56, 57, 58, 59, + 60, 61, 85, 118, 110, 62, 93, 94, 63, 82, + 64, 163, 175, 65, 219, 308, 276, 66, 156, 75 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -289 +#define YYPACT_NINF -211 static const yytype_int16 yypact[] = { - 341, -37, -289, -289, 887, -289, -289, 887, 887, 887, - 26, -289, 887, 887, 887, 927, -289, -289, -289, 18, - 43, 766, -289, 67, 887, 8, -2, 87, 88, 89, - 887, 806, 90, 887, 887, 887, 887, 887, 887, -289, - 93, 94, 27, 887, 887, 887, 887, 6, -289, -289, - -289, -289, -289, 887, 55, 887, 685, 887, -289, 1427, - -289, -289, -289, -289, -289, -289, -289, -289, 46, 887, - -289, 1427, 1427, 1427, 1427, 42, 887, 1427, 42, 1427, - 887, 42, 887, -289, -289, 44, 887, -289, 887, -289, - 104, -289, 1427, 30, -289, -289, 961, 122, -289, -33, - 887, -10, 99, -289, -289, 1324, -289, 30, -289, -289, - 48, -43, 19, 994, 1027, 1060, 1357, -289, 49, -289, - 126, -43, -43, 1390, 1427, -3, -289, 427, 1427, 887, - 146, -289, 1291, 887, 887, 887, 887, 887, 887, 887, - 887, 887, 887, 887, 887, 887, 887, 887, 887, 887, - 128, 887, 961, 887, 53, 1390, -21, 53, 130, 1427, - 1427, 887, -289, -289, 79, 887, 887, -289, 887, 887, - 92, 661, 887, 887, -289, -289, 887, -289, 136, 887, - 887, 887, 887, 887, 887, 887, 887, 887, 887, 137, - -12, -289, -289, 887, -289, 599, 1427, -289, -289, -289, - 887, -289, 158, 158, 158, 158, 1460, 1460, -43, 1427, - 158, 158, 201, 229, 229, -43, -43, 1427, 1427, -289, - -51, 1427, -289, -289, 1427, 128, -289, -289, 1427, 1427, - 1427, 158, 887, 887, 1427, 158, 128, 1427, -289, 1427, - 1093, 1427, 1126, 1427, 1159, 1427, 1192, 1427, 1427, -289, - -289, 887, 1427, -289, -289, 139, -11, 685, 599, 1427, - 599, 64, 141, -49, 158, 1427, -35, 887, 887, 887, - 887, 0, -289, 118, 887, -289, 20, 154, 162, -289, - -289, 64, 64, 1427, 1427, 1427, 1427, -289, 887, 1427, - 155, -289, -289, -289, 155, 887, -289, -289, 513, -289, - -289, 1427, -289, -289, -16, -289, 1225, 167, 599, 599, - -289, 599, -16, -289, -289, -289, -289, 887, -289, -289, - -289, 96, 599, 164, -289, 685, 685, -289, 1258, 685, - -289, 169, 170, -289, -289, -289, 599, -289, 599, -289, - -289, 599, -289, -289, -289, 173, -289, 175, 685, -289, - -289, -289, -289, -289, 178, 685, -289, -289 + 257, -77, -211, -211, 895, -211, -211, 895, 895, 895, + 16, -211, 895, 895, 895, 973, -211, -211, -211, -2, + 28, 775, -211, 37, 895, -42, 6, 39, 45, 47, + 895, 853, 49, 895, 895, 895, 895, 895, 895, -211, + 55, 59, 8, 895, 895, 895, 895, 2, -211, -211, + -211, -211, -211, 895, 13, 895, 697, 895, -211, 1559, + -211, -211, -211, -211, -211, -211, -211, -211, 12, 895, + -211, 1559, 1559, 1559, 1559, -13, 895, 1559, -13, 1559, + 895, -13, 895, -211, -211, -3, 895, -211, 895, -211, + 71, -211, 1559, 7, -211, -211, 1015, 96, -211, -32, + 895, -7, 94, -211, -211, 1447, -211, 7, -211, -211, + 42, -60, 1051, 1087, 1123, 1159, 1483, -211, 44, -211, + 123, -60, -60, 1519, 1559, 5, -211, 345, 1559, 895, + 941, -211, 1375, 895, 895, 895, 895, 895, 895, 895, + 895, 895, 895, 895, 895, 895, 895, 895, 895, 895, + 124, 895, 1015, 895, 48, 1519, -6, 48, 125, 1559, + 1559, 895, -211, -211, 87, 895, 895, -211, 895, 895, + 88, 1411, 895, 895, -211, -211, 895, -211, 129, 895, + 895, 895, 895, 895, 895, 895, 895, 895, 895, 130, + 1, -211, -211, 895, -211, 609, 1559, -211, -211, 895, + -211, -5, -5, -5, -5, 1595, 1595, -60, 1559, -5, + -5, 23, -18, -18, -60, -60, 1559, 1559, -211, -49, + 1559, -211, -211, 1559, 124, -211, -211, 1559, 1559, 1559, + -5, 895, 895, 1559, -5, 124, 1559, -211, 1559, 1195, + 1559, 1231, 1559, 1267, 1559, 1303, 1559, 1559, -211, -211, + 895, 1559, -211, -211, 70, -8, -211, 1559, 609, 58, + 137, -46, -5, 1559, -37, 895, 895, 895, 895, 3, + -211, 118, 895, 609, 80, 156, -211, -211, 58, 58, + 1559, 1559, 1559, 1559, -211, 895, 1559, 149, -211, -211, + 433, -211, -211, 1559, -211, -211, -211, 149, 895, 158, + 609, 609, -211, 609, -31, -211, 1339, -211, 82, 609, + 99, -211, -211, -211, 163, 101, -211, 521, -211, -211, + -211, -211, 609, -211 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -289, -289, 83, -289, -54, 1, -289, -275, -289, -91, - -289, -289, -289, -288, -128, -1, -94, -289, -289, 123, - -4, 60, -289, -289, -289, -289, -289, 199, -19, -289, - -289, -289, -289, -289, -289, -173, -289, -171, -289, -39, - 68 + -211, -211, 69, -211, 141, 19, -211, -98, -211, -211, + -211, -211, -211, -162, -88, -85, -211, -211, 100, -4, + 38, -211, -211, -211, -211, -211, 170, -19, -211, -211, + -211, -211, -211, -211, -210, -211, -155, -211, -39, 53 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -924,324 +910,352 @@ static const yytype_int16 yypgoto[] = #define YYTABLE_NINF -6 static const yytype_int16 yytable[] = { - 71, 51, 131, 72, 73, 74, 126, 125, 77, 74, - 79, 74, 108, 99, 100, 303, 317, 92, 313, 305, - 96, 314, 292, 168, 317, 273, 105, 92, 101, 111, - 112, 113, 114, 115, 116, 225, 140, 154, 169, 121, - 122, 123, 124, 157, 315, 274, 172, 236, 261, 128, - 281, 130, 263, 132, 291, 262, 76, 262, 292, 148, - 149, 173, 67, 266, 282, 152, 97, 98, 179, 257, - 83, 262, 124, 84, 162, 180, 155, 88, 124, 90, - 222, 78, 159, 81, 160, 193, 133, 134, 177, 250, - 135, 136, 137, 138, 251, 139, 171, 95, 140, 141, - 142, 287, 192, 193, 258, 127, 193, 260, 14, 226, - 299, 300, 143, 144, 145, 146, 147, 102, 103, 104, - 109, 148, 149, 117, 119, 196, 129, 120, 51, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 151, 124, 153, 221, - 158, 161, 167, 174, 178, 189, 190, 224, 219, 193, - 223, 228, 229, 232, 230, 231, 238, 249, 234, 235, - 278, 280, 237, 272, 288, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 298, 325, 326, 296, 252, - 329, 330, 297, 292, 255, 256, 259, 320, 333, 342, - 197, 198, 331, 275, 343, 308, 309, 351, 311, 352, - 194, 348, 271, 133, 134, 355, 322, 135, 136, 137, - 138, 324, 139, 170, 227, 140, 141, 142, 264, 265, - 107, 336, 338, 0, 139, 0, 341, 140, 0, 143, - 144, 145, 146, 147, 0, 0, 0, 124, 148, 149, - 0, 143, 144, 145, 146, 147, 0, 276, 0, 277, - 148, 149, 0, 283, 284, 285, 286, 0, 0, 0, - 289, 335, 337, 0, 290, 340, 0, 139, 0, 0, - 140, 0, 0, 0, 301, 0, 0, 0, 302, 0, - 0, 306, 304, 0, 353, 144, 145, 146, 147, 0, - 310, 356, 312, 148, 149, 139, 0, 0, 140, 0, - 323, 0, 0, 328, 0, 327, 0, 0, 0, 0, - 0, 332, 0, 334, 0, 146, 147, 0, 0, 0, - 0, 148, 149, 0, 344, 345, 346, 347, 0, 349, - 350, -5, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 354, 2, 0, 357, 3, 4, 5, 0, - 6, 7, 8, 9, 10, 0, 11, 12, 13, 0, - 14, 15, 16, 0, 17, 0, 18, 0, 0, 0, - 19, 0, 20, 21, 22, 0, 0, 23, 0, 0, - 0, 0, 24, 25, 26, 0, 0, 0, 27, 0, - 0, 0, 28, 29, 30, 31, 0, 32, 0, 0, - 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, - 0, 0, 0, 34, 35, 36, 37, 38, 0, 0, - 39, 40, 41, 42, 0, 43, 44, 0, 0, 2, - -5, 45, 3, 4, 5, 46, 6, 7, 8, 9, - 10, 0, 11, 12, 13, 0, 14, 15, 16, 0, - 17, 0, 18, 0, 0, 0, 19, 0, 20, 21, + 71, 224, 126, 72, 73, 74, 311, 125, 77, 74, + 79, 74, 108, 235, 261, 97, 98, 92, 140, 51, + 96, 99, 100, 168, 67, 264, 105, 92, 271, 111, + 112, 113, 114, 115, 116, 256, 101, 154, 169, 121, + 122, 123, 124, 157, 148, 149, 76, 272, 172, 128, + 83, 130, 259, 132, 88, 278, 90, 139, 84, 260, + 140, 312, 260, 173, 279, 152, 78, 95, 81, 102, + 139, 260, 124, 140, 162, 103, 155, 104, 124, 109, + 146, 147, 159, 129, 160, 117, 148, 149, 177, 119, + 143, 144, 145, 146, 147, 153, 171, 221, 139, 148, + 149, 140, 193, 127, 249, 158, 284, 254, 255, 250, + 120, 193, 192, 193, 151, 258, 14, 225, 161, 144, + 145, 146, 147, 291, 292, 196, 167, 148, 149, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 51, 124, 174, 220, + 178, 318, 189, 190, 218, 222, 193, 223, 231, 237, + 248, 227, 228, 270, 229, 230, 275, 277, 233, 234, + 274, 273, 236, 285, 288, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 287, 289, 295, 307, 251, + 314, 290, 316, 319, 320, 257, 194, 131, 294, 305, + 170, 107, 226, 0, 0, 302, 300, 301, 304, 303, + 0, 269, 0, 0, 0, 310, 0, 309, 0, 0, + 0, 315, 0, 0, 0, 0, 317, 262, 263, 0, + 0, 0, 0, 322, 323, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 124, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, -5, 1, 0, + 0, 280, 281, 282, 283, 0, 0, 0, 286, 2, + 0, 0, 3, 4, 5, 0, 6, 7, 8, 9, + 10, 293, 11, 12, 13, 0, 14, 15, 16, 0, + 17, 0, 18, 0, 306, 0, 19, 0, 20, 21, 22, 0, 0, 23, 0, 0, 0, 0, 24, 25, - 26, 0, 0, 0, 27, 0, 0, 0, 28, 29, - 30, 31, 0, 32, 0, 0, 0, 0, 0, 0, - 0, 0, 33, 0, 0, 0, 0, 0, 0, 34, - 35, 36, 37, 38, 0, 0, 39, 40, 41, 42, + 26, 0, 0, 27, 0, 0, 0, 28, 29, 30, + 31, 0, 32, 0, 0, 0, 0, 0, 0, 0, + 0, 33, 0, 0, 0, 0, 0, 0, 34, 35, + 36, 37, 38, 0, 0, 39, 40, 41, 42, 0, + 0, 0, 0, 43, 44, 0, 0, 2, -5, 45, + 3, 4, 5, 46, 6, 7, 8, 9, 10, 0, + 11, 12, 13, 0, 14, 15, 16, 0, 17, 0, + 18, 0, 0, 0, 19, 0, 20, 21, 22, 0, + 0, 23, 0, 0, 0, 0, 24, 25, 26, 0, + 0, 27, 0, 0, 0, 28, 29, 30, 31, 0, + 32, 0, 0, 0, 0, 0, 0, 0, 0, 33, + 0, 0, 0, 0, 0, 0, 34, 35, 36, 37, + 38, 0, 0, 39, 40, 41, 42, 0, 0, 0, 0, 43, 44, 0, 0, 2, 0, 45, 3, 4, 5, 46, 6, 7, 8, 9, 10, 0, 11, 12, - 13, 0, 14, 15, 16, 0, 17, 307, 18, 0, + 13, 0, 14, 15, 16, 0, 17, 299, 18, 0, 0, 0, 19, 0, 20, 21, 22, 0, 0, 0, - 0, 0, 0, 0, 24, 25, 26, 0, 0, 0, - 27, 0, 0, 0, 0, 0, 30, 31, 0, 32, - 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, - 0, 0, 0, 0, 0, 34, 35, 36, 37, 38, - 0, 0, 39, 40, 0, 42, 0, 43, 44, 0, - 0, 2, 253, 45, 3, 4, 5, 46, 6, 7, + 0, 0, 0, 0, 24, 25, 26, 0, 0, 27, + 0, 0, 0, 0, 0, 30, 31, 0, 32, 0, + 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, + 0, 0, 0, 0, 34, 35, 36, 37, 38, 0, + 0, 39, 40, 0, 42, 0, 0, 0, 0, 43, + 44, 0, 0, 2, 252, 45, 3, 4, 5, 46, + 6, 7, 8, 9, 10, 0, 11, 12, 13, 0, + 14, 15, 16, 0, 17, 0, 18, 0, 0, 0, + 19, 0, 20, 21, 22, 0, 0, 0, 0, 0, + 0, 0, 24, 25, 26, 0, 0, 27, 0, 0, + 0, 0, 0, 30, 31, 0, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, + 0, 0, 34, 35, 36, 37, 38, 0, 0, 39, + 40, 0, 42, 321, 0, 0, 0, 43, 44, 0, + 0, 2, 252, 45, 3, 4, 5, 46, 6, 7, 8, 9, 10, 0, 11, 12, 13, 0, 14, 15, 16, 0, 17, 0, 18, 0, 0, 0, 19, 0, 20, 21, 22, 0, 0, 0, 0, 0, 0, 0, - 24, 25, 26, 0, 0, 0, 27, 0, 0, 0, - 0, 0, 30, 31, 0, 32, 0, 0, 0, 0, - 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, - 0, 34, 35, 36, 37, 38, 0, 0, 39, 40, - 0, 42, 0, 43, 44, 0, 0, 2, 253, 45, - 3, 4, 5, 46, 6, 7, 8, 9, 10, 0, - 11, 12, 13, 0, 14, 15, 16, 233, 17, 0, - 18, 0, 0, 0, 19, 0, 20, 21, 133, 134, - 0, 0, 135, 136, 137, 138, 24, 139, 26, 0, - 140, 141, 142, 0, 0, 0, 0, 0, 30, 31, - 0, 32, 0, 0, 143, 144, 145, 146, 147, 0, - 33, 0, 0, 148, 149, 0, 0, 34, 35, 36, - 37, 38, 0, 0, 0, 40, 0, 42, 2, 43, - 44, 3, 4, 5, 0, 45, 0, 0, 0, 46, - 0, 11, 12, 13, 0, 14, 68, 16, 0, 17, - 0, 0, 0, 0, 0, 0, 86, 0, 0, 0, - 0, 87, 0, 88, 89, 90, 91, 69, 2, 26, - 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, - 0, 11, 12, 13, 0, 14, 68, 16, 0, 17, - 0, 33, 0, 0, 0, 0, 86, 0, 34, 35, - 36, 37, 38, 88, 0, 90, 0, 69, 70, 26, - 43, 44, 0, 0, 0, 0, 45, 0, 0, 0, - 46, 106, 0, 0, 0, 0, 0, 0, 0, 0, + 24, 25, 26, 0, 0, 27, 0, 0, 0, 0, + 0, 30, 31, 0, 32, 0, 0, 0, 0, 0, + 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, + 34, 35, 36, 37, 38, 0, 0, 39, 40, 0, + 42, 0, 0, 0, 0, 43, 44, 0, 0, 2, + 252, 45, 3, 4, 5, 46, 6, 7, 8, 9, + 10, 0, 11, 12, 13, 0, 14, 15, 16, 0, + 17, 0, 18, 0, 0, 0, 19, 0, 20, 21, + 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, + 26, 0, 0, 0, 0, 0, 0, 0, 0, 30, + 31, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 34, 35, - 36, 37, 38, 0, 0, 0, 0, 0, 70, 2, - 43, 44, 3, 4, 5, 0, 45, 0, 0, 0, - 46, 0, 11, 12, 13, 0, 14, 68, 16, 0, - 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 69, 2, - 26, 0, 3, 4, 5, 0, 0, 0, 0, 0, - 0, 0, 11, 12, 13, 0, 14, 68, 16, 0, - 17, 0, 33, 0, 0, 0, 0, 0, 0, 34, - 35, 36, 37, 38, 0, 0, 0, 0, 69, 70, - 26, 43, 44, 0, 0, 0, 0, 45, 0, 0, - 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 33, 0, 0, 164, 0, 0, 0, 34, - 35, 36, 37, 38, 0, 0, 0, 0, 0, 70, - 0, 43, 44, 0, 0, 0, 0, 80, 133, 134, - 0, 46, 135, 136, 137, 138, 0, 139, 165, 166, - 140, 141, 142, 181, 0, 0, 0, 0, 0, 0, - 182, 0, 0, 0, 143, 144, 145, 146, 147, 0, + 36, 37, 38, 0, 0, 0, 40, 2, 42, 0, + 3, 4, 5, 43, 44, 0, 0, 0, 0, 45, + 11, 12, 13, 46, 14, 68, 16, 0, 17, 0, + 0, 0, 0, 0, 0, 86, 0, 0, 0, 0, + 87, 0, 88, 89, 90, 91, 69, 0, 26, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, + 0, 0, 0, 0, 0, 0, 34, 35, 36, 37, + 38, 0, 0, 0, 0, 2, 70, 0, 3, 4, + 5, 43, 44, 0, 0, 0, 0, 45, 11, 12, + 13, 46, 14, 68, 16, 0, 17, 0, 0, 0, + 0, 0, 0, 86, 0, 0, 0, 0, 0, 0, + 88, 0, 90, 0, 69, 0, 26, 2, 0, 0, + 3, 4, 5, 0, 0, 0, 0, 106, 0, 0, + 11, 12, 13, 0, 14, 68, 16, 33, 17, 0, + 0, 0, 0, 0, 34, 35, 36, 37, 38, 0, + 0, 0, 0, 0, 70, 0, 69, 0, 26, 43, + 44, 0, 0, 0, 0, 45, 0, 0, 0, 46, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, + 0, 0, 0, 0, 0, 0, 34, 35, 36, 37, + 38, 0, 0, 0, 0, 2, 70, 0, 3, 4, + 5, 43, 44, 0, 0, 197, 0, 45, 11, 12, + 13, 46, 14, 68, 16, 0, 17, 133, 134, 0, + 0, 135, 136, 137, 138, 0, 139, 0, 0, 140, + 141, 142, 0, 0, 69, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 143, 144, 145, 146, + 147, 0, 0, 0, 0, 148, 149, 33, 0, 0, + 0, 0, 0, 0, 34, 35, 36, 37, 38, 164, + 0, 0, 0, 0, 70, 0, 0, 0, 0, 43, + 44, 0, 0, 0, 0, 80, 0, 0, 0, 46, + 0, 133, 134, 0, 0, 135, 136, 137, 138, 0, + 139, 165, 166, 140, 141, 142, 0, 0, 0, 0, + 179, 0, 0, 0, 0, 0, 180, 0, 0, 0, + 143, 144, 145, 146, 147, 0, 0, 133, 134, 148, + 149, 135, 136, 137, 138, 0, 139, 0, 0, 140, + 141, 142, 0, 0, 0, 0, 181, 0, 0, 0, + 0, 0, 182, 0, 0, 0, 143, 144, 145, 146, + 147, 0, 0, 133, 134, 148, 149, 135, 136, 137, + 138, 0, 139, 0, 0, 140, 141, 142, 0, 0, + 0, 0, 183, 0, 0, 0, 0, 0, 184, 0, + 0, 0, 143, 144, 145, 146, 147, 0, 0, 133, + 134, 148, 149, 135, 136, 137, 138, 0, 139, 0, + 0, 140, 141, 142, 0, 0, 0, 0, 185, 0, + 0, 0, 0, 0, 186, 0, 0, 0, 143, 144, + 145, 146, 147, 0, 0, 133, 134, 148, 149, 135, + 136, 137, 138, 0, 139, 0, 0, 140, 141, 142, + 0, 0, 0, 0, 265, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 143, 144, 145, 146, 147, 0, 0, 133, 134, 148, 149, 135, 136, 137, 138, 0, - 139, 0, 0, 140, 141, 142, 183, 0, 0, 0, - 0, 0, 0, 184, 0, 0, 0, 143, 144, 145, - 146, 147, 0, 0, 133, 134, 148, 149, 135, 136, - 137, 138, 0, 139, 0, 0, 140, 141, 142, 185, - 0, 0, 0, 0, 0, 0, 186, 0, 0, 0, + 139, 0, 0, 140, 141, 142, 0, 0, 0, 0, + 266, 0, 0, 0, 0, 0, 0, 0, 0, 0, 143, 144, 145, 146, 147, 0, 0, 133, 134, 148, 149, 135, 136, 137, 138, 0, 139, 0, 0, 140, - 141, 142, 267, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 143, 144, 145, 146, 147, 0, 0, - 133, 134, 148, 149, 135, 136, 137, 138, 0, 139, - 0, 0, 140, 141, 142, 268, 0, 0, 0, 0, + 141, 142, 0, 0, 0, 0, 267, 0, 0, 0, 0, 0, 0, 0, 0, 0, 143, 144, 145, 146, 147, 0, 0, 133, 134, 148, 149, 135, 136, 137, - 138, 0, 139, 0, 0, 140, 141, 142, 269, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 143, - 144, 145, 146, 147, 0, 0, 133, 134, 148, 149, - 135, 136, 137, 138, 0, 139, 0, 0, 140, 141, - 142, 270, 0, 0, 0, 0, 0, 0, 0, 0, + 138, 0, 139, 0, 0, 140, 141, 142, 0, 0, + 0, 0, 268, 0, 0, 0, 0, 0, 0, 0, 0, 0, 143, 144, 145, 146, 147, 0, 0, 133, 134, 148, 149, 135, 136, 137, 138, 0, 139, 0, - 0, 140, 141, 142, 0, 0, 0, 0, 0, 318, - 319, 0, 0, 0, 0, 143, 144, 145, 146, 147, - 0, 0, 133, 134, 148, 149, 135, 136, 137, 138, - 0, 139, 0, 0, 140, 141, 142, 0, 0, 0, - 0, 0, 339, 0, 0, 0, 0, 0, 143, 144, + 0, 140, 141, 142, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 313, 0, 0, 0, 0, 143, 144, 145, 146, 147, 0, 0, 133, 134, 148, 149, 135, 136, 137, 138, 0, 139, 0, 0, 140, 141, 142, - 0, 0, 0, 0, 0, 0, 0, 200, 0, 0, - 0, 143, 144, 145, 146, 147, 0, 0, 133, 134, - 148, 149, 135, 136, 137, 138, 0, 139, 0, 0, - 140, 141, 142, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 176, 0, 143, 144, 145, 146, 147, 0, - 201, 133, 134, 148, 149, 135, 136, 137, 138, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 199, 0, 0, 0, 143, 144, 145, 146, 147, 0, + 0, 133, 134, 148, 149, 135, 136, 137, 138, 0, 139, 0, 0, 140, 141, 142, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 143, 144, 145, - 146, 147, 0, 0, 133, 134, 148, 149, 135, 136, - 137, 138, 0, 139, 0, 0, 140, 141, 142, 0, - 0, 0, 0, 0, 187, 188, 0, 0, 0, 0, - 143, 144, 145, 146, 147, 0, 0, 133, 134, 148, + 0, 0, 0, 0, 0, 0, 232, 0, 0, 0, + 143, 144, 145, 146, 147, 0, 200, 133, 134, 148, 149, 135, 136, 137, 138, 0, 139, 0, 0, 140, 141, 142, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 143, 144, 145, 146, 147, 0, 0, - 0, 191, 148, 149, 133, 134, 0, 0, 135, 136, - 137, 138, 0, 139, 0, 0, 140, 141, 142, 0, + 0, 0, 0, 0, 176, 0, 143, 144, 145, 146, + 147, 0, 0, 133, 134, 148, 149, 135, 136, 137, + 138, 0, 139, 0, 0, 140, 141, 142, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 143, 144, 145, 146, 147, 0, 0, 133, 134, 148, - 149, 135, 136, 0, 0, 0, 139, 0, 0, 140, - 141, 142, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 143, 144, 145, 146, 147, 0, 0, - 0, 0, 148, 149 + 0, 0, 143, 144, 145, 146, 147, 0, 0, 133, + 134, 148, 149, 135, 136, 137, 138, 0, 139, 0, + 0, 140, 141, 142, 0, 0, 0, 0, 0, 187, + 188, 0, 0, 0, 0, 0, 0, 0, 143, 144, + 145, 146, 147, 0, 0, 133, 134, 148, 149, 135, + 136, 137, 138, 0, 139, 0, 0, 140, 141, 142, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 143, 144, 145, 146, 147, 0, + 0, 0, 191, 148, 149, 133, 134, 0, 0, 135, + 136, 137, 138, 0, 139, 0, 0, 140, 141, 142, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 143, 144, 145, 146, 147, 0, + 0, 133, 134, 148, 149, 135, 136, 0, 0, 0, + 139, 0, 0, 140, 141, 142, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 143, 144, 145, 146, 147, 0, 0, 0, 0, 148, + 149 }; static const yytype_int16 yycheck[] = { - 4, 0, 56, 7, 8, 9, 0, 46, 12, 13, - 14, 15, 31, 15, 16, 290, 304, 21, 34, 294, - 24, 37, 38, 56, 312, 36, 30, 31, 30, 33, - 34, 35, 36, 37, 38, 163, 79, 76, 71, 43, - 44, 45, 46, 82, 60, 56, 56, 175, 99, 53, - 99, 55, 225, 57, 34, 106, 30, 106, 38, 102, - 103, 71, 99, 236, 99, 69, 58, 59, 49, 197, - 52, 106, 76, 30, 93, 56, 80, 47, 82, 49, - 101, 13, 86, 15, 88, 106, 67, 68, 107, 101, - 71, 72, 73, 74, 106, 76, 100, 30, 79, 80, - 81, 101, 105, 106, 198, 99, 106, 201, 29, 30, - 281, 282, 93, 94, 95, 96, 97, 30, 30, 30, - 30, 102, 103, 30, 30, 129, 71, 100, 127, 133, + 4, 163, 0, 7, 8, 9, 37, 46, 12, 13, + 14, 15, 31, 175, 224, 57, 58, 21, 78, 0, + 24, 15, 16, 55, 101, 235, 30, 31, 36, 33, + 34, 35, 36, 37, 38, 197, 30, 76, 70, 43, + 44, 45, 46, 82, 104, 105, 30, 55, 55, 53, + 52, 55, 101, 57, 47, 101, 49, 75, 30, 108, + 78, 92, 108, 70, 101, 69, 13, 30, 15, 30, + 75, 108, 76, 78, 93, 30, 80, 30, 82, 30, + 98, 99, 86, 70, 88, 30, 104, 105, 107, 30, + 95, 96, 97, 98, 99, 108, 100, 103, 75, 104, + 105, 78, 108, 101, 103, 108, 103, 195, 196, 108, + 102, 108, 107, 108, 102, 200, 29, 30, 47, 96, + 97, 98, 99, 278, 279, 129, 30, 104, 105, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 100, 151, 106, 153, - 106, 47, 30, 54, 106, 106, 30, 161, 30, 106, - 30, 165, 166, 71, 168, 169, 30, 30, 172, 173, - 106, 30, 176, 34, 56, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 279, 314, 315, 34, 193, - 318, 319, 30, 38, 195, 196, 200, 30, 34, 30, - 54, 55, 106, 257, 34, 299, 300, 34, 302, 34, - 127, 339, 251, 67, 68, 37, 310, 71, 72, 73, - 74, 312, 76, 100, 164, 79, 80, 81, 232, 233, - 31, 325, 326, -1, 76, -1, 330, 79, -1, 93, - 94, 95, 96, 97, -1, -1, -1, 251, 102, 103, - -1, 93, 94, 95, 96, 97, -1, 258, -1, 260, - 102, 103, -1, 267, 268, 269, 270, -1, -1, -1, - 274, 325, 326, -1, 275, 329, -1, 76, -1, -1, - 79, -1, -1, -1, 288, -1, -1, -1, 289, -1, - -1, 295, 293, -1, 348, 94, 95, 96, 97, -1, - 301, 355, 303, 102, 103, 76, -1, -1, 79, -1, - 311, -1, -1, 317, -1, 316, -1, -1, -1, -1, - -1, 322, -1, 324, -1, 96, 97, -1, -1, -1, - -1, 102, 103, -1, 335, 336, 337, 338, -1, 340, - 341, 0, 1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 353, 12, -1, 356, 15, 16, 17, -1, - 19, 20, 21, 22, 23, -1, 25, 26, 27, -1, - 29, 30, 31, -1, 33, -1, 35, -1, -1, -1, - 39, -1, 41, 42, 43, -1, -1, 46, -1, -1, - -1, -1, 51, 52, 53, -1, -1, -1, 57, -1, - -1, -1, 61, 62, 63, 64, -1, 66, -1, -1, - -1, -1, -1, -1, -1, -1, 75, -1, -1, -1, - -1, -1, -1, 82, 83, 84, 85, 86, -1, -1, - 89, 90, 91, 92, -1, 94, 95, -1, -1, 12, - 99, 100, 15, 16, 17, 104, 19, 20, 21, 22, - 23, -1, 25, 26, 27, -1, 29, 30, 31, -1, - 33, -1, 35, -1, -1, -1, 39, -1, 41, 42, + 144, 145, 146, 147, 148, 149, 127, 151, 54, 153, + 108, 313, 108, 30, 30, 30, 108, 161, 70, 30, + 30, 165, 166, 93, 168, 169, 108, 30, 172, 173, + 258, 256, 176, 55, 94, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 273, 30, 38, 30, 193, + 108, 276, 93, 30, 93, 199, 127, 56, 286, 297, + 100, 31, 164, -1, -1, 293, 291, 292, 296, 294, + -1, 250, -1, -1, -1, 303, -1, 302, -1, -1, + -1, 309, -1, -1, -1, -1, 311, 231, 232, -1, + -1, -1, -1, 318, 322, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 250, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, + -1, 265, 266, 267, 268, -1, -1, -1, 272, 12, + -1, -1, 15, 16, 17, -1, 19, 20, 21, 22, + 23, 285, 25, 26, 27, -1, 29, 30, 31, -1, + 33, -1, 35, -1, 298, -1, 39, -1, 41, 42, 43, -1, -1, 46, -1, -1, -1, -1, 51, 52, - 53, -1, -1, -1, 57, -1, -1, -1, 61, 62, - 63, 64, -1, 66, -1, -1, -1, -1, -1, -1, - -1, -1, 75, -1, -1, -1, -1, -1, -1, 82, - 83, 84, 85, 86, -1, -1, 89, 90, 91, 92, - -1, 94, 95, -1, -1, 12, -1, 100, 15, 16, - 17, 104, 19, 20, 21, 22, 23, -1, 25, 26, + 53, -1, -1, 56, -1, -1, -1, 60, 61, 62, + 63, -1, 65, -1, -1, -1, -1, -1, -1, -1, + -1, 74, -1, -1, -1, -1, -1, -1, 81, 82, + 83, 84, 85, -1, -1, 88, 89, 90, 91, -1, + -1, -1, -1, 96, 97, -1, -1, 12, 101, 102, + 15, 16, 17, 106, 19, 20, 21, 22, 23, -1, + 25, 26, 27, -1, 29, 30, 31, -1, 33, -1, + 35, -1, -1, -1, 39, -1, 41, 42, 43, -1, + -1, 46, -1, -1, -1, -1, 51, 52, 53, -1, + -1, 56, -1, -1, -1, 60, 61, 62, 63, -1, + 65, -1, -1, -1, -1, -1, -1, -1, -1, 74, + -1, -1, -1, -1, -1, -1, 81, 82, 83, 84, + 85, -1, -1, 88, 89, 90, 91, -1, -1, -1, + -1, 96, 97, -1, -1, 12, -1, 102, 15, 16, + 17, 106, 19, 20, 21, 22, 23, -1, 25, 26, 27, -1, 29, 30, 31, -1, 33, 34, 35, -1, -1, -1, 39, -1, 41, 42, 43, -1, -1, -1, - -1, -1, -1, -1, 51, 52, 53, -1, -1, -1, - 57, -1, -1, -1, -1, -1, 63, 64, -1, 66, - -1, -1, -1, -1, -1, -1, -1, -1, 75, -1, - -1, -1, -1, -1, -1, 82, 83, 84, 85, 86, - -1, -1, 89, 90, -1, 92, -1, 94, 95, -1, - -1, 12, 99, 100, 15, 16, 17, 104, 19, 20, + -1, -1, -1, -1, 51, 52, 53, -1, -1, 56, + -1, -1, -1, -1, -1, 62, 63, -1, 65, -1, + -1, -1, -1, -1, -1, -1, -1, 74, -1, -1, + -1, -1, -1, -1, 81, 82, 83, 84, 85, -1, + -1, 88, 89, -1, 91, -1, -1, -1, -1, 96, + 97, -1, -1, 12, 101, 102, 15, 16, 17, 106, + 19, 20, 21, 22, 23, -1, 25, 26, 27, -1, + 29, 30, 31, -1, 33, -1, 35, -1, -1, -1, + 39, -1, 41, 42, 43, -1, -1, -1, -1, -1, + -1, -1, 51, 52, 53, -1, -1, 56, -1, -1, + -1, -1, -1, 62, 63, -1, 65, -1, -1, -1, + -1, -1, -1, -1, -1, 74, -1, -1, -1, -1, + -1, -1, 81, 82, 83, 84, 85, -1, -1, 88, + 89, -1, 91, 92, -1, -1, -1, 96, 97, -1, + -1, 12, 101, 102, 15, 16, 17, 106, 19, 20, 21, 22, 23, -1, 25, 26, 27, -1, 29, 30, 31, -1, 33, -1, 35, -1, -1, -1, 39, -1, 41, 42, 43, -1, -1, -1, -1, -1, -1, -1, - 51, 52, 53, -1, -1, -1, 57, -1, -1, -1, - -1, -1, 63, 64, -1, 66, -1, -1, -1, -1, - -1, -1, -1, -1, 75, -1, -1, -1, -1, -1, - -1, 82, 83, 84, 85, 86, -1, -1, 89, 90, - -1, 92, -1, 94, 95, -1, -1, 12, 99, 100, - 15, 16, 17, 104, 19, 20, 21, 22, 23, -1, - 25, 26, 27, -1, 29, 30, 31, 56, 33, -1, - 35, -1, -1, -1, 39, -1, 41, 42, 67, 68, - -1, -1, 71, 72, 73, 74, 51, 76, 53, -1, - 79, 80, 81, -1, -1, -1, -1, -1, 63, 64, - -1, 66, -1, -1, 93, 94, 95, 96, 97, -1, - 75, -1, -1, 102, 103, -1, -1, 82, 83, 84, - 85, 86, -1, -1, -1, 90, -1, 92, 12, 94, - 95, 15, 16, 17, -1, 100, -1, -1, -1, 104, - -1, 25, 26, 27, -1, 29, 30, 31, -1, 33, - -1, -1, -1, -1, -1, -1, 40, -1, -1, -1, - -1, 45, -1, 47, 48, 49, 50, 51, 12, 53, - -1, 15, 16, 17, -1, -1, -1, -1, -1, -1, - -1, 25, 26, 27, -1, 29, 30, 31, -1, 33, - -1, 75, -1, -1, -1, -1, 40, -1, 82, 83, - 84, 85, 86, 47, -1, 49, -1, 51, 92, 53, - 94, 95, -1, -1, -1, -1, 100, -1, -1, -1, - 104, 65, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 75, -1, -1, -1, -1, -1, -1, 82, 83, - 84, 85, 86, -1, -1, -1, -1, -1, 92, 12, - 94, 95, 15, 16, 17, -1, 100, -1, -1, -1, - 104, -1, 25, 26, 27, -1, 29, 30, 31, -1, - 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 51, 12, - 53, -1, 15, 16, 17, -1, -1, -1, -1, -1, - -1, -1, 25, 26, 27, -1, 29, 30, 31, -1, - 33, -1, 75, -1, -1, -1, -1, -1, -1, 82, - 83, 84, 85, 86, -1, -1, -1, -1, 51, 92, - 53, 94, 95, -1, -1, -1, -1, 100, -1, -1, - -1, 104, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 75, -1, -1, 44, -1, -1, -1, 82, - 83, 84, 85, 86, -1, -1, -1, -1, -1, 92, - -1, 94, 95, -1, -1, -1, -1, 100, 67, 68, - -1, 104, 71, 72, 73, 74, -1, 76, 77, 78, - 79, 80, 81, 49, -1, -1, -1, -1, -1, -1, - 56, -1, -1, -1, 93, 94, 95, 96, 97, -1, - -1, 67, 68, 102, 103, 71, 72, 73, 74, -1, - 76, -1, -1, 79, 80, 81, 49, -1, -1, -1, - -1, -1, -1, 56, -1, -1, -1, 93, 94, 95, - 96, 97, -1, -1, 67, 68, 102, 103, 71, 72, - 73, 74, -1, 76, -1, -1, 79, 80, 81, 49, - -1, -1, -1, -1, -1, -1, 56, -1, -1, -1, - 93, 94, 95, 96, 97, -1, -1, 67, 68, 102, - 103, 71, 72, 73, 74, -1, 76, -1, -1, 79, - 80, 81, 49, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 93, 94, 95, 96, 97, -1, -1, - 67, 68, 102, 103, 71, 72, 73, 74, -1, 76, - -1, -1, 79, 80, 81, 49, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 93, 94, 95, 96, - 97, -1, -1, 67, 68, 102, 103, 71, 72, 73, - 74, -1, 76, -1, -1, 79, 80, 81, 49, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 93, - 94, 95, 96, 97, -1, -1, 67, 68, 102, 103, - 71, 72, 73, 74, -1, 76, -1, -1, 79, 80, - 81, 49, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 93, 94, 95, 96, 97, -1, -1, 67, - 68, 102, 103, 71, 72, 73, 74, -1, 76, -1, - -1, 79, 80, 81, -1, -1, -1, -1, -1, 54, - 55, -1, -1, -1, -1, 93, 94, 95, 96, 97, - -1, -1, 67, 68, 102, 103, 71, 72, 73, 74, - -1, 76, -1, -1, 79, 80, 81, -1, -1, -1, - -1, -1, 54, -1, -1, -1, -1, -1, 93, 94, - 95, 96, 97, -1, -1, 67, 68, 102, 103, 71, - 72, 73, 74, -1, 76, -1, -1, 79, 80, 81, - -1, -1, -1, -1, -1, -1, -1, 56, -1, -1, - -1, 93, 94, 95, 96, 97, -1, -1, 67, 68, - 102, 103, 71, 72, 73, 74, -1, 76, -1, -1, - 79, 80, 81, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 58, -1, 93, 94, 95, 96, 97, -1, - 99, 67, 68, 102, 103, 71, 72, 73, 74, -1, - 76, -1, -1, 79, 80, 81, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 93, 94, 95, - 96, 97, -1, -1, 67, 68, 102, 103, 71, 72, - 73, 74, -1, 76, -1, -1, 79, 80, 81, -1, - -1, -1, -1, -1, 87, 88, -1, -1, -1, -1, - 93, 94, 95, 96, 97, -1, -1, 67, 68, 102, - 103, 71, 72, 73, 74, -1, 76, -1, -1, 79, - 80, 81, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 93, 94, 95, 96, 97, -1, -1, - -1, 101, 102, 103, 67, 68, -1, -1, 71, 72, - 73, 74, -1, 76, -1, -1, 79, 80, 81, -1, + 51, 52, 53, -1, -1, 56, -1, -1, -1, -1, + -1, 62, 63, -1, 65, -1, -1, -1, -1, -1, + -1, -1, -1, 74, -1, -1, -1, -1, -1, -1, + 81, 82, 83, 84, 85, -1, -1, 88, 89, -1, + 91, -1, -1, -1, -1, 96, 97, -1, -1, 12, + 101, 102, 15, 16, 17, 106, 19, 20, 21, 22, + 23, -1, 25, 26, 27, -1, 29, 30, 31, -1, + 33, -1, 35, -1, -1, -1, 39, -1, 41, 42, + -1, -1, -1, -1, -1, -1, -1, -1, 51, -1, + 53, -1, -1, -1, -1, -1, -1, -1, -1, 62, + 63, -1, 65, -1, -1, -1, -1, -1, -1, -1, + -1, 74, -1, -1, -1, -1, -1, -1, 81, 82, + 83, 84, 85, -1, -1, -1, 89, 12, 91, -1, + 15, 16, 17, 96, 97, -1, -1, -1, -1, 102, + 25, 26, 27, 106, 29, 30, 31, -1, 33, -1, + -1, -1, -1, -1, -1, 40, -1, -1, -1, -1, + 45, -1, 47, 48, 49, 50, 51, -1, 53, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 74, + -1, -1, -1, -1, -1, -1, 81, 82, 83, 84, + 85, -1, -1, -1, -1, 12, 91, -1, 15, 16, + 17, 96, 97, -1, -1, -1, -1, 102, 25, 26, + 27, 106, 29, 30, 31, -1, 33, -1, -1, -1, + -1, -1, -1, 40, -1, -1, -1, -1, -1, -1, + 47, -1, 49, -1, 51, -1, 53, 12, -1, -1, + 15, 16, 17, -1, -1, -1, -1, 64, -1, -1, + 25, 26, 27, -1, 29, 30, 31, 74, 33, -1, + -1, -1, -1, -1, 81, 82, 83, 84, 85, -1, + -1, -1, -1, -1, 91, -1, 51, -1, 53, 96, + 97, -1, -1, -1, -1, 102, -1, -1, -1, 106, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 74, + -1, -1, -1, -1, -1, -1, 81, 82, 83, 84, + 85, -1, -1, -1, -1, 12, 91, -1, 15, 16, + 17, 96, 97, -1, -1, 54, -1, 102, 25, 26, + 27, 106, 29, 30, 31, -1, 33, 66, 67, -1, + -1, 70, 71, 72, 73, -1, 75, -1, -1, 78, + 79, 80, -1, -1, 51, -1, 53, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 95, 96, 97, 98, + 99, -1, -1, -1, -1, 104, 105, 74, -1, -1, + -1, -1, -1, -1, 81, 82, 83, 84, 85, 44, + -1, -1, -1, -1, 91, -1, -1, -1, -1, 96, + 97, -1, -1, -1, -1, 102, -1, -1, -1, 106, + -1, 66, 67, -1, -1, 70, 71, 72, 73, -1, + 75, 76, 77, 78, 79, 80, -1, -1, -1, -1, + 49, -1, -1, -1, -1, -1, 55, -1, -1, -1, + 95, 96, 97, 98, 99, -1, -1, 66, 67, 104, + 105, 70, 71, 72, 73, -1, 75, -1, -1, 78, + 79, 80, -1, -1, -1, -1, 49, -1, -1, -1, + -1, -1, 55, -1, -1, -1, 95, 96, 97, 98, + 99, -1, -1, 66, 67, 104, 105, 70, 71, 72, + 73, -1, 75, -1, -1, 78, 79, 80, -1, -1, + -1, -1, 49, -1, -1, -1, -1, -1, 55, -1, + -1, -1, 95, 96, 97, 98, 99, -1, -1, 66, + 67, 104, 105, 70, 71, 72, 73, -1, 75, -1, + -1, 78, 79, 80, -1, -1, -1, -1, 49, -1, + -1, -1, -1, -1, 55, -1, -1, -1, 95, 96, + 97, 98, 99, -1, -1, 66, 67, 104, 105, 70, + 71, 72, 73, -1, 75, -1, -1, 78, 79, 80, + -1, -1, -1, -1, 49, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 95, 96, 97, 98, 99, -1, + -1, 66, 67, 104, 105, 70, 71, 72, 73, -1, + 75, -1, -1, 78, 79, 80, -1, -1, -1, -1, + 49, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 95, 96, 97, 98, 99, -1, -1, 66, 67, 104, + 105, 70, 71, 72, 73, -1, 75, -1, -1, 78, + 79, 80, -1, -1, -1, -1, 49, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 95, 96, 97, 98, + 99, -1, -1, 66, 67, 104, 105, 70, 71, 72, + 73, -1, 75, -1, -1, 78, 79, 80, -1, -1, + -1, -1, 49, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 95, 96, 97, 98, 99, -1, -1, 66, + 67, 104, 105, 70, 71, 72, 73, -1, 75, -1, + -1, 78, 79, 80, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 54, -1, -1, -1, -1, 95, 96, + 97, 98, 99, -1, -1, 66, 67, 104, 105, 70, + 71, 72, 73, -1, 75, -1, -1, 78, 79, 80, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 93, 94, 95, 96, 97, -1, -1, 67, 68, 102, - 103, 71, 72, -1, -1, -1, 76, -1, -1, 79, - 80, 81, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 93, 94, 95, 96, 97, -1, -1, - -1, -1, 102, 103 + 55, -1, -1, -1, 95, 96, 97, 98, 99, -1, + -1, 66, 67, 104, 105, 70, 71, 72, 73, -1, + 75, -1, -1, 78, 79, 80, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 55, -1, -1, -1, + 95, 96, 97, 98, 99, -1, 101, 66, 67, 104, + 105, 70, 71, 72, 73, -1, 75, -1, -1, 78, + 79, 80, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 57, -1, 95, 96, 97, 98, + 99, -1, -1, 66, 67, 104, 105, 70, 71, 72, + 73, -1, 75, -1, -1, 78, 79, 80, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 95, 96, 97, 98, 99, -1, -1, 66, + 67, 104, 105, 70, 71, 72, 73, -1, 75, -1, + -1, 78, 79, 80, -1, -1, -1, -1, -1, 86, + 87, -1, -1, -1, -1, -1, -1, -1, 95, 96, + 97, 98, 99, -1, -1, 66, 67, 104, 105, 70, + 71, 72, 73, -1, 75, -1, -1, 78, 79, 80, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 95, 96, 97, 98, 99, -1, + -1, -1, 103, 104, 105, 66, 67, -1, -1, 70, + 71, 72, 73, -1, 75, -1, -1, 78, 79, 80, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 95, 96, 97, 98, 99, -1, + -1, 66, 67, 104, 105, 70, 71, -1, -1, -1, + 75, -1, -1, 78, 79, 80, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 95, 96, 97, 98, 99, -1, -1, -1, -1, 104, + 105 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -1250,40 +1264,37 @@ static const yytype_uint8 yystos[] = { 0, 1, 12, 15, 16, 17, 19, 20, 21, 22, 23, 25, 26, 27, 29, 30, 31, 33, 35, 39, - 41, 42, 43, 46, 51, 52, 53, 57, 61, 62, - 63, 64, 66, 75, 82, 83, 84, 85, 86, 89, - 90, 91, 92, 94, 95, 100, 104, 108, 109, 110, - 111, 112, 113, 117, 118, 119, 124, 125, 126, 127, - 128, 129, 133, 136, 138, 141, 145, 99, 30, 51, - 92, 127, 127, 127, 127, 147, 30, 127, 147, 127, - 100, 147, 137, 52, 30, 130, 40, 45, 47, 48, - 49, 50, 127, 134, 135, 30, 127, 58, 59, 15, - 16, 30, 30, 30, 30, 127, 65, 134, 135, 30, - 132, 127, 127, 127, 127, 127, 127, 30, 131, 30, - 100, 127, 127, 127, 127, 146, 0, 99, 127, 71, - 127, 111, 127, 67, 68, 71, 72, 73, 74, 76, - 79, 80, 81, 93, 94, 95, 96, 97, 102, 103, - 121, 100, 127, 106, 146, 127, 146, 146, 106, 127, - 127, 47, 135, 139, 44, 77, 78, 30, 56, 71, - 126, 127, 56, 71, 54, 140, 58, 135, 106, 49, - 56, 49, 56, 49, 56, 49, 56, 87, 88, 106, - 30, 101, 105, 106, 109, 123, 127, 54, 55, 122, - 56, 99, 127, 127, 127, 127, 127, 127, 127, 127, - 127, 127, 127, 127, 127, 127, 127, 127, 127, 30, - 142, 127, 101, 30, 127, 121, 30, 128, 127, 127, - 127, 127, 71, 56, 127, 127, 121, 127, 30, 127, - 127, 127, 127, 127, 127, 127, 127, 127, 127, 30, - 101, 106, 127, 99, 112, 122, 122, 121, 123, 127, - 123, 99, 106, 142, 127, 127, 142, 49, 49, 49, - 49, 146, 34, 36, 56, 111, 122, 122, 106, 144, - 30, 99, 99, 127, 127, 127, 127, 101, 56, 127, - 122, 34, 38, 114, 115, 120, 34, 30, 123, 144, - 144, 127, 122, 114, 122, 114, 127, 34, 123, 123, - 122, 123, 122, 34, 37, 60, 116, 120, 54, 55, - 30, 143, 123, 122, 116, 121, 121, 122, 127, 121, - 121, 106, 122, 34, 122, 111, 123, 111, 123, 54, - 111, 123, 30, 34, 122, 122, 122, 122, 121, 122, - 122, 34, 34, 111, 122, 37, 111, 122 + 41, 42, 43, 46, 51, 52, 53, 56, 60, 61, + 62, 63, 65, 74, 81, 82, 83, 84, 85, 88, + 89, 90, 91, 96, 97, 102, 106, 110, 111, 112, + 113, 114, 115, 118, 119, 120, 125, 126, 127, 128, + 129, 130, 134, 137, 139, 142, 146, 101, 30, 51, + 91, 128, 128, 128, 128, 148, 30, 128, 148, 128, + 102, 148, 138, 52, 30, 131, 40, 45, 47, 48, + 49, 50, 128, 135, 136, 30, 128, 57, 58, 15, + 16, 30, 30, 30, 30, 128, 64, 135, 136, 30, + 133, 128, 128, 128, 128, 128, 128, 30, 132, 30, + 102, 128, 128, 128, 128, 147, 0, 101, 128, 70, + 128, 113, 128, 66, 67, 70, 71, 72, 73, 75, + 78, 79, 80, 95, 96, 97, 98, 99, 104, 105, + 122, 102, 128, 108, 147, 128, 147, 147, 108, 128, + 128, 47, 136, 140, 44, 76, 77, 30, 55, 70, + 127, 128, 55, 70, 54, 141, 57, 136, 108, 49, + 55, 49, 55, 49, 55, 49, 55, 86, 87, 108, + 30, 103, 107, 108, 111, 124, 128, 54, 123, 55, + 101, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 30, 143, + 128, 103, 30, 128, 122, 30, 129, 128, 128, 128, + 128, 70, 55, 128, 128, 122, 128, 30, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 30, 103, + 108, 128, 101, 114, 123, 123, 122, 128, 124, 101, + 108, 143, 128, 128, 143, 49, 49, 49, 49, 147, + 93, 36, 55, 124, 123, 108, 145, 30, 101, 101, + 128, 128, 128, 128, 103, 55, 128, 123, 94, 30, + 124, 145, 145, 128, 123, 38, 116, 117, 121, 34, + 124, 124, 123, 124, 123, 116, 128, 30, 144, 124, + 123, 37, 92, 54, 108, 123, 93, 124, 122, 30, + 93, 92, 124, 123 }; #define yyerrok (yyerrstatus = 0) @@ -2198,13 +2209,11 @@ yyreduce: WRITE_UINT32(&body, (yyvsp[(3) - (5)].code) - (yyvsp[(1) - (5)].code)); WRITE_UINT32(&end, (yyvsp[(4) - (5)].code) - (yyvsp[(1) - (5)].code)); (*g_lingo->_currentScript)[(yyvsp[(1) - (5)].code) + 1] = body; /* body of loop */ - (*g_lingo->_currentScript)[(yyvsp[(1) - (5)].code) + 2] = end; /* end, if cond fails */ - - checkEnd((yyvsp[(5) - (5)].s), "repeat", true); ;} + (*g_lingo->_currentScript)[(yyvsp[(1) - (5)].code) + 2] = end; ;} break; case 24: -#line 205 "engines/director/lingo/lingo-gr.y" +#line 203 "engines/director/lingo/lingo-gr.y" { inst init = 0, finish = 0, body = 0, end = 0, inc = 0; WRITE_UINT32(&init, (yyvsp[(3) - (10)].code) - (yyvsp[(1) - (10)].code)); @@ -2216,13 +2225,11 @@ yyreduce: (*g_lingo->_currentScript)[(yyvsp[(1) - (10)].code) + 2] = finish;/* final count value */ (*g_lingo->_currentScript)[(yyvsp[(1) - (10)].code) + 3] = body; /* body of loop */ (*g_lingo->_currentScript)[(yyvsp[(1) - (10)].code) + 4] = inc; /* increment */ - (*g_lingo->_currentScript)[(yyvsp[(1) - (10)].code) + 5] = end; /* end, if cond fails */ - - checkEnd((yyvsp[(10) - (10)].s), "repeat", true); ;} + (*g_lingo->_currentScript)[(yyvsp[(1) - (10)].code) + 5] = end; ;} break; case 25: -#line 223 "engines/director/lingo/lingo-gr.y" +#line 220 "engines/director/lingo/lingo-gr.y" { inst init = 0, finish = 0, body = 0, end = 0, inc = 0; WRITE_UINT32(&init, (yyvsp[(3) - (11)].code) - (yyvsp[(1) - (11)].code)); @@ -2234,13 +2241,11 @@ yyreduce: (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 2] = finish;/* final count value */ (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 3] = body; /* body of loop */ (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 4] = inc; /* increment */ - (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 5] = end; /* end, if cond fails */ - - checkEnd((yyvsp[(11) - (11)].s), "repeat", true); ;} + (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 5] = end; ;} break; case 26: -#line 237 "engines/director/lingo/lingo-gr.y" +#line 232 "engines/director/lingo/lingo-gr.y" { inst end = 0; WRITE_UINT32(&end, (yyvsp[(3) - (3)].code) - (yyvsp[(1) - (3)].code)); @@ -2249,87 +2254,48 @@ yyreduce: break; case 27: -#line 242 "engines/director/lingo/lingo-gr.y" +#line 237 "engines/director/lingo/lingo-gr.y" { - warning("STUB: TELL is not implemented"); - checkEnd((yyvsp[(6) - (6)].s), "tell", true); ;} + warning("STUB: TELL is not implemented"); ;} break; case 28: -#line 245 "engines/director/lingo/lingo-gr.y" +#line 239 "engines/director/lingo/lingo-gr.y" { warning("STUB: TELL is not implemented"); ;} break; case 29: -#line 250 "engines/director/lingo/lingo-gr.y" - { - inst then = 0, else1 = 0, end = 0; - WRITE_UINT32(&then, (yyvsp[(4) - (10)].code) - (yyvsp[(1) - (10)].code)); - WRITE_UINT32(&else1, (yyvsp[(6) - (10)].code) - (yyvsp[(1) - (10)].code)); - WRITE_UINT32(&end, (yyvsp[(10) - (10)].code) - (yyvsp[(1) - (10)].code)); - (*g_lingo->_currentScript)[(yyvsp[(1) - (10)].code) + 1] = then; /* thenpart */ - (*g_lingo->_currentScript)[(yyvsp[(1) - (10)].code) + 2] = else1; /* elsepart */ - (*g_lingo->_currentScript)[(yyvsp[(1) - (10)].code) + 3] = end; /* end, if cond fails */ - - g_lingo->processIf(0, (yyvsp[(10) - (10)].code) - (yyvsp[(1) - (10)].code)); ;} - break; - - case 30: -#line 260 "engines/director/lingo/lingo-gr.y" - { - inst then = 0, else1 = 0, end = 0; - WRITE_UINT32(&then, (yyvsp[(4) - (6)].code) - (yyvsp[(1) - (6)].code)); - WRITE_UINT32(&else1, 0); - WRITE_UINT32(&end, (yyvsp[(6) - (6)].code) - (yyvsp[(1) - (6)].code)); - (*g_lingo->_currentScript)[(yyvsp[(1) - (6)].code) + 1] = then; /* thenpart */ - (*g_lingo->_currentScript)[(yyvsp[(1) - (6)].code) + 2] = else1; /* elsepart */ - (*g_lingo->_currentScript)[(yyvsp[(1) - (6)].code) + 3] = end; /* end, if cond fails */ - - g_lingo->processIf(0, 0); ;} - break; - - case 31: -#line 270 "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[(4) - (9)].code) - (yyvsp[(1) - (9)].code)); - WRITE_UINT32(&else1, (yyvsp[(7) - (9)].code) - (yyvsp[(1) - (9)].code)); - WRITE_UINT32(&end, (yyvsp[(9) - (9)].code) - (yyvsp[(1) - (9)].code)); + WRITE_UINT32(&else1, (yyvsp[(6) - (9)].code) - (yyvsp[(1) - (9)].code)); + WRITE_UINT32(&end, (yyvsp[(8) - (9)].code) - (yyvsp[(1) - (9)].code)); (*g_lingo->_currentScript)[(yyvsp[(1) - (9)].code) + 1] = then; /* thenpart */ (*g_lingo->_currentScript)[(yyvsp[(1) - (9)].code) + 2] = else1; /* elsepart */ (*g_lingo->_currentScript)[(yyvsp[(1) - (9)].code) + 3] = end; /* end, if cond fails */ - g_lingo->processIf(0, 0); ;} + g_lingo->processIf(0, (yyvsp[(8) - (9)].code) - (yyvsp[(1) - (9)].code)); ;} break; - case 32: -#line 280 "engines/director/lingo/lingo-gr.y" - { - inst then = 0, end = 0; - WRITE_UINT32(&then, (yyvsp[(4) - (6)].code) - (yyvsp[(1) - (6)].code)); - WRITE_UINT32(&end, (yyvsp[(5) - (6)].code) - (yyvsp[(1) - (6)].code)); - (*g_lingo->_currentScript)[(yyvsp[(1) - (6)].code) + 1] = then; /* thenpart */ - (*g_lingo->_currentScript)[(yyvsp[(1) - (6)].code) + 3] = end; /* end, if cond fails */ - - checkEnd((yyvsp[(6) - (6)].s), "if", true); - - g_lingo->processIf(0, 0); ;} - break; - - case 35: -#line 296 "engines/director/lingo/lingo-gr.y" + case 30: +#line 254 "engines/director/lingo/lingo-gr.y" { - inst then = 0; - WRITE_UINT32(&then, (yyvsp[(4) - (6)].code) - (yyvsp[(1) - (6)].code)); - (*g_lingo->_currentScript)[(yyvsp[(1) - (6)].code) + 1] = then; /* thenpart */ + inst then = 0, else1 = 0, end = 0; + WRITE_UINT32(&then, (yyvsp[(4) - (11)].code) - (yyvsp[(1) - (11)].code)); + WRITE_UINT32(&else1, (yyvsp[(6) - (11)].code) - (yyvsp[(1) - (11)].code)); + WRITE_UINT32(&end, (yyvsp[(8) - (11)].code) - (yyvsp[(1) - (11)].code)); + (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 1] = then; /* thenpart */ + (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 2] = else1; /* elsepart */ + (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 3] = end; /* end, if cond fails */ - g_lingo->codeLabel((yyvsp[(1) - (6)].code)); ;} + g_lingo->processIf(0, (yyvsp[(8) - (11)].code) - (yyvsp[(1) - (11)].code)); ;} break; - case 36: -#line 302 "engines/director/lingo/lingo-gr.y" + case 33: +#line 270 "engines/director/lingo/lingo-gr.y" { inst then = 0; WRITE_UINT32(&then, (yyvsp[(5) - (6)].code) - (yyvsp[(1) - (6)].code)); @@ -2338,51 +2304,13 @@ yyreduce: g_lingo->codeLabel((yyvsp[(1) - (6)].code)); ;} break; - case 38: -#line 311 "engines/director/lingo/lingo-gr.y" - { - inst then = 0; - WRITE_UINT32(&then, (yyvsp[(4) - (9)].code) - (yyvsp[(1) - (9)].code)); - (*g_lingo->_currentScript)[(yyvsp[(1) - (9)].code) + 1] = then; /* thenpart */ - - g_lingo->codeLabel((yyvsp[(1) - (9)].code)); ;} - break; - - case 39: -#line 317 "engines/director/lingo/lingo-gr.y" - { - g_lingo->codeLabel((yyvsp[(2) - (5)].code)); - - checkEnd((yyvsp[(5) - (5)].s), "if", true); ;} - break; - - case 40: -#line 321 "engines/director/lingo/lingo-gr.y" - { - g_lingo->codeLabel((yyvsp[(2) - (4)].code)); ;} - break; - - case 41: -#line 324 "engines/director/lingo/lingo-gr.y" - { - g_lingo->codeLabel((yyvsp[(2) - (5)].code)); - - checkEnd((yyvsp[(5) - (5)].s), "if", true); ;} - break; - - case 42: -#line 328 "engines/director/lingo/lingo-gr.y" - { - g_lingo->codeLabel((yyvsp[(2) - (4)].code)); ;} - break; - - case 43: -#line 332 "engines/director/lingo/lingo-gr.y" + case 34: +#line 278 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code3(g_lingo->c_repeatwhilecode, STOP, STOP); ;} break; - case 44: -#line 335 "engines/director/lingo/lingo-gr.y" + case 35: +#line 281 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code3(g_lingo->c_repeatwithcode, STOP, STOP); g_lingo->code3(STOP, STOP, STOP); @@ -2390,8 +2318,8 @@ yyreduce: delete (yyvsp[(3) - (3)].s); ;} break; - case 45: -#line 342 "engines/director/lingo/lingo-gr.y" + case 36: +#line 288 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_ifcode); g_lingo->code3(STOP, STOP, STOP); @@ -2399,8 +2327,8 @@ yyreduce: g_lingo->codeLabel(0); ;} break; - case 46: -#line 349 "engines/director/lingo/lingo-gr.y" + case 37: +#line 295 "engines/director/lingo/lingo-gr.y" { inst skipEnd; WRITE_UINT32(&skipEnd, 1); // We have to skip end to avoid multiple executions @@ -2409,23 +2337,23 @@ yyreduce: g_lingo->code1(skipEnd); ;} break; - case 47: -#line 357 "engines/director/lingo/lingo-gr.y" + case 38: +#line 303 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->_currentScript->size(); ;} break; - case 48: -#line 360 "engines/director/lingo/lingo-gr.y" + case 39: +#line 306 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(STOP); (yyval.code) = g_lingo->_currentScript->size(); ;} break; - case 49: -#line 363 "engines/director/lingo/lingo-gr.y" + case 40: +#line 309 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->_currentScript->size(); ;} break; - case 52: -#line 368 "engines/director/lingo/lingo-gr.y" + case 43: +#line 314 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_whencode); g_lingo->code1(STOP); @@ -2433,82 +2361,82 @@ yyreduce: delete (yyvsp[(2) - (3)].s); ;} break; - case 53: -#line 374 "engines/director/lingo/lingo-gr.y" + case 44: +#line 320 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_tellcode); g_lingo->code1(STOP); ;} break; - case 54: -#line 378 "engines/director/lingo/lingo-gr.y" + case 45: +#line 324 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_intpush); g_lingo->codeInt((yyvsp[(1) - (1)].i)); ;} break; - case 55: -#line 381 "engines/director/lingo/lingo-gr.y" + case 46: +#line 327 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_floatpush); g_lingo->codeFloat((yyvsp[(1) - (1)].f)); ;} break; - case 56: -#line 384 "engines/director/lingo/lingo-gr.y" + case 47: +#line 330 "engines/director/lingo/lingo-gr.y" { // D3 (yyval.code) = g_lingo->code1(g_lingo->c_symbolpush); g_lingo->codeString((yyvsp[(1) - (1)].s)->c_str()); ;} break; - case 57: -#line 387 "engines/director/lingo/lingo-gr.y" + case 48: +#line 333 "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 58: -#line 390 "engines/director/lingo/lingo-gr.y" + case 49: +#line 336 "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 59: -#line 396 "engines/director/lingo/lingo-gr.y" + case 50: +#line 342 "engines/director/lingo/lingo-gr.y" { (yyval.code) = (yyvsp[(1) - (1)].code); ;} break; - case 61: -#line 398 "engines/director/lingo/lingo-gr.y" + case 52: +#line 344 "engines/director/lingo/lingo-gr.y" { g_lingo->codeFunc((yyvsp[(1) - (1)].s), 0); delete (yyvsp[(1) - (1)].s); ;} break; - case 62: -#line 401 "engines/director/lingo/lingo-gr.y" + case 53: +#line 347 "engines/director/lingo/lingo-gr.y" { g_lingo->codeFunc((yyvsp[(1) - (2)].s), 1); delete (yyvsp[(1) - (2)].s); ;} break; - case 63: -#line 404 "engines/director/lingo/lingo-gr.y" + case 54: +#line 350 "engines/director/lingo/lingo-gr.y" { g_lingo->codeFunc((yyvsp[(1) - (2)].s), (yyvsp[(2) - (2)].narg)); ;} break; - case 64: -#line 405 "engines/director/lingo/lingo-gr.y" + case 55: +#line 351 "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 65: -#line 408 "engines/director/lingo/lingo-gr.y" + case 56: +#line 354 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_intpush); g_lingo->codeInt(0); // Put dummy id @@ -2519,8 +2447,8 @@ yyreduce: g_lingo->code2(e, f); ;} break; - case 66: -#line 416 "engines/director/lingo/lingo-gr.y" + case 57: +#line 362 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_theentitypush); inst e = 0, f = 0; @@ -2529,395 +2457,395 @@ yyreduce: g_lingo->code2(e, f); ;} break; - case 68: -#line 423 "engines/director/lingo/lingo-gr.y" + case 59: +#line 369 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_add); ;} break; - case 69: -#line 424 "engines/director/lingo/lingo-gr.y" + case 60: +#line 370 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_sub); ;} break; - case 70: -#line 425 "engines/director/lingo/lingo-gr.y" + case 61: +#line 371 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_mul); ;} break; - case 71: -#line 426 "engines/director/lingo/lingo-gr.y" + case 62: +#line 372 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_div); ;} break; - case 72: -#line 427 "engines/director/lingo/lingo-gr.y" + case 63: +#line 373 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_mod); ;} break; - case 73: -#line 428 "engines/director/lingo/lingo-gr.y" + case 64: +#line 374 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gt); ;} break; - case 74: -#line 429 "engines/director/lingo/lingo-gr.y" + case 65: +#line 375 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_lt); ;} break; - case 75: -#line 430 "engines/director/lingo/lingo-gr.y" + case 66: +#line 376 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_eq); ;} break; - case 76: -#line 431 "engines/director/lingo/lingo-gr.y" + case 67: +#line 377 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_neq); ;} break; - case 77: -#line 432 "engines/director/lingo/lingo-gr.y" + case 68: +#line 378 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_ge); ;} break; - case 78: -#line 433 "engines/director/lingo/lingo-gr.y" + case 69: +#line 379 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_le); ;} break; - case 79: -#line 434 "engines/director/lingo/lingo-gr.y" + case 70: +#line 380 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_and); ;} break; - case 80: -#line 435 "engines/director/lingo/lingo-gr.y" + case 71: +#line 381 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_or); ;} break; - case 81: -#line 436 "engines/director/lingo/lingo-gr.y" + case 72: +#line 382 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_not); ;} break; - case 82: -#line 437 "engines/director/lingo/lingo-gr.y" + case 73: +#line 383 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_ampersand); ;} break; - case 83: -#line 438 "engines/director/lingo/lingo-gr.y" + case 74: +#line 384 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_concat); ;} break; - case 84: -#line 439 "engines/director/lingo/lingo-gr.y" + case 75: +#line 385 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_contains); ;} break; - case 85: -#line 440 "engines/director/lingo/lingo-gr.y" + case 76: +#line 386 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_starts); ;} break; - case 86: -#line 441 "engines/director/lingo/lingo-gr.y" + case 77: +#line 387 "engines/director/lingo/lingo-gr.y" { (yyval.code) = (yyvsp[(2) - (2)].code); ;} break; - case 87: -#line 442 "engines/director/lingo/lingo-gr.y" + case 78: +#line 388 "engines/director/lingo/lingo-gr.y" { (yyval.code) = (yyvsp[(2) - (2)].code); g_lingo->code1(g_lingo->c_negate); ;} break; - case 88: -#line 443 "engines/director/lingo/lingo-gr.y" + case 79: +#line 389 "engines/director/lingo/lingo-gr.y" { (yyval.code) = (yyvsp[(2) - (3)].code); ;} break; - case 89: -#line 444 "engines/director/lingo/lingo-gr.y" + case 80: +#line 390 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_arraypush); g_lingo->codeArray((yyvsp[(2) - (3)].narg)); ;} break; - case 90: -#line 445 "engines/director/lingo/lingo-gr.y" + case 81: +#line 391 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_intersects); ;} break; - case 91: -#line 446 "engines/director/lingo/lingo-gr.y" + case 82: +#line 392 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_within); ;} break; - case 92: -#line 447 "engines/director/lingo/lingo-gr.y" + case 83: +#line 393 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_charOf); ;} break; - case 93: -#line 448 "engines/director/lingo/lingo-gr.y" + case 84: +#line 394 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_charToOf); ;} break; - case 94: -#line 449 "engines/director/lingo/lingo-gr.y" + case 85: +#line 395 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_itemOf); ;} break; - case 95: -#line 450 "engines/director/lingo/lingo-gr.y" + case 86: +#line 396 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_itemToOf); ;} break; - case 96: -#line 451 "engines/director/lingo/lingo-gr.y" + case 87: +#line 397 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_lineOf); ;} break; - case 97: -#line 452 "engines/director/lingo/lingo-gr.y" + case 88: +#line 398 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_lineToOf); ;} break; - case 98: -#line 453 "engines/director/lingo/lingo-gr.y" + case 89: +#line 399 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_wordOf); ;} break; - case 99: -#line 454 "engines/director/lingo/lingo-gr.y" + case 90: +#line 400 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_wordToOf); ;} break; - case 100: -#line 455 "engines/director/lingo/lingo-gr.y" + case 91: +#line 401 "engines/director/lingo/lingo-gr.y" { g_lingo->codeMe(nullptr, 0); ;} break; - case 101: -#line 458 "engines/director/lingo/lingo-gr.y" + case 92: +#line 404 "engines/director/lingo/lingo-gr.y" { g_lingo->codeFunc((yyvsp[(1) - (2)].s), 1); delete (yyvsp[(1) - (2)].s); ;} break; - case 102: -#line 463 "engines/director/lingo/lingo-gr.y" + case 93: +#line 409 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_printtop); ;} break; - case 105: -#line 466 "engines/director/lingo/lingo-gr.y" + case 96: +#line 412 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_exitRepeat); ;} break; - case 106: -#line 467 "engines/director/lingo/lingo-gr.y" + case 97: +#line 413 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_procret); ;} break; - case 110: -#line 471 "engines/director/lingo/lingo-gr.y" + case 101: +#line 417 "engines/director/lingo/lingo-gr.y" { g_lingo->codeFunc((yyvsp[(1) - (1)].s), 0); delete (yyvsp[(1) - (1)].s); ;} break; - case 111: -#line 474 "engines/director/lingo/lingo-gr.y" + case 102: +#line 420 "engines/director/lingo/lingo-gr.y" { g_lingo->codeFunc((yyvsp[(1) - (2)].s), 1); delete (yyvsp[(1) - (2)].s); ;} break; - case 112: -#line 477 "engines/director/lingo/lingo-gr.y" + case 103: +#line 423 "engines/director/lingo/lingo-gr.y" { g_lingo->codeFunc((yyvsp[(1) - (2)].s), 1); delete (yyvsp[(1) - (2)].s); ;} break; - case 113: -#line 480 "engines/director/lingo/lingo-gr.y" + case 104: +#line 426 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_voidpush); g_lingo->codeFunc((yyvsp[(1) - (1)].s), 1); delete (yyvsp[(1) - (1)].s); ;} break; - case 114: -#line 484 "engines/director/lingo/lingo-gr.y" + case 105: +#line 430 "engines/director/lingo/lingo-gr.y" { g_lingo->codeFunc((yyvsp[(1) - (2)].s), (yyvsp[(2) - (2)].narg)); ;} break; - case 115: -#line 485 "engines/director/lingo/lingo-gr.y" + case 106: +#line 431 "engines/director/lingo/lingo-gr.y" { g_lingo->codeMe((yyvsp[(3) - (4)].s), 0); ;} break; - case 116: -#line 486 "engines/director/lingo/lingo-gr.y" + case 107: +#line 432 "engines/director/lingo/lingo-gr.y" { g_lingo->codeMe((yyvsp[(3) - (6)].s), (yyvsp[(5) - (6)].narg)); ;} break; - case 117: -#line 487 "engines/director/lingo/lingo-gr.y" + case 108: +#line 433 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_open); ;} break; - case 118: -#line 488 "engines/director/lingo/lingo-gr.y" + case 109: +#line 434 "engines/director/lingo/lingo-gr.y" { g_lingo->code2(g_lingo->c_voidpush, g_lingo->c_open); ;} break; - case 119: -#line 489 "engines/director/lingo/lingo-gr.y" + case 110: +#line 435 "engines/director/lingo/lingo-gr.y" { Common::String s(*(yyvsp[(1) - (3)].s)); s += '-'; s += *(yyvsp[(2) - (3)].s); g_lingo->codeFunc(&s, (yyvsp[(3) - (3)].narg)); ;} break; - case 120: -#line 492 "engines/director/lingo/lingo-gr.y" + case 111: +#line 438 "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 121: -#line 493 "engines/director/lingo/lingo-gr.y" + case 112: +#line 439 "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 122: -#line 496 "engines/director/lingo/lingo-gr.y" + case 113: +#line 442 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_property); g_lingo->codeString((yyvsp[(1) - (1)].s)->c_str()); delete (yyvsp[(1) - (1)].s); ;} break; - case 123: -#line 497 "engines/director/lingo/lingo-gr.y" + case 114: +#line 443 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_property); g_lingo->codeString((yyvsp[(3) - (3)].s)->c_str()); delete (yyvsp[(3) - (3)].s); ;} break; - case 124: -#line 500 "engines/director/lingo/lingo-gr.y" + case 115: +#line 446 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_instance); g_lingo->codeString((yyvsp[(1) - (1)].s)->c_str()); delete (yyvsp[(1) - (1)].s); ;} break; - case 125: -#line 501 "engines/director/lingo/lingo-gr.y" + case 116: +#line 447 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_instance); g_lingo->codeString((yyvsp[(3) - (3)].s)->c_str()); delete (yyvsp[(3) - (3)].s); ;} break; - case 126: -#line 512 "engines/director/lingo/lingo-gr.y" + case 117: +#line 458 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gotoloop); ;} break; - case 127: -#line 513 "engines/director/lingo/lingo-gr.y" + case 118: +#line 459 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gotonext); ;} break; - case 128: -#line 514 "engines/director/lingo/lingo-gr.y" + case 119: +#line 460 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gotoprevious); ;} break; - case 129: -#line 515 "engines/director/lingo/lingo-gr.y" + case 120: +#line 461 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_intpush); g_lingo->codeInt(1); g_lingo->code1(g_lingo->c_goto); ;} break; - case 130: -#line 519 "engines/director/lingo/lingo-gr.y" + case 121: +#line 465 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_intpush); g_lingo->codeInt(3); g_lingo->code1(g_lingo->c_goto); ;} break; - case 131: -#line 523 "engines/director/lingo/lingo-gr.y" + case 122: +#line 469 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_intpush); g_lingo->codeInt(2); g_lingo->code1(g_lingo->c_goto); ;} break; - case 136: -#line 537 "engines/director/lingo/lingo-gr.y" + case 127: +#line 483 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_playdone); ;} break; - case 137: -#line 538 "engines/director/lingo/lingo-gr.y" + case 128: +#line 484 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_intpush); g_lingo->codeInt(1); g_lingo->code1(g_lingo->c_play); ;} break; - case 138: -#line 542 "engines/director/lingo/lingo-gr.y" + case 129: +#line 488 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_intpush); g_lingo->codeInt(3); g_lingo->code1(g_lingo->c_play); ;} break; - case 139: -#line 546 "engines/director/lingo/lingo-gr.y" + case 130: +#line 492 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_intpush); g_lingo->codeInt(2); g_lingo->code1(g_lingo->c_play); ;} break; - case 140: -#line 550 "engines/director/lingo/lingo-gr.y" + case 131: +#line 496 "engines/director/lingo/lingo-gr.y" { g_lingo->codeSetImmediate(true); ;} break; - case 141: -#line 550 "engines/director/lingo/lingo-gr.y" + case 132: +#line 496 "engines/director/lingo/lingo-gr.y" { g_lingo->codeSetImmediate(false); g_lingo->codeFunc((yyvsp[(1) - (3)].s), (yyvsp[(3) - (3)].narg)); ;} break; - case 142: -#line 580 "engines/director/lingo/lingo-gr.y" + case 133: +#line 526 "engines/director/lingo/lingo-gr.y" { g_lingo->_indef = true; g_lingo->_currentFactory.clear(); ;} break; - case 143: -#line 581 "engines/director/lingo/lingo-gr.y" + case 134: +#line 527 "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)); g_lingo->_indef = false; ;} break; - case 144: -#line 585 "engines/director/lingo/lingo-gr.y" + case 135: +#line 531 "engines/director/lingo/lingo-gr.y" { g_lingo->codeFactory(*(yyvsp[(2) - (2)].s)); ;} break; - case 145: -#line 586 "engines/director/lingo/lingo-gr.y" + case 136: +#line 532 "engines/director/lingo/lingo-gr.y" { g_lingo->_indef = true; ;} break; - case 146: -#line 587 "engines/director/lingo/lingo-gr.y" + case 137: +#line 533 "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 147: -#line 591 "engines/director/lingo/lingo-gr.y" + case 138: +#line 537 "engines/director/lingo/lingo-gr.y" { // D3 g_lingo->code1(g_lingo->c_procret); g_lingo->define(*(yyvsp[(1) - (8)].s), (yyvsp[(2) - (8)].code), (yyvsp[(3) - (8)].narg)); @@ -2927,8 +2855,8 @@ yyreduce: checkEnd((yyvsp[(7) - (8)].s), (yyvsp[(1) - (8)].s)->c_str(), false); ;} break; - case 148: -#line 598 "engines/director/lingo/lingo-gr.y" + case 139: +#line 544 "engines/director/lingo/lingo-gr.y" { // D4. No 'end' clause g_lingo->code1(g_lingo->c_procret); g_lingo->define(*(yyvsp[(1) - (6)].s), (yyvsp[(2) - (6)].code), (yyvsp[(3) - (6)].narg)); @@ -2936,38 +2864,38 @@ yyreduce: g_lingo->_ignoreMe = false; ;} break; - case 149: -#line 604 "engines/director/lingo/lingo-gr.y" + case 140: +#line 550 "engines/director/lingo/lingo-gr.y" { (yyval.s) = (yyvsp[(2) - (2)].s); g_lingo->_indef = true; g_lingo->_currentFactory.clear(); g_lingo->_ignoreMe = true; ;} break; - case 150: -#line 606 "engines/director/lingo/lingo-gr.y" + case 141: +#line 552 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = 0; ;} break; - case 151: -#line 607 "engines/director/lingo/lingo-gr.y" + case 142: +#line 553 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArg((yyvsp[(1) - (1)].s)); (yyval.narg) = 1; ;} break; - case 152: -#line 608 "engines/director/lingo/lingo-gr.y" + case 143: +#line 554 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArg((yyvsp[(3) - (3)].s)); (yyval.narg) = (yyvsp[(1) - (3)].narg) + 1; ;} break; - case 153: -#line 609 "engines/director/lingo/lingo-gr.y" + case 144: +#line 555 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArg((yyvsp[(4) - (4)].s)); (yyval.narg) = (yyvsp[(1) - (4)].narg) + 1; ;} break; - case 157: -#line 617 "engines/director/lingo/lingo-gr.y" + case 148: +#line 563 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArgStore(); ;} break; - case 158: -#line 621 "engines/director/lingo/lingo-gr.y" + case 149: +#line 567 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_call); g_lingo->codeString((yyvsp[(1) - (2)].s)->c_str()); @@ -2976,34 +2904,34 @@ yyreduce: g_lingo->code1(numpar); ;} break; - case 159: -#line 629 "engines/director/lingo/lingo-gr.y" + case 150: +#line 575 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = 0; ;} break; - case 160: -#line 630 "engines/director/lingo/lingo-gr.y" + case 151: +#line 576 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = 1; ;} break; - case 161: -#line 631 "engines/director/lingo/lingo-gr.y" + case 152: +#line 577 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = (yyvsp[(1) - (3)].narg) + 1; ;} break; - case 162: -#line 634 "engines/director/lingo/lingo-gr.y" + case 153: +#line 580 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = 1; ;} break; - case 163: -#line 635 "engines/director/lingo/lingo-gr.y" + case 154: +#line 581 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = (yyvsp[(1) - (3)].narg) + 1; ;} break; /* Line 1267 of yacc.c. */ -#line 3007 "engines/director/lingo/lingo-gr.cpp" +#line 2935 "engines/director/lingo/lingo-gr.cpp" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -3217,6 +3145,6 @@ yyreturn: } -#line 638 "engines/director/lingo/lingo-gr.y" +#line 584 "engines/director/lingo/lingo-gr.y" diff --git a/engines/director/lingo/lingo-gr.h b/engines/director/lingo/lingo-gr.h index 9930ecdbad..0fc9c0efa1 100644 --- a/engines/director/lingo/lingo-gr.h +++ b/engines/director/lingo/lingo-gr.h @@ -74,7 +74,7 @@ tPLAYACCEL = 290, tDOWN = 291, tELSE = 292, - tNLELSIF = 293, + tELSIF = 293, tEXIT = 294, tFRAME = 295, tGLOBAL = 296, @@ -91,44 +91,46 @@ tREPEAT = 307, tSET = 308, tTHEN = 309, - tTHENNL = 310, - tTO = 311, - tWHEN = 312, - tWITH = 313, - tWHILE = 314, - tNLELSE = 315, - tFACTORY = 316, - tMETHOD = 317, - tOPEN = 318, - tPLAY = 319, - tDONE = 320, - tINSTANCE = 321, - tGE = 322, - tLE = 323, - tGT = 324, - tLT = 325, - tEQ = 326, - tNEQ = 327, - tAND = 328, - tOR = 329, - tNOT = 330, - tMOD = 331, - tAFTER = 332, - tBEFORE = 333, - tCONCAT = 334, - tCONTAINS = 335, - tSTARTS = 336, - tCHAR = 337, - tITEM = 338, - tLINE = 339, - tWORD = 340, - tSPRITE = 341, - tINTERSECTS = 342, - tWITHIN = 343, - tTELL = 344, - tPROPERTY = 345, - tON = 346, - tME = 347 + tTO = 310, + tWHEN = 311, + tWITH = 312, + tWHILE = 313, + tNLELSE = 314, + tFACTORY = 315, + tMETHOD = 316, + tOPEN = 317, + tPLAY = 318, + tDONE = 319, + tINSTANCE = 320, + tGE = 321, + tLE = 322, + tGT = 323, + tLT = 324, + tEQ = 325, + tNEQ = 326, + tAND = 327, + tOR = 328, + tNOT = 329, + tMOD = 330, + tAFTER = 331, + tBEFORE = 332, + tCONCAT = 333, + tCONTAINS = 334, + tSTARTS = 335, + tCHAR = 336, + tITEM = 337, + tLINE = 338, + tWORD = 339, + tSPRITE = 340, + tINTERSECTS = 341, + tWITHIN = 342, + tTELL = 343, + tPROPERTY = 344, + tON = 345, + tME = 346, + tENDIF = 347, + tENDREPEAT = 348, + tENDTELL = 349 }; #endif /* Tokens. */ @@ -167,7 +169,7 @@ #define tPLAYACCEL 290 #define tDOWN 291 #define tELSE 292 -#define tNLELSIF 293 +#define tELSIF 293 #define tEXIT 294 #define tFRAME 295 #define tGLOBAL 296 @@ -184,44 +186,46 @@ #define tREPEAT 307 #define tSET 308 #define tTHEN 309 -#define tTHENNL 310 -#define tTO 311 -#define tWHEN 312 -#define tWITH 313 -#define tWHILE 314 -#define tNLELSE 315 -#define tFACTORY 316 -#define tMETHOD 317 -#define tOPEN 318 -#define tPLAY 319 -#define tDONE 320 -#define tINSTANCE 321 -#define tGE 322 -#define tLE 323 -#define tGT 324 -#define tLT 325 -#define tEQ 326 -#define tNEQ 327 -#define tAND 328 -#define tOR 329 -#define tNOT 330 -#define tMOD 331 -#define tAFTER 332 -#define tBEFORE 333 -#define tCONCAT 334 -#define tCONTAINS 335 -#define tSTARTS 336 -#define tCHAR 337 -#define tITEM 338 -#define tLINE 339 -#define tWORD 340 -#define tSPRITE 341 -#define tINTERSECTS 342 -#define tWITHIN 343 -#define tTELL 344 -#define tPROPERTY 345 -#define tON 346 -#define tME 347 +#define tTO 310 +#define tWHEN 311 +#define tWITH 312 +#define tWHILE 313 +#define tNLELSE 314 +#define tFACTORY 315 +#define tMETHOD 316 +#define tOPEN 317 +#define tPLAY 318 +#define tDONE 319 +#define tINSTANCE 320 +#define tGE 321 +#define tLE 322 +#define tGT 323 +#define tLT 324 +#define tEQ 325 +#define tNEQ 326 +#define tAND 327 +#define tOR 328 +#define tNOT 329 +#define tMOD 330 +#define tAFTER 331 +#define tBEFORE 332 +#define tCONCAT 333 +#define tCONTAINS 334 +#define tSTARTS 335 +#define tCHAR 336 +#define tITEM 337 +#define tLINE 338 +#define tWORD 339 +#define tSPRITE 340 +#define tINTERSECTS 341 +#define tWITHIN 342 +#define tTELL 343 +#define tPROPERTY 344 +#define tON 345 +#define tME 346 +#define tENDIF 347 +#define tENDREPEAT 348 +#define tENDTELL 349 @@ -239,7 +243,7 @@ typedef union YYSTYPE Common::Array<double> *arr; } /* Line 1529 of yacc.c. */ -#line 243 "engines/director/lingo/lingo-gr.hpp" +#line 247 "engines/director/lingo/lingo-gr.hpp" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 diff --git a/engines/director/lingo/lingo-gr.y b/engines/director/lingo/lingo-gr.y index d05d37bcb3..ce2a8db344 100644 --- a/engines/director/lingo/lingo-gr.y +++ b/engines/director/lingo/lingo-gr.y @@ -95,13 +95,13 @@ void checkEnd(Common::String *token, const char *expect, bool required) { %token<s> FBLTIN FBLTINNOARGS FBLTINONEARG FBLTINARGLIST RBLTIN RBLTINONEARG %token<s> ID STRING HANDLER SYMBOL %token<s> ENDCLAUSE tPLAYACCEL -%token tDOWN tELSE tNLELSIF tEXIT tFRAME tGLOBAL tGO tIF tINTO tLOOP tMACRO -%token tMOVIE tNEXT tOF tPREVIOUS tPUT tREPEAT tSET tTHEN tTHENNL tTO tWHEN +%token tDOWN tELSE tELSIF tEXIT tFRAME tGLOBAL tGO tIF tINTO tLOOP tMACRO +%token tMOVIE tNEXT tOF tPREVIOUS tPUT tREPEAT tSET tTHEN tTO tWHEN %token tWITH tWHILE tNLELSE tFACTORY tMETHOD tOPEN tPLAY tDONE tINSTANCE %token tGE tLE tGT tLT tEQ tNEQ tAND tOR tNOT tMOD %token tAFTER tBEFORE tCONCAT tCONTAINS tSTARTS tCHAR tITEM tLINE tWORD %token tSPRITE tINTERSECTS tWITHIN tTELL tPROPERTY -%token tON tME +%token tON tME tENDIF tENDREPEAT tENDTELL %type<code> asgn begin elseif end expr if when repeatwhile %type<code> repeatwith stmtlist tell reference simpleexpr @@ -189,20 +189,18 @@ stmt: stmtoneliner // statements // end repeat // - | repeatwhile expr stmtlist end ENDCLAUSE { + | repeatwhile expr stmtlist end tENDREPEAT { inst body = 0, end = 0; WRITE_UINT32(&body, $3 - $1); WRITE_UINT32(&end, $4 - $1); (*g_lingo->_currentScript)[$1 + 1] = body; /* body of loop */ - (*g_lingo->_currentScript)[$1 + 2] = end; /* end, if cond fails */ - - checkEnd($5, "repeat", true); } + (*g_lingo->_currentScript)[$1 + 2] = end; } /* end, if cond fails */ ; // repeat with index = start to end // statements // end repeat // - | repeatwith tEQ expr end tTO expr end stmtlist end ENDCLAUSE { + | repeatwith tEQ expr end tTO expr end stmtlist end tENDREPEAT { inst init = 0, finish = 0, body = 0, end = 0, inc = 0; WRITE_UINT32(&init, $3 - $1); WRITE_UINT32(&finish, $6 - $1); @@ -213,14 +211,13 @@ stmt: stmtoneliner (*g_lingo->_currentScript)[$1 + 2] = finish;/* final count value */ (*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 */ + (*g_lingo->_currentScript)[$1 + 5] = end; } /* end, if cond fails */ - checkEnd($10, "repeat", true); } // repeat with index = high down to low // statements // end repeat // - | repeatwith tEQ expr end tDOWN tTO expr end stmtlist end ENDCLAUSE { + | repeatwith tEQ expr end tDOWN tTO expr end stmtlist end tENDREPEAT { inst init = 0, finish = 0, body = 0, end = 0, inc = 0; WRITE_UINT32(&init, $3 - $1); WRITE_UINT32(&finish, $7 - $1); @@ -231,75 +228,46 @@ stmt: stmtoneliner (*g_lingo->_currentScript)[$1 + 2] = finish;/* final count value */ (*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 */ - - checkEnd($11, "repeat", true); } + (*g_lingo->_currentScript)[$1 + 5] = end; } /* end, if cond fails */ | when stmtoneliner end { inst end = 0; WRITE_UINT32(&end, $3 - $1); g_lingo->code1(STOP); (*g_lingo->_currentScript)[$1 + 1] = end; } - | tell expr '\n' stmtlist end ENDCLAUSE { - warning("STUB: TELL is not implemented"); - checkEnd($6, "tell", true); } + | tell expr '\n' stmtlist end tENDTELL { + warning("STUB: TELL is not implemented"); } | tell expr tTO expr { warning("STUB: TELL is not implemented"); } ; -ifstmt: if expr tTHEN begin stmtoneliner end elseifstmtlist end endifstmt end { +ifstmt: if expr tTHEN begin stmtlist end elseifstmtlist end tENDIF { inst then = 0, else1 = 0, end = 0; WRITE_UINT32(&then, $4 - $1); WRITE_UINT32(&else1, $6 - $1); - WRITE_UINT32(&end, $10 - $1); + WRITE_UINT32(&end, $8 - $1); (*g_lingo->_currentScript)[$1 + 1] = then; /* thenpart */ (*g_lingo->_currentScript)[$1 + 2] = else1; /* elsepart */ (*g_lingo->_currentScript)[$1 + 3] = end; /* end, if cond fails */ - g_lingo->processIf(0, $10 - $1); } - | if expr tTHEN begin stmtoneliner end { - inst then = 0, else1 = 0, end = 0; - WRITE_UINT32(&then, $4 - $1); - WRITE_UINT32(&else1, 0); - WRITE_UINT32(&end, $6 - $1); - (*g_lingo->_currentScript)[$1 + 1] = then; /* thenpart */ - (*g_lingo->_currentScript)[$1 + 2] = else1; /* elsepart */ - (*g_lingo->_currentScript)[$1 + 3] = end; /* end, if cond fails */ - - g_lingo->processIf(0, 0); } - | if expr tTHENNL stmtlist end elseifstmtlist end endifstmt end { + g_lingo->processIf(0, $8 - $1); } + | if expr tTHEN begin stmtlist end elseifstmtlist end tELSE stmtlist tENDIF { inst then = 0, else1 = 0, end = 0; WRITE_UINT32(&then, $4 - $1); - WRITE_UINT32(&else1, $7 - $1); - WRITE_UINT32(&end, $9 - $1); + WRITE_UINT32(&else1, $6 - $1); + WRITE_UINT32(&end, $8 - $1); (*g_lingo->_currentScript)[$1 + 1] = then; /* thenpart */ (*g_lingo->_currentScript)[$1 + 2] = else1; /* elsepart */ (*g_lingo->_currentScript)[$1 + 3] = end; /* end, if cond fails */ - g_lingo->processIf(0, 0); } - | if expr tTHENNL stmtlist end ENDCLAUSE { - inst then = 0, end = 0; - WRITE_UINT32(&then, $4 - $1); - WRITE_UINT32(&end, $5 - $1); - (*g_lingo->_currentScript)[$1 + 1] = then; /* thenpart */ - (*g_lingo->_currentScript)[$1 + 3] = end; /* end, if cond fails */ - - checkEnd($6, "if", true); - - g_lingo->processIf(0, 0); } + g_lingo->processIf(0, $8 - $1); } ; elseifstmtlist: /* nothing */ | elseifstmt elseifstmtlist ; -elseifstmt: elseif expr tTHEN begin stmtoneliner end { - inst then = 0; - WRITE_UINT32(&then, $4 - $1); - (*g_lingo->_currentScript)[$1 + 1] = then; /* thenpart */ - - g_lingo->codeLabel($1); } - | elseif expr tTHENNL begin stmtlist end { +elseifstmt: elseif expr tTHEN begin stmtlist end { inst then = 0; WRITE_UINT32(&then, $5 - $1); (*g_lingo->_currentScript)[$1 + 1] = then; /* thenpart */ @@ -307,28 +275,6 @@ elseifstmt: elseif expr tTHEN begin stmtoneliner end { g_lingo->codeLabel($1); } ; -endifstmt: ENDCLAUSE - | elseif expr tTHEN begin stmtoneliner end tELSE stmtoneliner end { - inst then = 0; - WRITE_UINT32(&then, $4 - $1); - (*g_lingo->_currentScript)[$1 + 1] = then; /* thenpart */ - - g_lingo->codeLabel($1); } - | tELSE begin stmtlist end ENDCLAUSE { - g_lingo->codeLabel($2); - - checkEnd($5, "if", true); } - | tELSE begin stmtoneliner end { - g_lingo->codeLabel($2); } - - | tNLELSE begin stmtlist end ENDCLAUSE { - g_lingo->codeLabel($2); - - checkEnd($5, "if", true); } - | tNLELSE begin stmtoneliner end { - g_lingo->codeLabel($2); } - ; - repeatwhile: tREPEAT tWHILE { $$ = g_lingo->code3(g_lingo->c_repeatwhilecode, STOP, STOP); } ; @@ -346,7 +292,7 @@ if: tIF { g_lingo->codeLabel(0); } // Mark beginning of the if() statement ; -elseif: tNLELSIF { +elseif: tELSIF { inst skipEnd; WRITE_UINT32(&skipEnd, 1); // We have to skip end to avoid multiple executions $$ = g_lingo->code1(g_lingo->c_ifcode); diff --git a/engines/director/lingo/lingo-lex.cpp b/engines/director/lingo/lingo-lex.cpp index df36382c5c..3cfd3f410a 100644 --- a/engines/director/lingo/lingo-lex.cpp +++ b/engines/director/lingo/lingo-lex.cpp @@ -364,8 +364,8 @@ static void yy_fatal_error (yyconst char msg[] ); *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 76 -#define YY_END_OF_BUFFER 77 +#define YY_NUM_RULES 74 +#define YY_END_OF_BUFFER 75 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -373,39 +373,38 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[286] = +static yyconst flex_int16_t yy_accept[279] = { 0, - 0, 0, 77, 75, 4, 73, 73, 75, 75, 75, - 72, 72, 72, 71, 72, 68, 72, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 75, 3, 3, 4, 73, - 0, 0, 0, 0, 0, 0, 74, 5, 67, 2, - 70, 71, 66, 64, 65, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 23, 13, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 36, - 37, 69, 39, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 57, 69, 69, 69, 1, 3, 3, 0, - - 5, 2, 70, 69, 7, 69, 69, 69, 69, 69, - 69, 17, 69, 69, 69, 69, 0, 69, 69, 69, - 69, 69, 69, 69, 32, 69, 69, 35, 69, 69, - 69, 69, 44, 69, 46, 69, 69, 69, 69, 69, - 69, 69, 69, 0, 69, 69, 9, 69, 11, 12, - 16, 0, 17, 19, 69, 69, 69, 0, 69, 69, - 26, 27, 28, 29, 69, 69, 69, 34, 38, 40, - 69, 69, 69, 69, 69, 48, 0, 55, 61, 69, - 59, 63, 15, 6, 69, 69, 17, 17, 69, 20, - 69, 22, 69, 69, 30, 69, 33, 69, 69, 69, - - 69, 69, 69, 54, 54, 54, 54, 56, 62, 69, - 0, 8, 69, 17, 69, 21, 69, 69, 31, 69, - 69, 69, 45, 58, 47, 0, 0, 54, 54, 54, - 60, 0, 69, 18, 69, 69, 69, 69, 69, 0, - 0, 0, 0, 54, 54, 54, 14, 10, 24, 69, - 69, 42, 43, 0, 0, 0, 54, 54, 54, 69, - 41, 0, 0, 0, 0, 0, 54, 25, 53, 52, - 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 49, 50, 51, 51, 0 + 0, 0, 75, 73, 4, 71, 71, 73, 73, 73, + 70, 70, 70, 69, 70, 66, 70, 67, 67, 67, + 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, + 67, 67, 67, 67, 67, 73, 3, 3, 4, 71, + 0, 0, 0, 72, 5, 65, 2, 68, 69, 64, + 62, 63, 67, 67, 67, 67, 67, 67, 67, 67, + 67, 67, 67, 67, 67, 22, 13, 67, 67, 67, + 67, 67, 67, 67, 67, 67, 35, 36, 67, 38, + 67, 67, 67, 67, 67, 67, 67, 67, 67, 55, + 67, 67, 67, 1, 3, 3, 5, 2, 68, 67, + + 7, 67, 67, 67, 67, 67, 67, 16, 67, 67, + 67, 67, 0, 67, 67, 67, 67, 67, 67, 67, + 31, 67, 67, 34, 67, 67, 67, 67, 43, 67, + 45, 67, 67, 67, 67, 67, 67, 67, 67, 67, + 67, 9, 67, 11, 12, 15, 0, 16, 18, 67, + 67, 67, 0, 67, 67, 25, 26, 27, 28, 67, + 67, 67, 33, 37, 39, 67, 67, 67, 67, 67, + 47, 0, 54, 59, 67, 57, 61, 6, 67, 67, + 0, 16, 16, 67, 19, 67, 21, 67, 67, 29, + 67, 32, 67, 67, 67, 67, 67, 67, 53, 53, + + 53, 53, 60, 67, 8, 67, 0, 16, 67, 20, + 67, 67, 30, 67, 67, 67, 44, 56, 46, 0, + 0, 53, 53, 53, 58, 67, 14, 17, 67, 67, + 67, 67, 67, 0, 0, 0, 0, 53, 53, 53, + 10, 23, 67, 67, 41, 42, 0, 0, 0, 53, + 53, 53, 67, 40, 0, 0, 0, 0, 0, 53, + 24, 52, 51, 52, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 48, 49, 50, 50, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -451,81 +450,77 @@ static yyconst flex_int32_t yy_meta[66] = 5, 5, 5, 5, 1 } ; -static yyconst flex_int16_t yy_base[297] = +static yyconst flex_int16_t yy_base[290] = { 0, - 0, 64, 190, 760, 68, 72, 76, 80, 172, 0, - 760, 152, 121, 55, 71, 760, 106, 66, 68, 66, - 62, 72, 95, 73, 0, 107, 80, 123, 117, 117, - 122, 85, 154, 138, 156, 104, 191, 199, 212, 760, - 216, 153, 186, 220, 75, 103, 760, 0, 760, 0, - 91, 185, 760, 760, 760, 0, 82, 131, 161, 194, - 114, 197, 193, 192, 203, 210, 213, 203, 89, 0, - 204, 219, 205, 213, 225, 211, 241, 208, 213, 0, - 0, 228, 0, 243, 252, 217, 237, 240, 246, 263, - 256, 263, 0, 266, 254, 257, 760, 291, 315, 263, - - 0, 0, 85, 279, 0, 274, 275, 275, 280, 282, - 294, 325, 287, 288, 296, 311, 331, 296, 321, 309, - 318, 310, 311, 321, 0, 324, 317, 0, 324, 317, - 321, 328, 0, 339, 0, 337, 336, 344, 384, 343, - 346, 339, 358, 358, 351, 358, 0, 375, 0, 0, - 0, 240, 0, 0, 364, 377, 382, 371, 385, 372, - 0, 0, 0, 0, 376, 377, 388, 0, 0, 393, - 386, 393, 399, 384, 385, 0, 440, 418, 0, 405, - 403, 0, 444, 0, 411, 408, 0, 0, 405, 0, - 413, 760, 418, 414, 0, 430, 0, 435, 422, 423, - - 424, 439, 429, 463, 476, 487, 494, 466, 0, 437, - 498, 0, 453, 0, 444, 0, 469, 474, 0, 483, - 469, 472, 0, 0, 0, 510, 490, 512, 532, 548, - 0, 494, 475, 0, 505, 513, 517, 494, 504, 554, - 530, 532, 535, 571, 572, 578, 760, 0, 0, 527, - 539, 0, 0, 532, 519, 543, 591, 592, 607, 553, - 0, 557, 608, 577, 613, 614, 619, 0, 760, 620, - 760, 630, 598, 634, 604, 635, 645, 652, 661, 605, - 669, 673, 674, 680, 760, 715, 717, 720, 723, 729, - 734, 739, 742, 747, 749, 754 - + 0, 64, 177, 736, 68, 736, 736, 72, 159, 0, + 736, 113, 107, 55, 63, 736, 94, 58, 60, 58, + 54, 62, 77, 63, 0, 94, 70, 109, 106, 109, + 121, 75, 138, 137, 146, 82, 141, 185, 199, 736, + 205, 94, 93, 736, 0, 736, 0, 79, 90, 736, + 736, 736, 0, 69, 129, 128, 163, 139, 182, 160, + 178, 174, 193, 196, 185, 130, 0, 182, 200, 190, + 195, 203, 192, 208, 191, 196, 0, 0, 211, 0, + 216, 231, 201, 211, 213, 223, 217, 235, 242, 0, + 246, 230, 240, 736, 279, 296, 0, 0, 70, 247, + + 0, 248, 246, 252, 269, 265, 270, 304, 260, 269, + 277, 289, 308, 277, 293, 293, 287, 291, 291, 301, + 0, 301, 295, 0, 302, 294, 298, 307, 0, 306, + 0, 315, 309, 322, 351, 328, 333, 339, 344, 335, + 336, 0, 353, 0, 0, 177, 224, 0, 0, 342, + 353, 358, 347, 361, 349, 0, 0, 0, 0, 353, + 355, 365, 0, 0, 370, 365, 370, 377, 362, 363, + 0, 400, 0, 0, 387, 385, 0, 0, 392, 389, + 415, 0, 0, 385, 0, 396, 736, 395, 391, 0, + 408, 0, 410, 396, 398, 397, 420, 402, 457, 466, + + 467, 468, 0, 428, 0, 434, 442, 0, 434, 0, + 456, 458, 0, 461, 446, 453, 0, 0, 0, 489, + 466, 511, 525, 512, 0, 462, 736, 0, 469, 474, + 482, 468, 467, 527, 519, 515, 515, 536, 542, 549, + 0, 0, 507, 522, 0, 0, 515, 374, 527, 562, + 573, 582, 522, 0, 547, 441, 565, 586, 592, 594, + 0, 736, 490, 736, 600, 567, 605, 568, 618, 624, + 631, 637, 578, 639, 645, 647, 653, 736, 691, 693, + 696, 699, 705, 710, 715, 718, 723, 725, 730 } ; -static yyconst flex_int16_t yy_def[297] = +static yyconst flex_int16_t yy_def[290] = { 0, - 285, 1, 285, 285, 285, 285, 285, 285, 286, 287, - 285, 285, 285, 285, 285, 285, 285, 288, 288, 288, - 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, - 288, 288, 288, 288, 288, 285, 285, 285, 285, 285, - 285, 285, 285, 285, 285, 286, 285, 289, 285, 290, - 285, 285, 285, 285, 285, 288, 288, 288, 288, 288, - 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, - 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, - 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, - 288, 288, 288, 288, 288, 288, 285, 285, 285, 285, - - 289, 290, 285, 288, 288, 288, 288, 288, 288, 288, - 288, 291, 288, 288, 288, 288, 285, 288, 288, 288, - 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, - 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, - 288, 288, 288, 285, 288, 288, 288, 288, 288, 288, - 288, 292, 293, 288, 288, 288, 288, 285, 288, 288, - 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, - 288, 288, 288, 288, 288, 288, 294, 288, 288, 288, - 288, 288, 285, 288, 288, 288, 295, 293, 288, 288, - 288, 285, 288, 288, 288, 288, 288, 288, 288, 288, - - 288, 288, 288, 294, 294, 294, 294, 285, 288, 288, - 285, 288, 288, 295, 288, 288, 288, 288, 288, 288, - 288, 288, 288, 288, 288, 285, 285, 294, 294, 294, - 288, 285, 288, 288, 288, 288, 288, 288, 288, 285, - 285, 285, 285, 294, 294, 294, 285, 288, 288, 288, - 288, 288, 288, 285, 285, 285, 294, 294, 294, 288, - 288, 285, 296, 285, 285, 285, 294, 288, 285, 296, - 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, - 296, 296, 285, 296, 0, 285, 285, 285, 285, 285, - 285, 285, 285, 285, 285, 285 - + 278, 1, 278, 278, 278, 278, 278, 278, 279, 280, + 278, 278, 278, 278, 278, 278, 278, 281, 281, 281, + 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, + 281, 281, 281, 281, 281, 278, 278, 278, 278, 278, + 278, 278, 279, 278, 282, 278, 283, 278, 278, 278, + 278, 278, 281, 281, 281, 281, 281, 281, 281, 281, + 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, + 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, + 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, + 281, 281, 281, 278, 278, 278, 282, 283, 278, 281, + + 281, 281, 281, 281, 281, 281, 281, 284, 281, 281, + 281, 281, 278, 281, 281, 281, 281, 281, 281, 281, + 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, + 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, + 281, 281, 281, 281, 281, 281, 285, 286, 281, 281, + 281, 281, 278, 281, 281, 281, 281, 281, 281, 281, + 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, + 281, 287, 281, 281, 281, 281, 281, 281, 281, 281, + 278, 288, 286, 281, 281, 281, 278, 281, 281, 281, + 281, 281, 281, 281, 281, 281, 281, 281, 287, 287, + + 287, 287, 281, 281, 281, 281, 278, 288, 281, 281, + 281, 281, 281, 281, 281, 281, 281, 281, 281, 278, + 278, 287, 287, 287, 281, 281, 278, 281, 281, 281, + 281, 281, 281, 278, 278, 278, 278, 287, 287, 287, + 281, 281, 281, 281, 281, 281, 278, 278, 278, 287, + 287, 287, 281, 281, 278, 289, 278, 278, 278, 287, + 281, 278, 289, 278, 278, 278, 278, 278, 278, 278, + 278, 278, 278, 289, 289, 278, 289, 0, 278, 278, + 278, 278, 278, 278, 278, 278, 278, 278, 278 } ; -static yyconst flex_int16_t yy_nxt[826] = +static yyconst flex_int16_t yy_nxt[802] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 11, 13, 4, 14, 15, 16, 17, 18, 19, 20, 21, @@ -533,94 +528,92 @@ static yyconst flex_int16_t yy_nxt[826] = 31, 25, 32, 33, 34, 25, 25, 35, 25, 25, 25, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 25, 32, 33, 34, 25, - 25, 35, 25, 25, 36, 37, 51, 52, 38, 39, - 40, 40, 41, 43, 44, 44, 43, 43, 44, 44, - 43, 41, 40, 40, 41, 53, 54, 57, 59, 60, - 117, 62, 45, 117, 58, 61, 45, 103, 63, 68, - - 64, 100, 69, 103, 73, 87, 97, 97, 47, 74, - 65, 66, 57, 59, 60, 62, 104, 45, 58, 61, - 55, 45, 63, 68, 64, 100, 69, 67, 70, 73, - 87, 50, 42, 74, 65, 71, 66, 78, 80, 75, - 104, 72, 108, 76, 42, 81, 79, 82, 84, 83, - 105, 67, 77, 70, 85, 97, 97, 86, 91, 71, - 49, 92, 78, 80, 75, 72, 108, 93, 76, 81, - 79, 82, 84, 83, 88, 105, 77, 47, 85, 94, - 95, 86, 106, 91, 89, 96, 92, 43, 90, 285, - 43, 93, 98, 40, 40, 99, 51, 52, 285, 88, - - 99, 40, 40, 99, 94, 95, 45, 106, 89, 96, - 107, 112, 90, 39, 40, 40, 41, 41, 40, 40, - 41, 43, 44, 44, 43, 109, 111, 113, 114, 115, - 285, 45, 116, 121, 110, 107, 112, 118, 119, 120, - 45, 152, 122, 123, 152, 124, 127, 128, 129, 109, - 111, 133, 113, 114, 115, 42, 116, 121, 110, 130, - 125, 118, 119, 42, 120, 45, 122, 134, 123, 124, - 127, 128, 131, 129, 135, 133, 42, 126, 136, 137, - 42, 132, 138, 139, 130, 125, 140, 285, 142, 143, - 141, 134, 98, 40, 40, 99, 144, 131, 135, 145, - - 149, 126, 136, 146, 137, 132, 138, 147, 139, 148, - 150, 140, 142, 143, 151, 141, 99, 40, 40, 99, - 144, 154, 155, 156, 145, 149, 152, 146, 157, 152, - 159, 147, 117, 148, 150, 117, 162, 56, 163, 151, - 164, 160, 285, 165, 166, 154, 155, 156, 167, 285, - 161, 168, 169, 157, 159, 42, 170, 171, 172, 173, - 162, 174, 181, 163, 164, 158, 160, 165, 175, 166, - 176, 179, 180, 167, 161, 168, 169, 182, 183, 42, - 170, 171, 172, 184, 173, 177, 174, 181, 177, 158, - 185, 186, 175, 189, 176, 179, 180, 190, 191, 285, - - 192, 193, 182, 183, 194, 195, 196, 184, 197, 198, - 199, 285, 178, 200, 185, 201, 186, 189, 202, 203, - 208, 208, 190, 191, 192, 209, 193, 210, 194, 195, - 196, 212, 213, 197, 198, 199, 178, 215, 200, 216, - 201, 177, 202, 203, 177, 211, 217, 218, 211, 219, - 209, 221, 210, 220, 285, 222, 212, 213, 223, 224, - 285, 215, 225, 216, 226, 231, 205, 226, 208, 208, - 217, 218, 227, 206, 219, 221, 207, 226, 220, 222, - 226, 233, 223, 234, 224, 227, 225, 235, 226, 231, - 205, 226, 228, 285, 236, 226, 227, 206, 226, 211, - - 207, 237, 211, 227, 238, 233, 239, 234, 248, 241, - 230, 240, 235, 226, 240, 247, 226, 228, 229, 236, - 263, 227, 232, 263, 243, 249, 237, 252, 238, 241, - 239, 250, 248, 226, 241, 230, 226, 251, 285, 242, - 247, 227, 229, 253, 243, 244, 254, 232, 243, 226, - 249, 252, 226, 255, 241, 240, 250, 227, 240, 256, - 285, 260, 251, 242, 245, 261, 262, 253, 243, 244, - 264, 254, 226, 226, 246, 226, 226, 269, 255, 226, - 227, 227, 226, 242, 256, 260, 268, 227, 245, 261, - 262, 285, 265, 266, 264, 265, 266, 271, 246, 285, - - 227, 227, 269, 285, 285, 257, 258, 242, 226, 263, - 268, 226, 263, 259, 272, 274, 227, 272, 274, 277, - 276, 285, 271, 276, 285, 278, 283, 267, 227, 257, - 258, 272, 241, 241, 272, 274, 279, 259, 274, 279, - 285, 285, 273, 275, 277, 285, 281, 243, 243, 281, - 278, 283, 267, 282, 241, 285, 282, 241, 241, 273, - 285, 285, 279, 275, 280, 279, 273, 275, 285, 243, - 281, 243, 243, 281, 282, 284, 285, 282, 284, 241, - 285, 284, 285, 273, 284, 285, 285, 275, 280, 285, - 280, 285, 285, 243, 285, 285, 285, 285, 285, 285, - - 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, - 285, 285, 285, 285, 280, 46, 46, 285, 46, 46, - 46, 48, 48, 56, 56, 56, 101, 101, 101, 102, - 102, 285, 102, 102, 102, 153, 285, 153, 153, 153, - 187, 285, 285, 187, 187, 188, 188, 188, 204, 285, - 285, 204, 214, 214, 214, 270, 285, 285, 270, 3, - 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, - 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, - 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, - 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, - - 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, - 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, - 285, 285, 285, 285, 285 + 25, 35, 25, 25, 36, 37, 48, 49, 38, 39, + 40, 40, 41, 41, 40, 40, 41, 50, 51, 54, + 56, 57, 99, 59, 94, 94, 55, 58, 60, 65, + 61, 99, 66, 63, 70, 84, 94, 94, 44, 71, + + 62, 48, 49, 100, 54, 56, 57, 59, 52, 64, + 55, 58, 60, 65, 61, 67, 66, 47, 63, 70, + 84, 46, 68, 71, 62, 72, 75, 100, 69, 73, + 77, 113, 42, 64, 113, 76, 42, 78, 74, 79, + 67, 80, 95, 40, 40, 96, 68, 81, 101, 102, + 72, 75, 69, 82, 73, 77, 83, 88, 85, 76, + 89, 78, 74, 79, 44, 80, 90, 104, 86, 91, + 92, 81, 87, 101, 102, 93, 278, 82, 181, 103, + 83, 181, 88, 85, 278, 89, 96, 40, 40, 96, + 90, 104, 86, 107, 91, 92, 87, 108, 109, 93, + + 39, 40, 40, 41, 103, 42, 41, 40, 40, 41, + 105, 110, 111, 278, 112, 114, 115, 107, 117, 106, + 116, 119, 108, 109, 118, 147, 120, 121, 147, 123, + 124, 125, 126, 133, 105, 129, 110, 111, 112, 114, + 115, 130, 117, 106, 122, 116, 119, 131, 118, 42, + 120, 127, 121, 123, 124, 132, 125, 126, 133, 129, + 128, 134, 135, 42, 138, 130, 136, 140, 122, 42, + 137, 131, 139, 278, 278, 278, 127, 141, 142, 132, + 95, 40, 40, 96, 128, 134, 143, 135, 138, 144, + 146, 136, 140, 145, 149, 137, 139, 96, 40, 40, + + 96, 141, 142, 150, 151, 147, 152, 158, 147, 113, + 143, 154, 113, 155, 144, 146, 53, 145, 149, 278, + 157, 159, 156, 160, 161, 162, 168, 150, 151, 163, + 164, 152, 158, 165, 166, 154, 278, 167, 155, 169, + 278, 170, 153, 42, 157, 159, 156, 160, 171, 161, + 162, 168, 172, 163, 164, 172, 174, 165, 166, 175, + 42, 167, 176, 177, 169, 170, 153, 178, 179, 180, + 278, 184, 171, 185, 186, 256, 187, 188, 256, 173, + 174, 189, 190, 175, 191, 192, 193, 176, 177, 194, + 195, 178, 179, 196, 180, 184, 197, 198, 185, 186, + + 187, 172, 188, 173, 172, 189, 190, 203, 191, 204, + 192, 193, 205, 206, 194, 195, 181, 209, 196, 181, + 197, 198, 210, 211, 212, 215, 200, 213, 214, 278, + 216, 217, 203, 201, 204, 219, 202, 205, 206, 207, + 218, 209, 256, 278, 278, 256, 210, 211, 212, 215, + 200, 278, 213, 214, 216, 217, 225, 201, 220, 219, + 202, 220, 226, 227, 207, 218, 221, 220, 220, 220, + 220, 220, 220, 228, 229, 221, 221, 221, 230, 231, + 225, 232, 222, 278, 224, 235, 226, 233, 227, 242, + 234, 278, 243, 234, 278, 241, 278, 228, 223, 229, + + 237, 245, 244, 230, 231, 232, 246, 222, 235, 224, + 235, 233, 220, 220, 242, 220, 220, 243, 236, 241, + 221, 221, 223, 237, 237, 245, 220, 244, 234, 220, + 246, 234, 278, 235, 221, 247, 248, 220, 240, 249, + 220, 253, 236, 220, 238, 221, 220, 237, 254, 255, + 220, 221, 278, 220, 257, 261, 236, 239, 221, 278, + 247, 248, 240, 258, 249, 253, 258, 262, 238, 278, + 250, 221, 254, 255, 259, 278, 251, 259, 257, 261, + 236, 239, 221, 220, 252, 264, 220, 265, 270, 271, + 265, 221, 262, 267, 250, 269, 267, 278, 269, 276, + + 251, 265, 260, 221, 265, 235, 267, 278, 252, 267, + 264, 235, 278, 270, 271, 266, 278, 278, 278, 272, + 237, 268, 272, 278, 276, 274, 237, 260, 274, 266, + 235, 278, 275, 278, 268, 275, 235, 235, 272, 266, + 274, 272, 278, 274, 237, 268, 275, 273, 277, 275, + 237, 277, 237, 266, 277, 278, 278, 277, 268, 278, + 278, 278, 235, 278, 278, 278, 273, 278, 278, 278, + 278, 273, 278, 278, 278, 278, 237, 278, 278, 278, + 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + 273, 43, 43, 278, 43, 43, 43, 45, 45, 53, + + 53, 53, 97, 97, 97, 98, 98, 278, 98, 98, + 98, 148, 278, 148, 148, 148, 182, 278, 278, 182, + 182, 183, 183, 183, 199, 278, 278, 199, 208, 208, + 208, 263, 278, 278, 263, 3, 278, 278, 278, 278, + 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + + 278 } ; -static yyconst flex_int16_t yy_chk[826] = +static yyconst flex_int16_t yy_chk[802] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -629,90 +622,88 @@ static yyconst flex_int16_t yy_chk[826] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 14, 14, 2, 5, - 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, - 7, 8, 8, 8, 8, 15, 15, 18, 19, 20, - 69, 21, 6, 69, 18, 20, 7, 103, 22, 24, - - 22, 45, 24, 51, 27, 32, 36, 36, 46, 27, - 22, 23, 18, 19, 20, 21, 57, 6, 18, 20, - 17, 7, 22, 24, 22, 45, 24, 23, 26, 27, - 32, 13, 5, 27, 22, 26, 23, 29, 30, 28, - 57, 26, 61, 28, 8, 30, 29, 30, 31, 30, - 58, 23, 28, 26, 31, 42, 42, 31, 34, 26, - 12, 34, 29, 30, 28, 26, 61, 34, 28, 30, - 29, 30, 31, 30, 33, 58, 28, 9, 31, 35, - 35, 31, 59, 34, 33, 35, 34, 43, 33, 3, - 43, 34, 37, 37, 37, 37, 52, 52, 0, 33, - - 38, 38, 38, 38, 35, 35, 43, 59, 33, 35, - 60, 64, 33, 39, 39, 39, 39, 41, 41, 41, - 41, 44, 44, 44, 44, 62, 63, 65, 66, 67, - 0, 43, 68, 73, 62, 60, 64, 71, 71, 72, - 44, 152, 74, 75, 152, 76, 78, 79, 82, 62, - 63, 86, 65, 66, 67, 37, 68, 73, 62, 84, - 77, 71, 71, 38, 72, 44, 74, 87, 75, 76, - 78, 79, 85, 82, 88, 86, 39, 77, 89, 90, - 41, 85, 91, 92, 84, 77, 94, 0, 95, 96, - 94, 87, 98, 98, 98, 98, 100, 85, 88, 104, - - 109, 77, 89, 106, 90, 85, 91, 107, 92, 108, - 110, 94, 95, 96, 111, 94, 99, 99, 99, 99, - 100, 113, 114, 115, 104, 109, 112, 106, 116, 112, - 118, 107, 117, 108, 110, 117, 120, 112, 121, 111, - 122, 119, 0, 123, 124, 113, 114, 115, 126, 0, - 119, 127, 129, 116, 118, 98, 130, 131, 132, 134, - 120, 136, 142, 121, 122, 117, 119, 123, 137, 124, - 138, 140, 141, 126, 119, 127, 129, 143, 144, 99, - 130, 131, 132, 145, 134, 139, 136, 142, 139, 117, - 146, 148, 137, 155, 138, 140, 141, 156, 157, 0, - - 158, 159, 143, 144, 160, 165, 166, 145, 167, 170, - 171, 0, 139, 172, 146, 173, 148, 155, 174, 175, - 178, 178, 156, 157, 158, 180, 159, 181, 160, 165, - 166, 185, 186, 167, 170, 171, 139, 189, 172, 191, - 173, 177, 174, 175, 177, 183, 193, 194, 183, 196, - 180, 199, 181, 198, 0, 200, 185, 186, 201, 202, - 0, 189, 203, 191, 204, 210, 177, 204, 208, 208, - 193, 194, 204, 177, 196, 199, 177, 205, 198, 200, - 205, 213, 201, 215, 202, 205, 203, 217, 206, 210, - 177, 206, 205, 0, 218, 207, 206, 177, 207, 211, - - 177, 220, 211, 207, 221, 213, 222, 215, 233, 227, - 207, 226, 217, 228, 226, 232, 228, 205, 206, 218, - 255, 228, 211, 255, 227, 235, 220, 238, 221, 226, - 222, 236, 233, 229, 227, 207, 229, 237, 0, 226, - 232, 229, 206, 239, 226, 228, 241, 211, 227, 230, - 235, 238, 230, 242, 226, 240, 236, 230, 240, 243, - 0, 250, 237, 226, 229, 251, 254, 239, 226, 228, - 256, 241, 244, 245, 230, 244, 245, 262, 242, 246, - 244, 245, 246, 240, 243, 250, 260, 246, 229, 251, - 254, 0, 257, 258, 256, 257, 258, 264, 230, 0, - - 257, 258, 262, 0, 0, 244, 245, 240, 259, 263, - 260, 259, 263, 246, 265, 266, 259, 265, 266, 273, - 267, 270, 264, 267, 270, 275, 280, 259, 267, 244, - 245, 272, 265, 266, 272, 274, 276, 246, 274, 276, - 0, 0, 265, 266, 273, 0, 277, 265, 266, 277, - 275, 280, 259, 278, 276, 0, 278, 265, 266, 272, - 0, 0, 279, 274, 276, 279, 265, 266, 0, 276, - 281, 265, 266, 281, 282, 283, 0, 282, 283, 276, - 0, 284, 0, 272, 284, 0, 0, 274, 276, 0, - 279, 0, 0, 276, 0, 0, 0, 0, 0, 0, - + 5, 5, 5, 8, 8, 8, 8, 15, 15, 18, + 19, 20, 99, 21, 36, 36, 18, 20, 22, 24, + 22, 48, 24, 23, 27, 32, 42, 42, 43, 27, + + 22, 49, 49, 54, 18, 19, 20, 21, 17, 23, + 18, 20, 22, 24, 22, 26, 24, 13, 23, 27, + 32, 12, 26, 27, 22, 28, 29, 54, 26, 28, + 30, 66, 5, 23, 66, 29, 8, 30, 28, 30, + 26, 30, 37, 37, 37, 37, 26, 31, 55, 56, + 28, 29, 26, 31, 28, 30, 31, 34, 33, 29, + 34, 30, 28, 30, 9, 30, 34, 58, 33, 35, + 35, 31, 33, 55, 56, 35, 3, 31, 146, 57, + 31, 146, 34, 33, 0, 34, 38, 38, 38, 38, + 34, 58, 33, 60, 35, 35, 33, 61, 62, 35, + + 39, 39, 39, 39, 57, 37, 41, 41, 41, 41, + 59, 63, 64, 0, 65, 68, 68, 60, 70, 59, + 69, 72, 61, 62, 71, 147, 73, 74, 147, 75, + 76, 79, 81, 87, 59, 83, 63, 64, 65, 68, + 68, 84, 70, 59, 74, 69, 72, 85, 71, 38, + 73, 82, 74, 75, 76, 86, 79, 81, 87, 83, + 82, 88, 89, 39, 92, 84, 91, 100, 74, 41, + 91, 85, 93, 0, 0, 0, 82, 102, 103, 86, + 95, 95, 95, 95, 82, 88, 104, 89, 92, 105, + 107, 91, 100, 106, 109, 91, 93, 96, 96, 96, + + 96, 102, 103, 110, 111, 108, 112, 117, 108, 113, + 104, 114, 113, 115, 105, 107, 108, 106, 109, 0, + 116, 118, 115, 119, 120, 122, 130, 110, 111, 123, + 125, 112, 117, 126, 127, 114, 0, 128, 115, 132, + 0, 133, 113, 95, 116, 118, 115, 119, 134, 120, + 122, 130, 135, 123, 125, 135, 136, 126, 127, 137, + 96, 128, 138, 139, 132, 133, 113, 140, 141, 143, + 0, 150, 134, 151, 152, 248, 153, 154, 248, 135, + 136, 155, 160, 137, 161, 162, 165, 138, 139, 166, + 167, 140, 141, 168, 143, 150, 169, 170, 151, 152, + + 153, 172, 154, 135, 172, 155, 160, 175, 161, 176, + 162, 165, 179, 180, 166, 167, 181, 184, 168, 181, + 169, 170, 186, 188, 189, 194, 172, 191, 193, 0, + 195, 196, 175, 172, 176, 198, 172, 179, 180, 181, + 197, 184, 256, 0, 0, 256, 186, 188, 189, 194, + 172, 0, 191, 193, 195, 196, 204, 172, 199, 198, + 172, 199, 206, 207, 181, 197, 199, 200, 201, 202, + 200, 201, 202, 209, 211, 200, 201, 202, 212, 214, + 204, 215, 200, 0, 202, 221, 206, 216, 207, 229, + 220, 263, 230, 220, 263, 226, 0, 209, 201, 211, + + 221, 232, 231, 212, 214, 215, 233, 200, 220, 202, + 221, 216, 222, 224, 229, 222, 224, 230, 220, 226, + 222, 224, 201, 220, 221, 232, 223, 231, 234, 223, + 233, 234, 0, 220, 223, 235, 236, 238, 224, 237, + 238, 243, 220, 239, 222, 238, 239, 220, 244, 247, + 240, 239, 0, 240, 249, 253, 234, 223, 240, 0, + 235, 236, 224, 250, 237, 243, 250, 255, 222, 0, + 238, 250, 244, 247, 251, 0, 239, 251, 249, 253, + 234, 223, 251, 252, 240, 257, 252, 258, 266, 268, + 258, 252, 255, 259, 238, 260, 259, 0, 260, 273, + + 239, 265, 252, 260, 265, 258, 267, 0, 240, 267, + 257, 259, 0, 266, 268, 258, 0, 0, 0, 269, + 258, 259, 269, 0, 273, 270, 259, 252, 270, 265, + 258, 0, 271, 0, 267, 271, 259, 269, 272, 258, + 274, 272, 0, 274, 258, 259, 275, 269, 276, 275, + 259, 276, 269, 265, 277, 0, 0, 277, 267, 0, + 0, 0, 269, 0, 0, 0, 272, 0, 0, 0, + 0, 269, 0, 0, 0, 0, 269, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 279, 286, 286, 0, 286, 286, - 286, 287, 287, 288, 288, 288, 289, 289, 289, 290, - 290, 0, 290, 290, 290, 291, 0, 291, 291, 291, - 292, 0, 0, 292, 292, 293, 293, 293, 294, 0, - 0, 294, 295, 295, 295, 296, 0, 0, 296, 285, - 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, - 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, - 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, - 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, - - 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, - 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, - 285, 285, 285, 285, 285 + 272, 279, 279, 0, 279, 279, 279, 280, 280, 281, + + 281, 281, 282, 282, 282, 283, 283, 0, 283, 283, + 283, 284, 0, 284, 284, 284, 285, 0, 0, 285, + 285, 286, 286, 286, 287, 0, 0, 287, 288, 288, + 288, 289, 0, 0, 289, 278, 278, 278, 278, 278, + 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + + 278 } ; static yy_state_type yy_last_accepting_state; @@ -799,7 +790,7 @@ static int checkImmediate(int token) { return token; } -#line 803 "engines/director/lingo/lingo-lex.cpp" +#line 794 "engines/director/lingo/lingo-lex.cpp" #define INITIAL 0 @@ -985,7 +976,7 @@ YY_DECL #line 85 "engines/director/lingo/lingo-lex.l" -#line 989 "engines/director/lingo/lingo-lex.cpp" +#line 980 "engines/director/lingo/lingo-lex.cpp" if ( !(yy_init) ) { @@ -1039,13 +1030,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 286 ) + if ( yy_current_state >= 279 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_current_state != 285 ); + while ( yy_current_state != 278 ); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); @@ -1132,25 +1123,18 @@ YY_RULE_SETUP { count(); return tIF; } YY_BREAK case 14: -/* rule 14 can match eol */ YY_RULE_SETUP #line 102 "engines/director/lingo/lingo-lex.l" -{ count(); return tNLELSIF; } +{ count(); return tELSIF; } YY_BREAK case 15: -/* rule 15 can match eol */ YY_RULE_SETUP #line 103 "engines/director/lingo/lingo-lex.l" -{ count(); return tNLELSE; } +{ count(); return tELSE; } YY_BREAK case 16: YY_RULE_SETUP #line 104 "engines/director/lingo/lingo-lex.l" -{ count(); return tELSE; } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 105 "engines/director/lingo/lingo-lex.l" { count(); @@ -1158,169 +1142,176 @@ YY_RULE_SETUP while (*ptr == ' ' || *ptr == '\t') ptr++; + if (!scumm_stricmp(ptr, "if")) + return tENDIF; + else if (!scumm_stricmp(ptr, "repeat")) + return tENDREPEAT; + else if (!scumm_stricmp(ptr, "tell")) + return tENDTELL; + yylval.s = new Common::String(ptr); return ENDCLAUSE; } YY_BREAK -case 18: +case 17: YY_RULE_SETUP -#line 116 "engines/director/lingo/lingo-lex.l" +#line 122 "engines/director/lingo/lingo-lex.l" { count(); return tFACTORY; } YY_BREAK -case 19: +case 18: YY_RULE_SETUP -#line 117 "engines/director/lingo/lingo-lex.l" +#line 123 "engines/director/lingo/lingo-lex.l" { count(); return tEXIT; } YY_BREAK -case 20: +case 19: YY_RULE_SETUP -#line 118 "engines/director/lingo/lingo-lex.l" +#line 124 "engines/director/lingo/lingo-lex.l" { count(); return tFRAME; } YY_BREAK -case 21: +case 20: YY_RULE_SETUP -#line 119 "engines/director/lingo/lingo-lex.l" +#line 125 "engines/director/lingo/lingo-lex.l" { count(); return tGLOBAL; } YY_BREAK -case 22: +case 21: YY_RULE_SETUP -#line 120 "engines/director/lingo/lingo-lex.l" +#line 126 "engines/director/lingo/lingo-lex.l" { count(); return tGO; } YY_BREAK -case 23: +case 22: YY_RULE_SETUP -#line 121 "engines/director/lingo/lingo-lex.l" +#line 127 "engines/director/lingo/lingo-lex.l" { count(); return tGO; } YY_BREAK -case 24: +case 23: YY_RULE_SETUP -#line 122 "engines/director/lingo/lingo-lex.l" +#line 128 "engines/director/lingo/lingo-lex.l" { count(); return tINSTANCE; } YY_BREAK -case 25: +case 24: YY_RULE_SETUP -#line 123 "engines/director/lingo/lingo-lex.l" +#line 129 "engines/director/lingo/lingo-lex.l" { count(); return tINTERSECTS; } YY_BREAK -case 26: +case 25: YY_RULE_SETUP -#line 124 "engines/director/lingo/lingo-lex.l" +#line 130 "engines/director/lingo/lingo-lex.l" { count(); return tINTO; } YY_BREAK -case 27: +case 26: YY_RULE_SETUP -#line 125 "engines/director/lingo/lingo-lex.l" +#line 131 "engines/director/lingo/lingo-lex.l" { count(); return tITEM; } YY_BREAK -case 28: +case 27: YY_RULE_SETUP -#line 126 "engines/director/lingo/lingo-lex.l" +#line 132 "engines/director/lingo/lingo-lex.l" { count(); return tLINE; } YY_BREAK -case 29: +case 28: YY_RULE_SETUP -#line 127 "engines/director/lingo/lingo-lex.l" +#line 133 "engines/director/lingo/lingo-lex.l" { count(); return checkImmediate(tLOOP); } YY_BREAK -case 30: +case 29: YY_RULE_SETUP -#line 128 "engines/director/lingo/lingo-lex.l" +#line 134 "engines/director/lingo/lingo-lex.l" { count(); return tMACRO; } YY_BREAK -case 31: +case 30: YY_RULE_SETUP -#line 129 "engines/director/lingo/lingo-lex.l" +#line 135 "engines/director/lingo/lingo-lex.l" { count(); return tMETHOD; } YY_BREAK -case 32: +case 31: YY_RULE_SETUP -#line 130 "engines/director/lingo/lingo-lex.l" +#line 136 "engines/director/lingo/lingo-lex.l" { count(); return tMOD; } YY_BREAK -case 33: +case 32: YY_RULE_SETUP -#line 131 "engines/director/lingo/lingo-lex.l" +#line 137 "engines/director/lingo/lingo-lex.l" { count(); return tMOVIE; } YY_BREAK -case 34: +case 33: YY_RULE_SETUP -#line 132 "engines/director/lingo/lingo-lex.l" +#line 138 "engines/director/lingo/lingo-lex.l" { count(); return tNEXT; } YY_BREAK -case 35: +case 34: YY_RULE_SETUP -#line 133 "engines/director/lingo/lingo-lex.l" +#line 139 "engines/director/lingo/lingo-lex.l" { count(); return tNOT; } YY_BREAK -case 36: +case 35: YY_RULE_SETUP -#line 134 "engines/director/lingo/lingo-lex.l" +#line 140 "engines/director/lingo/lingo-lex.l" { count(); return tOF; } YY_BREAK -case 37: +case 36: YY_RULE_SETUP -#line 135 "engines/director/lingo/lingo-lex.l" +#line 141 "engines/director/lingo/lingo-lex.l" { count(); return tON; } // D3 YY_BREAK -case 38: +case 37: YY_RULE_SETUP -#line 136 "engines/director/lingo/lingo-lex.l" +#line 142 "engines/director/lingo/lingo-lex.l" { count(); return tOPEN; } YY_BREAK -case 39: +case 38: YY_RULE_SETUP -#line 137 "engines/director/lingo/lingo-lex.l" +#line 143 "engines/director/lingo/lingo-lex.l" { count(); return tOR; } YY_BREAK -case 40: +case 39: YY_RULE_SETUP -#line 138 "engines/director/lingo/lingo-lex.l" +#line 144 "engines/director/lingo/lingo-lex.l" { count(); return tPLAY; } YY_BREAK -case 41: +case 40: YY_RULE_SETUP -#line 139 "engines/director/lingo/lingo-lex.l" +#line 145 "engines/director/lingo/lingo-lex.l" { count(); yylval.s = new Common::String(yytext); return tPLAYACCEL; } YY_BREAK -case 42: +case 41: YY_RULE_SETUP -#line 140 "engines/director/lingo/lingo-lex.l" +#line 146 "engines/director/lingo/lingo-lex.l" { count(); return tPREVIOUS; } YY_BREAK -case 43: +case 42: YY_RULE_SETUP -#line 141 "engines/director/lingo/lingo-lex.l" +#line 147 "engines/director/lingo/lingo-lex.l" { count(); return tPROPERTY; } // D4 YY_BREAK -case 44: +case 43: YY_RULE_SETUP -#line 142 "engines/director/lingo/lingo-lex.l" +#line 148 "engines/director/lingo/lingo-lex.l" { count(); return tPUT; } YY_BREAK -case 45: +case 44: YY_RULE_SETUP -#line 143 "engines/director/lingo/lingo-lex.l" +#line 149 "engines/director/lingo/lingo-lex.l" { count(); return checkImmediate(tREPEAT); } YY_BREAK -case 46: +case 45: YY_RULE_SETUP -#line 144 "engines/director/lingo/lingo-lex.l" +#line 150 "engines/director/lingo/lingo-lex.l" { count(); return tSET; } YY_BREAK -case 47: +case 46: YY_RULE_SETUP -#line 145 "engines/director/lingo/lingo-lex.l" +#line 151 "engines/director/lingo/lingo-lex.l" { count(); return tSTARTS; } YY_BREAK -case 48: +case 47: YY_RULE_SETUP -#line 146 "engines/director/lingo/lingo-lex.l" +#line 152 "engines/director/lingo/lingo-lex.l" { count(); return tTELL; } YY_BREAK -case 49: +case 48: YY_RULE_SETUP -#line 147 "engines/director/lingo/lingo-lex.l" +#line 153 "engines/director/lingo/lingo-lex.l" { count(); @@ -1330,9 +1321,9 @@ YY_RULE_SETUP return THEENTITYWITHID; } YY_BREAK -case 50: +case 49: YY_RULE_SETUP -#line 155 "engines/director/lingo/lingo-lex.l" +#line 161 "engines/director/lingo/lingo-lex.l" { count(); @@ -1342,9 +1333,9 @@ YY_RULE_SETUP return THEENTITYWITHID; } YY_BREAK -case 51: +case 50: YY_RULE_SETUP -#line 163 "engines/director/lingo/lingo-lex.l" +#line 169 "engines/director/lingo/lingo-lex.l" { count(); @@ -1353,9 +1344,9 @@ YY_RULE_SETUP return FBLTINONEARG; } YY_BREAK -case 52: +case 51: YY_RULE_SETUP -#line 170 "engines/director/lingo/lingo-lex.l" +#line 176 "engines/director/lingo/lingo-lex.l" { count(); @@ -1397,9 +1388,9 @@ YY_RULE_SETUP warning("Unhandled the entity %s", ptr); } YY_BREAK -case 53: +case 52: YY_RULE_SETUP -#line 210 "engines/director/lingo/lingo-lex.l" +#line 216 "engines/director/lingo/lingo-lex.l" { count(); @@ -1432,9 +1423,9 @@ YY_RULE_SETUP return THEENTITY; } YY_BREAK -case 54: +case 53: YY_RULE_SETUP -#line 241 "engines/director/lingo/lingo-lex.l" +#line 247 "engines/director/lingo/lingo-lex.l" { count(); @@ -1455,80 +1446,74 @@ YY_RULE_SETUP warning("Unhandled the entity %s", ptr); } YY_BREAK -case 55: +case 54: YY_RULE_SETUP -#line 260 "engines/director/lingo/lingo-lex.l" +#line 266 "engines/director/lingo/lingo-lex.l" { count(); return tTHEN; } YY_BREAK -case 56: -/* rule 56 can match eol */ -YY_RULE_SETUP -#line 261 "engines/director/lingo/lingo-lex.l" -{ count(); return tTHENNL; } - YY_BREAK -case 57: +case 55: YY_RULE_SETUP -#line 262 "engines/director/lingo/lingo-lex.l" +#line 267 "engines/director/lingo/lingo-lex.l" { count(); return tTO; } YY_BREAK -case 58: +case 56: YY_RULE_SETUP -#line 263 "engines/director/lingo/lingo-lex.l" +#line 268 "engines/director/lingo/lingo-lex.l" { count(); return tSPRITE; } YY_BREAK -case 59: +case 57: YY_RULE_SETUP -#line 264 "engines/director/lingo/lingo-lex.l" +#line 269 "engines/director/lingo/lingo-lex.l" { count(); return tWITH; } YY_BREAK -case 60: +case 58: YY_RULE_SETUP -#line 265 "engines/director/lingo/lingo-lex.l" +#line 270 "engines/director/lingo/lingo-lex.l" { count(); return tWITHIN; } YY_BREAK -case 61: +case 59: YY_RULE_SETUP -#line 266 "engines/director/lingo/lingo-lex.l" +#line 271 "engines/director/lingo/lingo-lex.l" { count(); return tWHEN; } YY_BREAK -case 62: +case 60: YY_RULE_SETUP -#line 267 "engines/director/lingo/lingo-lex.l" +#line 272 "engines/director/lingo/lingo-lex.l" { count(); return tWHILE; } YY_BREAK -case 63: +case 61: YY_RULE_SETUP -#line 268 "engines/director/lingo/lingo-lex.l" +#line 273 "engines/director/lingo/lingo-lex.l" { count(); return tWORD; } YY_BREAK -case 64: +case 62: YY_RULE_SETUP -#line 270 "engines/director/lingo/lingo-lex.l" +#line 275 "engines/director/lingo/lingo-lex.l" { count(); return tNEQ; } YY_BREAK -case 65: +case 63: YY_RULE_SETUP -#line 271 "engines/director/lingo/lingo-lex.l" +#line 276 "engines/director/lingo/lingo-lex.l" { count(); return tGE; } YY_BREAK -case 66: +case 64: YY_RULE_SETUP -#line 272 "engines/director/lingo/lingo-lex.l" +#line 277 "engines/director/lingo/lingo-lex.l" { count(); return tLE; } YY_BREAK -case 67: +case 65: YY_RULE_SETUP -#line 273 "engines/director/lingo/lingo-lex.l" +#line 278 "engines/director/lingo/lingo-lex.l" { count(); return tCONCAT; } YY_BREAK -case 68: +case 66: YY_RULE_SETUP -#line 274 "engines/director/lingo/lingo-lex.l" +#line 279 "engines/director/lingo/lingo-lex.l" { count(); return tEQ; } YY_BREAK -case 69: +case 67: YY_RULE_SETUP -#line 276 "engines/director/lingo/lingo-lex.l" +#line 281 "engines/director/lingo/lingo-lex.l" { count(); yylval.s = new Common::String(yytext); @@ -1575,43 +1560,43 @@ YY_RULE_SETUP return ID; } YY_BREAK -case 70: +case 68: YY_RULE_SETUP -#line 321 "engines/director/lingo/lingo-lex.l" +#line 326 "engines/director/lingo/lingo-lex.l" { count(); yylval.f = atof(yytext); return FLOAT; } YY_BREAK -case 71: +case 69: YY_RULE_SETUP -#line 322 "engines/director/lingo/lingo-lex.l" +#line 327 "engines/director/lingo/lingo-lex.l" { count(); yylval.i = strtol(yytext, NULL, 10); return INT; } YY_BREAK -case 72: +case 70: YY_RULE_SETUP -#line 323 "engines/director/lingo/lingo-lex.l" +#line 328 "engines/director/lingo/lingo-lex.l" { count(); return *yytext; } YY_BREAK -case 73: -/* rule 73 can match eol */ +case 71: +/* rule 71 can match eol */ YY_RULE_SETUP -#line 324 "engines/director/lingo/lingo-lex.l" +#line 329 "engines/director/lingo/lingo-lex.l" { count(); return '\n'; } YY_BREAK -case 74: +case 72: YY_RULE_SETUP -#line 325 "engines/director/lingo/lingo-lex.l" +#line 330 "engines/director/lingo/lingo-lex.l" { count(); yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return STRING; } YY_BREAK -case 75: +case 73: YY_RULE_SETUP -#line 326 "engines/director/lingo/lingo-lex.l" +#line 331 "engines/director/lingo/lingo-lex.l" { count(); } YY_BREAK -case 76: +case 74: YY_RULE_SETUP -#line 328 "engines/director/lingo/lingo-lex.l" +#line 333 "engines/director/lingo/lingo-lex.l" ECHO; YY_BREAK -#line 1615 "engines/director/lingo/lingo-lex.cpp" +#line 1600 "engines/director/lingo/lingo-lex.cpp" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1905,7 +1890,7 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 286 ) + if ( yy_current_state >= 279 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1933,11 +1918,11 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 286 ) + if ( yy_current_state >= 279 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 285); + yy_is_jam = (yy_current_state == 278); return yy_is_jam ? 0 : yy_current_state; } @@ -2571,7 +2556,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 328 "engines/director/lingo/lingo-lex.l" +#line 333 "engines/director/lingo/lingo-lex.l" diff --git a/engines/director/lingo/lingo-lex.l b/engines/director/lingo/lingo-lex.l index d5ca6b6383..b1801bda78 100644 --- a/engines/director/lingo/lingo-lex.l +++ b/engines/director/lingo/lingo-lex.l @@ -99,8 +99,7 @@ whitespace [\t ] (?i:done) { count(); return tDONE; } (?i:down) { count(); return tDOWN; } (?i:if) { count(); return tIF; } -(?i:[\n\r]+[\t ]*else[\t ]+if) { count(); return tNLELSIF; } -(?i:[\n\r]+[\t ]*else) { count(); return tNLELSE; } +(?i:else[\t ]+if) { count(); return tELSIF; } (?i:else) { count(); return tELSE; } (?i:end)([\t ]*{identifier})? { count(); @@ -109,6 +108,13 @@ whitespace [\t ] while (*ptr == ' ' || *ptr == '\t') ptr++; + if (!scumm_stricmp(ptr, "if")) + return tENDIF; + else if (!scumm_stricmp(ptr, "repeat")) + return tENDREPEAT; + else if (!scumm_stricmp(ptr, "tell")) + return tENDTELL; + yylval.s = new Common::String(ptr); return ENDCLAUSE; @@ -258,7 +264,6 @@ whitespace [\t ] warning("Unhandled the entity %s", ptr); } (?i:then) { count(); return tTHEN; } -(?i:then[\n\r]+) { count(); return tTHENNL; } (?i:to) { count(); return tTO; } (?i:sprite) { count(); return tSPRITE; } (?i:with) { count(); return tWITH; } diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp index 98988462e8..24cc5fe76b 100644 --- a/engines/director/lingo/lingo.cpp +++ b/engines/director/lingo/lingo.cpp @@ -213,6 +213,40 @@ void Lingo::addCode(const char *code, ScriptType type, uint16 id) { } } +static Common::String nexttok(const char *s, const char **newP = nullptr) { + Common::String res; + + // Scan first non-whitespace + while (*s && (*s == ' ' || *s == '\t')) // If we see a whitespace + s++; + + // Now copy everything till whitespace + while (*s && *s != ' ' && *s != '\t' && *s != '\n') + res += *s++; + + if (newP) + *newP = s; + + return res; +} + +static Common::String prevtok(const char *s, const char *lineStart, const char **newP = nullptr) { + Common::String res; + + // Scan first non-whitespace + while (s >= lineStart && (*s == ' ' || *s == '\t')) // If we see a whitespace + s--; + + // Now copy everything till whitespace + while (s >= lineStart && *s != ' ' && *s != '\t') + res = *s-- + res; + + if (newP) + *newP = s; + + return res; +} + Common::String Lingo::stripComments(const char *s) { Common::String res; @@ -259,64 +293,127 @@ Common::String Lingo::stripComments(const char *s) { s++; } - // Preprocess if statements tmp = res; - int level = 0; - s = tmp.c_str(); - const char *stringStart; + res.clear(); + + // Preprocess if statements + Common::String line, tok; + const char *lineStart, *prevEnd; + int iflevel = 0; while (*s) { - // Scan first non-whitespace - while (*s && (*s == ' ' || *s == '\t' || *s == '\xc2')) { // If we see a whitespace - res += *s++; + line.clear(); - if (*s && *(s - 1) == '\xc2') { // if it is a continuation synbol, eat next one + // Get next line + while (*s && *s != '\n') { // If we see a whitespace + if (*s == '\xc2') { res += *s++; + if (*s == '\n') { + line += ' '; + res += *s++; + } + } else { + res += *s; + line += tolower(*s++); } } - if (!*s) // end of input string - break; - - stringStart = s; + if (line.size() < 4) { // If line is too small, then skip it + if (*s) // copy newline symbol + res += *s++; - if (!scumm_stricmp(s, "if")) { - level++; + continue; } - // copy rest of the line - while (*s && *s != '\n') { - res += *s++; - - if (*s && *(s - 1) == '\xc2') { // if it is a continuation synbol, eat next one - res += *s++; - } - } + tok = nexttok(line.c_str(), &lineStart); + if (tok.equals("if")) { + tok = prevtok(&line.c_str()[line.size() - 1], lineStart, &prevEnd); - // Now look if we have 'end if' at the end - if (s - stringStart >= strlen("end if")) { - if (tolower(*(s - 2)) == 'i' && tolower(*(s - 1)) == 'f') { - const char *tmps = s - strlen("end if"); + if (tok.equals("if")) { + tok = prevtok(prevEnd, lineStart); - while (tmps - stringStart > 0 && (*tmps == ' ' || *tmps == '\t')) // if we ended up with 'end if' - tmps--; + if (tok.equals("end")) { + // do nothing, we open and close same line + } else { + iflevel++; + } + } else if (tok.equals("then")) { + iflevel++; + } else if (tok.equals("else")) { + iflevel++; + } else { // other token + // Now check if we have tNLELSE + if (!*s) { + iflevel++; // end, we have to add 'end if' + break; + } + const char *s1 = s + 1; - if (tmps != s - strlen("end if")) {// if we were backtracking, then we're at end of 'end' now - if (tmps - stringStart > strlen("end")) { - tmps -= strlen("end"); + while (*s1 && *s1 == '\n') + s1++; + tok = nexttok(s1); - if (!scumm_stricmp(s, "end")) - level--; - } + if (tok.equalsIgnoreCase("else")) { // ignore case because it is look-ahead + iflevel++; + } else { + res += " end if"; + iflevel--; } } - } + } else if (tok.equals("else")) { + bool elseif = false; + + tok = nexttok(lineStart); + if (tok.equals("if")) { + elseif = true; + } else if (tok.empty()) { + continue; + } - if (level) { + tok = prevtok(&line.c_str()[line.size() - 1], lineStart, &prevEnd); + if (tok.equals("if")) { + tok = prevtok(prevEnd, lineStart); + + if (tok.equals("end")) { + iflevel--; + } + } else if (tok.equals("then")) { + if (elseif == false) { + warning("Badly nested then"); + } + } else if (tok.equals("else")) { + if (elseif == false) { + warning("Badly nested else"); + } + } else { // check if we have tNLELSE + if (!*s) { + break; + } + const char *s1 = s + 1; + + while (*s1 && *s1 == '\n') + s1++; + tok = nexttok(s1); + + if (tok.equalsIgnoreCase("else")) { + // Nothing to do here, same level + } else { + res += " end if"; + iflevel--; + } + } + } else if (tok.equals("end")) { + tok = nexttok(lineStart); + if (tok.equals("if")) { + iflevel--; + } } + } + for (int i = 0; i < iflevel; i++) { + res += "\nend if"; } return res; diff --git a/engines/director/lingo/tests/if.lingo b/engines/director/lingo/tests/if.lingo index 6a5b500dec..bcf1a09120 100644 --- a/engines/director/lingo/tests/if.lingo +++ b/engines/director/lingo/tests/if.lingo @@ -3,6 +3,8 @@ set x = 1 if x = 5 then exit else put 10.0 +if x = 6 then put 2 + set y = 4 repeat with x = 1 to 6 @@ -100,7 +102,7 @@ else end if if the selection = the text of cast A31 then - if whichTry = 3 then go to frame "sDo" + if whichTry = 3 then go to frame "sDo" end if else if whichTry = 1 then if whichTry = 3 then go to frame "sDo" else put 5 @@ -108,15 +110,16 @@ else if whichTry = 1 then else if whichTry = 2 then if whichTry = 3 then go to frame "sDo" else if the selection = the text of cast A21 then - if whichTry = 3 then go to frame "Foo" + if whichTry = 3 then go to frame "Foo" end if else if abra = 5 then put 6 else put 7 - if abra = 7 thhen put 5 + if abra = 7 then put 5 end if end if else if whichTry = 3 then go to frame "sDo" else put 6 +if the selection = the text of cast A31 then go to frame "sEnd" else put 7 end if macro WindowHorzP X set X1 = constrainH( 14, X ) |