aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2016-07-05 10:13:42 +0200
committerEugene Sandulenko2016-08-03 23:40:36 +0200
commitd7bdda559d5c3f8f002cc23be23908cdd07a282e (patch)
tree1c7fd0edc35329cae22995774b36c8a4c1a2e2a7
parent1808dcdc3011d7e7ceed9cad98410e99ec0f61c0 (diff)
downloadscummvm-rg350-d7bdda559d5c3f8f002cc23be23908cdd07a282e.tar.gz
scummvm-rg350-d7bdda559d5c3f8f002cc23be23908cdd07a282e.tar.bz2
scummvm-rg350-d7bdda559d5c3f8f002cc23be23908cdd07a282e.zip
DIRECTOR: Lingo: Merged if and oneline if grammar
-rw-r--r--engines/director/lingo/lingo-gr.cpp770
-rw-r--r--engines/director/lingo/lingo-gr.y51
2 files changed, 409 insertions, 412 deletions
diff --git a/engines/director/lingo/lingo-gr.cpp b/engines/director/lingo/lingo-gr.cpp
index 959f0b61c0..25b242a0bd 100644
--- a/engines/director/lingo/lingo-gr.cpp
+++ b/engines/director/lingo/lingo-gr.cpp
@@ -428,18 +428,18 @@ union yyalloc
#endif
/* YYFINAL -- State number of the termination state. */
-#define YYFINAL 61
+#define YYFINAL 60
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 332
+#define YYLAST 336
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 56
/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 29
+#define YYNNTS 28
/* YYNRULES -- Number of rules. */
-#define YYNRULES 91
+#define YYNRULES 90
/* YYNRULES -- Number of states. */
-#define YYNSTATES 198
+#define YYNSTATES 195
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
@@ -489,69 +489,70 @@ static const yytype_uint8 yytranslate[] =
static const yytype_uint16 yyprhs[] =
{
0, 0, 3, 7, 9, 10, 12, 14, 16, 18,
- 20, 22, 24, 29, 34, 39, 41, 43, 45, 54,
- 66, 79, 86, 99, 107, 118, 129, 132, 134, 142,
- 148, 150, 154, 158, 161, 165, 167, 169, 170, 171,
- 172, 175, 178, 180, 182, 187, 192, 194, 196, 200,
- 204, 208, 212, 216, 220, 224, 228, 232, 235, 238,
- 242, 245, 248, 251, 253, 255, 258, 260, 264, 267,
- 270, 273, 276, 280, 283, 287, 290, 293, 295, 299,
- 302, 306, 307, 316, 317, 319, 323, 328, 329, 333,
- 334, 336
+ 20, 22, 27, 32, 37, 39, 41, 43, 52, 64,
+ 77, 86, 93, 105, 118, 130, 133, 135, 143, 149,
+ 151, 155, 159, 162, 166, 168, 170, 171, 172, 173,
+ 176, 179, 181, 183, 188, 193, 195, 197, 201, 205,
+ 209, 213, 217, 221, 225, 229, 233, 236, 239, 243,
+ 246, 249, 252, 254, 256, 259, 261, 265, 268, 271,
+ 274, 277, 281, 284, 288, 291, 294, 296, 300, 303,
+ 307, 308, 317, 318, 320, 324, 329, 330, 334, 335,
+ 337
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const yytype_int8 yyrhs[] =
{
57, 0, -1, 57, 50, 58, -1, 58, -1, -1,
- 79, -1, 74, -1, 83, -1, 59, -1, 61, -1,
- 60, -1, 1, -1, 31, 73, 22, 10, -1, 33,
- 10, 44, 73, -1, 33, 10, 35, 73, -1, 73,
- -1, 74, -1, 62, -1, 66, 51, 65, 52, 72,
- 71, 16, 32, -1, 67, 44, 73, 71, 35, 73,
- 71, 72, 71, 16, 32, -1, 67, 44, 73, 71,
- 13, 35, 73, 71, 72, 71, 16, 32, -1, 68,
- 65, 34, 70, 60, 71, -1, 68, 65, 34, 70,
- 60, 71, 50, 14, 70, 60, 71, 50, -1, 68,
- 65, 34, 72, 71, 16, 21, -1, 68, 65, 34,
- 72, 71, 14, 72, 71, 16, 21, -1, 68, 65,
- 34, 72, 71, 70, 63, 71, 16, 21, -1, 63,
- 64, -1, 64, -1, 69, 65, 34, 70, 60, 71,
- 50, -1, 69, 65, 34, 72, 71, -1, 73, -1,
- 73, 44, 73, -1, 51, 65, 52, -1, 32, 37,
- -1, 32, 36, 10, -1, 21, -1, 15, -1, -1,
- -1, -1, 72, 50, -1, 72, 60, -1, 7, -1,
- 8, -1, 9, 51, 84, 52, -1, 10, 51, 84,
- 52, -1, 10, -1, 59, -1, 73, 45, 73, -1,
- 73, 46, 73, -1, 73, 47, 73, -1, 73, 48,
- 73, -1, 73, 53, 73, -1, 73, 54, 73, -1,
- 73, 43, 73, -1, 73, 38, 73, -1, 73, 39,
- 73, -1, 45, 73, -1, 46, 73, -1, 51, 73,
- 52, -1, 25, 11, -1, 26, 10, -1, 31, 73,
- -1, 76, -1, 17, -1, 19, 75, -1, 10, -1,
- 75, 55, 10, -1, 20, 23, -1, 20, 28, -1,
- 20, 30, -1, 20, 77, -1, 20, 77, 78, -1,
- 20, 78, -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, 80,
- 70, 81, 50, 82, 72, -1, -1, 10, -1, 81,
- 55, 10, -1, 81, 50, 55, 10, -1, -1, 10,
- 70, 84, -1, -1, 73, -1, 84, 55, 73, -1
+ 78, -1, 73, -1, 82, -1, 59, -1, 60, -1,
+ 1, -1, 31, 72, 22, 10, -1, 33, 10, 44,
+ 72, -1, 33, 10, 35, 72, -1, 72, -1, 73,
+ -1, 61, -1, 65, 51, 64, 52, 71, 70, 16,
+ 32, -1, 66, 44, 72, 70, 35, 72, 70, 71,
+ 70, 16, 32, -1, 66, 44, 72, 70, 13, 35,
+ 72, 70, 71, 70, 16, 32, -1, 67, 64, 34,
+ 50, 71, 70, 16, 21, -1, 67, 64, 34, 69,
+ 60, 70, -1, 67, 64, 34, 50, 71, 70, 14,
+ 71, 70, 16, 21, -1, 67, 64, 34, 69, 60,
+ 70, 50, 14, 69, 60, 70, 50, -1, 67, 64,
+ 34, 50, 71, 70, 69, 62, 70, 16, 21, -1,
+ 62, 63, -1, 63, -1, 68, 64, 34, 69, 60,
+ 70, 50, -1, 68, 64, 34, 71, 70, -1, 72,
+ -1, 72, 44, 72, -1, 51, 64, 52, -1, 32,
+ 37, -1, 32, 36, 10, -1, 21, -1, 15, -1,
+ -1, -1, -1, 71, 50, -1, 71, 60, -1, 7,
+ -1, 8, -1, 9, 51, 83, 52, -1, 10, 51,
+ 83, 52, -1, 10, -1, 59, -1, 72, 45, 72,
+ -1, 72, 46, 72, -1, 72, 47, 72, -1, 72,
+ 48, 72, -1, 72, 53, 72, -1, 72, 54, 72,
+ -1, 72, 43, 72, -1, 72, 38, 72, -1, 72,
+ 39, 72, -1, 45, 72, -1, 46, 72, -1, 51,
+ 72, 52, -1, 25, 11, -1, 26, 10, -1, 31,
+ 72, -1, 75, -1, 17, -1, 19, 74, -1, 10,
+ -1, 74, 55, 10, -1, 20, 23, -1, 20, 28,
+ -1, 20, 30, -1, 20, 76, -1, 20, 76, 77,
+ -1, 20, 77, -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,
+ 79, 69, 80, 50, 81, 71, -1, -1, 10, -1,
+ 80, 55, 10, -1, 80, 50, 55, 10, -1, -1,
+ 10, 69, 83, -1, -1, 72, -1, 83, 55, 72,
+ -1
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
0, 93, 93, 94, 97, 98, 99, 100, 101, 102,
- 103, 104, 107, 113, 119, 127, 128, 129, 134, 145,
- 161, 175, 183, 195, 202, 211, 222, 223, 226, 232,
- 240, 241, 242, 244, 246, 252, 258, 265, 267, 269,
- 270, 271, 274, 279, 282, 288, 296, 299, 300, 301,
- 302, 303, 304, 305, 306, 307, 308, 309, 310, 311,
- 314, 315, 316, 317, 318, 320, 323, 324, 335, 336,
- 337, 338, 343, 349, 356, 357, 358, 359, 362, 363,
- 364, 392, 392, 399, 400, 401, 402, 404, 407, 415,
- 416, 417
+ 103, 106, 112, 118, 126, 127, 128, 133, 144, 160,
+ 174, 181, 189, 198, 208, 219, 220, 223, 229, 237,
+ 238, 239, 241, 243, 249, 255, 262, 264, 266, 267,
+ 268, 271, 276, 279, 285, 293, 296, 297, 298, 299,
+ 300, 301, 302, 303, 304, 305, 306, 307, 308, 311,
+ 312, 313, 314, 315, 317, 320, 321, 332, 333, 334,
+ 335, 340, 346, 353, 354, 355, 356, 359, 360, 361,
+ 389, 389, 396, 397, 398, 399, 401, 404, 412, 413,
+ 414
};
#endif
@@ -567,11 +568,10 @@ static const char *const yytname[] =
"tPUT", "tREPEAT", "tSET", "tTHEN", "tTO", "tWITH", "tWHILE", "tGE",
"tLE", "tGT", "tLT", "tEQ", "tNEQ", "'='", "'+'", "'-'", "'*'", "'/'",
"'%'", "'\\n'", "'('", "')'", "'>'", "'<'", "','", "$accept", "program",
- "programline", "asgn", "stmt", "stmtoneliner", "ifstmt", "elseifstmt",
- "elseifstmt1", "cond", "repeatwhile", "repeatwith", "if", "elseif",
- "begin", "end", "stmtlist", "expr", "func", "globallist", "gotofunc",
- "gotoframe", "gotomovie", "defn", "@1", "argdef", "argstore", "macro",
- "arglist", 0
+ "programline", "asgn", "stmt", "ifstmt", "elseifstmt", "elseifstmt1",
+ "cond", "repeatwhile", "repeatwith", "if", "elseif", "begin", "end",
+ "stmtlist", "expr", "func", "globallist", "gotofunc", "gotoframe",
+ "gotomovie", "defn", "@1", "argdef", "argstore", "macro", "arglist", 0
};
#endif
@@ -593,30 +593,30 @@ static const yytype_uint16 yytoknum[] =
static const yytype_uint8 yyr1[] =
{
0, 56, 57, 57, 58, 58, 58, 58, 58, 58,
- 58, 58, 59, 59, 59, 60, 60, 60, 60, 60,
- 60, 61, 61, 62, 62, 62, 63, 63, 64, 64,
- 65, 65, 65, 66, 67, 68, 69, 70, 71, 72,
- 72, 72, 73, 73, 73, 73, 73, 73, 73, 73,
- 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
- 74, 74, 74, 74, 74, 74, 75, 75, 76, 76,
- 76, 76, 76, 76, 77, 77, 77, 77, 78, 78,
- 78, 80, 79, 81, 81, 81, 81, 82, 83, 84,
- 84, 84
+ 58, 59, 59, 59, 60, 60, 60, 60, 60, 60,
+ 61, 61, 61, 61, 61, 62, 62, 63, 63, 64,
+ 64, 64, 65, 66, 67, 68, 69, 70, 71, 71,
+ 71, 72, 72, 72, 72, 72, 72, 72, 72, 72,
+ 72, 72, 72, 72, 72, 72, 72, 72, 72, 73,
+ 73, 73, 73, 73, 73, 74, 74, 75, 75, 75,
+ 75, 75, 75, 76, 76, 76, 76, 77, 77, 77,
+ 79, 78, 80, 80, 80, 80, 81, 82, 83, 83,
+ 83
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
static const yytype_uint8 yyr2[] =
{
0, 2, 3, 1, 0, 1, 1, 1, 1, 1,
- 1, 1, 4, 4, 4, 1, 1, 1, 8, 11,
- 12, 6, 12, 7, 10, 10, 2, 1, 7, 5,
- 1, 3, 3, 2, 3, 1, 1, 0, 0, 0,
- 2, 2, 1, 1, 4, 4, 1, 1, 3, 3,
- 3, 3, 3, 3, 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
+ 1, 4, 4, 4, 1, 1, 1, 8, 11, 12,
+ 8, 6, 11, 12, 11, 2, 1, 7, 5, 1,
+ 3, 3, 2, 3, 1, 1, 0, 0, 0, 2,
+ 2, 1, 1, 4, 4, 1, 1, 3, 3, 3,
+ 3, 3, 3, 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
@@ -624,150 +624,150 @@ static const yytype_uint8 yyr2[] =
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
- 0, 11, 42, 43, 0, 37, 64, 0, 0, 35,
+ 0, 10, 41, 42, 0, 36, 63, 0, 0, 34,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 3, 47, 10, 9, 17, 0, 0, 0, 15, 6,
- 63, 5, 7, 89, 89, 89, 66, 65, 77, 0,
- 68, 0, 69, 0, 70, 0, 71, 73, 81, 60,
- 61, 46, 0, 47, 62, 0, 33, 0, 57, 58,
- 0, 1, 0, 0, 0, 0, 0, 30, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 90, 0, 0,
- 88, 0, 75, 79, 0, 76, 0, 0, 0, 72,
- 37, 0, 0, 34, 0, 0, 59, 2, 0, 38,
- 0, 0, 37, 0, 55, 56, 54, 48, 49, 50,
- 51, 52, 53, 44, 0, 45, 67, 78, 74, 80,
- 83, 12, 14, 13, 39, 0, 32, 0, 38, 31,
- 91, 84, 0, 38, 0, 0, 38, 0, 16, 40,
- 41, 37, 87, 0, 0, 0, 38, 21, 0, 39,
- 0, 0, 0, 39, 85, 0, 38, 39, 0, 39,
- 38, 23, 36, 38, 27, 0, 86, 82, 18, 39,
- 38, 37, 0, 26, 0, 0, 38, 0, 0, 0,
- 0, 37, 0, 0, 38, 24, 25, 0, 38, 0,
- 19, 0, 38, 29, 20, 22, 0, 28
+ 3, 46, 9, 16, 0, 0, 0, 14, 6, 62,
+ 5, 7, 88, 88, 88, 65, 64, 76, 0, 67,
+ 0, 68, 0, 69, 0, 70, 72, 80, 59, 60,
+ 45, 0, 46, 61, 0, 32, 0, 56, 57, 0,
+ 1, 0, 0, 0, 0, 0, 29, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 89, 0, 0, 87,
+ 0, 74, 78, 0, 75, 0, 0, 0, 71, 36,
+ 0, 0, 33, 0, 0, 58, 2, 0, 37, 0,
+ 0, 36, 0, 54, 55, 53, 47, 48, 49, 50,
+ 51, 52, 43, 0, 44, 66, 77, 73, 79, 82,
+ 11, 13, 12, 38, 0, 31, 38, 0, 30, 90,
+ 83, 0, 37, 0, 0, 37, 37, 15, 86, 0,
+ 39, 40, 0, 0, 37, 36, 21, 0, 38, 84,
+ 0, 37, 38, 38, 0, 0, 0, 85, 81, 17,
+ 38, 37, 37, 20, 35, 37, 26, 0, 36, 37,
+ 0, 0, 25, 0, 0, 0, 0, 0, 0, 0,
+ 36, 37, 0, 18, 22, 24, 0, 37, 0, 19,
+ 37, 28, 23, 0, 27
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
{
- -1, 19, 20, 53, 140, 23, 24, 163, 164, 66,
- 25, 26, 137, 165, 35, 125, 128, 28, 138, 37,
- 30, 46, 47, 31, 90, 132, 153, 32, 78
+ -1, 19, 20, 52, 141, 23, 165, 166, 65, 24,
+ 25, 26, 167, 34, 124, 132, 27, 137, 36, 29,
+ 45, 46, 30, 89, 131, 148, 31, 77
};
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
-#define YYPACT_NINF -89
+#define YYPACT_NINF -109
static const yytype_int16 yypact[] =
{
- 138, -89, -89, -89, -46, 278, -89, 22, 96, -89,
- 39, 31, 47, 134, 49, 66, 134, 134, 134, 4,
- -89, 6, -89, -89, -89, 41, 50, 166, 266, -89,
- -89, -89, -89, 134, 134, 134, -89, 44, -89, 95,
- -89, 99, -89, 77, -89, 84, 93, -89, -89, -89,
- -89, 65, 134, -89, -2, 103, -89, -28, -20, -20,
- 242, -89, 138, 166, 134, 166, 83, 254, 134, 134,
- 134, 134, 134, 134, 134, 134, 134, 266, -31, -17,
- 63, 124, -89, -89, 125, -89, 139, 140, 108, -89,
- -89, -2, 142, -89, 134, 134, -89, -89, 97, 266,
- 101, 224, 11, 134, 266, 266, 266, 203, 203, -20,
- -20, 266, 266, -89, 134, -89, -89, -89, -89, -89,
- 144, -89, 266, 266, -89, -4, -89, 228, 183, 266,
- 266, -89, 32, 183, 121, 134, -89, 166, -89, -89,
- -89, 34, 106, 156, 152, 134, 266, 122, 143, -89,
- 160, 167, 176, -89, -89, 162, 266, -89, 181, -89,
- 183, -89, -89, 167, -89, 166, -89, 183, -89, -89,
- 183, -89, 180, -89, 182, 171, 183, 185, 228, 186,
- 189, 24, 190, 187, -89, -89, -89, 228, 183, 188,
- -89, 163, -89, -89, -89, -89, 168, -89
+ 133, -109, -109, -109, -8, 282, -109, 41, 192, -109,
+ 43, 20, 64, 70, -14, 72, 70, 70, 70, 5,
+ -109, 6, -109, -109, 45, 42, 163, 270, -109, -109,
+ -109, -109, 70, 70, 70, -109, 37, -109, 83, -109,
+ 88, -109, 75, -109, 80, -20, -109, -109, -109, -109,
+ 58, 70, -109, 221, 102, -109, -18, -4, -4, 246,
+ -109, 133, 163, 70, 163, 79, 258, 70, 70, 70,
+ 70, 70, 70, 70, 70, 70, 270, 21, 35, 62,
+ 109, -109, -109, 111, -109, 112, 113, 93, -109, -109,
+ 221, 115, -109, 70, 70, -109, -109, 74, 270, 76,
+ 234, 81, 70, 270, 270, 270, -6, -6, -4, -4,
+ 270, 270, -109, 70, -109, -109, -109, -109, -109, 122,
+ -109, 270, 270, -109, -11, -109, -109, 225, 270, 270,
+ -109, -25, 180, 100, 70, 180, -109, -109, 82, 134,
+ -109, -109, 129, 70, 270, 22, 96, 137, -109, -109,
+ 116, 270, -109, -109, 128, 136, 141, -109, 180, -109,
+ -109, 180, 180, -109, -109, 136, -109, 163, -109, 180,
+ 140, 144, -109, 145, 135, 225, 147, 142, 146, 155,
+ 4, -109, 148, -109, -109, -109, 225, 180, 118, -109,
+ -109, -109, -109, 127, -109
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
- -89, -89, 159, 10, 0, -89, -89, -89, 59, -62,
- -89, -89, 15, -89, -88, -55, -69, -5, 17, -89,
- -89, -89, 177, -89, -89, -89, -89, -89, 62
+ -109, -109, 120, 10, 0, -109, -109, 17, -61, -109,
+ -109, -109, -109, -85, -51, -108, -5, 14, -109, -109,
+ -109, 150, -109, -109, -109, -109, -109, 71
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
number is the opposite. If zero, do what YYDEFACT says.
If YYTABLE_NINF, syntax error. */
-#define YYTABLE_NINF -47
+#define YYTABLE_NINF -46
static const yytype_int16 yytable[] =
{
- 22, 98, 120, 100, 61, 33, -8, 94, 54, 134,
- 21, 58, 59, 60, 127, 27, 95, 29, 68, 69,
- 92, 113, 67, 70, 114, -39, -39, -39, 77, 77,
- 77, 135, 36, 75, 76, 115, 68, 69, 114, -39,
- -39, 70, 49, 71, 72, 73, 74, 91, 149, 48,
- 150, 75, 76, 151, 62, 133, -8, 50, 67, 99,
- 101, -39, 22, 104, 105, 106, 107, 108, 109, 110,
- 111, 112, 21, 141, -39, 148, 57, 27, 144, 29,
- 160, 147, 142, 178, 167, 55, 56, 143, 170, 122,
- 123, 157, 63, 187, 64, 85, 79, 80, 129, 81,
- 176, 169, 86, 175, 84, 172, 82, 38, 174, 130,
- 83, 87, 188, 93, 39, 177, 34, 102, 114, 40,
- 41, 182, 43, 41, 42, 43, 44, 136, 88, 191,
- 146, 45, 67, 193, 116, 87, 117, 196, -4, 1,
- 156, 2, 3, 4, 51, 2, 3, 4, 5, 124,
- 118, 119, 121, 126, 131, 6, 145, 7, 8, 9,
- 67, 152, 10, 11, 12, 52, 154, 15, 155, 13,
- 14, 15, 158, 2, 3, 4, 51, 159, 184, 16,
- 17, 161, 162, 16, 17, 18, 166, 192, -4, 18,
- 2, 3, 4, 51, 168, 171, 179, 52, 180, 15,
- 6, 183, 7, 8, 9, 181, 189, 185, 11, 12,
- 186, 16, 17, 195, 13, 14, 15, 65, 197, 190,
- 194, 97, 173, 89, 0, 0, 0, 0, 16, 17,
- 0, 0, 0, 139, 18, 2, 3, 4, 51, 0,
- 0, 68, 69, 0, 0, 6, 70, 7, 8, 9,
- 73, 74, 0, 11, 12, 0, 75, 76, 0, 13,
- 14, 15, 68, 69, 0, 0, 0, 70, 103, 71,
- 72, 73, 74, 16, 17, 0, 96, 75, 76, 18,
- 68, 69, 0, 0, 0, 70, 0, 71, 72, 73,
- 74, 0, 68, 69, 96, 75, 76, 70, 103, 71,
- 72, 73, 74, 0, 68, 69, 0, 75, 76, 70,
- 0, 71, 72, 73, 74, 0, -46, -46, 0, 75,
- 76, -46, 0, 0, 0, -46, -46, 0, 0, 34,
- 0, -46, -46
+ 22, 97, 133, 99, 119, 60, -8, 40, 53, 42,
+ 21, 57, 58, 59, 28, 87, 127, 93, 135, -38,
+ -38, 66, 54, 55, 134, 138, 94, 76, 76, 76,
+ 139, 48, 67, 68, 67, 68, 153, 69, 154, 69,
+ 158, 72, 73, 32, 161, 162, 90, 74, 75, 74,
+ 75, 35, 169, 47, -38, 61, -8, 66, 98, 100,
+ 155, 22, 103, 104, 105, 106, 107, 108, 109, 110,
+ 111, 21, 187, 112, 49, 28, 113, 2, 3, 4,
+ 50, 142, 56, 175, 145, 146, 63, 114, 121, 122,
+ 113, 84, 80, 152, 81, 186, 62, 128, 85, 82,
+ 160, 51, 83, 15, 78, 79, 174, 86, 129, 33,
+ 170, 171, 92, 101, 173, 16, 17, 113, 176, 115,
+ 86, 18, 116, 117, 118, 120, 123, 136, 125, 144,
+ 188, 126, 130, -4, 1, 143, 191, 147, 151, 193,
+ 2, 3, 4, 5, 149, 150, 156, 157, 159, 163,
+ 6, 164, 7, 8, 9, 168, 177, 10, 11, 12,
+ 178, 179, 66, 182, 13, 14, 15, 184, 192, 180,
+ 2, 3, 4, 50, 183, 181, 185, 194, 16, 17,
+ 189, 96, 172, -4, 18, 0, 190, 2, 3, 4,
+ 50, 0, 0, 0, 51, 88, 15, 6, 0, 7,
+ 8, 9, 0, 37, 0, 11, 12, 0, 16, 17,
+ 38, 13, 14, 15, 64, 39, 0, 0, 0, 40,
+ 41, 42, 43, 0, 0, 16, 17, 44, 0, 0,
+ 140, 18, 2, 3, 4, 50, 0, 0, 0, 0,
+ 0, 0, 6, 91, 7, 8, 9, 0, 0, 0,
+ 11, 12, 0, 0, 0, 0, 13, 14, 15, 67,
+ 68, 0, 0, 0, 69, 0, 70, 71, 72, 73,
+ 16, 17, 67, 68, 74, 75, 18, 69, 102, 70,
+ 71, 72, 73, 0, 67, 68, 95, 74, 75, 69,
+ 0, 70, 71, 72, 73, 0, 67, 68, 95, 74,
+ 75, 69, 102, 70, 71, 72, 73, 0, 67, 68,
+ 0, 74, 75, 69, 0, 70, 71, 72, 73, 0,
+ -45, -45, 0, 74, 75, -45, 0, 0, 0, -45,
+ -45, 0, 0, 33, 0, -45, -45
};
static const yytype_int16 yycheck[] =
{
- 0, 63, 90, 65, 0, 51, 0, 35, 13, 13,
- 0, 16, 17, 18, 102, 0, 44, 0, 38, 39,
- 22, 52, 27, 43, 55, 14, 15, 16, 33, 34,
- 35, 35, 10, 53, 54, 52, 38, 39, 55, 15,
- 16, 43, 11, 45, 46, 47, 48, 52, 14, 10,
- 16, 53, 54, 141, 50, 124, 50, 10, 63, 64,
- 65, 50, 62, 68, 69, 70, 71, 72, 73, 74,
- 75, 76, 62, 128, 50, 137, 10, 62, 133, 62,
- 149, 136, 50, 171, 153, 36, 37, 55, 157, 94,
- 95, 146, 51, 181, 44, 11, 34, 35, 103, 55,
- 169, 156, 18, 165, 27, 160, 11, 11, 163, 114,
- 11, 27, 181, 10, 18, 170, 51, 34, 55, 23,
- 27, 176, 29, 27, 28, 29, 30, 127, 35, 184,
- 135, 35, 137, 188, 10, 27, 11, 192, 0, 1,
- 145, 7, 8, 9, 10, 7, 8, 9, 10, 52,
- 11, 11, 10, 52, 10, 17, 35, 19, 20, 21,
- 165, 55, 24, 25, 26, 31, 10, 33, 16, 31,
- 32, 33, 50, 7, 8, 9, 10, 34, 178, 45,
- 46, 21, 15, 45, 46, 51, 10, 187, 50, 51,
- 7, 8, 9, 10, 32, 14, 16, 31, 16, 33,
- 17, 16, 19, 20, 21, 34, 16, 21, 25, 26,
- 21, 45, 46, 50, 31, 32, 33, 51, 50, 32,
- 32, 62, 163, 46, -1, -1, -1, -1, 45, 46,
- -1, -1, -1, 50, 51, 7, 8, 9, 10, -1,
- -1, 38, 39, -1, -1, 17, 43, 19, 20, 21,
- 47, 48, -1, 25, 26, -1, 53, 54, -1, 31,
- 32, 33, 38, 39, -1, -1, -1, 43, 44, 45,
- 46, 47, 48, 45, 46, -1, 52, 53, 54, 51,
- 38, 39, -1, -1, -1, 43, -1, 45, 46, 47,
- 48, -1, 38, 39, 52, 53, 54, 43, 44, 45,
- 46, 47, 48, -1, 38, 39, -1, 53, 54, 43,
- -1, 45, 46, 47, 48, -1, 38, 39, -1, 53,
- 54, 43, -1, -1, -1, 47, 48, -1, -1, 51,
- -1, 53, 54
+ 0, 62, 13, 64, 89, 0, 0, 27, 13, 29,
+ 0, 16, 17, 18, 0, 35, 101, 35, 126, 15,
+ 16, 26, 36, 37, 35, 50, 44, 32, 33, 34,
+ 55, 11, 38, 39, 38, 39, 14, 43, 16, 43,
+ 148, 47, 48, 51, 152, 153, 51, 53, 54, 53,
+ 54, 10, 160, 10, 50, 50, 50, 62, 63, 64,
+ 145, 61, 67, 68, 69, 70, 71, 72, 73, 74,
+ 75, 61, 180, 52, 10, 61, 55, 7, 8, 9,
+ 10, 132, 10, 168, 135, 136, 44, 52, 93, 94,
+ 55, 11, 55, 144, 11, 180, 51, 102, 18, 11,
+ 151, 31, 27, 33, 33, 34, 167, 27, 113, 51,
+ 161, 162, 10, 34, 165, 45, 46, 55, 169, 10,
+ 27, 51, 11, 11, 11, 10, 52, 127, 52, 134,
+ 181, 50, 10, 0, 1, 35, 187, 55, 143, 190,
+ 7, 8, 9, 10, 10, 16, 50, 10, 32, 21,
+ 17, 15, 19, 20, 21, 14, 16, 24, 25, 26,
+ 16, 16, 167, 16, 31, 32, 33, 21, 50, 34,
+ 7, 8, 9, 10, 32, 175, 21, 50, 45, 46,
+ 32, 61, 165, 50, 51, -1, 186, 7, 8, 9,
+ 10, -1, -1, -1, 31, 45, 33, 17, -1, 19,
+ 20, 21, -1, 11, -1, 25, 26, -1, 45, 46,
+ 18, 31, 32, 33, 51, 23, -1, -1, -1, 27,
+ 28, 29, 30, -1, -1, 45, 46, 35, -1, -1,
+ 50, 51, 7, 8, 9, 10, -1, -1, -1, -1,
+ -1, -1, 17, 22, 19, 20, 21, -1, -1, -1,
+ 25, 26, -1, -1, -1, -1, 31, 32, 33, 38,
+ 39, -1, -1, -1, 43, -1, 45, 46, 47, 48,
+ 45, 46, 38, 39, 53, 54, 51, 43, 44, 45,
+ 46, 47, 48, -1, 38, 39, 52, 53, 54, 43,
+ -1, 45, 46, 47, 48, -1, 38, 39, 52, 53,
+ 54, 43, 44, 45, 46, 47, 48, -1, 38, 39,
+ -1, 53, 54, 43, -1, 45, 46, 47, 48, -1,
+ 38, 39, -1, 53, 54, 43, -1, -1, -1, 47,
+ 48, -1, -1, 51, -1, 53, 54
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
@@ -776,24 +776,24 @@ static const yytype_uint8 yystos[] =
{
0, 1, 7, 8, 9, 10, 17, 19, 20, 21,
24, 25, 26, 31, 32, 33, 45, 46, 51, 57,
- 58, 59, 60, 61, 62, 66, 67, 68, 73, 74,
- 76, 79, 83, 51, 51, 70, 10, 75, 11, 18,
- 23, 27, 28, 29, 30, 35, 77, 78, 10, 11,
- 10, 10, 31, 59, 73, 36, 37, 10, 73, 73,
- 73, 0, 50, 51, 44, 51, 65, 73, 38, 39,
- 43, 45, 46, 47, 48, 53, 54, 73, 84, 84,
- 84, 55, 11, 11, 27, 11, 18, 27, 35, 78,
- 80, 73, 22, 10, 35, 44, 52, 58, 65, 73,
- 65, 73, 34, 44, 73, 73, 73, 73, 73, 73,
- 73, 73, 73, 52, 55, 52, 10, 11, 11, 11,
- 70, 10, 73, 73, 52, 71, 52, 70, 72, 73,
- 73, 10, 81, 72, 13, 35, 60, 68, 74, 50,
- 60, 71, 50, 55, 71, 35, 73, 71, 65, 14,
- 16, 70, 55, 82, 10, 16, 73, 71, 50, 34,
- 72, 21, 15, 63, 64, 69, 10, 72, 32, 71,
- 72, 14, 71, 64, 71, 65, 72, 71, 70, 16,
- 16, 34, 71, 16, 60, 21, 21, 70, 72, 16,
- 32, 71, 60, 71, 32, 50, 71, 50
+ 58, 59, 60, 61, 65, 66, 67, 72, 73, 75,
+ 78, 82, 51, 51, 69, 10, 74, 11, 18, 23,
+ 27, 28, 29, 30, 35, 76, 77, 10, 11, 10,
+ 10, 31, 59, 72, 36, 37, 10, 72, 72, 72,
+ 0, 50, 51, 44, 51, 64, 72, 38, 39, 43,
+ 45, 46, 47, 48, 53, 54, 72, 83, 83, 83,
+ 55, 11, 11, 27, 11, 18, 27, 35, 77, 79,
+ 72, 22, 10, 35, 44, 52, 58, 64, 72, 64,
+ 72, 34, 44, 72, 72, 72, 72, 72, 72, 72,
+ 72, 72, 52, 55, 52, 10, 11, 11, 11, 69,
+ 10, 72, 72, 52, 70, 52, 50, 69, 72, 72,
+ 10, 80, 71, 13, 35, 71, 60, 73, 50, 55,
+ 50, 60, 70, 35, 72, 70, 70, 55, 81, 10,
+ 16, 72, 70, 14, 16, 69, 50, 10, 71, 32,
+ 70, 71, 71, 21, 15, 62, 63, 68, 14, 71,
+ 70, 70, 63, 70, 64, 69, 70, 16, 16, 16,
+ 34, 60, 16, 32, 21, 21, 69, 71, 70, 32,
+ 60, 70, 50, 70, 50
};
#define yyerrok (yyerrstatus = 0)
@@ -1612,13 +1612,13 @@ yyreduce:
{ g_lingo->code1(g_lingo->c_xpop); ;}
break;
- case 11:
-#line 104 "engines/director/lingo/lingo-gr.y"
+ case 10:
+#line 103 "engines/director/lingo/lingo-gr.y"
{ yyerrok; ;}
break;
- case 12:
-#line 107 "engines/director/lingo/lingo-gr.y"
+ case 11:
+#line 106 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_varpush);
g_lingo->codeString((yyvsp[(4) - (4)].s)->c_str());
@@ -1627,8 +1627,8 @@ yyreduce:
delete (yyvsp[(4) - (4)].s); ;}
break;
- case 13:
-#line 113 "engines/director/lingo/lingo-gr.y"
+ case 12:
+#line 112 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_varpush);
g_lingo->codeString((yyvsp[(2) - (4)].s)->c_str());
@@ -1637,8 +1637,8 @@ yyreduce:
delete (yyvsp[(2) - (4)].s); ;}
break;
- case 14:
-#line 119 "engines/director/lingo/lingo-gr.y"
+ case 13:
+#line 118 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_varpush);
g_lingo->codeString((yyvsp[(2) - (4)].s)->c_str());
@@ -1647,13 +1647,13 @@ yyreduce:
delete (yyvsp[(2) - (4)].s); ;}
break;
- case 15:
-#line 127 "engines/director/lingo/lingo-gr.y"
+ case 14:
+#line 126 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_xpop); ;}
break;
- case 18:
-#line 134 "engines/director/lingo/lingo-gr.y"
+ case 17:
+#line 133 "engines/director/lingo/lingo-gr.y"
{
inst body = 0, end = 0;
WRITE_UINT32(&body, (yyvsp[(5) - (8)].code));
@@ -1662,8 +1662,8 @@ yyreduce:
(*g_lingo->_currentScript)[(yyvsp[(1) - (8)].code) + 2] = end; ;}
break;
- case 19:
-#line 145 "engines/director/lingo/lingo-gr.y"
+ case 18:
+#line 144 "engines/director/lingo/lingo-gr.y"
{
inst init = 0, finish = 0, body = 0, end = 0, inc = 0;
WRITE_UINT32(&init, (yyvsp[(3) - (11)].code));
@@ -1678,8 +1678,8 @@ yyreduce:
(*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 5] = end; ;}
break;
- case 20:
-#line 161 "engines/director/lingo/lingo-gr.y"
+ case 19:
+#line 160 "engines/director/lingo/lingo-gr.y"
{
inst init = 0, finish = 0, body = 0, end = 0, inc = 0;
WRITE_UINT32(&init, (yyvsp[(3) - (12)].code));
@@ -1694,20 +1694,44 @@ yyreduce:
(*g_lingo->_currentScript)[(yyvsp[(1) - (12)].code) + 5] = end; ;}
break;
- case 21:
-#line 175 "engines/director/lingo/lingo-gr.y"
+ case 20:
+#line 174 "engines/director/lingo/lingo-gr.y"
{
inst then = 0, end = 0;
- WRITE_UINT32(&then, (yyvsp[(4) - (6)].code));
- WRITE_UINT32(&end, (yyvsp[(6) - (6)].code));
- (*g_lingo->_currentScript)[(yyvsp[(1) - (6)].code) + 1] = then; /* thenpart */
- (*g_lingo->_currentScript)[(yyvsp[(1) - (6)].code) + 3] = end; /* end, if cond fails */
-
+ WRITE_UINT32(&then, (yyvsp[(5) - (8)].code));
+ WRITE_UINT32(&end, (yyvsp[(6) - (8)].code));
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (8)].code) + 1] = then; /* thenpart */
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (8)].code) + 3] = end; /* end, if cond fails */
g_lingo->processIf(0, 0); ;}
break;
+ case 21:
+#line 181 "engines/director/lingo/lingo-gr.y"
+ {
+ inst then = 0, end = 0;
+ WRITE_UINT32(&then, (yyvsp[(4) - (6)].code));
+ WRITE_UINT32(&end, (yyvsp[(6) - (6)].code));
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (6)].code) + 1] = then; /* thenpart */
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (6)].code) + 3] = end; /* end, if cond fails */
+
+ g_lingo->processIf(0, 0); ;}
+ break;
+
case 22:
-#line 183 "engines/director/lingo/lingo-gr.y"
+#line 189 "engines/director/lingo/lingo-gr.y"
+ {
+ inst then = 0, else1 = 0, end = 0;
+ WRITE_UINT32(&then, (yyvsp[(5) - (11)].code));
+ WRITE_UINT32(&else1, (yyvsp[(8) - (11)].code));
+ WRITE_UINT32(&end, (yyvsp[(9) - (11)].code));
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 1] = then; /* thenpart */
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 2] = else1; /* elsepart */
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 3] = end; /* end, if cond fails */
+ g_lingo->processIf(0, 0); ;}
+ break;
+
+ case 23:
+#line 198 "engines/director/lingo/lingo-gr.y"
{
inst then = 0, else1 = 0, end = 0;
WRITE_UINT32(&then, (yyvsp[(4) - (12)].code));
@@ -1720,45 +1744,21 @@ yyreduce:
g_lingo->processIf(0, 0); ;}
break;
- case 23:
-#line 195 "engines/director/lingo/lingo-gr.y"
- {
- inst then = 0, end = 0;
- WRITE_UINT32(&then, (yyvsp[(4) - (7)].code));
- WRITE_UINT32(&end, (yyvsp[(5) - (7)].code));
- (*g_lingo->_currentScript)[(yyvsp[(1) - (7)].code) + 1] = then; /* thenpart */
- (*g_lingo->_currentScript)[(yyvsp[(1) - (7)].code) + 3] = end; /* end, if cond fails */
- g_lingo->processIf(0, 0); ;}
- break;
-
case 24:
-#line 202 "engines/director/lingo/lingo-gr.y"
- {
- inst then = 0, else1 = 0, end = 0;
- WRITE_UINT32(&then, (yyvsp[(4) - (10)].code));
- WRITE_UINT32(&else1, (yyvsp[(7) - (10)].code));
- WRITE_UINT32(&end, (yyvsp[(8) - (10)].code));
- (*g_lingo->_currentScript)[(yyvsp[(1) - (10)].code) + 1] = then; /* thenpart */
- (*g_lingo->_currentScript)[(yyvsp[(1) - (10)].code) + 2] = else1; /* elsepart */
- (*g_lingo->_currentScript)[(yyvsp[(1) - (10)].code) + 3] = end; /* end, if cond fails */
- g_lingo->processIf(0, 0); ;}
- break;
-
- case 25:
-#line 211 "engines/director/lingo/lingo-gr.y"
+#line 208 "engines/director/lingo/lingo-gr.y"
{
inst then = 0, else1 = 0, end = 0;
- WRITE_UINT32(&then, (yyvsp[(4) - (10)].code));
- WRITE_UINT32(&else1, (yyvsp[(6) - (10)].code));
- WRITE_UINT32(&end, (yyvsp[(8) - (10)].code));
- (*g_lingo->_currentScript)[(yyvsp[(1) - (10)].code) + 1] = then; /* thenpart */
- (*g_lingo->_currentScript)[(yyvsp[(1) - (10)].code) + 2] = else1; /* elsepart */
- (*g_lingo->_currentScript)[(yyvsp[(1) - (10)].code) + 3] = end; /* end, if cond fails */
- g_lingo->processIf(0, (yyvsp[(8) - (10)].code)); ;}
+ WRITE_UINT32(&then, (yyvsp[(5) - (11)].code));
+ WRITE_UINT32(&else1, (yyvsp[(7) - (11)].code));
+ WRITE_UINT32(&end, (yyvsp[(9) - (11)].code));
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 1] = then; /* thenpart */
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 2] = else1; /* elsepart */
+ (*g_lingo->_currentScript)[(yyvsp[(1) - (11)].code) + 3] = end; /* end, if cond fails */
+ g_lingo->processIf(0, (yyvsp[(9) - (11)].code)); ;}
break;
- case 28:
-#line 226 "engines/director/lingo/lingo-gr.y"
+ case 27:
+#line 223 "engines/director/lingo/lingo-gr.y"
{
inst then = 0;
WRITE_UINT32(&then, (yyvsp[(4) - (7)].code));
@@ -1767,8 +1767,8 @@ yyreduce:
g_lingo->codeLabel((yyvsp[(1) - (7)].code)); ;}
break;
- case 29:
-#line 232 "engines/director/lingo/lingo-gr.y"
+ case 28:
+#line 229 "engines/director/lingo/lingo-gr.y"
{
inst then = 0;
WRITE_UINT32(&then, (yyvsp[(4) - (5)].code));
@@ -1777,23 +1777,23 @@ yyreduce:
g_lingo->codeLabel((yyvsp[(1) - (5)].code)); ;}
break;
- case 30:
-#line 240 "engines/director/lingo/lingo-gr.y"
+ case 29:
+#line 237 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(STOP); ;}
break;
- case 31:
-#line 241 "engines/director/lingo/lingo-gr.y"
+ case 30:
+#line 238 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code2(g_lingo->c_eq, STOP); ;}
break;
- case 33:
-#line 244 "engines/director/lingo/lingo-gr.y"
+ case 32:
+#line 241 "engines/director/lingo/lingo-gr.y"
{ (yyval.code) = g_lingo->code3(g_lingo->c_repeatwhilecode, STOP, STOP); ;}
break;
- case 34:
-#line 246 "engines/director/lingo/lingo-gr.y"
+ case 33:
+#line 243 "engines/director/lingo/lingo-gr.y"
{
(yyval.code) = g_lingo->code3(g_lingo->c_repeatwithcode, STOP, STOP);
g_lingo->code3(STOP, STOP, STOP);
@@ -1801,8 +1801,8 @@ yyreduce:
delete (yyvsp[(3) - (3)].s); ;}
break;
- case 35:
-#line 252 "engines/director/lingo/lingo-gr.y"
+ case 34:
+#line 249 "engines/director/lingo/lingo-gr.y"
{
(yyval.code) = g_lingo->code1(g_lingo->c_ifcode);
g_lingo->code3(STOP, STOP, STOP);
@@ -1810,8 +1810,8 @@ yyreduce:
g_lingo->codeLabel(0); ;}
break;
- case 36:
-#line 258 "engines/director/lingo/lingo-gr.y"
+ case 35:
+#line 255 "engines/director/lingo/lingo-gr.y"
{
inst skipEnd;
WRITE_UINT32(&skipEnd, 1); // We have to skip end to avoid multiple executions
@@ -1820,23 +1820,23 @@ yyreduce:
g_lingo->code1(skipEnd); ;}
break;
- case 37:
-#line 265 "engines/director/lingo/lingo-gr.y"
+ case 36:
+#line 262 "engines/director/lingo/lingo-gr.y"
{ (yyval.code) = g_lingo->_currentScript->size(); ;}
break;
- case 38:
-#line 267 "engines/director/lingo/lingo-gr.y"
+ case 37:
+#line 264 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(STOP); (yyval.code) = g_lingo->_currentScript->size(); ;}
break;
- case 39:
-#line 269 "engines/director/lingo/lingo-gr.y"
+ case 38:
+#line 266 "engines/director/lingo/lingo-gr.y"
{ (yyval.code) = g_lingo->_currentScript->size(); ;}
break;
- case 42:
-#line 274 "engines/director/lingo/lingo-gr.y"
+ case 41:
+#line 271 "engines/director/lingo/lingo-gr.y"
{
(yyval.code) = g_lingo->code1(g_lingo->c_constpush);
inst i = 0;
@@ -1844,15 +1844,15 @@ yyreduce:
g_lingo->code1(i); ;}
break;
- case 43:
-#line 279 "engines/director/lingo/lingo-gr.y"
+ case 42:
+#line 276 "engines/director/lingo/lingo-gr.y"
{
(yyval.code) = g_lingo->code1(g_lingo->c_fconstpush);
g_lingo->codeFloat((yyvsp[(1) - (1)].f)); ;}
break;
- case 44:
-#line 282 "engines/director/lingo/lingo-gr.y"
+ case 43:
+#line 279 "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));
@@ -1861,8 +1861,8 @@ yyreduce:
delete (yyvsp[(1) - (4)].s); ;}
break;
- case 45:
-#line 288 "engines/director/lingo/lingo-gr.y"
+ case 44:
+#line 285 "engines/director/lingo/lingo-gr.y"
{
(yyval.code) = g_lingo->code1(g_lingo->c_call);
g_lingo->codeString((yyvsp[(1) - (4)].s)->c_str());
@@ -1873,121 +1873,121 @@ yyreduce:
delete (yyvsp[(1) - (4)].s); ;}
break;
- case 46:
-#line 296 "engines/director/lingo/lingo-gr.y"
+ case 45:
+#line 293 "engines/director/lingo/lingo-gr.y"
{
(yyval.code) = g_lingo->codeId(*(yyvsp[(1) - (1)].s));
delete (yyvsp[(1) - (1)].s); ;}
break;
- case 48:
-#line 300 "engines/director/lingo/lingo-gr.y"
+ case 47:
+#line 297 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_add); ;}
break;
- case 49:
-#line 301 "engines/director/lingo/lingo-gr.y"
+ case 48:
+#line 298 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_sub); ;}
break;
- case 50:
-#line 302 "engines/director/lingo/lingo-gr.y"
+ case 49:
+#line 299 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_mul); ;}
break;
- case 51:
-#line 303 "engines/director/lingo/lingo-gr.y"
+ case 50:
+#line 300 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_div); ;}
break;
- case 52:
-#line 304 "engines/director/lingo/lingo-gr.y"
+ case 51:
+#line 301 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_gt); ;}
break;
- case 53:
-#line 305 "engines/director/lingo/lingo-gr.y"
+ case 52:
+#line 302 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_lt); ;}
break;
- case 54:
-#line 306 "engines/director/lingo/lingo-gr.y"
+ case 53:
+#line 303 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_neq); ;}
break;
- case 55:
-#line 307 "engines/director/lingo/lingo-gr.y"
+ case 54:
+#line 304 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_ge); ;}
break;
- case 56:
-#line 308 "engines/director/lingo/lingo-gr.y"
+ case 55:
+#line 305 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_le); ;}
break;
- case 57:
-#line 309 "engines/director/lingo/lingo-gr.y"
+ case 56:
+#line 306 "engines/director/lingo/lingo-gr.y"
{ (yyval.code) = (yyvsp[(2) - (2)].code); ;}
break;
- case 58:
-#line 310 "engines/director/lingo/lingo-gr.y"
+ case 57:
+#line 307 "engines/director/lingo/lingo-gr.y"
{ (yyval.code) = (yyvsp[(2) - (2)].code); g_lingo->code1(g_lingo->c_negate); ;}
break;
- case 59:
-#line 311 "engines/director/lingo/lingo-gr.y"
+ case 58:
+#line 308 "engines/director/lingo/lingo-gr.y"
{ (yyval.code) = (yyvsp[(2) - (3)].code); ;}
break;
- case 60:
-#line 314 "engines/director/lingo/lingo-gr.y"
+ case 59:
+#line 311 "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 61:
-#line 315 "engines/director/lingo/lingo-gr.y"
+ case 60:
+#line 312 "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 62:
-#line 316 "engines/director/lingo/lingo-gr.y"
+ case 61:
+#line 313 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_printtop); ;}
break;
- case 64:
-#line 318 "engines/director/lingo/lingo-gr.y"
+ case 63:
+#line 315 "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 66:
-#line 323 "engines/director/lingo/lingo-gr.y"
+ case 65:
+#line 320 "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 67:
-#line 324 "engines/director/lingo/lingo-gr.y"
+ case 66:
+#line 321 "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 68:
-#line 335 "engines/director/lingo/lingo-gr.y"
+ case 67:
+#line 332 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_gotoloop); ;}
break;
- case 69:
-#line 336 "engines/director/lingo/lingo-gr.y"
+ case 68:
+#line 333 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_gotonext); ;}
break;
- case 70:
-#line 337 "engines/director/lingo/lingo-gr.y"
+ case 69:
+#line 334 "engines/director/lingo/lingo-gr.y"
{ g_lingo->code1(g_lingo->c_gotoprevious); ;}
break;
- case 71:
-#line 338 "engines/director/lingo/lingo-gr.y"
+ case 70:
+#line 335 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_goto);
g_lingo->codeString((yyvsp[(2) - (2)].s)->c_str());
@@ -1995,8 +1995,8 @@ yyreduce:
delete (yyvsp[(2) - (2)].s); ;}
break;
- case 72:
-#line 343 "engines/director/lingo/lingo-gr.y"
+ case 71:
+#line 340 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_goto);
g_lingo->codeString((yyvsp[(2) - (3)].s)->c_str());
@@ -2005,8 +2005,8 @@ yyreduce:
delete (yyvsp[(3) - (3)].s); ;}
break;
- case 73:
-#line 349 "engines/director/lingo/lingo-gr.y"
+ case 72:
+#line 346 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_goto);
g_lingo->codeString("");
@@ -2014,48 +2014,48 @@ yyreduce:
delete (yyvsp[(2) - (2)].s); ;}
break;
- case 74:
-#line 356 "engines/director/lingo/lingo-gr.y"
+ case 73:
+#line 353 "engines/director/lingo/lingo-gr.y"
{ (yyval.s) = (yyvsp[(3) - (3)].s); ;}
break;
- case 75:
-#line 357 "engines/director/lingo/lingo-gr.y"
+ case 74:
+#line 354 "engines/director/lingo/lingo-gr.y"
{ (yyval.s) = (yyvsp[(2) - (2)].s); ;}
break;
- case 76:
-#line 358 "engines/director/lingo/lingo-gr.y"
+ case 75:
+#line 355 "engines/director/lingo/lingo-gr.y"
{ (yyval.s) = (yyvsp[(2) - (2)].s); ;}
break;
- case 77:
-#line 359 "engines/director/lingo/lingo-gr.y"
+ case 76:
+#line 356 "engines/director/lingo/lingo-gr.y"
{ (yyval.s) = (yyvsp[(1) - (1)].s); ;}
break;
- case 78:
-#line 362 "engines/director/lingo/lingo-gr.y"
+ case 77:
+#line 359 "engines/director/lingo/lingo-gr.y"
{ (yyval.s) = (yyvsp[(3) - (3)].s); ;}
break;
- case 79:
-#line 363 "engines/director/lingo/lingo-gr.y"
+ case 78:
+#line 360 "engines/director/lingo/lingo-gr.y"
{ (yyval.s) = (yyvsp[(2) - (2)].s); ;}
break;
- case 80:
-#line 364 "engines/director/lingo/lingo-gr.y"
+ case 79:
+#line 361 "engines/director/lingo/lingo-gr.y"
{ (yyval.s) = (yyvsp[(3) - (3)].s); ;}
break;
- case 81:
-#line 392 "engines/director/lingo/lingo-gr.y"
+ case 80:
+#line 389 "engines/director/lingo/lingo-gr.y"
{ g_lingo->_indef = true; ;}
break;
- case 82:
-#line 393 "engines/director/lingo/lingo-gr.y"
+ case 81:
+#line 390 "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);
@@ -2063,33 +2063,33 @@ yyreduce:
g_lingo->_indef = false; ;}
break;
- case 83:
-#line 399 "engines/director/lingo/lingo-gr.y"
+ case 82:
+#line 396 "engines/director/lingo/lingo-gr.y"
{ (yyval.narg) = 0; ;}
break;
- case 84:
-#line 400 "engines/director/lingo/lingo-gr.y"
+ case 83:
+#line 397 "engines/director/lingo/lingo-gr.y"
{ g_lingo->codeArg((yyvsp[(1) - (1)].s)); (yyval.narg) = 1; ;}
break;
- case 85:
-#line 401 "engines/director/lingo/lingo-gr.y"
+ case 84:
+#line 398 "engines/director/lingo/lingo-gr.y"
{ g_lingo->codeArg((yyvsp[(3) - (3)].s)); (yyval.narg) = (yyvsp[(1) - (3)].narg) + 1; ;}
break;
- case 86:
-#line 402 "engines/director/lingo/lingo-gr.y"
+ case 85:
+#line 399 "engines/director/lingo/lingo-gr.y"
{ g_lingo->codeArg((yyvsp[(4) - (4)].s)); (yyval.narg) = (yyvsp[(1) - (4)].narg) + 1; ;}
break;
- case 87:
-#line 404 "engines/director/lingo/lingo-gr.y"
+ case 86:
+#line 401 "engines/director/lingo/lingo-gr.y"
{ g_lingo->codeArgStore(); ;}
break;
- case 88:
-#line 407 "engines/director/lingo/lingo-gr.y"
+ case 87:
+#line 404 "engines/director/lingo/lingo-gr.y"
{
g_lingo->code1(g_lingo->c_call);
g_lingo->codeString((yyvsp[(1) - (3)].s)->c_str());
@@ -2098,18 +2098,18 @@ yyreduce:
g_lingo->code1(numpar); ;}
break;
- case 89:
-#line 415 "engines/director/lingo/lingo-gr.y"
+ case 88:
+#line 412 "engines/director/lingo/lingo-gr.y"
{ (yyval.narg) = 0; ;}
break;
- case 90:
-#line 416 "engines/director/lingo/lingo-gr.y"
+ case 89:
+#line 413 "engines/director/lingo/lingo-gr.y"
{ (yyval.narg) = 1; ;}
break;
- case 91:
-#line 417 "engines/director/lingo/lingo-gr.y"
+ case 90:
+#line 414 "engines/director/lingo/lingo-gr.y"
{ (yyval.narg) = (yyvsp[(1) - (3)].narg) + 1; ;}
break;
@@ -2329,6 +2329,6 @@ yyreturn:
}
-#line 420 "engines/director/lingo/lingo-gr.y"
+#line 417 "engines/director/lingo/lingo-gr.y"
diff --git a/engines/director/lingo/lingo-gr.y b/engines/director/lingo/lingo-gr.y
index fd5245d78b..e7b42860c0 100644
--- a/engines/director/lingo/lingo-gr.y
+++ b/engines/director/lingo/lingo-gr.y
@@ -99,7 +99,6 @@ programline:
| func
| macro
| asgn { g_lingo->code1(g_lingo->c_xpop); }
- | stmtoneliner
| stmt
| error { yyerrok; }
;
@@ -172,13 +171,29 @@ stmt: expr { g_lingo->code1(g_lingo->c_xpop); }
(*g_lingo->_currentScript)[$1 + 5] = end; } /* end, if cond fails */
;
-stmtoneliner: if cond tTHEN begin stmt end {
+ifstmt: if cond tTHEN '\n' stmtlist end tEND tIF {
inst then = 0, end = 0;
- WRITE_UINT32(&then, $4);
+ WRITE_UINT32(&then, $5);
WRITE_UINT32(&end, $6);
(*g_lingo->_currentScript)[$1 + 1] = then; /* thenpart */
- (*g_lingo->_currentScript)[$1 + 3] = end; /* end, if cond fails */
-
+ (*g_lingo->_currentScript)[$1 + 3] = end; /* end, if cond fails */
+ g_lingo->processIf(0, 0); }
+ | if cond tTHEN begin stmt end {
+ inst then = 0, end = 0;
+ WRITE_UINT32(&then, $4);
+ WRITE_UINT32(&end, $6);
+ (*g_lingo->_currentScript)[$1 + 1] = then; /* thenpart */
+ (*g_lingo->_currentScript)[$1 + 3] = end; /* end, if cond fails */
+
+ g_lingo->processIf(0, 0); }
+ | if cond tTHEN '\n' stmtlist end tELSE stmtlist end tEND tIF {
+ inst then = 0, else1 = 0, end = 0;
+ WRITE_UINT32(&then, $5);
+ WRITE_UINT32(&else1, $8);
+ WRITE_UINT32(&end, $9);
+ (*g_lingo->_currentScript)[$1 + 1] = then; /* thenpart */
+ (*g_lingo->_currentScript)[$1 + 2] = else1; /* elsepart */
+ (*g_lingo->_currentScript)[$1 + 3] = end; /* end, if cond fails */
g_lingo->processIf(0, 0); }
| if cond tTHEN begin stmt end '\n' tELSE begin stmt end '\n' {
inst then = 0, else1 = 0, end = 0;
@@ -190,33 +205,15 @@ stmtoneliner: if cond tTHEN begin stmt end {
(*g_lingo->_currentScript)[$1 + 3] = end; /* end, if cond fails */
g_lingo->processIf(0, 0); }
- ;
-
-ifstmt: if cond tTHEN stmtlist end tEND tIF {
- inst then = 0, end = 0;
- WRITE_UINT32(&then, $4);
- WRITE_UINT32(&end, $5);
- (*g_lingo->_currentScript)[$1 + 1] = then; /* thenpart */
- (*g_lingo->_currentScript)[$1 + 3] = end; /* end, if cond fails */
- g_lingo->processIf(0, 0); }
- | if cond tTHEN stmtlist end tELSE stmtlist end tEND tIF {
+ | if cond tTHEN '\n' stmtlist end begin elseifstmt end tEND tIF {
inst then = 0, else1 = 0, end = 0;
- WRITE_UINT32(&then, $4);
+ WRITE_UINT32(&then, $5);
WRITE_UINT32(&else1, $7);
- WRITE_UINT32(&end, $8);
- (*g_lingo->_currentScript)[$1 + 1] = then; /* thenpart */
- (*g_lingo->_currentScript)[$1 + 2] = else1; /* elsepart */
- (*g_lingo->_currentScript)[$1 + 3] = end; /* end, if cond fails */
- g_lingo->processIf(0, 0); }
- | if cond tTHEN stmtlist end begin elseifstmt end tEND tIF {
- inst then = 0, else1 = 0, end = 0;
- WRITE_UINT32(&then, $4);
- WRITE_UINT32(&else1, $6);
- WRITE_UINT32(&end, $8);
+ WRITE_UINT32(&end, $9);
(*g_lingo->_currentScript)[$1 + 1] = then; /* thenpart */
(*g_lingo->_currentScript)[$1 + 2] = else1; /* elsepart */
(*g_lingo->_currentScript)[$1 + 3] = end; /* end, if cond fails */
- g_lingo->processIf(0, $8); }
+ g_lingo->processIf(0, $9); }
;
elseifstmt: elseifstmt elseifstmt1