aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2016-07-09 21:20:03 +0200
committerEugene Sandulenko2016-08-03 23:40:36 +0200
commitda408c0ad03429a4cbe9718491c1130fef47e1d1 (patch)
treec13fe30f33233c571442ff8630285bb2c7a32b4b
parent8084989605853dd23e265a1f649e36611bdbfd99 (diff)
downloadscummvm-rg350-da408c0ad03429a4cbe9718491c1130fef47e1d1.tar.gz
scummvm-rg350-da408c0ad03429a4cbe9718491c1130fef47e1d1.tar.bz2
scummvm-rg350-da408c0ad03429a4cbe9718491c1130fef47e1d1.zip
DIRECTOR: Lingo: Implement 'contains' and 'starts' string operators
-rw-r--r--engines/director/director.cpp4
-rw-r--r--engines/director/lingo/lingo-code.cpp46
-rw-r--r--engines/director/lingo/lingo-gr.cpp782
-rw-r--r--engines/director/lingo/lingo-gr.h8
-rw-r--r--engines/director/lingo/lingo-gr.y5
-rw-r--r--engines/director/lingo/lingo-lex.cpp400
-rw-r--r--engines/director/lingo/lingo-lex.l2
-rw-r--r--engines/director/lingo/lingo.cpp43
-rw-r--r--engines/director/lingo/lingo.h4
9 files changed, 715 insertions, 579 deletions
diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index 97e7c70fda..107a9a5f77 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -134,7 +134,9 @@ Common::Error DirectorEngine::run() {
put z1\n\
put chars(\"Macromedia\", 6, 6)\n\
put chars(\"Macromedia\", 6, 10)\n\
- put chars(\"Macromedia\", 6, 15)\n\
+ put chars(\"Macromedia\", -1, 15)\n\
+ if z1 contains \"Me\xafW\" then put \"Contains\"\n\
+ else put \"Doesn't contain\"\n\
", kMovieScript, 2);
_lingo->executeScript(kMovieScript, 2);
diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp
index a576f1c91d..817f9c9a7f 100644
--- a/engines/director/lingo/lingo-code.cpp
+++ b/engines/director/lingo/lingo-code.cpp
@@ -311,6 +311,52 @@ void Lingo::c_concat() {
g_lingo->push(d1);
}
+void Lingo::c_contains() {
+ Datum d2 = g_lingo->pop();
+ Datum d1 = g_lingo->pop();
+
+ d1.toString();
+ d2.toString();
+
+ Common::String *s1 = g_lingo->toLowercaseMac(d1.u.s);
+ Common::String *s2 = g_lingo->toLowercaseMac(d2.u.s);
+
+ int res = s1->contains(*s2) ? 1 : 0;
+
+ delete d1.u.s;
+ delete d2.u.s;
+ delete s1;
+ delete s2;
+
+ d1.type = INT;
+ d1.u.i = res;
+
+ g_lingo->push(d1);
+}
+
+void Lingo::c_starts() {
+ Datum d2 = g_lingo->pop();
+ Datum d1 = g_lingo->pop();
+
+ d1.toString();
+ d2.toString();
+
+ Common::String *s1 = g_lingo->toLowercaseMac(d1.u.s);
+ Common::String *s2 = g_lingo->toLowercaseMac(d2.u.s);
+
+ int res = s1->hasPrefix(*s2) ? 1 : 0;
+
+ delete d1.u.s;
+ delete d2.u.s;
+ delete s1;
+ delete s2;
+
+ d1.type = INT;
+ d1.u.i = res;
+
+ g_lingo->push(d1);
+}
+
void Lingo::c_and() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
diff --git a/engines/director/lingo/lingo-gr.cpp b/engines/director/lingo/lingo-gr.cpp
index 2077d5c9ba..f5c4e3da1d 100644
--- a/engines/director/lingo/lingo-gr.cpp
+++ b/engines/director/lingo/lingo-gr.cpp
@@ -111,7 +111,9 @@
tAND = 300,
tOR = 301,
tNOT = 302,
- tCONCAT = 303
+ tCONCAT = 303,
+ tCONTAINS = 304,
+ tSTARTS = 305
};
#endif
/* Tokens. */
@@ -161,6 +163,8 @@
#define tOR 301
#define tNOT 302
#define tCONCAT 303
+#define tCONTAINS 304
+#define tSTARTS 305
@@ -212,7 +216,7 @@ typedef union YYSTYPE
int narg; /* number of arguments */
}
/* Line 193 of yacc.c. */
-#line 216 "engines/director/lingo/lingo-gr.cpp"
+#line 220 "engines/director/lingo/lingo-gr.cpp"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
@@ -225,7 +229,7 @@ typedef union YYSTYPE
/* Line 216 of yacc.c. */
-#line 229 "engines/director/lingo/lingo-gr.cpp"
+#line 233 "engines/director/lingo/lingo-gr.cpp"
#ifdef short
# undef short
@@ -440,20 +444,20 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 64
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 540
+#define YYLAST 544
/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 62
+#define YYNTOKENS 64
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 33
/* YYNRULES -- Number of rules. */
-#define YYNRULES 104
+#define YYNRULES 106
/* YYNRULES -- Number of states. */
-#define YYNSTATES 219
+#define YYNSTATES 223
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
-#define YYMAXUTOK 303
+#define YYMAXUTOK 305
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
@@ -462,12 +466,12 @@ union yyalloc
static const yytype_uint8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 55, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 57, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 54, 60, 2,
- 56, 57, 52, 50, 61, 51, 2, 53, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 56, 62, 2,
+ 58, 59, 54, 52, 63, 53, 2, 55, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 59, 49, 58, 2, 2, 2, 2, 2, 2, 2,
+ 61, 51, 60, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -491,7 +495,7 @@ static const yytype_uint8 yytranslate[] =
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
- 45, 46, 47, 48
+ 45, 46, 47, 48, 49, 50
};
#if YYDEBUG
@@ -506,70 +510,71 @@ static const yytype_uint16 yyprhs[] =
184, 187, 191, 193, 195, 196, 197, 198, 201, 204,
206, 208, 210, 215, 220, 222, 224, 228, 232, 236,
240, 244, 248, 252, 256, 260, 264, 268, 271, 275,
- 279, 282, 285, 289, 292, 295, 298, 300, 302, 305,
- 307, 311, 314, 317, 320, 323, 327, 330, 334, 337,
- 340, 342, 346, 349, 353, 354, 363, 364, 366, 370,
- 375, 376, 380, 381, 383
+ 279, 283, 287, 290, 293, 297, 300, 303, 306, 308,
+ 310, 313, 315, 319, 322, 325, 328, 331, 335, 338,
+ 342, 345, 348, 350, 354, 357, 361, 362, 371, 372,
+ 374, 378, 383, 384, 388, 389, 391
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const yytype_int8 yyrhs[] =
{
- 63, 0, -1, 63, 64, 65, -1, 65, -1, 55,
- -1, -1, 89, -1, 84, -1, 93, -1, 66, -1,
- 68, -1, 1, -1, 31, 83, 22, 10, -1, 33,
- 10, 49, 83, -1, 33, 10, 35, 83, -1, 83,
- -1, 84, -1, 67, -1, 69, -1, 76, 56, 75,
- 57, 82, 81, 16, 32, -1, 77, 49, 83, 81,
- 35, 83, 81, 82, 81, 16, 32, -1, 77, 49,
- 83, 81, 13, 35, 83, 81, 82, 81, 16, 32,
- -1, 78, 75, 34, 64, 82, 81, 16, 21, -1,
- 78, 75, 34, 64, 82, 81, 14, 82, 81, 16,
- 21, -1, 78, 75, 34, 64, 82, 81, 80, 71,
- 81, 64, 16, 21, -1, 78, 75, 34, 80, 67,
- 81, -1, 78, 75, 34, 80, 67, 81, 38, 80,
- 67, 81, -1, 78, 75, 34, 80, 67, 81, 72,
- 81, 70, 81, -1, -1, 38, 80, 67, -1, 71,
- 74, -1, 74, -1, 72, 73, -1, 73, -1, 79,
- 75, 34, 80, 68, 81, -1, 72, -1, 79, 75,
- 34, 82, 81, -1, 83, -1, 83, 49, 83, -1,
- 56, 75, 57, -1, 32, 37, -1, 32, 36, 10,
- -1, 21, -1, 15, -1, -1, -1, -1, 82, 64,
- -1, 82, 68, -1, 7, -1, 8, -1, 11, -1,
- 9, 56, 94, 57, -1, 10, 56, 94, 57, -1,
- 10, -1, 66, -1, 83, 50, 83, -1, 83, 51,
- 83, -1, 83, 52, 83, -1, 83, 53, 83, -1,
- 83, 58, 83, -1, 83, 59, 83, -1, 83, 44,
- 83, -1, 83, 39, 83, -1, 83, 40, 83, -1,
- 83, 45, 83, -1, 83, 46, 83, -1, 47, 83,
- -1, 83, 60, 83, -1, 83, 48, 83, -1, 50,
- 83, -1, 51, 83, -1, 56, 83, 57, -1, 25,
- 11, -1, 26, 10, -1, 31, 83, -1, 86, -1,
- 17, -1, 19, 85, -1, 10, -1, 85, 61, 10,
- -1, 20, 23, -1, 20, 28, -1, 20, 30, -1,
- 20, 87, -1, 20, 87, 88, -1, 20, 88, -1,
- 35, 18, 11, -1, 18, 11, -1, 35, 11, -1,
- 11, -1, 29, 27, 11, -1, 27, 11, -1, 35,
- 27, 11, -1, -1, 24, 10, 90, 80, 91, 64,
- 92, 82, -1, -1, 10, -1, 91, 61, 10, -1,
- 91, 64, 61, 10, -1, -1, 10, 80, 94, -1,
- -1, 83, -1, 94, 61, 83, -1
+ 65, 0, -1, 65, 66, 67, -1, 67, -1, 57,
+ -1, -1, 91, -1, 86, -1, 95, -1, 68, -1,
+ 70, -1, 1, -1, 31, 85, 22, 10, -1, 33,
+ 10, 51, 85, -1, 33, 10, 35, 85, -1, 85,
+ -1, 86, -1, 69, -1, 71, -1, 78, 58, 77,
+ 59, 84, 83, 16, 32, -1, 79, 51, 85, 83,
+ 35, 85, 83, 84, 83, 16, 32, -1, 79, 51,
+ 85, 83, 13, 35, 85, 83, 84, 83, 16, 32,
+ -1, 80, 77, 34, 66, 84, 83, 16, 21, -1,
+ 80, 77, 34, 66, 84, 83, 14, 84, 83, 16,
+ 21, -1, 80, 77, 34, 66, 84, 83, 82, 73,
+ 83, 66, 16, 21, -1, 80, 77, 34, 82, 69,
+ 83, -1, 80, 77, 34, 82, 69, 83, 38, 82,
+ 69, 83, -1, 80, 77, 34, 82, 69, 83, 74,
+ 83, 72, 83, -1, -1, 38, 82, 69, -1, 73,
+ 76, -1, 76, -1, 74, 75, -1, 75, -1, 81,
+ 77, 34, 82, 70, 83, -1, 74, -1, 81, 77,
+ 34, 84, 83, -1, 85, -1, 85, 51, 85, -1,
+ 58, 77, 59, -1, 32, 37, -1, 32, 36, 10,
+ -1, 21, -1, 15, -1, -1, -1, -1, 84, 66,
+ -1, 84, 70, -1, 7, -1, 8, -1, 11, -1,
+ 9, 58, 96, 59, -1, 10, 58, 96, 59, -1,
+ 10, -1, 68, -1, 85, 52, 85, -1, 85, 53,
+ 85, -1, 85, 54, 85, -1, 85, 55, 85, -1,
+ 85, 60, 85, -1, 85, 61, 85, -1, 85, 44,
+ 85, -1, 85, 39, 85, -1, 85, 40, 85, -1,
+ 85, 45, 85, -1, 85, 46, 85, -1, 47, 85,
+ -1, 85, 62, 85, -1, 85, 48, 85, -1, 85,
+ 49, 85, -1, 85, 50, 85, -1, 52, 85, -1,
+ 53, 85, -1, 58, 85, 59, -1, 25, 11, -1,
+ 26, 10, -1, 31, 85, -1, 88, -1, 17, -1,
+ 19, 87, -1, 10, -1, 87, 63, 10, -1, 20,
+ 23, -1, 20, 28, -1, 20, 30, -1, 20, 89,
+ -1, 20, 89, 90, -1, 20, 90, -1, 35, 18,
+ 11, -1, 18, 11, -1, 35, 11, -1, 11, -1,
+ 29, 27, 11, -1, 27, 11, -1, 35, 27, 11,
+ -1, -1, 24, 10, 92, 82, 93, 66, 94, 84,
+ -1, -1, 10, -1, 93, 63, 10, -1, 93, 66,
+ 63, 10, -1, -1, 10, 82, 96, -1, -1, 85,
+ -1, 96, 63, 85, -1
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 93, 93, 94, 97, 102, 103, 104, 105, 106,
- 107, 108, 111, 117, 123, 130, 131, 133, 134, 139,
- 150, 166, 180, 187, 196, 205, 215, 225, 236, 237,
- 240, 241, 244, 245, 248, 256, 257, 265, 266, 267,
- 269, 271, 277, 283, 290, 292, 294, 295, 296, 299,
- 304, 307, 310, 316, 324, 327, 328, 329, 330, 331,
- 332, 333, 334, 335, 336, 337, 338, 339, 340, 341,
- 342, 343, 344, 347, 348, 349, 350, 351, 353, 356,
- 357, 368, 369, 370, 371, 376, 382, 389, 390, 391,
- 392, 395, 396, 397, 425, 425, 432, 433, 434, 435,
- 437, 440, 448, 449, 450
+ 0, 94, 94, 95, 98, 103, 104, 105, 106, 107,
+ 108, 109, 112, 118, 124, 131, 132, 134, 135, 140,
+ 151, 167, 181, 188, 197, 206, 216, 226, 237, 238,
+ 241, 242, 245, 246, 249, 257, 258, 266, 267, 268,
+ 270, 272, 278, 284, 291, 293, 295, 296, 297, 300,
+ 305, 308, 311, 317, 325, 328, 329, 330, 331, 332,
+ 333, 334, 335, 336, 337, 338, 339, 340, 341, 342,
+ 343, 344, 345, 346, 347, 350, 351, 352, 353, 354,
+ 356, 359, 360, 371, 372, 373, 374, 379, 385, 392,
+ 393, 394, 395, 398, 399, 400, 428, 428, 435, 436,
+ 437, 438, 440, 443, 451, 452, 453
};
#endif
@@ -584,10 +589,10 @@ static const char *const yytname[] =
"tLOOP", "tMACRO", "tMCI", "tMCIWAIT", "tMOVIE", "tNEXT", "tOF",
"tPREVIOUS", "tPUT", "tREPEAT", "tSET", "tTHEN", "tTO", "tWITH",
"tWHILE", "tNLELSE", "tGE", "tLE", "tGT", "tLT", "tEQ", "tNEQ", "tAND",
- "tOR", "tNOT", "tCONCAT", "'='", "'+'", "'-'", "'*'", "'/'", "'%'",
- "'\\n'", "'('", "')'", "'>'", "'<'", "'&'", "','", "$accept", "program",
- "nl", "programline", "asgn", "stmtoneliner", "stmt", "ifstmt",
- "elsestmtoneliner", "elseifstmt", "elseifstmtoneliner",
+ "tOR", "tNOT", "tCONCAT", "tCONTAINS", "tSTARTS", "'='", "'+'", "'-'",
+ "'*'", "'/'", "'%'", "'\\n'", "'('", "')'", "'>'", "'<'", "'&'", "','",
+ "$accept", "program", "nl", "programline", "asgn", "stmtoneliner",
+ "stmt", "ifstmt", "elsestmtoneliner", "elseifstmt", "elseifstmtoneliner",
"elseifstmtoneliner1", "elseifstmt1", "cond", "repeatwhile",
"repeatwith", "if", "elseif", "begin", "end", "stmtlist", "expr", "func",
"globallist", "gotofunc", "gotoframe", "gotomovie", "defn", "@1",
@@ -604,26 +609,26 @@ static const yytype_uint16 yytoknum[] =
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
- 295, 296, 297, 298, 299, 300, 301, 302, 303, 61,
- 43, 45, 42, 47, 37, 10, 40, 41, 62, 60,
- 38, 44
+ 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
+ 305, 61, 43, 45, 42, 47, 37, 10, 40, 41,
+ 62, 60, 38, 44
};
# endif
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_uint8 yyr1[] =
{
- 0, 62, 63, 63, 64, 65, 65, 65, 65, 65,
- 65, 65, 66, 66, 66, 67, 67, 68, 68, 68,
- 68, 68, 69, 69, 69, 69, 69, 69, 70, 70,
- 71, 71, 72, 72, 73, 74, 74, 75, 75, 75,
- 76, 77, 78, 79, 80, 81, 82, 82, 82, 83,
- 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
- 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
- 83, 83, 83, 84, 84, 84, 84, 84, 84, 85,
- 85, 86, 86, 86, 86, 86, 86, 87, 87, 87,
- 87, 88, 88, 88, 90, 89, 91, 91, 91, 91,
- 92, 93, 94, 94, 94
+ 0, 64, 65, 65, 66, 67, 67, 67, 67, 67,
+ 67, 67, 68, 68, 68, 69, 69, 70, 70, 70,
+ 70, 70, 71, 71, 71, 71, 71, 71, 72, 72,
+ 73, 73, 74, 74, 75, 76, 76, 77, 77, 77,
+ 78, 79, 80, 81, 82, 83, 84, 84, 84, 85,
+ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
+ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
+ 85, 85, 85, 85, 85, 86, 86, 86, 86, 86,
+ 86, 87, 87, 88, 88, 88, 88, 88, 88, 89,
+ 89, 89, 89, 90, 90, 90, 92, 91, 93, 93,
+ 93, 93, 94, 95, 96, 96, 96
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
@@ -636,10 +641,10 @@ static const yytype_uint8 yyr2[] =
2, 3, 1, 1, 0, 0, 0, 2, 2, 1,
1, 1, 4, 4, 1, 1, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 2, 3, 3,
- 2, 2, 3, 2, 2, 2, 1, 1, 2, 1,
- 3, 2, 2, 2, 2, 3, 2, 3, 2, 2,
- 1, 3, 2, 3, 0, 8, 0, 1, 3, 4,
- 0, 3, 0, 1, 3
+ 3, 3, 2, 2, 3, 2, 2, 2, 1, 1,
+ 2, 1, 3, 2, 2, 2, 2, 3, 2, 3,
+ 2, 2, 1, 3, 2, 3, 0, 8, 0, 1,
+ 3, 4, 0, 3, 0, 1, 3
};
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
@@ -647,75 +652,77 @@ static const yytype_uint8 yyr2[] =
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
- 0, 11, 49, 50, 0, 44, 51, 77, 0, 0,
+ 0, 11, 49, 50, 0, 44, 51, 79, 0, 0,
42, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 3, 55, 17, 10, 18, 0, 0, 0,
- 15, 7, 76, 6, 8, 102, 102, 102, 79, 78,
- 90, 0, 81, 0, 82, 0, 83, 0, 84, 86,
- 94, 73, 74, 54, 0, 55, 75, 0, 40, 0,
- 67, 70, 71, 0, 1, 4, 0, 0, 0, 0,
+ 15, 7, 78, 6, 8, 104, 104, 104, 81, 80,
+ 92, 0, 83, 0, 84, 0, 85, 0, 86, 88,
+ 96, 75, 76, 54, 0, 55, 77, 0, 40, 0,
+ 67, 72, 73, 0, 1, 4, 0, 0, 0, 0,
0, 37, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 103, 0, 0, 101, 0,
- 88, 92, 0, 89, 0, 0, 0, 85, 44, 0,
- 0, 41, 0, 0, 72, 2, 0, 45, 0, 0,
- 44, 0, 63, 64, 62, 65, 66, 69, 56, 57,
- 58, 59, 60, 61, 68, 52, 0, 53, 80, 91,
- 87, 93, 96, 12, 14, 13, 46, 0, 39, 46,
- 0, 38, 104, 97, 0, 45, 0, 0, 45, 45,
- 16, 0, 100, 47, 48, 0, 0, 45, 44, 25,
- 98, 0, 46, 0, 45, 46, 46, 0, 0, 43,
- 44, 45, 33, 0, 99, 95, 19, 46, 45, 45,
- 22, 45, 35, 31, 0, 0, 32, 28, 0, 45,
- 0, 0, 30, 0, 0, 45, 44, 45, 44, 0,
- 0, 0, 0, 44, 26, 0, 27, 0, 0, 20,
- 23, 0, 45, 29, 45, 21, 24, 36, 34
+ 0, 0, 0, 0, 0, 0, 0, 105, 0, 0,
+ 103, 0, 90, 94, 0, 91, 0, 0, 0, 87,
+ 44, 0, 0, 41, 0, 0, 74, 2, 0, 45,
+ 0, 0, 44, 0, 63, 64, 62, 65, 66, 69,
+ 70, 71, 56, 57, 58, 59, 60, 61, 68, 52,
+ 0, 53, 82, 93, 89, 95, 98, 12, 14, 13,
+ 46, 0, 39, 46, 0, 38, 106, 99, 0, 45,
+ 0, 0, 45, 45, 16, 0, 102, 47, 48, 0,
+ 0, 45, 44, 25, 100, 0, 46, 0, 45, 46,
+ 46, 0, 0, 43, 44, 45, 33, 0, 101, 97,
+ 19, 46, 45, 45, 22, 45, 35, 31, 0, 0,
+ 32, 28, 0, 45, 0, 0, 30, 0, 0, 45,
+ 44, 45, 44, 0, 0, 0, 0, 44, 26, 0,
+ 27, 0, 0, 20, 23, 0, 45, 29, 45, 21,
+ 24, 36, 34
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
{
- -1, 21, 153, 22, 55, 24, 154, 26, 197, 181,
- 182, 172, 183, 70, 27, 28, 29, 173, 207, 137,
- 145, 30, 150, 39, 32, 48, 49, 33, 98, 144,
- 162, 34, 86
+ -1, 21, 157, 22, 55, 24, 158, 26, 201, 185,
+ 186, 176, 187, 70, 27, 28, 29, 177, 211, 141,
+ 149, 30, 154, 39, 32, 48, 49, 33, 100, 148,
+ 166, 34, 88
};
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
-#define YYPACT_NINF -156
+#define YYPACT_NINF -159
static const yytype_int16 yypact[] =
{
- 170, -156, -156, -156, -48, 441, -156, -156, 36, 108,
- -156, 39, 43, 45, 326, 5, 50, 326, 326, 326,
- 326, 4, -156, 9, -156, -156, -156, 11, 12, 333,
- 424, -156, -156, -156, -156, 326, 326, 326, -156, 26,
- -156, 51, -156, 54, -156, 63, -156, 16, 18, -156,
- -156, -156, -156, 37, 326, -156, 346, 82, -156, -21,
- 480, 480, 480, 385, -156, -156, 170, 333, 326, 333,
- 61, 407, 326, 326, 326, 326, 326, 326, 326, 326,
- 326, 326, 326, 326, 326, 424, -25, -17, 40, 87,
- -156, -156, 91, -156, 92, 96, 71, -156, -156, 346,
- 100, -156, 326, 326, -156, -156, 55, 424, 57, 363,
- 56, 326, 424, 424, 424, 424, 424, 424, 463, 463,
- 480, 480, 424, 424, 424, -156, 326, -156, -156, -156,
- -156, -156, 106, -156, 424, 424, -156, -2, -156, -156,
- 299, 424, 424, -156, -31, 220, 83, 326, 220, -156,
- -156, 107, 60, -156, -156, 111, 326, 424, 1, -3,
- -156, 113, -156, 101, 424, -156, -156, 103, 119, -156,
- -156, 119, -156, 333, -156, 220, -156, -156, 220, 220,
- -156, 119, 119, -156, 333, 299, -156, 104, 105, 220,
- 125, 128, -156, 56, 116, -156, -156, -156, -156, 129,
- 115, 130, 136, -5, -156, 299, -156, 270, 121, -156,
- -156, 134, 220, -156, -156, -156, -156, -156, -156
+ 174, -159, -159, -159, -43, 439, -159, -159, 25, 116,
+ -159, 30, 33, 31, 312, 13, 49, 312, 312, 312,
+ 312, 4, -159, 8, -159, -159, -159, 9, 11, 319,
+ 420, -159, -159, -159, -159, 312, 312, 312, -159, 5,
+ -159, 53, -159, 80, -159, 65, -159, -1, 1, -159,
+ -159, -159, -159, 36, 312, -159, 334, 50, -159, -22,
+ 482, 482, 482, 377, -159, -159, 174, 319, 312, 319,
+ 61, 401, 312, 312, 312, 312, 312, 312, 312, 312,
+ 312, 312, 312, 312, 312, 312, 312, 420, -17, -16,
+ 35, 89, -159, -159, 91, -159, 92, 93, 78, -159,
+ -159, 334, 101, -159, 312, 312, -159, -159, 55, 420,
+ 58, 353, 62, 312, 420, 420, 420, 420, 420, 420,
+ 420, 420, 463, 463, 482, 482, 420, 420, 420, -159,
+ 312, -159, -159, -159, -159, -159, 102, -159, 420, 420,
+ -159, -2, -159, -159, 284, 420, 420, -159, -39, 226,
+ 83, 312, 226, -159, -159, 110, 59, -159, -159, 105,
+ 312, 420, 39, -6, -159, 115, -159, 94, 420, -159,
+ -159, 107, 120, -159, -159, 120, -159, 319, -159, 226,
+ -159, -159, 226, 226, -159, 120, 120, -159, 319, 284,
+ -159, 98, 103, 226, 122, 124, -159, 62, 108, -159,
+ -159, -159, -159, 132, 118, 131, 138, -3, -159, 284,
+ -159, 255, 123, -159, -159, 135, 226, -159, -159, -159,
+ -159, -159, -159
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
- -156, -156, -19, 90, 6, -117, 0, -156, -156, -156,
- 3, -153, -24, -64, -156, -156, -156, -155, -4, -49,
- -114, 2, 7, -156, -156, -156, 112, -156, -156, -156,
- -156, -156, 21
+ -159, -159, -19, 95, 6, -99, 0, -159, -159, -159,
+ 10, -152, -28, -64, -159, -159, -159, -158, -4, -52,
+ -118, 2, 7, -159, -159, -159, 111, -159, -159, -159,
+ -159, -159, 21
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
@@ -725,120 +732,120 @@ static const yytype_int16 yypgoto[] =
#define YYTABLE_NINF -55
static const yytype_int16 yytable[] =
{
- 25, 37, 66, 106, 64, 108, 23, 31, 35, -9,
- -46, 146, 169, 184, 102, 166, 56, 167, 186, 60,
- 61, 62, 63, 149, 65, 148, 184, 93, 103, 186,
- 151, 71, 125, 147, 94, 170, 126, 85, 85, 85,
- 127, 57, 58, 95, 126, 43, 38, 45, 175, 50,
- -46, 178, 179, 96, 51, 52, 99, 87, 88, 65,
- 59, 68, 90, 189, -9, 91, 25, 67, 195, 71,
- 107, 109, 23, 31, 112, 113, 114, 115, 116, 117,
- 118, 119, 120, 121, 122, 123, 124, 89, 213, 212,
- 92, 139, 101, 36, 132, 110, 155, 128, 95, 158,
- 159, 126, 129, 130, 134, 135, 140, 131, 165, 188,
- 133, 65, 136, 141, 138, 177, 143, 160, 156, 40,
- 194, 161, 187, 174, 180, 152, 41, 163, 142, 190,
- 191, 42, 193, 176, 169, 43, 44, 45, 46, 198,
- 199, 200, 196, 47, 201, 208, 204, 209, 206, 157,
- 203, 210, 211, 215, 168, 216, 105, 192, 164, 0,
- 97, 0, 171, 217, 0, 218, 185, 0, 0, 0,
- -5, 1, 0, 0, 202, 71, 0, 2, 3, 4,
- 5, 6, 0, 0, 0, 0, 71, 7, 0, 8,
- 9, 10, 205, 0, 11, 12, 13, 0, 0, 0,
- 0, 14, 15, 16, 0, 0, 0, 214, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 17, 0, 0,
- 18, 19, 0, 0, 0, -5, 20, 2, 3, 4,
- 53, 6, 0, 0, 0, 0, 0, 7, 0, 8,
- 9, 10, 0, 0, 0, 12, 13, 0, 0, 0,
- 0, 14, 15, 16, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 17, 0, 0,
- 18, 19, 0, 0, 0, 65, 20, 2, 3, 4,
- 53, 6, 0, 0, 0, 0, 0, 7, 0, 8,
- 9, 10, 0, 0, 0, 12, 13, 0, 0, 0,
- 0, 14, 15, 16, 0, 0, 2, 3, 4, 53,
- 6, 0, 0, 0, 0, 0, 7, 17, 8, 9,
- 18, 19, 0, 0, 12, 13, 20, 0, 0, 0,
- 14, 0, 16, 2, 3, 4, 53, 6, 0, 0,
- 2, 3, 4, 53, 6, 0, 17, 0, 0, 18,
- 19, 0, 0, 0, 0, 20, 0, 54, 0, 16,
- 0, 0, 0, 0, 54, 0, 16, 0, 100, 0,
- 0, 0, 0, 17, 0, 0, 18, 19, 0, 0,
- 17, 0, 20, 18, 19, 72, 73, 0, 0, 69,
- 74, 75, 76, 0, 77, 0, 78, 79, 80, 81,
- 0, 0, 72, 73, 82, 83, 84, 74, 75, 76,
- 0, 77, 111, 78, 79, 80, 81, 0, 0, 0,
- 104, 82, 83, 84, 72, 73, 0, 0, 0, 74,
- 75, 76, 0, 77, 0, 78, 79, 80, 81, 0,
- 0, 0, 104, 82, 83, 84, 72, 73, 0, 0,
- 0, 74, 75, 76, 0, 77, 111, 78, 79, 80,
- 81, 0, 0, 72, 73, 82, 83, 84, 74, 75,
- 76, 0, 77, 0, 78, 79, 80, 81, 0, 0,
- -54, -54, 82, 83, 84, -54, -54, -54, 0, -54,
+ 25, 37, 66, 108, 64, 110, 23, 31, -9, 173,
+ 95, 150, -46, 104, 188, 35, 56, 96, 65, 60,
+ 61, 62, 63, 190, 155, 152, 97, 188, 43, 105,
+ 45, 71, 174, 151, 190, 38, 98, 87, 87, 87,
+ 50, 52, 129, 131, 51, 153, 130, 130, 179, 57,
+ 58, 182, 183, 170, -46, 171, 101, 89, 90, 59,
+ 103, 65, 68, 193, 92, -9, 25, 67, 91, 71,
+ 109, 111, 23, 31, 114, 115, 116, 117, 118, 119,
+ 120, 121, 122, 123, 124, 125, 126, 127, 128, 216,
+ 199, 93, 94, 143, 36, 112, 136, 159, 130, 132,
+ 162, 163, 133, 134, 135, 97, 138, 139, 144, 169,
+ 217, 137, 147, 192, 140, 145, 181, 142, 160, 65,
+ 164, 167, 165, 191, 198, 178, 180, 40, 184, 156,
+ 194, 195, 146, 197, 41, 173, 200, 202, 204, 42,
+ 205, 203, 207, 43, 44, 45, 46, 208, 212, 210,
+ 213, 47, 214, 161, 215, 219, 220, 196, 172, 99,
+ 0, 107, 168, 0, 221, 0, 222, 0, 0, 0,
+ 189, 0, 0, 175, -5, 1, 0, 0, 206, 71,
+ 0, 2, 3, 4, 5, 6, 0, 0, 0, 0,
+ 71, 7, 0, 8, 9, 10, 209, 0, 11, 12,
+ 13, 0, 0, 0, 0, 14, 15, 16, 0, 0,
+ 0, 218, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 17, 0, 0, 0, 0, 18, 19, 0, 0,
+ 0, -5, 20, 2, 3, 4, 53, 6, 0, 0,
+ 0, 0, 0, 7, 0, 8, 9, 10, 0, 0,
+ 0, 12, 13, 0, 0, 0, 0, 14, 15, 16,
+ 0, 0, 2, 3, 4, 53, 6, 0, 0, 0,
+ 0, 0, 7, 17, 8, 9, 10, 0, 18, 19,
+ 12, 13, 0, 65, 20, 0, 14, 15, 16, 0,
+ 0, 2, 3, 4, 53, 6, 0, 0, 0, 0,
+ 0, 7, 17, 8, 9, 0, 0, 18, 19, 12,
+ 13, 0, 0, 20, 0, 14, 0, 16, 0, 2,
+ 3, 4, 53, 6, 0, 0, 2, 3, 4, 53,
+ 6, 17, 0, 0, 0, 0, 18, 19, 0, 0,
+ 0, 0, 20, 54, 0, 16, 0, 0, 0, 0,
+ 54, 0, 16, 0, 0, 0, 102, 0, 0, 17,
+ 0, 0, 0, 0, 18, 19, 17, 0, 0, 0,
+ 20, 18, 19, 72, 73, 0, 0, 69, 74, 75,
+ 76, 0, 77, 78, 79, 0, 80, 81, 82, 83,
+ 0, 0, 72, 73, 84, 85, 86, 74, 75, 76,
+ 0, 77, 78, 79, 113, 80, 81, 82, 83, 0,
+ 0, 0, 106, 84, 85, 86, 72, 73, 0, 0,
+ 0, 74, 75, 76, 0, 77, 78, 79, 0, 80,
+ 81, 82, 83, 0, 0, 0, 106, 84, 85, 86,
+ 72, 73, 0, 0, 0, 74, 75, 76, 0, 77,
+ 78, 79, 113, 80, 81, 82, 83, 0, 0, 72,
+ 73, 84, 85, 86, 74, 75, 76, 0, 77, 78,
+ 79, 0, 80, 81, 82, 83, 0, 0, -54, -54,
+ 84, 85, 86, -54, -54, -54, 0, -54, -54, -54,
0, 0, 0, -54, -54, 0, 0, 36, 0, -54,
-54, -54, 72, 73, 0, 0, 0, 74, 75, 76,
- 0, 77, 0, 0, 0, 80, 81, 0, 0, 72,
- 73, 82, 83, 84, 74, 75, 76, 0, 77, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 82, 83,
- 84
+ 0, 77, 78, 79, 0, 0, 0, 82, 83, 0,
+ 0, 72, 73, 84, 85, 86, 74, 75, 76, 0,
+ 77, 78, 79, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 84, 85, 86
};
static const yytype_int16 yycheck[] =
{
- 0, 5, 21, 67, 0, 69, 0, 0, 56, 0,
- 15, 13, 15, 168, 35, 14, 14, 16, 171, 17,
- 18, 19, 20, 140, 55, 139, 181, 11, 49, 182,
- 61, 29, 57, 35, 18, 38, 61, 35, 36, 37,
- 57, 36, 37, 27, 61, 27, 10, 29, 162, 10,
- 55, 165, 166, 35, 11, 10, 54, 36, 37, 55,
- 10, 49, 11, 177, 55, 11, 66, 56, 185, 67,
+ 0, 5, 21, 67, 0, 69, 0, 0, 0, 15,
+ 11, 13, 15, 35, 172, 58, 14, 18, 57, 17,
+ 18, 19, 20, 175, 63, 143, 27, 185, 27, 51,
+ 29, 29, 38, 35, 186, 10, 35, 35, 36, 37,
+ 10, 10, 59, 59, 11, 144, 63, 63, 166, 36,
+ 37, 169, 170, 14, 57, 16, 54, 36, 37, 10,
+ 10, 57, 51, 181, 11, 57, 66, 58, 63, 67,
68, 69, 66, 66, 72, 73, 74, 75, 76, 77,
- 78, 79, 80, 81, 82, 83, 84, 61, 205, 203,
- 27, 110, 10, 56, 98, 34, 145, 10, 27, 148,
- 149, 61, 11, 11, 102, 103, 110, 11, 157, 173,
- 10, 55, 57, 111, 57, 164, 10, 10, 35, 11,
- 184, 61, 171, 10, 21, 144, 18, 16, 126, 178,
- 179, 23, 181, 32, 15, 27, 28, 29, 30, 34,
- 189, 16, 38, 35, 16, 16, 195, 32, 197, 147,
- 34, 21, 16, 32, 158, 21, 66, 181, 156, -1,
- 48, -1, 159, 212, -1, 214, 170, -1, -1, -1,
- 0, 1, -1, -1, 193, 173, -1, 7, 8, 9,
- 10, 11, -1, -1, -1, -1, 184, 17, -1, 19,
- 20, 21, 196, -1, 24, 25, 26, -1, -1, -1,
- -1, 31, 32, 33, -1, -1, -1, 207, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 47, -1, -1,
- 50, 51, -1, -1, -1, 55, 56, 7, 8, 9,
- 10, 11, -1, -1, -1, -1, -1, 17, -1, 19,
- 20, 21, -1, -1, -1, 25, 26, -1, -1, -1,
- -1, 31, 32, 33, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 47, -1, -1,
- 50, 51, -1, -1, -1, 55, 56, 7, 8, 9,
- 10, 11, -1, -1, -1, -1, -1, 17, -1, 19,
- 20, 21, -1, -1, -1, 25, 26, -1, -1, -1,
- -1, 31, 32, 33, -1, -1, 7, 8, 9, 10,
- 11, -1, -1, -1, -1, -1, 17, 47, 19, 20,
- 50, 51, -1, -1, 25, 26, 56, -1, -1, -1,
- 31, -1, 33, 7, 8, 9, 10, 11, -1, -1,
- 7, 8, 9, 10, 11, -1, 47, -1, -1, 50,
- 51, -1, -1, -1, -1, 56, -1, 31, -1, 33,
- -1, -1, -1, -1, 31, -1, 33, -1, 22, -1,
- -1, -1, -1, 47, -1, -1, 50, 51, -1, -1,
- 47, -1, 56, 50, 51, 39, 40, -1, -1, 56,
- 44, 45, 46, -1, 48, -1, 50, 51, 52, 53,
- -1, -1, 39, 40, 58, 59, 60, 44, 45, 46,
- -1, 48, 49, 50, 51, 52, 53, -1, -1, -1,
- 57, 58, 59, 60, 39, 40, -1, -1, -1, 44,
- 45, 46, -1, 48, -1, 50, 51, 52, 53, -1,
- -1, -1, 57, 58, 59, 60, 39, 40, -1, -1,
- -1, 44, 45, 46, -1, 48, 49, 50, 51, 52,
- 53, -1, -1, 39, 40, 58, 59, 60, 44, 45,
- 46, -1, 48, -1, 50, 51, 52, 53, -1, -1,
- 39, 40, 58, 59, 60, 44, 45, 46, -1, 48,
- -1, -1, -1, 52, 53, -1, -1, 56, -1, 58,
- 59, 60, 39, 40, -1, -1, -1, 44, 45, 46,
- -1, 48, -1, -1, -1, 52, 53, -1, -1, 39,
- 40, 58, 59, 60, 44, 45, 46, -1, 48, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 58, 59,
- 60
+ 78, 79, 80, 81, 82, 83, 84, 85, 86, 207,
+ 189, 11, 27, 112, 58, 34, 100, 149, 63, 10,
+ 152, 153, 11, 11, 11, 27, 104, 105, 112, 161,
+ 209, 10, 10, 177, 59, 113, 168, 59, 35, 57,
+ 10, 16, 63, 175, 188, 10, 32, 11, 21, 148,
+ 182, 183, 130, 185, 18, 15, 38, 34, 16, 23,
+ 16, 193, 34, 27, 28, 29, 30, 199, 16, 201,
+ 32, 35, 21, 151, 16, 32, 21, 185, 162, 48,
+ -1, 66, 160, -1, 216, -1, 218, -1, -1, -1,
+ 174, -1, -1, 163, 0, 1, -1, -1, 197, 177,
+ -1, 7, 8, 9, 10, 11, -1, -1, -1, -1,
+ 188, 17, -1, 19, 20, 21, 200, -1, 24, 25,
+ 26, -1, -1, -1, -1, 31, 32, 33, -1, -1,
+ -1, 211, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 47, -1, -1, -1, -1, 52, 53, -1, -1,
+ -1, 57, 58, 7, 8, 9, 10, 11, -1, -1,
+ -1, -1, -1, 17, -1, 19, 20, 21, -1, -1,
+ -1, 25, 26, -1, -1, -1, -1, 31, 32, 33,
+ -1, -1, 7, 8, 9, 10, 11, -1, -1, -1,
+ -1, -1, 17, 47, 19, 20, 21, -1, 52, 53,
+ 25, 26, -1, 57, 58, -1, 31, 32, 33, -1,
+ -1, 7, 8, 9, 10, 11, -1, -1, -1, -1,
+ -1, 17, 47, 19, 20, -1, -1, 52, 53, 25,
+ 26, -1, -1, 58, -1, 31, -1, 33, -1, 7,
+ 8, 9, 10, 11, -1, -1, 7, 8, 9, 10,
+ 11, 47, -1, -1, -1, -1, 52, 53, -1, -1,
+ -1, -1, 58, 31, -1, 33, -1, -1, -1, -1,
+ 31, -1, 33, -1, -1, -1, 22, -1, -1, 47,
+ -1, -1, -1, -1, 52, 53, 47, -1, -1, -1,
+ 58, 52, 53, 39, 40, -1, -1, 58, 44, 45,
+ 46, -1, 48, 49, 50, -1, 52, 53, 54, 55,
+ -1, -1, 39, 40, 60, 61, 62, 44, 45, 46,
+ -1, 48, 49, 50, 51, 52, 53, 54, 55, -1,
+ -1, -1, 59, 60, 61, 62, 39, 40, -1, -1,
+ -1, 44, 45, 46, -1, 48, 49, 50, -1, 52,
+ 53, 54, 55, -1, -1, -1, 59, 60, 61, 62,
+ 39, 40, -1, -1, -1, 44, 45, 46, -1, 48,
+ 49, 50, 51, 52, 53, 54, 55, -1, -1, 39,
+ 40, 60, 61, 62, 44, 45, 46, -1, 48, 49,
+ 50, -1, 52, 53, 54, 55, -1, -1, 39, 40,
+ 60, 61, 62, 44, 45, 46, -1, 48, 49, 50,
+ -1, -1, -1, 54, 55, -1, -1, 58, -1, 60,
+ 61, 62, 39, 40, -1, -1, -1, 44, 45, 46,
+ -1, 48, 49, 50, -1, -1, -1, 54, 55, -1,
+ -1, 39, 40, 60, 61, 62, 44, 45, 46, -1,
+ 48, 49, 50, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 60, 61, 62
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
@@ -846,27 +853,28 @@ static const yytype_int16 yycheck[] =
static const yytype_uint8 yystos[] =
{
0, 1, 7, 8, 9, 10, 11, 17, 19, 20,
- 21, 24, 25, 26, 31, 32, 33, 47, 50, 51,
- 56, 63, 65, 66, 67, 68, 69, 76, 77, 78,
- 83, 84, 86, 89, 93, 56, 56, 80, 10, 85,
- 11, 18, 23, 27, 28, 29, 30, 35, 87, 88,
- 10, 11, 10, 10, 31, 66, 83, 36, 37, 10,
- 83, 83, 83, 83, 0, 55, 64, 56, 49, 56,
- 75, 83, 39, 40, 44, 45, 46, 48, 50, 51,
- 52, 53, 58, 59, 60, 83, 94, 94, 94, 61,
- 11, 11, 27, 11, 18, 27, 35, 88, 90, 83,
- 22, 10, 35, 49, 57, 65, 75, 83, 75, 83,
- 34, 49, 83, 83, 83, 83, 83, 83, 83, 83,
- 83, 83, 83, 83, 83, 57, 61, 57, 10, 11,
- 11, 11, 80, 10, 83, 83, 57, 81, 57, 64,
- 80, 83, 83, 10, 91, 82, 13, 35, 82, 67,
- 84, 61, 64, 64, 68, 81, 35, 83, 81, 81,
- 10, 61, 92, 16, 83, 81, 14, 16, 80, 15,
- 38, 72, 73, 79, 10, 82, 32, 81, 82, 82,
- 21, 71, 72, 74, 79, 80, 73, 81, 75, 82,
- 81, 81, 74, 81, 75, 67, 38, 70, 34, 81,
- 16, 16, 64, 34, 81, 80, 81, 80, 16, 32,
- 21, 16, 82, 67, 68, 32, 21, 81, 81
+ 21, 24, 25, 26, 31, 32, 33, 47, 52, 53,
+ 58, 65, 67, 68, 69, 70, 71, 78, 79, 80,
+ 85, 86, 88, 91, 95, 58, 58, 82, 10, 87,
+ 11, 18, 23, 27, 28, 29, 30, 35, 89, 90,
+ 10, 11, 10, 10, 31, 68, 85, 36, 37, 10,
+ 85, 85, 85, 85, 0, 57, 66, 58, 51, 58,
+ 77, 85, 39, 40, 44, 45, 46, 48, 49, 50,
+ 52, 53, 54, 55, 60, 61, 62, 85, 96, 96,
+ 96, 63, 11, 11, 27, 11, 18, 27, 35, 90,
+ 92, 85, 22, 10, 35, 51, 59, 67, 77, 85,
+ 77, 85, 34, 51, 85, 85, 85, 85, 85, 85,
+ 85, 85, 85, 85, 85, 85, 85, 85, 85, 59,
+ 63, 59, 10, 11, 11, 11, 82, 10, 85, 85,
+ 59, 83, 59, 66, 82, 85, 85, 10, 93, 84,
+ 13, 35, 84, 69, 86, 63, 66, 66, 70, 83,
+ 35, 85, 83, 83, 10, 63, 94, 16, 85, 83,
+ 14, 16, 82, 15, 38, 74, 75, 81, 10, 84,
+ 32, 83, 84, 84, 21, 73, 74, 76, 81, 82,
+ 75, 83, 77, 84, 83, 83, 76, 83, 77, 69,
+ 38, 72, 34, 83, 16, 16, 66, 34, 83, 82,
+ 83, 82, 16, 32, 21, 16, 84, 69, 70, 32,
+ 21, 83, 83
};
#define yyerrok (yyerrstatus = 0)
@@ -1681,7 +1689,7 @@ yyreduce:
switch (yyn)
{
case 4:
-#line 97 "engines/director/lingo/lingo-gr.y"
+#line 98 "engines/director/lingo/lingo-gr.y"
{
g_lingo->_linenumber++;
g_lingo->_colnumber = 1;
@@ -1689,17 +1697,17 @@ yyreduce:
break;
case 9:
-#line 106 "engines/director/lingo/lingo-gr.y"
+#line 107 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_xpop); ;}
break;
case 11:
-#line 108 "engines/director/lingo/lingo-gr.y"
+#line 109 "engines/director/lingo/lingo-gr.y"
{ yyerrok; ;}
break;
case 12:
-#line 111 "engines/director/lingo/lingo-gr.y"
+#line 112 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_varpush);
g_lingo->codeString((yyvsp[(4) - (4)].s)->c_str());
@@ -1709,7 +1717,7 @@ yyreduce:
break;
case 13:
-#line 117 "engines/director/lingo/lingo-gr.y"
+#line 118 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_varpush);
g_lingo->codeString((yyvsp[(2) - (4)].s)->c_str());
@@ -1719,7 +1727,7 @@ yyreduce:
break;
case 14:
-#line 123 "engines/director/lingo/lingo-gr.y"
+#line 124 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_varpush);
g_lingo->codeString((yyvsp[(2) - (4)].s)->c_str());
@@ -1729,12 +1737,12 @@ yyreduce:
break;
case 15:
-#line 130 "engines/director/lingo/lingo-gr.y"
+#line 131 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_xpop); ;}
break;
case 19:
-#line 139 "engines/director/lingo/lingo-gr.y"
+#line 140 "engines/director/lingo/lingo-gr.y"
{
inst body = 0, end = 0;
WRITE_UINT32(&body, (yyvsp[(5) - (8)].code));
@@ -1744,7 +1752,7 @@ yyreduce:
break;
case 20:
-#line 150 "engines/director/lingo/lingo-gr.y"
+#line 151 "engines/director/lingo/lingo-gr.y"
{
inst init = 0, finish = 0, body = 0, end = 0, inc = 0;
WRITE_UINT32(&init, (yyvsp[(3) - (11)].code));
@@ -1760,7 +1768,7 @@ yyreduce:
break;
case 21:
-#line 166 "engines/director/lingo/lingo-gr.y"
+#line 167 "engines/director/lingo/lingo-gr.y"
{
inst init = 0, finish = 0, body = 0, end = 0, inc = 0;
WRITE_UINT32(&init, (yyvsp[(3) - (12)].code));
@@ -1776,7 +1784,7 @@ yyreduce:
break;
case 22:
-#line 180 "engines/director/lingo/lingo-gr.y"
+#line 181 "engines/director/lingo/lingo-gr.y"
{
inst then = 0, end = 0;
WRITE_UINT32(&then, (yyvsp[(5) - (8)].code));
@@ -1787,7 +1795,7 @@ yyreduce:
break;
case 23:
-#line 187 "engines/director/lingo/lingo-gr.y"
+#line 188 "engines/director/lingo/lingo-gr.y"
{
inst then = 0, else1 = 0, end = 0;
WRITE_UINT32(&then, (yyvsp[(5) - (11)].code));
@@ -1800,7 +1808,7 @@ yyreduce:
break;
case 24:
-#line 196 "engines/director/lingo/lingo-gr.y"
+#line 197 "engines/director/lingo/lingo-gr.y"
{
inst then = 0, else1 = 0, end = 0;
WRITE_UINT32(&then, (yyvsp[(5) - (12)].code));
@@ -1813,7 +1821,7 @@ yyreduce:
break;
case 25:
-#line 205 "engines/director/lingo/lingo-gr.y"
+#line 206 "engines/director/lingo/lingo-gr.y"
{
inst then = 0, else1 = 0, end = 0;
WRITE_UINT32(&then, (yyvsp[(4) - (6)].code));
@@ -1827,7 +1835,7 @@ yyreduce:
break;
case 26:
-#line 215 "engines/director/lingo/lingo-gr.y"
+#line 216 "engines/director/lingo/lingo-gr.y"
{
inst then = 0, else1 = 0, end = 0;
WRITE_UINT32(&then, (yyvsp[(4) - (10)].code));
@@ -1841,7 +1849,7 @@ yyreduce:
break;
case 27:
-#line 225 "engines/director/lingo/lingo-gr.y"
+#line 226 "engines/director/lingo/lingo-gr.y"
{
inst then = 0, else1 = 0, end = 0;
WRITE_UINT32(&then, (yyvsp[(4) - (10)].code));
@@ -1855,17 +1863,17 @@ yyreduce:
break;
case 28:
-#line 236 "engines/director/lingo/lingo-gr.y"
+#line 237 "engines/director/lingo/lingo-gr.y"
{ (yyval.code) = 0; ;}
break;
case 29:
-#line 237 "engines/director/lingo/lingo-gr.y"
+#line 238 "engines/director/lingo/lingo-gr.y"
{ (yyval.code) = (yyvsp[(2) - (3)].code); ;}
break;
case 34:
-#line 248 "engines/director/lingo/lingo-gr.y"
+#line 249 "engines/director/lingo/lingo-gr.y"
{
inst then = 0;
WRITE_UINT32(&then, (yyvsp[(4) - (6)].code));
@@ -1875,7 +1883,7 @@ yyreduce:
break;
case 36:
-#line 257 "engines/director/lingo/lingo-gr.y"
+#line 258 "engines/director/lingo/lingo-gr.y"
{
inst then = 0;
WRITE_UINT32(&then, (yyvsp[(4) - (5)].code));
@@ -1885,22 +1893,22 @@ yyreduce:
break;
case 37:
-#line 265 "engines/director/lingo/lingo-gr.y"
+#line 266 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(STOP); ;}
break;
case 38:
-#line 266 "engines/director/lingo/lingo-gr.y"
+#line 267 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code2(g_lingo->c_eq, STOP); ;}
break;
case 40:
-#line 269 "engines/director/lingo/lingo-gr.y"
+#line 270 "engines/director/lingo/lingo-gr.y"
{ (yyval.code) = g_lingo->code3(g_lingo->c_repeatwhilecode, STOP, STOP); ;}
break;
case 41:
-#line 271 "engines/director/lingo/lingo-gr.y"
+#line 272 "engines/director/lingo/lingo-gr.y"
{
(yyval.code) = g_lingo->code3(g_lingo->c_repeatwithcode, STOP, STOP);
g_lingo->code3(STOP, STOP, STOP);
@@ -1909,7 +1917,7 @@ yyreduce:
break;
case 42:
-#line 277 "engines/director/lingo/lingo-gr.y"
+#line 278 "engines/director/lingo/lingo-gr.y"
{
(yyval.code) = g_lingo->code1(g_lingo->c_ifcode);
g_lingo->code3(STOP, STOP, STOP);
@@ -1918,7 +1926,7 @@ yyreduce:
break;
case 43:
-#line 283 "engines/director/lingo/lingo-gr.y"
+#line 284 "engines/director/lingo/lingo-gr.y"
{
inst skipEnd;
WRITE_UINT32(&skipEnd, 1); // We have to skip end to avoid multiple executions
@@ -1928,22 +1936,22 @@ yyreduce:
break;
case 44:
-#line 290 "engines/director/lingo/lingo-gr.y"
+#line 291 "engines/director/lingo/lingo-gr.y"
{ (yyval.code) = g_lingo->_currentScript->size(); ;}
break;
case 45:
-#line 292 "engines/director/lingo/lingo-gr.y"
+#line 293 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(STOP); (yyval.code) = g_lingo->_currentScript->size(); ;}
break;
case 46:
-#line 294 "engines/director/lingo/lingo-gr.y"
+#line 295 "engines/director/lingo/lingo-gr.y"
{ (yyval.code) = g_lingo->_currentScript->size(); ;}
break;
case 49:
-#line 299 "engines/director/lingo/lingo-gr.y"
+#line 300 "engines/director/lingo/lingo-gr.y"
{
(yyval.code) = g_lingo->code1(g_lingo->c_constpush);
inst i = 0;
@@ -1952,21 +1960,21 @@ yyreduce:
break;
case 50:
-#line 304 "engines/director/lingo/lingo-gr.y"
+#line 305 "engines/director/lingo/lingo-gr.y"
{
(yyval.code) = g_lingo->code1(g_lingo->c_fconstpush);
g_lingo->codeFloat((yyvsp[(1) - (1)].f)); ;}
break;
case 51:
-#line 307 "engines/director/lingo/lingo-gr.y"
+#line 308 "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 52:
-#line 310 "engines/director/lingo/lingo-gr.y"
+#line 311 "engines/director/lingo/lingo-gr.y"
{
if ((yyvsp[(3) - (4)].narg) != g_lingo->_builtins[*(yyvsp[(1) - (4)].s)]->nargs)
error("Built-in function %s expects %d arguments but got %d", (yyvsp[(1) - (4)].s)->c_str(), g_lingo->_builtins[*(yyvsp[(1) - (4)].s)]->nargs, (yyvsp[(3) - (4)].narg));
@@ -1976,7 +1984,7 @@ yyreduce:
break;
case 53:
-#line 316 "engines/director/lingo/lingo-gr.y"
+#line 317 "engines/director/lingo/lingo-gr.y"
{
(yyval.code) = g_lingo->code1(g_lingo->c_call);
g_lingo->codeString((yyvsp[(1) - (4)].s)->c_str());
@@ -1988,145 +1996,155 @@ yyreduce:
break;
case 54:
-#line 324 "engines/director/lingo/lingo-gr.y"
+#line 325 "engines/director/lingo/lingo-gr.y"
{
(yyval.code) = g_lingo->codeId(*(yyvsp[(1) - (1)].s));
delete (yyvsp[(1) - (1)].s); ;}
break;
case 56:
-#line 328 "engines/director/lingo/lingo-gr.y"
+#line 329 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_add); ;}
break;
case 57:
-#line 329 "engines/director/lingo/lingo-gr.y"
+#line 330 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_sub); ;}
break;
case 58:
-#line 330 "engines/director/lingo/lingo-gr.y"
+#line 331 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_mul); ;}
break;
case 59:
-#line 331 "engines/director/lingo/lingo-gr.y"
+#line 332 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_div); ;}
break;
case 60:
-#line 332 "engines/director/lingo/lingo-gr.y"
+#line 333 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_gt); ;}
break;
case 61:
-#line 333 "engines/director/lingo/lingo-gr.y"
+#line 334 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_lt); ;}
break;
case 62:
-#line 334 "engines/director/lingo/lingo-gr.y"
+#line 335 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_neq); ;}
break;
case 63:
-#line 335 "engines/director/lingo/lingo-gr.y"
+#line 336 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_ge); ;}
break;
case 64:
-#line 336 "engines/director/lingo/lingo-gr.y"
+#line 337 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_le); ;}
break;
case 65:
-#line 337 "engines/director/lingo/lingo-gr.y"
+#line 338 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_and); ;}
break;
case 66:
-#line 338 "engines/director/lingo/lingo-gr.y"
+#line 339 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_or); ;}
break;
case 67:
-#line 339 "engines/director/lingo/lingo-gr.y"
+#line 340 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_not); ;}
break;
case 68:
-#line 340 "engines/director/lingo/lingo-gr.y"
+#line 341 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_ampersand); ;}
break;
case 69:
-#line 341 "engines/director/lingo/lingo-gr.y"
+#line 342 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_concat); ;}
break;
case 70:
-#line 342 "engines/director/lingo/lingo-gr.y"
- { (yyval.code) = (yyvsp[(2) - (2)].code); ;}
+#line 343 "engines/director/lingo/lingo-gr.y"
+ { g_lingo->code1(g_lingo->c_contains); ;}
break;
case 71:
-#line 343 "engines/director/lingo/lingo-gr.y"
- { (yyval.code) = (yyvsp[(2) - (2)].code); g_lingo->code1(g_lingo->c_negate); ;}
+#line 344 "engines/director/lingo/lingo-gr.y"
+ { g_lingo->code1(g_lingo->c_starts); ;}
break;
case 72:
-#line 344 "engines/director/lingo/lingo-gr.y"
- { (yyval.code) = (yyvsp[(2) - (3)].code); ;}
+#line 345 "engines/director/lingo/lingo-gr.y"
+ { (yyval.code) = (yyvsp[(2) - (2)].code); ;}
break;
case 73:
+#line 346 "engines/director/lingo/lingo-gr.y"
+ { (yyval.code) = (yyvsp[(2) - (2)].code); g_lingo->code1(g_lingo->c_negate); ;}
+ break;
+
+ case 74:
#line 347 "engines/director/lingo/lingo-gr.y"
+ { (yyval.code) = (yyvsp[(2) - (3)].code); ;}
+ break;
+
+ case 75:
+#line 350 "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 74:
-#line 348 "engines/director/lingo/lingo-gr.y"
+ case 76:
+#line 351 "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 75:
-#line 349 "engines/director/lingo/lingo-gr.y"
+ case 77:
+#line 352 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_printtop); ;}
break;
- case 77:
-#line 351 "engines/director/lingo/lingo-gr.y"
+ case 79:
+#line 354 "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 79:
-#line 356 "engines/director/lingo/lingo-gr.y"
+ case 81:
+#line 359 "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 80:
-#line 357 "engines/director/lingo/lingo-gr.y"
+ case 82:
+#line 360 "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 81:
-#line 368 "engines/director/lingo/lingo-gr.y"
+ case 83:
+#line 371 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_gotoloop); ;}
break;
- case 82:
-#line 369 "engines/director/lingo/lingo-gr.y"
+ case 84:
+#line 372 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_gotonext); ;}
break;
- case 83:
-#line 370 "engines/director/lingo/lingo-gr.y"
+ case 85:
+#line 373 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_gotoprevious); ;}
break;
- case 84:
-#line 371 "engines/director/lingo/lingo-gr.y"
+ case 86:
+#line 374 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_goto);
g_lingo->codeString((yyvsp[(2) - (2)].s)->c_str());
@@ -2134,8 +2152,8 @@ yyreduce:
delete (yyvsp[(2) - (2)].s); ;}
break;
- case 85:
-#line 376 "engines/director/lingo/lingo-gr.y"
+ case 87:
+#line 379 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_goto);
g_lingo->codeString((yyvsp[(2) - (3)].s)->c_str());
@@ -2144,8 +2162,8 @@ yyreduce:
delete (yyvsp[(3) - (3)].s); ;}
break;
- case 86:
-#line 382 "engines/director/lingo/lingo-gr.y"
+ case 88:
+#line 385 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_goto);
g_lingo->codeString("");
@@ -2153,48 +2171,48 @@ yyreduce:
delete (yyvsp[(2) - (2)].s); ;}
break;
- case 87:
-#line 389 "engines/director/lingo/lingo-gr.y"
+ case 89:
+#line 392 "engines/director/lingo/lingo-gr.y"
{ (yyval.s) = (yyvsp[(3) - (3)].s); ;}
break;
- case 88:
-#line 390 "engines/director/lingo/lingo-gr.y"
+ case 90:
+#line 393 "engines/director/lingo/lingo-gr.y"
{ (yyval.s) = (yyvsp[(2) - (2)].s); ;}
break;
- case 89:
-#line 391 "engines/director/lingo/lingo-gr.y"
+ case 91:
+#line 394 "engines/director/lingo/lingo-gr.y"
{ (yyval.s) = (yyvsp[(2) - (2)].s); ;}
break;
- case 90:
-#line 392 "engines/director/lingo/lingo-gr.y"
+ case 92:
+#line 395 "engines/director/lingo/lingo-gr.y"
{ (yyval.s) = (yyvsp[(1) - (1)].s); ;}
break;
- case 91:
-#line 395 "engines/director/lingo/lingo-gr.y"
+ case 93:
+#line 398 "engines/director/lingo/lingo-gr.y"
{ (yyval.s) = (yyvsp[(3) - (3)].s); ;}
break;
- case 92:
-#line 396 "engines/director/lingo/lingo-gr.y"
+ case 94:
+#line 399 "engines/director/lingo/lingo-gr.y"
{ (yyval.s) = (yyvsp[(2) - (2)].s); ;}
break;
- case 93:
-#line 397 "engines/director/lingo/lingo-gr.y"
+ case 95:
+#line 400 "engines/director/lingo/lingo-gr.y"
{ (yyval.s) = (yyvsp[(3) - (3)].s); ;}
break;
- case 94:
-#line 425 "engines/director/lingo/lingo-gr.y"
+ case 96:
+#line 428 "engines/director/lingo/lingo-gr.y"
{ g_lingo->_indef = true; ;}
break;
- case 95:
-#line 426 "engines/director/lingo/lingo-gr.y"
+ case 97:
+#line 429 "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);
@@ -2202,33 +2220,33 @@ yyreduce:
g_lingo->_indef = false; ;}
break;
- case 96:
-#line 432 "engines/director/lingo/lingo-gr.y"
+ case 98:
+#line 435 "engines/director/lingo/lingo-gr.y"
{ (yyval.narg) = 0; ;}
break;
- case 97:
-#line 433 "engines/director/lingo/lingo-gr.y"
+ case 99:
+#line 436 "engines/director/lingo/lingo-gr.y"
{ g_lingo->codeArg((yyvsp[(1) - (1)].s)); (yyval.narg) = 1; ;}
break;
- case 98:
-#line 434 "engines/director/lingo/lingo-gr.y"
+ case 100:
+#line 437 "engines/director/lingo/lingo-gr.y"
{ g_lingo->codeArg((yyvsp[(3) - (3)].s)); (yyval.narg) = (yyvsp[(1) - (3)].narg) + 1; ;}
break;
- case 99:
-#line 435 "engines/director/lingo/lingo-gr.y"
+ case 101:
+#line 438 "engines/director/lingo/lingo-gr.y"
{ g_lingo->codeArg((yyvsp[(4) - (4)].s)); (yyval.narg) = (yyvsp[(1) - (4)].narg) + 1; ;}
break;
- case 100:
-#line 437 "engines/director/lingo/lingo-gr.y"
+ case 102:
+#line 440 "engines/director/lingo/lingo-gr.y"
{ g_lingo->codeArgStore(); ;}
break;
- case 101:
-#line 440 "engines/director/lingo/lingo-gr.y"
+ case 103:
+#line 443 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_call);
g_lingo->codeString((yyvsp[(1) - (3)].s)->c_str());
@@ -2237,24 +2255,24 @@ yyreduce:
g_lingo->code1(numpar); ;}
break;
- case 102:
-#line 448 "engines/director/lingo/lingo-gr.y"
+ case 104:
+#line 451 "engines/director/lingo/lingo-gr.y"
{ (yyval.narg) = 0; ;}
break;
- case 103:
-#line 449 "engines/director/lingo/lingo-gr.y"
+ case 105:
+#line 452 "engines/director/lingo/lingo-gr.y"
{ (yyval.narg) = 1; ;}
break;
- case 104:
-#line 450 "engines/director/lingo/lingo-gr.y"
+ case 106:
+#line 453 "engines/director/lingo/lingo-gr.y"
{ (yyval.narg) = (yyvsp[(1) - (3)].narg) + 1; ;}
break;
/* Line 1267 of yacc.c. */
-#line 2258 "engines/director/lingo/lingo-gr.cpp"
+#line 2276 "engines/director/lingo/lingo-gr.cpp"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -2468,6 +2486,6 @@ yyreturn:
}
-#line 453 "engines/director/lingo/lingo-gr.y"
+#line 456 "engines/director/lingo/lingo-gr.y"
diff --git a/engines/director/lingo/lingo-gr.h b/engines/director/lingo/lingo-gr.h
index a22d489e6e..3c349b7e98 100644
--- a/engines/director/lingo/lingo-gr.h
+++ b/engines/director/lingo/lingo-gr.h
@@ -84,7 +84,9 @@
tAND = 300,
tOR = 301,
tNOT = 302,
- tCONCAT = 303
+ tCONCAT = 303,
+ tCONTAINS = 304,
+ tSTARTS = 305
};
#endif
/* Tokens. */
@@ -134,6 +136,8 @@
#define tOR 301
#define tNOT 302
#define tCONCAT 303
+#define tCONTAINS 304
+#define tSTARTS 305
@@ -149,7 +153,7 @@ typedef union YYSTYPE
int narg; /* number of arguments */
}
/* Line 1529 of yacc.c. */
-#line 153 "engines/director/lingo/lingo-gr.hpp"
+#line 157 "engines/director/lingo/lingo-gr.hpp"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
diff --git a/engines/director/lingo/lingo-gr.y b/engines/director/lingo/lingo-gr.y
index 155b615bfa..d0618af9f8 100644
--- a/engines/director/lingo/lingo-gr.y
+++ b/engines/director/lingo/lingo-gr.y
@@ -77,7 +77,8 @@ using namespace Director;
%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
%token tWITH tWHILE tNLELSE
-%token tGE tLE tGT tLT tEQ tNEQ tAND tOR tNOT tCONCAT
+%token tGE tLE tGT tLT tEQ tNEQ tAND tOR tNOT
+%token tCONCAT tCONTAINS tSTARTS
%type<code> asgn begin elseif elsestmtoneliner end expr if repeatwhile repeatwith stmtlist
%type<s> gotoframe gotomovie
@@ -339,6 +340,8 @@ expr: INT {
| tNOT expr %prec UNARY { g_lingo->code1(g_lingo->c_not); }
| expr '&' expr { g_lingo->code1(g_lingo->c_ampersand); }
| 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); }
| '+' expr %prec UNARY { $$ = $2; }
| '-' expr %prec UNARY { $$ = $2; g_lingo->code1(g_lingo->c_negate); }
| '(' expr ')' { $$ = $2; }
diff --git a/engines/director/lingo/lingo-lex.cpp b/engines/director/lingo/lingo-lex.cpp
index 0a0af1173c..b419574cfc 100644
--- a/engines/director/lingo/lingo-lex.cpp
+++ b/engines/director/lingo/lingo-lex.cpp
@@ -364,8 +364,8 @@ static void yy_fatal_error (yyconst char msg[] );
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
-#define YY_NUM_RULES 44
-#define YY_END_OF_BUFFER 45
+#define YY_NUM_RULES 46
+#define YY_END_OF_BUFFER 47
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@@ -373,23 +373,25 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[139] =
+static yyconst flex_int16_t yy_accept[152] =
{ 0,
- 0, 0, 45, 43, 3, 41, 41, 43, 43, 40,
- 40, 40, 39, 40, 40, 37, 37, 37, 37, 37,
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
- 37, 2, 2, 3, 41, 0, 0, 41, 0, 42,
- 36, 1, 38, 39, 35, 33, 34, 37, 37, 37,
- 37, 37, 37, 37, 37, 14, 6, 37, 37, 37,
- 37, 37, 37, 37, 23, 24, 37, 37, 37, 37,
- 37, 30, 37, 37, 2, 2, 0, 1, 38, 4,
- 37, 37, 10, 37, 37, 37, 37, 37, 37, 18,
- 37, 37, 22, 37, 26, 37, 28, 37, 37, 37,
-
- 0, 5, 9, 11, 37, 37, 15, 16, 37, 37,
- 37, 21, 37, 37, 29, 37, 31, 0, 12, 37,
- 17, 37, 20, 37, 37, 32, 8, 13, 37, 37,
- 27, 0, 19, 37, 0, 25, 7, 0
+ 0, 0, 47, 45, 3, 43, 43, 45, 45, 42,
+ 42, 42, 41, 42, 42, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 2, 2, 3, 43, 0, 0, 43, 0,
+ 44, 38, 1, 40, 41, 37, 35, 36, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 15, 7, 39,
+ 39, 39, 39, 39, 39, 39, 24, 25, 39, 39,
+ 39, 39, 39, 39, 32, 39, 39, 2, 2, 0,
+ 1, 40, 4, 39, 39, 39, 11, 39, 39, 39,
+ 39, 39, 39, 19, 39, 39, 23, 39, 27, 39,
+
+ 29, 39, 39, 39, 39, 0, 39, 6, 10, 12,
+ 39, 39, 16, 17, 39, 39, 39, 22, 39, 39,
+ 39, 31, 39, 33, 0, 39, 13, 39, 18, 39,
+ 21, 39, 39, 39, 34, 9, 39, 14, 39, 39,
+ 28, 30, 0, 39, 20, 39, 0, 5, 26, 8,
+ 0
} ;
static yyconst flex_int32_t yy_ec[256] =
@@ -434,95 +436,98 @@ static yyconst flex_int32_t yy_meta[58] =
4, 4, 4, 4, 4, 4, 4
} ;
-static yyconst flex_int16_t yy_base[142] =
+static yyconst flex_int16_t yy_base[155] =
{ 0,
- 0, 56, 149, 335, 60, 64, 68, 72, 138, 335,
- 131, 128, 49, 65, 121, 53, 0, 53, 57, 53,
- 60, 69, 58, 82, 94, 78, 61, 97, 99, 102,
- 103, 150, 154, 158, 124, 162, 131, 166, 126, 335,
- 335, 0, 89, 131, 335, 335, 335, 0, 105, 138,
- 143, 157, 153, 162, 151, 0, 0, 148, 153, 165,
- 160, 151, 150, 155, 0, 0, 169, 158, 162, 160,
- 174, 0, 173, 171, 217, 223, 184, 0, 84, 0,
- 187, 197, 0, 191, 203, 201, 203, 203, 203, 199,
- 213, 208, 0, 207, 0, 218, 0, 215, 218, 223,
-
- 216, 0, 0, 0, 229, 234, 0, 0, 223, 241,
- 238, 0, 237, 250, 0, 247, 0, 250, 0, 248,
- 0, 251, 0, 248, 245, 0, 85, 0, 248, 248,
- 0, 281, 0, 253, 265, 0, 335, 335, 326, 88,
- 330
+ 0, 56, 186, 352, 60, 64, 68, 72, 173, 352,
+ 143, 141, 49, 65, 132, 53, 0, 53, 54, 58,
+ 54, 61, 70, 59, 83, 95, 79, 62, 98, 105,
+ 103, 104, 138, 151, 157, 125, 161, 165, 169, 132,
+ 352, 352, 0, 108, 123, 352, 352, 352, 0, 117,
+ 141, 134, 144, 158, 154, 163, 152, 0, 0, 149,
+ 154, 166, 162, 153, 152, 159, 0, 0, 173, 162,
+ 166, 165, 189, 191, 0, 188, 181, 217, 225, 192,
+ 0, 85, 0, 191, 197, 206, 0, 199, 209, 220,
+ 211, 211, 211, 207, 214, 211, 0, 212, 0, 229,
+
+ 0, 220, 224, 228, 232, 226, 240, 0, 0, 0,
+ 246, 251, 0, 0, 240, 254, 254, 0, 252, 264,
+ 249, 0, 263, 0, 264, 261, 0, 261, 0, 267,
+ 0, 264, 261, 263, 0, 86, 269, 0, 266, 266,
+ 0, 0, 298, 277, 0, 278, 290, 0, 0, 352,
+ 352, 343, 89, 347
} ;
-static yyconst flex_int16_t yy_def[142] =
+static yyconst flex_int16_t yy_def[155] =
{ 0,
- 138, 1, 138, 138, 138, 138, 138, 138, 139, 138,
- 138, 138, 138, 138, 138, 140, 140, 140, 140, 140,
- 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
- 140, 138, 138, 138, 138, 138, 138, 138, 139, 138,
- 138, 141, 138, 138, 138, 138, 138, 140, 140, 140,
- 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
- 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
- 140, 140, 140, 140, 138, 138, 138, 141, 138, 140,
- 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
- 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
-
- 138, 140, 140, 140, 140, 140, 140, 140, 140, 140,
- 140, 140, 140, 140, 140, 140, 140, 138, 140, 140,
- 140, 140, 140, 140, 140, 140, 138, 140, 140, 140,
- 140, 138, 140, 140, 138, 140, 138, 0, 138, 138,
- 138
+ 151, 1, 151, 151, 151, 151, 151, 151, 152, 151,
+ 151, 151, 151, 151, 151, 153, 153, 153, 153, 153,
+ 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
+ 153, 153, 151, 151, 151, 151, 151, 151, 151, 152,
+ 151, 151, 154, 151, 151, 151, 151, 151, 153, 153,
+ 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
+ 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
+ 153, 153, 153, 153, 153, 153, 153, 151, 151, 151,
+ 154, 151, 153, 153, 153, 153, 153, 153, 153, 153,
+ 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
+
+ 153, 153, 153, 153, 153, 151, 153, 153, 153, 153,
+ 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
+ 153, 153, 153, 153, 151, 153, 153, 153, 153, 153,
+ 153, 153, 153, 153, 153, 151, 153, 153, 153, 153,
+ 153, 153, 151, 153, 153, 153, 151, 153, 153, 151,
+ 0, 151, 151, 151
} ;
-static yyconst flex_int16_t yy_nxt[393] =
+static yyconst flex_int16_t yy_nxt[410] =
{ 0,
4, 5, 6, 7, 8, 9, 10, 11, 12, 4,
- 13, 14, 10, 15, 16, 17, 17, 18, 19, 20,
- 21, 17, 22, 17, 23, 24, 25, 26, 27, 28,
- 29, 30, 17, 17, 31, 17, 16, 17, 17, 18,
- 19, 20, 21, 17, 22, 23, 24, 25, 26, 27,
- 28, 29, 30, 17, 17, 31, 17, 32, 43, 44,
- 33, 34, 35, 35, 36, 37, 38, 38, 37, 37,
- 38, 38, 37, 36, 35, 35, 36, 45, 46, 49,
- 50, 51, 54, 52, 55, 59, 132, 56, 57, 132,
- 67, 48, 53, 68, 79, 58, 60, 65, 61, 79,
-
- 49, 50, 51, 54, 52, 55, 59, 66, 56, 62,
- 57, 67, 63, 53, 68, 69, 58, 70, 60, 65,
- 61, 64, 80, 71, 73, 74, 35, 35, 66, 72,
- 62, 40, 37, 47, 63, 37, 42, 69, 41, 70,
- 43, 44, 64, 40, 80, 71, 73, 74, 138, 77,
- 72, 75, 35, 35, 76, 76, 35, 35, 76, 34,
- 35, 35, 36, 36, 35, 35, 36, 37, 38, 38,
- 37, 77, 81, 82, 83, 84, 85, 138, 86, 87,
- 88, 89, 90, 138, 91, 92, 93, 94, 138, 95,
- 96, 97, 98, 81, 82, 99, 83, 84, 85, 86,
-
- 87, 88, 100, 89, 90, 91, 92, 93, 101, 94,
- 95, 96, 97, 102, 98, 103, 106, 99, 75, 35,
- 35, 76, 104, 100, 76, 35, 35, 76, 105, 101,
- 107, 108, 109, 110, 102, 111, 114, 103, 106, 112,
- 113, 115, 116, 104, 117, 138, 118, 119, 120, 105,
- 121, 107, 108, 109, 110, 122, 123, 111, 114, 124,
- 112, 113, 115, 116, 125, 126, 117, 118, 127, 119,
- 120, 121, 128, 129, 138, 130, 131, 122, 123, 133,
- 134, 124, 132, 136, 137, 132, 125, 126, 138, 138,
- 127, 138, 138, 128, 138, 129, 130, 131, 138, 138,
-
- 133, 134, 138, 135, 136, 138, 137, 138, 138, 138,
- 138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
- 138, 138, 138, 138, 138, 135, 39, 138, 39, 39,
- 78, 138, 138, 78, 3, 138, 138, 138, 138, 138,
- 138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
- 138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
- 138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
- 138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
- 138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
- 138, 138
-
+ 13, 14, 10, 15, 16, 17, 18, 19, 20, 21,
+ 22, 17, 23, 17, 24, 25, 26, 27, 28, 29,
+ 30, 31, 17, 17, 32, 17, 16, 17, 18, 19,
+ 20, 21, 22, 17, 23, 24, 25, 26, 27, 28,
+ 29, 30, 31, 17, 17, 32, 17, 33, 44, 45,
+ 34, 35, 36, 36, 37, 38, 39, 39, 38, 38,
+ 39, 39, 38, 37, 36, 36, 37, 46, 47, 50,
+ 51, 52, 53, 56, 54, 57, 61, 143, 58, 59,
+ 143, 69, 49, 55, 70, 82, 60, 62, 67, 63,
+
+ 50, 51, 52, 53, 56, 54, 57, 61, 68, 58,
+ 64, 59, 69, 65, 55, 70, 71, 60, 82, 62,
+ 67, 63, 66, 72, 74, 76, 77, 36, 36, 68,
+ 75, 64, 44, 45, 83, 65, 73, 41, 71, 78,
+ 36, 36, 79, 66, 48, 72, 74, 76, 77, 43,
+ 42, 75, 79, 36, 36, 79, 83, 73, 35, 36,
+ 36, 37, 37, 36, 36, 37, 38, 84, 85, 38,
+ 38, 39, 39, 38, 86, 87, 88, 89, 41, 90,
+ 91, 92, 93, 80, 94, 151, 95, 96, 84, 85,
+ 97, 98, 151, 99, 100, 86, 101, 87, 88, 89,
+
+ 90, 91, 92, 102, 93, 80, 94, 95, 96, 103,
+ 104, 97, 105, 98, 99, 100, 106, 101, 78, 36,
+ 36, 79, 107, 108, 109, 102, 79, 36, 36, 79,
+ 110, 103, 104, 105, 111, 112, 117, 106, 113, 114,
+ 115, 116, 118, 107, 108, 119, 109, 120, 151, 121,
+ 122, 110, 123, 124, 126, 111, 125, 112, 117, 113,
+ 114, 115, 116, 118, 127, 128, 119, 129, 130, 120,
+ 121, 122, 131, 123, 132, 124, 126, 125, 133, 151,
+ 134, 135, 136, 137, 151, 138, 127, 128, 129, 139,
+ 130, 140, 141, 142, 131, 144, 132, 145, 146, 143,
+
+ 133, 134, 143, 135, 136, 137, 138, 148, 149, 150,
+ 151, 139, 140, 141, 142, 151, 144, 151, 145, 146,
+ 147, 151, 151, 151, 151, 151, 151, 151, 148, 149,
+ 151, 150, 151, 151, 151, 151, 151, 151, 151, 151,
+ 151, 151, 147, 40, 151, 40, 40, 81, 151, 151,
+ 81, 3, 151, 151, 151, 151, 151, 151, 151, 151,
+ 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
+ 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
+ 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
+ 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
+
+ 151, 151, 151, 151, 151, 151, 151, 151, 151
} ;
-static yyconst flex_int16_t yy_chk[393] =
+static yyconst flex_int16_t yy_chk[410] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -532,42 +537,43 @@ static yyconst flex_int16_t yy_chk[393] =
1, 1, 1, 1, 1, 1, 1, 2, 13, 13,
2, 5, 5, 5, 5, 6, 6, 6, 6, 7,
7, 7, 7, 8, 8, 8, 8, 14, 14, 16,
- 18, 19, 20, 19, 21, 23, 127, 21, 22, 127,
- 27, 140, 19, 27, 79, 22, 24, 26, 24, 43,
-
- 16, 18, 19, 20, 19, 21, 23, 26, 21, 24,
- 22, 27, 25, 19, 27, 28, 22, 29, 24, 26,
- 24, 25, 49, 30, 31, 31, 35, 35, 26, 30,
- 24, 39, 37, 15, 25, 37, 12, 28, 11, 29,
- 44, 44, 25, 9, 49, 30, 31, 31, 3, 37,
- 30, 32, 32, 32, 32, 33, 33, 33, 33, 34,
- 34, 34, 34, 36, 36, 36, 36, 38, 38, 38,
- 38, 37, 50, 51, 52, 53, 54, 0, 55, 58,
- 59, 60, 61, 0, 62, 63, 64, 67, 0, 68,
- 69, 70, 71, 50, 51, 73, 52, 53, 54, 55,
-
- 58, 59, 74, 60, 61, 62, 63, 64, 77, 67,
- 68, 69, 70, 81, 71, 82, 86, 73, 75, 75,
- 75, 75, 84, 74, 76, 76, 76, 76, 85, 77,
- 87, 88, 89, 90, 81, 91, 96, 82, 86, 92,
- 94, 98, 99, 84, 100, 0, 101, 105, 106, 85,
- 109, 87, 88, 89, 90, 110, 111, 91, 96, 113,
- 92, 94, 98, 99, 114, 116, 100, 101, 118, 105,
- 106, 109, 120, 122, 0, 124, 125, 110, 111, 129,
- 130, 113, 132, 134, 135, 132, 114, 116, 0, 0,
- 118, 0, 0, 120, 0, 122, 124, 125, 0, 0,
-
- 129, 130, 0, 132, 134, 0, 135, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 132, 139, 0, 139, 139,
- 141, 0, 0, 141, 138, 138, 138, 138, 138, 138,
- 138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
- 138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
- 138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
- 138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
- 138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
- 138, 138
-
+ 18, 19, 20, 21, 20, 22, 24, 136, 22, 23,
+ 136, 28, 153, 20, 28, 82, 23, 25, 27, 25,
+
+ 16, 18, 19, 20, 21, 20, 22, 24, 27, 22,
+ 25, 23, 28, 26, 20, 28, 29, 23, 44, 25,
+ 27, 25, 26, 30, 31, 32, 32, 36, 36, 27,
+ 31, 25, 45, 45, 50, 26, 30, 40, 29, 33,
+ 33, 33, 33, 26, 15, 30, 31, 32, 32, 12,
+ 11, 31, 34, 34, 34, 34, 50, 30, 35, 35,
+ 35, 35, 37, 37, 37, 37, 38, 51, 52, 38,
+ 39, 39, 39, 39, 53, 54, 55, 56, 9, 57,
+ 60, 61, 62, 38, 63, 3, 64, 65, 51, 52,
+ 66, 69, 0, 70, 71, 53, 72, 54, 55, 56,
+
+ 57, 60, 61, 73, 62, 38, 63, 64, 65, 74,
+ 76, 66, 77, 69, 70, 71, 80, 72, 78, 78,
+ 78, 78, 84, 85, 86, 73, 79, 79, 79, 79,
+ 88, 74, 76, 77, 89, 90, 95, 80, 91, 92,
+ 93, 94, 96, 84, 85, 98, 86, 100, 0, 102,
+ 103, 88, 104, 105, 107, 89, 106, 90, 95, 91,
+ 92, 93, 94, 96, 111, 112, 98, 115, 116, 100,
+ 102, 103, 117, 104, 119, 105, 107, 106, 120, 0,
+ 121, 123, 125, 126, 0, 128, 111, 112, 115, 130,
+ 116, 132, 133, 134, 117, 137, 119, 139, 140, 143,
+
+ 120, 121, 143, 123, 125, 126, 128, 144, 146, 147,
+ 0, 130, 132, 133, 134, 0, 137, 0, 139, 140,
+ 143, 0, 0, 0, 0, 0, 0, 0, 144, 146,
+ 0, 147, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 143, 152, 0, 152, 152, 154, 0, 0,
+ 154, 151, 151, 151, 151, 151, 151, 151, 151, 151,
+ 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
+ 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
+ 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
+ 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
+
+ 151, 151, 151, 151, 151, 151, 151, 151, 151
} ;
static yy_state_type yy_last_accepting_state;
@@ -630,7 +636,7 @@ static void countnl() {
Director::g_lingo->_colnumber = strlen(p);
}
-#line 634 "engines/director/lingo/lingo-lex.cpp"
+#line 640 "engines/director/lingo/lingo-lex.cpp"
#define INITIAL 0
@@ -818,7 +824,7 @@ YY_DECL
#line 58 "engines/director/lingo/lingo-lex.l"
-#line 822 "engines/director/lingo/lingo-lex.cpp"
+#line 828 "engines/director/lingo/lingo-lex.cpp"
if ( !(yy_init) )
{
@@ -872,13 +878,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 139 )
+ if ( yy_current_state >= 152 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
- while ( yy_base[yy_current_state] != 335 );
+ while ( yy_base[yy_current_state] != 352 );
yy_find_action:
yy_act = yy_accept[yy_current_state];
@@ -925,168 +931,178 @@ YY_RULE_SETUP
case 5:
YY_RULE_SETUP
#line 65 "engines/director/lingo/lingo-lex.l"
-{ count(); return tDOWN; }
+{ count(); return tCONTAINS; }
YY_BREAK
case 6:
YY_RULE_SETUP
#line 66 "engines/director/lingo/lingo-lex.l"
-{ count(); return tIF; }
+{ count(); return tDOWN; }
YY_BREAK
case 7:
-/* rule 7 can match eol */
YY_RULE_SETUP
#line 67 "engines/director/lingo/lingo-lex.l"
-{ countnl(); return tNLELSIF; }
+{ count(); return tIF; }
YY_BREAK
case 8:
/* rule 8 can match eol */
YY_RULE_SETUP
#line 68 "engines/director/lingo/lingo-lex.l"
-{ countnl(); return tNLELSE; }
+{ countnl(); return tNLELSIF; }
YY_BREAK
case 9:
+/* rule 9 can match eol */
YY_RULE_SETUP
#line 69 "engines/director/lingo/lingo-lex.l"
-{ count(); return tELSE; }
+{ countnl(); return tNLELSE; }
YY_BREAK
case 10:
YY_RULE_SETUP
#line 70 "engines/director/lingo/lingo-lex.l"
-{ count(); return tEND; }
+{ count(); return tELSE; }
YY_BREAK
case 11:
YY_RULE_SETUP
#line 71 "engines/director/lingo/lingo-lex.l"
-{ count(); return tEXIT; }
+{ count(); return tEND; }
YY_BREAK
case 12:
YY_RULE_SETUP
#line 72 "engines/director/lingo/lingo-lex.l"
-{ count(); return tFRAME; }
+{ count(); return tEXIT; }
YY_BREAK
case 13:
YY_RULE_SETUP
#line 73 "engines/director/lingo/lingo-lex.l"
-{ count(); return tGLOBAL; }
+{ count(); return tFRAME; }
YY_BREAK
case 14:
YY_RULE_SETUP
#line 74 "engines/director/lingo/lingo-lex.l"
-{ count(); return tGO; }
+{ count(); return tGLOBAL; }
YY_BREAK
case 15:
YY_RULE_SETUP
#line 75 "engines/director/lingo/lingo-lex.l"
-{ count(); return tINTO; }
+{ count(); return tGO; }
YY_BREAK
case 16:
YY_RULE_SETUP
#line 76 "engines/director/lingo/lingo-lex.l"
-{ count(); return tLOOP; }
+{ count(); return tINTO; }
YY_BREAK
case 17:
YY_RULE_SETUP
#line 77 "engines/director/lingo/lingo-lex.l"
-{ count(); return tMACRO; }
+{ count(); return tLOOP; }
YY_BREAK
case 18:
YY_RULE_SETUP
#line 78 "engines/director/lingo/lingo-lex.l"
-{ count(); return tMCI; }
+{ count(); return tMACRO; }
YY_BREAK
case 19:
YY_RULE_SETUP
#line 79 "engines/director/lingo/lingo-lex.l"
-{ count(); return tMCIWAIT; }
+{ count(); return tMCI; }
YY_BREAK
case 20:
YY_RULE_SETUP
#line 80 "engines/director/lingo/lingo-lex.l"
-{ count(); return tMOVIE; }
+{ count(); return tMCIWAIT; }
YY_BREAK
case 21:
YY_RULE_SETUP
#line 81 "engines/director/lingo/lingo-lex.l"
-{ count(); return tNEXT; }
+{ count(); return tMOVIE; }
YY_BREAK
case 22:
YY_RULE_SETUP
#line 82 "engines/director/lingo/lingo-lex.l"
-{ count(); return tNOT; }
+{ count(); return tNEXT; }
YY_BREAK
case 23:
YY_RULE_SETUP
#line 83 "engines/director/lingo/lingo-lex.l"
-{ count(); return tOF; }
+{ count(); return tNOT; }
YY_BREAK
case 24:
YY_RULE_SETUP
#line 84 "engines/director/lingo/lingo-lex.l"
-{ count(); return tOR; }
+{ count(); return tOF; }
YY_BREAK
case 25:
YY_RULE_SETUP
#line 85 "engines/director/lingo/lingo-lex.l"
-{ count(); return tPREVIOUS; }
+{ count(); return tOR; }
YY_BREAK
case 26:
YY_RULE_SETUP
#line 86 "engines/director/lingo/lingo-lex.l"
-{ count(); return tPUT; }
+{ count(); return tPREVIOUS; }
YY_BREAK
case 27:
YY_RULE_SETUP
#line 87 "engines/director/lingo/lingo-lex.l"
-{ count(); return tREPEAT; }
+{ count(); return tPUT; }
YY_BREAK
case 28:
YY_RULE_SETUP
#line 88 "engines/director/lingo/lingo-lex.l"
-{ count(); return tSET; }
+{ count(); return tREPEAT; }
YY_BREAK
case 29:
YY_RULE_SETUP
#line 89 "engines/director/lingo/lingo-lex.l"
-{ count(); return tTHEN; }
+{ count(); return tSET; }
YY_BREAK
case 30:
YY_RULE_SETUP
#line 90 "engines/director/lingo/lingo-lex.l"
-{ count(); return tTO; }
+{ count(); return tSTARTS; }
YY_BREAK
case 31:
YY_RULE_SETUP
#line 91 "engines/director/lingo/lingo-lex.l"
-{ count(); return tWITH; }
+{ count(); return tTHEN; }
YY_BREAK
case 32:
YY_RULE_SETUP
#line 92 "engines/director/lingo/lingo-lex.l"
-{ count(); return tWHILE; }
+{ count(); return tTO; }
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 94 "engines/director/lingo/lingo-lex.l"
-{ count(); return tNEQ; }
+#line 93 "engines/director/lingo/lingo-lex.l"
+{ count(); return tWITH; }
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 95 "engines/director/lingo/lingo-lex.l"
-{ count(); return tGE; }
+#line 94 "engines/director/lingo/lingo-lex.l"
+{ count(); return tWHILE; }
YY_BREAK
case 35:
YY_RULE_SETUP
#line 96 "engines/director/lingo/lingo-lex.l"
-{ count(); return tLE; }
+{ count(); return tNEQ; }
YY_BREAK
case 36:
YY_RULE_SETUP
#line 97 "engines/director/lingo/lingo-lex.l"
-{ count(); return tCONCAT; }
+{ count(); return tGE; }
YY_BREAK
case 37:
YY_RULE_SETUP
+#line 98 "engines/director/lingo/lingo-lex.l"
+{ count(); return tLE; }
+ YY_BREAK
+case 38:
+YY_RULE_SETUP
#line 99 "engines/director/lingo/lingo-lex.l"
+{ count(); return tCONCAT; }
+ YY_BREAK
+case 39:
+YY_RULE_SETUP
+#line 101 "engines/director/lingo/lingo-lex.l"
{
count();
yylval.s = new Common::String(yytext);
@@ -1097,43 +1113,43 @@ YY_RULE_SETUP
return ID;
}
YY_BREAK
-case 38:
-YY_RULE_SETUP
-#line 108 "engines/director/lingo/lingo-lex.l"
-{ count(); yylval.f = atof(yytext); return FLOAT; }
- YY_BREAK
-case 39:
-YY_RULE_SETUP
-#line 109 "engines/director/lingo/lingo-lex.l"
-{ count(); yylval.i = strtol(yytext, NULL, 10); return INT; }
- YY_BREAK
case 40:
YY_RULE_SETUP
#line 110 "engines/director/lingo/lingo-lex.l"
-{ count(); return *yytext; }
+{ count(); yylval.f = atof(yytext); return FLOAT; }
YY_BREAK
case 41:
-/* rule 41 can match eol */
YY_RULE_SETUP
#line 111 "engines/director/lingo/lingo-lex.l"
-{ return '\n'; }
+{ count(); yylval.i = strtol(yytext, NULL, 10); return INT; }
YY_BREAK
case 42:
YY_RULE_SETUP
#line 112 "engines/director/lingo/lingo-lex.l"
-{ count(); yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return STRING; }
+{ count(); return *yytext; }
YY_BREAK
case 43:
+/* rule 43 can match eol */
YY_RULE_SETUP
#line 113 "engines/director/lingo/lingo-lex.l"
-
+{ return '\n'; }
YY_BREAK
case 44:
YY_RULE_SETUP
+#line 114 "engines/director/lingo/lingo-lex.l"
+{ count(); yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return STRING; }
+ YY_BREAK
+case 45:
+YY_RULE_SETUP
#line 115 "engines/director/lingo/lingo-lex.l"
+
+ YY_BREAK
+case 46:
+YY_RULE_SETUP
+#line 117 "engines/director/lingo/lingo-lex.l"
ECHO;
YY_BREAK
-#line 1137 "engines/director/lingo/lingo-lex.cpp"
+#line 1153 "engines/director/lingo/lingo-lex.cpp"
case YY_STATE_EOF(INITIAL):
yyterminate();
@@ -1426,7 +1442,7 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 139 )
+ if ( yy_current_state >= 152 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -1454,11 +1470,11 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 139 )
+ if ( yy_current_state >= 152 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 138);
+ yy_is_jam = (yy_current_state == 151);
return yy_is_jam ? 0 : yy_current_state;
}
@@ -2133,7 +2149,7 @@ void yyfree (void * ptr )
#define YYTABLES_NAME "yytables"
-#line 115 "engines/director/lingo/lingo-lex.l"
+#line 117 "engines/director/lingo/lingo-lex.l"
diff --git a/engines/director/lingo/lingo-lex.l b/engines/director/lingo/lingo-lex.l
index d241993d53..6a78a3f160 100644
--- a/engines/director/lingo/lingo-lex.l
+++ b/engines/director/lingo/lingo-lex.l
@@ -62,6 +62,7 @@ whitespace [\t ]
[\t]+ { count(); return ' '; }
(?i:and) { count(); return tAND; }
+(?i:contains) { count(); return tCONTAINS; }
(?i:down) { count(); return tDOWN; }
(?i:if) { count(); return tIF; }
(?i:[\n\r]+[\t ]+else[\t ]+if) { countnl(); return tNLELSIF; }
@@ -86,6 +87,7 @@ whitespace [\t ]
(?i:put) { count(); return tPUT; }
(?i:repeat) { count(); return tREPEAT; }
(?i:set) { count(); return tSET; }
+(?i:starts) { count(); return tSTARTS; }
(?i:then) { count(); return tTHEN; }
(?i:to) { count(); return tTO; }
(?i:with) { count(); return tWITH; }
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index 9ec89ff0af..9fe17f3be5 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -222,8 +222,9 @@ Common::String *Datum::toString() {
case STRING:
delete s;
s = u.s;
+ break;
default:
- warning("Incorrect operation toInt() for type: %s", type2str());
+ warning("Incorrect operation toString() for type: %s", type2str());
}
u.s = s;
@@ -250,4 +251,44 @@ const char *Datum::type2str() {
}
}
+// This is table for built-in Macintosh font lowercasing.
+// '.' means that the symbol should be not changed, rest
+// of the symbols are stripping the diacritics
+// The table starts from 0x80
+//
+// TODO: Check it for correctness.
+static char lowerCaseConvert[] =
+"aacenoua" // 80
+"aaaaacee" // 88
+"eeiiiino" // 90
+"oooouuuu" // 98
+"........" // a0
+".......o" // a8
+"........" // b0
+".......o" // b8
+"........" // c0
+".. aao.." // c8
+"--.....y";// d0-d8
+
+Common::String *Lingo::toLowercaseMac(Common::String *s) {
+ Common::String *res = new Common::String;
+ const unsigned char *p = (const unsigned char *)s->c_str();
+
+ while (*p) {
+ if (*p >= 0x80 && *p <= 0xd8) {
+ if (lowerCaseConvert[*p - 0x80] != '.')
+ *res += lowerCaseConvert[*p - 0x80];
+ else
+ *res += *p;
+ } else if (*p < 0x80) {
+ *res += tolower(*p);
+ } else {
+ error("Unacceptable symbol in toLowercaseMac: %c", *p);
+ }
+ p++;
+ }
+
+ return res;
+}
+
} // End of namespace Director
diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h
index 162bb5f4e5..f3b36f94f6 100644
--- a/engines/director/lingo/lingo.h
+++ b/engines/director/lingo/lingo.h
@@ -142,6 +142,8 @@ public:
void initBuiltIns();
+ Common::String *toLowercaseMac(Common::String *s);
+
public:
void execute(int pc);
void pushContext();
@@ -188,6 +190,8 @@ public:
static void c_ampersand();
static void c_concat();
+ static void c_contains();
+ static void c_starts();
static void c_constpush();
static void c_fconstpush();