aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/director/lingo/lingo-gr.cpp113
-rw-r--r--engines/director/lingo/lingo-gr.y13
2 files changed, 64 insertions, 62 deletions
diff --git a/engines/director/lingo/lingo-gr.cpp b/engines/director/lingo/lingo-gr.cpp
index f59cae743a..d6f9990821 100644
--- a/engines/director/lingo/lingo-gr.cpp
+++ b/engines/director/lingo/lingo-gr.cpp
@@ -691,11 +691,11 @@ static const yytype_uint16 yyrline[] =
451, 452, 453, 454, 455, 456, 457, 458, 459, 460,
461, 462, 463, 464, 465, 466, 467, 468, 469, 470,
473, 474, 475, 476, 477, 479, 480, 481, 482, 485,
- 488, 491, 494, 495, 496, 497, 498, 499, 502, 503,
- 506, 507, 510, 511, 522, 523, 524, 525, 528, 531,
- 536, 537, 540, 541, 544, 545, 548, 551, 554, 554,
- 584, 584, 590, 593, 593, 598, 599, 598, 609, 610,
- 611, 612, 615, 619, 627, 628, 629, 632, 633
+ 488, 491, 495, 496, 497, 498, 499, 500, 503, 504,
+ 507, 508, 511, 512, 523, 524, 525, 526, 529, 532,
+ 537, 538, 541, 542, 545, 546, 549, 552, 555, 555,
+ 585, 585, 591, 594, 594, 599, 600, 599, 610, 611,
+ 612, 613, 616, 620, 628, 629, 630, 633, 634
};
#endif
@@ -2492,14 +2492,14 @@ yyreduce:
case 62:
#line 413 "engines/director/lingo/lingo-gr.y"
{
- (yyval.code) = g_lingo->code1(g_lingo->_builtins[*(yyvsp[(1) - (1)].s)]->u.func);
+ g_lingo->codeFunc((yyvsp[(1) - (1)].s), 0);
delete (yyvsp[(1) - (1)].s); ;}
break;
case 63:
#line 416 "engines/director/lingo/lingo-gr.y"
{
- g_lingo->code1(g_lingo->_builtins[*(yyvsp[(1) - (2)].s)]->u.func);
+ g_lingo->codeFunc((yyvsp[(1) - (2)].s), 1);
delete (yyvsp[(1) - (2)].s); ;}
break;
@@ -2713,172 +2713,173 @@ yyreduce:
case 108:
#line 482 "engines/director/lingo/lingo-gr.y"
{
- g_lingo->code1(g_lingo->_builtins[*(yyvsp[(1) - (1)].s)]->u.func);
+ g_lingo->codeFunc((yyvsp[(1) - (1)].s), 0);
delete (yyvsp[(1) - (1)].s); ;}
break;
case 109:
#line 485 "engines/director/lingo/lingo-gr.y"
{
- g_lingo->code1(g_lingo->_builtins[*(yyvsp[(1) - (2)].s)]->u.func);
+ g_lingo->codeFunc((yyvsp[(1) - (2)].s), 1);
delete (yyvsp[(1) - (2)].s); ;}
break;
case 110:
#line 488 "engines/director/lingo/lingo-gr.y"
{
- g_lingo->code1(g_lingo->_builtins[*(yyvsp[(1) - (2)].s)]->u.func);
+ g_lingo->codeFunc((yyvsp[(1) - (2)].s), 1);
delete (yyvsp[(1) - (2)].s); ;}
break;
case 111:
#line 491 "engines/director/lingo/lingo-gr.y"
{
- g_lingo->code2(g_lingo->c_voidpush, g_lingo->_builtins[*(yyvsp[(1) - (1)].s)]->u.func);
+ g_lingo->code1(g_lingo->c_voidpush);
+ g_lingo->codeFunc((yyvsp[(1) - (1)].s), 1);
delete (yyvsp[(1) - (1)].s); ;}
break;
case 112:
-#line 494 "engines/director/lingo/lingo-gr.y"
+#line 495 "engines/director/lingo/lingo-gr.y"
{ g_lingo->codeFunc((yyvsp[(1) - (2)].s), (yyvsp[(2) - (2)].narg)); ;}
break;
case 113:
-#line 495 "engines/director/lingo/lingo-gr.y"
+#line 496 "engines/director/lingo/lingo-gr.y"
{ g_lingo->codeMe((yyvsp[(3) - (4)].s), 0); ;}
break;
case 114:
-#line 496 "engines/director/lingo/lingo-gr.y"
+#line 497 "engines/director/lingo/lingo-gr.y"
{ g_lingo->codeMe((yyvsp[(3) - (6)].s), (yyvsp[(5) - (6)].narg)); ;}
break;
case 115:
-#line 497 "engines/director/lingo/lingo-gr.y"
+#line 498 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_open); ;}
break;
case 116:
-#line 498 "engines/director/lingo/lingo-gr.y"
+#line 499 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code2(g_lingo->c_voidpush, g_lingo->c_open); ;}
break;
case 117:
-#line 499 "engines/director/lingo/lingo-gr.y"
+#line 500 "engines/director/lingo/lingo-gr.y"
{ Common::String s(*(yyvsp[(1) - (3)].s)); s += '-'; s += *(yyvsp[(2) - (3)].s); g_lingo->codeFunc(&s, (yyvsp[(3) - (3)].narg)); ;}
break;
case 118:
-#line 502 "engines/director/lingo/lingo-gr.y"
+#line 503 "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 119:
-#line 503 "engines/director/lingo/lingo-gr.y"
+#line 504 "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 120:
-#line 506 "engines/director/lingo/lingo-gr.y"
+#line 507 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_property); g_lingo->codeString((yyvsp[(1) - (1)].s)->c_str()); delete (yyvsp[(1) - (1)].s); ;}
break;
case 121:
-#line 507 "engines/director/lingo/lingo-gr.y"
+#line 508 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_property); g_lingo->codeString((yyvsp[(3) - (3)].s)->c_str()); delete (yyvsp[(3) - (3)].s); ;}
break;
case 122:
-#line 510 "engines/director/lingo/lingo-gr.y"
+#line 511 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_instance); g_lingo->codeString((yyvsp[(1) - (1)].s)->c_str()); delete (yyvsp[(1) - (1)].s); ;}
break;
case 123:
-#line 511 "engines/director/lingo/lingo-gr.y"
+#line 512 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_instance); g_lingo->codeString((yyvsp[(3) - (3)].s)->c_str()); delete (yyvsp[(3) - (3)].s); ;}
break;
case 124:
-#line 522 "engines/director/lingo/lingo-gr.y"
+#line 523 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_gotoloop); ;}
break;
case 125:
-#line 523 "engines/director/lingo/lingo-gr.y"
+#line 524 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_gotonext); ;}
break;
case 126:
-#line 524 "engines/director/lingo/lingo-gr.y"
+#line 525 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_gotoprevious); ;}
break;
case 127:
-#line 525 "engines/director/lingo/lingo-gr.y"
+#line 526 "engines/director/lingo/lingo-gr.y"
{
g_lingo->codeConst(1);
g_lingo->code1(g_lingo->c_goto); ;}
break;
case 128:
-#line 528 "engines/director/lingo/lingo-gr.y"
+#line 529 "engines/director/lingo/lingo-gr.y"
{
g_lingo->codeConst(3);
g_lingo->code1(g_lingo->c_goto); ;}
break;
case 129:
-#line 531 "engines/director/lingo/lingo-gr.y"
+#line 532 "engines/director/lingo/lingo-gr.y"
{
g_lingo->codeConst(2);
g_lingo->code1(g_lingo->c_goto); ;}
break;
case 134:
-#line 544 "engines/director/lingo/lingo-gr.y"
+#line 545 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_playdone); ;}
break;
case 135:
-#line 545 "engines/director/lingo/lingo-gr.y"
+#line 546 "engines/director/lingo/lingo-gr.y"
{
g_lingo->codeConst(1);
g_lingo->code1(g_lingo->c_play); ;}
break;
case 136:
-#line 548 "engines/director/lingo/lingo-gr.y"
+#line 549 "engines/director/lingo/lingo-gr.y"
{
g_lingo->codeConst(3);
g_lingo->code1(g_lingo->c_play); ;}
break;
case 137:
-#line 551 "engines/director/lingo/lingo-gr.y"
+#line 552 "engines/director/lingo/lingo-gr.y"
{
g_lingo->codeConst(2);
g_lingo->code1(g_lingo->c_play); ;}
break;
case 138:
-#line 554 "engines/director/lingo/lingo-gr.y"
+#line 555 "engines/director/lingo/lingo-gr.y"
{ g_lingo->codeSetImmediate(true); ;}
break;
case 139:
-#line 554 "engines/director/lingo/lingo-gr.y"
+#line 555 "engines/director/lingo/lingo-gr.y"
{
g_lingo->codeSetImmediate(false);
g_lingo->codeFunc((yyvsp[(1) - (3)].s), (yyvsp[(3) - (3)].narg)); ;}
break;
case 140:
-#line 584 "engines/director/lingo/lingo-gr.y"
+#line 585 "engines/director/lingo/lingo-gr.y"
{ g_lingo->_indef = true; g_lingo->_currentFactory.clear(); ;}
break;
case 141:
-#line 585 "engines/director/lingo/lingo-gr.y"
+#line 586 "engines/director/lingo/lingo-gr.y"
{
g_lingo->codeConst(0); // Push fake value on stack
g_lingo->code1(g_lingo->c_procret);
@@ -2887,19 +2888,19 @@ yyreduce:
break;
case 142:
-#line 590 "engines/director/lingo/lingo-gr.y"
+#line 591 "engines/director/lingo/lingo-gr.y"
{
g_lingo->codeFactory(*(yyvsp[(2) - (2)].s));
;}
break;
case 143:
-#line 593 "engines/director/lingo/lingo-gr.y"
+#line 594 "engines/director/lingo/lingo-gr.y"
{ g_lingo->_indef = true; ;}
break;
case 144:
-#line 594 "engines/director/lingo/lingo-gr.y"
+#line 595 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_procret);
g_lingo->define(*(yyvsp[(2) - (8)].s), (yyvsp[(4) - (8)].code), (yyvsp[(5) - (8)].narg) + 1, &g_lingo->_currentFactory);
@@ -2907,17 +2908,17 @@ yyreduce:
break;
case 145:
-#line 598 "engines/director/lingo/lingo-gr.y"
+#line 599 "engines/director/lingo/lingo-gr.y"
{ g_lingo->_indef = true; g_lingo->_currentFactory.clear(); ;}
break;
case 146:
-#line 599 "engines/director/lingo/lingo-gr.y"
+#line 600 "engines/director/lingo/lingo-gr.y"
{ g_lingo->_ignoreMe = true; ;}
break;
case 147:
-#line 599 "engines/director/lingo/lingo-gr.y"
+#line 600 "engines/director/lingo/lingo-gr.y"
{
g_lingo->codeConst(0); // Push fake value on stack
g_lingo->code1(g_lingo->c_procret);
@@ -2930,32 +2931,32 @@ yyreduce:
break;
case 148:
-#line 609 "engines/director/lingo/lingo-gr.y"
+#line 610 "engines/director/lingo/lingo-gr.y"
{ (yyval.narg) = 0; ;}
break;
case 149:
-#line 610 "engines/director/lingo/lingo-gr.y"
+#line 611 "engines/director/lingo/lingo-gr.y"
{ g_lingo->codeArg((yyvsp[(1) - (1)].s)); (yyval.narg) = 1; ;}
break;
case 150:
-#line 611 "engines/director/lingo/lingo-gr.y"
+#line 612 "engines/director/lingo/lingo-gr.y"
{ g_lingo->codeArg((yyvsp[(3) - (3)].s)); (yyval.narg) = (yyvsp[(1) - (3)].narg) + 1; ;}
break;
case 151:
-#line 612 "engines/director/lingo/lingo-gr.y"
+#line 613 "engines/director/lingo/lingo-gr.y"
{ g_lingo->codeArg((yyvsp[(4) - (4)].s)); (yyval.narg) = (yyvsp[(1) - (4)].narg) + 1; ;}
break;
case 152:
-#line 615 "engines/director/lingo/lingo-gr.y"
+#line 616 "engines/director/lingo/lingo-gr.y"
{ g_lingo->codeArgStore(); ;}
break;
case 153:
-#line 619 "engines/director/lingo/lingo-gr.y"
+#line 620 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_call);
g_lingo->codeString((yyvsp[(1) - (2)].s)->c_str());
@@ -2965,33 +2966,33 @@ yyreduce:
break;
case 154:
-#line 627 "engines/director/lingo/lingo-gr.y"
+#line 628 "engines/director/lingo/lingo-gr.y"
{ (yyval.narg) = 0; ;}
break;
case 155:
-#line 628 "engines/director/lingo/lingo-gr.y"
+#line 629 "engines/director/lingo/lingo-gr.y"
{ (yyval.narg) = 1; ;}
break;
case 156:
-#line 629 "engines/director/lingo/lingo-gr.y"
+#line 630 "engines/director/lingo/lingo-gr.y"
{ (yyval.narg) = (yyvsp[(1) - (3)].narg) + 1; ;}
break;
case 157:
-#line 632 "engines/director/lingo/lingo-gr.y"
+#line 633 "engines/director/lingo/lingo-gr.y"
{ (yyval.narg) = 1; ;}
break;
case 158:
-#line 633 "engines/director/lingo/lingo-gr.y"
+#line 634 "engines/director/lingo/lingo-gr.y"
{ (yyval.narg) = (yyvsp[(1) - (3)].narg) + 1; ;}
break;
/* Line 1267 of yacc.c. */
-#line 2995 "engines/director/lingo/lingo-gr.cpp"
+#line 2996 "engines/director/lingo/lingo-gr.cpp"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -3205,6 +3206,6 @@ yyreturn:
}
-#line 636 "engines/director/lingo/lingo-gr.y"
+#line 637 "engines/director/lingo/lingo-gr.y"
diff --git a/engines/director/lingo/lingo-gr.y b/engines/director/lingo/lingo-gr.y
index ee4d8db4c3..ccf4899c44 100644
--- a/engines/director/lingo/lingo-gr.y
+++ b/engines/director/lingo/lingo-gr.y
@@ -411,10 +411,10 @@ expr: INT { $$ = g_lingo->codeConst($1); }
$$ = g_lingo->code1(g_lingo->c_stringpush);
g_lingo->codeString($1->c_str()); }
| FBLTINNOARGS {
- $$ = g_lingo->code1(g_lingo->_builtins[*$1]->u.func);
+ g_lingo->codeFunc($1, 0);
delete $1; }
| FBLTINONEARG expr {
- g_lingo->code1(g_lingo->_builtins[*$1]->u.func);
+ g_lingo->codeFunc($1, 1);
delete $1; }
| ID '(' arglist ')' {
$$ = g_lingo->codeFunc($1, $3);
@@ -480,16 +480,17 @@ proc: tPUT expr { g_lingo->code1(g_lingo->c_printtop); }
| tPROPERTY propertylist
| tINSTANCE instancelist
| BLTINNOARGS {
- g_lingo->code1(g_lingo->_builtins[*$1]->u.func);
+ g_lingo->codeFunc($1, 0);
delete $1; }
| BLTINONEARG expr {
- g_lingo->code1(g_lingo->_builtins[*$1]->u.func);
+ g_lingo->codeFunc($1, 1);
delete $1; }
| BLTINNOARGSORONE expr {
- g_lingo->code1(g_lingo->_builtins[*$1]->u.func);
+ g_lingo->codeFunc($1, 1);
delete $1; }
| BLTINNOARGSORONE {
- g_lingo->code2(g_lingo->c_voidpush, g_lingo->_builtins[*$1]->u.func);
+ g_lingo->code1(g_lingo->c_voidpush);
+ g_lingo->codeFunc($1, 1);
delete $1; }
| BLTINARGLIST nonemptyarglist { g_lingo->codeFunc($1, $2); }
| tME '(' ID ')' { g_lingo->codeMe($3, 0); }