diff options
author | Eugene Sandulenko | 2016-07-30 20:42:56 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | ba3cf6181c06ddcd543db277d1fe5a6d4506cad7 (patch) | |
tree | 479a8298d692389d7eeb0caed7ee28f31d73e10a /engines/director/lingo | |
parent | 7fd25e98f1a689733b6bad449618ebe8f3c91546 (diff) | |
download | scummvm-rg350-ba3cf6181c06ddcd543db277d1fe5a6d4506cad7.tar.gz scummvm-rg350-ba3cf6181c06ddcd543db277d1fe5a6d4506cad7.tar.bz2 scummvm-rg350-ba3cf6181c06ddcd543db277d1fe5a6d4506cad7.zip |
DIRECTOR: Lingo: Implemented ilk() function
Diffstat (limited to 'engines/director/lingo')
-rw-r--r-- | engines/director/lingo/lingo-builtins.cpp | 8 | ||||
-rw-r--r-- | engines/director/lingo/lingo-code.cpp | 9 | ||||
-rw-r--r-- | engines/director/lingo/lingo-gr.cpp | 653 | ||||
-rw-r--r-- | engines/director/lingo/lingo-gr.h | 216 | ||||
-rw-r--r-- | engines/director/lingo/lingo-gr.y | 2 | ||||
-rw-r--r-- | engines/director/lingo/lingo.cpp | 16 | ||||
-rw-r--r-- | engines/director/lingo/lingo.h | 3 | ||||
-rw-r--r-- | engines/director/lingo/tests/ilk.lingo | 7 |
8 files changed, 472 insertions, 442 deletions
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp index 78c751641d..b23a3ce09e 100644 --- a/engines/director/lingo/lingo-builtins.cpp +++ b/engines/director/lingo/lingo-builtins.cpp @@ -49,6 +49,7 @@ static struct BuiltinProto { { "string", Lingo::b_string, 1}, // Misc { "dontpassevent", Lingo::b_dontpassevent, -1 }, + { "ilk", Lingo::b_ilk, 1 }, // point { "point", Lingo::b_point, 2}, { 0, 0, 0 } @@ -218,6 +219,13 @@ void Lingo::b_dontpassevent() { warning("STUB: b_dontpassevent"); } +void Lingo::b_ilk() { + Datum d = g_lingo->pop(); + d.u.i = d.type; + d.type = SYMBOL; + g_lingo->push(d); +} + /////////////////// // Point /////////////////// diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp index eb28dcfd73..fa7642651f 100644 --- a/engines/director/lingo/lingo-code.cpp +++ b/engines/director/lingo/lingo-code.cpp @@ -96,7 +96,10 @@ void Lingo::c_printtop(void) { warning("%s", d.u.s->c_str()); break; case POINT: - warning("point (%d, %d)", (int)((*d.u.arr)[0]), (int)((*d.u.arr)[1])); + warning("point(%d, %d)", (int)((*d.u.arr)[0]), (int)((*d.u.arr)[1])); + break; + case SYMBOL: + warning("%s", d.type2str(true)); break; default: warning("--unknown--"); @@ -180,6 +183,8 @@ void Lingo::c_assign() { 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 if (d2.type == SYMBOL) + d1.u.sym->u.i = d2.u.i; else error("c_assign: unhandled type: %s", d2.type2str()); @@ -223,6 +228,8 @@ void Lingo::c_eval() { 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 if (d.u.sym->type == SYMBOL) + d.u.i = d.u.sym->u.i; else error("c_eval: unhandled type: %s", d.type2str()); diff --git a/engines/director/lingo/lingo-gr.cpp b/engines/director/lingo/lingo-gr.cpp index 6276ee42c2..ed4f5a4358 100644 --- a/engines/director/lingo/lingo-gr.cpp +++ b/engines/director/lingo/lingo-gr.cpp @@ -73,59 +73,60 @@ 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 + SYMBOL = 265, + INT = 266, + THEENTITY = 267, + THEENTITYWITHID = 268, + FLOAT = 269, + BLTIN = 270, + BLTINNOARGS = 271, + ID = 272, + STRING = 273, + HANDLER = 274, + tDOWN = 275, + tELSE = 276, + tNLELSIF = 277, + tEND = 278, + tEXIT = 279, + tFRAME = 280, + tGLOBAL = 281, + tGO = 282, + tIF = 283, + tINTO = 284, + tLOOP = 285, + tMACRO = 286, + tMCI = 287, + tMCIWAIT = 288, + tMOVIE = 289, + tNEXT = 290, + tOF = 291, + tPREVIOUS = 292, + tPUT = 293, + tREPEAT = 294, + tSET = 295, + tTHEN = 296, + tTO = 297, + tWHEN = 298, + tWITH = 299, + tWHILE = 300, + tNLELSE = 301, + tFACTORY = 302, + tMETHOD = 303, + tGE = 304, + tLE = 305, + tGT = 306, + tLT = 307, + tEQ = 308, + tNEQ = 309, + tAND = 310, + tOR = 311, + tNOT = 312, + tCONCAT = 313, + tCONTAINS = 314, + tSTARTS = 315, + tSPRITE = 316, + tINTERSECTS = 317, + tWITHIN = 318 }; #endif /* Tokens. */ @@ -136,59 +137,60 @@ #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 +#define SYMBOL 265 +#define INT 266 +#define THEENTITY 267 +#define THEENTITYWITHID 268 +#define FLOAT 269 +#define BLTIN 270 +#define BLTINNOARGS 271 +#define ID 272 +#define STRING 273 +#define HANDLER 274 +#define tDOWN 275 +#define tELSE 276 +#define tNLELSIF 277 +#define tEND 278 +#define tEXIT 279 +#define tFRAME 280 +#define tGLOBAL 281 +#define tGO 282 +#define tIF 283 +#define tINTO 284 +#define tLOOP 285 +#define tMACRO 286 +#define tMCI 287 +#define tMCIWAIT 288 +#define tMOVIE 289 +#define tNEXT 290 +#define tOF 291 +#define tPREVIOUS 292 +#define tPUT 293 +#define tREPEAT 294 +#define tSET 295 +#define tTHEN 296 +#define tTO 297 +#define tWHEN 298 +#define tWITH 299 +#define tWHILE 300 +#define tNLELSE 301 +#define tFACTORY 302 +#define tMETHOD 303 +#define tGE 304 +#define tLE 305 +#define tGT 306 +#define tLT 307 +#define tEQ 308 +#define tNEQ 309 +#define tAND 310 +#define tOR 311 +#define tNOT 312 +#define tCONCAT 313 +#define tCONTAINS 314 +#define tSTARTS 315 +#define tSPRITE 316 +#define tINTERSECTS 317 +#define tWITHIN 318 @@ -246,7 +248,7 @@ typedef union YYSTYPE Common::Array<double> *arr; } /* Line 193 of yacc.c. */ -#line 250 "engines/director/lingo/lingo-gr.cpp" +#line 252 "engines/director/lingo/lingo-gr.cpp" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -259,7 +261,7 @@ typedef union YYSTYPE /* Line 216 of yacc.c. */ -#line 263 "engines/director/lingo/lingo-gr.cpp" +#line 265 "engines/director/lingo/lingo-gr.cpp" #ifdef short # undef short @@ -477,7 +479,7 @@ union yyalloc #define YYLAST 731 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 76 +#define YYNTOKENS 77 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 34 /* YYNRULES -- Number of rules. */ @@ -487,7 +489,7 @@ union yyalloc /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 317 +#define YYMAXUTOK 318 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -496,12 +498,12 @@ union yyalloc static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 69, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 70, 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, 68, 74, 2, - 70, 71, 66, 64, 75, 65, 2, 67, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 69, 75, 2, + 71, 72, 67, 65, 76, 66, 2, 68, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 73, 63, 72, 2, 2, 2, 2, 2, 2, 2, + 74, 64, 73, 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, @@ -526,7 +528,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, 60, 61, 62 + 55, 56, 57, 58, 59, 60, 61, 62, 63 }; #if YYDEBUG @@ -551,52 +553,52 @@ static const yytype_uint16 yyprhs[] = /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { - 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 + 78, 0, -1, 78, 79, 80, -1, 80, -1, 1, + 70, -1, 70, -1, -1, 104, -1, 99, -1, 109, + -1, 81, -1, 83, -1, 38, 98, 29, 17, -1, + 40, 17, 64, 98, -1, 40, 12, 64, 98, -1, + 40, 13, 98, 64, 98, -1, 40, 17, 42, 98, + -1, 40, 12, 42, 98, -1, 40, 13, 98, 42, + 98, -1, 98, -1, 99, -1, 82, -1, 84, -1, + 91, 71, 90, 72, 97, 96, 23, 39, -1, 92, + 64, 98, 96, 42, 98, 96, 97, 96, 23, 39, + -1, 92, 64, 98, 96, 20, 42, 98, 96, 97, + 96, 23, 39, -1, 43, 17, 41, 98, -1, 93, + 90, 41, 79, 97, 96, 23, 28, -1, 93, 90, + 41, 79, 97, 96, 46, 97, 96, 23, 28, -1, + 93, 90, 41, 79, 97, 96, 95, 86, 96, 23, + 28, -1, 93, 90, 41, 95, 82, 96, -1, 93, + 90, 41, 95, 82, 96, 46, 95, 82, 96, -1, + 93, 90, 41, 95, 82, 96, 87, 96, 85, 96, + -1, -1, 46, 95, 82, -1, 86, 89, -1, 89, + -1, 87, 88, -1, 88, -1, 94, 90, 41, 95, + 83, 96, -1, 87, -1, 94, 90, 41, 97, 96, + -1, 98, -1, 98, 64, 98, -1, 71, 90, 72, + -1, 39, 45, -1, 39, 44, 17, -1, 28, -1, + 22, -1, -1, -1, -1, 97, 79, -1, 97, 83, + -1, 11, -1, 14, -1, 18, -1, 15, 71, 110, + 72, -1, 16, -1, 17, 71, 110, 72, -1, 17, + -1, 12, -1, 13, 98, -1, 81, -1, 98, 65, + 98, -1, 98, 66, 98, -1, 98, 67, 98, -1, + 98, 68, 98, -1, 98, 73, 98, -1, 98, 74, + 98, -1, 98, 54, 98, -1, 98, 49, 98, -1, + 98, 50, 98, -1, 98, 55, 98, -1, 98, 56, + 98, -1, 57, 98, -1, 98, 75, 98, -1, 98, + 58, 98, -1, 98, 59, 98, -1, 98, 60, 98, + -1, 65, 98, -1, 66, 98, -1, 71, 98, 72, + -1, 61, 98, 62, 98, -1, 61, 98, 63, 98, + -1, 32, 18, -1, 33, 17, -1, 38, 98, -1, + 101, -1, 24, -1, 26, 100, -1, 17, -1, 100, + 76, 17, -1, 27, 30, -1, 27, 35, -1, 27, + 37, -1, 27, 102, -1, 27, 102, 103, -1, 27, + 103, -1, 42, 25, 18, -1, 25, 18, -1, 42, + 18, -1, 18, -1, 36, 34, 18, -1, 34, 18, + -1, 42, 34, 18, -1, -1, 31, 17, 105, 95, + 107, 79, 108, 97, -1, 47, 17, -1, -1, 48, + 17, 106, 95, 107, 79, 108, 97, -1, -1, 17, + -1, 107, 76, 17, -1, 107, 79, 76, 17, -1, + -1, 17, 95, 110, -1, -1, 98, -1, 110, 76, + 98, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -623,16 +625,17 @@ static const yytype_uint16 yyrline[] = static const char *const yytname[] = { "$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", + "POINT", "RECT", "ARRAY", "SYMBOL", "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", @@ -652,26 +655,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, - 315, 316, 317, 61, 43, 45, 42, 47, 37, 10, - 40, 41, 62, 60, 38, 44 + 315, 316, 317, 318, 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, 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 + 0, 77, 78, 78, 78, 79, 80, 80, 80, 80, + 80, 80, 81, 81, 81, 81, 81, 81, 81, 82, + 82, 83, 83, 83, 83, 83, 83, 84, 84, 84, + 84, 84, 84, 85, 85, 86, 86, 87, 87, 88, + 89, 89, 90, 90, 90, 91, 92, 93, 94, 95, + 96, 97, 97, 97, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 99, 99, 99, 99, 99, + 99, 100, 100, 101, 101, 101, 101, 101, 101, 102, + 102, 102, 102, 103, 103, 103, 105, 104, 104, 106, + 104, 107, 107, 107, 107, 108, 109, 110, 110, 110 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -738,41 +741,41 @@ static const yytype_int16 yydefgoto[] = #define YYPACT_NINF -192 static const yytype_int16 yypact[] = { - 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 + 222, -25, -192, -192, 446, -192, -14, -192, 656, -192, + -192, 50, 142, -192, 51, 52, 55, 446, -30, 48, + 56, 59, 60, 446, 446, 446, 446, 446, 9, -192, + 10, -192, -192, -192, -2, 18, 478, 634, -192, -192, + -192, -192, -192, 3, 446, -192, 634, 446, 446, 446, + -192, 34, -192, 65, -192, 69, -192, 71, -192, 29, + 22, -192, -192, -192, -192, 492, 97, -192, -22, 446, + -21, 78, -192, -192, 57, 536, 57, 57, 585, -192, + -192, 283, 478, 446, 478, 79, 612, 446, 446, 446, + 446, 446, 446, 446, 446, 446, 446, 446, 446, 446, + 446, 446, 492, 634, -28, -10, 47, 117, -192, -192, + 118, -192, 122, 123, 108, -192, -192, 126, -192, 446, + 446, 514, 446, 446, 446, -192, 446, 446, -192, -192, + 72, 634, 74, 558, 77, 446, 634, 634, 634, 634, + 634, 634, 634, 634, 278, 278, 57, 57, 634, 634, + 634, -192, 446, -192, -192, -192, -192, -192, 132, -192, + 634, 634, 446, 446, 634, 634, 634, 132, 634, 634, + -192, 11, -192, -192, 416, 634, 634, -192, -52, 634, + 634, -52, 344, 109, 446, 344, -192, -192, 133, 81, + 81, -192, -192, 130, 446, 634, -6, -9, -192, 141, + -192, -192, 120, 634, -192, 134, -192, 139, -192, -192, + 139, -192, 478, -192, 344, 344, -192, -192, 344, -192, + 344, 139, 139, -192, 478, 416, -192, 124, 125, 344, + 145, 146, -192, 152, 140, -192, -192, -192, -192, 157, + 144, 159, 163, -11, -192, 416, -192, 380, 153, -192, + -192, -192, 344, -192, -192, -192, -192, -192 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -192, -192, -26, 104, 7, -170, 0, -192, -192, -192, - -4, -179, -27, -79, -192, -192, -192, -191, -7, -47, - -165, 2, 23, -192, -192, -192, 137, -192, -192, -192, - 31, 5, -192, 34 + -4, -188, -27, -79, -192, -192, -192, -191, -7, -47, + -165, 2, 23, -192, -192, -192, 135, -192, -192, -192, + 30, 8, -192, -16 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -782,18 +785,18 @@ static const yytype_int16 yypgoto[] = #define YYTABLE_NINF -61 static const yytype_int16 yytable[] = { - 32, 49, 81, 130, 186, 132, 46, 30, 185, 208, - 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, + 32, 49, 81, 130, 186, 132, 46, 30, 185, 79, + -10, -51, -51, 208, 66, 67, 224, 205, 80, 65, + 119, 122, 226, 38, 188, 74, 75, 76, 77, 78, + 224, 183, 105, 106, 226, 214, 215, 209, 86, 218, + 206, 220, 120, 123, 151, 42, 102, 111, 152, 103, + 103, 103, 229, 184, 112, 235, 55, 47, 57, -51, + 68, 69, 153, 113, 114, 70, 152, 50, 62, 82, + 63, 121, 64, 71, 48, 253, 72, 73, 252, 80, + -10, 32, 83, 108, 86, 131, 133, 109, 30, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 38, 109, 87, 88, 173, 158, - 110, 89, 90, 91, 118, 92, 93, 94, 167, 124, + 147, 148, 149, 150, 38, 110, 87, 88, 173, 158, + 107, 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, 156, 157, 113, 159, 170, 234, 172, 80, 204, 177, @@ -801,10 +804,10 @@ 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, 210, 232, 201, 203, 115, 181, 0, + 246, 251, 255, 210, 232, 115, 203, 181, 201, 0, 0, 0, 225, 0, 0, 256, 0, 257, 0, 0, 0, 0, 0, 0, 86, 0, 0, 0, 0, 0, - 0, 0, 0, -6, 1, 0, 86, 0, 0, 245, + 0, 0, -6, 1, 0, 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, @@ -860,112 +863,112 @@ static const yytype_int16 yytable[] = static const yytype_int16 yycheck[] = { - 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, + 0, 8, 28, 82, 174, 84, 4, 0, 173, 0, + 0, 22, 23, 22, 44, 45, 207, 23, 70, 17, + 42, 42, 210, 0, 76, 23, 24, 25, 26, 27, + 221, 20, 48, 49, 222, 200, 201, 46, 36, 204, + 46, 206, 64, 64, 72, 70, 44, 18, 76, 47, + 48, 49, 217, 42, 25, 225, 34, 71, 36, 70, + 12, 13, 72, 34, 42, 17, 76, 17, 17, 71, + 18, 69, 17, 17, 71, 245, 17, 17, 243, 70, + 70, 81, 64, 18, 82, 83, 84, 18, 81, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 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, + 98, 99, 100, 101, 81, 34, 49, 50, 134, 116, + 76, 54, 55, 56, 17, 58, 59, 60, 125, 41, + 41, 119, 120, 76, 122, 123, 124, 134, 126, 127, + 73, 74, 75, 212, 17, 182, 18, 135, 185, 186, + 18, 18, 34, 17, 72, 224, 72, 70, 195, 17, + 17, 42, 178, 23, 152, 181, 203, 76, 17, 39, + 18, 22, 28, 210, 162, 163, 41, 25, 23, 23, + 46, 218, 30, 220, 221, 23, 34, 35, 36, 37, + 23, 41, 229, 39, 42, 81, 184, 28, 235, 196, + 237, 28, 39, 197, 221, 60, 194, 167, 190, -1, -1, -1, 209, -1, -1, 252, -1, 254, -1, -1, -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 + -1, -1, 0, 1, -1, -1, 224, -1, -1, 236, + -1, -1, -1, 11, 12, 13, 14, 15, 16, 17, + 18, -1, -1, -1, -1, -1, 24, 247, 26, 27, + 28, -1, -1, 31, 32, 33, -1, -1, -1, -1, + 38, 39, 40, -1, -1, 43, -1, -1, -1, 47, + 48, -1, -1, -1, -1, -1, -1, -1, -1, 57, + -1, -1, -1, 61, -1, -1, -1, 65, 66, -1, + -1, -1, 70, 71, 11, 12, 13, 14, 15, 16, + 17, 18, -1, -1, -1, -1, -1, 24, -1, 26, + 27, 28, -1, -1, 31, 32, 33, -1, -1, -1, + -1, 38, 39, 40, -1, -1, 43, 49, 50, -1, + 47, 48, 54, 55, 56, -1, 58, 59, 60, -1, + 57, -1, -1, -1, 61, 67, 68, -1, 65, 66, + -1, 73, 74, 75, 71, 11, 12, 13, 14, 15, + 16, 17, 18, -1, -1, -1, -1, -1, 24, -1, + 26, 27, 28, -1, -1, -1, 32, 33, -1, -1, + -1, -1, 38, 39, 40, -1, -1, 43, -1, -1, + -1, 11, 12, 13, 14, 15, 16, 17, 18, -1, + -1, 57, -1, -1, 24, 61, 26, 27, 28, 65, + 66, -1, 32, 33, 70, 71, -1, -1, 38, 39, + 40, -1, -1, 43, -1, -1, -1, 11, 12, 13, + 14, 15, 16, 17, 18, -1, -1, 57, -1, -1, + 24, 61, 26, 27, -1, 65, 66, -1, 32, 33, + -1, 71, -1, -1, 38, -1, 40, 11, 12, 13, + 14, 15, 16, 17, 18, -1, -1, -1, -1, -1, + -1, -1, -1, 57, -1, -1, -1, 61, -1, -1, + -1, 65, 66, -1, 38, -1, 40, 71, -1, 11, + 12, 13, 14, 15, 16, 17, 18, -1, -1, -1, + -1, -1, -1, 57, -1, -1, -1, 61, -1, -1, + -1, 65, 66, -1, -1, -1, 38, 71, 40, -1, + -1, 29, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 57, -1, -1, -1, 61, + -1, 49, 50, 65, 66, -1, 54, 55, 56, 71, + 58, 59, 60, -1, -1, -1, 42, 65, 66, 67, + 68, -1, -1, 49, 50, 73, 74, 75, 54, 55, + 56, -1, 58, 59, 60, -1, -1, -1, 64, 65, + 66, 67, 68, -1, -1, 49, 50, 73, 74, 75, + 54, 55, 56, -1, 58, 59, 60, -1, 62, 63, + -1, 65, 66, 67, 68, -1, -1, 49, 50, 73, + 74, 75, 54, 55, 56, -1, 58, 59, 60, -1, + -1, -1, 64, 65, 66, 67, 68, -1, -1, -1, + 72, 73, 74, 75, 49, 50, -1, -1, -1, 54, + 55, 56, -1, 58, 59, 60, -1, -1, -1, -1, + 65, 66, 67, 68, -1, -1, -1, 72, 73, 74, + 75, 49, 50, -1, -1, -1, 54, 55, 56, -1, + 58, 59, 60, -1, -1, -1, 64, 65, 66, 67, + 68, -1, -1, 49, 50, 73, 74, 75, 54, 55, + 56, -1, 58, 59, 60, -1, -1, -1, -1, 65, + 66, 67, 68, -1, -1, 49, 50, 73, 74, 75, + 54, 55, 56, -1, 58, 59, 60, -1, -1, -1, + -1, -1, -1, 67, 68, -1, -1, 71, -1, 73, + 74, 75 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 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 + 0, 1, 11, 12, 13, 14, 15, 16, 17, 18, + 24, 26, 27, 28, 31, 32, 33, 38, 39, 40, + 43, 47, 48, 57, 61, 65, 66, 71, 78, 80, + 81, 82, 83, 84, 91, 92, 93, 98, 99, 101, + 104, 109, 70, 17, 38, 81, 98, 71, 71, 95, + 17, 100, 18, 25, 30, 34, 35, 36, 37, 42, + 102, 103, 17, 18, 17, 98, 44, 45, 12, 13, + 17, 17, 17, 17, 98, 98, 98, 98, 98, 0, + 70, 79, 71, 64, 71, 90, 98, 49, 50, 54, + 55, 56, 58, 59, 60, 65, 66, 67, 68, 73, + 74, 75, 98, 98, 110, 110, 110, 76, 18, 18, + 34, 18, 25, 34, 42, 103, 105, 29, 17, 42, + 64, 98, 42, 64, 41, 106, 62, 63, 72, 80, + 90, 98, 90, 98, 41, 64, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 72, 76, 72, 17, 18, 18, 18, 95, 17, + 98, 98, 42, 64, 98, 98, 98, 95, 98, 98, + 72, 96, 72, 79, 95, 98, 98, 17, 107, 98, + 98, 107, 97, 20, 42, 97, 82, 99, 76, 79, + 79, 79, 83, 96, 42, 98, 96, 96, 17, 76, + 108, 108, 23, 98, 96, 23, 46, 95, 22, 46, + 87, 88, 94, 17, 97, 97, 39, 96, 97, 28, + 97, 86, 87, 89, 94, 95, 88, 96, 90, 97, + 96, 96, 89, 96, 90, 82, 46, 85, 41, 96, + 23, 23, 23, 41, 96, 95, 96, 95, 23, 39, + 28, 28, 97, 82, 83, 39, 96, 96 }; #define yyerrok (yyerrstatus = 0) @@ -2477,7 +2480,7 @@ yyreduce: /* Line 1267 of yacc.c. */ -#line 2481 "engines/director/lingo/lingo-gr.cpp" +#line 2484 "engines/director/lingo/lingo-gr.cpp" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); diff --git a/engines/director/lingo/lingo-gr.h b/engines/director/lingo/lingo-gr.h index 6c093d503c..a806533d2f 100644 --- a/engines/director/lingo/lingo-gr.h +++ b/engines/director/lingo/lingo-gr.h @@ -46,59 +46,60 @@ 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 + SYMBOL = 265, + INT = 266, + THEENTITY = 267, + THEENTITYWITHID = 268, + FLOAT = 269, + BLTIN = 270, + BLTINNOARGS = 271, + ID = 272, + STRING = 273, + HANDLER = 274, + tDOWN = 275, + tELSE = 276, + tNLELSIF = 277, + tEND = 278, + tEXIT = 279, + tFRAME = 280, + tGLOBAL = 281, + tGO = 282, + tIF = 283, + tINTO = 284, + tLOOP = 285, + tMACRO = 286, + tMCI = 287, + tMCIWAIT = 288, + tMOVIE = 289, + tNEXT = 290, + tOF = 291, + tPREVIOUS = 292, + tPUT = 293, + tREPEAT = 294, + tSET = 295, + tTHEN = 296, + tTO = 297, + tWHEN = 298, + tWITH = 299, + tWHILE = 300, + tNLELSE = 301, + tFACTORY = 302, + tMETHOD = 303, + tGE = 304, + tLE = 305, + tGT = 306, + tLT = 307, + tEQ = 308, + tNEQ = 309, + tAND = 310, + tOR = 311, + tNOT = 312, + tCONCAT = 313, + tCONTAINS = 314, + tSTARTS = 315, + tSPRITE = 316, + tINTERSECTS = 317, + tWITHIN = 318 }; #endif /* Tokens. */ @@ -109,59 +110,60 @@ #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 +#define SYMBOL 265 +#define INT 266 +#define THEENTITY 267 +#define THEENTITYWITHID 268 +#define FLOAT 269 +#define BLTIN 270 +#define BLTINNOARGS 271 +#define ID 272 +#define STRING 273 +#define HANDLER 274 +#define tDOWN 275 +#define tELSE 276 +#define tNLELSIF 277 +#define tEND 278 +#define tEXIT 279 +#define tFRAME 280 +#define tGLOBAL 281 +#define tGO 282 +#define tIF 283 +#define tINTO 284 +#define tLOOP 285 +#define tMACRO 286 +#define tMCI 287 +#define tMCIWAIT 288 +#define tMOVIE 289 +#define tNEXT 290 +#define tOF 291 +#define tPREVIOUS 292 +#define tPUT 293 +#define tREPEAT 294 +#define tSET 295 +#define tTHEN 296 +#define tTO 297 +#define tWHEN 298 +#define tWITH 299 +#define tWHILE 300 +#define tNLELSE 301 +#define tFACTORY 302 +#define tMETHOD 303 +#define tGE 304 +#define tLE 305 +#define tGT 306 +#define tLT 307 +#define tEQ 308 +#define tNEQ 309 +#define tAND 310 +#define tOR 311 +#define tNOT 312 +#define tCONCAT 313 +#define tCONTAINS 314 +#define tSTARTS 315 +#define tSPRITE 316 +#define tINTERSECTS 317 +#define tWITHIN 318 @@ -179,7 +181,7 @@ typedef union YYSTYPE Common::Array<double> *arr; } /* Line 1529 of yacc.c. */ -#line 183 "engines/director/lingo/lingo-gr.hpp" +#line 185 "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 9ad2f750e7..6df71f9ea7 100644 --- a/engines/director/lingo/lingo-gr.y +++ b/engines/director/lingo/lingo-gr.y @@ -76,7 +76,7 @@ void yyerror(char *s) { Common::Array<double> *arr; } -%token CASTREF UNARY VOID VAR POINT RECT ARRAY +%token CASTREF UNARY VOID VAR POINT RECT ARRAY SYMBOL %token<i> INT %token<e> THEENTITY THEENTITYWITHID %token<f> FLOAT diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp index 441cd27972..0bb43092f3 100644 --- a/engines/director/lingo/lingo.cpp +++ b/engines/director/lingo/lingo.cpp @@ -290,22 +290,24 @@ Common::String *Datum::toString() { return u.s; } -const char *Datum::type2str() { +const char *Datum::type2str(bool isk) { static char res[20]; - switch (type) { + switch (isk ? u.i : type) { case INT: - return "INT"; + return isk ? "#integer" : "INT"; case FLOAT: - return "FLOAT"; + return isk ? "#float" : "FLOAT"; case STRING: - return "STRING"; + return isk ? "#string" : "STRING"; case CASTREF: return "CASTREF"; case VOID: - return "VOID"; + return isk ? "#void" : "VOID"; case POINT: - return "POINT"; + return isk ? "#point" : "POINT"; + case SYMBOL: + return isk ? "#symbol" : "SYMBOL"; default: snprintf(res, 20, "-- (%d) --", type); return res; diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h index fe9d4a59dc..85db22cf0f 100644 --- a/engines/director/lingo/lingo.h +++ b/engines/director/lingo/lingo.h @@ -111,7 +111,7 @@ struct Datum { /* interpreter stack type */ int toInt(); Common::String *toString(); - const char *type2str(); + const char *type2str(bool isk = false); }; struct Builtin { @@ -260,6 +260,7 @@ public: static void b_tan(); static void b_dontpassevent(); + static void b_ilk(); static void b_point(); diff --git a/engines/director/lingo/tests/ilk.lingo b/engines/director/lingo/tests/ilk.lingo new file mode 100644 index 0000000000..686d9a5118 --- /dev/null +++ b/engines/director/lingo/tests/ilk.lingo @@ -0,0 +1,7 @@ +put ilk(10) +put ilk(20.0) +put ilk("Macromedia") +put ilk(point(10, 20)) +put ilk(ilk(10)) +set x = point(10, 20) +put ilk(x) |