From 29b6f3edbb9e87bb39ac0635678f1c5a9897c62c Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 16 Jul 2016 13:32:37 +0300 Subject: [PATCH] DIRECTOR: Lingo: Stub for when/then statement --- engines/director/lingo/lingo-codegen.cpp | 4 +- engines/director/lingo/lingo-gr.cpp | 1045 ++++++++++---------- engines/director/lingo/lingo-gr.h | 72 +- engines/director/lingo/lingo-gr.y | 5 +- engines/director/lingo/lingo-lex.cpp | 292 +++--- engines/director/lingo/lingo-lex.l | 1 + engines/director/lingo/tests/factory.lingo | 2 +- 7 files changed, 727 insertions(+), 694 deletions(-) diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp index 553213cc33f1..b54953e9f32d 100644 --- a/engines/director/lingo/lingo-codegen.cpp +++ b/engines/director/lingo/lingo-codegen.cpp @@ -124,13 +124,13 @@ void Lingo::cleanLocalVars() { } void Lingo::define(Common::String &name, int start, int nargs, Common::String *prefix) { - debug(3, "define(\"%s\", %d, %d, %d)", name.c_str(), start, _currentScript->size() - 1, nargs); - Symbol *sym; if (prefix) name = *prefix + "-" + name; + debug(3, "define(\"%s\", %d, %d, %d)", name.c_str(), start, _currentScript->size() - 1, nargs); + if (!_handlers.contains(name)) { // Create variable if it was not defined sym = new Symbol; diff --git a/engines/director/lingo/lingo-gr.cpp b/engines/director/lingo/lingo-gr.cpp index dbbc100263e5..1a4ac2d32964 100644 --- a/engines/director/lingo/lingo-gr.cpp +++ b/engines/director/lingo/lingo-gr.cpp @@ -102,23 +102,24 @@ tSET = 291, tTHEN = 292, tTO = 293, - tWITH = 294, - tWHILE = 295, - tNLELSE = 296, - tFACTORY = 297, - tMETHOD = 298, - tGE = 299, - tLE = 300, - tGT = 301, - tLT = 302, - tEQ = 303, - tNEQ = 304, - tAND = 305, - tOR = 306, - tNOT = 307, - tCONCAT = 308, - tCONTAINS = 309, - tSTARTS = 310 + tWHEN = 294, + tWITH = 295, + tWHILE = 296, + tNLELSE = 297, + tFACTORY = 298, + tMETHOD = 299, + tGE = 300, + tLE = 301, + tGT = 302, + tLT = 303, + tEQ = 304, + tNEQ = 305, + tAND = 306, + tOR = 307, + tNOT = 308, + tCONCAT = 309, + tCONTAINS = 310, + tSTARTS = 311 }; #endif /* Tokens. */ @@ -158,23 +159,24 @@ #define tSET 291 #define tTHEN 292 #define tTO 293 -#define tWITH 294 -#define tWHILE 295 -#define tNLELSE 296 -#define tFACTORY 297 -#define tMETHOD 298 -#define tGE 299 -#define tLE 300 -#define tGT 301 -#define tLT 302 -#define tEQ 303 -#define tNEQ 304 -#define tAND 305 -#define tOR 306 -#define tNOT 307 -#define tCONCAT 308 -#define tCONTAINS 309 -#define tSTARTS 310 +#define tWHEN 294 +#define tWITH 295 +#define tWHILE 296 +#define tNLELSE 297 +#define tFACTORY 298 +#define tMETHOD 299 +#define tGE 300 +#define tLE 301 +#define tGT 302 +#define tLT 303 +#define tEQ 304 +#define tNEQ 305 +#define tAND 306 +#define tOR 307 +#define tNOT 308 +#define tCONCAT 309 +#define tCONTAINS 310 +#define tSTARTS 311 @@ -231,7 +233,7 @@ typedef union YYSTYPE int narg; /* number of arguments */ } /* Line 193 of yacc.c. */ -#line 235 "engines/director/lingo/lingo-gr.cpp" +#line 237 "engines/director/lingo/lingo-gr.cpp" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -244,7 +246,7 @@ typedef union YYSTYPE /* Line 216 of yacc.c. */ -#line 248 "engines/director/lingo/lingo-gr.cpp" +#line 250 "engines/director/lingo/lingo-gr.cpp" #ifdef short # undef short @@ -457,22 +459,22 @@ union yyalloc #endif /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 75 +#define YYFINAL 77 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 641 +#define YYLAST 682 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 69 +#define YYNTOKENS 70 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 34 /* YYNRULES -- Number of rules. */ -#define YYNRULES 116 +#define YYNRULES 117 /* YYNRULES -- Number of states. */ -#define YYNSTATES 248 +#define YYNSTATES 252 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 310 +#define YYMAXUTOK 311 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -481,12 +483,12 @@ union yyalloc static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 62, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 63, 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, 61, 67, 2, - 63, 64, 59, 57, 68, 58, 2, 60, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 62, 68, 2, + 64, 65, 60, 58, 69, 59, 2, 61, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 66, 56, 65, 2, 2, 2, 2, 2, 2, 2, + 67, 57, 66, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -511,7 +513,7 @@ static const yytype_uint8 yytranslate[] = 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55 + 55, 56 }; #if YYDEBUG @@ -521,65 +523,66 @@ static const yytype_uint16 yyprhs[] = { 0, 0, 3, 7, 9, 12, 14, 15, 17, 19, 21, 23, 25, 30, 35, 40, 46, 51, 56, 62, - 64, 66, 68, 70, 79, 91, 104, 113, 125, 137, - 144, 155, 166, 167, 171, 174, 176, 179, 181, 188, - 190, 196, 198, 202, 206, 209, 213, 215, 217, 218, - 219, 220, 223, 226, 228, 230, 232, 237, 239, 244, - 246, 248, 251, 253, 257, 261, 265, 269, 273, 277, - 281, 285, 289, 293, 297, 300, 304, 308, 312, 316, - 319, 322, 326, 329, 332, 335, 337, 339, 342, 344, - 348, 351, 354, 357, 360, 364, 367, 371, 374, 377, - 379, 383, 386, 390, 391, 400, 403, 404, 413, 414, - 416, 420, 425, 426, 430, 431, 433 + 64, 66, 68, 70, 79, 91, 104, 109, 118, 130, + 142, 149, 160, 171, 172, 176, 179, 181, 184, 186, + 193, 195, 201, 203, 207, 211, 214, 218, 220, 222, + 223, 224, 225, 228, 231, 233, 235, 237, 242, 244, + 249, 251, 253, 256, 258, 262, 266, 270, 274, 278, + 282, 286, 290, 294, 298, 302, 305, 309, 313, 317, + 321, 324, 327, 331, 334, 337, 340, 342, 344, 347, + 349, 353, 356, 359, 362, 365, 369, 372, 376, 379, + 382, 384, 388, 391, 395, 396, 405, 408, 409, 418, + 419, 421, 425, 430, 431, 435, 436, 438 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { - 70, 0, -1, 70, 71, 72, -1, 72, -1, 1, - 62, -1, 62, -1, -1, 96, -1, 91, -1, 101, - -1, 73, -1, 75, -1, 34, 90, 25, 13, -1, - 36, 13, 56, 90, -1, 36, 8, 56, 90, -1, - 36, 9, 90, 56, 90, -1, 36, 13, 38, 90, - -1, 36, 8, 38, 90, -1, 36, 9, 90, 38, - 90, -1, 90, -1, 91, -1, 74, -1, 76, -1, - 83, 63, 82, 64, 89, 88, 19, 35, -1, 84, - 56, 90, 88, 38, 90, 88, 89, 88, 19, 35, - -1, 84, 56, 90, 88, 16, 38, 90, 88, 89, - 88, 19, 35, -1, 85, 82, 37, 71, 89, 88, - 19, 24, -1, 85, 82, 37, 71, 89, 88, 41, - 89, 88, 19, 24, -1, 85, 82, 37, 71, 89, - 88, 87, 78, 88, 19, 24, -1, 85, 82, 37, - 87, 74, 88, -1, 85, 82, 37, 87, 74, 88, - 41, 87, 74, 88, -1, 85, 82, 37, 87, 74, - 88, 79, 88, 77, 88, -1, -1, 41, 87, 74, - -1, 78, 81, -1, 81, -1, 79, 80, -1, 80, - -1, 86, 82, 37, 87, 75, 88, -1, 79, -1, - 86, 82, 37, 89, 88, -1, 90, -1, 90, 56, - 90, -1, 63, 82, 64, -1, 35, 40, -1, 35, - 39, 13, -1, 24, -1, 18, -1, -1, -1, -1, - 89, 71, -1, 89, 75, -1, 7, -1, 10, -1, - 14, -1, 11, 63, 102, 64, -1, 12, -1, 13, - 63, 102, 64, -1, 13, -1, 8, -1, 9, 90, - -1, 73, -1, 90, 57, 90, -1, 90, 58, 90, - -1, 90, 59, 90, -1, 90, 60, 90, -1, 90, - 65, 90, -1, 90, 66, 90, -1, 90, 49, 90, - -1, 90, 44, 90, -1, 90, 45, 90, -1, 90, - 50, 90, -1, 90, 51, 90, -1, 52, 90, -1, - 90, 67, 90, -1, 90, 53, 90, -1, 90, 54, - 90, -1, 90, 55, 90, -1, 57, 90, -1, 58, - 90, -1, 63, 90, 64, -1, 28, 14, -1, 29, - 13, -1, 34, 90, -1, 93, -1, 20, -1, 22, - 92, -1, 13, -1, 92, 68, 13, -1, 23, 26, - -1, 23, 31, -1, 23, 33, -1, 23, 94, -1, - 23, 94, 95, -1, 23, 95, -1, 38, 21, 14, - -1, 21, 14, -1, 38, 14, -1, 14, -1, 32, - 30, 14, -1, 30, 14, -1, 38, 30, 14, -1, - -1, 27, 13, 97, 87, 99, 71, 100, 89, -1, - 42, 13, -1, -1, 43, 13, 98, 87, 99, 71, - 100, 89, -1, -1, 13, -1, 99, 68, 13, -1, - 99, 71, 68, 13, -1, -1, 13, 87, 102, -1, - -1, 90, -1, 102, 68, 90, -1 + 71, 0, -1, 71, 72, 73, -1, 73, -1, 1, + 63, -1, 63, -1, -1, 97, -1, 92, -1, 102, + -1, 74, -1, 76, -1, 34, 91, 25, 13, -1, + 36, 13, 57, 91, -1, 36, 8, 57, 91, -1, + 36, 9, 91, 57, 91, -1, 36, 13, 38, 91, + -1, 36, 8, 38, 91, -1, 36, 9, 91, 38, + 91, -1, 91, -1, 92, -1, 75, -1, 77, -1, + 84, 64, 83, 65, 90, 89, 19, 35, -1, 85, + 57, 91, 89, 38, 91, 89, 90, 89, 19, 35, + -1, 85, 57, 91, 89, 16, 38, 91, 89, 90, + 89, 19, 35, -1, 39, 13, 37, 91, -1, 86, + 83, 37, 72, 90, 89, 19, 24, -1, 86, 83, + 37, 72, 90, 89, 42, 90, 89, 19, 24, -1, + 86, 83, 37, 72, 90, 89, 88, 79, 89, 19, + 24, -1, 86, 83, 37, 88, 75, 89, -1, 86, + 83, 37, 88, 75, 89, 42, 88, 75, 89, -1, + 86, 83, 37, 88, 75, 89, 80, 89, 78, 89, + -1, -1, 42, 88, 75, -1, 79, 82, -1, 82, + -1, 80, 81, -1, 81, -1, 87, 83, 37, 88, + 76, 89, -1, 80, -1, 87, 83, 37, 90, 89, + -1, 91, -1, 91, 57, 91, -1, 64, 83, 65, + -1, 35, 41, -1, 35, 40, 13, -1, 24, -1, + 18, -1, -1, -1, -1, 90, 72, -1, 90, 76, + -1, 7, -1, 10, -1, 14, -1, 11, 64, 103, + 65, -1, 12, -1, 13, 64, 103, 65, -1, 13, + -1, 8, -1, 9, 91, -1, 74, -1, 91, 58, + 91, -1, 91, 59, 91, -1, 91, 60, 91, -1, + 91, 61, 91, -1, 91, 66, 91, -1, 91, 67, + 91, -1, 91, 50, 91, -1, 91, 45, 91, -1, + 91, 46, 91, -1, 91, 51, 91, -1, 91, 52, + 91, -1, 53, 91, -1, 91, 68, 91, -1, 91, + 54, 91, -1, 91, 55, 91, -1, 91, 56, 91, + -1, 58, 91, -1, 59, 91, -1, 64, 91, 65, + -1, 28, 14, -1, 29, 13, -1, 34, 91, -1, + 94, -1, 20, -1, 22, 93, -1, 13, -1, 93, + 69, 13, -1, 23, 26, -1, 23, 31, -1, 23, + 33, -1, 23, 95, -1, 23, 95, 96, -1, 23, + 96, -1, 38, 21, 14, -1, 21, 14, -1, 38, + 14, -1, 14, -1, 32, 30, 14, -1, 30, 14, + -1, 38, 30, 14, -1, -1, 27, 13, 98, 88, + 100, 72, 101, 90, -1, 43, 13, -1, -1, 44, + 13, 99, 88, 100, 72, 101, 90, -1, -1, 13, + -1, 100, 69, 13, -1, 100, 72, 69, 13, -1, + -1, 13, 88, 103, -1, -1, 91, -1, 103, 69, + 91, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -587,16 +590,16 @@ static const yytype_uint16 yyrline[] = { 0, 100, 100, 101, 102, 105, 110, 111, 112, 113, 114, 115, 118, 124, 130, 138, 146, 152, 160, 169, - 170, 172, 173, 178, 189, 205, 219, 226, 235, 244, - 254, 264, 275, 276, 279, 280, 283, 284, 287, 295, - 296, 304, 305, 306, 308, 310, 316, 322, 329, 331, - 333, 334, 335, 338, 343, 346, 349, 355, 358, 366, - 369, 376, 382, 383, 384, 385, 386, 387, 388, 389, - 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, - 400, 401, 404, 405, 406, 407, 408, 410, 413, 414, - 425, 426, 427, 428, 433, 439, 446, 447, 448, 449, - 452, 453, 454, 482, 482, 488, 491, 491, 497, 498, - 499, 500, 502, 506, 514, 515, 516 + 170, 172, 173, 178, 189, 205, 217, 222, 229, 238, + 247, 257, 267, 278, 279, 282, 283, 286, 287, 290, + 298, 299, 307, 308, 309, 311, 313, 319, 325, 332, + 334, 336, 337, 338, 341, 346, 349, 352, 358, 361, + 369, 372, 379, 385, 386, 387, 388, 389, 390, 391, + 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 407, 408, 409, 410, 411, 413, 416, + 417, 428, 429, 430, 431, 436, 442, 449, 450, 451, + 452, 455, 456, 457, 485, 485, 491, 494, 494, 500, + 501, 502, 503, 505, 509, 517, 518, 519 }; #endif @@ -610,10 +613,10 @@ static const char *const yytname[] = "STRING", "HANDLER", "tDOWN", "tELSE", "tNLELSIF", "tEND", "tEXIT", "tFRAME", "tGLOBAL", "tGO", "tIF", "tINTO", "tLOOP", "tMACRO", "tMCI", "tMCIWAIT", "tMOVIE", "tNEXT", "tOF", "tPREVIOUS", "tPUT", "tREPEAT", - "tSET", "tTHEN", "tTO", "tWITH", "tWHILE", "tNLELSE", "tFACTORY", - "tMETHOD", "tGE", "tLE", "tGT", "tLT", "tEQ", "tNEQ", "tAND", "tOR", - "tNOT", "tCONCAT", "tCONTAINS", "tSTARTS", "'='", "'+'", "'-'", "'*'", - "'/'", "'%'", "'\\n'", "'('", "')'", "'>'", "'<'", "'&'", "','", + "tSET", "tTHEN", "tTO", "tWHEN", "tWITH", "tWHILE", "tNLELSE", + "tFACTORY", "tMETHOD", "tGE", "tLE", "tGT", "tLT", "tEQ", "tNEQ", "tAND", + "tOR", "tNOT", "tCONCAT", "tCONTAINS", "tSTARTS", "'='", "'+'", "'-'", + "'*'", "'/'", "'%'", "'\\n'", "'('", "')'", "'>'", "'<'", "'&'", "','", "$accept", "program", "nl", "programline", "asgn", "stmtoneliner", "stmt", "ifstmt", "elsestmtoneliner", "elseifstmt", "elseifstmtoneliner", "elseifstmtoneliner1", "elseifstmt1", "cond", "repeatwhile", @@ -633,26 +636,26 @@ static const yytype_uint16 yytoknum[] = 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 61, 43, 45, 42, - 47, 37, 10, 40, 41, 62, 60, 38, 44 + 305, 306, 307, 308, 309, 310, 311, 61, 43, 45, + 42, 47, 37, 10, 40, 41, 62, 60, 38, 44 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 69, 70, 70, 70, 71, 72, 72, 72, 72, - 72, 72, 73, 73, 73, 73, 73, 73, 73, 74, - 74, 75, 75, 75, 75, 75, 76, 76, 76, 76, - 76, 76, 77, 77, 78, 78, 79, 79, 80, 81, - 81, 82, 82, 82, 83, 84, 85, 86, 87, 88, - 89, 89, 89, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 91, 91, 91, 91, 91, 91, 92, 92, - 93, 93, 93, 93, 93, 93, 94, 94, 94, 94, - 95, 95, 95, 97, 96, 96, 98, 96, 99, 99, - 99, 99, 100, 101, 102, 102, 102 + 0, 70, 71, 71, 71, 72, 73, 73, 73, 73, + 73, 73, 74, 74, 74, 74, 74, 74, 74, 75, + 75, 76, 76, 76, 76, 76, 76, 77, 77, 77, + 77, 77, 77, 78, 78, 79, 79, 80, 80, 81, + 82, 82, 83, 83, 83, 84, 85, 86, 87, 88, + 89, 90, 90, 90, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 92, 92, 92, 92, 92, 92, 93, + 93, 94, 94, 94, 94, 94, 94, 95, 95, 95, + 95, 96, 96, 96, 98, 97, 97, 99, 97, 100, + 100, 100, 100, 101, 102, 103, 103, 103 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -660,16 +663,16 @@ static const yytype_uint8 yyr2[] = { 0, 2, 3, 1, 2, 1, 0, 1, 1, 1, 1, 1, 4, 4, 4, 5, 4, 4, 5, 1, - 1, 1, 1, 8, 11, 12, 8, 11, 11, 6, - 10, 10, 0, 3, 2, 1, 2, 1, 6, 1, - 5, 1, 3, 3, 2, 3, 1, 1, 0, 0, - 0, 2, 2, 1, 1, 1, 4, 1, 4, 1, - 1, 2, 1, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, - 2, 3, 2, 2, 2, 1, 1, 2, 1, 3, - 2, 2, 2, 2, 3, 2, 3, 2, 2, 1, - 3, 2, 3, 0, 8, 2, 0, 8, 0, 1, - 3, 4, 0, 3, 0, 1, 3 + 1, 1, 1, 8, 11, 12, 4, 8, 11, 11, + 6, 10, 10, 0, 3, 2, 1, 2, 1, 6, + 1, 5, 1, 3, 3, 2, 3, 1, 1, 0, + 0, 0, 2, 2, 1, 1, 1, 4, 1, 4, + 1, 1, 2, 1, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, + 2, 2, 3, 2, 2, 2, 1, 1, 2, 1, + 3, 2, 2, 2, 2, 3, 2, 3, 2, 2, + 1, 3, 2, 3, 0, 8, 2, 0, 8, 0, + 1, 3, 4, 0, 3, 0, 1, 3 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -677,224 +680,234 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 0, 0, 53, 60, 0, 54, 0, 57, 48, 55, - 86, 0, 0, 46, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 62, 21, - 11, 22, 0, 0, 0, 19, 8, 85, 7, 9, - 4, 59, 0, 62, 61, 114, 114, 114, 88, 87, - 99, 0, 90, 0, 91, 0, 92, 0, 93, 95, - 103, 82, 83, 84, 0, 44, 0, 0, 0, 105, - 106, 74, 79, 80, 0, 1, 5, 6, 0, 0, - 0, 0, 41, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 115, - 0, 0, 113, 0, 97, 101, 0, 98, 0, 0, - 0, 94, 48, 0, 45, 0, 0, 0, 0, 0, - 48, 81, 2, 0, 49, 0, 0, 48, 0, 70, - 71, 69, 72, 73, 76, 77, 78, 63, 64, 65, - 66, 67, 68, 75, 56, 0, 58, 89, 100, 96, - 102, 108, 12, 17, 14, 0, 0, 16, 13, 108, - 50, 0, 43, 50, 0, 42, 116, 109, 0, 18, - 15, 0, 49, 0, 0, 49, 49, 20, 0, 112, - 112, 51, 52, 0, 0, 49, 48, 29, 110, 0, - 50, 50, 0, 49, 50, 0, 50, 0, 47, 48, - 49, 37, 0, 111, 104, 107, 23, 50, 49, 26, - 49, 49, 39, 35, 0, 0, 36, 32, 0, 49, - 0, 0, 34, 0, 0, 49, 48, 49, 48, 0, - 0, 0, 0, 48, 30, 0, 31, 0, 0, 24, - 27, 28, 49, 33, 49, 25, 40, 38 + 0, 0, 54, 61, 0, 55, 0, 58, 49, 56, + 87, 0, 0, 47, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 3, 63, + 21, 11, 22, 0, 0, 0, 19, 8, 86, 7, + 9, 4, 60, 0, 63, 62, 115, 115, 115, 89, + 88, 100, 0, 91, 0, 92, 0, 93, 0, 94, + 96, 104, 83, 84, 85, 0, 45, 0, 0, 0, + 0, 106, 107, 75, 80, 81, 0, 1, 5, 6, + 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 116, 0, 0, 114, 0, 98, 102, 0, 99, + 0, 0, 0, 95, 49, 0, 46, 0, 0, 0, + 0, 0, 0, 49, 82, 2, 0, 50, 0, 0, + 49, 0, 71, 72, 70, 73, 74, 77, 78, 79, + 64, 65, 66, 67, 68, 69, 76, 57, 0, 59, + 90, 101, 97, 103, 109, 12, 17, 14, 0, 0, + 16, 13, 26, 109, 51, 0, 44, 51, 0, 43, + 117, 110, 0, 18, 15, 0, 50, 0, 0, 50, + 50, 20, 0, 113, 113, 52, 53, 0, 0, 50, + 49, 30, 111, 0, 51, 51, 0, 50, 51, 0, + 51, 0, 48, 49, 50, 38, 0, 112, 105, 108, + 23, 51, 50, 27, 50, 50, 40, 36, 0, 0, + 37, 33, 0, 50, 0, 0, 35, 0, 0, 50, + 49, 50, 49, 0, 0, 0, 0, 49, 31, 0, + 32, 0, 0, 24, 28, 29, 50, 34, 50, 25, + 41, 39 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 26, 181, 27, 43, 29, 182, 31, 227, 211, - 212, 201, 213, 81, 32, 33, 34, 202, 237, 161, - 172, 35, 177, 49, 37, 58, 59, 38, 112, 120, - 168, 190, 39, 100 + -1, 27, 185, 28, 44, 30, 186, 32, 231, 215, + 216, 205, 217, 83, 33, 34, 35, 206, 241, 165, + 176, 36, 181, 50, 38, 59, 60, 39, 114, 123, + 172, 194, 40, 102 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -176 +#define YYPACT_NINF -185 static const yytype_int16 yypact[] = { - 200, -43, -176, -176, 4, -176, -19, -176, 550, -176, - -176, 26, 119, -176, 41, 43, 56, 4, 76, 98, - 61, 96, 4, 4, 4, 4, 6, -176, 9, -176, - -176, -176, -16, 67, 406, 531, -176, -176, -176, -176, - -176, 49, 4, -176, 531, 4, 4, 4, -176, 58, - -176, 103, -176, 110, -176, 100, -176, 21, 34, -176, - -176, -176, -176, 421, 121, -176, -15, 4, -4, -176, - -176, 574, 574, 574, 488, -176, -176, 257, 406, 4, - 406, 95, 512, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 421, 531, - 40, 46, 68, 122, -176, -176, 123, -176, 127, 128, - 113, -176, -176, 141, -176, 4, 4, 445, 4, 4, - -176, -176, -176, 91, 531, 92, 464, 104, 4, 531, - 531, 531, 531, 531, 531, 531, 531, 252, 252, 574, - 574, 531, 531, 531, -176, 4, -176, -176, -176, -176, - -176, 147, -176, 531, 531, 4, 4, 531, 531, 147, - -176, 5, -176, -176, 376, 531, 531, -176, 16, 531, - 531, 16, 314, 124, 4, 314, -176, -176, 152, 99, - 99, -176, -176, 149, 4, 531, 12, -8, -176, 156, - -176, -176, 135, 531, -176, 150, -176, 153, -176, -176, - 153, -176, 406, -176, 314, 314, -176, -176, 314, -176, - 314, 153, 153, -176, 406, 376, -176, 132, 138, 314, - 157, 162, -176, 163, 146, -176, -176, -176, -176, 165, - 151, 161, 164, 11, -176, 376, -176, 345, 154, -176, - -176, -176, 314, -176, -176, -176, -176, -176 + 204, -39, -185, -185, 443, -185, -29, -185, 590, -185, + -185, 29, 128, -185, 32, 52, 68, 443, 19, 101, + 70, 93, 98, 443, 443, 443, 443, 6, -185, 15, + -185, -185, -185, 51, 60, 474, 571, -185, -185, -185, + -185, -185, 54, 443, -185, 571, 443, 443, 443, -185, + 50, -185, 106, -185, 113, -185, 100, -185, 23, 24, + -185, -185, -185, -185, 119, 115, -185, -31, 443, -16, + 94, -185, -185, 614, 614, 614, 528, -185, -185, 262, + 474, 443, 474, 95, 552, 443, 443, 443, 443, 443, + 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, + 119, 571, 8, 43, 64, 121, -185, -185, 122, -185, + 123, 124, 109, -185, -185, 127, -185, 443, 443, 485, + 443, 443, 443, -185, -185, -185, 78, 571, 80, 504, + 83, 443, 571, 571, 571, 571, 571, 571, 571, 571, + 257, 257, 614, 614, 571, 571, 571, -185, 443, -185, + -185, -185, -185, -185, 135, -185, 571, 571, 443, 443, + 571, 571, 571, 135, -185, 2, -185, -185, 412, 571, + 571, -185, -5, 571, 571, -5, 320, 117, 443, 320, + -185, -185, 138, 84, 84, -185, -185, 137, 443, 571, + -8, -6, -185, 144, -185, -185, 132, 571, -185, 148, + -185, 150, -185, -185, 150, -185, 474, -185, 320, 320, + -185, -185, 320, -185, 320, 150, 150, -185, 474, 412, + -185, 134, 147, 320, 162, 169, -185, 170, 153, -185, + -185, -185, -185, 172, 158, 171, 173, -2, -185, 412, + -185, 378, 159, -185, -185, -185, 320, -185, -185, -185, + -185, -185 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -176, -176, -24, 114, 8, -160, 0, -176, -176, -176, - 7, -154, -21, -75, -176, -176, -176, -175, -7, -47, - -131, 3, 24, -176, -176, -176, 140, -176, -176, -176, - 37, 13, -176, 33 + -185, -185, -25, 120, 9, -164, 0, -185, -185, -185, + 7, -184, -15, -77, -185, -185, -185, -182, -7, -166, + -124, 4, 25, -185, -185, -185, 142, -185, -185, -185, + 39, 22, -185, 20 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -60 +#define YYTABLE_NINF -61 static const yytype_int16 yytable[] = { - 30, 47, 77, 123, 176, 125, 75, 44, 28, -10, - 198, 2, 3, 4, 5, 6, 7, 41, 9, 40, - 63, 173, 214, 115, 36, 71, 72, 73, 74, -50, - -50, 195, 175, 199, 118, 107, 214, 82, 42, 48, - 19, 116, 108, 174, 45, 98, 216, 78, 99, 99, - 99, 109, 119, 196, 60, 225, 22, 61, 216, 204, - 205, 23, 24, 208, 53, 210, 55, 25, 76, 62, - 117, -10, 110, -50, 69, 243, 219, 30, 76, 101, - 102, 82, 124, 126, 178, 28, 129, 130, 131, 132, + 31, 48, 79, 126, 180, 128, 77, 117, 45, 29, + 187, 199, 202, 190, 191, -10, -51, -51, 177, 218, + 220, 64, 120, 198, 41, 37, 118, 73, 74, 75, + 76, 211, 220, 218, 200, 46, 203, 109, 221, 84, + 178, 121, 49, 179, 110, 61, 224, 100, 225, 227, + 101, 101, 101, 111, 54, 229, 56, 233, 78, 65, + 66, -51, 112, 238, 182, 240, 62, 103, 104, 78, + 208, 209, 119, 147, 212, 247, 214, 148, -10, 31, + 250, 63, 251, 70, 84, 127, 129, 223, 29, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 36, 242, 163, 144, 151, 66, 67, 145, 70, - 146, 68, 46, 159, 145, 64, 65, 104, 153, 154, - 164, 157, 158, 79, 105, 183, 103, 218, 186, 187, - 106, 165, 127, 50, 114, 147, 145, 148, 194, 224, - 51, 149, 150, 109, 179, 52, 207, 180, 166, 53, - 54, 55, 56, 217, 152, 160, 162, 57, 169, 170, - 167, 220, 184, 221, 223, 188, 76, 189, 192, 203, - 206, 198, 229, 226, 209, 228, 230, 185, 234, 197, - 236, 231, 232, 233, 238, 240, 239, 193, 241, 245, - 222, 122, 215, 191, 200, 246, 171, 247, 111, 0, - -6, 1, 0, 0, 0, 82, 0, 2, 3, 4, - 5, 6, 7, 8, 9, 0, 0, 82, 0, 235, - 10, 0, 11, 12, 13, 0, 0, 14, 15, 16, - 0, 0, 0, 0, 17, 18, 19, 244, 0, 0, - 0, 0, 20, 21, 0, 0, 0, 0, 0, 0, - 0, 0, 22, 0, 0, 0, 0, 23, 24, 0, - 0, 0, -6, 25, 2, 3, 4, 5, 6, 7, - 8, 9, 0, 0, 0, 0, 0, 10, 0, 11, - 12, 13, 0, 0, 14, 15, 16, 0, 0, 0, - 0, 17, 18, 19, 0, 0, 83, 84, 0, 20, - 21, 85, 86, 87, 0, 88, 89, 90, 0, 22, - 0, 93, 94, 0, 23, 24, 0, 95, 96, 97, - 25, 2, 3, 4, 5, 6, 7, 41, 9, 0, - 0, 0, 0, 0, 10, 0, 11, 12, 13, 0, - 0, 0, 15, 16, 0, 0, 0, 0, 17, 18, - 19, 0, 2, 3, 4, 5, 6, 7, 41, 9, - 0, 0, 0, 0, 0, 10, 22, 11, 12, 13, - 0, 23, 24, 15, 16, 0, 76, 25, 0, 17, - 18, 19, 0, 2, 3, 4, 5, 6, 7, 41, - 9, 0, 0, 0, 0, 0, 10, 22, 11, 12, - 0, 0, 23, 24, 15, 16, 0, 0, 25, 0, - 17, 0, 19, 2, 3, 4, 5, 6, 7, 41, - 9, 0, 0, 0, 0, 0, 0, 0, 22, 0, - 0, 0, 0, 23, 24, 0, 0, 0, 0, 25, - 42, 0, 19, 0, 0, 0, 113, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, - 0, 0, 0, 23, 24, 83, 84, 0, 0, 80, - 85, 86, 87, 0, 88, 89, 90, 0, 91, 92, - 93, 94, 0, 155, 0, 0, 95, 96, 97, 83, - 84, 0, 0, 0, 85, 86, 87, 0, 88, 89, - 90, 156, 91, 92, 93, 94, 0, 0, 83, 84, - 95, 96, 97, 85, 86, 87, 0, 88, 89, 90, - 128, 91, 92, 93, 94, 0, 0, 0, 121, 95, - 96, 97, 83, 84, 0, 0, 0, 85, 86, 87, - 0, 88, 89, 90, 0, 91, 92, 93, 94, 0, - 0, 0, 121, 95, 96, 97, 83, 84, 0, 0, - 0, 85, 86, 87, 0, 88, 89, 90, 128, 91, - 92, 93, 94, 0, 0, 83, 84, 95, 96, 97, - 85, 86, 87, 0, 88, 89, 90, 0, 91, 92, - 93, 94, 0, 0, -59, -59, 95, 96, 97, -59, - -59, -59, 0, -59, -59, -59, 0, 0, 0, -59, - -59, 0, 0, 46, 0, -59, -59, -59, 83, 84, - 0, 0, 0, 85, 86, 87, 0, 88, 89, 90, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 95, - 96, 97 + 143, 144, 145, 146, 37, 167, 71, 154, 149, 67, + 68, 72, 148, 246, 69, 80, 163, 81, 47, 105, + 106, 156, 157, 168, 160, 161, 162, 107, 116, 222, + 108, 122, 130, 148, 150, 169, 151, 152, 153, 111, + 155, 228, 51, 164, 115, 166, 78, 183, 171, 52, + 184, 192, 170, 193, 53, 188, 196, 207, 54, 55, + 56, 57, 173, 174, 85, 86, 58, 210, 202, 87, + 88, 89, 213, 90, 91, 92, 230, 93, 94, 95, + 96, 234, 189, 201, 232, 97, 98, 99, 235, 236, + 237, 242, 197, 243, 249, 244, 219, 245, 204, 125, + 226, 113, 175, 0, -6, 1, 195, 0, 0, 0, + 84, 2, 3, 4, 5, 6, 7, 8, 9, 0, + 0, 0, 84, 239, 10, 0, 11, 12, 13, 0, + 0, 14, 15, 16, 0, 0, 0, 0, 17, 18, + 19, 248, 0, 20, 0, 0, 0, 21, 22, 0, + 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, + 0, 0, 24, 25, 0, 0, 0, -6, 26, 2, + 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, + 0, 0, 10, 0, 11, 12, 13, 0, 0, 14, + 15, 16, 0, 0, 0, 0, 17, 18, 19, 0, + 0, 20, 85, 86, 0, 21, 22, 87, 88, 89, + 0, 90, 91, 92, 0, 23, 0, 95, 96, 0, + 24, 25, 0, 97, 98, 99, 26, 2, 3, 4, + 5, 6, 7, 42, 9, 0, 0, 0, 0, 0, + 10, 0, 11, 12, 13, 0, 0, 0, 15, 16, + 0, 0, 0, 0, 17, 18, 19, 0, 0, 20, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 23, 0, 0, 0, 0, 24, 25, + 0, 0, 0, 78, 26, 2, 3, 4, 5, 6, + 7, 42, 9, 0, 0, 0, 0, 0, 10, 0, + 11, 12, 13, 0, 0, 0, 15, 16, 0, 0, + 0, 0, 17, 18, 19, 0, 0, 20, 0, 2, + 3, 4, 5, 6, 7, 42, 9, 0, 0, 0, + 0, 23, 10, 0, 11, 12, 24, 25, 0, 0, + 15, 16, 26, 0, 0, 0, 17, 0, 19, 0, + 2, 3, 4, 5, 6, 7, 42, 9, 0, 0, + 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, + 24, 25, 0, 0, 0, 0, 26, 43, 0, 19, + 0, 2, 3, 4, 5, 6, 7, 42, 9, 0, + 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, + 0, 24, 25, 0, 0, 0, 0, 26, 43, 0, + 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 158, 0, 0, 0, 23, 0, 0, + 85, 86, 24, 25, 0, 87, 88, 89, 82, 90, + 91, 92, 159, 93, 94, 95, 96, 0, 0, 85, + 86, 97, 98, 99, 87, 88, 89, 0, 90, 91, + 92, 131, 93, 94, 95, 96, 0, 0, 0, 124, + 97, 98, 99, 85, 86, 0, 0, 0, 87, 88, + 89, 0, 90, 91, 92, 0, 93, 94, 95, 96, + 0, 0, 0, 124, 97, 98, 99, 85, 86, 0, + 0, 0, 87, 88, 89, 0, 90, 91, 92, 131, + 93, 94, 95, 96, 0, 0, 85, 86, 97, 98, + 99, 87, 88, 89, 0, 90, 91, 92, 0, 93, + 94, 95, 96, 0, 0, -60, -60, 97, 98, 99, + -60, -60, -60, 0, -60, -60, -60, 0, 0, 0, + -60, -60, 0, 0, 47, 0, -60, -60, -60, 85, + 86, 0, 0, 0, 87, 88, 89, 0, 90, 91, + 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 97, 98, 99 }; static const yytype_int16 yycheck[] = { - 0, 8, 26, 78, 164, 80, 0, 4, 0, 0, - 18, 7, 8, 9, 10, 11, 12, 13, 14, 62, - 17, 16, 197, 38, 0, 22, 23, 24, 25, 18, - 19, 19, 163, 41, 38, 14, 211, 34, 34, 13, - 36, 56, 21, 38, 63, 42, 200, 63, 45, 46, - 47, 30, 56, 41, 13, 215, 52, 14, 212, 190, - 191, 57, 58, 194, 30, 196, 32, 63, 62, 13, - 67, 62, 38, 62, 13, 235, 207, 77, 62, 46, - 47, 78, 79, 80, 68, 77, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 77, 233, 127, 64, 112, 8, 9, 68, 13, - 64, 13, 63, 120, 68, 39, 40, 14, 115, 116, - 127, 118, 119, 56, 14, 172, 68, 202, 175, 176, - 30, 128, 37, 14, 13, 13, 68, 14, 185, 214, - 21, 14, 14, 30, 168, 26, 193, 171, 145, 30, - 31, 32, 33, 200, 13, 64, 64, 38, 155, 156, - 13, 208, 38, 210, 211, 13, 62, 68, 19, 13, - 35, 18, 219, 41, 24, 37, 19, 174, 225, 186, - 227, 19, 19, 37, 19, 24, 35, 184, 24, 35, - 211, 77, 199, 180, 187, 242, 159, 244, 58, -1, - 0, 1, -1, -1, -1, 202, -1, 7, 8, 9, - 10, 11, 12, 13, 14, -1, -1, 214, -1, 226, - 20, -1, 22, 23, 24, -1, -1, 27, 28, 29, - -1, -1, -1, -1, 34, 35, 36, 237, -1, -1, - -1, -1, 42, 43, -1, -1, -1, -1, -1, -1, - -1, -1, 52, -1, -1, -1, -1, 57, 58, -1, - -1, -1, 62, 63, 7, 8, 9, 10, 11, 12, - 13, 14, -1, -1, -1, -1, -1, 20, -1, 22, - 23, 24, -1, -1, 27, 28, 29, -1, -1, -1, - -1, 34, 35, 36, -1, -1, 44, 45, -1, 42, - 43, 49, 50, 51, -1, 53, 54, 55, -1, 52, - -1, 59, 60, -1, 57, 58, -1, 65, 66, 67, - 63, 7, 8, 9, 10, 11, 12, 13, 14, -1, - -1, -1, -1, -1, 20, -1, 22, 23, 24, -1, - -1, -1, 28, 29, -1, -1, -1, -1, 34, 35, - 36, -1, 7, 8, 9, 10, 11, 12, 13, 14, - -1, -1, -1, -1, -1, 20, 52, 22, 23, 24, - -1, 57, 58, 28, 29, -1, 62, 63, -1, 34, - 35, 36, -1, 7, 8, 9, 10, 11, 12, 13, - 14, -1, -1, -1, -1, -1, 20, 52, 22, 23, - -1, -1, 57, 58, 28, 29, -1, -1, 63, -1, - 34, -1, 36, 7, 8, 9, 10, 11, 12, 13, - 14, -1, -1, -1, -1, -1, -1, -1, 52, -1, - -1, -1, -1, 57, 58, -1, -1, -1, -1, 63, - 34, -1, 36, -1, -1, -1, 25, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 52, -1, - -1, -1, -1, 57, 58, 44, 45, -1, -1, 63, - 49, 50, 51, -1, 53, 54, 55, -1, 57, 58, - 59, 60, -1, 38, -1, -1, 65, 66, 67, 44, - 45, -1, -1, -1, 49, 50, 51, -1, 53, 54, - 55, 56, 57, 58, 59, 60, -1, -1, 44, 45, - 65, 66, 67, 49, 50, 51, -1, 53, 54, 55, - 56, 57, 58, 59, 60, -1, -1, -1, 64, 65, - 66, 67, 44, 45, -1, -1, -1, 49, 50, 51, - -1, 53, 54, 55, -1, 57, 58, 59, 60, -1, - -1, -1, 64, 65, 66, 67, 44, 45, -1, -1, - -1, 49, 50, 51, -1, 53, 54, 55, 56, 57, - 58, 59, 60, -1, -1, 44, 45, 65, 66, 67, - 49, 50, 51, -1, 53, 54, 55, -1, 57, 58, - 59, 60, -1, -1, 44, 45, 65, 66, 67, 49, - 50, 51, -1, 53, 54, 55, -1, -1, -1, 59, - 60, -1, -1, 63, -1, 65, 66, 67, 44, 45, - -1, -1, -1, 49, 50, 51, -1, 53, 54, 55, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 65, - 66, 67 + 0, 8, 27, 80, 168, 82, 0, 38, 4, 0, + 176, 19, 18, 179, 180, 0, 18, 19, 16, 201, + 204, 17, 38, 189, 63, 0, 57, 23, 24, 25, + 26, 197, 216, 215, 42, 64, 42, 14, 204, 35, + 38, 57, 13, 167, 21, 13, 212, 43, 214, 215, + 46, 47, 48, 30, 30, 219, 32, 223, 63, 40, + 41, 63, 38, 229, 69, 231, 14, 47, 48, 63, + 194, 195, 68, 65, 198, 239, 200, 69, 63, 79, + 246, 13, 248, 13, 80, 81, 82, 211, 79, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 79, 130, 13, 114, 65, 8, + 9, 13, 69, 237, 13, 64, 123, 57, 64, 69, + 14, 117, 118, 130, 120, 121, 122, 14, 13, 206, + 30, 37, 37, 69, 13, 131, 14, 14, 14, 30, + 13, 218, 14, 65, 25, 65, 63, 172, 13, 21, + 175, 13, 148, 69, 26, 38, 19, 13, 30, 31, + 32, 33, 158, 159, 45, 46, 38, 35, 18, 50, + 51, 52, 24, 54, 55, 56, 42, 58, 59, 60, + 61, 19, 178, 190, 37, 66, 67, 68, 19, 19, + 37, 19, 188, 35, 35, 24, 203, 24, 191, 79, + 215, 59, 163, -1, 0, 1, 184, -1, -1, -1, + 206, 7, 8, 9, 10, 11, 12, 13, 14, -1, + -1, -1, 218, 230, 20, -1, 22, 23, 24, -1, + -1, 27, 28, 29, -1, -1, -1, -1, 34, 35, + 36, 241, -1, 39, -1, -1, -1, 43, 44, -1, + -1, -1, -1, -1, -1, -1, -1, 53, -1, -1, + -1, -1, 58, 59, -1, -1, -1, 63, 64, 7, + 8, 9, 10, 11, 12, 13, 14, -1, -1, -1, + -1, -1, 20, -1, 22, 23, 24, -1, -1, 27, + 28, 29, -1, -1, -1, -1, 34, 35, 36, -1, + -1, 39, 45, 46, -1, 43, 44, 50, 51, 52, + -1, 54, 55, 56, -1, 53, -1, 60, 61, -1, + 58, 59, -1, 66, 67, 68, 64, 7, 8, 9, + 10, 11, 12, 13, 14, -1, -1, -1, -1, -1, + 20, -1, 22, 23, 24, -1, -1, -1, 28, 29, + -1, -1, -1, -1, 34, 35, 36, -1, -1, 39, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 53, -1, -1, -1, -1, 58, 59, + -1, -1, -1, 63, 64, 7, 8, 9, 10, 11, + 12, 13, 14, -1, -1, -1, -1, -1, 20, -1, + 22, 23, 24, -1, -1, -1, 28, 29, -1, -1, + -1, -1, 34, 35, 36, -1, -1, 39, -1, 7, + 8, 9, 10, 11, 12, 13, 14, -1, -1, -1, + -1, 53, 20, -1, 22, 23, 58, 59, -1, -1, + 28, 29, 64, -1, -1, -1, 34, -1, 36, -1, + 7, 8, 9, 10, 11, 12, 13, 14, -1, -1, + -1, -1, -1, -1, -1, 53, -1, -1, -1, -1, + 58, 59, -1, -1, -1, -1, 64, 34, -1, 36, + -1, 7, 8, 9, 10, 11, 12, 13, 14, -1, + -1, -1, -1, -1, -1, -1, 53, -1, -1, -1, + -1, 58, 59, -1, -1, -1, -1, 64, 34, -1, + 36, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 38, -1, -1, -1, 53, -1, -1, + 45, 46, 58, 59, -1, 50, 51, 52, 64, 54, + 55, 56, 57, 58, 59, 60, 61, -1, -1, 45, + 46, 66, 67, 68, 50, 51, 52, -1, 54, 55, + 56, 57, 58, 59, 60, 61, -1, -1, -1, 65, + 66, 67, 68, 45, 46, -1, -1, -1, 50, 51, + 52, -1, 54, 55, 56, -1, 58, 59, 60, 61, + -1, -1, -1, 65, 66, 67, 68, 45, 46, -1, + -1, -1, 50, 51, 52, -1, 54, 55, 56, 57, + 58, 59, 60, 61, -1, -1, 45, 46, 66, 67, + 68, 50, 51, 52, -1, 54, 55, 56, -1, 58, + 59, 60, 61, -1, -1, 45, 46, 66, 67, 68, + 50, 51, 52, -1, 54, 55, 56, -1, -1, -1, + 60, 61, -1, -1, 64, -1, 66, 67, 68, 45, + 46, -1, -1, -1, 50, 51, 52, -1, 54, 55, + 56, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 66, 67, 68 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -903,29 +916,30 @@ static const yytype_uint8 yystos[] = { 0, 1, 7, 8, 9, 10, 11, 12, 13, 14, 20, 22, 23, 24, 27, 28, 29, 34, 35, 36, - 42, 43, 52, 57, 58, 63, 70, 72, 73, 74, - 75, 76, 83, 84, 85, 90, 91, 93, 96, 101, - 62, 13, 34, 73, 90, 63, 63, 87, 13, 92, - 14, 21, 26, 30, 31, 32, 33, 38, 94, 95, - 13, 14, 13, 90, 39, 40, 8, 9, 13, 13, - 13, 90, 90, 90, 90, 0, 62, 71, 63, 56, - 63, 82, 90, 44, 45, 49, 50, 51, 53, 54, - 55, 57, 58, 59, 60, 65, 66, 67, 90, 90, - 102, 102, 102, 68, 14, 14, 30, 14, 21, 30, - 38, 95, 97, 25, 13, 38, 56, 90, 38, 56, - 98, 64, 72, 82, 90, 82, 90, 37, 56, 90, - 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 64, 68, 64, 13, 14, 14, - 14, 87, 13, 90, 90, 38, 56, 90, 90, 87, - 64, 88, 64, 71, 87, 90, 90, 13, 99, 90, - 90, 99, 89, 16, 38, 89, 74, 91, 68, 71, - 71, 71, 75, 88, 38, 90, 88, 88, 13, 68, - 100, 100, 19, 90, 88, 19, 41, 87, 18, 41, - 79, 80, 86, 13, 89, 89, 35, 88, 89, 24, - 89, 78, 79, 81, 86, 87, 80, 88, 82, 89, - 88, 88, 81, 88, 82, 74, 41, 77, 37, 88, - 19, 19, 19, 37, 88, 87, 88, 87, 19, 35, - 24, 24, 89, 74, 75, 35, 88, 88 + 39, 43, 44, 53, 58, 59, 64, 71, 73, 74, + 75, 76, 77, 84, 85, 86, 91, 92, 94, 97, + 102, 63, 13, 34, 74, 91, 64, 64, 88, 13, + 93, 14, 21, 26, 30, 31, 32, 33, 38, 95, + 96, 13, 14, 13, 91, 40, 41, 8, 9, 13, + 13, 13, 13, 91, 91, 91, 91, 0, 63, 72, + 64, 57, 64, 83, 91, 45, 46, 50, 51, 52, + 54, 55, 56, 58, 59, 60, 61, 66, 67, 68, + 91, 91, 103, 103, 103, 69, 14, 14, 30, 14, + 21, 30, 38, 96, 98, 25, 13, 38, 57, 91, + 38, 57, 37, 99, 65, 73, 83, 91, 83, 91, + 37, 57, 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 65, 69, 65, + 13, 14, 14, 14, 88, 13, 91, 91, 38, 57, + 91, 91, 91, 88, 65, 89, 65, 72, 88, 91, + 91, 13, 100, 91, 91, 100, 90, 16, 38, 90, + 75, 92, 69, 72, 72, 72, 76, 89, 38, 91, + 89, 89, 13, 69, 101, 101, 19, 91, 89, 19, + 42, 88, 18, 42, 80, 81, 87, 13, 90, 90, + 35, 89, 90, 24, 90, 79, 80, 82, 87, 88, + 81, 89, 83, 90, 89, 89, 82, 89, 83, 75, + 42, 78, 37, 89, 19, 19, 19, 37, 89, 88, + 89, 88, 19, 35, 24, 24, 90, 75, 76, 35, + 89, 89 }; #define yyerrok (yyerrstatus = 0) @@ -1883,7 +1897,14 @@ yyparse () break; case 26: -#line 219 "engines/director/lingo/lingo-gr.y" +#line 217 "engines/director/lingo/lingo-gr.y" + { + g_lingo->code1(g_lingo->c_ifcode); + ;} + break; + + case 27: +#line 222 "engines/director/lingo/lingo-gr.y" { inst then = 0, end = 0; WRITE_UINT32(&then, (yyvsp[(5) - (8)].code)); @@ -1893,8 +1914,8 @@ yyparse () g_lingo->processIf(0, 0); ;} break; - case 27: -#line 226 "engines/director/lingo/lingo-gr.y" + case 28: +#line 229 "engines/director/lingo/lingo-gr.y" { inst then = 0, else1 = 0, end = 0; WRITE_UINT32(&then, (yyvsp[(5) - (11)].code)); @@ -1906,8 +1927,8 @@ yyparse () g_lingo->processIf(0, 0); ;} break; - case 28: -#line 235 "engines/director/lingo/lingo-gr.y" + case 29: +#line 238 "engines/director/lingo/lingo-gr.y" { inst then = 0, else1 = 0, end = 0; WRITE_UINT32(&then, (yyvsp[(5) - (11)].code)); @@ -1919,8 +1940,8 @@ yyparse () g_lingo->processIf(0, (yyvsp[(9) - (11)].code)); ;} break; - case 29: -#line 244 "engines/director/lingo/lingo-gr.y" + case 30: +#line 247 "engines/director/lingo/lingo-gr.y" { inst then = 0, else1 = 0, end = 0; WRITE_UINT32(&then, (yyvsp[(4) - (6)].code)); @@ -1933,8 +1954,8 @@ yyparse () g_lingo->processIf(0, 0); ;} break; - case 30: -#line 254 "engines/director/lingo/lingo-gr.y" + case 31: +#line 257 "engines/director/lingo/lingo-gr.y" { inst then = 0, else1 = 0, end = 0; WRITE_UINT32(&then, (yyvsp[(4) - (10)].code)); @@ -1947,8 +1968,8 @@ yyparse () g_lingo->processIf(0, 0); ;} break; - case 31: -#line 264 "engines/director/lingo/lingo-gr.y" + case 32: +#line 267 "engines/director/lingo/lingo-gr.y" { inst then = 0, else1 = 0, end = 0; WRITE_UINT32(&then, (yyvsp[(4) - (10)].code)); @@ -1961,18 +1982,18 @@ yyparse () g_lingo->processIf(0, (yyvsp[(10) - (10)].code)); ;} break; - case 32: -#line 275 "engines/director/lingo/lingo-gr.y" + case 33: +#line 278 "engines/director/lingo/lingo-gr.y" { (yyval.code) = 0; ;} break; - case 33: -#line 276 "engines/director/lingo/lingo-gr.y" + case 34: +#line 279 "engines/director/lingo/lingo-gr.y" { (yyval.code) = (yyvsp[(2) - (3)].code); ;} break; - case 38: -#line 287 "engines/director/lingo/lingo-gr.y" + case 39: +#line 290 "engines/director/lingo/lingo-gr.y" { inst then = 0; WRITE_UINT32(&then, (yyvsp[(4) - (6)].code)); @@ -1981,8 +2002,8 @@ yyparse () g_lingo->codeLabel((yyvsp[(1) - (6)].code)); ;} break; - case 40: -#line 296 "engines/director/lingo/lingo-gr.y" + case 41: +#line 299 "engines/director/lingo/lingo-gr.y" { inst then = 0; WRITE_UINT32(&then, (yyvsp[(4) - (5)].code)); @@ -1991,23 +2012,23 @@ yyparse () g_lingo->codeLabel((yyvsp[(1) - (5)].code)); ;} break; - case 41: -#line 304 "engines/director/lingo/lingo-gr.y" + case 42: +#line 307 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(STOP); ;} break; - case 42: -#line 305 "engines/director/lingo/lingo-gr.y" + case 43: +#line 308 "engines/director/lingo/lingo-gr.y" { g_lingo->code2(g_lingo->c_eq, STOP); ;} break; - case 44: -#line 308 "engines/director/lingo/lingo-gr.y" + case 45: +#line 311 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code3(g_lingo->c_repeatwhilecode, STOP, STOP); ;} break; - case 45: -#line 310 "engines/director/lingo/lingo-gr.y" + case 46: +#line 313 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code3(g_lingo->c_repeatwithcode, STOP, STOP); g_lingo->code3(STOP, STOP, STOP); @@ -2015,8 +2036,8 @@ yyparse () delete (yyvsp[(3) - (3)].s); ;} break; - case 46: -#line 316 "engines/director/lingo/lingo-gr.y" + case 47: +#line 319 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_ifcode); g_lingo->code3(STOP, STOP, STOP); @@ -2024,8 +2045,8 @@ yyparse () g_lingo->codeLabel(0); ;} break; - case 47: -#line 322 "engines/director/lingo/lingo-gr.y" + case 48: +#line 325 "engines/director/lingo/lingo-gr.y" { inst skipEnd; WRITE_UINT32(&skipEnd, 1); // We have to skip end to avoid multiple executions @@ -2034,23 +2055,23 @@ yyparse () g_lingo->code1(skipEnd); ;} break; - case 48: -#line 329 "engines/director/lingo/lingo-gr.y" + case 49: +#line 332 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->_currentScript->size(); ;} break; - case 49: -#line 331 "engines/director/lingo/lingo-gr.y" + case 50: +#line 334 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(STOP); (yyval.code) = g_lingo->_currentScript->size(); ;} break; - case 50: -#line 333 "engines/director/lingo/lingo-gr.y" + case 51: +#line 336 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->_currentScript->size(); ;} break; - case 53: -#line 338 "engines/director/lingo/lingo-gr.y" + case 54: +#line 341 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_constpush); inst i = 0; @@ -2058,22 +2079,22 @@ yyparse () g_lingo->code1(i); ;} break; - case 54: -#line 343 "engines/director/lingo/lingo-gr.y" + case 55: +#line 346 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_fconstpush); g_lingo->codeFloat((yyvsp[(1) - (1)].f)); ;} break; - case 55: -#line 346 "engines/director/lingo/lingo-gr.y" + case 56: +#line 349 "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 56: -#line 349 "engines/director/lingo/lingo-gr.y" + case 57: +#line 352 "engines/director/lingo/lingo-gr.y" { if ((yyvsp[(3) - (4)].narg) != g_lingo->_builtins[*(yyvsp[(1) - (4)].s)]->nargs) error("Built-in function %s expects %d arguments but got %d", (yyvsp[(1) - (4)].s)->c_str(), g_lingo->_builtins[*(yyvsp[(1) - (4)].s)]->nargs, (yyvsp[(3) - (4)].narg)); @@ -2082,15 +2103,15 @@ yyparse () delete (yyvsp[(1) - (4)].s); ;} break; - case 57: -#line 355 "engines/director/lingo/lingo-gr.y" + case 58: +#line 358 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->_builtins[*(yyvsp[(1) - (1)].s)]->func); delete (yyvsp[(1) - (1)].s); ;} break; - case 58: -#line 358 "engines/director/lingo/lingo-gr.y" + case 59: +#line 361 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_call); g_lingo->codeString((yyvsp[(1) - (4)].s)->c_str()); @@ -2101,15 +2122,15 @@ yyparse () delete (yyvsp[(1) - (4)].s); ;} break; - case 59: -#line 366 "engines/director/lingo/lingo-gr.y" + case 60: +#line 369 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->codeId(*(yyvsp[(1) - (1)].s)); delete (yyvsp[(1) - (1)].s); ;} break; - case 60: -#line 369 "engines/director/lingo/lingo-gr.y" + case 61: +#line 372 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code2(g_lingo->c_constpush, 0); // Put dummy id g_lingo->code1(g_lingo->c_theentitypush); @@ -2119,8 +2140,8 @@ yyparse () g_lingo->code2(e, f); ;} break; - case 61: -#line 376 "engines/director/lingo/lingo-gr.y" + case 62: +#line 379 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_theentitypush); inst e = 0, f = 0; @@ -2129,149 +2150,149 @@ yyparse () g_lingo->code2(e, f); ;} break; - case 63: -#line 383 "engines/director/lingo/lingo-gr.y" + case 64: +#line 386 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_add); ;} break; - case 64: -#line 384 "engines/director/lingo/lingo-gr.y" + case 65: +#line 387 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_sub); ;} break; - case 65: -#line 385 "engines/director/lingo/lingo-gr.y" + case 66: +#line 388 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_mul); ;} break; - case 66: -#line 386 "engines/director/lingo/lingo-gr.y" + case 67: +#line 389 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_div); ;} break; - case 67: -#line 387 "engines/director/lingo/lingo-gr.y" + case 68: +#line 390 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gt); ;} break; - case 68: -#line 388 "engines/director/lingo/lingo-gr.y" + case 69: +#line 391 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_lt); ;} break; - case 69: -#line 389 "engines/director/lingo/lingo-gr.y" + case 70: +#line 392 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_neq); ;} break; - case 70: -#line 390 "engines/director/lingo/lingo-gr.y" + case 71: +#line 393 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_ge); ;} break; - case 71: -#line 391 "engines/director/lingo/lingo-gr.y" + case 72: +#line 394 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_le); ;} break; - case 72: -#line 392 "engines/director/lingo/lingo-gr.y" + case 73: +#line 395 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_and); ;} break; - case 73: -#line 393 "engines/director/lingo/lingo-gr.y" + case 74: +#line 396 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_or); ;} break; - case 74: -#line 394 "engines/director/lingo/lingo-gr.y" + case 75: +#line 397 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_not); ;} break; - case 75: -#line 395 "engines/director/lingo/lingo-gr.y" + case 76: +#line 398 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_ampersand); ;} break; - case 76: -#line 396 "engines/director/lingo/lingo-gr.y" + case 77: +#line 399 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_concat); ;} break; - case 77: -#line 397 "engines/director/lingo/lingo-gr.y" + case 78: +#line 400 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_contains); ;} break; - case 78: -#line 398 "engines/director/lingo/lingo-gr.y" + case 79: +#line 401 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_starts); ;} break; - case 79: -#line 399 "engines/director/lingo/lingo-gr.y" + case 80: +#line 402 "engines/director/lingo/lingo-gr.y" { (yyval.code) = (yyvsp[(2) - (2)].code); ;} break; - case 80: -#line 400 "engines/director/lingo/lingo-gr.y" + case 81: +#line 403 "engines/director/lingo/lingo-gr.y" { (yyval.code) = (yyvsp[(2) - (2)].code); g_lingo->code1(g_lingo->c_negate); ;} break; - case 81: -#line 401 "engines/director/lingo/lingo-gr.y" + case 82: +#line 404 "engines/director/lingo/lingo-gr.y" { (yyval.code) = (yyvsp[(2) - (3)].code); ;} break; - case 82: -#line 404 "engines/director/lingo/lingo-gr.y" + case 83: +#line 407 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_mci); g_lingo->codeString((yyvsp[(2) - (2)].s)->c_str()); delete (yyvsp[(2) - (2)].s); ;} break; - case 83: -#line 405 "engines/director/lingo/lingo-gr.y" + case 84: +#line 408 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_mciwait); g_lingo->codeString((yyvsp[(2) - (2)].s)->c_str()); delete (yyvsp[(2) - (2)].s); ;} break; - case 84: -#line 406 "engines/director/lingo/lingo-gr.y" + case 85: +#line 409 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_printtop); ;} break; - case 86: -#line 408 "engines/director/lingo/lingo-gr.y" + case 87: +#line 411 "engines/director/lingo/lingo-gr.y" { g_lingo->code2(g_lingo->c_constpush, (inst)0); // Push fake value on stack g_lingo->code1(g_lingo->c_procret); ;} break; - case 88: -#line 413 "engines/director/lingo/lingo-gr.y" + case 89: +#line 416 "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 89: -#line 414 "engines/director/lingo/lingo-gr.y" + case 90: +#line 417 "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 90: -#line 425 "engines/director/lingo/lingo-gr.y" + case 91: +#line 428 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gotoloop); ;} break; - case 91: -#line 426 "engines/director/lingo/lingo-gr.y" + case 92: +#line 429 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gotonext); ;} break; - case 92: -#line 427 "engines/director/lingo/lingo-gr.y" + case 93: +#line 430 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gotoprevious); ;} break; - case 93: -#line 428 "engines/director/lingo/lingo-gr.y" + case 94: +#line 431 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_goto); g_lingo->codeString((yyvsp[(2) - (2)].s)->c_str()); @@ -2279,8 +2300,8 @@ yyparse () delete (yyvsp[(2) - (2)].s); ;} break; - case 94: -#line 433 "engines/director/lingo/lingo-gr.y" + case 95: +#line 436 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_goto); g_lingo->codeString((yyvsp[(2) - (3)].s)->c_str()); @@ -2289,8 +2310,8 @@ yyparse () delete (yyvsp[(3) - (3)].s); ;} break; - case 95: -#line 439 "engines/director/lingo/lingo-gr.y" + case 96: +#line 442 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_goto); g_lingo->codeString(""); @@ -2298,48 +2319,48 @@ yyparse () delete (yyvsp[(2) - (2)].s); ;} break; - case 96: -#line 446 "engines/director/lingo/lingo-gr.y" - { (yyval.s) = (yyvsp[(3) - (3)].s); ;} - break; - case 97: -#line 447 "engines/director/lingo/lingo-gr.y" - { (yyval.s) = (yyvsp[(2) - (2)].s); ;} +#line 449 "engines/director/lingo/lingo-gr.y" + { (yyval.s) = (yyvsp[(3) - (3)].s); ;} break; case 98: -#line 448 "engines/director/lingo/lingo-gr.y" +#line 450 "engines/director/lingo/lingo-gr.y" { (yyval.s) = (yyvsp[(2) - (2)].s); ;} break; case 99: -#line 449 "engines/director/lingo/lingo-gr.y" - { (yyval.s) = (yyvsp[(1) - (1)].s); ;} +#line 451 "engines/director/lingo/lingo-gr.y" + { (yyval.s) = (yyvsp[(2) - (2)].s); ;} break; case 100: #line 452 "engines/director/lingo/lingo-gr.y" - { (yyval.s) = (yyvsp[(3) - (3)].s); ;} + { (yyval.s) = (yyvsp[(1) - (1)].s); ;} break; case 101: -#line 453 "engines/director/lingo/lingo-gr.y" - { (yyval.s) = (yyvsp[(2) - (2)].s); ;} +#line 455 "engines/director/lingo/lingo-gr.y" + { (yyval.s) = (yyvsp[(3) - (3)].s); ;} break; case 102: -#line 454 "engines/director/lingo/lingo-gr.y" - { (yyval.s) = (yyvsp[(3) - (3)].s); ;} +#line 456 "engines/director/lingo/lingo-gr.y" + { (yyval.s) = (yyvsp[(2) - (2)].s); ;} break; case 103: -#line 482 "engines/director/lingo/lingo-gr.y" - { g_lingo->_indef = true; ;} +#line 457 "engines/director/lingo/lingo-gr.y" + { (yyval.s) = (yyvsp[(3) - (3)].s); ;} break; case 104: -#line 483 "engines/director/lingo/lingo-gr.y" +#line 485 "engines/director/lingo/lingo-gr.y" + { g_lingo->_indef = true; ;} + break; + + case 105: +#line 486 "engines/director/lingo/lingo-gr.y" { g_lingo->code2(g_lingo->c_constpush, (inst)0); // Push fake value on stack g_lingo->code1(g_lingo->c_procret); @@ -2347,20 +2368,20 @@ yyparse () g_lingo->_indef = false; ;} break; - case 105: -#line 488 "engines/director/lingo/lingo-gr.y" + case 106: +#line 491 "engines/director/lingo/lingo-gr.y" { g_lingo->codeFactory(*(yyvsp[(2) - (2)].s)); ;} break; - case 106: -#line 491 "engines/director/lingo/lingo-gr.y" + case 107: +#line 494 "engines/director/lingo/lingo-gr.y" { g_lingo->_indef = true; ;} break; - case 107: -#line 492 "engines/director/lingo/lingo-gr.y" + case 108: +#line 495 "engines/director/lingo/lingo-gr.y" { g_lingo->code2(g_lingo->c_constpush, (inst)0); // Push fake value on stack g_lingo->code1(g_lingo->c_procret); @@ -2368,33 +2389,33 @@ yyparse () g_lingo->_indef = false; ;} break; - case 108: -#line 497 "engines/director/lingo/lingo-gr.y" + case 109: +#line 500 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = 0; ;} break; - case 109: -#line 498 "engines/director/lingo/lingo-gr.y" + case 110: +#line 501 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArg((yyvsp[(1) - (1)].s)); (yyval.narg) = 1; ;} break; - case 110: -#line 499 "engines/director/lingo/lingo-gr.y" + case 111: +#line 502 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArg((yyvsp[(3) - (3)].s)); (yyval.narg) = (yyvsp[(1) - (3)].narg) + 1; ;} break; - case 111: -#line 500 "engines/director/lingo/lingo-gr.y" + case 112: +#line 503 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArg((yyvsp[(4) - (4)].s)); (yyval.narg) = (yyvsp[(1) - (4)].narg) + 1; ;} break; - case 112: -#line 502 "engines/director/lingo/lingo-gr.y" + case 113: +#line 505 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArgStore(); ;} break; - case 113: -#line 506 "engines/director/lingo/lingo-gr.y" + case 114: +#line 509 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_call); g_lingo->codeString((yyvsp[(1) - (3)].s)->c_str()); @@ -2403,24 +2424,24 @@ yyparse () g_lingo->code1(numpar); ;} break; - case 114: -#line 514 "engines/director/lingo/lingo-gr.y" + case 115: +#line 517 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = 0; ;} break; - case 115: -#line 515 "engines/director/lingo/lingo-gr.y" + case 116: +#line 518 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = 1; ;} break; - case 116: -#line 516 "engines/director/lingo/lingo-gr.y" + case 117: +#line 519 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = (yyvsp[(1) - (3)].narg) + 1; ;} break; /* Line 1267 of yacc.c. */ -#line 2424 "engines/director/lingo/lingo-gr.cpp" +#line 2445 "engines/director/lingo/lingo-gr.cpp" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -2634,6 +2655,6 @@ yyparse () } -#line 519 "engines/director/lingo/lingo-gr.y" +#line 522 "engines/director/lingo/lingo-gr.y" diff --git a/engines/director/lingo/lingo-gr.h b/engines/director/lingo/lingo-gr.h index e55340ea856f..a459ac97b973 100644 --- a/engines/director/lingo/lingo-gr.h +++ b/engines/director/lingo/lingo-gr.h @@ -75,23 +75,24 @@ tSET = 291, tTHEN = 292, tTO = 293, - tWITH = 294, - tWHILE = 295, - tNLELSE = 296, - tFACTORY = 297, - tMETHOD = 298, - tGE = 299, - tLE = 300, - tGT = 301, - tLT = 302, - tEQ = 303, - tNEQ = 304, - tAND = 305, - tOR = 306, - tNOT = 307, - tCONCAT = 308, - tCONTAINS = 309, - tSTARTS = 310 + tWHEN = 294, + tWITH = 295, + tWHILE = 296, + tNLELSE = 297, + tFACTORY = 298, + tMETHOD = 299, + tGE = 300, + tLE = 301, + tGT = 302, + tLT = 303, + tEQ = 304, + tNEQ = 305, + tAND = 306, + tOR = 307, + tNOT = 308, + tCONCAT = 309, + tCONTAINS = 310, + tSTARTS = 311 }; #endif /* Tokens. */ @@ -131,23 +132,24 @@ #define tSET 291 #define tTHEN 292 #define tTO 293 -#define tWITH 294 -#define tWHILE 295 -#define tNLELSE 296 -#define tFACTORY 297 -#define tMETHOD 298 -#define tGE 299 -#define tLE 300 -#define tGT 301 -#define tLT 302 -#define tEQ 303 -#define tNEQ 304 -#define tAND 305 -#define tOR 306 -#define tNOT 307 -#define tCONCAT 308 -#define tCONTAINS 309 -#define tSTARTS 310 +#define tWHEN 294 +#define tWITH 295 +#define tWHILE 296 +#define tNLELSE 297 +#define tFACTORY 298 +#define tMETHOD 299 +#define tGE 300 +#define tLE 301 +#define tGT 302 +#define tLT 303 +#define tEQ 304 +#define tNEQ 305 +#define tAND 306 +#define tOR 307 +#define tNOT 308 +#define tCONCAT 309 +#define tCONTAINS 310 +#define tSTARTS 311 @@ -164,7 +166,7 @@ typedef union YYSTYPE int narg; /* number of arguments */ } /* Line 1529 of yacc.c. */ -#line 168 "engines/director/lingo/lingo-gr.hpp" +#line 170 "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 15c6c686b65a..ed3fb11fcbba 100644 --- a/engines/director/lingo/lingo-gr.y +++ b/engines/director/lingo/lingo-gr.y @@ -81,7 +81,7 @@ void yyerror(char *s) { %token FLOAT %token BLTIN BLTINNOARGS ID STRING HANDLER %token tDOWN tELSE tNLELSIF tEND tEXIT tFRAME tGLOBAL tGO tIF tINTO tLOOP tMACRO -%token tMCI tMCIWAIT tMOVIE tNEXT tOF tPREVIOUS tPUT tREPEAT tSET tTHEN tTO +%token tMCI tMCIWAIT tMOVIE tNEXT tOF tPREVIOUS tPUT tREPEAT tSET tTHEN tTO tWHEN %token tWITH tWHILE tNLELSE tFACTORY tMETHOD %token tGE tLE tGT tLT tEQ tNEQ tAND tOR tNOT %token tCONCAT tCONTAINS tSTARTS @@ -214,6 +214,9 @@ stmt: stmtoneliner (*g_lingo->_currentScript)[$1 + 3] = body; /* body of loop */ (*g_lingo->_currentScript)[$1 + 4] = inc; /* increment */ (*g_lingo->_currentScript)[$1 + 5] = end; } /* end, if cond fails */ + | tWHEN ID tTHEN expr { + g_lingo->code1(g_lingo->c_ifcode); + } ; ifstmt: if cond tTHEN nl stmtlist end tEND tIF { diff --git a/engines/director/lingo/lingo-lex.cpp b/engines/director/lingo/lingo-lex.cpp index f630dfd76977..0284905e1d03 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 50 -#define YY_END_OF_BUFFER 51 +#define YY_NUM_RULES 51 +#define YY_END_OF_BUFFER 52 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -373,26 +373,27 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[170] = +static yyconst flex_int16_t yy_accept[172] = { 0, - 0, 0, 51, 49, 3, 47, 47, 49, 49, 46, - 46, 46, 45, 46, 46, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 2, 2, 3, 47, 0, 0, 47, 0, - 0, 48, 42, 1, 44, 45, 41, 39, 40, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 16, - 7, 43, 43, 43, 43, 43, 43, 43, 43, 26, - 27, 43, 43, 43, 43, 43, 43, 36, 43, 43, - 2, 2, 0, 1, 44, 4, 43, 43, 43, 11, - 43, 43, 43, 43, 43, 43, 43, 20, 43, 43, - - 43, 25, 43, 29, 43, 31, 43, 43, 43, 43, - 0, 43, 6, 10, 13, 43, 43, 43, 17, 18, - 43, 43, 43, 43, 24, 43, 43, 43, 0, 35, - 43, 37, 9, 43, 43, 14, 43, 19, 43, 43, - 23, 43, 43, 43, 34, 38, 0, 43, 43, 15, - 43, 22, 43, 30, 32, 0, 0, 43, 12, 21, - 43, 0, 8, 5, 28, 0, 0, 33, 0 + 0, 0, 52, 50, 3, 48, 48, 50, 50, 47, + 47, 47, 46, 47, 47, 44, 44, 44, 44, 44, + 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, + 44, 44, 2, 2, 3, 48, 0, 0, 48, 0, + 0, 49, 43, 1, 45, 46, 42, 40, 41, 44, + 44, 44, 44, 44, 44, 44, 44, 44, 44, 16, + 7, 44, 44, 44, 44, 44, 44, 44, 44, 26, + 27, 44, 44, 44, 44, 44, 44, 36, 44, 44, + 2, 2, 0, 1, 45, 4, 44, 44, 44, 11, + 44, 44, 44, 44, 44, 44, 44, 20, 44, 44, + + 44, 25, 44, 29, 44, 31, 44, 44, 44, 44, + 44, 0, 44, 6, 10, 13, 44, 44, 44, 17, + 18, 44, 44, 44, 44, 24, 44, 44, 44, 0, + 35, 38, 44, 37, 9, 44, 44, 14, 44, 19, + 44, 44, 23, 44, 44, 44, 34, 39, 0, 44, + 44, 15, 44, 22, 44, 30, 32, 0, 0, 44, + 12, 21, 44, 0, 8, 5, 28, 0, 0, 33, + 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -437,53 +438,53 @@ static yyconst flex_int32_t yy_meta[61] = 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 } ; -static yyconst flex_int16_t yy_base[175] = +static yyconst flex_int16_t yy_base[177] = { 0, - 0, 59, 356, 417, 63, 67, 71, 75, 346, 417, - 343, 181, 52, 68, 132, 56, 0, 56, 57, 67, + 0, 59, 359, 419, 63, 67, 71, 75, 351, 419, + 224, 181, 52, 68, 132, 56, 0, 56, 57, 67, 72, 68, 68, 69, 112, 70, 79, 103, 81, 103, 106, 115, 139, 145, 162, 101, 166, 170, 174, 135, - 133, 417, 417, 0, 90, 163, 417, 417, 417, 0, + 133, 419, 419, 0, 90, 163, 419, 419, 419, 0, 112, 153, 146, 151, 166, 162, 169, 172, 163, 0, 0, 160, 167, 171, 173, 166, 165, 164, 169, 0, - 0, 183, 174, 178, 184, 204, 206, 0, 204, 199, - 230, 242, 205, 0, 80, 0, 205, 211, 209, 0, - 208, 209, 216, 232, 222, 224, 225, 221, 235, 235, - - 230, 0, 232, 0, 248, 0, 239, 266, 249, 248, - 256, 262, 0, 0, 0, 252, 264, 269, 0, 0, - 258, 272, 262, 269, 0, 272, 281, 266, 192, 0, - 281, 0, 300, 281, 276, 0, 285, 0, 291, 297, - 0, 289, 286, 291, 321, 0, 325, 304, 295, 0, - 302, 0, 302, 0, 0, 341, 305, 305, 0, 0, - 306, 322, 417, 0, 0, 342, 348, 359, 417, 392, - 394, 400, 405, 410 + 0, 183, 174, 178, 184, 204, 206, 0, 208, 201, + 232, 242, 207, 0, 80, 0, 208, 214, 209, 0, + 210, 216, 224, 237, 229, 229, 229, 225, 232, 239, + + 234, 0, 233, 0, 249, 0, 240, 267, 247, 250, + 254, 260, 269, 0, 0, 0, 259, 266, 273, 0, + 0, 263, 280, 271, 277, 0, 278, 287, 272, 192, + 0, 0, 286, 0, 311, 283, 281, 0, 290, 0, + 284, 300, 0, 293, 291, 293, 330, 0, 331, 301, + 300, 0, 307, 0, 307, 0, 0, 343, 321, 312, + 0, 0, 318, 330, 419, 0, 0, 350, 351, 356, + 419, 394, 396, 402, 407, 412 } ; -static yyconst flex_int16_t yy_def[175] = +static yyconst flex_int16_t yy_def[177] = { 0, - 169, 1, 169, 169, 169, 169, 169, 169, 170, 169, - 169, 169, 169, 169, 169, 171, 171, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, - 171, 171, 169, 169, 169, 169, 169, 169, 169, 169, - 170, 169, 169, 172, 169, 169, 169, 169, 169, 171, - 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, - 169, 169, 169, 172, 169, 171, 171, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, - - 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, - 169, 171, 171, 171, 171, 171, 171, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 171, 171, 173, 171, - 171, 171, 169, 171, 171, 171, 171, 171, 171, 171, - 171, 171, 171, 171, 173, 171, 169, 171, 171, 171, - 171, 171, 171, 171, 171, 169, 169, 171, 171, 171, - 171, 169, 169, 171, 171, 169, 174, 174, 0, 169, - 169, 169, 169, 169 + 171, 1, 171, 171, 171, 171, 171, 171, 172, 171, + 171, 171, 171, 171, 171, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 171, 171, 171, 171, 171, 171, 171, 171, + 172, 171, 171, 174, 171, 171, 171, 171, 171, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 171, 171, 171, 174, 171, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 171, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 175, + 173, 173, 173, 173, 171, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 175, 173, 171, 173, + 173, 173, 173, 173, 173, 173, 173, 171, 171, 173, + 173, 173, 173, 171, 171, 173, 173, 171, 176, 176, + 0, 171, 171, 171, 171, 171 } ; -static yyconst flex_int16_t yy_nxt[478] = +static yyconst flex_int16_t yy_nxt[480] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 4, 13, 14, 10, 15, 16, 17, 18, 19, 20, 21, @@ -505,41 +506,41 @@ static yyconst flex_int16_t yy_nxt[478] = 79, 80, 67, 35, 36, 36, 37, 37, 36, 36, 37, 38, 45, 46, 38, 38, 39, 39, 38, 87, 88, 89, 83, 90, 91, 92, 93, 97, 40, 44, - 94, 95, 40, 129, 96, 98, 129, 99, 100, 101, + 94, 95, 40, 130, 96, 98, 130, 99, 100, 101, 102, 103, 87, 88, 89, 104, 105, 90, 91, 92, 93, 97, 40, 94, 95, 106, 40, 96, 107, 98, - 99, 100, 101, 102, 108, 103, 109, 114, 104, 105, - 110, 81, 36, 36, 82, 111, 112, 113, 106, 115, - 116, 117, 107, 82, 36, 36, 82, 118, 108, 119, - 109, 114, 120, 110, 121, 122, 123, 124, 111, 112, - 113, 125, 115, 116, 117, 126, 127, 129, 128, 132, - 129, 118, 119, 131, 133, 120, 134, 121, 122, 135, - 123, 124, 136, 137, 125, 138, 139, 141, 126, 140, - 127, 128, 130, 132, 142, 143, 131, 144, 133, 146, - - 134, 147, 135, 148, 147, 149, 136, 137, 138, 150, - 139, 141, 140, 151, 152, 130, 153, 154, 142, 143, - 144, 155, 156, 146, 163, 156, 147, 148, 149, 147, - 158, 159, 150, 160, 161, 164, 165, 151, 152, 153, - 154, 166, 156, 167, 155, 156, 167, 157, 163, 167, - 43, 42, 167, 158, 159, 169, 160, 161, 164, 165, - 169, 169, 169, 169, 169, 166, 169, 169, 162, 169, - 169, 157, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 162, 41, 41, 169, 41, 41, 41, 50, 50, - - 84, 84, 169, 169, 84, 84, 145, 169, 169, 169, - 145, 168, 169, 169, 169, 168, 3, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169 + 99, 100, 101, 102, 108, 103, 109, 115, 104, 105, + 110, 43, 111, 81, 36, 36, 82, 112, 106, 113, + 114, 116, 107, 82, 36, 36, 82, 117, 108, 118, + 109, 115, 119, 124, 110, 111, 120, 121, 122, 123, + 112, 125, 113, 114, 116, 126, 127, 128, 130, 129, + 117, 130, 118, 132, 133, 134, 119, 124, 135, 120, + 121, 122, 123, 136, 138, 125, 137, 139, 126, 127, + 140, 128, 129, 131, 141, 143, 132, 133, 142, 134, + + 144, 145, 135, 146, 148, 150, 153, 136, 138, 137, + 151, 139, 149, 140, 152, 149, 131, 154, 141, 143, + 155, 142, 156, 157, 144, 145, 146, 160, 148, 150, + 153, 158, 149, 151, 158, 149, 161, 152, 162, 163, + 165, 154, 166, 155, 158, 156, 157, 158, 167, 168, + 160, 169, 169, 159, 169, 169, 42, 171, 171, 161, + 171, 162, 163, 171, 165, 166, 171, 171, 171, 171, + 164, 167, 171, 168, 171, 171, 171, 159, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 164, 41, 41, 171, 41, 41, 41, + + 50, 50, 84, 84, 171, 171, 84, 84, 147, 171, + 171, 171, 147, 170, 171, 171, 171, 170, 3, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171 } ; -static yyconst flex_int16_t yy_chk[478] = +static yyconst flex_int16_t yy_chk[480] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -561,38 +562,38 @@ static yyconst flex_int16_t yy_chk[478] = 32, 32, 25, 35, 35, 35, 35, 37, 37, 37, 37, 38, 46, 46, 38, 39, 39, 39, 39, 52, 53, 54, 40, 55, 56, 57, 58, 64, 38, 12, - 59, 62, 39, 129, 63, 65, 129, 66, 67, 68, + 59, 62, 39, 130, 63, 65, 130, 66, 67, 68, 69, 72, 52, 53, 54, 73, 74, 55, 56, 57, 58, 64, 38, 59, 62, 75, 39, 63, 76, 65, 66, 67, 68, 69, 77, 72, 79, 89, 73, 74, - 80, 81, 81, 81, 81, 83, 87, 88, 75, 91, - 92, 93, 76, 82, 82, 82, 82, 94, 77, 95, - 79, 89, 96, 80, 97, 98, 99, 100, 83, 87, - 88, 101, 91, 92, 93, 103, 105, 108, 107, 110, - 108, 94, 95, 109, 111, 96, 112, 97, 98, 116, - 99, 100, 117, 118, 101, 121, 122, 124, 103, 123, - 105, 107, 108, 110, 126, 127, 109, 128, 111, 131, - - 112, 133, 116, 134, 133, 135, 117, 118, 121, 137, - 122, 124, 123, 139, 140, 108, 142, 143, 126, 127, - 128, 144, 145, 131, 157, 145, 147, 134, 135, 147, - 148, 149, 137, 151, 153, 158, 161, 139, 140, 142, - 143, 162, 156, 166, 144, 156, 166, 147, 157, 167, - 11, 9, 167, 148, 149, 3, 151, 153, 158, 161, - 168, 0, 0, 168, 0, 162, 0, 0, 156, 0, - 0, 147, 0, 0, 0, 0, 0, 0, 0, 0, + 79, 11, 80, 81, 81, 81, 81, 83, 75, 87, + 88, 91, 76, 82, 82, 82, 82, 92, 77, 93, + 79, 89, 94, 99, 79, 80, 95, 96, 97, 98, + 83, 100, 87, 88, 91, 101, 103, 105, 108, 107, + 92, 108, 93, 109, 110, 111, 94, 99, 112, 95, + 96, 97, 98, 113, 118, 100, 117, 119, 101, 103, + 122, 105, 107, 108, 123, 125, 109, 110, 124, 111, + + 127, 128, 112, 129, 133, 136, 141, 113, 118, 117, + 137, 119, 135, 122, 139, 135, 108, 142, 123, 125, + 144, 124, 145, 146, 127, 128, 129, 150, 133, 136, + 141, 147, 149, 137, 147, 149, 151, 139, 153, 155, + 159, 142, 160, 144, 158, 145, 146, 158, 163, 164, + 150, 168, 169, 149, 168, 169, 9, 170, 3, 151, + 170, 153, 155, 0, 159, 160, 0, 0, 0, 0, + 158, 163, 0, 164, 0, 0, 0, 149, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 156, 170, 170, 0, 170, 170, 170, 171, 171, - - 172, 172, 0, 0, 172, 172, 173, 0, 0, 0, - 173, 174, 0, 0, 0, 174, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169 + 0, 0, 0, 158, 172, 172, 0, 172, 172, 172, + + 173, 173, 174, 174, 0, 0, 174, 174, 175, 0, + 0, 0, 175, 176, 0, 0, 0, 176, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171 } ; static yy_state_type yy_last_accepting_state; @@ -657,7 +658,7 @@ static void countnl() { g_lingo->_colnumber = strlen(p); } -#line 661 "engines/director/lingo/lingo-lex.cpp" +#line 662 "engines/director/lingo/lingo-lex.cpp" #define INITIAL 0 @@ -845,7 +846,7 @@ YY_DECL #line 60 "engines/director/lingo/lingo-lex.l" -#line 849 "engines/director/lingo/lingo-lex.cpp" +#line 850 "engines/director/lingo/lingo-lex.cpp" if ( !(yy_init) ) { @@ -899,13 +900,13 @@ YY_DECL 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 >= 170 ) + if ( yy_current_state >= 172 ) 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_base[yy_current_state] != 417 ); + while ( yy_base[yy_current_state] != 419 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1176,31 +1177,36 @@ YY_RULE_SETUP case 38: YY_RULE_SETUP #line 157 "engines/director/lingo/lingo-lex.l" -{ count(); return tWHILE; } +{ count(); return tWHEN; } YY_BREAK case 39: YY_RULE_SETUP -#line 159 "engines/director/lingo/lingo-lex.l" -{ count(); return tNEQ; } +#line 158 "engines/director/lingo/lingo-lex.l" +{ count(); return tWHILE; } YY_BREAK case 40: YY_RULE_SETUP #line 160 "engines/director/lingo/lingo-lex.l" -{ count(); return tGE; } +{ count(); return tNEQ; } YY_BREAK case 41: YY_RULE_SETUP #line 161 "engines/director/lingo/lingo-lex.l" -{ count(); return tLE; } +{ count(); return tGE; } YY_BREAK case 42: YY_RULE_SETUP #line 162 "engines/director/lingo/lingo-lex.l" -{ count(); return tCONCAT; } +{ count(); return tLE; } YY_BREAK case 43: YY_RULE_SETUP -#line 164 "engines/director/lingo/lingo-lex.l" +#line 163 "engines/director/lingo/lingo-lex.l" +{ count(); return tCONCAT; } + YY_BREAK +case 44: +YY_RULE_SETUP +#line 165 "engines/director/lingo/lingo-lex.l" { count(); yylval.s = new Common::String(yytext); @@ -1215,43 +1221,43 @@ YY_RULE_SETUP return ID; } YY_BREAK -case 44: -YY_RULE_SETUP -#line 177 "engines/director/lingo/lingo-lex.l" -{ count(); yylval.f = atof(yytext); return FLOAT; } - YY_BREAK case 45: YY_RULE_SETUP #line 178 "engines/director/lingo/lingo-lex.l" -{ count(); yylval.i = strtol(yytext, NULL, 10); return INT; } +{ count(); yylval.f = atof(yytext); return FLOAT; } YY_BREAK case 46: YY_RULE_SETUP #line 179 "engines/director/lingo/lingo-lex.l" -{ count(); return *yytext; } +{ count(); yylval.i = strtol(yytext, NULL, 10); return INT; } YY_BREAK case 47: -/* rule 47 can match eol */ YY_RULE_SETUP #line 180 "engines/director/lingo/lingo-lex.l" -{ return '\n'; } +{ count(); return *yytext; } YY_BREAK case 48: +/* rule 48 can match eol */ YY_RULE_SETUP #line 181 "engines/director/lingo/lingo-lex.l" -{ count(); yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return STRING; } +{ return '\n'; } YY_BREAK case 49: YY_RULE_SETUP #line 182 "engines/director/lingo/lingo-lex.l" - +{ count(); yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return STRING; } YY_BREAK case 50: YY_RULE_SETUP -#line 184 "engines/director/lingo/lingo-lex.l" +#line 183 "engines/director/lingo/lingo-lex.l" + + YY_BREAK +case 51: +YY_RULE_SETUP +#line 185 "engines/director/lingo/lingo-lex.l" ECHO; YY_BREAK -#line 1255 "engines/director/lingo/lingo-lex.cpp" +#line 1261 "engines/director/lingo/lingo-lex.cpp" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1544,7 +1550,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 >= 170 ) + if ( yy_current_state >= 172 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1572,11 +1578,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 >= 170 ) + if ( yy_current_state >= 172 ) 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 == 169); + yy_is_jam = (yy_current_state == 171); return yy_is_jam ? 0 : yy_current_state; } @@ -2251,7 +2257,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 184 "engines/director/lingo/lingo-lex.l" +#line 185 "engines/director/lingo/lingo-lex.l" diff --git a/engines/director/lingo/lingo-lex.l b/engines/director/lingo/lingo-lex.l index 21110ceb3d89..f125a010135a 100644 --- a/engines/director/lingo/lingo-lex.l +++ b/engines/director/lingo/lingo-lex.l @@ -154,6 +154,7 @@ whitespace [\t ] (?i:then) { count(); return tTHEN; } (?i:to) { count(); return tTO; } (?i:with) { count(); return tWITH; } +(?i:when) { count(); return tWHEN; } (?i:while) { count(); return tWHILE; } [<][>] { count(); return tNEQ; } diff --git a/engines/director/lingo/tests/factory.lingo b/engines/director/lingo/tests/factory.lingo index cf1e14208863..5349b3476b75 100644 --- a/engines/director/lingo/tests/factory.lingo +++ b/engines/director/lingo/tests/factory.lingo @@ -26,7 +26,7 @@ method mExit method mDispose global aim1 set aim1 = 1 --- when keydown then nothing + when keydown then nothing -- factory fire2 method mNew