From 7fd25e98f1a689733b6bad449618ebe8f3c91546 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 30 Jul 2016 01:43:55 +0300 Subject: DIRECTOR: Lingo: Added basic support for points --- engines/director/lingo/lingo-builtins.cpp | 23 + engines/director/lingo/lingo-code.cpp | 13 +- engines/director/lingo/lingo-gr.cpp | 975 +++++++++++++++--------------- engines/director/lingo/lingo-gr.h | 225 +++---- engines/director/lingo/lingo-gr.y | 7 +- engines/director/lingo/lingo.cpp | 2 + engines/director/lingo/lingo.h | 5 + engines/director/lingo/tests/point.lingo | 3 + 8 files changed, 658 insertions(+), 595 deletions(-) create mode 100644 engines/director/lingo/tests/point.lingo (limited to 'engines/director') diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp index e9c173bce6..78c751641d 100644 --- a/engines/director/lingo/lingo-builtins.cpp +++ b/engines/director/lingo/lingo-builtins.cpp @@ -49,6 +49,8 @@ static struct BuiltinProto { { "string", Lingo::b_string, 1}, // Misc { "dontpassevent", Lingo::b_dontpassevent, -1 }, + // point + { "point", Lingo::b_point, 2}, { 0, 0, 0 } }; @@ -216,4 +218,25 @@ void Lingo::b_dontpassevent() { warning("STUB: b_dontpassevent"); } +/////////////////// +// Point +/////////////////// +void Lingo::b_point() { + Datum y = g_lingo->pop(); + Datum x = g_lingo->pop(); + Datum d; + + x.toFloat(); + y.toFloat(); + + d.u.arr = new FloatArray; + + d.u.arr->push_back(x.u.f); + d.u.arr->push_back(y.u.f); + d.type = POINT; + + g_lingo->push(d); +} + + } // End of namespace Director diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp index c8ae4b9774..eb28dcfd73 100644 --- a/engines/director/lingo/lingo-code.cpp +++ b/engines/director/lingo/lingo-code.cpp @@ -95,6 +95,9 @@ void Lingo::c_printtop(void) { case STRING: warning("%s", d.u.s->c_str()); break; + case POINT: + warning("point (%d, %d)", (int)((*d.u.arr)[0]), (int)((*d.u.arr)[1])); + break; default: warning("--unknown--"); } @@ -175,6 +178,10 @@ void Lingo::c_assign() { d1.u.sym->u.f = d2.u.f; else if (d2.type == STRING) d1.u.sym->u.s = new Common::String(*d2.u.s); + else if (d2.type == POINT) + d1.u.sym->u.arr = d2.u.arr; + else + error("c_assign: unhandled type: %s", d2.type2str()); d1.u.sym->type = d2.type; @@ -182,7 +189,7 @@ void Lingo::c_assign() { } bool Lingo::verify(Symbol *s) { - if (s->type != INT && s->type != VOID && s->type != FLOAT && s->type != STRING) { + if (s->type != INT && s->type != VOID && s->type != FLOAT && s->type != STRING && s->type != POINT) { warning("attempt to evaluate non-variable '%s'", s->name); return false; @@ -214,6 +221,10 @@ void Lingo::c_eval() { d.u.f = d.u.sym->u.f; else if (d.u.sym->type == STRING) d.u.s = new Common::String(*d.u.sym->u.s); + else if (d.u.sym->type == POINT) + d.u.arr = d.u.sym->u.arr; + else + error("c_eval: unhandled type: %s", d.type2str()); g_lingo->push(d); } diff --git a/engines/director/lingo/lingo-gr.cpp b/engines/director/lingo/lingo-gr.cpp index bb343ff30b..6276ee42c2 100644 --- a/engines/director/lingo/lingo-gr.cpp +++ b/engines/director/lingo/lingo-gr.cpp @@ -70,59 +70,62 @@ UNARY = 259, VOID = 260, VAR = 261, - INT = 262, - THEENTITY = 263, - THEENTITYWITHID = 264, - FLOAT = 265, - BLTIN = 266, - BLTINNOARGS = 267, - ID = 268, - STRING = 269, - HANDLER = 270, - tDOWN = 271, - tELSE = 272, - tNLELSIF = 273, - tEND = 274, - tEXIT = 275, - tFRAME = 276, - tGLOBAL = 277, - tGO = 278, - tIF = 279, - tINTO = 280, - tLOOP = 281, - tMACRO = 282, - tMCI = 283, - tMCIWAIT = 284, - tMOVIE = 285, - tNEXT = 286, - tOF = 287, - tPREVIOUS = 288, - tPUT = 289, - tREPEAT = 290, - tSET = 291, - tTHEN = 292, - tTO = 293, - 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, - tSPRITE = 312, - tINTERSECTS = 313, - tWITHIN = 314 + POINT = 262, + RECT = 263, + ARRAY = 264, + INT = 265, + THEENTITY = 266, + THEENTITYWITHID = 267, + FLOAT = 268, + BLTIN = 269, + BLTINNOARGS = 270, + ID = 271, + STRING = 272, + HANDLER = 273, + tDOWN = 274, + tELSE = 275, + tNLELSIF = 276, + tEND = 277, + tEXIT = 278, + tFRAME = 279, + tGLOBAL = 280, + tGO = 281, + tIF = 282, + tINTO = 283, + tLOOP = 284, + tMACRO = 285, + tMCI = 286, + tMCIWAIT = 287, + tMOVIE = 288, + tNEXT = 289, + tOF = 290, + tPREVIOUS = 291, + tPUT = 292, + tREPEAT = 293, + tSET = 294, + tTHEN = 295, + tTO = 296, + tWHEN = 297, + tWITH = 298, + tWHILE = 299, + tNLELSE = 300, + tFACTORY = 301, + tMETHOD = 302, + tGE = 303, + tLE = 304, + tGT = 305, + tLT = 306, + tEQ = 307, + tNEQ = 308, + tAND = 309, + tOR = 310, + tNOT = 311, + tCONCAT = 312, + tCONTAINS = 313, + tSTARTS = 314, + tSPRITE = 315, + tINTERSECTS = 316, + tWITHIN = 317 }; #endif /* Tokens. */ @@ -130,59 +133,62 @@ #define UNARY 259 #define VOID 260 #define VAR 261 -#define INT 262 -#define THEENTITY 263 -#define THEENTITYWITHID 264 -#define FLOAT 265 -#define BLTIN 266 -#define BLTINNOARGS 267 -#define ID 268 -#define STRING 269 -#define HANDLER 270 -#define tDOWN 271 -#define tELSE 272 -#define tNLELSIF 273 -#define tEND 274 -#define tEXIT 275 -#define tFRAME 276 -#define tGLOBAL 277 -#define tGO 278 -#define tIF 279 -#define tINTO 280 -#define tLOOP 281 -#define tMACRO 282 -#define tMCI 283 -#define tMCIWAIT 284 -#define tMOVIE 285 -#define tNEXT 286 -#define tOF 287 -#define tPREVIOUS 288 -#define tPUT 289 -#define tREPEAT 290 -#define tSET 291 -#define tTHEN 292 -#define tTO 293 -#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 -#define tSPRITE 312 -#define tINTERSECTS 313 -#define tWITHIN 314 +#define POINT 262 +#define RECT 263 +#define ARRAY 264 +#define INT 265 +#define THEENTITY 266 +#define THEENTITYWITHID 267 +#define FLOAT 268 +#define BLTIN 269 +#define BLTINNOARGS 270 +#define ID 271 +#define STRING 272 +#define HANDLER 273 +#define tDOWN 274 +#define tELSE 275 +#define tNLELSIF 276 +#define tEND 277 +#define tEXIT 278 +#define tFRAME 279 +#define tGLOBAL 280 +#define tGO 281 +#define tIF 282 +#define tINTO 283 +#define tLOOP 284 +#define tMACRO 285 +#define tMCI 286 +#define tMCIWAIT 287 +#define tMOVIE 288 +#define tNEXT 289 +#define tOF 290 +#define tPREVIOUS 291 +#define tPUT 292 +#define tREPEAT 293 +#define tSET 294 +#define tTHEN 295 +#define tTO 296 +#define tWHEN 297 +#define tWITH 298 +#define tWHILE 299 +#define tNLELSE 300 +#define tFACTORY 301 +#define tMETHOD 302 +#define tGE 303 +#define tLE 304 +#define tGT 305 +#define tLT 306 +#define tEQ 307 +#define tNEQ 308 +#define tAND 309 +#define tOR 310 +#define tNOT 311 +#define tCONCAT 312 +#define tCONTAINS 313 +#define tSTARTS 314 +#define tSPRITE 315 +#define tINTERSECTS 316 +#define tWITHIN 317 @@ -232,14 +238,15 @@ typedef union YYSTYPE #line 69 "engines/director/lingo/lingo-gr.y" { Common::String *s; - int i; + int i; double f; int e[2]; // Entity + field int code; - int narg; /* number of arguments */ + int narg; /* number of arguments */ + Common::Array *arr; } /* Line 193 of yacc.c. */ -#line 243 "engines/director/lingo/lingo-gr.cpp" +#line 250 "engines/director/lingo/lingo-gr.cpp" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -252,7 +259,7 @@ typedef union YYSTYPE /* Line 216 of yacc.c. */ -#line 256 "engines/director/lingo/lingo-gr.cpp" +#line 263 "engines/director/lingo/lingo-gr.cpp" #ifdef short # undef short @@ -467,10 +474,10 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 79 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 715 +#define YYLAST 731 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 73 +#define YYNTOKENS 76 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 34 /* YYNRULES -- Number of rules. */ @@ -480,7 +487,7 @@ union yyalloc /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 314 +#define YYMAXUTOK 317 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -489,12 +496,12 @@ union yyalloc static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 66, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 69, 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, 65, 71, 2, - 67, 68, 63, 61, 72, 62, 2, 64, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 68, 74, 2, + 70, 71, 66, 64, 75, 65, 2, 67, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 70, 60, 69, 2, 2, 2, 2, 2, 2, 2, + 73, 63, 72, 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, @@ -519,7 +526,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, 56, 57, 58, 59 + 55, 56, 57, 58, 59, 60, 61, 62 }; #if YYDEBUG @@ -544,69 +551,69 @@ static const yytype_uint16 yyprhs[] = /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { - 74, 0, -1, 74, 75, 76, -1, 76, -1, 1, - 66, -1, 66, -1, -1, 100, -1, 95, -1, 105, - -1, 77, -1, 79, -1, 34, 94, 25, 13, -1, - 36, 13, 60, 94, -1, 36, 8, 60, 94, -1, - 36, 9, 94, 60, 94, -1, 36, 13, 38, 94, - -1, 36, 8, 38, 94, -1, 36, 9, 94, 38, - 94, -1, 94, -1, 95, -1, 78, -1, 80, -1, - 87, 67, 86, 68, 93, 92, 19, 35, -1, 88, - 60, 94, 92, 38, 94, 92, 93, 92, 19, 35, - -1, 88, 60, 94, 92, 16, 38, 94, 92, 93, - 92, 19, 35, -1, 39, 13, 37, 94, -1, 89, - 86, 37, 75, 93, 92, 19, 24, -1, 89, 86, - 37, 75, 93, 92, 42, 93, 92, 19, 24, -1, - 89, 86, 37, 75, 93, 92, 91, 82, 92, 19, - 24, -1, 89, 86, 37, 91, 78, 92, -1, 89, - 86, 37, 91, 78, 92, 42, 91, 78, 92, -1, - 89, 86, 37, 91, 78, 92, 83, 92, 81, 92, - -1, -1, 42, 91, 78, -1, 82, 85, -1, 85, - -1, 83, 84, -1, 84, -1, 90, 86, 37, 91, - 79, 92, -1, 83, -1, 90, 86, 37, 93, 92, - -1, 94, -1, 94, 60, 94, -1, 67, 86, 68, - -1, 35, 41, -1, 35, 40, 13, -1, 24, -1, - 18, -1, -1, -1, -1, 93, 75, -1, 93, 79, - -1, 7, -1, 10, -1, 14, -1, 11, 67, 106, - 68, -1, 12, -1, 13, 67, 106, 68, -1, 13, - -1, 8, -1, 9, 94, -1, 77, -1, 94, 61, - 94, -1, 94, 62, 94, -1, 94, 63, 94, -1, - 94, 64, 94, -1, 94, 69, 94, -1, 94, 70, - 94, -1, 94, 50, 94, -1, 94, 45, 94, -1, - 94, 46, 94, -1, 94, 51, 94, -1, 94, 52, - 94, -1, 53, 94, -1, 94, 71, 94, -1, 94, - 54, 94, -1, 94, 55, 94, -1, 94, 56, 94, - -1, 61, 94, -1, 62, 94, -1, 67, 94, 68, - -1, 57, 94, 58, 94, -1, 57, 94, 59, 94, - -1, 28, 14, -1, 29, 13, -1, 34, 94, -1, - 97, -1, 20, -1, 22, 96, -1, 13, -1, 96, - 72, 13, -1, 23, 26, -1, 23, 31, -1, 23, - 33, -1, 23, 98, -1, 23, 98, 99, -1, 23, - 99, -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, 101, 91, - 103, 75, 104, 93, -1, 43, 13, -1, -1, 44, - 13, 102, 91, 103, 75, 104, 93, -1, -1, 13, - -1, 103, 72, 13, -1, 103, 75, 72, 13, -1, - -1, 13, 91, 106, -1, -1, 94, -1, 106, 72, - 94, -1 + 77, 0, -1, 77, 78, 79, -1, 79, -1, 1, + 69, -1, 69, -1, -1, 103, -1, 98, -1, 108, + -1, 80, -1, 82, -1, 37, 97, 28, 16, -1, + 39, 16, 63, 97, -1, 39, 11, 63, 97, -1, + 39, 12, 97, 63, 97, -1, 39, 16, 41, 97, + -1, 39, 11, 41, 97, -1, 39, 12, 97, 41, + 97, -1, 97, -1, 98, -1, 81, -1, 83, -1, + 90, 70, 89, 71, 96, 95, 22, 38, -1, 91, + 63, 97, 95, 41, 97, 95, 96, 95, 22, 38, + -1, 91, 63, 97, 95, 19, 41, 97, 95, 96, + 95, 22, 38, -1, 42, 16, 40, 97, -1, 92, + 89, 40, 78, 96, 95, 22, 27, -1, 92, 89, + 40, 78, 96, 95, 45, 96, 95, 22, 27, -1, + 92, 89, 40, 78, 96, 95, 94, 85, 95, 22, + 27, -1, 92, 89, 40, 94, 81, 95, -1, 92, + 89, 40, 94, 81, 95, 45, 94, 81, 95, -1, + 92, 89, 40, 94, 81, 95, 86, 95, 84, 95, + -1, -1, 45, 94, 81, -1, 85, 88, -1, 88, + -1, 86, 87, -1, 87, -1, 93, 89, 40, 94, + 82, 95, -1, 86, -1, 93, 89, 40, 96, 95, + -1, 97, -1, 97, 63, 97, -1, 70, 89, 71, + -1, 38, 44, -1, 38, 43, 16, -1, 27, -1, + 21, -1, -1, -1, -1, 96, 78, -1, 96, 82, + -1, 10, -1, 13, -1, 17, -1, 14, 70, 109, + 71, -1, 15, -1, 16, 70, 109, 71, -1, 16, + -1, 11, -1, 12, 97, -1, 80, -1, 97, 64, + 97, -1, 97, 65, 97, -1, 97, 66, 97, -1, + 97, 67, 97, -1, 97, 72, 97, -1, 97, 73, + 97, -1, 97, 53, 97, -1, 97, 48, 97, -1, + 97, 49, 97, -1, 97, 54, 97, -1, 97, 55, + 97, -1, 56, 97, -1, 97, 74, 97, -1, 97, + 57, 97, -1, 97, 58, 97, -1, 97, 59, 97, + -1, 64, 97, -1, 65, 97, -1, 70, 97, 71, + -1, 60, 97, 61, 97, -1, 60, 97, 62, 97, + -1, 31, 17, -1, 32, 16, -1, 37, 97, -1, + 100, -1, 23, -1, 25, 99, -1, 16, -1, 99, + 75, 16, -1, 26, 29, -1, 26, 34, -1, 26, + 36, -1, 26, 101, -1, 26, 101, 102, -1, 26, + 102, -1, 41, 24, 17, -1, 24, 17, -1, 41, + 17, -1, 17, -1, 35, 33, 17, -1, 33, 17, + -1, 41, 33, 17, -1, -1, 30, 16, 104, 94, + 106, 78, 107, 96, -1, 46, 16, -1, -1, 47, + 16, 105, 94, 106, 78, 107, 96, -1, -1, 16, + -1, 106, 75, 16, -1, 106, 78, 75, 16, -1, + -1, 16, 94, 109, -1, -1, 97, -1, 109, 75, + 97, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 101, 101, 102, 103, 106, 111, 112, 113, 114, - 115, 116, 119, 125, 131, 139, 147, 153, 161, 170, - 171, 173, 174, 179, 190, 206, 218, 223, 230, 239, - 248, 258, 268, 279, 280, 283, 284, 287, 288, 291, - 299, 300, 308, 309, 310, 312, 314, 320, 326, 333, - 335, 337, 338, 339, 342, 347, 350, 353, 359, 362, - 370, 373, 380, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 410, 411, 412, 413, 414, - 416, 419, 420, 431, 432, 433, 434, 439, 445, 452, - 453, 454, 455, 458, 459, 460, 488, 488, 494, 497, - 497, 503, 504, 505, 506, 508, 512, 520, 521, 522 + 0, 102, 102, 103, 104, 107, 112, 113, 114, 115, + 116, 117, 120, 126, 132, 140, 148, 154, 162, 171, + 172, 174, 175, 180, 191, 207, 219, 224, 231, 240, + 249, 259, 269, 280, 281, 284, 285, 288, 289, 292, + 300, 301, 309, 310, 311, 313, 315, 321, 327, 334, + 336, 338, 339, 340, 343, 348, 351, 354, 360, 363, + 371, 374, 381, 387, 388, 389, 390, 391, 392, 393, + 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, + 404, 405, 406, 407, 408, 411, 412, 413, 414, 415, + 417, 420, 421, 432, 433, 434, 435, 440, 446, 453, + 454, 455, 456, 459, 460, 461, 489, 489, 495, 498, + 498, 504, 505, 506, 507, 509, 513, 521, 522, 523 }; #endif @@ -615,17 +622,17 @@ static const yytype_uint16 yyrline[] = First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "CASTREF", "UNARY", "VOID", "VAR", "INT", - "THEENTITY", "THEENTITYWITHID", "FLOAT", "BLTIN", "BLTINNOARGS", "ID", - "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", "tWHEN", "tWITH", "tWHILE", "tNLELSE", - "tFACTORY", "tMETHOD", "tGE", "tLE", "tGT", "tLT", "tEQ", "tNEQ", "tAND", - "tOR", "tNOT", "tCONCAT", "tCONTAINS", "tSTARTS", "tSPRITE", - "tINTERSECTS", "tWITHIN", "'='", "'+'", "'-'", "'*'", "'/'", "'%'", - "'\\n'", "'('", "')'", "'>'", "'<'", "'&'", "','", "$accept", "program", - "nl", "programline", "asgn", "stmtoneliner", "stmt", "ifstmt", + "$end", "error", "$undefined", "CASTREF", "UNARY", "VOID", "VAR", + "POINT", "RECT", "ARRAY", "INT", "THEENTITY", "THEENTITYWITHID", "FLOAT", + "BLTIN", "BLTINNOARGS", "ID", "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", "tWHEN", "tWITH", + "tWHILE", "tNLELSE", "tFACTORY", "tMETHOD", "tGE", "tLE", "tGT", "tLT", + "tEQ", "tNEQ", "tAND", "tOR", "tNOT", "tCONCAT", "tCONTAINS", "tSTARTS", + "tSPRITE", "tINTERSECTS", "tWITHIN", "'='", "'+'", "'-'", "'*'", "'/'", + "'%'", "'\\n'", "'('", "')'", "'>'", "'<'", "'&'", "','", "$accept", + "program", "nl", "programline", "asgn", "stmtoneliner", "stmt", "ifstmt", "elsestmtoneliner", "elseifstmt", "elseifstmtoneliner", "elseifstmtoneliner1", "elseifstmt1", "cond", "repeatwhile", "repeatwith", "if", "elseif", "begin", "end", "stmtlist", "expr", "func", @@ -645,26 +652,26 @@ static const yytype_uint16 yytoknum[] = 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 61, 43, 45, 42, 47, 37, 10, 40, 41, 62, - 60, 38, 44 + 315, 316, 317, 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, 73, 74, 74, 74, 75, 76, 76, 76, 76, - 76, 76, 77, 77, 77, 77, 77, 77, 77, 78, - 78, 79, 79, 79, 79, 79, 79, 80, 80, 80, - 80, 80, 80, 81, 81, 82, 82, 83, 83, 84, - 85, 85, 86, 86, 86, 87, 88, 89, 90, 91, - 92, 93, 93, 93, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 95, 95, 95, 95, 95, - 95, 96, 96, 97, 97, 97, 97, 97, 97, 98, - 98, 98, 98, 99, 99, 99, 101, 100, 100, 102, - 100, 103, 103, 103, 103, 104, 105, 106, 106, 106 + 0, 76, 77, 77, 77, 78, 79, 79, 79, 79, + 79, 79, 80, 80, 80, 80, 80, 80, 80, 81, + 81, 82, 82, 82, 82, 82, 82, 83, 83, 83, + 83, 83, 83, 84, 84, 85, 85, 86, 86, 87, + 88, 88, 89, 89, 89, 90, 91, 92, 93, 94, + 95, 96, 96, 96, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 98, 98, 98, 98, 98, + 98, 99, 99, 100, 100, 100, 100, 100, 100, 101, + 101, 101, 101, 102, 102, 102, 104, 103, 103, 105, + 103, 106, 106, 106, 106, 107, 108, 109, 109, 109 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -731,41 +738,41 @@ static const yytype_int16 yydefgoto[] = #define YYPACT_NINF -192 static const yytype_int16 yypact[] = { - 210, -49, -192, -192, 434, -192, -43, -192, 644, -192, - -192, 35, 146, -192, 41, 20, 54, 434, 25, 50, - 59, 60, 66, 434, 434, 434, 434, 434, 10, -192, - 11, -192, -192, -192, 13, 14, 466, 622, -192, -192, - -192, -192, -192, 16, 434, -192, 622, 434, 434, 434, - -192, 33, -192, 68, -192, 73, -192, 80, -192, 1, - 15, -192, -192, -192, -192, 480, 101, -192, -20, 434, - -18, 82, -192, -192, 61, 524, 61, 61, 573, -192, - -192, 271, 466, 434, 466, 83, 600, 434, 434, 434, - 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, - 434, 434, 480, 622, -11, -4, 51, 121, -192, -192, - 122, -192, 126, 127, 112, -192, -192, 130, -192, 434, - 434, 502, 434, 434, 434, -192, 434, 434, -192, -192, - 76, 622, 78, 546, 81, 434, 622, 622, 622, 622, - 622, 622, 622, 622, 266, 266, 61, 61, 622, 622, - 622, -192, 434, -192, -192, -192, -192, -192, 136, -192, - 622, 622, 434, 434, 622, 622, 622, 136, 622, 622, - -192, 5, -192, -192, 404, 622, 622, -192, -10, 622, - 622, -10, 332, 113, 434, 332, -192, -192, 137, 85, - 85, -192, -192, 134, 434, 622, -5, -9, -192, 145, - -192, -192, 124, 622, -192, 138, -192, 143, -192, -192, - 143, -192, 466, -192, 332, 332, -192, -192, 332, -192, - 332, 143, 143, -192, 466, 404, -192, 128, 129, 332, - 149, 150, -192, 156, 144, -192, -192, -192, -192, 161, - 148, 163, 167, -6, -192, 404, -192, 368, 157, -192, - -192, -192, 332, -192, -192, -192, -192, -192 + 223, -52, -192, -192, 447, -192, -46, -192, 657, -192, + -192, 16, 143, -192, 18, 28, 32, 447, 33, 50, + 37, 40, 42, 447, 447, 447, 447, 447, 10, -192, + 11, -192, -192, -192, -6, 4, 479, 635, -192, -192, + -192, -192, -192, 17, 447, -192, 635, 447, 447, 447, + -192, -5, -192, 57, -192, 88, -192, 77, -192, 30, + 24, -192, -192, -192, -192, 493, 98, -192, -23, 447, + -21, 79, -192, -192, 58, 537, 58, 58, 586, -192, + -192, 284, 479, 447, 479, 80, 613, 447, 447, 447, + 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, + 447, 447, 493, 635, -3, -2, 48, 118, -192, -192, + 119, -192, 123, 124, 109, -192, -192, 127, -192, 447, + 447, 515, 447, 447, 447, -192, 447, 447, -192, -192, + 73, 635, 75, 559, 78, 447, 635, 635, 635, 635, + 635, 635, 635, 635, 279, 279, 58, 58, 635, 635, + 635, -192, 447, -192, -192, -192, -192, -192, 133, -192, + 635, 635, 447, 447, 635, 635, 635, 133, 635, 635, + -192, 3, -192, -192, 417, 635, 635, -192, -54, 635, + 635, -54, 345, 110, 447, 345, -192, -192, 134, 82, + 82, -192, -192, 131, 447, 635, -8, -12, -192, 142, + -192, -192, 121, 635, -192, 135, -192, 140, -192, -192, + 140, -192, 479, -192, 345, 345, -192, -192, 345, -192, + 345, 140, 140, -192, 479, 417, -192, 125, 126, 345, + 146, 147, -192, 153, 141, -192, -192, -192, -192, 158, + 145, 160, 164, -9, -192, 417, -192, 381, 154, -192, + -192, -192, 345, -192, -192, -192, -192, -192 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -192, -192, -26, 104, 7, -170, 0, -192, -192, -192, - -3, -178, -28, -79, -192, -192, -192, -191, -7, -47, - -165, 2, 23, -192, -192, -192, 135, -192, -192, -192, - 30, 8, -192, 21 + -4, -179, -27, -79, -192, -192, -192, -191, -7, -47, + -165, 2, 23, -192, -192, -192, 137, -192, -192, -192, + 31, 5, -192, 34 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -776,16 +783,16 @@ static const yytype_int16 yypgoto[] = static const yytype_int16 yytable[] = { 32, 49, 81, 130, 186, 132, 46, 30, 185, 208, - 79, -10, -51, -51, 205, 111, 224, 42, 119, 65, - 122, 183, 112, 38, 47, 74, 75, 76, 77, 78, - 224, 113, 226, 209, 63, 214, 215, 206, 86, 218, - 120, 220, 123, 184, 226, 55, 102, 57, 50, 103, - 103, 103, 229, 114, 62, 235, 80, 151, 68, 69, - -51, 152, 188, 70, 153, 66, 67, 64, 152, 105, - 106, 121, 71, 72, 83, 253, 80, -10, 252, 73, - 82, 32, 108, 48, 86, 131, 133, 109, 30, 136, + 79, -10, -51, -51, 205, 80, 224, 42, 119, 65, + 122, 188, 183, 38, 47, 74, 75, 76, 77, 78, + 224, 226, 50, 209, 62, 214, 215, 206, 86, 218, + 120, 220, 123, 226, 184, 63, 102, 111, 64, 103, + 103, 103, 229, 71, 112, 235, 72, 55, 73, 57, + -51, 68, 69, 113, 82, 114, 70, 83, 151, 153, + 107, 121, 152, 152, 108, 253, 66, 67, 252, 80, + -10, 32, 105, 106, 86, 131, 133, 48, 30, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 38, 107, 87, 88, 173, 158, + 147, 148, 149, 150, 38, 109, 87, 88, 173, 158, 110, 89, 90, 91, 118, 92, 93, 94, 167, 124, 134, 160, 161, 152, 164, 165, 166, 174, 168, 169, 99, 100, 101, 228, 154, 193, 155, 175, 196, 197, @@ -794,167 +801,171 @@ static const yytype_int16 yytable[] = 52, 208, 219, 227, 179, 180, 238, 53, 240, 241, 236, 230, 54, 231, 233, 242, 55, 56, 57, 58, 248, 243, 239, 249, 59, 129, 195, 250, 244, 207, - 246, 251, 255, 232, 210, 115, 203, 181, 201, 0, + 246, 251, 255, 210, 232, 201, 203, 115, 181, 0, 0, 0, 225, 0, 0, 256, 0, 257, 0, 0, - -6, 1, 0, 0, 86, 0, 0, 2, 3, 4, - 5, 6, 7, 8, 9, 0, 86, 0, 0, 245, - 10, 0, 11, 12, 13, 0, 0, 14, 15, 16, - 0, 0, 0, 0, 17, 18, 19, 254, 0, 20, - 0, 0, 0, 21, 22, 0, 0, 0, 0, 0, - 0, 0, 0, 23, 0, 0, 0, 24, 0, 0, - 0, 25, 26, 0, 0, 0, -6, 27, 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, 87, 88, 0, 21, 22, 89, 90, 91, 0, - 92, 93, 94, 0, 23, 0, 0, 0, 24, 97, - 98, 0, 25, 26, 0, 99, 100, 101, 27, 2, - 3, 4, 5, 6, 7, 43, 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, 2, 3, 4, 5, 6, - 7, 43, 9, 0, 0, 23, 0, 0, 10, 24, - 11, 12, 13, 25, 26, 0, 15, 16, 80, 27, + 0, 0, 0, 0, 86, 0, 0, 0, 0, 0, + 0, 0, 0, -6, 1, 0, 86, 0, 0, 245, + 0, 0, 0, 2, 3, 4, 5, 6, 7, 8, + 9, 0, 0, 0, 0, 0, 10, 254, 11, 12, + 13, 0, 0, 14, 15, 16, 0, 0, 0, 0, + 17, 18, 19, 0, 0, 20, 0, 0, 0, 21, + 22, 0, 0, 0, 0, 0, 0, 0, 0, 23, + 0, 0, 0, 24, 0, 0, 0, 25, 26, 0, + 0, 0, -6, 27, 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, 87, 88, 0, + 21, 22, 89, 90, 91, 0, 92, 93, 94, 0, + 23, 0, 0, 0, 24, 97, 98, 0, 25, 26, + 0, 99, 100, 101, 27, 2, 3, 4, 5, 6, + 7, 43, 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, 2, 3, 4, 5, 6, 7, 43, 9, 0, - 0, 23, 0, 0, 10, 24, 11, 12, 0, 25, - 26, 0, 15, 16, 0, 27, 0, 0, 17, 0, - 19, 2, 3, 4, 5, 6, 7, 43, 9, 0, - 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, - 0, 24, 0, 0, 0, 25, 26, 0, 44, 0, - 19, 27, 0, 2, 3, 4, 5, 6, 7, 43, - 9, 0, 0, 0, 0, 0, 0, 23, 0, 0, - 0, 24, 0, 0, 0, 25, 26, 0, 0, 0, - 44, 27, 19, 0, 0, 117, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, - 0, 0, 0, 24, 0, 87, 88, 25, 26, 0, - 89, 90, 91, 84, 92, 93, 94, 0, 0, 0, - 162, 95, 96, 97, 98, 0, 0, 87, 88, 99, + 0, 23, 0, 0, 10, 24, 11, 12, 13, 25, + 26, 0, 15, 16, 80, 27, 0, 0, 17, 18, + 19, 0, 0, 20, 0, 0, 0, 2, 3, 4, + 5, 6, 7, 43, 9, 0, 0, 23, 0, 0, + 10, 24, 11, 12, 0, 25, 26, 0, 15, 16, + 0, 27, 0, 0, 17, 0, 19, 2, 3, 4, + 5, 6, 7, 43, 9, 0, 0, 0, 0, 0, + 0, 0, 0, 23, 0, 0, 0, 24, 0, 0, + 0, 25, 26, 0, 44, 0, 19, 27, 0, 2, + 3, 4, 5, 6, 7, 43, 9, 0, 0, 0, + 0, 0, 0, 23, 0, 0, 0, 24, 0, 0, + 0, 25, 26, 0, 0, 0, 44, 27, 19, 0, + 0, 117, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 23, 0, 0, 0, 24, + 0, 87, 88, 25, 26, 0, 89, 90, 91, 84, + 92, 93, 94, 0, 0, 0, 162, 95, 96, 97, + 98, 0, 0, 87, 88, 99, 100, 101, 89, 90, + 91, 0, 92, 93, 94, 0, 0, 0, 163, 95, + 96, 97, 98, 0, 0, 87, 88, 99, 100, 101, + 89, 90, 91, 0, 92, 93, 94, 0, 126, 127, + 0, 95, 96, 97, 98, 0, 0, 87, 88, 99, 100, 101, 89, 90, 91, 0, 92, 93, 94, 0, - 0, 0, 163, 95, 96, 97, 98, 0, 0, 87, - 88, 99, 100, 101, 89, 90, 91, 0, 92, 93, - 94, 0, 126, 127, 0, 95, 96, 97, 98, 0, - 0, 87, 88, 99, 100, 101, 89, 90, 91, 0, + 0, 0, 135, 95, 96, 97, 98, 0, 0, 0, + 128, 99, 100, 101, 87, 88, 0, 0, 0, 89, + 90, 91, 0, 92, 93, 94, 0, 0, 0, 0, + 95, 96, 97, 98, 0, 0, 0, 128, 99, 100, + 101, 87, 88, 0, 0, 0, 89, 90, 91, 0, 92, 93, 94, 0, 0, 0, 135, 95, 96, 97, - 98, 0, 0, 0, 128, 99, 100, 101, 87, 88, - 0, 0, 0, 89, 90, 91, 0, 92, 93, 94, - 0, 0, 0, 0, 95, 96, 97, 98, 0, 0, - 0, 128, 99, 100, 101, 87, 88, 0, 0, 0, - 89, 90, 91, 0, 92, 93, 94, 0, 0, 0, - 135, 95, 96, 97, 98, 0, 0, 87, 88, 99, - 100, 101, 89, 90, 91, 0, 92, 93, 94, 0, - 0, 0, 0, 95, 96, 97, 98, 0, 0, -60, - -60, 99, 100, 101, -60, -60, -60, 0, -60, -60, - -60, 0, 0, 0, 0, 0, 0, -60, -60, 0, - 0, 48, 0, -60, -60, -60 + 98, 0, 0, 87, 88, 99, 100, 101, 89, 90, + 91, 0, 92, 93, 94, 0, 0, 0, 0, 95, + 96, 97, 98, 0, 0, -60, -60, 99, 100, 101, + -60, -60, -60, 0, -60, -60, -60, 0, 0, 0, + 0, 0, 0, -60, -60, 0, 0, 48, 0, -60, + -60, -60 }; static const yytype_int16 yycheck[] = { - 0, 8, 28, 82, 174, 84, 4, 0, 173, 18, - 0, 0, 18, 19, 19, 14, 207, 66, 38, 17, - 38, 16, 21, 0, 67, 23, 24, 25, 26, 27, - 221, 30, 210, 42, 14, 200, 201, 42, 36, 204, - 60, 206, 60, 38, 222, 30, 44, 32, 13, 47, - 48, 49, 217, 38, 13, 225, 66, 68, 8, 9, - 66, 72, 72, 13, 68, 40, 41, 13, 72, 48, - 49, 69, 13, 13, 60, 245, 66, 66, 243, 13, - 67, 81, 14, 67, 82, 83, 84, 14, 81, 87, + 0, 8, 28, 82, 174, 84, 4, 0, 173, 21, + 0, 0, 21, 22, 22, 69, 207, 69, 41, 17, + 41, 75, 19, 0, 70, 23, 24, 25, 26, 27, + 221, 210, 16, 45, 16, 200, 201, 45, 36, 204, + 63, 206, 63, 222, 41, 17, 44, 17, 16, 47, + 48, 49, 217, 16, 24, 225, 16, 33, 16, 35, + 69, 11, 12, 33, 70, 41, 16, 63, 71, 71, + 75, 69, 75, 75, 17, 245, 43, 44, 243, 69, + 69, 81, 48, 49, 82, 83, 84, 70, 81, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 81, 72, 45, 46, 134, 116, - 30, 50, 51, 52, 13, 54, 55, 56, 125, 37, - 37, 119, 120, 72, 122, 123, 124, 134, 126, 127, - 69, 70, 71, 212, 13, 182, 14, 135, 185, 186, - 14, 14, 30, 13, 68, 224, 68, 66, 195, 13, - 13, 38, 178, 19, 152, 181, 203, 72, 13, 35, - 14, 18, 24, 210, 162, 163, 37, 21, 19, 19, - 42, 218, 26, 220, 221, 19, 30, 31, 32, 33, - 19, 37, 229, 35, 38, 81, 184, 24, 235, 196, - 237, 24, 35, 221, 197, 60, 194, 167, 190, -1, + 98, 99, 100, 101, 81, 17, 48, 49, 134, 116, + 33, 53, 54, 55, 16, 57, 58, 59, 125, 40, + 40, 119, 120, 75, 122, 123, 124, 134, 126, 127, + 72, 73, 74, 212, 16, 182, 17, 135, 185, 186, + 17, 17, 33, 16, 71, 224, 71, 69, 195, 16, + 16, 41, 178, 22, 152, 181, 203, 75, 16, 38, + 17, 21, 27, 210, 162, 163, 40, 24, 22, 22, + 45, 218, 29, 220, 221, 22, 33, 34, 35, 36, + 22, 40, 229, 38, 41, 81, 184, 27, 235, 196, + 237, 27, 38, 197, 221, 190, 194, 60, 167, -1, -1, -1, 209, -1, -1, 252, -1, 254, -1, -1, - 0, 1, -1, -1, 212, -1, -1, 7, 8, 9, - 10, 11, 12, 13, 14, -1, 224, -1, -1, 236, - 20, -1, 22, 23, 24, -1, -1, 27, 28, 29, - -1, -1, -1, -1, 34, 35, 36, 247, -1, 39, - -1, -1, -1, 43, 44, -1, -1, -1, -1, -1, - -1, -1, -1, 53, -1, -1, -1, 57, -1, -1, - -1, 61, 62, -1, -1, -1, 66, 67, 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, -1, -1, 57, 63, - 64, -1, 61, 62, -1, 69, 70, 71, 67, 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, 7, 8, 9, 10, 11, - 12, 13, 14, -1, -1, 53, -1, -1, 20, 57, - 22, 23, 24, 61, 62, -1, 28, 29, 66, 67, - -1, -1, 34, 35, 36, -1, -1, 39, -1, -1, - -1, 7, 8, 9, 10, 11, 12, 13, 14, -1, - -1, 53, -1, -1, 20, 57, 22, 23, -1, 61, - 62, -1, 28, 29, -1, 67, -1, -1, 34, -1, - 36, 7, 8, 9, 10, 11, 12, 13, 14, -1, - -1, -1, -1, -1, -1, -1, -1, 53, -1, -1, - -1, 57, -1, -1, -1, 61, 62, -1, 34, -1, - 36, 67, -1, 7, 8, 9, 10, 11, 12, 13, - 14, -1, -1, -1, -1, -1, -1, 53, -1, -1, - -1, 57, -1, -1, -1, 61, 62, -1, -1, -1, - 34, 67, 36, -1, -1, 25, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, - -1, -1, -1, 57, -1, 45, 46, 61, 62, -1, - 50, 51, 52, 67, 54, 55, 56, -1, -1, -1, - 38, 61, 62, 63, 64, -1, -1, 45, 46, 69, - 70, 71, 50, 51, 52, -1, 54, 55, 56, -1, - -1, -1, 60, 61, 62, 63, 64, -1, -1, 45, - 46, 69, 70, 71, 50, 51, 52, -1, 54, 55, - 56, -1, 58, 59, -1, 61, 62, 63, 64, -1, - -1, 45, 46, 69, 70, 71, 50, 51, 52, -1, - 54, 55, 56, -1, -1, -1, 60, 61, 62, 63, - 64, -1, -1, -1, 68, 69, 70, 71, 45, 46, - -1, -1, -1, 50, 51, 52, -1, 54, 55, 56, - -1, -1, -1, -1, 61, 62, 63, 64, -1, -1, - -1, 68, 69, 70, 71, 45, 46, -1, -1, -1, - 50, 51, 52, -1, 54, 55, 56, -1, -1, -1, - 60, 61, 62, 63, 64, -1, -1, 45, 46, 69, - 70, 71, 50, 51, 52, -1, 54, 55, 56, -1, - -1, -1, -1, 61, 62, 63, 64, -1, -1, 45, - 46, 69, 70, 71, 50, 51, 52, -1, 54, 55, - 56, -1, -1, -1, -1, -1, -1, 63, 64, -1, - -1, 67, -1, 69, 70, 71 + -1, -1, -1, -1, 212, -1, -1, -1, -1, -1, + -1, -1, -1, 0, 1, -1, 224, -1, -1, 236, + -1, -1, -1, 10, 11, 12, 13, 14, 15, 16, + 17, -1, -1, -1, -1, -1, 23, 247, 25, 26, + 27, -1, -1, 30, 31, 32, -1, -1, -1, -1, + 37, 38, 39, -1, -1, 42, -1, -1, -1, 46, + 47, -1, -1, -1, -1, -1, -1, -1, -1, 56, + -1, -1, -1, 60, -1, -1, -1, 64, 65, -1, + -1, -1, 69, 70, 10, 11, 12, 13, 14, 15, + 16, 17, -1, -1, -1, -1, -1, 23, -1, 25, + 26, 27, -1, -1, 30, 31, 32, -1, -1, -1, + -1, 37, 38, 39, -1, -1, 42, 48, 49, -1, + 46, 47, 53, 54, 55, -1, 57, 58, 59, -1, + 56, -1, -1, -1, 60, 66, 67, -1, 64, 65, + -1, 72, 73, 74, 70, 10, 11, 12, 13, 14, + 15, 16, 17, -1, -1, -1, -1, -1, 23, -1, + 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, + -1, -1, 37, 38, 39, -1, -1, 42, -1, -1, + -1, 10, 11, 12, 13, 14, 15, 16, 17, -1, + -1, 56, -1, -1, 23, 60, 25, 26, 27, 64, + 65, -1, 31, 32, 69, 70, -1, -1, 37, 38, + 39, -1, -1, 42, -1, -1, -1, 10, 11, 12, + 13, 14, 15, 16, 17, -1, -1, 56, -1, -1, + 23, 60, 25, 26, -1, 64, 65, -1, 31, 32, + -1, 70, -1, -1, 37, -1, 39, 10, 11, 12, + 13, 14, 15, 16, 17, -1, -1, -1, -1, -1, + -1, -1, -1, 56, -1, -1, -1, 60, -1, -1, + -1, 64, 65, -1, 37, -1, 39, 70, -1, 10, + 11, 12, 13, 14, 15, 16, 17, -1, -1, -1, + -1, -1, -1, 56, -1, -1, -1, 60, -1, -1, + -1, 64, 65, -1, -1, -1, 37, 70, 39, -1, + -1, 28, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 56, -1, -1, -1, 60, + -1, 48, 49, 64, 65, -1, 53, 54, 55, 70, + 57, 58, 59, -1, -1, -1, 41, 64, 65, 66, + 67, -1, -1, 48, 49, 72, 73, 74, 53, 54, + 55, -1, 57, 58, 59, -1, -1, -1, 63, 64, + 65, 66, 67, -1, -1, 48, 49, 72, 73, 74, + 53, 54, 55, -1, 57, 58, 59, -1, 61, 62, + -1, 64, 65, 66, 67, -1, -1, 48, 49, 72, + 73, 74, 53, 54, 55, -1, 57, 58, 59, -1, + -1, -1, 63, 64, 65, 66, 67, -1, -1, -1, + 71, 72, 73, 74, 48, 49, -1, -1, -1, 53, + 54, 55, -1, 57, 58, 59, -1, -1, -1, -1, + 64, 65, 66, 67, -1, -1, -1, 71, 72, 73, + 74, 48, 49, -1, -1, -1, 53, 54, 55, -1, + 57, 58, 59, -1, -1, -1, 63, 64, 65, 66, + 67, -1, -1, 48, 49, 72, 73, 74, 53, 54, + 55, -1, 57, 58, 59, -1, -1, -1, -1, 64, + 65, 66, 67, -1, -1, 48, 49, 72, 73, 74, + 53, 54, 55, -1, 57, 58, 59, -1, -1, -1, + -1, -1, -1, 66, 67, -1, -1, 70, -1, 72, + 73, 74 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ 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, - 39, 43, 44, 53, 57, 61, 62, 67, 74, 76, - 77, 78, 79, 80, 87, 88, 89, 94, 95, 97, - 100, 105, 66, 13, 34, 77, 94, 67, 67, 91, - 13, 96, 14, 21, 26, 30, 31, 32, 33, 38, - 98, 99, 13, 14, 13, 94, 40, 41, 8, 9, - 13, 13, 13, 13, 94, 94, 94, 94, 94, 0, - 66, 75, 67, 60, 67, 86, 94, 45, 46, 50, - 51, 52, 54, 55, 56, 61, 62, 63, 64, 69, - 70, 71, 94, 94, 106, 106, 106, 72, 14, 14, - 30, 14, 21, 30, 38, 99, 101, 25, 13, 38, - 60, 94, 38, 60, 37, 102, 58, 59, 68, 76, - 86, 94, 86, 94, 37, 60, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 68, 72, 68, 13, 14, 14, 14, 91, 13, - 94, 94, 38, 60, 94, 94, 94, 91, 94, 94, - 68, 92, 68, 75, 91, 94, 94, 13, 103, 94, - 94, 103, 93, 16, 38, 93, 78, 95, 72, 75, - 75, 75, 79, 92, 38, 94, 92, 92, 13, 72, - 104, 104, 19, 94, 92, 19, 42, 91, 18, 42, - 83, 84, 90, 13, 93, 93, 35, 92, 93, 24, - 93, 82, 83, 85, 90, 91, 84, 92, 86, 93, - 92, 92, 85, 92, 86, 78, 42, 81, 37, 92, - 19, 19, 19, 37, 92, 91, 92, 91, 19, 35, - 24, 24, 93, 78, 79, 35, 92, 92 + 0, 1, 10, 11, 12, 13, 14, 15, 16, 17, + 23, 25, 26, 27, 30, 31, 32, 37, 38, 39, + 42, 46, 47, 56, 60, 64, 65, 70, 77, 79, + 80, 81, 82, 83, 90, 91, 92, 97, 98, 100, + 103, 108, 69, 16, 37, 80, 97, 70, 70, 94, + 16, 99, 17, 24, 29, 33, 34, 35, 36, 41, + 101, 102, 16, 17, 16, 97, 43, 44, 11, 12, + 16, 16, 16, 16, 97, 97, 97, 97, 97, 0, + 69, 78, 70, 63, 70, 89, 97, 48, 49, 53, + 54, 55, 57, 58, 59, 64, 65, 66, 67, 72, + 73, 74, 97, 97, 109, 109, 109, 75, 17, 17, + 33, 17, 24, 33, 41, 102, 104, 28, 16, 41, + 63, 97, 41, 63, 40, 105, 61, 62, 71, 79, + 89, 97, 89, 97, 40, 63, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, + 97, 71, 75, 71, 16, 17, 17, 17, 94, 16, + 97, 97, 41, 63, 97, 97, 97, 94, 97, 97, + 71, 95, 71, 78, 94, 97, 97, 16, 106, 97, + 97, 106, 96, 19, 41, 96, 81, 98, 75, 78, + 78, 78, 82, 95, 41, 97, 95, 95, 16, 75, + 107, 107, 22, 97, 95, 22, 45, 94, 21, 45, + 86, 87, 93, 16, 96, 96, 38, 95, 96, 27, + 96, 85, 86, 88, 93, 94, 87, 95, 89, 96, + 95, 95, 88, 95, 89, 81, 45, 84, 40, 95, + 22, 22, 22, 40, 95, 94, 95, 94, 22, 38, + 27, 27, 96, 81, 82, 38, 95, 95 }; #define yyerrok (yyerrstatus = 0) @@ -1769,12 +1780,12 @@ yyreduce: switch (yyn) { case 4: -#line 103 "engines/director/lingo/lingo-gr.y" +#line 104 "engines/director/lingo/lingo-gr.y" { yyerrok; ;} break; case 5: -#line 106 "engines/director/lingo/lingo-gr.y" +#line 107 "engines/director/lingo/lingo-gr.y" { g_lingo->_linenumber++; g_lingo->_colnumber = 1; @@ -1782,12 +1793,12 @@ yyreduce: break; case 10: -#line 115 "engines/director/lingo/lingo-gr.y" +#line 116 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_xpop); ;} break; case 12: -#line 119 "engines/director/lingo/lingo-gr.y" +#line 120 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_varpush); g_lingo->codeString((yyvsp[(4) - (4)].s)->c_str()); @@ -1797,7 +1808,7 @@ yyreduce: break; case 13: -#line 125 "engines/director/lingo/lingo-gr.y" +#line 126 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_varpush); g_lingo->codeString((yyvsp[(2) - (4)].s)->c_str()); @@ -1807,7 +1818,7 @@ yyreduce: break; case 14: -#line 131 "engines/director/lingo/lingo-gr.y" +#line 132 "engines/director/lingo/lingo-gr.y" { g_lingo->code2(g_lingo->c_constpush, 0); // Put dummy id g_lingo->code1(g_lingo->c_theentityassign); @@ -1819,7 +1830,7 @@ yyreduce: break; case 15: -#line 139 "engines/director/lingo/lingo-gr.y" +#line 140 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_swap); g_lingo->code1(g_lingo->c_theentityassign); @@ -1831,7 +1842,7 @@ yyreduce: break; case 16: -#line 147 "engines/director/lingo/lingo-gr.y" +#line 148 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_varpush); g_lingo->codeString((yyvsp[(2) - (4)].s)->c_str()); @@ -1841,7 +1852,7 @@ yyreduce: break; case 17: -#line 153 "engines/director/lingo/lingo-gr.y" +#line 154 "engines/director/lingo/lingo-gr.y" { g_lingo->code2(g_lingo->c_constpush, 0); // Put dummy id g_lingo->code1(g_lingo->c_theentityassign); @@ -1853,7 +1864,7 @@ yyreduce: break; case 18: -#line 161 "engines/director/lingo/lingo-gr.y" +#line 162 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_swap); g_lingo->code1(g_lingo->c_theentityassign); @@ -1865,12 +1876,12 @@ yyreduce: break; case 19: -#line 170 "engines/director/lingo/lingo-gr.y" +#line 171 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_xpop); ;} break; case 23: -#line 179 "engines/director/lingo/lingo-gr.y" +#line 180 "engines/director/lingo/lingo-gr.y" { inst body = 0, end = 0; WRITE_UINT32(&body, (yyvsp[(5) - (8)].code)); @@ -1880,7 +1891,7 @@ yyreduce: break; case 24: -#line 190 "engines/director/lingo/lingo-gr.y" +#line 191 "engines/director/lingo/lingo-gr.y" { inst init = 0, finish = 0, body = 0, end = 0, inc = 0; WRITE_UINT32(&init, (yyvsp[(3) - (11)].code)); @@ -1896,7 +1907,7 @@ yyreduce: break; case 25: -#line 206 "engines/director/lingo/lingo-gr.y" +#line 207 "engines/director/lingo/lingo-gr.y" { inst init = 0, finish = 0, body = 0, end = 0, inc = 0; WRITE_UINT32(&init, (yyvsp[(3) - (12)].code)); @@ -1912,14 +1923,14 @@ yyreduce: break; case 26: -#line 218 "engines/director/lingo/lingo-gr.y" +#line 219 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_ifcode); ;} break; case 27: -#line 223 "engines/director/lingo/lingo-gr.y" +#line 224 "engines/director/lingo/lingo-gr.y" { inst then = 0, end = 0; WRITE_UINT32(&then, (yyvsp[(5) - (8)].code)); @@ -1930,7 +1941,7 @@ yyreduce: break; case 28: -#line 230 "engines/director/lingo/lingo-gr.y" +#line 231 "engines/director/lingo/lingo-gr.y" { inst then = 0, else1 = 0, end = 0; WRITE_UINT32(&then, (yyvsp[(5) - (11)].code)); @@ -1943,7 +1954,7 @@ yyreduce: break; case 29: -#line 239 "engines/director/lingo/lingo-gr.y" +#line 240 "engines/director/lingo/lingo-gr.y" { inst then = 0, else1 = 0, end = 0; WRITE_UINT32(&then, (yyvsp[(5) - (11)].code)); @@ -1956,7 +1967,7 @@ yyreduce: break; case 30: -#line 248 "engines/director/lingo/lingo-gr.y" +#line 249 "engines/director/lingo/lingo-gr.y" { inst then = 0, else1 = 0, end = 0; WRITE_UINT32(&then, (yyvsp[(4) - (6)].code)); @@ -1970,7 +1981,7 @@ yyreduce: break; case 31: -#line 258 "engines/director/lingo/lingo-gr.y" +#line 259 "engines/director/lingo/lingo-gr.y" { inst then = 0, else1 = 0, end = 0; WRITE_UINT32(&then, (yyvsp[(4) - (10)].code)); @@ -1984,7 +1995,7 @@ yyreduce: break; case 32: -#line 268 "engines/director/lingo/lingo-gr.y" +#line 269 "engines/director/lingo/lingo-gr.y" { inst then = 0, else1 = 0, end = 0; WRITE_UINT32(&then, (yyvsp[(4) - (10)].code)); @@ -1998,17 +2009,17 @@ yyreduce: break; case 33: -#line 279 "engines/director/lingo/lingo-gr.y" +#line 280 "engines/director/lingo/lingo-gr.y" { (yyval.code) = 0; ;} break; case 34: -#line 280 "engines/director/lingo/lingo-gr.y" +#line 281 "engines/director/lingo/lingo-gr.y" { (yyval.code) = (yyvsp[(2) - (3)].code); ;} break; case 39: -#line 291 "engines/director/lingo/lingo-gr.y" +#line 292 "engines/director/lingo/lingo-gr.y" { inst then = 0; WRITE_UINT32(&then, (yyvsp[(4) - (6)].code)); @@ -2018,7 +2029,7 @@ yyreduce: break; case 41: -#line 300 "engines/director/lingo/lingo-gr.y" +#line 301 "engines/director/lingo/lingo-gr.y" { inst then = 0; WRITE_UINT32(&then, (yyvsp[(4) - (5)].code)); @@ -2028,22 +2039,22 @@ yyreduce: break; case 42: -#line 308 "engines/director/lingo/lingo-gr.y" +#line 309 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(STOP); ;} break; case 43: -#line 309 "engines/director/lingo/lingo-gr.y" +#line 310 "engines/director/lingo/lingo-gr.y" { g_lingo->code2(g_lingo->c_eq, STOP); ;} break; case 45: -#line 312 "engines/director/lingo/lingo-gr.y" +#line 313 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code3(g_lingo->c_repeatwhilecode, STOP, STOP); ;} break; case 46: -#line 314 "engines/director/lingo/lingo-gr.y" +#line 315 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code3(g_lingo->c_repeatwithcode, STOP, STOP); g_lingo->code3(STOP, STOP, STOP); @@ -2052,7 +2063,7 @@ yyreduce: break; case 47: -#line 320 "engines/director/lingo/lingo-gr.y" +#line 321 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_ifcode); g_lingo->code3(STOP, STOP, STOP); @@ -2061,7 +2072,7 @@ yyreduce: break; case 48: -#line 326 "engines/director/lingo/lingo-gr.y" +#line 327 "engines/director/lingo/lingo-gr.y" { inst skipEnd; WRITE_UINT32(&skipEnd, 1); // We have to skip end to avoid multiple executions @@ -2071,22 +2082,22 @@ yyreduce: break; case 49: -#line 333 "engines/director/lingo/lingo-gr.y" +#line 334 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->_currentScript->size(); ;} break; case 50: -#line 335 "engines/director/lingo/lingo-gr.y" +#line 336 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(STOP); (yyval.code) = g_lingo->_currentScript->size(); ;} break; case 51: -#line 337 "engines/director/lingo/lingo-gr.y" +#line 338 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->_currentScript->size(); ;} break; case 54: -#line 342 "engines/director/lingo/lingo-gr.y" +#line 343 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_constpush); inst i = 0; @@ -2095,21 +2106,21 @@ yyreduce: break; case 55: -#line 347 "engines/director/lingo/lingo-gr.y" +#line 348 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_fconstpush); g_lingo->codeFloat((yyvsp[(1) - (1)].f)); ;} break; case 56: -#line 350 "engines/director/lingo/lingo-gr.y" +#line 351 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_stringpush); g_lingo->codeString((yyvsp[(1) - (1)].s)->c_str()); ;} break; case 57: -#line 353 "engines/director/lingo/lingo-gr.y" +#line 354 "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)); @@ -2119,14 +2130,14 @@ yyreduce: break; case 58: -#line 359 "engines/director/lingo/lingo-gr.y" +#line 360 "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 59: -#line 362 "engines/director/lingo/lingo-gr.y" +#line 363 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_call); g_lingo->codeString((yyvsp[(1) - (4)].s)->c_str()); @@ -2138,14 +2149,14 @@ yyreduce: break; case 60: -#line 370 "engines/director/lingo/lingo-gr.y" +#line 371 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->codeId(*(yyvsp[(1) - (1)].s)); delete (yyvsp[(1) - (1)].s); ;} break; case 61: -#line 373 "engines/director/lingo/lingo-gr.y" +#line 374 "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); @@ -2156,7 +2167,7 @@ yyreduce: break; case 62: -#line 380 "engines/director/lingo/lingo-gr.y" +#line 381 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_theentitypush); inst e = 0, f = 0; @@ -2166,158 +2177,158 @@ yyreduce: break; case 64: -#line 387 "engines/director/lingo/lingo-gr.y" +#line 388 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_add); ;} break; case 65: -#line 388 "engines/director/lingo/lingo-gr.y" +#line 389 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_sub); ;} break; case 66: -#line 389 "engines/director/lingo/lingo-gr.y" +#line 390 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_mul); ;} break; case 67: -#line 390 "engines/director/lingo/lingo-gr.y" +#line 391 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_div); ;} break; case 68: -#line 391 "engines/director/lingo/lingo-gr.y" +#line 392 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gt); ;} break; case 69: -#line 392 "engines/director/lingo/lingo-gr.y" +#line 393 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_lt); ;} break; case 70: -#line 393 "engines/director/lingo/lingo-gr.y" +#line 394 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_neq); ;} break; case 71: -#line 394 "engines/director/lingo/lingo-gr.y" +#line 395 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_ge); ;} break; case 72: -#line 395 "engines/director/lingo/lingo-gr.y" +#line 396 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_le); ;} break; case 73: -#line 396 "engines/director/lingo/lingo-gr.y" +#line 397 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_and); ;} break; case 74: -#line 397 "engines/director/lingo/lingo-gr.y" +#line 398 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_or); ;} break; case 75: -#line 398 "engines/director/lingo/lingo-gr.y" +#line 399 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_not); ;} break; case 76: -#line 399 "engines/director/lingo/lingo-gr.y" +#line 400 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_ampersand); ;} break; case 77: -#line 400 "engines/director/lingo/lingo-gr.y" +#line 401 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_concat); ;} break; case 78: -#line 401 "engines/director/lingo/lingo-gr.y" +#line 402 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_contains); ;} break; case 79: -#line 402 "engines/director/lingo/lingo-gr.y" +#line 403 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_starts); ;} break; case 80: -#line 403 "engines/director/lingo/lingo-gr.y" +#line 404 "engines/director/lingo/lingo-gr.y" { (yyval.code) = (yyvsp[(2) - (2)].code); ;} break; case 81: -#line 404 "engines/director/lingo/lingo-gr.y" +#line 405 "engines/director/lingo/lingo-gr.y" { (yyval.code) = (yyvsp[(2) - (2)].code); g_lingo->code1(g_lingo->c_negate); ;} break; case 82: -#line 405 "engines/director/lingo/lingo-gr.y" +#line 406 "engines/director/lingo/lingo-gr.y" { (yyval.code) = (yyvsp[(2) - (3)].code); ;} break; case 83: -#line 406 "engines/director/lingo/lingo-gr.y" +#line 407 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_intersects); ;} break; case 84: -#line 407 "engines/director/lingo/lingo-gr.y" +#line 408 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_within); ;} break; case 85: -#line 410 "engines/director/lingo/lingo-gr.y" +#line 411 "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 86: -#line 411 "engines/director/lingo/lingo-gr.y" +#line 412 "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 87: -#line 412 "engines/director/lingo/lingo-gr.y" +#line 413 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_printtop); ;} break; case 89: -#line 414 "engines/director/lingo/lingo-gr.y" +#line 415 "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 91: -#line 419 "engines/director/lingo/lingo-gr.y" +#line 420 "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 92: -#line 420 "engines/director/lingo/lingo-gr.y" +#line 421 "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 93: -#line 431 "engines/director/lingo/lingo-gr.y" +#line 432 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gotoloop); ;} break; case 94: -#line 432 "engines/director/lingo/lingo-gr.y" +#line 433 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gotonext); ;} break; case 95: -#line 433 "engines/director/lingo/lingo-gr.y" +#line 434 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gotoprevious); ;} break; case 96: -#line 434 "engines/director/lingo/lingo-gr.y" +#line 435 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_goto); g_lingo->codeString((yyvsp[(2) - (2)].s)->c_str()); @@ -2326,7 +2337,7 @@ yyreduce: break; case 97: -#line 439 "engines/director/lingo/lingo-gr.y" +#line 440 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_goto); g_lingo->codeString((yyvsp[(2) - (3)].s)->c_str()); @@ -2336,7 +2347,7 @@ yyreduce: break; case 98: -#line 445 "engines/director/lingo/lingo-gr.y" +#line 446 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_goto); g_lingo->codeString(""); @@ -2345,47 +2356,47 @@ yyreduce: break; case 99: -#line 452 "engines/director/lingo/lingo-gr.y" +#line 453 "engines/director/lingo/lingo-gr.y" { (yyval.s) = (yyvsp[(3) - (3)].s); ;} break; case 100: -#line 453 "engines/director/lingo/lingo-gr.y" +#line 454 "engines/director/lingo/lingo-gr.y" { (yyval.s) = (yyvsp[(2) - (2)].s); ;} break; case 101: -#line 454 "engines/director/lingo/lingo-gr.y" +#line 455 "engines/director/lingo/lingo-gr.y" { (yyval.s) = (yyvsp[(2) - (2)].s); ;} break; case 102: -#line 455 "engines/director/lingo/lingo-gr.y" +#line 456 "engines/director/lingo/lingo-gr.y" { (yyval.s) = (yyvsp[(1) - (1)].s); ;} break; case 103: -#line 458 "engines/director/lingo/lingo-gr.y" +#line 459 "engines/director/lingo/lingo-gr.y" { (yyval.s) = (yyvsp[(3) - (3)].s); ;} break; case 104: -#line 459 "engines/director/lingo/lingo-gr.y" +#line 460 "engines/director/lingo/lingo-gr.y" { (yyval.s) = (yyvsp[(2) - (2)].s); ;} break; case 105: -#line 460 "engines/director/lingo/lingo-gr.y" +#line 461 "engines/director/lingo/lingo-gr.y" { (yyval.s) = (yyvsp[(3) - (3)].s); ;} break; case 106: -#line 488 "engines/director/lingo/lingo-gr.y" +#line 489 "engines/director/lingo/lingo-gr.y" { g_lingo->_indef = true; ;} break; case 107: -#line 489 "engines/director/lingo/lingo-gr.y" +#line 490 "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); @@ -2394,19 +2405,19 @@ yyreduce: break; case 108: -#line 494 "engines/director/lingo/lingo-gr.y" +#line 495 "engines/director/lingo/lingo-gr.y" { g_lingo->codeFactory(*(yyvsp[(2) - (2)].s)); ;} break; case 109: -#line 497 "engines/director/lingo/lingo-gr.y" +#line 498 "engines/director/lingo/lingo-gr.y" { g_lingo->_indef = true; ;} break; case 110: -#line 498 "engines/director/lingo/lingo-gr.y" +#line 499 "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); @@ -2415,32 +2426,32 @@ yyreduce: break; case 111: -#line 503 "engines/director/lingo/lingo-gr.y" +#line 504 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = 0; ;} break; case 112: -#line 504 "engines/director/lingo/lingo-gr.y" +#line 505 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArg((yyvsp[(1) - (1)].s)); (yyval.narg) = 1; ;} break; case 113: -#line 505 "engines/director/lingo/lingo-gr.y" +#line 506 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArg((yyvsp[(3) - (3)].s)); (yyval.narg) = (yyvsp[(1) - (3)].narg) + 1; ;} break; case 114: -#line 506 "engines/director/lingo/lingo-gr.y" +#line 507 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArg((yyvsp[(4) - (4)].s)); (yyval.narg) = (yyvsp[(1) - (4)].narg) + 1; ;} break; case 115: -#line 508 "engines/director/lingo/lingo-gr.y" +#line 509 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArgStore(); ;} break; case 116: -#line 512 "engines/director/lingo/lingo-gr.y" +#line 513 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_call); g_lingo->codeString((yyvsp[(1) - (3)].s)->c_str()); @@ -2450,23 +2461,23 @@ yyreduce: break; case 117: -#line 520 "engines/director/lingo/lingo-gr.y" +#line 521 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = 0; ;} break; case 118: -#line 521 "engines/director/lingo/lingo-gr.y" +#line 522 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = 1; ;} break; case 119: -#line 522 "engines/director/lingo/lingo-gr.y" +#line 523 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = (yyvsp[(1) - (3)].narg) + 1; ;} break; /* Line 1267 of yacc.c. */ -#line 2470 "engines/director/lingo/lingo-gr.cpp" +#line 2481 "engines/director/lingo/lingo-gr.cpp" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -2680,6 +2691,6 @@ yyreturn: } -#line 525 "engines/director/lingo/lingo-gr.y" +#line 526 "engines/director/lingo/lingo-gr.y" diff --git a/engines/director/lingo/lingo-gr.h b/engines/director/lingo/lingo-gr.h index 5044eacf7d..6c093d503c 100644 --- a/engines/director/lingo/lingo-gr.h +++ b/engines/director/lingo/lingo-gr.h @@ -43,59 +43,62 @@ UNARY = 259, VOID = 260, VAR = 261, - INT = 262, - THEENTITY = 263, - THEENTITYWITHID = 264, - FLOAT = 265, - BLTIN = 266, - BLTINNOARGS = 267, - ID = 268, - STRING = 269, - HANDLER = 270, - tDOWN = 271, - tELSE = 272, - tNLELSIF = 273, - tEND = 274, - tEXIT = 275, - tFRAME = 276, - tGLOBAL = 277, - tGO = 278, - tIF = 279, - tINTO = 280, - tLOOP = 281, - tMACRO = 282, - tMCI = 283, - tMCIWAIT = 284, - tMOVIE = 285, - tNEXT = 286, - tOF = 287, - tPREVIOUS = 288, - tPUT = 289, - tREPEAT = 290, - tSET = 291, - tTHEN = 292, - tTO = 293, - 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, - tSPRITE = 312, - tINTERSECTS = 313, - tWITHIN = 314 + POINT = 262, + RECT = 263, + ARRAY = 264, + INT = 265, + THEENTITY = 266, + THEENTITYWITHID = 267, + FLOAT = 268, + BLTIN = 269, + BLTINNOARGS = 270, + ID = 271, + STRING = 272, + HANDLER = 273, + tDOWN = 274, + tELSE = 275, + tNLELSIF = 276, + tEND = 277, + tEXIT = 278, + tFRAME = 279, + tGLOBAL = 280, + tGO = 281, + tIF = 282, + tINTO = 283, + tLOOP = 284, + tMACRO = 285, + tMCI = 286, + tMCIWAIT = 287, + tMOVIE = 288, + tNEXT = 289, + tOF = 290, + tPREVIOUS = 291, + tPUT = 292, + tREPEAT = 293, + tSET = 294, + tTHEN = 295, + tTO = 296, + tWHEN = 297, + tWITH = 298, + tWHILE = 299, + tNLELSE = 300, + tFACTORY = 301, + tMETHOD = 302, + tGE = 303, + tLE = 304, + tGT = 305, + tLT = 306, + tEQ = 307, + tNEQ = 308, + tAND = 309, + tOR = 310, + tNOT = 311, + tCONCAT = 312, + tCONTAINS = 313, + tSTARTS = 314, + tSPRITE = 315, + tINTERSECTS = 316, + tWITHIN = 317 }; #endif /* Tokens. */ @@ -103,59 +106,62 @@ #define UNARY 259 #define VOID 260 #define VAR 261 -#define INT 262 -#define THEENTITY 263 -#define THEENTITYWITHID 264 -#define FLOAT 265 -#define BLTIN 266 -#define BLTINNOARGS 267 -#define ID 268 -#define STRING 269 -#define HANDLER 270 -#define tDOWN 271 -#define tELSE 272 -#define tNLELSIF 273 -#define tEND 274 -#define tEXIT 275 -#define tFRAME 276 -#define tGLOBAL 277 -#define tGO 278 -#define tIF 279 -#define tINTO 280 -#define tLOOP 281 -#define tMACRO 282 -#define tMCI 283 -#define tMCIWAIT 284 -#define tMOVIE 285 -#define tNEXT 286 -#define tOF 287 -#define tPREVIOUS 288 -#define tPUT 289 -#define tREPEAT 290 -#define tSET 291 -#define tTHEN 292 -#define tTO 293 -#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 -#define tSPRITE 312 -#define tINTERSECTS 313 -#define tWITHIN 314 +#define POINT 262 +#define RECT 263 +#define ARRAY 264 +#define INT 265 +#define THEENTITY 266 +#define THEENTITYWITHID 267 +#define FLOAT 268 +#define BLTIN 269 +#define BLTINNOARGS 270 +#define ID 271 +#define STRING 272 +#define HANDLER 273 +#define tDOWN 274 +#define tELSE 275 +#define tNLELSIF 276 +#define tEND 277 +#define tEXIT 278 +#define tFRAME 279 +#define tGLOBAL 280 +#define tGO 281 +#define tIF 282 +#define tINTO 283 +#define tLOOP 284 +#define tMACRO 285 +#define tMCI 286 +#define tMCIWAIT 287 +#define tMOVIE 288 +#define tNEXT 289 +#define tOF 290 +#define tPREVIOUS 291 +#define tPUT 292 +#define tREPEAT 293 +#define tSET 294 +#define tTHEN 295 +#define tTO 296 +#define tWHEN 297 +#define tWITH 298 +#define tWHILE 299 +#define tNLELSE 300 +#define tFACTORY 301 +#define tMETHOD 302 +#define tGE 303 +#define tLE 304 +#define tGT 305 +#define tLT 306 +#define tEQ 307 +#define tNEQ 308 +#define tAND 309 +#define tOR 310 +#define tNOT 311 +#define tCONCAT 312 +#define tCONTAINS 313 +#define tSTARTS 314 +#define tSPRITE 315 +#define tINTERSECTS 316 +#define tWITHIN 317 @@ -165,14 +171,15 @@ typedef union YYSTYPE #line 69 "engines/director/lingo/lingo-gr.y" { Common::String *s; - int i; + int i; double f; int e[2]; // Entity + field int code; - int narg; /* number of arguments */ + int narg; /* number of arguments */ + Common::Array *arr; } /* Line 1529 of yacc.c. */ -#line 176 "engines/director/lingo/lingo-gr.hpp" +#line 183 "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 033b7dd2ea..9ad2f750e7 100644 --- a/engines/director/lingo/lingo-gr.y +++ b/engines/director/lingo/lingo-gr.y @@ -68,14 +68,15 @@ void yyerror(char *s) { %union { Common::String *s; - int i; + int i; double f; int e[2]; // Entity + field int code; - int narg; /* number of arguments */ + int narg; /* number of arguments */ + Common::Array *arr; } -%token CASTREF UNARY VOID VAR +%token CASTREF UNARY VOID VAR POINT RECT ARRAY %token INT %token THEENTITY THEENTITYWITHID %token FLOAT diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp index 2c2583699e..441cd27972 100644 --- a/engines/director/lingo/lingo.cpp +++ b/engines/director/lingo/lingo.cpp @@ -304,6 +304,8 @@ const char *Datum::type2str() { return "CASTREF"; case VOID: return "VOID"; + case POINT: + return "POINT"; default: snprintf(res, 20, "-- (%d) --", type); return res; diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h index 1859c31473..fe9d4a59dc 100644 --- a/engines/director/lingo/lingo.h +++ b/engines/director/lingo/lingo.h @@ -76,6 +76,7 @@ typedef void (*inst)(void); #define STOP (inst)0 typedef Common::Array ScriptData; +typedef Common::Array FloatArray; struct Symbol { /* symbol table entry */ char *name; @@ -85,6 +86,7 @@ struct Symbol { /* symbol table entry */ double f; /* FLOAT */ ScriptData *defn; /* FUNCTION, PROCEDURE */ Common::String *s; /* STRING */ + FloatArray *arr; /* ARRAY, POINT, RECT */ } u; int nargs; bool global; @@ -100,6 +102,7 @@ struct Datum { /* interpreter stack type */ double f; Common::String *s; Symbol *sym; + FloatArray *arr; /* ARRAY, POINT, RECT */ } u; Datum() { u.sym = NULL; type = VOID; } @@ -258,6 +261,8 @@ public: static void b_dontpassevent(); + static void b_point(); + void func_mci(Common::String &s); void func_mciwait(Common::String &s); void func_goto(Common::String &frame, Common::String &movie); diff --git a/engines/director/lingo/tests/point.lingo b/engines/director/lingo/tests/point.lingo new file mode 100644 index 0000000000..4e90ddb684 --- /dev/null +++ b/engines/director/lingo/tests/point.lingo @@ -0,0 +1,3 @@ +put point(10, 20) +set x = point(20,30) +put x -- cgit v1.2.3