diff options
author | Eugene Sandulenko | 2016-06-30 17:13:34 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | d70a76f1d6e5fdb5e7dd0a3c45f7c6acf4f8a94f (patch) | |
tree | 7d92de50ca7a505900b0290bf019876122eb0ca7 /engines/director | |
parent | c53e4b579a0217e01208b7e06ead853f4319df7c (diff) | |
download | scummvm-rg350-d70a76f1d6e5fdb5e7dd0a3c45f7c6acf4f8a94f.tar.gz scummvm-rg350-d70a76f1d6e5fdb5e7dd0a3c45f7c6acf4f8a94f.tar.bz2 scummvm-rg350-d70a76f1d6e5fdb5e7dd0a3c45f7c6acf4f8a94f.zip |
DIRECTOR: Lingo: Make 'global' accept list of variables
Diffstat (limited to 'engines/director')
-rw-r--r-- | engines/director/director.cpp | 7 | ||||
-rw-r--r-- | engines/director/lingo/lingo-gr.cpp | 386 | ||||
-rw-r--r-- | engines/director/lingo/lingo-gr.y | 6 |
3 files changed, 207 insertions, 192 deletions
diff --git a/engines/director/director.cpp b/engines/director/director.cpp index 7463a9e77a..2081ebdc89 100644 --- a/engines/director/director.cpp +++ b/engines/director/director.cpp @@ -105,13 +105,14 @@ _lingo->executeScript(kMovieScript, 2); _lingo->addCode("--\n\ macro SHIPX\n\ -global x\n\ +global x, y\n\ set x = 5\n\ if x = 1 then\n\ go \"Zoom\"\n\ exit\n\ end if\n\ if x >1 then\n\ +set y = 10\n\ exit\n\ end if\n\ put 100\n\ @@ -138,11 +139,13 @@ end if\n\ ", kMovieScript, 1); _lingo->addCode("check(2, 3)\n\ -global x\n\ +global x, y\n\ +set y = 8\n\ shipx\n\ put x\n\ zipx\n\ put x\n\ +put y\n\ ", kMovieScript, 2); _lingo->executeScript(kMovieScript, 2); diff --git a/engines/director/lingo/lingo-gr.cpp b/engines/director/lingo/lingo-gr.cpp index 80229c74c3..13630f5426 100644 --- a/engines/director/lingo/lingo-gr.cpp +++ b/engines/director/lingo/lingo-gr.cpp @@ -422,18 +422,18 @@ union yyalloc #endif /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 55 +#define YYFINAL 56 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 264 +#define YYLAST 260 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 53 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 23 +#define YYNNTS 24 /* YYNRULES -- Number of rules. */ -#define YYNRULES 77 +#define YYNRULES 79 /* YYNRULES -- Number of states. */ -#define YYNSTATES 160 +#define YYNSTATES 163 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -487,16 +487,16 @@ static const yytype_uint16 yyprhs[] = 81, 94, 96, 100, 104, 107, 111, 113, 114, 115, 116, 119, 122, 124, 126, 128, 132, 136, 140, 144, 148, 152, 156, 160, 164, 167, 170, 174, 179, 182, - 185, 188, 190, 192, 195, 198, 201, 204, 207, 211, - 214, 218, 221, 224, 226, 230, 233, 237, 238, 247, - 248, 250, 254, 259, 260, 264, 265, 267 + 185, 188, 190, 192, 195, 197, 201, 204, 207, 210, + 213, 217, 220, 224, 227, 230, 232, 236, 239, 243, + 244, 253, 254, 256, 260, 265, 266, 270, 271, 273 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { 54, 0, -1, 55, 47, 54, -1, 55, -1, -1, - 70, -1, 66, -1, 74, -1, 56, -1, 57, -1, + 71, -1, 66, -1, 75, -1, 56, -1, 57, -1, 1, -1, 28, 65, 19, 8, -1, 30, 8, 41, 65, -1, 30, 8, 32, 65, -1, 65, -1, 66, -1, 61, 58, 31, 64, 63, 13, 18, -1, 61, @@ -512,17 +512,17 @@ static const yytype_int8 yyrhs[] = 65, 45, 65, -1, 65, 50, 65, -1, 65, 51, 65, -1, 65, 40, 65, -1, 65, 35, 65, -1, 65, 36, 65, -1, 42, 65, -1, 43, 65, -1, - 48, 65, 49, -1, 8, 48, 75, 49, -1, 22, - 9, -1, 23, 8, -1, 28, 65, -1, 67, -1, - 14, -1, 16, 8, -1, 17, 20, -1, 17, 25, - -1, 17, 27, -1, 17, 68, -1, 17, 68, 69, - -1, 17, 69, -1, 32, 15, 9, -1, 15, 9, - -1, 32, 9, -1, 9, -1, 26, 24, 9, -1, - 24, 9, -1, 32, 24, 9, -1, -1, 21, 8, - 71, 62, 72, 47, 73, 64, -1, -1, 8, -1, - 72, 52, 8, -1, 72, 47, 52, 8, -1, -1, - 8, 62, 75, -1, -1, 65, -1, 75, 52, 65, - -1 + 48, 65, 49, -1, 8, 48, 76, 49, -1, 22, + 9, -1, 23, 8, -1, 28, 65, -1, 68, -1, + 14, -1, 16, 67, -1, 8, -1, 67, 52, 8, + -1, 17, 20, -1, 17, 25, -1, 17, 27, -1, + 17, 69, -1, 17, 69, 70, -1, 17, 70, -1, + 32, 15, 9, -1, 15, 9, -1, 32, 9, -1, + 9, -1, 26, 24, 9, -1, 24, 9, -1, 32, + 24, 9, -1, -1, 21, 8, 72, 62, 73, 47, + 74, 64, -1, -1, 8, -1, 73, 52, 8, -1, + 73, 47, 52, 8, -1, -1, 8, 62, 76, -1, + -1, 65, -1, 76, 52, 65, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -533,9 +533,9 @@ static const yytype_uint16 yyrline[] = 172, 186, 187, 188, 190, 192, 198, 200, 202, 204, 205, 206, 209, 214, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 232, 238, 239, - 240, 241, 242, 243, 254, 255, 256, 257, 262, 268, - 275, 276, 277, 278, 281, 282, 283, 311, 311, 317, - 318, 319, 320, 322, 325, 333, 334, 335 + 240, 241, 242, 243, 246, 247, 258, 259, 260, 261, + 266, 272, 279, 280, 281, 282, 285, 286, 287, 315, + 315, 321, 322, 323, 324, 326, 329, 337, 338, 339 }; #endif @@ -552,8 +552,8 @@ static const char *const yytname[] = "tNEQ", "'='", "'+'", "'-'", "'*'", "'/'", "'%'", "'\\n'", "'('", "')'", "'>'", "'<'", "','", "$accept", "program", "programline", "asgn", "stmt", "cond", "repeatwhile", "repeatwith", "if", "begin", "end", "stmtlist", - "expr", "func", "gotofunc", "gotoframe", "gotomovie", "defn", "@1", - "argdef", "argstore", "macro", "arglist", 0 + "expr", "func", "globallist", "gotofunc", "gotoframe", "gotomovie", + "defn", "@1", "argdef", "argstore", "macro", "arglist", 0 }; #endif @@ -579,9 +579,9 @@ static const yytype_uint8 yyr1[] = 57, 58, 58, 58, 59, 60, 61, 62, 63, 64, 64, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 66, 66, 66, - 66, 66, 66, 66, 67, 67, 67, 67, 67, 67, - 68, 68, 68, 68, 69, 69, 69, 71, 70, 72, - 72, 72, 72, 73, 74, 75, 75, 75 + 66, 66, 66, 66, 67, 67, 68, 68, 68, 68, + 68, 68, 69, 69, 69, 69, 70, 70, 70, 72, + 71, 73, 73, 73, 73, 74, 75, 76, 76, 76 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -592,9 +592,9 @@ static const yytype_uint8 yyr2[] = 12, 1, 3, 3, 2, 3, 1, 0, 0, 0, 2, 2, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 3, 4, 2, 2, - 2, 1, 1, 2, 2, 2, 2, 2, 3, 2, - 3, 2, 2, 1, 3, 2, 3, 0, 8, 0, - 1, 3, 4, 0, 3, 0, 1, 3 + 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 @@ -604,59 +604,61 @@ static const yytype_uint8 yydefact[] = { 0, 10, 32, 27, 52, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 34, - 9, 0, 0, 0, 14, 6, 51, 5, 7, 75, - 75, 53, 63, 0, 54, 0, 55, 0, 56, 0, - 57, 59, 67, 48, 49, 33, 0, 34, 50, 0, - 24, 0, 44, 45, 0, 1, 0, 0, 0, 0, - 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 76, 0, 74, 61, 65, 0, 62, 0, 0, - 0, 58, 27, 0, 0, 25, 0, 0, 46, 2, - 0, 28, 0, 0, 29, 0, 42, 43, 41, 35, - 36, 37, 38, 39, 40, 47, 0, 64, 60, 66, - 69, 11, 13, 12, 29, 0, 23, 28, 22, 77, - 70, 0, 28, 0, 0, 33, 30, 31, 0, 15, - 73, 0, 0, 0, 28, 29, 0, 0, 29, 71, - 0, 28, 29, 28, 16, 72, 68, 18, 29, 28, - 0, 28, 0, 0, 0, 0, 17, 0, 19, 20 + 9, 0, 0, 0, 14, 6, 51, 5, 7, 77, + 77, 54, 53, 65, 0, 56, 0, 57, 0, 58, + 0, 59, 61, 69, 48, 49, 33, 0, 34, 50, + 0, 24, 0, 44, 45, 0, 1, 0, 0, 0, + 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 78, 0, 76, 0, 63, 67, 0, 64, + 0, 0, 0, 60, 27, 0, 0, 25, 0, 0, + 46, 2, 0, 28, 0, 0, 29, 0, 42, 43, + 41, 35, 36, 37, 38, 39, 40, 47, 0, 55, + 66, 62, 68, 71, 11, 13, 12, 29, 0, 23, + 28, 22, 79, 72, 0, 28, 0, 0, 33, 30, + 31, 0, 15, 75, 0, 0, 0, 28, 29, 0, + 0, 29, 73, 0, 28, 29, 28, 16, 74, 70, + 18, 29, 28, 0, 28, 0, 0, 0, 0, 17, + 0, 19, 20 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 17, 18, 47, 127, 60, 21, 22, 23, 30, - 115, 117, 24, 129, 26, 40, 41, 27, 82, 121, - 138, 28, 72 + -1, 17, 18, 48, 130, 61, 21, 22, 23, 30, + 118, 120, 24, 132, 32, 26, 41, 42, 27, 84, + 124, 141, 28, 73 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -108 +#define YYPACT_NINF -117 static const yytype_int16 yypact[] = { - 82, -108, -108, 196, -108, 1, 5, -108, 13, 4, - 25, 37, 27, 42, 37, 37, 37, 74, 31, 2, - -108, 38, 46, 111, 184, -108, -108, -108, -108, 37, - 37, -108, -108, 84, -108, 93, -108, 67, -108, 57, - 45, -108, -108, -108, -108, -108, 37, -108, 136, 98, - -108, -15, -12, -12, 160, -108, 82, 111, 37, 111, - 77, 172, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 184, 40, 62, -108, -108, 100, -108, 106, 107, - 94, -108, -108, 136, 112, -108, 37, 37, -108, -108, - 72, 184, 78, 148, -108, 37, 184, 184, 184, 213, - 213, -12, -12, 184, 184, -108, 37, -108, -108, -108, - 115, -108, 184, 184, -108, -10, -108, 120, 184, 184, - -108, -36, 120, 99, 37, 85, -108, -108, 28, -108, - 80, 127, 131, 37, 184, -108, 122, 137, -108, -108, - 117, 184, -108, 120, -108, -108, 120, -108, -108, 120, - 134, 120, 138, 139, 143, 123, -108, 129, -108, -108 + 66, -117, -117, 192, -117, 26, 151, -117, 29, 32, + 36, 3, -13, 42, 3, 3, 3, 62, 28, 14, + -117, 25, 38, 63, 180, -117, -117, -117, -117, 3, + 3, -117, 33, -117, 72, -117, 81, -117, 68, -117, + 15, 44, -117, -117, -117, -117, -117, 3, -117, 119, + 92, -117, -15, -8, -8, 156, -117, 66, 63, 3, + 63, 70, 168, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 180, -36, 50, 95, -117, -117, 98, -117, + 106, 108, 80, -117, -117, 119, 111, -117, 3, 3, + -117, -117, 74, 180, 79, 144, -117, 3, 180, 180, + 180, 209, 209, -8, -8, 180, 180, -117, 3, -117, + -117, -117, -117, 122, -117, 180, 180, -117, -9, -117, + 104, 180, 180, -117, -37, 104, 99, 3, 87, -117, + -117, 86, -117, 84, 129, 126, 3, 180, -117, 124, + 132, -117, -117, 114, 180, -117, 104, -117, -117, 104, + -117, -117, 104, 131, 104, 136, 127, 140, 128, -117, + 138, -117, -117 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -108, 104, -108, 6, 7, 11, -108, -108, -108, 79, - -107, -41, -11, 8, -108, -108, 124, -108, -108, -108, - -108, -108, 135 + -117, 115, -117, 6, 7, -20, -117, -117, -117, 89, + 4, -116, -11, 8, -117, -117, -117, 133, -117, -117, + -117, -117, -117, 135 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -666,64 +668,64 @@ static const yytype_int16 yypgoto[] = #define YYTABLE_NINF -34 static const yytype_int16 yytable[] = { - 48, 123, -8, 52, 53, 54, 19, 20, 25, 31, - 128, 130, 61, 43, 32, 132, 131, 86, 71, 71, - 33, 42, 124, 62, 63, 34, 87, 142, 64, 35, - 36, 37, 38, 44, 148, 83, 150, 39, 69, 70, - 135, 136, 152, 2, 154, 45, 61, 91, 93, -8, - 51, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 49, 50, 19, 20, 25, 46, 77, 13, 90, 35, - 92, 37, 78, 122, 55, 112, 113, 80, 56, 14, - 15, 79, -4, 1, 118, 16, 57, 58, 2, 105, - 3, 76, 106, 74, 143, 119, 4, 146, 5, 6, - 7, 149, 75, 8, 9, 10, 85, 151, 94, 107, - 11, 12, 13, 134, 106, 108, 109, 2, 79, 45, - 111, 114, 141, 120, 14, 15, 2, 116, 125, -4, - 16, 133, 137, 29, 4, 139, 5, 6, 7, 46, - 144, 13, 9, 10, 140, 145, 147, 153, 11, 12, - 13, 155, 158, 14, 15, 84, 157, 156, 159, 59, - 89, 110, 14, 15, 81, 73, 0, 126, 16, 0, - 0, 62, 63, 0, 0, 0, 64, 0, 65, 66, - 67, 68, 0, 62, 63, 0, 69, 70, 64, 95, - 65, 66, 67, 68, 0, 62, 63, 88, 69, 70, - 64, 0, 65, 66, 67, 68, 0, 62, 63, 88, - 69, 70, 64, 95, 65, 66, 67, 68, 0, 62, - 63, 0, 69, 70, 64, 0, 65, 66, 67, 68, - 0, -33, -33, 0, 69, 70, -33, 0, 0, 0, - -33, -33, 0, 0, 29, 0, -33, -33, 62, 63, - 0, 0, 0, 64, 0, 0, 0, 67, 68, 0, - 0, 0, 0, 69, 70 + 49, 125, 126, 53, 54, 55, 19, 20, 25, 2, + 133, 46, 62, 107, -8, 134, 108, 88, 72, 72, + 50, 51, 146, 127, 79, 149, 89, 63, 64, 152, + 80, 47, 65, 13, 31, 154, 85, 43, 92, 81, + 94, 44, 70, 71, 45, 14, 15, 62, 93, 95, + 52, 16, 98, 99, 100, 101, 102, 103, 104, 105, + 106, -8, 56, 19, 20, 25, -4, 1, 36, 2, + 38, 46, 2, 58, 3, 57, 82, 115, 116, 59, + 4, 76, 5, 6, 7, 75, 121, 8, 9, 10, + 77, 47, 78, 13, 11, 12, 13, 122, 138, 139, + 87, 96, 108, 109, 81, 14, 15, 110, 14, 15, + 2, 60, 128, -4, 16, 111, 137, 112, 4, 114, + 5, 6, 7, 117, 131, 144, 9, 10, 119, 135, + 123, 136, 11, 12, 13, 29, 140, 142, 86, 143, + 148, 145, 147, 150, 156, 159, 14, 15, 151, 158, + 153, 129, 16, 160, 63, 64, 155, 161, 157, 65, + 33, 66, 67, 68, 69, 74, 34, 162, 0, 70, + 71, 35, 91, 113, 83, 36, 37, 38, 39, 63, + 64, 0, 0, 40, 65, 97, 66, 67, 68, 69, + 0, 63, 64, 90, 70, 71, 65, 0, 66, 67, + 68, 69, 0, 63, 64, 90, 70, 71, 65, 97, + 66, 67, 68, 69, 0, 63, 64, 0, 70, 71, + 65, 0, 66, 67, 68, 69, 0, -33, -33, 0, + 70, 71, -33, 0, 0, 0, -33, -33, 0, 0, + 29, 0, -33, -33, 63, 64, 0, 0, 0, 65, + 0, 0, 0, 68, 69, 0, 0, 0, 0, 70, + 71 }; static const yytype_int16 yycheck[] = { - 11, 11, 0, 14, 15, 16, 0, 0, 0, 8, - 117, 47, 23, 9, 9, 122, 52, 32, 29, 30, - 15, 8, 32, 35, 36, 20, 41, 134, 40, 24, - 25, 26, 27, 8, 141, 46, 143, 32, 50, 51, - 12, 13, 149, 6, 151, 8, 57, 58, 59, 47, - 8, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 33, 34, 56, 56, 56, 28, 9, 30, 57, 24, - 59, 26, 15, 114, 0, 86, 87, 32, 47, 42, - 43, 24, 0, 1, 95, 48, 48, 41, 6, 49, - 8, 24, 52, 9, 135, 106, 14, 138, 16, 17, - 18, 142, 9, 21, 22, 23, 8, 148, 31, 9, - 28, 29, 30, 124, 52, 9, 9, 6, 24, 8, - 8, 49, 133, 8, 42, 43, 6, 49, 8, 47, - 48, 32, 52, 48, 14, 8, 16, 17, 18, 28, - 18, 30, 22, 23, 13, 8, 29, 13, 28, 29, - 30, 13, 29, 42, 43, 19, 13, 18, 29, 48, - 56, 82, 42, 43, 40, 30, -1, 47, 48, -1, - -1, 35, 36, -1, -1, -1, 40, -1, 42, 43, - 44, 45, -1, 35, 36, -1, 50, 51, 40, 41, - 42, 43, 44, 45, -1, 35, 36, 49, 50, 51, - 40, -1, 42, 43, 44, 45, -1, 35, 36, 49, - 50, 51, 40, 41, 42, 43, 44, 45, -1, 35, - 36, -1, 50, 51, 40, -1, 42, 43, 44, 45, - -1, 35, 36, -1, 50, 51, 40, -1, -1, -1, - 44, 45, -1, -1, 48, -1, 50, 51, 35, 36, - -1, -1, -1, 40, -1, -1, -1, 44, 45, -1, - -1, -1, -1, 50, 51 + 11, 117, 11, 14, 15, 16, 0, 0, 0, 6, + 47, 8, 23, 49, 0, 52, 52, 32, 29, 30, + 33, 34, 138, 32, 9, 141, 41, 35, 36, 145, + 15, 28, 40, 30, 8, 151, 47, 8, 58, 24, + 60, 9, 50, 51, 8, 42, 43, 58, 59, 60, + 8, 48, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 47, 0, 57, 57, 57, 0, 1, 24, 6, + 26, 8, 6, 48, 8, 47, 32, 88, 89, 41, + 14, 9, 16, 17, 18, 52, 97, 21, 22, 23, + 9, 28, 24, 30, 28, 29, 30, 108, 12, 13, + 8, 31, 52, 8, 24, 42, 43, 9, 42, 43, + 6, 48, 8, 47, 48, 9, 127, 9, 14, 8, + 16, 17, 18, 49, 120, 136, 22, 23, 49, 125, + 8, 32, 28, 29, 30, 48, 52, 8, 19, 13, + 8, 137, 18, 29, 13, 18, 42, 43, 144, 13, + 146, 47, 48, 13, 35, 36, 152, 29, 154, 40, + 9, 42, 43, 44, 45, 30, 15, 29, -1, 50, + 51, 20, 57, 84, 41, 24, 25, 26, 27, 35, + 36, -1, -1, 32, 40, 41, 42, 43, 44, 45, + -1, 35, 36, 49, 50, 51, 40, -1, 42, 43, + 44, 45, -1, 35, 36, 49, 50, 51, 40, 41, + 42, 43, 44, 45, -1, 35, 36, -1, 50, 51, + 40, -1, 42, 43, 44, 45, -1, 35, 36, -1, + 50, 51, 40, -1, -1, -1, 44, 45, -1, -1, + 48, -1, 50, 51, 35, 36, -1, -1, -1, 40, + -1, -1, -1, 44, 45, -1, -1, -1, -1, 50, + 51 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -732,20 +734,21 @@ static const yytype_uint8 yystos[] = { 0, 1, 6, 8, 14, 16, 17, 18, 21, 22, 23, 28, 29, 30, 42, 43, 48, 54, 55, 56, - 57, 59, 60, 61, 65, 66, 67, 70, 74, 48, - 62, 8, 9, 15, 20, 24, 25, 26, 27, 32, - 68, 69, 8, 9, 8, 8, 28, 56, 65, 33, - 34, 8, 65, 65, 65, 0, 47, 48, 41, 48, - 58, 65, 35, 36, 40, 42, 43, 44, 45, 50, - 51, 65, 75, 75, 9, 9, 24, 9, 15, 24, - 32, 69, 71, 65, 19, 8, 32, 41, 49, 54, - 58, 65, 58, 65, 31, 41, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 49, 52, 9, 9, 9, - 62, 8, 65, 65, 49, 63, 49, 64, 65, 65, - 8, 72, 64, 11, 32, 8, 47, 57, 63, 66, - 47, 52, 63, 32, 65, 12, 13, 52, 73, 8, - 13, 65, 63, 64, 18, 8, 64, 29, 63, 64, - 63, 64, 63, 13, 63, 13, 18, 13, 29, 29 + 57, 59, 60, 61, 65, 66, 68, 71, 75, 48, + 62, 8, 67, 9, 15, 20, 24, 25, 26, 27, + 32, 69, 70, 8, 9, 8, 8, 28, 56, 65, + 33, 34, 8, 65, 65, 65, 0, 47, 48, 41, + 48, 58, 65, 35, 36, 40, 42, 43, 44, 45, + 50, 51, 65, 76, 76, 52, 9, 9, 24, 9, + 15, 24, 32, 70, 72, 65, 19, 8, 32, 41, + 49, 54, 58, 65, 58, 65, 31, 41, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 49, 52, 8, + 9, 9, 9, 62, 8, 65, 65, 49, 63, 49, + 64, 65, 65, 8, 73, 64, 11, 32, 8, 47, + 57, 63, 66, 47, 52, 63, 32, 65, 12, 13, + 52, 74, 8, 13, 65, 63, 64, 18, 8, 64, + 29, 63, 64, 63, 64, 63, 13, 63, 13, 18, + 13, 29, 29 }; #define yyerrok (yyerrstatus = 0) @@ -1818,28 +1821,33 @@ yyreduce: { g_lingo->code1(g_lingo->c_exit); ;} break; - case 53: -#line 243 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_global); g_lingo->codeString((yyvsp[(2) - (2)].s)->c_str()); delete (yyvsp[(2) - (2)].s); ;} + case 54: +#line 246 "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 54: -#line 254 "engines/director/lingo/lingo-gr.y" + case 55: +#line 247 "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 56: +#line 258 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gotoloop); ;} break; - case 55: -#line 255 "engines/director/lingo/lingo-gr.y" + case 57: +#line 259 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gotonext); ;} break; - case 56: -#line 256 "engines/director/lingo/lingo-gr.y" + case 58: +#line 260 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gotoprevious); ;} break; - case 57: -#line 257 "engines/director/lingo/lingo-gr.y" + case 59: +#line 261 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_goto); g_lingo->codeString((yyvsp[(2) - (2)].s)->c_str()); @@ -1847,8 +1855,8 @@ yyreduce: delete (yyvsp[(2) - (2)].s); ;} break; - case 58: -#line 262 "engines/director/lingo/lingo-gr.y" + case 60: +#line 266 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_goto); g_lingo->codeString((yyvsp[(2) - (3)].s)->c_str()); @@ -1857,8 +1865,8 @@ yyreduce: delete (yyvsp[(3) - (3)].s); ;} break; - case 59: -#line 268 "engines/director/lingo/lingo-gr.y" + case 61: +#line 272 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_goto); g_lingo->codeString(""); @@ -1866,81 +1874,81 @@ yyreduce: delete (yyvsp[(2) - (2)].s); ;} break; - case 60: -#line 275 "engines/director/lingo/lingo-gr.y" + case 62: +#line 279 "engines/director/lingo/lingo-gr.y" { (yyval.s) = (yyvsp[(3) - (3)].s); ;} break; - case 61: -#line 276 "engines/director/lingo/lingo-gr.y" + case 63: +#line 280 "engines/director/lingo/lingo-gr.y" { (yyval.s) = (yyvsp[(2) - (2)].s); ;} break; - case 62: -#line 277 "engines/director/lingo/lingo-gr.y" + case 64: +#line 281 "engines/director/lingo/lingo-gr.y" { (yyval.s) = (yyvsp[(2) - (2)].s); ;} break; - case 63: -#line 278 "engines/director/lingo/lingo-gr.y" + case 65: +#line 282 "engines/director/lingo/lingo-gr.y" { (yyval.s) = (yyvsp[(1) - (1)].s); ;} break; - case 64: -#line 281 "engines/director/lingo/lingo-gr.y" + case 66: +#line 285 "engines/director/lingo/lingo-gr.y" { (yyval.s) = (yyvsp[(3) - (3)].s); ;} break; - case 65: -#line 282 "engines/director/lingo/lingo-gr.y" + case 67: +#line 286 "engines/director/lingo/lingo-gr.y" { (yyval.s) = (yyvsp[(2) - (2)].s); ;} break; - case 66: -#line 283 "engines/director/lingo/lingo-gr.y" + case 68: +#line 287 "engines/director/lingo/lingo-gr.y" { (yyval.s) = (yyvsp[(3) - (3)].s); ;} break; - case 67: -#line 311 "engines/director/lingo/lingo-gr.y" + case 69: +#line 315 "engines/director/lingo/lingo-gr.y" { g_lingo->_indef = true; ;} break; - case 68: -#line 312 "engines/director/lingo/lingo-gr.y" + case 70: +#line 316 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_procret); g_lingo->define(*(yyvsp[(2) - (8)].s), (yyvsp[(4) - (8)].code), (yyvsp[(5) - (8)].narg)); g_lingo->_indef = false; ;} break; - case 69: -#line 317 "engines/director/lingo/lingo-gr.y" + case 71: +#line 321 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = 0; ;} break; - case 70: -#line 318 "engines/director/lingo/lingo-gr.y" + case 72: +#line 322 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArg((yyvsp[(1) - (1)].s)); (yyval.narg) = 1; ;} break; - case 71: -#line 319 "engines/director/lingo/lingo-gr.y" + case 73: +#line 323 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArg((yyvsp[(3) - (3)].s)); (yyval.narg) = (yyvsp[(1) - (3)].narg) + 1; ;} break; - case 72: -#line 320 "engines/director/lingo/lingo-gr.y" + case 74: +#line 324 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArg((yyvsp[(4) - (4)].s)); (yyval.narg) = (yyvsp[(1) - (4)].narg) + 1; ;} break; - case 73: -#line 322 "engines/director/lingo/lingo-gr.y" + case 75: +#line 326 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArgStore(); ;} break; - case 74: -#line 325 "engines/director/lingo/lingo-gr.y" + case 76: +#line 329 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_call); g_lingo->codeString((yyvsp[(1) - (3)].s)->c_str()); @@ -1949,24 +1957,24 @@ yyreduce: g_lingo->code1(numpar); ;} break; - case 75: -#line 333 "engines/director/lingo/lingo-gr.y" + case 77: +#line 337 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = 0; ;} break; - case 76: -#line 334 "engines/director/lingo/lingo-gr.y" + case 78: +#line 338 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = 1; ;} break; - case 77: -#line 335 "engines/director/lingo/lingo-gr.y" + case 79: +#line 339 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = (yyvsp[(1) - (3)].narg) + 1; ;} break; /* Line 1267 of yacc.c. */ -#line 1970 "engines/director/lingo/lingo-gr.cpp" +#line 1978 "engines/director/lingo/lingo-gr.cpp" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -2180,6 +2188,6 @@ yyreturn: } -#line 338 "engines/director/lingo/lingo-gr.y" +#line 342 "engines/director/lingo/lingo-gr.y" diff --git a/engines/director/lingo/lingo-gr.y b/engines/director/lingo/lingo-gr.y index 2084c704db..73dc4f0e08 100644 --- a/engines/director/lingo/lingo-gr.y +++ b/engines/director/lingo/lingo-gr.y @@ -240,7 +240,11 @@ func: ID '(' arglist ')' { | tPUT expr { g_lingo->code1(g_lingo->c_printtop); } | gotofunc | tEXIT { g_lingo->code1(g_lingo->c_exit); } - | tGLOBAL ID { g_lingo->code1(g_lingo->c_global); g_lingo->codeString($2->c_str()); delete $2; } + | tGLOBAL globallist + ; + +globallist: ID { g_lingo->code1(g_lingo->c_global); g_lingo->codeString($1->c_str()); delete $1; } + | globallist ',' ID { g_lingo->code1(g_lingo->c_global); g_lingo->codeString($3->c_str()); delete $3; } ; // go {to} {frame} whichFrame {of movie whichMovie} |