mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-08 11:57:25 +00:00
DIRECTOR: LINGO: Added special grammar case for "the meuItem" field
This commit is contained in:
parent
3de471de36
commit
1ab92ea017
File diff suppressed because it is too large
Load Diff
@ -63,72 +63,73 @@ extern int yydebug;
|
||||
ARGCNORET = 269,
|
||||
THEENTITY = 270,
|
||||
THEENTITYWITHID = 271,
|
||||
FLOAT = 272,
|
||||
BLTIN = 273,
|
||||
FBLTIN = 274,
|
||||
RBLTIN = 275,
|
||||
ID = 276,
|
||||
STRING = 277,
|
||||
HANDLER = 278,
|
||||
SYMBOL = 279,
|
||||
ENDCLAUSE = 280,
|
||||
tPLAYACCEL = 281,
|
||||
tMETHOD = 282,
|
||||
THEOBJECTFIELD = 283,
|
||||
tDOWN = 284,
|
||||
tELSE = 285,
|
||||
tELSIF = 286,
|
||||
tEXIT = 287,
|
||||
tGLOBAL = 288,
|
||||
tGO = 289,
|
||||
tIF = 290,
|
||||
tINTO = 291,
|
||||
tLOOP = 292,
|
||||
tMACRO = 293,
|
||||
tMOVIE = 294,
|
||||
tNEXT = 295,
|
||||
tOF = 296,
|
||||
tPREVIOUS = 297,
|
||||
tPUT = 298,
|
||||
tREPEAT = 299,
|
||||
tSET = 300,
|
||||
tTHEN = 301,
|
||||
tTO = 302,
|
||||
tWHEN = 303,
|
||||
tWITH = 304,
|
||||
tWHILE = 305,
|
||||
tNLELSE = 306,
|
||||
tFACTORY = 307,
|
||||
tOPEN = 308,
|
||||
tPLAY = 309,
|
||||
tDONE = 310,
|
||||
tINSTANCE = 311,
|
||||
tGE = 312,
|
||||
tLE = 313,
|
||||
tEQ = 314,
|
||||
tNEQ = 315,
|
||||
tAND = 316,
|
||||
tOR = 317,
|
||||
tNOT = 318,
|
||||
tMOD = 319,
|
||||
tAFTER = 320,
|
||||
tBEFORE = 321,
|
||||
tCONCAT = 322,
|
||||
tCONTAINS = 323,
|
||||
tSTARTS = 324,
|
||||
tCHAR = 325,
|
||||
tITEM = 326,
|
||||
tLINE = 327,
|
||||
tWORD = 328,
|
||||
tSPRITE = 329,
|
||||
tINTERSECTS = 330,
|
||||
tWITHIN = 331,
|
||||
tTELL = 332,
|
||||
tPROPERTY = 333,
|
||||
tON = 334,
|
||||
tENDIF = 335,
|
||||
tENDREPEAT = 336,
|
||||
tENDTELL = 337
|
||||
THEMENUITEMENTITY = 272,
|
||||
FLOAT = 273,
|
||||
BLTIN = 274,
|
||||
FBLTIN = 275,
|
||||
RBLTIN = 276,
|
||||
ID = 277,
|
||||
STRING = 278,
|
||||
HANDLER = 279,
|
||||
SYMBOL = 280,
|
||||
ENDCLAUSE = 281,
|
||||
tPLAYACCEL = 282,
|
||||
tMETHOD = 283,
|
||||
THEOBJECTFIELD = 284,
|
||||
tDOWN = 285,
|
||||
tELSE = 286,
|
||||
tELSIF = 287,
|
||||
tEXIT = 288,
|
||||
tGLOBAL = 289,
|
||||
tGO = 290,
|
||||
tIF = 291,
|
||||
tINTO = 292,
|
||||
tLOOP = 293,
|
||||
tMACRO = 294,
|
||||
tMOVIE = 295,
|
||||
tNEXT = 296,
|
||||
tOF = 297,
|
||||
tPREVIOUS = 298,
|
||||
tPUT = 299,
|
||||
tREPEAT = 300,
|
||||
tSET = 301,
|
||||
tTHEN = 302,
|
||||
tTO = 303,
|
||||
tWHEN = 304,
|
||||
tWITH = 305,
|
||||
tWHILE = 306,
|
||||
tNLELSE = 307,
|
||||
tFACTORY = 308,
|
||||
tOPEN = 309,
|
||||
tPLAY = 310,
|
||||
tDONE = 311,
|
||||
tINSTANCE = 312,
|
||||
tGE = 313,
|
||||
tLE = 314,
|
||||
tEQ = 315,
|
||||
tNEQ = 316,
|
||||
tAND = 317,
|
||||
tOR = 318,
|
||||
tNOT = 319,
|
||||
tMOD = 320,
|
||||
tAFTER = 321,
|
||||
tBEFORE = 322,
|
||||
tCONCAT = 323,
|
||||
tCONTAINS = 324,
|
||||
tSTARTS = 325,
|
||||
tCHAR = 326,
|
||||
tITEM = 327,
|
||||
tLINE = 328,
|
||||
tWORD = 329,
|
||||
tSPRITE = 330,
|
||||
tINTERSECTS = 331,
|
||||
tWITHIN = 332,
|
||||
tTELL = 333,
|
||||
tPROPERTY = 334,
|
||||
tON = 335,
|
||||
tENDIF = 336,
|
||||
tENDREPEAT = 337,
|
||||
tENDTELL = 338
|
||||
};
|
||||
#endif
|
||||
|
||||
@ -151,7 +152,7 @@ union YYSTYPE
|
||||
int oe;
|
||||
} objectfield;
|
||||
|
||||
#line 155 "engines/director/lingo/lingo-gr.h"
|
||||
#line 156 "engines/director/lingo/lingo-gr.h"
|
||||
|
||||
};
|
||||
typedef union YYSTYPE YYSTYPE;
|
||||
|
@ -101,7 +101,7 @@ void checkEnd(Common::String *token, const char *expect, bool required) {
|
||||
%token UNARY
|
||||
%token CASTREF VOID VAR POINT RECT ARRAY OBJECT REFERENCE
|
||||
%token<i> INT ARGC ARGCNORET
|
||||
%token<e> THEENTITY THEENTITYWITHID
|
||||
%token<e> THEENTITY THEENTITYWITHID THEMENUITEMENTITY
|
||||
%token<f> FLOAT
|
||||
%token<s> BLTIN FBLTIN RBLTIN
|
||||
%token<s> ID STRING HANDLER SYMBOL
|
||||
@ -189,6 +189,18 @@ asgn: tPUT expr tINTO ID {
|
||||
g_lingo->codeInt($THEENTITYWITHID[0]);
|
||||
g_lingo->codeInt($THEENTITYWITHID[1]);
|
||||
$$ = $expr; }
|
||||
// the <field> of menuItem <expr>" of menu <expr>
|
||||
| tSET THEMENUITEMENTITY simpleexpr tOF ID simpleexpr tTO expr {
|
||||
if (!$ID->equalsIgnoreCase("menu")) {
|
||||
error("LEXER: keyword 'menu' expected");
|
||||
}
|
||||
|
||||
warning("STUB: menuItem entity");
|
||||
g_lingo->code1(LC::c_swap);
|
||||
g_lingo->code1(LC::c_theentityassign);
|
||||
g_lingo->codeInt($THEMENUITEMENTITY[0]);
|
||||
g_lingo->codeInt($THEMENUITEMENTITY[1]);
|
||||
$$ = $expr; }
|
||||
| tSET THEOBJECTFIELD tTO expr {
|
||||
g_lingo->code1(LC::c_objectfieldassign);
|
||||
g_lingo->codeString($THEOBJECTFIELD.os->c_str());
|
||||
|
@ -1488,6 +1488,10 @@ YY_RULE_SETUP
|
||||
yylval.e[0] = g_lingo->_theEntities[ptr]->entity;
|
||||
yylval.e[1] = g_lingo->_theEntityFields[field]->field;
|
||||
|
||||
// the <field> of menuItem <expr>" of menu <expr>
|
||||
if (g_lingo->_theEntityFields[field]->entity == kTheMenuItem)
|
||||
return THEMENUITEMENTITY;
|
||||
|
||||
if (g_lingo->_theEntities[ptr]->hasId)
|
||||
return THEENTITYWITHID;
|
||||
else
|
||||
@ -1512,7 +1516,7 @@ YY_RULE_SETUP
|
||||
YY_BREAK
|
||||
case 54:
|
||||
YY_RULE_SETUP
|
||||
#line 280 "engines/director/lingo/lingo-lex.l"
|
||||
#line 284 "engines/director/lingo/lingo-lex.l"
|
||||
{
|
||||
count();
|
||||
|
||||
@ -1547,7 +1551,7 @@ YY_RULE_SETUP
|
||||
YY_BREAK
|
||||
case 55:
|
||||
YY_RULE_SETUP
|
||||
#line 311 "engines/director/lingo/lingo-lex.l"
|
||||
#line 315 "engines/director/lingo/lingo-lex.l"
|
||||
{
|
||||
count();
|
||||
|
||||
@ -1570,72 +1574,72 @@ YY_RULE_SETUP
|
||||
YY_BREAK
|
||||
case 56:
|
||||
YY_RULE_SETUP
|
||||
#line 330 "engines/director/lingo/lingo-lex.l"
|
||||
#line 334 "engines/director/lingo/lingo-lex.l"
|
||||
{ count(); return tTHEN; }
|
||||
YY_BREAK
|
||||
case 57:
|
||||
YY_RULE_SETUP
|
||||
#line 331 "engines/director/lingo/lingo-lex.l"
|
||||
#line 335 "engines/director/lingo/lingo-lex.l"
|
||||
{ count(); return tTO; }
|
||||
YY_BREAK
|
||||
case 58:
|
||||
YY_RULE_SETUP
|
||||
#line 332 "engines/director/lingo/lingo-lex.l"
|
||||
#line 336 "engines/director/lingo/lingo-lex.l"
|
||||
{ count(); return tSPRITE; }
|
||||
YY_BREAK
|
||||
case 59:
|
||||
YY_RULE_SETUP
|
||||
#line 333 "engines/director/lingo/lingo-lex.l"
|
||||
#line 337 "engines/director/lingo/lingo-lex.l"
|
||||
{ count(); return tWITH; }
|
||||
YY_BREAK
|
||||
case 60:
|
||||
YY_RULE_SETUP
|
||||
#line 334 "engines/director/lingo/lingo-lex.l"
|
||||
#line 338 "engines/director/lingo/lingo-lex.l"
|
||||
{ count(); return tWITHIN; }
|
||||
YY_BREAK
|
||||
case 61:
|
||||
YY_RULE_SETUP
|
||||
#line 335 "engines/director/lingo/lingo-lex.l"
|
||||
#line 339 "engines/director/lingo/lingo-lex.l"
|
||||
{ count(); return tWHEN; }
|
||||
YY_BREAK
|
||||
case 62:
|
||||
YY_RULE_SETUP
|
||||
#line 336 "engines/director/lingo/lingo-lex.l"
|
||||
#line 340 "engines/director/lingo/lingo-lex.l"
|
||||
{ count(); return tWHILE; }
|
||||
YY_BREAK
|
||||
case 63:
|
||||
YY_RULE_SETUP
|
||||
#line 337 "engines/director/lingo/lingo-lex.l"
|
||||
#line 341 "engines/director/lingo/lingo-lex.l"
|
||||
{ count(); return tWORD; }
|
||||
YY_BREAK
|
||||
case 64:
|
||||
YY_RULE_SETUP
|
||||
#line 339 "engines/director/lingo/lingo-lex.l"
|
||||
#line 343 "engines/director/lingo/lingo-lex.l"
|
||||
{ count(); return tNEQ; }
|
||||
YY_BREAK
|
||||
case 65:
|
||||
YY_RULE_SETUP
|
||||
#line 340 "engines/director/lingo/lingo-lex.l"
|
||||
#line 344 "engines/director/lingo/lingo-lex.l"
|
||||
{ count(); return tGE; }
|
||||
YY_BREAK
|
||||
case 66:
|
||||
YY_RULE_SETUP
|
||||
#line 341 "engines/director/lingo/lingo-lex.l"
|
||||
#line 345 "engines/director/lingo/lingo-lex.l"
|
||||
{ count(); return tLE; }
|
||||
YY_BREAK
|
||||
case 67:
|
||||
YY_RULE_SETUP
|
||||
#line 342 "engines/director/lingo/lingo-lex.l"
|
||||
#line 346 "engines/director/lingo/lingo-lex.l"
|
||||
{ count(); return tCONCAT; }
|
||||
YY_BREAK
|
||||
case 68:
|
||||
YY_RULE_SETUP
|
||||
#line 343 "engines/director/lingo/lingo-lex.l"
|
||||
#line 347 "engines/director/lingo/lingo-lex.l"
|
||||
{ count(); return tEQ; }
|
||||
YY_BREAK
|
||||
case 69:
|
||||
YY_RULE_SETUP
|
||||
#line 345 "engines/director/lingo/lingo-lex.l"
|
||||
#line 349 "engines/director/lingo/lingo-lex.l"
|
||||
{
|
||||
count();
|
||||
yylval.s = new Common::String(yytext);
|
||||
@ -1671,41 +1675,41 @@ YY_RULE_SETUP
|
||||
YY_BREAK
|
||||
case 70:
|
||||
YY_RULE_SETUP
|
||||
#line 377 "engines/director/lingo/lingo-lex.l"
|
||||
#line 381 "engines/director/lingo/lingo-lex.l"
|
||||
{ count(); yylval.f = atof(yytext); return FLOAT; }
|
||||
YY_BREAK
|
||||
case 71:
|
||||
YY_RULE_SETUP
|
||||
#line 378 "engines/director/lingo/lingo-lex.l"
|
||||
#line 382 "engines/director/lingo/lingo-lex.l"
|
||||
{ count(); yylval.i = strtol(yytext, NULL, 10); return INT; }
|
||||
YY_BREAK
|
||||
case 72:
|
||||
YY_RULE_SETUP
|
||||
#line 379 "engines/director/lingo/lingo-lex.l"
|
||||
#line 383 "engines/director/lingo/lingo-lex.l"
|
||||
{ count(); return *yytext; }
|
||||
YY_BREAK
|
||||
case 73:
|
||||
/* rule 73 can match eol */
|
||||
YY_RULE_SETUP
|
||||
#line 380 "engines/director/lingo/lingo-lex.l"
|
||||
#line 384 "engines/director/lingo/lingo-lex.l"
|
||||
{ count(); return '\n'; }
|
||||
YY_BREAK
|
||||
case 74:
|
||||
YY_RULE_SETUP
|
||||
#line 381 "engines/director/lingo/lingo-lex.l"
|
||||
#line 385 "engines/director/lingo/lingo-lex.l"
|
||||
{ count(); yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return STRING; }
|
||||
YY_BREAK
|
||||
case 75:
|
||||
YY_RULE_SETUP
|
||||
#line 382 "engines/director/lingo/lingo-lex.l"
|
||||
#line 386 "engines/director/lingo/lingo-lex.l"
|
||||
{ count(); }
|
||||
YY_BREAK
|
||||
case 76:
|
||||
YY_RULE_SETUP
|
||||
#line 384 "engines/director/lingo/lingo-lex.l"
|
||||
#line 388 "engines/director/lingo/lingo-lex.l"
|
||||
ECHO;
|
||||
YY_BREAK
|
||||
#line 1709 "engines/director/lingo/lingo-lex.cpp"
|
||||
#line 1713 "engines/director/lingo/lingo-lex.cpp"
|
||||
case YY_STATE_EOF(INITIAL):
|
||||
yyterminate();
|
||||
|
||||
@ -2665,7 +2669,7 @@ void yyfree (void * ptr )
|
||||
|
||||
#define YYTABLES_NAME "yytables"
|
||||
|
||||
#line 384 "engines/director/lingo/lingo-lex.l"
|
||||
#line 388 "engines/director/lingo/lingo-lex.l"
|
||||
|
||||
|
||||
|
||||
|
@ -256,6 +256,10 @@ the[ \t]+[[:alpha:]]+[ \t]+of[ \t]+{identifier} {
|
||||
yylval.e[0] = g_lingo->_theEntities[ptr]->entity;
|
||||
yylval.e[1] = g_lingo->_theEntityFields[field]->field;
|
||||
|
||||
// the <field> of menuItem <expr>" of menu <expr>
|
||||
if (g_lingo->_theEntityFields[field]->entity == kTheMenuItem)
|
||||
return THEMENUITEMENTITY;
|
||||
|
||||
if (g_lingo->_theEntities[ptr]->hasId)
|
||||
return THEENTITYWITHID;
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user