From 266e8e6611950e02a9c9feb8492c0a552deee702 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 4 Aug 2016 15:52:24 +0200 Subject: DIRECTOR: Lingo: Add prefix 'v' to all Symbol types. Helps WinCE backend which has lots of them defined. --- engines/director/lingo/lingo-builtins.cpp | 20 +- engines/director/lingo/lingo-code.cpp | 116 ++--- engines/director/lingo/lingo-codegen.cpp | 6 +- engines/director/lingo/lingo-gr.cpp | 712 +++++++++++++++--------------- engines/director/lingo/lingo-gr.h | 68 +-- engines/director/lingo/lingo-gr.y | 48 +- engines/director/lingo/lingo-lex.cpp | 18 +- engines/director/lingo/lingo-lex.l | 18 +- engines/director/lingo/lingo-the.cpp | 26 +- engines/director/lingo/lingo.cpp | 56 +-- engines/director/lingo/lingo.h | 16 +- 11 files changed, 553 insertions(+), 551 deletions(-) (limited to 'engines') diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp index e44fc69c51..d4acc1a182 100644 --- a/engines/director/lingo/lingo-builtins.cpp +++ b/engines/director/lingo/lingo-builtins.cpp @@ -62,7 +62,7 @@ void Lingo::initBuiltIns() { sym->name = (char *)calloc(strlen(blt->name) + 1, 1); Common::strlcpy(sym->name, blt->name, strlen(blt->name)); - sym->type = BLTIN; + sym->type = vBLTIN; sym->nargs = blt->nparams; sym->u.func = blt->func; @@ -76,9 +76,9 @@ void Lingo::initBuiltIns() { void Lingo::b_abs() { Datum d = g_lingo->pop(); - if (d.type == INT) + if (d.type == vINT) d.u.i = ABS(d.u.i); - else if (d.type == FLOAT) + else if (d.type == vFLOAT) d.u.f = ABS(d.u.f); g_lingo->push(d); @@ -148,7 +148,7 @@ void Lingo::b_random() { max.toInt(); res.u.i = g_lingo->_vm->_rnd.getRandomNumber(max.u.i); - res.type = INT; + res.type = vINT; g_lingo->push(res); } @@ -182,7 +182,7 @@ void Lingo::b_chars() { Datum from = g_lingo->pop(); Datum s = g_lingo->pop(); - if (s.type != STRING) + if (s.type != vSTRING) error("Incorrect type for 'chars' function: %s", s.type2str()); to.toInt(); @@ -197,21 +197,21 @@ void Lingo::b_chars() { delete s.u.s; s.u.s = res; - s.type = STRING; + s.type = vSTRING; g_lingo->push(s); } void Lingo::b_length() { Datum d = g_lingo->pop(); - if (d.type != STRING) + if (d.type != vSTRING) error("Incorrect type for 'length' function: %s", d.type2str()); int len = strlen(d.u.s->c_str()); delete d.u.s; d.u.i = len; - d.type = INT; + d.type = vINT; g_lingo->push(d); } @@ -235,7 +235,7 @@ void Lingo::b_updatestage() { void Lingo::b_ilk() { Datum d = g_lingo->pop(); d.u.i = d.type; - d.type = SYMBOL; + d.type = vSYMBOL; g_lingo->push(d); } @@ -254,7 +254,7 @@ void Lingo::b_point() { d.u.arr->push_back(x.u.f); d.u.arr->push_back(y.u.f); - d.type = POINT; + d.type = vPOINT; g_lingo->push(d); } diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp index f48f29ad50..b0099dc1b9 100644 --- a/engines/director/lingo/lingo-code.cpp +++ b/engines/director/lingo/lingo-code.cpp @@ -58,7 +58,7 @@ void Lingo::push(Datum d) { void Lingo::pushVoid() { Datum d; d.u.i = 0; - d.type = VOIDVAL; + d.type = vVOID; push(d); } @@ -80,16 +80,16 @@ void Lingo::c_printtop(void) { Datum d = g_lingo->pop(); switch (d.type) { - case VOIDVAL: + case vVOID: warning("Void"); break; - case INT: + case vINT: warning("%d", d.u.i); break; - case FLOAT: + case vFLOAT: warning(g_lingo->_floatPrecisionFormat.c_str(), d.u.f); break; - case VAR: + case vVAR: if (!d.u.sym) { warning("Inconsistent stack: var, val: %d", d.u.i); } else { @@ -99,13 +99,13 @@ void Lingo::c_printtop(void) { warning("Nameless var. val: %d", d.u.sym->u.i); } break; - case STRING: + case vSTRING: warning("%s", d.u.s->c_str()); break; - case POINT: + case vPOINT: warning("point(%d, %d)", (int)((*d.u.arr)[0]), (int)((*d.u.arr)[1])); break; - case SYMBOL: + case vSYMBOL: warning("%s", d.type2str(true)); break; default: @@ -117,7 +117,7 @@ void Lingo::c_constpush() { Datum d; inst i = (*g_lingo->_currentScript)[g_lingo->_pc++]; d.u.i = READ_UINT32(&i); - d.type = INT; + d.type = vINT; g_lingo->push(d); } @@ -125,7 +125,7 @@ void Lingo::c_fconstpush() { Datum d; inst i = (*g_lingo->_currentScript)[g_lingo->_pc]; d.u.f = *((double *)&i); - d.type = FLOAT; + d.type = vFLOAT; g_lingo->_pc += g_lingo->calcCodeAlignment(sizeof(double)); @@ -138,7 +138,7 @@ void Lingo::c_stringpush() { g_lingo->_pc += g_lingo->calcStringAlignment(s); d.u.s = new Common::String(s); - d.type = STRING; + d.type = vSTRING; g_lingo->push(d); } @@ -147,15 +147,15 @@ void Lingo::c_varpush() { Datum d; d.u.sym = g_lingo->lookupVar(name); - if (d.u.sym->type == CASTREF) { - d.type = INT; + if (d.u.sym->type == vCASTREF) { + d.type = vINT; int val = d.u.sym->u.i; delete d.u.sym; d.u.i = val; } else { - d.type = VAR; + d.type = vVAR; } g_lingo->_pc += g_lingo->calcStringAlignment(name); @@ -168,34 +168,34 @@ void Lingo::c_assign() { d1 = g_lingo->pop(); d2 = g_lingo->pop(); - if (d1.type != VAR) { + if (d1.type != vVAR) { warning("assignment to non-variable"); return; } - if (d1.u.sym->type != INT && d1.u.sym->type != VOIDVAL && - d1.u.sym->type != FLOAT && d1.u.sym->type != STRING) { + if (d1.u.sym->type != vINT && d1.u.sym->type != vVOID && + d1.u.sym->type != vFLOAT && d1.u.sym->type != vSTRING) { warning("assignment to non-variable '%s'", d1.u.sym->name); return; } - if (d1.u.sym->type == STRING) // Free memory if needed + if (d1.u.sym->type == vSTRING) // Free memory if needed delete d1.u.sym->u.s; - if (d1.u.sym->type == POINT || d1.u.sym->type == RECT || d1.u.sym->type == ARRAY) + if (d1.u.sym->type == vPOINT || d1.u.sym->type == vRECT || d1.u.sym->type == vARRAY) delete d1.u.sym->u.arr; - if (d2.type == INT) { + if (d2.type == vINT) { d1.u.sym->u.i = d2.u.i; - } else if (d2.type == FLOAT) { + } else if (d2.type == vFLOAT) { d1.u.sym->u.f = d2.u.f; - } else if (d2.type == STRING) { + } else if (d2.type == vSTRING) { d1.u.sym->u.s = new Common::String(*d2.u.s); delete d2.u.s; - } else if (d2.type == POINT) { + } else if (d2.type == vPOINT) { d1.u.sym->u.arr = new FloatArray(*d2.u.arr); delete d2.u.arr; - } else if (d2.type == SYMBOL) { + } else if (d2.type == vSYMBOL) { d1.u.sym->u.i = d2.u.i; } else { warning("c_assign: unhandled type: %s", d2.type2str()); @@ -207,13 +207,13 @@ void Lingo::c_assign() { } bool Lingo::verify(Symbol *s) { - if (s->type != INT && s->type != VOIDVAL && s->type != FLOAT && s->type != STRING && s->type != POINT) { + if (s->type != vINT && s->type != vVOID && s->type != vFLOAT && s->type != vSTRING && s->type != vPOINT) { warning("attempt to evaluate non-variable '%s'", s->name); return false; } - if (s->type == VOIDVAL) + if (s->type == vVOID) warning("Variable used before assigning a value '%s'", s->name); return true; @@ -225,7 +225,7 @@ void Lingo::c_eval() { Datum d; d = g_lingo->pop(); - if (d.type != VAR) { // It could be cast ref + if (d.type != vVAR) { // It could be cast ref g_lingo->push(d); return; } @@ -235,15 +235,15 @@ void Lingo::c_eval() { d.type = d.u.sym->type; - if (d.u.sym->type == INT) + if (d.u.sym->type == vINT) d.u.i = d.u.sym->u.i; - else if (d.u.sym->type == FLOAT) + else if (d.u.sym->type == vFLOAT) d.u.f = d.u.sym->u.f; - else if (d.u.sym->type == STRING) + else if (d.u.sym->type == vSTRING) d.u.s = new Common::String(*d.u.sym->u.s); - else if (d.u.sym->type == POINT) + else if (d.u.sym->type == vPOINT) d.u.arr = d.u.sym->u.arr; - else if (d.u.sym->type == SYMBOL) + else if (d.u.sym->type == vSYMBOL) d.u.i = d.u.sym->u.i; else warning("c_eval: unhandled type: %s", d.type2str()); @@ -288,7 +288,7 @@ void Lingo::c_add() { Datum d2 = g_lingo->pop(); Datum d1 = g_lingo->pop(); - if (g_lingo->alignTypes(d1, d2) == FLOAT) { + if (g_lingo->alignTypes(d1, d2) == vFLOAT) { d1.u.f += d2.u.f; } else { d1.u.i += d2.u.i; @@ -300,7 +300,7 @@ void Lingo::c_sub() { Datum d2 = g_lingo->pop(); Datum d1 = g_lingo->pop(); - if (g_lingo->alignTypes(d1, d2) == FLOAT) { + if (g_lingo->alignTypes(d1, d2) == vFLOAT) { d1.u.f -= d2.u.f; } else { d1.u.i -= d2.u.i; @@ -312,7 +312,7 @@ void Lingo::c_mul() { Datum d2 = g_lingo->pop(); Datum d1 = g_lingo->pop(); - if (g_lingo->alignTypes(d1, d2) == FLOAT) { + if (g_lingo->alignTypes(d1, d2) == vFLOAT) { d1.u.f *= d2.u.f; } else { d1.u.i *= d2.u.i; @@ -323,13 +323,13 @@ void Lingo::c_mul() { void Lingo::c_div() { Datum d2 = g_lingo->pop(); - if ((d2.type == INT && d2.u.i == 0) || - (d2.type == FLOAT && d2.u.f == 0.0)) + if ((d2.type == vINT && d2.u.i == 0) || + (d2.type == vFLOAT && d2.u.f == 0.0)) error("division by zero"); Datum d1 = g_lingo->pop(); - if (g_lingo->alignTypes(d1, d2) == FLOAT) { + if (g_lingo->alignTypes(d1, d2) == vFLOAT) { d1.u.f /= d2.u.f; } else { d1.u.i /= d2.u.i; @@ -340,9 +340,9 @@ void Lingo::c_div() { void Lingo::c_negate() { Datum d = g_lingo->pop(); - if (d.type == INT) + if (d.type == vINT) d.u.i = -d.u.i; - else if (d.type == FLOAT) + else if (d.type == vFLOAT) d.u.f = -d.u.f; g_lingo->push(d); @@ -394,7 +394,7 @@ void Lingo::c_contains() { delete s1; delete s2; - d1.type = INT; + d1.type = vINT; d1.u.i = res; g_lingo->push(d1); @@ -417,7 +417,7 @@ void Lingo::c_starts() { delete s1; delete s2; - d1.type = INT; + d1.type = vINT; d1.u.i = res; g_lingo->push(d1); @@ -479,9 +479,9 @@ void Lingo::c_eq() { Datum d2 = g_lingo->pop(); Datum d1 = g_lingo->pop(); - if (g_lingo->alignTypes(d1, d2) == FLOAT) { + if (g_lingo->alignTypes(d1, d2) == vFLOAT) { d1.u.i = (d1.u.f == d2.u.f) ? 1 : 0; - d1.type = INT; + d1.type = vINT; } else { d1.u.i = (d1.u.i == d2.u.i) ? 1 : 0; } @@ -492,9 +492,9 @@ void Lingo::c_neq() { Datum d2 = g_lingo->pop(); Datum d1 = g_lingo->pop(); - if (g_lingo->alignTypes(d1, d2) == FLOAT) { + if (g_lingo->alignTypes(d1, d2) == vFLOAT) { d1.u.i = (d1.u.f != d2.u.f) ? 1 : 0; - d1.type = INT; + d1.type = vINT; } else { d1.u.i = (d1.u.i != d2.u.i) ? 1 : 0; } @@ -505,9 +505,9 @@ void Lingo::c_gt() { Datum d2 = g_lingo->pop(); Datum d1 = g_lingo->pop(); - if (g_lingo->alignTypes(d1, d2) == FLOAT) { + if (g_lingo->alignTypes(d1, d2) == vFLOAT) { d1.u.i = (d1.u.f > d2.u.f) ? 1 : 0; - d1.type = INT; + d1.type = vINT; } else { d1.u.i = (d1.u.i > d2.u.i) ? 1 : 0; } @@ -518,9 +518,9 @@ void Lingo::c_lt() { Datum d2 = g_lingo->pop(); Datum d1 = g_lingo->pop(); - if (g_lingo->alignTypes(d1, d2) == FLOAT) { + if (g_lingo->alignTypes(d1, d2) == vFLOAT) { d1.u.i = (d1.u.f < d2.u.f) ? 1 : 0; - d1.type = INT; + d1.type = vINT; } else { d1.u.i = (d1.u.i < d2.u.i) ? 1 : 0; } @@ -531,9 +531,9 @@ void Lingo::c_ge() { Datum d2 = g_lingo->pop(); Datum d1 = g_lingo->pop(); - if (g_lingo->alignTypes(d1, d2) == FLOAT) { + if (g_lingo->alignTypes(d1, d2) == vFLOAT) { d1.u.i = (d1.u.f >= d2.u.f) ? 1 : 0; - d1.type = INT; + d1.type = vINT; } else { d1.u.i = (d1.u.i >= d2.u.i) ? 1 : 0; } @@ -544,9 +544,9 @@ void Lingo::c_le() { Datum d2 = g_lingo->pop(); Datum d1 = g_lingo->pop(); - if (g_lingo->alignTypes(d1, d2) == FLOAT) { + if (g_lingo->alignTypes(d1, d2) == vFLOAT) { d1.u.i = (d1.u.f <= d2.u.f) ? 1 : 0; - d1.type = INT; + d1.type = vINT; } else { d1.u.i = (d1.u.i <= d2.u.i) ? 1 : 0; } @@ -590,7 +590,7 @@ void Lingo::c_repeatwithcode(void) { Common::String countername((char *)&(*g_lingo->_currentScript)[savepc + 5]); Symbol *counter = g_lingo->lookupVar(countername.c_str()); - if (counter->type == CASTREF) { + if (counter->type == vCASTREF) { error("Cast ref used as index: %s", countername.c_str()); } @@ -598,7 +598,7 @@ void Lingo::c_repeatwithcode(void) { d = g_lingo->pop(); d.toInt(); counter->u.i = d.u.i; - counter->type = INT; + counter->type = vINT; while (true) { g_lingo->execute(body); /* body */ @@ -714,7 +714,7 @@ void Lingo::c_call() { g_lingo->pop(); } - if (sym->type == BLTIN) { + if (sym->type == vBLTIN) { if (sym->nargs > 0 && nargs < sym->nargs) { warning("Too few arguments for function %s. Expecting %d but got %d", name.c_str(), sym->nargs, nargs); for (int i = 0; i < nargs; i++) @@ -733,7 +733,7 @@ void Lingo::c_call() { Datum d; d.u.i = 0; - d.type = VOIDVAL; + d.type = vVOID; g_lingo->push(d); } diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp index 885b6a2a55..6c5b5e6bc7 100644 --- a/engines/director/lingo/lingo-codegen.cpp +++ b/engines/director/lingo/lingo-codegen.cpp @@ -80,7 +80,7 @@ Symbol *Lingo::lookupVar(const char *name, bool create, bool putInGlobalList) { int val = (tolower(name[0]) - 'a') * 64 + (name[1] - '1') * 8 + (name[2] - '1') + 1; sym = new Symbol; - sym->type = CASTREF; + sym->type = vCASTREF; sym->u.i = val; return sym; @@ -95,7 +95,7 @@ Symbol *Lingo::lookupVar(const char *name, bool create, bool putInGlobalList) { sym = new Symbol; sym->name = (char *)calloc(strlen(name) + 1, 1); Common::strlcpy(sym->name, name, strlen(name) + 1); - sym->type = VOIDVAL; + sym->type = vVOID; sym->u.i = 0; (*_localvars)[name] = sym; @@ -136,7 +136,7 @@ void Lingo::define(Common::String &name, int start, int nargs, Common::String *p sym->name = (char *)calloc(name.size() + 1, 1); Common::strlcpy(sym->name, name.c_str(), name.size() + 1); - sym->type = HANDLER; + sym->type = vHANDLER; _handlers[name] = sym; } else { diff --git a/engines/director/lingo/lingo-gr.cpp b/engines/director/lingo/lingo-gr.cpp index 58789d2ae3..ce6e11b295 100644 --- a/engines/director/lingo/lingo-gr.cpp +++ b/engines/director/lingo/lingo-gr.cpp @@ -66,23 +66,23 @@ /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { - CASTREF = 258, - UNARY = 259, - VOIDVAL = 260, - VAR = 261, - POINT = 262, - RECT = 263, - ARRAY = 264, - SYMBOL = 265, - INT = 266, - THEENTITY = 267, - THEENTITYWITHID = 268, - FLOAT = 269, - BLTIN = 270, - BLTINNOARGS = 271, - ID = 272, - STRING = 273, - HANDLER = 274, + UNARY = 258, + vCASTREF = 259, + vVOID = 260, + vVAR = 261, + vPOINT = 262, + vRECT = 263, + vARRAY = 264, + vSYMBOL = 265, + vINT = 266, + vTHEENTITY = 267, + vTHEENTITYWITHID = 268, + vFLOAT = 269, + vBLTIN = 270, + vBLTINNOARGS = 271, + vSTRING = 272, + vHANDLER = 273, + ID = 274, tDOWN = 275, tELSE = 276, tNLELSIF = 277, @@ -130,23 +130,23 @@ }; #endif /* Tokens. */ -#define CASTREF 258 -#define UNARY 259 -#define VOIDVAL 260 -#define VAR 261 -#define POINT 262 -#define RECT 263 -#define ARRAY 264 -#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 UNARY 258 +#define vCASTREF 259 +#define vVOID 260 +#define vVAR 261 +#define vPOINT 262 +#define vRECT 263 +#define vARRAY 264 +#define vSYMBOL 265 +#define vINT 266 +#define vTHEENTITY 267 +#define vTHEENTITYWITHID 268 +#define vFLOAT 269 +#define vBLTIN 270 +#define vBLTINNOARGS 271 +#define vSTRING 272 +#define vHANDLER 273 +#define ID 274 #define tDOWN 275 #define tELSE 276 #define tNLELSIF 277 @@ -476,7 +476,7 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 77 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 712 +#define YYLAST 719 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 77 @@ -555,15 +555,15 @@ static const yytype_int8 yyrhs[] = { 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, 81, -1, 83, -1, 38, 98, 29, 19, -1, + 40, 19, 64, 98, -1, 40, 12, 64, 98, -1, + 40, 13, 98, 64, 98, -1, 40, 19, 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, + 96, 23, 39, -1, 43, 19, 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, @@ -574,10 +574,10 @@ static const yytype_int8 yyrhs[] = -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, + -1, 39, 45, -1, 39, 44, 19, -1, 28, -1, 22, -1, -1, -1, -1, 97, 79, -1, 97, 83, - -1, 11, -1, 14, -1, 18, -1, 16, -1, 17, - 71, 110, 72, -1, 17, -1, 12, -1, 13, 98, + -1, 11, -1, 14, -1, 17, -1, 16, -1, 19, + 71, 110, 72, -1, 19, -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, @@ -586,35 +586,35 @@ static const yytype_int8 yyrhs[] = 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, 61, 98, 63, 98, -1, 32, 17, -1, 33, + 19, -1, 38, 98, -1, 101, -1, 24, -1, 26, + 100, -1, 19, -1, 100, 76, 19, -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, + 27, 102, 103, -1, 27, 103, -1, 42, 25, 17, + -1, 25, 17, -1, 42, 17, -1, 17, -1, 36, + 34, 17, -1, 34, 17, -1, 42, 34, 17, -1, + -1, 31, 19, 105, 95, 107, 79, 108, 97, -1, + 47, 19, -1, -1, 48, 19, 106, 95, 107, 79, + 108, 97, -1, -1, 19, -1, 107, 76, 19, -1, + 107, 79, 76, 19, -1, -1, 19, 95, 110, -1, -1, 98, -1, 110, 76, 98, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 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, 358, 361, - 365, 372, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, - 396, 397, 398, 399, 402, 403, 404, 405, 406, 408, - 411, 412, 423, 424, 425, 426, 431, 437, 444, 445, - 446, 447, 450, 451, 452, 480, 480, 486, 489, 489, - 495, 496, 497, 498, 500, 504, 512, 513, 514 + 0, 104, 104, 105, 106, 109, 114, 115, 116, 117, + 118, 119, 122, 128, 134, 142, 150, 156, 164, 173, + 174, 176, 177, 182, 193, 209, 221, 226, 233, 242, + 251, 261, 271, 282, 283, 286, 287, 290, 291, 294, + 302, 303, 311, 312, 313, 315, 317, 323, 329, 336, + 338, 340, 341, 342, 345, 350, 353, 356, 360, 363, + 367, 374, 380, 381, 382, 383, 384, 385, 386, 387, + 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 404, 405, 406, 407, 408, 410, + 413, 414, 425, 426, 427, 428, 433, 439, 446, 447, + 448, 449, 452, 453, 454, 482, 482, 488, 491, 491, + 497, 498, 499, 500, 502, 506, 514, 515, 516 }; #endif @@ -623,18 +623,18 @@ static const yytype_uint16 yyrline[] = First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "CASTREF", "UNARY", "VOIDVAL", "VAR", - "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", + "$end", "error", "$undefined", "UNARY", "vCASTREF", "vVOID", "vVAR", + "vPOINT", "vRECT", "vARRAY", "vSYMBOL", "vINT", "vTHEENTITY", + "vTHEENTITYWITHID", "vFLOAT", "vBLTIN", "vBLTINNOARGS", "vSTRING", + "vHANDLER", "ID", "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", @@ -698,7 +698,7 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 0, 0, 54, 60, 0, 55, 57, 49, 56, 88, + 0, 0, 54, 60, 0, 55, 57, 56, 49, 88, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 62, 21, 11, 22, 0, 0, 0, 19, 8, 87, 7, @@ -737,44 +737,44 @@ static const yytype_int16 yydefgoto[] = /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -189 +#define YYPACT_NINF -187 static const yytype_int16 yypact[] = { - 201, -49, -189, -189, 420, -189, -189, 610, -189, -189, - 6, 17, -189, 15, 18, 48, 420, 29, 59, 50, - 52, 58, 420, 420, 420, 420, 420, 10, -189, 16, - -189, -189, -189, 7, 39, 432, 588, -189, -189, -189, - -189, -189, 35, 420, -189, 588, 420, 420, -189, 36, - -189, 99, -189, 100, -189, 87, -189, 30, 24, -189, - -189, -189, -189, 446, 115, -189, -27, 420, -20, 92, - -189, -189, 55, 490, 55, 55, 539, -189, -189, 262, - 432, 420, 432, 93, 566, 420, 420, 420, 420, 420, - 420, 420, 420, 420, 420, 420, 420, 420, 420, 420, - 446, 588, -52, 60, 121, -189, -189, 124, -189, 126, - 127, 105, -189, -189, 129, -189, 420, 420, 468, 420, - 420, 420, -189, 420, 420, -189, -189, 75, 588, 76, - 512, 79, 420, 588, 588, 588, 588, 588, 588, 588, - 588, 637, 637, 55, 55, 588, 588, 588, -189, 420, - -189, -189, -189, -189, 136, -189, 588, 588, 420, 420, - 588, 588, 588, 136, 588, 588, -189, 21, -189, -189, - 390, 588, 588, -189, -8, 588, 588, -8, 318, 113, - 420, 318, -189, -189, 139, 81, 81, -189, -189, 137, - 420, 588, -12, -13, -189, 142, -189, -189, 125, 588, - -189, 135, -189, 144, -189, -189, 144, -189, 432, -189, - 318, 318, -189, -189, 318, -189, 318, 144, 144, -189, - 432, 390, -189, 122, 128, 318, 147, 148, -189, 149, - 133, -189, -189, -189, -189, 154, 140, 150, 152, -9, - -189, 390, -189, 354, 143, -189, -189, -189, 318, -189, - -189, -189, -189, -189 + 188, -39, -187, -187, 407, -187, -187, -187, 617, -187, + 40, 122, -187, 43, 26, 48, 407, 28, 52, 49, + 51, 55, 407, 407, 407, 407, 407, 15, -187, 33, + -187, -187, -187, 4, 13, 439, 595, -187, -187, -187, + -187, -187, 34, 407, -187, 595, 407, 407, -187, 5, + -187, 91, -187, 92, -187, 76, -187, 17, 24, -187, + -187, -187, -187, 453, 93, -187, -29, 407, -23, 70, + -187, -187, 121, 497, 121, 121, 546, -187, -187, 249, + 439, 407, 439, 72, 573, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 453, 595, -22, 38, 97, -187, -187, 100, -187, 103, + 110, 94, -187, -187, 114, -187, 407, 407, 475, 407, + 407, 407, -187, 407, 407, -187, -187, 57, 595, 64, + 519, 68, 407, 595, 595, 595, 595, 595, 595, 595, + 595, 644, 644, 121, 121, 595, 595, 595, -187, 407, + -187, -187, -187, -187, 124, -187, 595, 595, 407, 407, + 595, 595, 595, 124, 595, 595, -187, 10, -187, -187, + 377, 595, 595, -187, -54, 595, 595, -54, 305, 98, + 407, 305, -187, -187, 125, 65, 65, -187, -187, 123, + 407, 595, -6, -8, -187, 126, -187, -187, 115, 595, + -187, 127, -187, 140, -187, -187, 140, -187, 439, -187, + 305, 305, -187, -187, 305, -187, 305, 140, 140, -187, + 439, 377, -187, 117, 108, 305, 142, 143, -187, 144, + 128, -187, -187, -187, -187, 145, 133, 150, 155, -13, + -187, 377, -187, 341, 134, -187, -187, -187, 305, -187, + -187, -187, -187, -187 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -189, -189, -23, 88, 2, -164, 0, -189, -189, -189, - -5, -188, -36, -77, -189, -189, -189, -186, -6, -41, - -157, 3, 8, -189, -189, -189, 131, -189, -189, -189, - 22, 1, -189, 151 + -187, -187, -24, 105, 7, -165, 0, -187, -187, -187, + -3, -186, -31, -78, -187, -187, -187, -164, -7, -170, + -65, 2, 23, -187, -187, -187, 129, -187, -187, -187, + 30, 11, -187, 156 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -784,181 +784,181 @@ static const yytype_int16 yypgoto[] = #define YYTABLE_NINF -60 static const yytype_int16 yytable[] = { - 31, 47, 29, 127, 79, 129, 182, 45, 37, 204, - 77, 201, 181, -51, -51, 116, -10, 220, 222, 63, - 148, 41, 119, 48, 149, 72, 73, 74, 75, 76, - 222, 220, 60, 205, 202, 50, 61, 117, 84, 210, - 211, 179, 51, 214, 120, 216, 100, 52, 108, 101, - 101, 53, 54, 55, 56, 109, 225, 231, 53, 57, - 55, -51, 78, 180, 110, 62, 111, 69, 184, 70, - 118, 66, 67, 64, 65, 71, 68, 249, 80, 31, - 78, 29, 248, 84, 128, 130, -10, 37, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 81, 85, 86, 46, 154, 169, 87, - 88, 89, 104, 90, 91, 92, 163, 105, 106, 156, - 157, 107, 160, 161, 162, 170, 164, 165, 97, 98, - 99, 224, 115, 121, 131, 171, 149, 189, 150, 110, - 192, 193, 151, 230, 152, 153, 155, 166, 168, 78, - 200, 185, 172, 173, 186, 190, 194, 195, 213, 209, - 198, 175, 176, 215, 212, 223, 204, 126, 232, 234, - 236, 237, 238, 226, 239, 227, 229, 244, 246, 245, - 247, 228, 251, 191, 235, 177, 203, 197, 206, 112, - 240, 0, 242, 199, 0, 0, 0, 0, 103, 221, - 0, -6, 1, 0, 0, 0, 0, 252, 0, 253, - 0, 84, 2, 3, 4, 5, 0, 6, 7, 8, - 0, 0, 0, 84, 0, 9, 241, 10, 11, 12, - 0, 0, 13, 14, 15, 0, 0, 0, 0, 16, - 17, 18, 0, 250, 19, 0, 0, 0, 20, 21, - 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, - 0, 0, 23, 0, 0, 0, 24, 25, 0, 0, - 0, -6, 26, 2, 3, 4, 5, 0, 6, 7, - 8, 0, 0, 0, 0, 0, 9, 0, 10, 11, - 12, 0, 0, 13, 14, 15, 0, 0, 0, 0, - 16, 17, 18, 0, 0, 19, 0, 0, 0, 20, - 21, 0, 0, 0, 0, 0, 0, 0, 0, 22, - 0, 0, 0, 23, 0, 0, 0, 24, 25, 2, - 3, 4, 5, 26, 6, 42, 8, 0, 0, 0, - 0, 0, 9, 0, 10, 11, 12, 0, 0, 0, - 14, 15, 0, 0, 0, 0, 16, 17, 18, 0, - 0, 19, 0, 0, 0, 2, 3, 4, 5, 0, - 6, 42, 8, 0, 0, 22, 0, 0, 9, 23, - 10, 11, 12, 24, 25, 0, 14, 15, 78, 26, - 0, 0, 16, 17, 18, 0, 0, 19, 0, 0, - 0, 2, 3, 4, 5, 0, 6, 42, 8, 0, - 0, 22, 0, 0, 9, 23, 10, 11, 0, 24, - 25, 0, 14, 15, 0, 26, 0, 0, 16, 0, - 18, 2, 3, 4, 5, 0, 6, 42, 8, 0, - 0, 0, 0, 2, 3, 4, 5, 22, 6, 42, - 8, 23, 0, 0, 0, 24, 25, 0, 43, 0, - 18, 26, 0, 0, 0, 0, 0, 0, 0, 0, - 43, 0, 18, 0, 0, 114, 0, 22, 0, 0, - 0, 23, 0, 0, 0, 24, 25, 0, 0, 22, - 0, 26, 0, 23, 0, 85, 86, 24, 25, 0, - 87, 88, 89, 82, 90, 91, 92, 0, 0, 0, - 158, 93, 94, 95, 96, 0, 0, 85, 86, 97, - 98, 99, 87, 88, 89, 0, 90, 91, 92, 0, - 0, 0, 159, 93, 94, 95, 96, 0, 0, 85, - 86, 97, 98, 99, 87, 88, 89, 0, 90, 91, - 92, 0, 123, 124, 0, 93, 94, 95, 96, 0, - 0, 85, 86, 97, 98, 99, 87, 88, 89, 0, - 90, 91, 92, 0, 0, 0, 132, 93, 94, 95, - 96, 0, 0, 0, 125, 97, 98, 99, 85, 86, - 0, 0, 0, 87, 88, 89, 0, 90, 91, 92, - 0, 0, 0, 0, 93, 94, 95, 96, 0, 0, + 31, 47, 127, 79, 129, 182, 45, 29, 189, -51, + -51, 192, 193, 116, 204, 77, 78, 201, 63, 119, + 222, 200, 184, 37, 72, 73, 74, 75, 76, 213, + 179, 41, 222, -10, 108, 117, 223, 84, 205, 220, + 202, 120, 109, 61, 226, 100, 227, 229, 101, 101, + 148, 110, 180, 220, 149, 235, 231, -51, 53, 48, + 55, 240, 60, 242, 66, 67, 111, 62, 69, 118, + 70, 68, 64, 65, 71, 80, 249, 81, 252, 31, + 253, 104, 84, 128, 130, 78, 29, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 37, -10, 181, 46, 154, 169, 105, 106, + 107, 121, 115, 131, 149, 163, 150, 151, 156, 157, + 152, 160, 161, 162, 170, 164, 165, 153, 110, 166, + 224, 210, 211, 155, 171, 214, 168, 216, 78, 50, + 190, 195, 230, 173, 194, 209, 198, 51, 225, 234, + 185, 172, 52, 186, 212, 215, 53, 54, 55, 56, + 175, 176, 204, 232, 57, 236, 237, 238, 244, 239, + 85, 86, 245, 251, 248, 87, 88, 89, 246, 90, + 91, 92, 191, 247, 126, 203, 228, 112, -6, 1, + 206, 0, 199, 177, 97, 98, 99, 197, 221, 2, + 3, 4, 5, 103, 6, 7, 0, 8, 0, 0, + 84, 0, 9, 0, 10, 11, 12, 0, 0, 13, + 14, 15, 84, 0, 0, 241, 16, 17, 18, 0, + 0, 19, 0, 0, 0, 20, 21, 0, 0, 0, + 0, 0, 0, 250, 0, 22, 0, 0, 0, 23, + 0, 0, 0, 24, 25, 0, 0, 0, -6, 26, + 2, 3, 4, 5, 0, 6, 7, 0, 8, 0, + 0, 0, 0, 9, 0, 10, 11, 12, 0, 0, + 13, 14, 15, 0, 0, 0, 0, 16, 17, 18, + 0, 0, 19, 0, 0, 0, 20, 21, 0, 0, + 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, + 23, 0, 0, 0, 24, 25, 2, 3, 4, 5, + 26, 6, 7, 0, 42, 0, 0, 0, 0, 9, + 0, 10, 11, 12, 0, 0, 0, 14, 15, 0, + 0, 0, 0, 16, 17, 18, 0, 0, 19, 0, + 0, 0, 2, 3, 4, 5, 0, 6, 7, 0, + 42, 0, 22, 0, 0, 9, 23, 10, 11, 12, + 24, 25, 0, 14, 15, 78, 26, 0, 0, 16, + 17, 18, 0, 0, 19, 0, 0, 0, 2, 3, + 4, 5, 0, 6, 7, 0, 42, 0, 22, 0, + 0, 9, 23, 10, 11, 0, 24, 25, 0, 14, + 15, 0, 26, 0, 0, 16, 0, 18, 2, 3, + 4, 5, 0, 6, 7, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 22, 0, 0, 0, 23, 0, + 0, 0, 24, 25, 0, 43, 0, 18, 26, 0, + 2, 3, 4, 5, 0, 6, 7, 0, 42, 0, + 0, 0, 0, 0, 22, 0, 0, 0, 23, 0, + 0, 0, 24, 25, 0, 0, 0, 43, 26, 18, + 0, 0, 114, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, + 23, 0, 85, 86, 24, 25, 0, 87, 88, 89, + 82, 90, 91, 92, 0, 0, 0, 158, 93, 94, + 95, 96, 0, 0, 85, 86, 97, 98, 99, 87, + 88, 89, 0, 90, 91, 92, 0, 0, 0, 159, + 93, 94, 95, 96, 0, 0, 85, 86, 97, 98, + 99, 87, 88, 89, 0, 90, 91, 92, 0, 123, + 124, 0, 93, 94, 95, 96, 0, 0, 85, 86, + 97, 98, 99, 87, 88, 89, 0, 90, 91, 92, + 0, 0, 0, 132, 93, 94, 95, 96, 0, 0, 0, 125, 97, 98, 99, 85, 86, 0, 0, 0, 87, 88, 89, 0, 90, 91, 92, 0, 0, 0, - 132, 93, 94, 95, 96, 0, 0, 85, 86, 97, - 98, 99, 87, 88, 89, 0, 90, 91, 92, 0, - 0, 0, 0, 93, 94, 95, 96, 0, 0, -59, - -59, 97, 98, 99, -59, -59, -59, 0, -59, -59, - -59, 0, 0, 0, 0, 0, 0, -59, -59, 0, - 0, 46, 0, -59, -59, -59, 85, 86, 0, 0, - 0, 87, 88, 89, 0, 90, 91, 92, 0, 0, - 0, 0, 0, 0, 95, 96, 0, 0, 0, 0, - 97, 98, 99 + 0, 93, 94, 95, 96, 0, 0, 0, 125, 97, + 98, 99, 85, 86, 0, 0, 0, 87, 88, 89, + 0, 90, 91, 92, 0, 0, 0, 132, 93, 94, + 95, 96, 0, 0, 85, 86, 97, 98, 99, 87, + 88, 89, 0, 90, 91, 92, 0, 0, 0, 0, + 93, 94, 95, 96, 0, 0, -59, -59, 97, 98, + 99, -59, -59, -59, 0, -59, -59, -59, 0, 0, + 0, 0, 0, 0, -59, -59, 0, 0, 46, 0, + -59, -59, -59, 85, 86, 0, 0, 0, 87, 88, + 89, 0, 90, 91, 92, 0, 0, 0, 0, 0, + 0, 95, 96, 0, 0, 0, 0, 97, 98, 99 }; static const yytype_int16 yycheck[] = { - 0, 7, 0, 80, 27, 82, 170, 4, 0, 22, - 0, 23, 169, 22, 23, 42, 0, 203, 206, 16, - 72, 70, 42, 17, 76, 22, 23, 24, 25, 26, - 218, 217, 17, 46, 46, 18, 18, 64, 35, 196, - 197, 20, 25, 200, 64, 202, 43, 30, 18, 46, - 47, 34, 35, 36, 37, 25, 213, 221, 34, 42, - 36, 70, 70, 42, 34, 17, 42, 17, 76, 17, - 67, 12, 13, 44, 45, 17, 17, 241, 71, 79, - 70, 79, 239, 80, 81, 82, 70, 79, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 64, 49, 50, 71, 113, 131, 54, - 55, 56, 76, 58, 59, 60, 122, 18, 18, 116, - 117, 34, 119, 120, 121, 131, 123, 124, 73, 74, - 75, 208, 17, 41, 41, 132, 76, 178, 17, 34, - 181, 182, 18, 220, 18, 18, 17, 72, 72, 70, - 191, 174, 149, 17, 177, 42, 17, 76, 199, 17, - 23, 158, 159, 28, 39, 206, 22, 79, 46, 41, - 23, 23, 23, 214, 41, 216, 217, 23, 28, 39, - 28, 217, 39, 180, 225, 163, 192, 186, 193, 58, - 231, -1, 233, 190, -1, -1, -1, -1, 47, 205, - -1, 0, 1, -1, -1, -1, -1, 248, -1, 250, - -1, 208, 11, 12, 13, 14, -1, 16, 17, 18, - -1, -1, -1, 220, -1, 24, 232, 26, 27, 28, - -1, -1, 31, 32, 33, -1, -1, -1, -1, 38, - 39, 40, -1, 243, 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, -1, 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, -1, -1, -1, 47, - 48, -1, -1, -1, -1, -1, -1, -1, -1, 57, - -1, -1, -1, 61, -1, -1, -1, 65, 66, 11, - 12, 13, 14, 71, 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, -1, - 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, -1, 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, -1, 16, 17, 18, -1, - -1, -1, -1, 11, 12, 13, 14, 57, 16, 17, - 18, 61, -1, -1, -1, 65, 66, -1, 38, -1, - 40, 71, -1, -1, -1, -1, -1, -1, -1, -1, - 38, -1, 40, -1, -1, 29, -1, 57, -1, -1, - -1, 61, -1, -1, -1, 65, 66, -1, -1, 57, - -1, 71, -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, + 0, 8, 80, 27, 82, 170, 4, 0, 178, 22, + 23, 181, 182, 42, 22, 0, 70, 23, 16, 42, + 206, 191, 76, 0, 22, 23, 24, 25, 26, 199, + 20, 70, 218, 0, 17, 64, 206, 35, 46, 203, + 46, 64, 25, 17, 214, 43, 216, 217, 46, 47, + 72, 34, 42, 217, 76, 225, 221, 70, 34, 19, + 36, 231, 19, 233, 12, 13, 42, 19, 19, 67, + 19, 19, 44, 45, 19, 71, 241, 64, 248, 79, + 250, 76, 80, 81, 82, 70, 79, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 79, 70, 169, 71, 113, 131, 17, 17, + 34, 41, 19, 41, 76, 122, 19, 17, 116, 117, + 17, 119, 120, 121, 131, 123, 124, 17, 34, 72, + 208, 196, 197, 19, 132, 200, 72, 202, 70, 17, + 42, 76, 220, 19, 19, 19, 23, 25, 213, 41, + 174, 149, 30, 177, 39, 28, 34, 35, 36, 37, + 158, 159, 22, 46, 42, 23, 23, 23, 23, 41, + 49, 50, 39, 39, 239, 54, 55, 56, 28, 58, + 59, 60, 180, 28, 79, 192, 217, 58, 0, 1, + 193, -1, 190, 163, 73, 74, 75, 186, 205, 11, + 12, 13, 14, 47, 16, 17, -1, 19, -1, -1, + 208, -1, 24, -1, 26, 27, 28, -1, -1, 31, + 32, 33, 220, -1, -1, 232, 38, 39, 40, -1, + -1, 43, -1, -1, -1, 47, 48, -1, -1, -1, + -1, -1, -1, 243, -1, 57, -1, -1, -1, 61, + -1, -1, -1, 65, 66, -1, -1, -1, 70, 71, + 11, 12, 13, 14, -1, 16, 17, -1, 19, -1, + -1, -1, -1, 24, -1, 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, 11, 12, 13, 14, + 71, 16, 17, -1, 19, -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, -1, 16, 17, -1, + 19, -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, -1, 16, 17, -1, 19, -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, -1, 16, 17, -1, 19, -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, -1, 16, 17, -1, 19, -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, - 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, 49, 50, -1, -1, - -1, 54, 55, 56, -1, 58, 59, 60, -1, -1, - -1, -1, -1, -1, 67, 68, -1, -1, -1, -1, - 73, 74, 75 + -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, 49, 50, -1, -1, -1, 54, 55, + 56, -1, 58, 59, 60, -1, -1, -1, -1, -1, + -1, 67, 68, -1, -1, -1, -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, 11, 12, 13, 14, 16, 17, 18, 24, + 0, 1, 11, 12, 13, 14, 16, 17, 19, 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, 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, + 109, 70, 19, 38, 81, 98, 71, 95, 19, 100, + 17, 25, 30, 34, 35, 36, 37, 42, 102, 103, + 19, 17, 19, 98, 44, 45, 12, 13, 19, 19, + 19, 19, 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, 76, 18, 18, 34, 18, 25, - 34, 42, 103, 105, 29, 17, 42, 64, 98, 42, + 98, 98, 110, 110, 76, 17, 17, 34, 17, 25, + 34, 42, 103, 105, 29, 19, 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, - 17, 18, 18, 18, 95, 17, 98, 98, 42, 64, + 19, 17, 17, 17, 95, 19, 98, 98, 42, 64, 98, 98, 98, 95, 98, 98, 72, 96, 72, 79, - 95, 98, 98, 17, 107, 98, 98, 107, 97, 20, + 95, 98, 98, 19, 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, + 42, 98, 96, 96, 19, 76, 108, 108, 23, 98, + 96, 23, 46, 95, 22, 46, 87, 88, 94, 19, 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, @@ -1778,12 +1778,12 @@ yyreduce: switch (yyn) { case 4: -#line 104 "engines/director/lingo/lingo-gr.y" +#line 106 "engines/director/lingo/lingo-gr.y" { yyerrok; ;} break; case 5: -#line 107 "engines/director/lingo/lingo-gr.y" +#line 109 "engines/director/lingo/lingo-gr.y" { g_lingo->_linenumber++; g_lingo->_colnumber = 1; @@ -1791,12 +1791,12 @@ yyreduce: break; case 10: -#line 116 "engines/director/lingo/lingo-gr.y" +#line 118 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_xpop); ;} break; case 12: -#line 120 "engines/director/lingo/lingo-gr.y" +#line 122 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_varpush); g_lingo->codeString((yyvsp[(4) - (4)].s)->c_str()); @@ -1806,7 +1806,7 @@ yyreduce: break; case 13: -#line 126 "engines/director/lingo/lingo-gr.y" +#line 128 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_varpush); g_lingo->codeString((yyvsp[(2) - (4)].s)->c_str()); @@ -1816,7 +1816,7 @@ yyreduce: break; case 14: -#line 132 "engines/director/lingo/lingo-gr.y" +#line 134 "engines/director/lingo/lingo-gr.y" { g_lingo->code2(g_lingo->c_constpush, 0); // Put dummy id g_lingo->code1(g_lingo->c_theentityassign); @@ -1828,7 +1828,7 @@ yyreduce: break; case 15: -#line 140 "engines/director/lingo/lingo-gr.y" +#line 142 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_swap); g_lingo->code1(g_lingo->c_theentityassign); @@ -1840,7 +1840,7 @@ yyreduce: break; case 16: -#line 148 "engines/director/lingo/lingo-gr.y" +#line 150 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_varpush); g_lingo->codeString((yyvsp[(2) - (4)].s)->c_str()); @@ -1850,7 +1850,7 @@ yyreduce: break; case 17: -#line 154 "engines/director/lingo/lingo-gr.y" +#line 156 "engines/director/lingo/lingo-gr.y" { g_lingo->code2(g_lingo->c_constpush, 0); // Put dummy id g_lingo->code1(g_lingo->c_theentityassign); @@ -1862,7 +1862,7 @@ yyreduce: break; case 18: -#line 162 "engines/director/lingo/lingo-gr.y" +#line 164 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_swap); g_lingo->code1(g_lingo->c_theentityassign); @@ -1874,12 +1874,12 @@ yyreduce: break; case 19: -#line 171 "engines/director/lingo/lingo-gr.y" +#line 173 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_xpop); ;} break; case 23: -#line 180 "engines/director/lingo/lingo-gr.y" +#line 182 "engines/director/lingo/lingo-gr.y" { inst body = 0, end = 0; WRITE_UINT32(&body, (yyvsp[(5) - (8)].code)); @@ -1889,7 +1889,7 @@ yyreduce: break; case 24: -#line 191 "engines/director/lingo/lingo-gr.y" +#line 193 "engines/director/lingo/lingo-gr.y" { inst init = 0, finish = 0, body = 0, end = 0, inc = 0; WRITE_UINT32(&init, (yyvsp[(3) - (11)].code)); @@ -1905,7 +1905,7 @@ yyreduce: break; case 25: -#line 207 "engines/director/lingo/lingo-gr.y" +#line 209 "engines/director/lingo/lingo-gr.y" { inst init = 0, finish = 0, body = 0, end = 0, inc = 0; WRITE_UINT32(&init, (yyvsp[(3) - (12)].code)); @@ -1921,14 +1921,14 @@ yyreduce: break; case 26: -#line 219 "engines/director/lingo/lingo-gr.y" +#line 221 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_ifcode); ;} break; case 27: -#line 224 "engines/director/lingo/lingo-gr.y" +#line 226 "engines/director/lingo/lingo-gr.y" { inst then = 0, end = 0; WRITE_UINT32(&then, (yyvsp[(5) - (8)].code)); @@ -1939,7 +1939,7 @@ yyreduce: break; case 28: -#line 231 "engines/director/lingo/lingo-gr.y" +#line 233 "engines/director/lingo/lingo-gr.y" { inst then = 0, else1 = 0, end = 0; WRITE_UINT32(&then, (yyvsp[(5) - (11)].code)); @@ -1952,7 +1952,7 @@ yyreduce: break; case 29: -#line 240 "engines/director/lingo/lingo-gr.y" +#line 242 "engines/director/lingo/lingo-gr.y" { inst then = 0, else1 = 0, end = 0; WRITE_UINT32(&then, (yyvsp[(5) - (11)].code)); @@ -1965,7 +1965,7 @@ yyreduce: break; case 30: -#line 249 "engines/director/lingo/lingo-gr.y" +#line 251 "engines/director/lingo/lingo-gr.y" { inst then = 0, else1 = 0, end = 0; WRITE_UINT32(&then, (yyvsp[(4) - (6)].code)); @@ -1979,7 +1979,7 @@ yyreduce: break; case 31: -#line 259 "engines/director/lingo/lingo-gr.y" +#line 261 "engines/director/lingo/lingo-gr.y" { inst then = 0, else1 = 0, end = 0; WRITE_UINT32(&then, (yyvsp[(4) - (10)].code)); @@ -1993,7 +1993,7 @@ yyreduce: break; case 32: -#line 269 "engines/director/lingo/lingo-gr.y" +#line 271 "engines/director/lingo/lingo-gr.y" { inst then = 0, else1 = 0, end = 0; WRITE_UINT32(&then, (yyvsp[(4) - (10)].code)); @@ -2007,17 +2007,17 @@ yyreduce: break; case 33: -#line 280 "engines/director/lingo/lingo-gr.y" +#line 282 "engines/director/lingo/lingo-gr.y" { (yyval.code) = 0; ;} break; case 34: -#line 281 "engines/director/lingo/lingo-gr.y" +#line 283 "engines/director/lingo/lingo-gr.y" { (yyval.code) = (yyvsp[(2) - (3)].code); ;} break; case 39: -#line 292 "engines/director/lingo/lingo-gr.y" +#line 294 "engines/director/lingo/lingo-gr.y" { inst then = 0; WRITE_UINT32(&then, (yyvsp[(4) - (6)].code)); @@ -2027,7 +2027,7 @@ yyreduce: break; case 41: -#line 301 "engines/director/lingo/lingo-gr.y" +#line 303 "engines/director/lingo/lingo-gr.y" { inst then = 0; WRITE_UINT32(&then, (yyvsp[(4) - (5)].code)); @@ -2037,22 +2037,22 @@ yyreduce: break; case 42: -#line 309 "engines/director/lingo/lingo-gr.y" +#line 311 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(STOP); ;} break; case 43: -#line 310 "engines/director/lingo/lingo-gr.y" +#line 312 "engines/director/lingo/lingo-gr.y" { g_lingo->code2(g_lingo->c_eq, STOP); ;} break; case 45: -#line 313 "engines/director/lingo/lingo-gr.y" +#line 315 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code3(g_lingo->c_repeatwhilecode, STOP, STOP); ;} break; case 46: -#line 315 "engines/director/lingo/lingo-gr.y" +#line 317 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code3(g_lingo->c_repeatwithcode, STOP, STOP); g_lingo->code3(STOP, STOP, STOP); @@ -2061,7 +2061,7 @@ yyreduce: break; case 47: -#line 321 "engines/director/lingo/lingo-gr.y" +#line 323 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_ifcode); g_lingo->code3(STOP, STOP, STOP); @@ -2070,7 +2070,7 @@ yyreduce: break; case 48: -#line 327 "engines/director/lingo/lingo-gr.y" +#line 329 "engines/director/lingo/lingo-gr.y" { inst skipEnd; WRITE_UINT32(&skipEnd, 1); // We have to skip end to avoid multiple executions @@ -2080,22 +2080,22 @@ yyreduce: break; case 49: -#line 334 "engines/director/lingo/lingo-gr.y" +#line 336 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->_currentScript->size(); ;} break; case 50: -#line 336 "engines/director/lingo/lingo-gr.y" +#line 338 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(STOP); (yyval.code) = g_lingo->_currentScript->size(); ;} break; case 51: -#line 338 "engines/director/lingo/lingo-gr.y" +#line 340 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->_currentScript->size(); ;} break; case 54: -#line 343 "engines/director/lingo/lingo-gr.y" +#line 345 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_constpush); inst i = 0; @@ -2104,21 +2104,21 @@ yyreduce: break; case 55: -#line 348 "engines/director/lingo/lingo-gr.y" +#line 350 "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 351 "engines/director/lingo/lingo-gr.y" +#line 353 "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 354 "engines/director/lingo/lingo-gr.y" +#line 356 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->_handlers[*(yyvsp[(1) - (1)].s)]->u.func); (yyval.code) = g_lingo->code2(g_lingo->c_constpush, 0); // Put dummy value @@ -2126,14 +2126,14 @@ yyreduce: break; case 58: -#line 358 "engines/director/lingo/lingo-gr.y" +#line 360 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->codeFunc((yyvsp[(1) - (4)].s), (yyvsp[(3) - (4)].narg)); delete (yyvsp[(1) - (4)].s); ;} break; case 59: -#line 361 "engines/director/lingo/lingo-gr.y" +#line 363 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_eval); g_lingo->codeString((yyvsp[(1) - (1)].s)->c_str()); @@ -2141,7 +2141,7 @@ yyreduce: break; case 60: -#line 365 "engines/director/lingo/lingo-gr.y" +#line 367 "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); @@ -2152,7 +2152,7 @@ yyreduce: break; case 61: -#line 372 "engines/director/lingo/lingo-gr.y" +#line 374 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_theentitypush); inst e = 0, f = 0; @@ -2162,158 +2162,158 @@ yyreduce: break; case 63: -#line 379 "engines/director/lingo/lingo-gr.y" +#line 381 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_add); ;} break; case 64: -#line 380 "engines/director/lingo/lingo-gr.y" +#line 382 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_sub); ;} break; case 65: -#line 381 "engines/director/lingo/lingo-gr.y" +#line 383 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_mul); ;} break; case 66: -#line 382 "engines/director/lingo/lingo-gr.y" +#line 384 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_div); ;} break; case 67: -#line 383 "engines/director/lingo/lingo-gr.y" +#line 385 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gt); ;} break; case 68: -#line 384 "engines/director/lingo/lingo-gr.y" +#line 386 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_lt); ;} break; case 69: -#line 385 "engines/director/lingo/lingo-gr.y" +#line 387 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_neq); ;} break; case 70: -#line 386 "engines/director/lingo/lingo-gr.y" +#line 388 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_ge); ;} break; case 71: -#line 387 "engines/director/lingo/lingo-gr.y" +#line 389 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_le); ;} break; case 72: -#line 388 "engines/director/lingo/lingo-gr.y" +#line 390 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_and); ;} break; case 73: -#line 389 "engines/director/lingo/lingo-gr.y" +#line 391 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_or); ;} break; case 74: -#line 390 "engines/director/lingo/lingo-gr.y" +#line 392 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_not); ;} break; case 75: -#line 391 "engines/director/lingo/lingo-gr.y" +#line 393 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_ampersand); ;} break; case 76: -#line 392 "engines/director/lingo/lingo-gr.y" +#line 394 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_concat); ;} break; case 77: -#line 393 "engines/director/lingo/lingo-gr.y" +#line 395 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_contains); ;} break; case 78: -#line 394 "engines/director/lingo/lingo-gr.y" +#line 396 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_starts); ;} break; case 79: -#line 395 "engines/director/lingo/lingo-gr.y" +#line 397 "engines/director/lingo/lingo-gr.y" { (yyval.code) = (yyvsp[(2) - (2)].code); ;} break; case 80: -#line 396 "engines/director/lingo/lingo-gr.y" +#line 398 "engines/director/lingo/lingo-gr.y" { (yyval.code) = (yyvsp[(2) - (2)].code); g_lingo->code1(g_lingo->c_negate); ;} break; case 81: -#line 397 "engines/director/lingo/lingo-gr.y" +#line 399 "engines/director/lingo/lingo-gr.y" { (yyval.code) = (yyvsp[(2) - (3)].code); ;} break; case 82: -#line 398 "engines/director/lingo/lingo-gr.y" +#line 400 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_intersects); ;} break; case 83: -#line 399 "engines/director/lingo/lingo-gr.y" +#line 401 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_within); ;} break; case 84: -#line 402 "engines/director/lingo/lingo-gr.y" +#line 404 "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 85: -#line 403 "engines/director/lingo/lingo-gr.y" +#line 405 "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 86: -#line 404 "engines/director/lingo/lingo-gr.y" +#line 406 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_printtop); ;} break; case 88: -#line 406 "engines/director/lingo/lingo-gr.y" +#line 408 "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 90: -#line 411 "engines/director/lingo/lingo-gr.y" +#line 413 "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 91: -#line 412 "engines/director/lingo/lingo-gr.y" +#line 414 "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 92: -#line 423 "engines/director/lingo/lingo-gr.y" +#line 425 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gotoloop); ;} break; case 93: -#line 424 "engines/director/lingo/lingo-gr.y" +#line 426 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gotonext); ;} break; case 94: -#line 425 "engines/director/lingo/lingo-gr.y" +#line 427 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gotoprevious); ;} break; case 95: -#line 426 "engines/director/lingo/lingo-gr.y" +#line 428 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_goto); g_lingo->codeString((yyvsp[(2) - (2)].s)->c_str()); @@ -2322,7 +2322,7 @@ yyreduce: break; case 96: -#line 431 "engines/director/lingo/lingo-gr.y" +#line 433 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_goto); g_lingo->codeString((yyvsp[(2) - (3)].s)->c_str()); @@ -2332,7 +2332,7 @@ yyreduce: break; case 97: -#line 437 "engines/director/lingo/lingo-gr.y" +#line 439 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_goto); g_lingo->codeString(""); @@ -2341,47 +2341,47 @@ yyreduce: break; case 98: -#line 444 "engines/director/lingo/lingo-gr.y" +#line 446 "engines/director/lingo/lingo-gr.y" { (yyval.s) = (yyvsp[(3) - (3)].s); ;} break; case 99: -#line 445 "engines/director/lingo/lingo-gr.y" +#line 447 "engines/director/lingo/lingo-gr.y" { (yyval.s) = (yyvsp[(2) - (2)].s); ;} break; case 100: -#line 446 "engines/director/lingo/lingo-gr.y" +#line 448 "engines/director/lingo/lingo-gr.y" { (yyval.s) = (yyvsp[(2) - (2)].s); ;} break; case 101: -#line 447 "engines/director/lingo/lingo-gr.y" +#line 449 "engines/director/lingo/lingo-gr.y" { (yyval.s) = (yyvsp[(1) - (1)].s); ;} break; case 102: -#line 450 "engines/director/lingo/lingo-gr.y" +#line 452 "engines/director/lingo/lingo-gr.y" { (yyval.s) = (yyvsp[(3) - (3)].s); ;} break; case 103: -#line 451 "engines/director/lingo/lingo-gr.y" +#line 453 "engines/director/lingo/lingo-gr.y" { (yyval.s) = (yyvsp[(2) - (2)].s); ;} break; case 104: -#line 452 "engines/director/lingo/lingo-gr.y" +#line 454 "engines/director/lingo/lingo-gr.y" { (yyval.s) = (yyvsp[(3) - (3)].s); ;} break; case 105: -#line 480 "engines/director/lingo/lingo-gr.y" +#line 482 "engines/director/lingo/lingo-gr.y" { g_lingo->_indef = true; g_lingo->_currentFactory.clear(); ;} break; case 106: -#line 481 "engines/director/lingo/lingo-gr.y" +#line 483 "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); @@ -2390,19 +2390,19 @@ yyreduce: break; case 107: -#line 486 "engines/director/lingo/lingo-gr.y" +#line 488 "engines/director/lingo/lingo-gr.y" { g_lingo->codeFactory(*(yyvsp[(2) - (2)].s)); ;} break; case 108: -#line 489 "engines/director/lingo/lingo-gr.y" +#line 491 "engines/director/lingo/lingo-gr.y" { g_lingo->_indef = true; ;} break; case 109: -#line 490 "engines/director/lingo/lingo-gr.y" +#line 492 "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); @@ -2411,32 +2411,32 @@ yyreduce: break; case 110: -#line 495 "engines/director/lingo/lingo-gr.y" +#line 497 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = 0; ;} break; case 111: -#line 496 "engines/director/lingo/lingo-gr.y" +#line 498 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArg((yyvsp[(1) - (1)].s)); (yyval.narg) = 1; ;} break; case 112: -#line 497 "engines/director/lingo/lingo-gr.y" +#line 499 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArg((yyvsp[(3) - (3)].s)); (yyval.narg) = (yyvsp[(1) - (3)].narg) + 1; ;} break; case 113: -#line 498 "engines/director/lingo/lingo-gr.y" +#line 500 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArg((yyvsp[(4) - (4)].s)); (yyval.narg) = (yyvsp[(1) - (4)].narg) + 1; ;} break; case 114: -#line 500 "engines/director/lingo/lingo-gr.y" +#line 502 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArgStore(); ;} break; case 115: -#line 504 "engines/director/lingo/lingo-gr.y" +#line 506 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_call); g_lingo->codeString((yyvsp[(1) - (3)].s)->c_str()); @@ -2446,17 +2446,17 @@ yyreduce: break; case 116: -#line 512 "engines/director/lingo/lingo-gr.y" +#line 514 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = 0; ;} break; case 117: -#line 513 "engines/director/lingo/lingo-gr.y" +#line 515 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = 1; ;} break; case 118: -#line 514 "engines/director/lingo/lingo-gr.y" +#line 516 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = (yyvsp[(1) - (3)].narg) + 1; ;} break; @@ -2676,6 +2676,6 @@ yyreturn: } -#line 517 "engines/director/lingo/lingo-gr.y" +#line 519 "engines/director/lingo/lingo-gr.y" diff --git a/engines/director/lingo/lingo-gr.h b/engines/director/lingo/lingo-gr.h index 241c4299b4..f5d97e9f00 100644 --- a/engines/director/lingo/lingo-gr.h +++ b/engines/director/lingo/lingo-gr.h @@ -39,23 +39,23 @@ /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { - CASTREF = 258, - UNARY = 259, - VOIDVAL = 260, - VAR = 261, - POINT = 262, - RECT = 263, - ARRAY = 264, - SYMBOL = 265, - INT = 266, - THEENTITY = 267, - THEENTITYWITHID = 268, - FLOAT = 269, - BLTIN = 270, - BLTINNOARGS = 271, - ID = 272, - STRING = 273, - HANDLER = 274, + UNARY = 258, + vCASTREF = 259, + vVOID = 260, + vVAR = 261, + vPOINT = 262, + vRECT = 263, + vARRAY = 264, + vSYMBOL = 265, + vINT = 266, + vTHEENTITY = 267, + vTHEENTITYWITHID = 268, + vFLOAT = 269, + vBLTIN = 270, + vBLTINNOARGS = 271, + vSTRING = 272, + vHANDLER = 273, + ID = 274, tDOWN = 275, tELSE = 276, tNLELSIF = 277, @@ -103,23 +103,23 @@ }; #endif /* Tokens. */ -#define CASTREF 258 -#define UNARY 259 -#define VOIDVAL 260 -#define VAR 261 -#define POINT 262 -#define RECT 263 -#define ARRAY 264 -#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 UNARY 258 +#define vCASTREF 259 +#define vVOID 260 +#define vVAR 261 +#define vPOINT 262 +#define vRECT 263 +#define vARRAY 264 +#define vSYMBOL 265 +#define vINT 266 +#define vTHEENTITY 267 +#define vTHEENTITYWITHID 268 +#define vFLOAT 269 +#define vBLTIN 270 +#define vBLTINNOARGS 271 +#define vSTRING 272 +#define vHANDLER 273 +#define ID 274 #define tDOWN 275 #define tELSE 276 #define tNLELSIF 277 diff --git a/engines/director/lingo/lingo-gr.y b/engines/director/lingo/lingo-gr.y index b70e318c07..59a103bfac 100644 --- a/engines/director/lingo/lingo-gr.y +++ b/engines/director/lingo/lingo-gr.y @@ -76,11 +76,13 @@ void yyerror(char *s) { Common::Array *arr; } -%token CASTREF UNARY VOIDVAL VAR POINT RECT ARRAY SYMBOL -%token INT -%token THEENTITY THEENTITYWITHID -%token FLOAT -%token BLTIN BLTINNOARGS ID STRING HANDLER +%token UNARY +%token vCASTREF vVOID vVAR vPOINT vRECT vARRAY vSYMBOL +%token vINT +%token vTHEENTITY vTHEENTITYWITHID +%token vFLOAT +%token vBLTIN vBLTINNOARGS vSTRING vHANDLER +%token ID %token tDOWN tELSE tNLELSIF tEND tEXIT tFRAME tGLOBAL tGO tIF tINTO tLOOP tMACRO %token tMCI tMCIWAIT tMOVIE tNEXT tOF tPREVIOUS tPUT tREPEAT tSET tTHEN tTO tWHEN %token tWITH tWHILE tNLELSE tFACTORY tMETHOD @@ -129,7 +131,7 @@ asgn: tPUT expr tINTO ID { g_lingo->code1(g_lingo->c_assign); $$ = $4; delete $2; } - | tSET THEENTITY '=' expr { + | tSET vTHEENTITY '=' expr { g_lingo->code2(g_lingo->c_constpush, 0); // Put dummy id g_lingo->code1(g_lingo->c_theentityassign); inst e = 0, f = 0; @@ -137,7 +139,7 @@ asgn: tPUT expr tINTO ID { WRITE_UINT32(&f, $2[1]); g_lingo->code2(e, f); $$ = $4; } - | tSET THEENTITYWITHID expr '=' expr { + | tSET vTHEENTITYWITHID expr '=' expr { g_lingo->code1(g_lingo->c_swap); g_lingo->code1(g_lingo->c_theentityassign); inst e = 0, f = 0; @@ -151,7 +153,7 @@ asgn: tPUT expr tINTO ID { g_lingo->code1(g_lingo->c_assign); $$ = $4; delete $2; } - | tSET THEENTITY tTO expr { + | tSET vTHEENTITY tTO expr { g_lingo->code2(g_lingo->c_constpush, 0); // Put dummy id g_lingo->code1(g_lingo->c_theentityassign); inst e = 0, f = 0; @@ -159,7 +161,7 @@ asgn: tPUT expr tINTO ID { WRITE_UINT32(&f, $2[1]); g_lingo->code2(e, f); $$ = $4; } - | tSET THEENTITYWITHID expr tTO expr { + | tSET vTHEENTITYWITHID expr tTO expr { g_lingo->code1(g_lingo->c_swap); g_lingo->code1(g_lingo->c_theentityassign); inst e = 0, f = 0; @@ -340,18 +342,18 @@ stmtlist: /* nothing */ { $$ = g_lingo->_currentScript->size(); } | stmtlist stmt ; -expr: INT { +expr: vINT { $$ = g_lingo->code1(g_lingo->c_constpush); inst i = 0; WRITE_UINT32(&i, $1); g_lingo->code1(i); } - | FLOAT { + | vFLOAT { $$ = g_lingo->code1(g_lingo->c_fconstpush); g_lingo->codeFloat($1); } - | STRING { + | vSTRING { $$ = g_lingo->code1(g_lingo->c_stringpush); g_lingo->codeString($1->c_str()); } - | BLTINNOARGS { + | vBLTINNOARGS { $$ = g_lingo->code1(g_lingo->_handlers[*$1]->u.func); $$ = g_lingo->code2(g_lingo->c_constpush, 0); // Put dummy value delete $1; } @@ -362,14 +364,14 @@ expr: INT { $$ = g_lingo->code1(g_lingo->c_eval); g_lingo->codeString($1->c_str()); delete $1; } - | THEENTITY { + | vTHEENTITY { $$ = g_lingo->code2(g_lingo->c_constpush, 0); // Put dummy id g_lingo->code1(g_lingo->c_theentitypush); inst e = 0, f = 0; WRITE_UINT32(&e, $1[0]); WRITE_UINT32(&f, $1[1]); g_lingo->code2(e, f); } - | THEENTITYWITHID expr { + | vTHEENTITYWITHID expr { $$ = g_lingo->code1(g_lingo->c_theentitypush); inst e = 0, f = 0; WRITE_UINT32(&e, $1[0]); @@ -399,7 +401,7 @@ expr: INT { | tSPRITE expr tWITHIN expr { g_lingo->code1(g_lingo->c_within); } ; -func: tMCI STRING { g_lingo->code1(g_lingo->c_mci); g_lingo->codeString($2->c_str()); delete $2; } +func: tMCI vSTRING { g_lingo->code1(g_lingo->c_mci); g_lingo->codeString($2->c_str()); delete $2; } | tMCIWAIT ID { g_lingo->code1(g_lingo->c_mciwait); g_lingo->codeString($2->c_str()); delete $2; } | tPUT expr { g_lingo->code1(g_lingo->c_printtop); } | gotofunc @@ -441,15 +443,15 @@ gotofunc: tGO tLOOP { g_lingo->code1(g_lingo->c_gotoloop); } delete $2; } ; -gotoframe: tTO tFRAME STRING { $$ = $3; } - | tFRAME STRING { $$ = $2; } - | tTO STRING { $$ = $2; } - | STRING { $$ = $1; } +gotoframe: tTO tFRAME vSTRING { $$ = $3; } + | tFRAME vSTRING { $$ = $2; } + | tTO vSTRING { $$ = $2; } + | vSTRING { $$ = $1; } ; -gotomovie: tOF tMOVIE STRING { $$ = $3; } - | tMOVIE STRING { $$ = $2; } - | tTO tMOVIE STRING { $$ = $3; } +gotomovie: tOF tMOVIE vSTRING { $$ = $3; } + | tMOVIE vSTRING { $$ = $2; } + | tTO tMOVIE vSTRING { $$ = $3; } ; // macro diff --git a/engines/director/lingo/lingo-lex.cpp b/engines/director/lingo/lingo-lex.cpp index 11ded79bfc..1fd200d0d0 100644 --- a/engines/director/lingo/lingo-lex.cpp +++ b/engines/director/lingo/lingo-lex.cpp @@ -1149,9 +1149,9 @@ YY_RULE_SETUP yylval.e[1] = g_lingo->_theEntityFields[field]->field; if (g_lingo->_theEntities[ptr]->hasId) - return THEENTITYWITHID; + return vTHEENTITYWITHID; else - return THEENTITY; + return vTHEENTITY; } warning("Unhandled the entity %s", ptr); @@ -1172,9 +1172,9 @@ YY_RULE_SETUP yylval.e[1] = 0; // No field if (g_lingo->_theEntities[ptr]->hasId) - return THEENTITYWITHID; + return vTHEENTITYWITHID; else - return THEENTITY; + return vTHEENTITY; } warning("Unhandled the entity %s", ptr); @@ -1243,8 +1243,8 @@ YY_RULE_SETUP yylval.s = new Common::String(yytext); if (g_lingo->_handlers.contains(yytext)) { - if (g_lingo->_handlers[yytext]->type == BLTIN && g_lingo->_handlers[yytext]->nargs == -1) - return BLTINNOARGS; + if (g_lingo->_handlers[yytext]->type == vBLTIN && g_lingo->_handlers[yytext]->nargs == -1) + return vBLTINNOARGS; } return ID; @@ -1253,12 +1253,12 @@ YY_RULE_SETUP case 48: YY_RULE_SETUP #line 184 "engines/director/lingo/lingo-lex.l" -{ count(); yylval.f = atof(yytext); return FLOAT; } +{ count(); yylval.f = atof(yytext); return vFLOAT; } YY_BREAK case 49: YY_RULE_SETUP #line 185 "engines/director/lingo/lingo-lex.l" -{ count(); yylval.i = strtol(yytext, NULL, 10); return INT; } +{ count(); yylval.i = strtol(yytext, NULL, 10); return vINT; } YY_BREAK case 50: YY_RULE_SETUP @@ -1274,7 +1274,7 @@ YY_RULE_SETUP case 52: YY_RULE_SETUP #line 188 "engines/director/lingo/lingo-lex.l" -{ count(); yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return STRING; } +{ count(); yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return vSTRING; } YY_BREAK case 53: YY_RULE_SETUP diff --git a/engines/director/lingo/lingo-lex.l b/engines/director/lingo/lingo-lex.l index 6a5cf0486c..e96a82e972 100644 --- a/engines/director/lingo/lingo-lex.l +++ b/engines/director/lingo/lingo-lex.l @@ -131,9 +131,9 @@ whitespace [\t ] yylval.e[1] = g_lingo->_theEntityFields[field]->field; if (g_lingo->_theEntities[ptr]->hasId) - return THEENTITYWITHID; + return vTHEENTITYWITHID; else - return THEENTITY; + return vTHEENTITY; } warning("Unhandled the entity %s", ptr); @@ -150,9 +150,9 @@ whitespace [\t ] yylval.e[1] = 0; // No field if (g_lingo->_theEntities[ptr]->hasId) - return THEENTITYWITHID; + return vTHEENTITYWITHID; else - return THEENTITY; + return vTHEENTITY; } warning("Unhandled the entity %s", ptr); @@ -175,17 +175,17 @@ whitespace [\t ] yylval.s = new Common::String(yytext); if (g_lingo->_handlers.contains(yytext)) { - if (g_lingo->_handlers[yytext]->type == BLTIN && g_lingo->_handlers[yytext]->nargs == -1) - return BLTINNOARGS; + if (g_lingo->_handlers[yytext]->type == vBLTIN && g_lingo->_handlers[yytext]->nargs == -1) + return vBLTINNOARGS; } return ID; } -{constfloat} { count(); yylval.f = atof(yytext); return FLOAT; } -{constinteger} { count(); yylval.i = strtol(yytext, NULL, 10); return INT; } +{constfloat} { count(); yylval.f = atof(yytext); return vFLOAT; } +{constinteger} { count(); yylval.i = strtol(yytext, NULL, 10); return vINT; } {operator} { count(); return *yytext; } {newline} { return '\n'; } -{conststring} { count(); yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return STRING; } +{conststring} { count(); yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return vSTRING; } . %% diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp index cf303aa5ee..84654ebe36 100644 --- a/engines/director/lingo/lingo-the.cpp +++ b/engines/director/lingo/lingo-the.cpp @@ -196,7 +196,7 @@ void Lingo::setTheEntity(int entity, Datum &id, int field, Datum &d) { void Lingo::setTheSprite(Datum &id1, int field, Datum &d) { int id = 0; - if (id1.type == INT) { + if (id1.type == vINT) { id = id1.u.i; } else { warning("Unknown the sprite id type: %s", id1.type2str()); @@ -315,12 +315,12 @@ Datum Lingo::getTheEntity(int entity, Datum &id, int field) { warning("STUB: getting the perframehook"); break; case kTheFloatPrecision: - d.type = INT; + d.type = vINT; d.u.i = _floatPrecision; break; default: warning("Unprocessed getting field %d of entity %d", field, entity); - d.type = VOIDVAL; + d.type = vVOID; } return d; @@ -330,7 +330,7 @@ Datum Lingo::getTheSprite(Datum &id1, int field) { Datum d; int id = 0; - if (id1.type == INT) { + if (id1.type == vINT) { id = id1.u.i; } else { warning("Unknown the sprite id type: %s", id1.type2str()); @@ -347,7 +347,7 @@ Datum Lingo::getTheSprite(Datum &id1, int field) { if (!sprite) return d; - d.type = INT; + d.type = vINT; switch (field) { case kTheCastNum: @@ -431,7 +431,7 @@ Datum Lingo::getTheSprite(Datum &id1, int field) { break; default: warning("Unprocessed getting field %d of sprite", field); - d.type = VOIDVAL; + d.type = vVOID; } return d; @@ -441,7 +441,7 @@ Datum Lingo::getTheCast(Datum &id1, int field) { Datum d; int id = 0; - if (id1.type == INT) { + if (id1.type == vINT) { id = id1.u.i; } else { warning("Unknown the cast id type: %s", id1.type2str()); @@ -457,7 +457,7 @@ Datum Lingo::getTheCast(Datum &id1, int field) { CastInfo *castInfo; if (!_vm->_currentScore->_casts.contains(id)) { if (field == kTheLoaded) { - d.type = INT; + d.type = vINT; d.u.i = 0; } @@ -469,7 +469,7 @@ Datum Lingo::getTheCast(Datum &id1, int field) { cast = _vm->_currentScore->_casts[id]; castInfo = _vm->_currentScore->_castsInfo[id]; - d.type = INT; + d.type = vINT; switch (field) { case kTheCastType: @@ -497,7 +497,7 @@ Datum Lingo::getTheCast(Datum &id1, int field) { { if (cast->type != kCastShape) { warning("Field %d of cast %d not found", field, id); - d.type = VOIDVAL; + d.type = vVOID; return d; } @@ -509,7 +509,7 @@ Datum Lingo::getTheCast(Datum &id1, int field) { { if (cast->type != kCastShape) { warning("Field %d of cast %d not found", field, id); - d.type = VOIDVAL; + d.type = vVOID; return d; } @@ -522,7 +522,7 @@ Datum Lingo::getTheCast(Datum &id1, int field) { break; default: warning("Unprocessed getting field %d of cast %d", field, id); - d.type = VOIDVAL; + d.type = vVOID; //TODO find out about String fields } @@ -532,7 +532,7 @@ Datum Lingo::getTheCast(Datum &id1, int field) { void Lingo::setTheCast(Datum &id1, int field, Datum &d) { int id = 0; - if (id1.type == INT) { + if (id1.type == vINT) { id = id1.u.i; } else { warning("Unknown the cast id type: %s", id1.type2str()); diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp index d13de6a1dd..e5fa09ceb9 100644 --- a/engines/director/lingo/lingo.cpp +++ b/engines/director/lingo/lingo.cpp @@ -69,7 +69,7 @@ struct EventHandlerType { Symbol::Symbol() { name = NULL; - type = VOIDVAL; + type = vVOID; u.s = NULL; nargs = 0; global = false; @@ -224,10 +224,10 @@ void Lingo::processEvent(LEvent event, int entityId) { } int Lingo::alignTypes(Datum &d1, Datum &d2) { - int opType = INT; + int opType = vINT; - if (d1.type == FLOAT || d2.type == FLOAT) { - opType = FLOAT; + if (d1.type == vFLOAT || d2.type == vFLOAT) { + opType = vFLOAT; d1.toFloat(); d2.toFloat(); } @@ -237,12 +237,12 @@ int Lingo::alignTypes(Datum &d1, Datum &d2) { int Datum::toInt() { switch (type) { - case INT: + case vINT: // no-op break; - case FLOAT: + case vFLOAT: u.i = (int)u.f; - type = INT; + type = vINT; break; default: warning("Incorrect operation toInt() for type: %s", type2str()); @@ -253,11 +253,11 @@ int Datum::toInt() { double Datum::toFloat() { switch (type) { - case INT: + case vINT: u.f = (double)u.i; - type = FLOAT; + type = vFLOAT; break; - case FLOAT: + case vFLOAT: // no-op break; default: @@ -270,13 +270,13 @@ double Datum::toFloat() { Common::String *Datum::toString() { Common::String *s = new Common::String; switch (type) { - case INT: + case vINT: s->format("%d", u.i); break; - case FLOAT: + case vFLOAT: s->format(g_lingo->_floatPrecisionFormat.c_str(), u.f); break; - case STRING: + case vSTRING: delete s; s = u.s; break; @@ -285,7 +285,7 @@ Common::String *Datum::toString() { } u.s = s; - type = STRING; + type = vSTRING; return u.s; } @@ -294,20 +294,20 @@ const char *Datum::type2str(bool isk) { static char res[20]; switch (isk ? u.i : type) { - case INT: - return isk ? "#integer" : "INT"; - case FLOAT: - return isk ? "#float" : "FLOAT"; - case STRING: - return isk ? "#string" : "STRING"; - case CASTREF: - return "CASTREF"; - case VOIDVAL: - return isk ? "#void" : "VOIDVAL"; - case POINT: - return isk ? "#point" : "POINT"; - case SYMBOL: - return isk ? "#symbol" : "SYMBOL"; + case vINT: + return isk ? "#integer" : "vINT"; + case vFLOAT: + return isk ? "#float" : "vFLOAT"; + case vSTRING: + return isk ? "#string" : "vSTRING"; + case vCASTREF: + return "vCASTREF"; + case vVOID: + return isk ? "#void" : "vVOID"; + case vPOINT: + return isk ? "#point" : "vPOINT"; + case vSYMBOL: + return isk ? "#symbol" : "vSYMBOL"; default: snprintf(res, 20, "-- (%d) --", type); return res; diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h index 51cc649670..fb68dbb4e3 100644 --- a/engines/director/lingo/lingo.h +++ b/engines/director/lingo/lingo.h @@ -82,12 +82,12 @@ struct Symbol { /* symbol table entry */ char *name; int type; union { - int i; /* VAR */ - double f; /* FLOAT */ - ScriptData *defn; /* FUNCTION, PROCEDURE */ - void (*func)(void); /* BUILTIN */ - Common::String *s; /* STRING */ - FloatArray *arr; /* ARRAY, POINT, RECT */ + int i; /* vVAR */ + double f; /* vFLOAT */ + ScriptData *defn; /* vFUNCTION, vPROCEDURE */ + void (*func)(void); /* vBUILTIN */ + Common::String *s; /* vSTRING */ + FloatArray *arr; /* vARRAY, vPOINT, vRECT */ } u; int nargs; bool global; @@ -103,10 +103,10 @@ struct Datum { /* interpreter stack type */ double f; Common::String *s; Symbol *sym; - FloatArray *arr; /* ARRAY, POINT, RECT */ + FloatArray *arr; /* vARRAY, vPOINT, vRECT */ } u; - Datum() { u.sym = NULL; type = VOIDVAL; } + Datum() { u.sym = NULL; type = vVOID; } double toFloat(); int toInt(); -- cgit v1.2.3