diff options
-rw-r--r-- | engines/director/lingo/lingo-builtins.cpp | 33 | ||||
-rw-r--r-- | engines/director/lingo/lingo-lex.l | 84 | ||||
-rw-r--r-- | engines/director/lingo/lingo.h | 2 |
3 files changed, 72 insertions, 47 deletions
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp index adcd276714..b080774db7 100644 --- a/engines/director/lingo/lingo-builtins.cpp +++ b/engines/director/lingo/lingo-builtins.cpp @@ -120,10 +120,11 @@ static struct BuiltinProto { // Types { "floatP", Lingo::b_floatP, 1, 1, true }, // D3 { "ilk", Lingo::b_ilk, 1, 2, false }, // D4 f - { "integerp", Lingo::b_integerp, 1, 1, true }, // D2 - { "objectp", Lingo::b_objectp, 1, 1, true }, // D2 - { "stringp", Lingo::b_stringp, 1, 1, true }, // D2 - { "symbolp", Lingo::b_symbolp, 1, 1, true }, // D2 + { "integerp", Lingo::b_integerp, 1, 1, true }, // D2 f + { "objectp", Lingo::b_objectp, 1, 1, true }, // D2 f + { "puctureP", Lingo::b_pictureP, 1, 1, true }, // D4 f + { "stringp", Lingo::b_stringp, 1, 1, true }, // D2 f + { "symbolp", Lingo::b_symbolp, 1, 1, true }, // D2 f // Misc { "alert", Lingo::b_alert, 1, 1, false }, // D2 c { "cursor", Lingo::b_cursor, 1, 1, false }, // D2 @@ -146,6 +147,7 @@ static struct BuiltinProto { // go // D2 { "importFileInto", Lingo::b_importFileInto,2, 2, false }, // D4 c { "installMenu", Lingo::b_installMenu, 1, 1, false }, // D2 + { "intersect", Lingo::b_intersect, 2, 2, false }, // D4 f { "label", Lingo::b_label, 1, 1, true }, // D2 { "marker", Lingo::b_marker, 1, 1, true }, // D2 { "move", Lingo::b_move, 1, 2, false }, // D4 c @@ -172,7 +174,7 @@ static struct BuiltinProto { { "sound-fadeOut", Lingo::b_soundFadeOut, 1, 2, false }, // D3 { "sound-playFile", Lingo::b_soundPlayFile, 2, 2, false }, // D3 c { "sound-stop", Lingo::b_soundStop, 1, 1, false }, // D3 - { "soundBusy", Lingo::b_soundBusy, 1, 1, true }, // D3 + { "soundBusy", Lingo::b_soundBusy, 1, 1, true }, // D3 f // Constants { "backspace", Lingo::b_backspace, 0, 0, false }, // D2 { "empty", Lingo::b_empty, 0, 0, false }, // D2 @@ -214,10 +216,17 @@ static const char *builtinFunctions[] = { "getProp", "getPropAt", "ilk", + "integerp", + "intersect", "list", "listP", "max", "min", + "objectp", + "pictureP", + "soundBusy", + "stringp", + "symbolp", "xFactoryList", 0 }; @@ -882,6 +891,12 @@ void Lingo::b_objectp(int nargs) { g_lingo->push(d); } +void Lingo::b_pictureP(int nargs) { + Datum d = g_lingo->pop(); + warning("STUB: b_pictureP"); + g_lingo->push(Datum(0)); +} + void Lingo::b_stringp(int nargs) { Datum d = g_lingo->pop(); int res = (d.type == STRING) ? 1 : 0; @@ -994,6 +1009,14 @@ void Lingo::b_installMenu(int nargs) { warning("STUB: b_installMenu(%d)", d.u.i); } +void Lingo::b_intersect(int nargs) { + g_lingo->printSTUBWithArglist("b_intersect", nargs); + + g_lingo->dropStack(nargs); + + g_lingo->push(Datum(0)); +} + void Lingo::b_label(int nargs) { Datum d = g_lingo->pop(); d.toInt(); diff --git a/engines/director/lingo/lingo-lex.l b/engines/director/lingo/lingo-lex.l index ec9d6319bd..ac8fd63671 100644 --- a/engines/director/lingo/lingo-lex.l +++ b/engines/director/lingo/lingo-lex.l @@ -82,22 +82,22 @@ whitespace [\t ] %% --[^\r\n]* -^{whitespace}+ { count(); } -[\t]+ { count(); return ' '; } +^{whitespace}+ { count(); } +[\t]+ { count(); return ' '; } -[#]{identifier} { count(); yylval.s = new Common::String(yytext); return SYMBOL; } // D3 +[#]{identifier} { count(); yylval.s = new Common::String(yytext); return SYMBOL; } // D3 (?i:after) { count(); return tAFTER; } // D3 -(?i:and) { count(); return tAND; } +(?i:and) { count(); return tAND; } (?i:before) { count(); return tBEFORE; } // D3 -(?i:char) { count(); return tCHAR; } // D3 +(?i:char) { count(); return tCHAR; } // D3 (?i:contains) { count(); return tCONTAINS; } -(?i:done) { count(); return tDONE; } -(?i:down) { count(); return tDOWN; } -(?i:if) { count(); return tIF; } +(?i:done) { count(); return tDONE; } +(?i:down) { count(); return tDOWN; } +(?i:if) { count(); return tIF; } (?i:[\n\r]+[\t ]*else[\t ]+if) { countnl(); return tNLELSIF; } (?i:[\n\r]+[\t ]*else) { countnl(); return tNLELSE; } -(?i:else) { count(); return tELSE; } +(?i:else) { count(); return tELSE; } (?i:end)([\t ]*{identifier})? { count(); @@ -110,33 +110,33 @@ whitespace [\t ] return ENDCLAUSE; } (?i:factory) { count(); return tFACTORY; } -(?i:exit) { count(); return tEXIT; } +(?i:exit) { count(); return tEXIT; } (?i:frame) { count(); return tFRAME; } (?i:global) { count(); return tGLOBAL; } -(?i:go[\t ]+to) { count(); return tGO; } -(?i:go) { count(); return tGO; } +(?i:go[\t ]+to) { count(); return tGO; } +(?i:go) { count(); return tGO; } (?i:instance) { count(); return tINSTANCE; } -(?i:intersects) { count(); return tINTERSECTS; } -(?i:into) { count(); return tINTO; } -(?i:item) { count(); return tITEM; } -(?i:line) { count(); return tLINE; } -(?i:loop) { count(); return checkImmediate(tLOOP); } +(?i:intersects) { count(); return tINTERSECTS; } +(?i:into) { count(); return tINTO; } +(?i:item) { count(); return tITEM; } +(?i:line) { count(); return tLINE; } +(?i:loop) { count(); return checkImmediate(tLOOP); } (?i:macro) { count(); return tMACRO; } (?i:method) { count(); return tMETHOD; } -(?i:mod) { count(); return tMOD; } +(?i:mod) { count(); return tMOD; } (?i:movie) { count(); return tMOVIE; } -(?i:next) { count(); return tNEXT; } -(?i:not) { count(); return tNOT; } -(?i:of) { count(); return tOF; } -(?i:on) { count(); return tON; } // D3 -(?i:open) { count(); return tOPEN; } -(?i:or) { count(); return tOR; } -(?i:play) { count(); return tPLAY; } -(?i:playAccel) { count(); yylval.s = new Common::String(yytext); return tPLAYACCEL; } +(?i:next) { count(); return tNEXT; } +(?i:not) { count(); return tNOT; } +(?i:of) { count(); return tOF; } +(?i:on) { count(); return tON; } // D3 +(?i:open) { count(); return tOPEN; } +(?i:or) { count(); return tOR; } +(?i:play) { count(); return tPLAY; } +(?i:playAccel) { count(); yylval.s = new Common::String(yytext); return tPLAYACCEL; } (?i:previous) { count(); return tPREVIOUS; } -(?i:put) { count(); return tPUT; } +(?i:put) { count(); return tPUT; } (?i:repeat) { count(); return checkImmediate(tREPEAT); } -(?i:set) { count(); return tSET; } +(?i:set) { count(); return tSET; } (?i:starts) { count(); return tSTARTS; } (?i:the[ \t]+sqrt[\t ]+of[\t ]+) { count(); @@ -236,21 +236,21 @@ whitespace [\t ] warning("Unhandled the entity %s", ptr); } -(?i:then) { count(); return tTHEN; } -(?i:to) { count(); return tTO; } +(?i:then) { count(); return tTHEN; } +(?i:to) { count(); return tTO; } (?i:sprite) { count(); return tSPRITE; } -(?i:with) { count(); return tWITH; } +(?i:with) { count(); return tWITH; } (?i:within) { count(); return tWITHIN; } -(?i:when) { count(); return tWHEN; } +(?i:when) { count(); return tWHEN; } (?i:while) { count(); return tWHILE; } -(?i:word) { count(); return tWORD; } +(?i:word) { count(); return tWORD; } -[<][>] { count(); return tNEQ; } -[>][=] { count(); return tGE; } -[<][=] { count(); return tLE; } -[&][&] { count(); return tCONCAT; } +[<][>] { count(); return tNEQ; } +[>][=] { count(); return tGE; } +[<][=] { count(); return tLE; } +[&][&] { count(); return tCONCAT; } -{identifier} { +{identifier} { count(); yylval.s = new Common::String(yytext); @@ -289,11 +289,11 @@ whitespace [\t ] return ID; } -{constfloat} { count(); yylval.f = atof(yytext); return FLOAT; } +{constfloat} { count(); yylval.f = atof(yytext); return FLOAT; } {constinteger} { count(); yylval.i = strtol(yytext, NULL, 10); return INT; } -{operator} { count(); return *yytext; } -{newline} { return '\n'; } -{conststring} { count(); yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return STRING; } +{operator} { count(); return *yytext; } +{newline} { return '\n'; } +{conststring} { count(); yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return STRING; } . %% diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h index 31cd00495e..8bd082b17d 100644 --- a/engines/director/lingo/lingo.h +++ b/engines/director/lingo/lingo.h @@ -369,6 +369,7 @@ public: static void b_ilk(int nargs); static void b_integerp(int nargs); static void b_objectp(int nargs); + static void b_pictureP(int nargs); static void b_stringp(int nargs); static void b_symbolp(int nargs); @@ -391,6 +392,7 @@ public: static void b_findEmpty(int nargs); static void b_importFileInto(int nargs); static void b_installMenu(int nargs); + static void b_intersect(int nargs); static void b_label(int nargs); static void b_marker(int nargs); static void b_move(int nargs); |