Skip to content

Commit

Permalink
DIRECTOR: Lingo: Implemented stubs for put..after and put..before
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Jan 10, 2017
1 parent 5ee5102 commit bfc2fa8
Show file tree
Hide file tree
Showing 7 changed files with 1,023 additions and 921 deletions.
30 changes: 30 additions & 0 deletions engines/director/lingo/lingo-code.cpp
Expand Up @@ -74,6 +74,8 @@ static struct FuncDescr {
{ Lingo::c_mod, "c_mod", "" },
{ Lingo::c_negate, "c_negate", "" },
{ Lingo::c_ampersand, "c_ampersand", "" },
{ Lingo::c_after, "c_after", "" },
{ Lingo::c_before, "c_before", "" },
{ Lingo::c_concat, "c_concat", "" },
{ Lingo::c_contains, "c_contains", "" },
{ Lingo::c_starts, "c_starts", "" },
Expand Down Expand Up @@ -476,6 +478,34 @@ void Lingo::c_ampersand() {
g_lingo->push(d1);
}

void Lingo::c_after() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();

d1.toString();
d2.toString();

warning("STUB: c_after");

delete d2.u.s;

g_lingo->push(d1);
}

void Lingo::c_before() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();

d1.toString();
d2.toString();

warning("STUB: c_before");

delete d2.u.s;

g_lingo->push(d1);
}

void Lingo::c_concat() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
Expand Down
1,264 changes: 654 additions & 610 deletions engines/director/lingo/lingo-gr.cpp

Large diffs are not rendered by default.

38 changes: 21 additions & 17 deletions engines/director/lingo/lingo-gr.h
Expand Up @@ -102,14 +102,16 @@
tOR = 318,
tNOT = 319,
tMOD = 320,
tCONCAT = 321,
tCONTAINS = 322,
tSTARTS = 323,
tSPRITE = 324,
tINTERSECTS = 325,
tWITHIN = 326,
tON = 327,
tSOUND = 328
tAFTER = 321,
tBEFORE = 322,
tCONCAT = 323,
tCONTAINS = 324,
tSTARTS = 325,
tSPRITE = 326,
tINTERSECTS = 327,
tWITHIN = 328,
tON = 329,
tSOUND = 330
};
#endif
/* Tokens. */
Expand Down Expand Up @@ -176,14 +178,16 @@
#define tOR 318
#define tNOT 319
#define tMOD 320
#define tCONCAT 321
#define tCONTAINS 322
#define tSTARTS 323
#define tSPRITE 324
#define tINTERSECTS 325
#define tWITHIN 326
#define tON 327
#define tSOUND 328
#define tAFTER 321
#define tBEFORE 322
#define tCONCAT 323
#define tCONTAINS 324
#define tSTARTS 325
#define tSPRITE 326
#define tINTERSECTS 327
#define tWITHIN 328
#define tON 329
#define tSOUND 330



Expand All @@ -201,7 +205,7 @@ typedef union YYSTYPE
Common::Array<double> *arr;
}
/* Line 1529 of yacc.c. */
#line 205 "engines/director/lingo/lingo-gr.hpp"
#line 209 "engines/director/lingo/lingo-gr.hpp"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
Expand Down
9 changes: 6 additions & 3 deletions engines/director/lingo/lingo-gr.y
Expand Up @@ -87,7 +87,7 @@ void yyerror(const char *s) {
%token tMOVIE tNEXT tOF tPREVIOUS tPUT tREPEAT tSET tTHEN tTO tWHEN
%token tWITH tWHILE tNLELSE tFACTORY tMETHOD tOPEN tPLAY tDONE tPLAYACCEL tINSTANCE
%token tGE tLE tGT tLT tEQ tNEQ tAND tOR tNOT tMOD
%token tCONCAT tCONTAINS tSTARTS
%token tAFTER tBEFORE tCONCAT tCONTAINS tSTARTS
%token tSPRITE tINTERSECTS tWITHIN
%token tON tSOUND

Expand Down Expand Up @@ -127,6 +127,8 @@ asgn: tPUT expr tINTO ID {
g_lingo->code1(g_lingo->c_assign);
$$ = $2;
delete $4; }
| tPUT expr tAFTER expr { $$ = g_lingo->code1(g_lingo->c_after); } // D3
| tPUT expr tBEFORE expr { $$ = g_lingo->code1(g_lingo->c_before); } // D3
| tSET ID '=' expr {
g_lingo->code1(g_lingo->c_varpush);
g_lingo->codeString($2->c_str());
Expand Down Expand Up @@ -357,7 +359,7 @@ expr: INT { $$ = g_lingo->codeConst($1); }
| FLOAT {
$$ = g_lingo->code1(g_lingo->c_fconstpush);
g_lingo->codeFloat($1); }
| SYMBOL {
| SYMBOL { // D3
$$ = g_lingo->code1(g_lingo->c_symbolpush);
g_lingo->codeString($1->c_str()); }
| STRING {
Expand Down Expand Up @@ -401,6 +403,7 @@ expr: INT { $$ = g_lingo->codeConst($1); }
| expr tOR expr { g_lingo->code1(g_lingo->c_or); }
| tNOT expr %prec UNARY { g_lingo->code1(g_lingo->c_not); }
| expr '&' expr { g_lingo->code1(g_lingo->c_ampersand); }
| expr tAFTER expr { g_lingo->code1(g_lingo->c_after); }
| expr tCONCAT expr { g_lingo->code1(g_lingo->c_concat); }
| expr tCONTAINS expr { g_lingo->code1(g_lingo->c_contains); }
| expr tSTARTS expr { g_lingo->code1(g_lingo->c_starts); }
Expand Down Expand Up @@ -523,7 +526,7 @@ defn: tMACRO ID { g_lingo->_indef = true; g_lingo->_currentFactory.clear(); }
g_lingo->code1(g_lingo->c_procret);
g_lingo->define(*$2, $4, $5 + 1, &g_lingo->_currentFactory);
g_lingo->_indef = false; } ;
| tON ID { g_lingo->_indef = true; g_lingo->_currentFactory.clear(); }
| tON ID { g_lingo->_indef = true; g_lingo->_currentFactory.clear(); } // D3
begin { g_lingo->_ignoreMe = true; } argdef nl argstore stmtlist tEND {
g_lingo->codeConst(0); // Push fake value on stack
g_lingo->code1(g_lingo->c_procret);
Expand Down

0 comments on commit bfc2fa8

Please sign in to comment.