aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/director/lingo/lingo-builtins.cpp23
-rw-r--r--engines/director/lingo/lingo-lex.cpp459
-rw-r--r--engines/director/lingo/lingo-lex.l11
-rw-r--r--engines/director/lingo/lingo-the.cpp5
-rw-r--r--engines/director/lingo/lingo-the.h1
5 files changed, 271 insertions, 228 deletions
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index ae2f951f1a..58b65e7bd4 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -46,14 +46,14 @@ static struct BuiltinProto {
{ "sqrt", Lingo::b_sqrt, 1, 1, true }, // D2 f
{ "tan", Lingo::b_tan, 1, 1, true }, // D4 f
// String
- { "chars", Lingo::b_chars, 3, 3, true }, // D2
- { "charToNum", Lingo::b_charToNum, 1, 1, true }, // D2
- { "delete", Lingo::b_delete, 1, 1, true }, // D3
- { "hilite", Lingo::b_hilite, 1, 1, true }, // D3
- { "length", Lingo::b_length, 1, 1, true }, // D2
- { "numToChar", Lingo::b_numToChar, 1, 1, true }, // D2
- { "offset", Lingo::b_offset, 2, 3, true }, // D2
- { "string", Lingo::b_string, 1, 1, true }, // D2
+ { "chars", Lingo::b_chars, 3, 3, true }, // D2 f
+ { "charToNum", Lingo::b_charToNum, 1, 1, true }, // D2 f
+ { "delete", Lingo::b_delete, 1, 1, true }, // D3 c
+ { "hilite", Lingo::b_hilite, 1, 1, true }, // D3 c
+ { "length", Lingo::b_length, 1, 1, true }, // D2 f
+ { "numToChar", Lingo::b_numToChar, 1, 1, true }, // D2 f
+ { "offset", Lingo::b_offset, 2, 3, true }, // D2 f
+ { "string", Lingo::b_string, 1, 1, true }, // D2 f
{ "value", Lingo::b_value, 1, 1, true }, // D2 f
// Lists
{ "add", Lingo::b_add, 2, 2, false }, // D4 command
@@ -99,7 +99,7 @@ static struct BuiltinProto {
{ "continue", Lingo::b_continue, 0, 0, false }, // D2 c
{ "dontPassEvent", Lingo::b_dontPassEvent, 0, 0, false }, // D2 c
{ "delay", Lingo::b_delay, 1, 1, false }, // D2
- { "do", Lingo::b_do, 1, 1, false }, // D2
+ { "do", Lingo::b_do, 1, 1, false }, // D2 c
{ "halt", Lingo::b_halt, 0, 0, false }, // D4 c
{ "nothing", Lingo::b_nothing, 0, 0, false }, // D2 c
{ "pass", Lingo::b_pass, 0, 0, false }, // D4 c
@@ -222,6 +222,8 @@ static const char *builtinFunctions[] = {
"backspace",
"birth",
"cast",
+ "chars",
+ "charToNum",
"constrainH",
"constrainV",
"cos",
@@ -250,6 +252,7 @@ static const char *builtinFunctions[] = {
"integerp",
"intersect",
"label",
+ "length",
"list",
"listP",
"log",
@@ -257,6 +260,7 @@ static const char *builtinFunctions[] = {
"marker",
"max",
"min",
+ "numToChar",
"objectp",
"offset",
"param",
@@ -274,6 +278,7 @@ static const char *builtinFunctions[] = {
"sin",
"sqrt",
"soundBusy",
+ "string",
"stringp",
"symbolp",
"tab",
diff --git a/engines/director/lingo/lingo-lex.cpp b/engines/director/lingo/lingo-lex.cpp
index c468801b63..97ade7d01d 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 71
-#define YY_END_OF_BUFFER 72
+#define YY_NUM_RULES 72
+#define YY_END_OF_BUFFER 73
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@@ -373,37 +373,37 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[262] =
+static yyconst flex_int16_t yy_accept[271] =
{ 0,
- 0, 0, 72, 70, 3, 68, 68, 70, 70, 70,
- 67, 67, 67, 66, 67, 67, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 2, 2, 3, 68, 0, 0,
- 0, 0, 0, 69, 4, 63, 1, 65, 66, 62,
- 60, 61, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 22, 12, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 35, 36, 64, 38,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 53,
- 64, 64, 64, 2, 2, 0, 4, 1, 65, 64,
-
- 6, 64, 64, 64, 64, 64, 64, 16, 64, 64,
- 64, 64, 0, 64, 64, 64, 64, 64, 64, 64,
- 31, 64, 64, 34, 64, 64, 64, 64, 43, 64,
- 45, 64, 64, 64, 64, 64, 64, 64, 64, 0,
- 64, 64, 8, 64, 10, 11, 15, 0, 16, 18,
- 64, 64, 64, 0, 64, 64, 25, 26, 27, 28,
- 64, 64, 64, 33, 37, 39, 64, 64, 64, 64,
- 64, 47, 0, 52, 57, 64, 55, 59, 14, 5,
- 64, 64, 16, 16, 64, 19, 64, 21, 64, 64,
- 29, 64, 32, 64, 64, 64, 64, 64, 64, 51,
-
- 51, 58, 64, 0, 7, 64, 16, 64, 20, 64,
- 64, 30, 64, 64, 64, 44, 54, 46, 0, 0,
- 51, 56, 0, 64, 17, 64, 64, 64, 64, 64,
- 0, 0, 0, 0, 51, 13, 9, 23, 64, 64,
- 41, 42, 0, 0, 0, 51, 64, 40, 0, 0,
- 0, 0, 24, 50, 49, 50, 0, 0, 0, 48,
- 0
+ 0, 0, 73, 71, 3, 69, 69, 71, 71, 71,
+ 68, 68, 68, 67, 68, 68, 65, 65, 65, 65,
+ 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
+ 65, 65, 65, 65, 2, 2, 3, 69, 0, 0,
+ 0, 0, 0, 70, 4, 64, 1, 66, 67, 63,
+ 61, 62, 65, 65, 65, 65, 65, 65, 65, 65,
+ 65, 65, 65, 65, 65, 22, 12, 65, 65, 65,
+ 65, 65, 65, 65, 65, 65, 35, 36, 65, 38,
+ 65, 65, 65, 65, 65, 65, 65, 65, 65, 54,
+ 65, 65, 65, 2, 2, 0, 4, 1, 66, 65,
+
+ 6, 65, 65, 65, 65, 65, 65, 16, 65, 65,
+ 65, 65, 0, 65, 65, 65, 65, 65, 65, 65,
+ 31, 65, 65, 34, 65, 65, 65, 65, 43, 65,
+ 45, 65, 65, 65, 65, 65, 65, 65, 65, 0,
+ 65, 65, 8, 65, 10, 11, 15, 0, 16, 18,
+ 65, 65, 65, 0, 65, 65, 25, 26, 27, 28,
+ 65, 65, 65, 33, 37, 39, 65, 65, 65, 65,
+ 65, 47, 0, 53, 58, 65, 56, 60, 14, 5,
+ 65, 65, 16, 16, 65, 19, 65, 21, 65, 65,
+ 29, 65, 32, 65, 65, 65, 65, 65, 65, 52,
+
+ 52, 52, 59, 65, 0, 7, 65, 16, 65, 20,
+ 65, 65, 30, 65, 65, 65, 44, 55, 46, 0,
+ 0, 52, 52, 57, 0, 65, 17, 65, 65, 65,
+ 65, 65, 0, 0, 0, 0, 52, 52, 13, 9,
+ 23, 65, 65, 41, 42, 0, 0, 0, 52, 52,
+ 65, 40, 0, 0, 0, 0, 0, 24, 51, 50,
+ 51, 0, 0, 0, 0, 0, 0, 48, 49, 0
} ;
static yyconst flex_int32_t yy_ec[256] =
@@ -449,14 +449,14 @@ static yyconst flex_int32_t yy_meta[65] =
5, 5, 5, 5
} ;
-static yyconst flex_int16_t yy_base[273] =
+static yyconst flex_int16_t yy_base[282] =
{ 0,
- 0, 63, 159, 660, 67, 71, 75, 79, 147, 0,
- 660, 133, 126, 54, 70, 94, 65, 67, 65, 61,
+ 0, 63, 159, 697, 67, 71, 75, 79, 147, 0,
+ 697, 133, 126, 54, 70, 94, 65, 67, 65, 61,
71, 87, 72, 0, 103, 81, 119, 109, 135, 118,
- 82, 112, 153, 155, 191, 208, 212, 660, 216, 179,
- 224, 119, 99, 660, 0, 660, 0, 88, 95, 660,
- 660, 660, 0, 113, 96, 105, 159, 169, 194, 172,
+ 82, 112, 153, 155, 191, 208, 212, 697, 216, 179,
+ 224, 119, 99, 697, 0, 697, 0, 88, 95, 697,
+ 697, 697, 0, 113, 96, 105, 159, 169, 194, 172,
188, 199, 215, 218, 201, 88, 0, 203, 218, 212,
212, 224, 213, 226, 211, 216, 0, 0, 223, 0,
235, 237, 219, 226, 238, 243, 262, 255, 259, 0,
@@ -470,54 +470,56 @@ static yyconst flex_int16_t yy_base[273] =
357, 368, 375, 364, 380, 367, 0, 0, 0, 0,
372, 373, 377, 0, 0, 387, 382, 387, 392, 377,
378, 0, 414, 0, 0, 394, 395, 0, 423, 0,
- 400, 406, 0, 0, 402, 0, 411, 660, 410, 407,
- 0, 422, 0, 424, 417, 416, 415, 423, 417, 450,
-
- 456, 0, 424, 474, 0, 425, 0, 417, 0, 445,
- 449, 0, 461, 446, 448, 0, 0, 0, 488, 466,
- 482, 0, 463, 462, 0, 470, 475, 476, 468, 463,
- 526, 487, 487, 488, 530, 660, 0, 0, 482, 494,
- 0, 0, 495, 541, 508, 547, 503, 0, 523, 546,
- 529, 553, 0, 660, 557, 660, 561, 531, 562, 566,
- 660, 615, 617, 620, 623, 629, 634, 639, 642, 647,
- 649, 654
+ 400, 406, 0, 0, 402, 0, 411, 697, 410, 408,
+ 0, 423, 0, 425, 417, 416, 415, 430, 419, 450,
+
+ 465, 476, 0, 432, 478, 0, 435, 0, 447, 0,
+ 435, 463, 0, 470, 455, 457, 0, 0, 0, 492,
+ 475, 491, 519, 0, 476, 468, 0, 484, 487, 492,
+ 483, 478, 531, 502, 513, 514, 538, 545, 697, 0,
+ 0, 510, 526, 0, 0, 519, 554, 529, 560, 561,
+ 524, 0, 546, 570, 547, 581, 582, 0, 697, 586,
+ 697, 593, 552, 598, 567, 603, 604, 605, 613, 697,
+ 652, 654, 657, 660, 666, 671, 676, 679, 684, 686,
+ 691
} ;
-static yyconst flex_int16_t yy_def[273] =
+static yyconst flex_int16_t yy_def[282] =
{ 0,
- 261, 1, 261, 261, 261, 261, 261, 261, 262, 263,
- 261, 261, 261, 261, 261, 261, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 261, 261, 261, 261, 261, 261,
- 261, 261, 262, 261, 265, 261, 266, 261, 261, 261,
- 261, 261, 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 261, 261, 261, 265, 266, 261, 264,
-
- 264, 264, 264, 264, 264, 264, 264, 267, 264, 264,
- 264, 264, 261, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 261,
- 264, 264, 264, 264, 264, 264, 264, 268, 269, 264,
- 264, 264, 264, 261, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 270, 264, 264, 264, 264, 264, 261, 264,
- 264, 264, 271, 269, 264, 264, 264, 261, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 270,
-
- 270, 264, 264, 261, 264, 264, 271, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 261, 261,
- 270, 264, 261, 264, 264, 264, 264, 264, 264, 264,
- 261, 261, 261, 261, 270, 261, 264, 264, 264, 264,
- 264, 264, 261, 261, 261, 270, 264, 264, 261, 272,
- 261, 261, 264, 261, 272, 261, 261, 261, 261, 272,
- 0, 261, 261, 261, 261, 261, 261, 261, 261, 261,
- 261, 261
+ 270, 1, 270, 270, 270, 270, 270, 270, 271, 272,
+ 270, 270, 270, 270, 270, 270, 273, 273, 273, 273,
+ 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
+ 273, 273, 273, 273, 270, 270, 270, 270, 270, 270,
+ 270, 270, 271, 270, 274, 270, 275, 270, 270, 270,
+ 270, 270, 273, 273, 273, 273, 273, 273, 273, 273,
+ 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
+ 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
+ 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
+ 273, 273, 273, 270, 270, 270, 274, 275, 270, 273,
+
+ 273, 273, 273, 273, 273, 273, 273, 276, 273, 273,
+ 273, 273, 270, 273, 273, 273, 273, 273, 273, 273,
+ 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
+ 273, 273, 273, 273, 273, 273, 273, 273, 273, 270,
+ 273, 273, 273, 273, 273, 273, 273, 277, 278, 273,
+ 273, 273, 273, 270, 273, 273, 273, 273, 273, 273,
+ 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
+ 273, 273, 279, 273, 273, 273, 273, 273, 270, 273,
+ 273, 273, 280, 278, 273, 273, 273, 270, 273, 273,
+ 273, 273, 273, 273, 273, 273, 273, 273, 273, 279,
+
+ 279, 279, 273, 273, 270, 273, 273, 280, 273, 273,
+ 273, 273, 273, 273, 273, 273, 273, 273, 273, 270,
+ 270, 279, 279, 273, 270, 273, 273, 273, 273, 273,
+ 273, 273, 270, 270, 270, 270, 279, 279, 270, 273,
+ 273, 273, 273, 273, 273, 270, 270, 270, 279, 279,
+ 273, 273, 270, 281, 270, 270, 270, 273, 270, 281,
+ 270, 270, 270, 270, 270, 270, 270, 281, 281, 0,
+ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
+ 270
} ;
-static yyconst flex_int16_t yy_nxt[725] =
+static yyconst flex_int16_t yy_nxt[762] =
{ 0,
4, 5, 6, 7, 8, 9, 10, 11, 12, 11,
13, 4, 14, 15, 11, 16, 17, 18, 19, 20,
@@ -535,73 +537,77 @@ static yyconst flex_int16_t yy_nxt[725] =
42, 60, 65, 61, 67, 66, 102, 84, 63, 75,
70, 68, 85, 62, 71, 72, 47, 69, 76, 73,
101, 46, 86, 64, 81, 96, 87, 100, 74, 67,
- 82, 102, 44, 83, 75, 68, 77, 85, 261, 261,
+ 82, 102, 44, 83, 75, 68, 77, 85, 270, 270,
72, 69, 76, 78, 73, 79, 86, 80, 81, 96,
87, 100, 74, 88, 82, 103, 89, 83, 91, 92,
- 40, 77, 90, 40, 93, 148, 261, 78, 148, 79,
- 261, 80, 94, 38, 38, 95, 53, 104, 88, 42,
+ 40, 77, 90, 40, 93, 148, 270, 78, 148, 79,
+ 270, 80, 94, 38, 38, 95, 53, 104, 88, 42,
- 103, 89, 261, 91, 92, 107, 90, 108, 93, 95,
+ 103, 89, 270, 91, 92, 107, 90, 108, 93, 95,
38, 38, 95, 37, 38, 38, 39, 39, 38, 38,
39, 104, 105, 109, 42, 40, 41, 41, 40, 107,
- 112, 106, 108, 110, 111, 261, 114, 115, 116, 261,
+ 112, 106, 108, 110, 111, 270, 114, 115, 116, 270,
117, 118, 119, 125, 42, 121, 105, 120, 109, 123,
- 124, 126, 261, 129, 112, 106, 130, 127, 110, 111,
+ 124, 126, 270, 129, 112, 106, 130, 127, 110, 111,
114, 115, 122, 116, 117, 118, 128, 119, 125, 42,
121, 120, 131, 123, 124, 132, 126, 129, 133, 135,
- 130, 134, 127, 136, 261, 138, 122, 137, 261, 139,
+ 130, 134, 127, 136, 270, 138, 122, 137, 270, 139,
128, 94, 38, 38, 95, 140, 131, 141, 145, 132,
142, 143, 144, 133, 135, 134, 146, 147, 136, 138,
150, 151, 137, 139, 95, 38, 38, 95, 152, 140,
153, 159, 141, 145, 142, 143, 144, 155, 113, 156,
- 146, 113, 147, 158, 150, 151, 160, 261, 157, 161,
+ 146, 113, 147, 158, 150, 151, 160, 270, 157, 161,
162, 163, 152, 164, 165, 153, 159, 166, 167, 168,
- 169, 155, 170, 261, 156, 171, 172, 158, 175, 176,
+ 169, 155, 170, 270, 156, 171, 172, 158, 175, 176,
160, 154, 157, 161, 177, 162, 163, 164, 165, 178,
179, 166, 167, 168, 180, 169, 181, 170, 173, 171,
172, 173, 175, 176, 182, 154, 185, 148, 186, 177,
- 148, 187, 261, 188, 178, 179, 189, 193, 180, 190,
-
- 181, 191, 192, 194, 261, 174, 195, 196, 197, 182,
- 185, 198, 199, 186, 202, 173, 187, 188, 173, 203,
- 205, 189, 193, 190, 204, 191, 192, 204, 194, 174,
- 206, 195, 196, 197, 208, 198, 199, 209, 210, 202,
- 211, 212, 213, 217, 203, 205, 214, 201, 215, 216,
- 218, 219, 222, 224, 219, 206, 225, 219, 208, 220,
- 219, 209, 210, 226, 211, 220, 212, 213, 217, 227,
- 214, 201, 215, 216, 218, 204, 222, 224, 204, 228,
- 225, 229, 230, 219, 236, 232, 219, 221, 226, 231,
- 238, 220, 231, 239, 227, 237, 240, 261, 223, 261,
-
- 234, 241, 242, 243, 228, 229, 230, 232, 244, 236,
- 232, 221, 245, 261, 235, 238, 247, 233, 239, 237,
- 248, 240, 234, 223, 234, 241, 242, 231, 243, 249,
- 231, 219, 232, 244, 219, 251, 253, 245, 235, 220,
- 247, 233, 250, 254, 248, 250, 234, 250, 252, 256,
- 250, 252, 259, 249, 257, 233, 220, 257, 261, 251,
- 253, 261, 257, 260, 246, 257, 260, 260, 254, 261,
- 260, 261, 232, 261, 256, 261, 261, 259, 261, 233,
- 261, 261, 258, 261, 261, 261, 261, 234, 246, 261,
- 258, 261, 261, 261, 261, 261, 261, 232, 261, 261,
-
- 261, 261, 261, 261, 261, 261, 258, 261, 261, 261,
- 261, 234, 261, 261, 258, 43, 43, 261, 43, 43,
- 43, 45, 45, 53, 53, 53, 97, 97, 97, 98,
- 98, 261, 98, 98, 98, 149, 261, 149, 149, 149,
- 183, 261, 261, 183, 183, 184, 184, 184, 200, 261,
- 261, 200, 207, 207, 207, 255, 261, 261, 255, 3,
- 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
- 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
- 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
- 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
-
- 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
- 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
- 261, 261, 261, 261
+ 148, 187, 270, 188, 178, 179, 189, 193, 180, 190,
+
+ 181, 191, 192, 194, 270, 174, 195, 196, 197, 182,
+ 185, 198, 199, 186, 203, 173, 187, 188, 173, 204,
+ 206, 189, 193, 190, 205, 191, 192, 205, 194, 174,
+ 207, 195, 196, 197, 209, 198, 199, 210, 211, 203,
+ 201, 212, 213, 214, 204, 206, 215, 202, 216, 217,
+ 218, 220, 219, 228, 220, 207, 270, 270, 209, 221,
+ 224, 210, 211, 226, 201, 212, 220, 213, 214, 220,
+ 215, 202, 216, 217, 221, 218, 219, 220, 228, 205,
+ 220, 222, 205, 229, 224, 221, 227, 226, 230, 270,
+ 231, 232, 220, 233, 234, 220, 233, 239, 270, 270,
+
+ 221, 240, 225, 270, 241, 242, 222, 223, 229, 236,
+ 227, 234, 243, 230, 231, 232, 244, 245, 246, 234,
+ 220, 235, 239, 220, 237, 240, 236, 225, 221, 241,
+ 242, 223, 233, 236, 247, 233, 234, 243, 248, 220,
+ 244, 245, 220, 246, 251, 235, 220, 221, 237, 220,
+ 236, 238, 252, 253, 221, 254, 255, 258, 254, 247,
+ 235, 256, 257, 248, 256, 257, 259, 261, 251, 221,
+ 221, 254, 249, 266, 254, 238, 252, 253, 270, 250,
+ 255, 258, 262, 264, 235, 262, 264, 270, 267, 270,
+ 270, 259, 261, 270, 262, 270, 249, 262, 266, 264,
+
+ 234, 234, 264, 250, 268, 269, 268, 268, 269, 268,
+ 263, 265, 270, 267, 269, 236, 236, 269, 270, 270,
+ 270, 270, 263, 270, 270, 234, 234, 265, 270, 270,
+ 270, 270, 270, 270, 263, 265, 270, 270, 270, 236,
+ 236, 270, 270, 270, 270, 270, 263, 270, 270, 270,
+ 270, 265, 43, 43, 270, 43, 43, 43, 45, 45,
+ 53, 53, 53, 97, 97, 97, 98, 98, 270, 98,
+ 98, 98, 149, 270, 149, 149, 149, 183, 270, 270,
+ 183, 183, 184, 184, 184, 200, 270, 270, 200, 208,
+ 208, 208, 260, 270, 270, 260, 3, 270, 270, 270,
+
+ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
+ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
+ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
+ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
+ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
+ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
+ 270
} ;
-static yyconst flex_int16_t yy_chk[725] =
+static yyconst flex_int16_t yy_chk[762] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -651,38 +657,42 @@ static yyconst flex_int16_t yy_chk[725] =
151, 170, 171, 152, 176, 173, 153, 154, 173, 177,
181, 155, 163, 156, 179, 161, 162, 179, 166, 135,
182, 167, 168, 169, 185, 170, 171, 187, 189, 176,
- 190, 192, 194, 198, 177, 181, 195, 173, 196, 197,
- 199, 200, 203, 206, 200, 182, 208, 201, 185, 200,
- 201, 187, 189, 210, 190, 201, 192, 194, 198, 211,
- 195, 173, 196, 197, 199, 204, 203, 206, 204, 213,
- 208, 214, 215, 221, 223, 220, 221, 201, 210, 219,
- 226, 221, 219, 227, 211, 224, 228, 0, 204, 0,
-
- 220, 229, 230, 232, 213, 214, 215, 219, 233, 223,
- 220, 201, 234, 0, 221, 226, 239, 219, 227, 224,
- 240, 228, 219, 204, 220, 229, 230, 231, 232, 243,
- 231, 235, 219, 233, 235, 245, 247, 234, 221, 235,
- 239, 219, 244, 249, 240, 244, 219, 250, 246, 251,
- 250, 246, 258, 243, 252, 231, 246, 252, 255, 245,
- 247, 255, 257, 259, 235, 257, 259, 260, 249, 0,
- 260, 0, 252, 0, 251, 0, 0, 258, 0, 231,
- 0, 0, 252, 0, 0, 0, 0, 252, 235, 0,
- 257, 0, 0, 0, 0, 0, 0, 252, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 252, 0, 0, 0,
- 0, 252, 0, 0, 257, 262, 262, 0, 262, 262,
- 262, 263, 263, 264, 264, 264, 265, 265, 265, 266,
- 266, 0, 266, 266, 266, 267, 0, 267, 267, 267,
- 268, 0, 0, 268, 268, 269, 269, 269, 270, 0,
- 0, 270, 271, 271, 271, 272, 0, 0, 272, 261,
- 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
- 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
- 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
- 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
-
- 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
- 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
- 261, 261, 261, 261
+ 173, 190, 192, 194, 177, 181, 195, 173, 196, 197,
+ 198, 200, 199, 211, 200, 182, 0, 0, 185, 200,
+ 204, 187, 189, 207, 173, 190, 201, 192, 194, 201,
+ 195, 173, 196, 197, 201, 198, 199, 202, 211, 205,
+ 202, 201, 205, 212, 204, 202, 209, 207, 214, 0,
+ 215, 216, 222, 220, 221, 222, 220, 225, 0, 0,
+
+ 222, 226, 205, 0, 228, 229, 201, 202, 212, 221,
+ 209, 220, 230, 214, 215, 216, 231, 232, 234, 221,
+ 223, 220, 225, 223, 222, 226, 220, 205, 223, 228,
+ 229, 202, 233, 221, 235, 233, 220, 230, 236, 237,
+ 231, 232, 237, 234, 242, 220, 238, 237, 222, 238,
+ 220, 223, 243, 246, 238, 247, 248, 251, 247, 235,
+ 233, 249, 250, 236, 249, 250, 253, 255, 242, 249,
+ 250, 254, 237, 263, 254, 223, 243, 246, 0, 238,
+ 248, 251, 256, 257, 233, 256, 257, 260, 265, 0,
+ 260, 253, 255, 0, 262, 0, 237, 262, 263, 264,
+
+ 256, 257, 264, 238, 266, 267, 268, 266, 267, 268,
+ 256, 257, 0, 265, 269, 256, 257, 269, 0, 0,
+ 0, 0, 262, 0, 0, 256, 257, 264, 0, 0,
+ 0, 0, 0, 0, 256, 257, 0, 0, 0, 256,
+ 257, 0, 0, 0, 0, 0, 262, 0, 0, 0,
+ 0, 264, 271, 271, 0, 271, 271, 271, 272, 272,
+ 273, 273, 273, 274, 274, 274, 275, 275, 0, 275,
+ 275, 275, 276, 0, 276, 276, 276, 277, 0, 0,
+ 277, 277, 278, 278, 278, 279, 0, 0, 279, 280,
+ 280, 280, 281, 0, 0, 281, 270, 270, 270, 270,
+
+ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
+ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
+ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
+ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
+ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
+ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
+ 270
} ;
static yy_state_type yy_last_accepting_state;
@@ -767,7 +777,7 @@ static int checkImmediate(int token) {
return token;
}
-#line 771 "engines/director/lingo/lingo-lex.cpp"
+#line 781 "engines/director/lingo/lingo-lex.cpp"
#define INITIAL 0
@@ -953,7 +963,7 @@ YY_DECL
#line 82 "engines/director/lingo/lingo-lex.l"
-#line 957 "engines/director/lingo/lingo-lex.cpp"
+#line 967 "engines/director/lingo/lingo-lex.cpp"
if ( !(yy_init) )
{
@@ -1007,13 +1017,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 >= 262 )
+ if ( yy_current_state >= 271 )
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] != 660 );
+ while ( yy_base[yy_current_state] != 697 );
yy_find_action:
yy_act = yy_accept[yy_current_state];
@@ -1291,9 +1301,9 @@ YY_RULE_SETUP
count();
if (debugChannelSet(-1, kDebugLingoCompile))
- debug("LEXER: the sqrt: Read '%s'", yytext);
+ debug("LEXER: the last: Read '%s'", yytext);
- yylval.e[0] = g_lingo->_theEntities["sqrt"]->entity;
+ yylval.e[0] = g_lingo->_theEntities["last"]->entity;
yylval.e[1] = 0; // No field
return THEENTITYWITHID;
@@ -1306,6 +1316,21 @@ YY_RULE_SETUP
count();
if (debugChannelSet(-1, kDebugLingoCompile))
+ debug("LEXER: the sqrt: Read '%s'", yytext);
+
+ yylval.e[0] = g_lingo->_theEntities["sqrt"]->entity;
+ yylval.e[1] = 0; // No field
+
+ return THEENTITYWITHID;
+ }
+ YY_BREAK
+case 50:
+YY_RULE_SETUP
+#line 165 "engines/director/lingo/lingo-lex.l"
+{
+ count();
+
+ if (debugChannelSet(-1, kDebugLingoCompile))
debug("LEXER: the of: Read '%s'", yytext);
const char *ptr = &yytext[4]; // Skip 'the '
@@ -1346,9 +1371,9 @@ YY_RULE_SETUP
warning("Unhandled the entity %s", ptr);
}
YY_BREAK
-case 50:
+case 51:
YY_RULE_SETUP
-#line 197 "engines/director/lingo/lingo-lex.l"
+#line 208 "engines/director/lingo/lingo-lex.l"
{
count();
@@ -1384,9 +1409,9 @@ YY_RULE_SETUP
return THEENTITY;
}
YY_BREAK
-case 51:
+case 52:
YY_RULE_SETUP
-#line 231 "engines/director/lingo/lingo-lex.l"
+#line 242 "engines/director/lingo/lingo-lex.l"
{
count();
@@ -1410,69 +1435,69 @@ YY_RULE_SETUP
warning("Unhandled the entity %s", ptr);
}
YY_BREAK
-case 52:
+case 53:
YY_RULE_SETUP
-#line 253 "engines/director/lingo/lingo-lex.l"
+#line 264 "engines/director/lingo/lingo-lex.l"
{ count(); return tTHEN; }
YY_BREAK
-case 53:
+case 54:
YY_RULE_SETUP
-#line 254 "engines/director/lingo/lingo-lex.l"
+#line 265 "engines/director/lingo/lingo-lex.l"
{ count(); return tTO; }
YY_BREAK
-case 54:
+case 55:
YY_RULE_SETUP
-#line 255 "engines/director/lingo/lingo-lex.l"
+#line 266 "engines/director/lingo/lingo-lex.l"
{ count(); return tSPRITE; }
YY_BREAK
-case 55:
+case 56:
YY_RULE_SETUP
-#line 256 "engines/director/lingo/lingo-lex.l"
+#line 267 "engines/director/lingo/lingo-lex.l"
{ count(); return tWITH; }
YY_BREAK
-case 56:
+case 57:
YY_RULE_SETUP
-#line 257 "engines/director/lingo/lingo-lex.l"
+#line 268 "engines/director/lingo/lingo-lex.l"
{ count(); return tWITHIN; }
YY_BREAK
-case 57:
+case 58:
YY_RULE_SETUP
-#line 258 "engines/director/lingo/lingo-lex.l"
+#line 269 "engines/director/lingo/lingo-lex.l"
{ count(); return tWHEN; }
YY_BREAK
-case 58:
+case 59:
YY_RULE_SETUP
-#line 259 "engines/director/lingo/lingo-lex.l"
+#line 270 "engines/director/lingo/lingo-lex.l"
{ count(); return tWHILE; }
YY_BREAK
-case 59:
+case 60:
YY_RULE_SETUP
-#line 260 "engines/director/lingo/lingo-lex.l"
+#line 271 "engines/director/lingo/lingo-lex.l"
{ count(); return tWORD; }
YY_BREAK
-case 60:
+case 61:
YY_RULE_SETUP
-#line 262 "engines/director/lingo/lingo-lex.l"
+#line 273 "engines/director/lingo/lingo-lex.l"
{ count(); return tNEQ; }
YY_BREAK
-case 61:
+case 62:
YY_RULE_SETUP
-#line 263 "engines/director/lingo/lingo-lex.l"
+#line 274 "engines/director/lingo/lingo-lex.l"
{ count(); return tGE; }
YY_BREAK
-case 62:
+case 63:
YY_RULE_SETUP
-#line 264 "engines/director/lingo/lingo-lex.l"
+#line 275 "engines/director/lingo/lingo-lex.l"
{ count(); return tLE; }
YY_BREAK
-case 63:
+case 64:
YY_RULE_SETUP
-#line 265 "engines/director/lingo/lingo-lex.l"
+#line 276 "engines/director/lingo/lingo-lex.l"
{ count(); return tCONCAT; }
YY_BREAK
-case 64:
+case 65:
YY_RULE_SETUP
-#line 267 "engines/director/lingo/lingo-lex.l"
+#line 278 "engines/director/lingo/lingo-lex.l"
{
count();
yylval.s = new Common::String(yytext);
@@ -1516,43 +1541,43 @@ YY_RULE_SETUP
return ID;
}
YY_BREAK
-case 65:
+case 66:
YY_RULE_SETUP
-#line 309 "engines/director/lingo/lingo-lex.l"
+#line 320 "engines/director/lingo/lingo-lex.l"
{ count(); yylval.f = atof(yytext); return FLOAT; }
YY_BREAK
-case 66:
+case 67:
YY_RULE_SETUP
-#line 310 "engines/director/lingo/lingo-lex.l"
+#line 321 "engines/director/lingo/lingo-lex.l"
{ count(); yylval.i = strtol(yytext, NULL, 10); return INT; }
YY_BREAK
-case 67:
+case 68:
YY_RULE_SETUP
-#line 311 "engines/director/lingo/lingo-lex.l"
+#line 322 "engines/director/lingo/lingo-lex.l"
{ count(); return *yytext; }
YY_BREAK
-case 68:
-/* rule 68 can match eol */
+case 69:
+/* rule 69 can match eol */
YY_RULE_SETUP
-#line 312 "engines/director/lingo/lingo-lex.l"
+#line 323 "engines/director/lingo/lingo-lex.l"
{ return '\n'; }
YY_BREAK
-case 69:
+case 70:
YY_RULE_SETUP
-#line 313 "engines/director/lingo/lingo-lex.l"
+#line 324 "engines/director/lingo/lingo-lex.l"
{ count(); yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return STRING; }
YY_BREAK
-case 70:
+case 71:
YY_RULE_SETUP
-#line 314 "engines/director/lingo/lingo-lex.l"
+#line 325 "engines/director/lingo/lingo-lex.l"
YY_BREAK
-case 71:
+case 72:
YY_RULE_SETUP
-#line 316 "engines/director/lingo/lingo-lex.l"
+#line 327 "engines/director/lingo/lingo-lex.l"
ECHO;
YY_BREAK
-#line 1556 "engines/director/lingo/lingo-lex.cpp"
+#line 1581 "engines/director/lingo/lingo-lex.cpp"
case YY_STATE_EOF(INITIAL):
yyterminate();
@@ -1845,7 +1870,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 >= 262 )
+ if ( yy_current_state >= 271 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -1873,11 +1898,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 >= 262 )
+ if ( yy_current_state >= 271 )
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 == 261);
+ yy_is_jam = (yy_current_state == 270);
return yy_is_jam ? 0 : yy_current_state;
}
@@ -2515,7 +2540,7 @@ void yyfree (void * ptr )
#define YYTABLES_NAME "yytables"
-#line 316 "engines/director/lingo/lingo-lex.l"
+#line 327 "engines/director/lingo/lingo-lex.l"
diff --git a/engines/director/lingo/lingo-lex.l b/engines/director/lingo/lingo-lex.l
index ff8eb8fe72..99cc21225a 100644
--- a/engines/director/lingo/lingo-lex.l
+++ b/engines/director/lingo/lingo-lex.l
@@ -140,6 +140,17 @@ whitespace [\t ]
(?i:set) { count(); return tSET; }
(?i:starts) { count(); return tSTARTS; }
(?i:tell) { count(); return tTELL; }
+(?i:the[ \t]+last[\t ]+of[\t ]+) {
+ count();
+
+ if (debugChannelSet(-1, kDebugLingoCompile))
+ debug("LEXER: the last: Read '%s'", yytext);
+
+ yylval.e[0] = g_lingo->_theEntities["last"]->entity;
+ yylval.e[1] = 0; // No field
+
+ return THEENTITYWITHID;
+ }
(?i:the[ \t]+sqrt[\t ]+of[\t ]+) {
count();
diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index 0428f568be..8f874435f7 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -65,6 +65,7 @@ TheEntity entities[] = {
{ kTheKeyDownScript, "keyDownScript", false }, // D2 p
{ kTheKeyUpScript, "keyUpScript", false }, // D4 p
{ kTheLabelList, "labelList", false }, // D3 f
+ { kTheLast, "last", false }, // D4 f
{ kTheLastClick, "lastClick", false }, // D2 f
{ kTheLastEvent, "lastEvent", false }, // D2 f
{ kTheLastFrame, "lastFrame", false }, // D4 p
@@ -193,8 +194,8 @@ TheEntityField fields[] = {
{ kTheCast, "width", kTheWidth }, // D4 p
// Shape fields
- { kTheCast, "backColor", kTheBackColor },
- { kTheCast, "foreColor", kTheForeColor },
+ { kTheCast, "backColor", kTheBackColor }, // D4 p
+ { kTheCast, "foreColor", kTheForeColor }, // D4 p
// Digital video fields
{ kTheCast, "center", kTheCenter }, // D4 p
diff --git a/engines/director/lingo/lingo-the.h b/engines/director/lingo/lingo-the.h
index 512443abd7..173efe6bbe 100644
--- a/engines/director/lingo/lingo-the.h
+++ b/engines/director/lingo/lingo-the.h
@@ -63,6 +63,7 @@ enum TheEntityType {
kTheKeyDownScript,
kTheKeyUpScript,
kTheLabelList,
+ kTheLast,
kTheLastClick,
kTheLastEvent,
kTheLastFrame,