diff options
author | Eugene Sandulenko | 2016-06-17 10:22:02 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | 612a480f9b1342820d88fc66f513dc00f768f5d9 (patch) | |
tree | 62dbd8354028f626e30e12c9920e7d8be180fd59 /engines | |
parent | f58de432c5d7ab1e465fccfe9a449fe955a7865b (diff) | |
download | scummvm-rg350-612a480f9b1342820d88fc66f513dc00f768f5d9.tar.gz scummvm-rg350-612a480f9b1342820d88fc66f513dc00f768f5d9.tar.bz2 scummvm-rg350-612a480f9b1342820d88fc66f513dc00f768f5d9.zip |
DIRECTOR: Lingo: Added mciwait function stub
Diffstat (limited to 'engines')
-rw-r--r-- | engines/director/lingo/lingo-funcs.cpp | 4 | ||||
-rw-r--r-- | engines/director/lingo/lingo-gr.cpp | 173 | ||||
-rw-r--r-- | engines/director/lingo/lingo-gr.h | 12 | ||||
-rw-r--r-- | engines/director/lingo/lingo-gr.y | 2 | ||||
-rw-r--r-- | engines/director/lingo/lingo-lex.cpp | 124 | ||||
-rw-r--r-- | engines/director/lingo/lingo-lex.l | 1 | ||||
-rw-r--r-- | engines/director/lingo/lingo.h | 1 |
7 files changed, 174 insertions, 143 deletions
diff --git a/engines/director/lingo/lingo-funcs.cpp b/engines/director/lingo/lingo-funcs.cpp index 5422b3ca9b..ee640dea4c 100644 --- a/engines/director/lingo/lingo-funcs.cpp +++ b/engines/director/lingo/lingo-funcs.cpp @@ -154,6 +154,10 @@ int Lingo::func_mci(Common::String *s) { return 0; } +void Lingo::func_mciwait(Common::String *s) { + warning("MCI wait file: %s", s->c_str()); +} + void Lingo::func_constpush() { } diff --git a/engines/director/lingo/lingo-gr.cpp b/engines/director/lingo/lingo-gr.cpp index c34a25f839..ff3513f12b 100644 --- a/engines/director/lingo/lingo-gr.cpp +++ b/engines/director/lingo/lingo-gr.cpp @@ -74,8 +74,9 @@ OP_INTO = 263, OP_TO = 264, FUNC_MCI = 265, - FUNC_PUT = 266, - FUNC_SET = 267 + FUNC_MCIWAIT = 266, + FUNC_PUT = 267, + FUNC_SET = 268 }; #endif /* Tokens. */ @@ -87,8 +88,9 @@ #define OP_INTO 263 #define OP_TO 264 #define FUNC_MCI 265 -#define FUNC_PUT 266 -#define FUNC_SET 267 +#define FUNC_MCIWAIT 266 +#define FUNC_PUT 267 +#define FUNC_SET 268 @@ -138,7 +140,7 @@ typedef union YYSTYPE #line 43 "engines/director/lingo/lingo-gr.y" { float f; int i; Common::String *s; } /* Line 193 of yacc.c. */ -#line 142 "engines/director/lingo/lingo-gr.cpp" +#line 144 "engines/director/lingo/lingo-gr.cpp" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -151,7 +153,7 @@ typedef union YYSTYPE /* Line 216 of yacc.c. */ -#line 155 "engines/director/lingo/lingo-gr.cpp" +#line 157 "engines/director/lingo/lingo-gr.cpp" #ifdef short # undef short @@ -364,22 +366,22 @@ union yyalloc #endif /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 19 +#define YYFINAL 21 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 52 +#define YYLAST 54 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 22 +#define YYNTOKENS 23 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 5 /* YYNRULES -- Number of rules. */ -#define YYNRULES 19 +#define YYNRULES 20 /* YYNRULES -- Number of states. */ -#define YYNSTATES 37 +#define YYNSTATES 39 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 267 +#define YYMAXUTOK 268 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -388,12 +390,12 @@ union yyalloc static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 19, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 20, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 18, 2, 2, - 20, 21, 16, 14, 2, 15, 2, 17, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 19, 2, 2, + 21, 22, 17, 15, 2, 16, 2, 18, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 13, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 14, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -413,7 +415,7 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12 + 5, 6, 7, 8, 9, 10, 11, 12, 13 }; #if YYDEBUG @@ -422,26 +424,28 @@ static const yytype_uint8 yytranslate[] = static const yytype_uint8 yyprhs[] = { 0, 0, 3, 5, 9, 11, 13, 15, 17, 21, - 25, 29, 33, 36, 39, 43, 44, 47, 52, 57 + 25, 29, 33, 36, 39, 43, 44, 47, 50, 55, + 60 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { - 23, 0, -1, 24, -1, 23, 19, 24, -1, 25, - -1, 26, -1, 5, -1, 6, -1, 25, 14, 25, - -1, 25, 15, 25, -1, 25, 16, 25, -1, 25, - 17, 25, -1, 14, 25, -1, 15, 25, -1, 20, - 25, 21, -1, -1, 10, 7, -1, 11, 25, 8, - 6, -1, 12, 6, 13, 25, -1, 12, 6, 9, - 25, -1 + 24, 0, -1, 25, -1, 24, 20, 25, -1, 26, + -1, 27, -1, 5, -1, 6, -1, 26, 15, 26, + -1, 26, 16, 26, -1, 26, 17, 26, -1, 26, + 18, 26, -1, 15, 26, -1, 16, 26, -1, 21, + 26, 22, -1, -1, 10, 7, -1, 11, 6, -1, + 12, 26, 8, 6, -1, 13, 6, 14, 26, -1, + 13, 6, 9, 26, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { - 0, 66, 66, 67, 70, 71, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 86, 87, 88, 89 + 0, 67, 67, 68, 71, 72, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 87, 88, 89, 90, + 91 }; #endif @@ -451,9 +455,9 @@ static const yytype_uint8 yyrline[] = static const char *const yytname[] = { "$end", "error", "$undefined", "UNARY", "FLOAT", "INT", "VAR", "STRING", - "OP_INTO", "OP_TO", "FUNC_MCI", "FUNC_PUT", "FUNC_SET", "'='", "'+'", - "'-'", "'*'", "'/'", "'%'", "'\\n'", "'('", "')'", "$accept", "list", - "statement", "expr", "func", 0 + "OP_INTO", "OP_TO", "FUNC_MCI", "FUNC_MCIWAIT", "FUNC_PUT", "FUNC_SET", + "'='", "'+'", "'-'", "'*'", "'/'", "'%'", "'\\n'", "'('", "')'", + "$accept", "list", "statement", "expr", "func", 0 }; #endif @@ -463,23 +467,25 @@ static const char *const yytname[] = static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 61, 43, 45, 42, 47, 37, 10, - 40, 41 + 265, 266, 267, 268, 61, 43, 45, 42, 47, 37, + 10, 40, 41 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 22, 23, 23, 24, 24, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 26, 26, 26, 26 + 0, 23, 24, 24, 25, 25, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, + 27 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 1, 3, 1, 1, 1, 1, 3, 3, - 3, 3, 2, 2, 3, 0, 2, 4, 4, 4 + 3, 3, 2, 2, 3, 0, 2, 2, 4, 4, + 4 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -487,33 +493,33 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 15, 6, 7, 0, 15, 0, 15, 15, 15, 0, - 2, 4, 5, 16, 0, 0, 12, 13, 0, 1, - 15, 15, 15, 15, 15, 0, 15, 15, 14, 3, - 8, 9, 10, 11, 17, 19, 18 + 15, 6, 7, 0, 0, 15, 0, 15, 15, 15, + 0, 2, 4, 5, 16, 17, 0, 0, 12, 13, + 0, 1, 15, 15, 15, 15, 15, 0, 15, 15, + 14, 3, 8, 9, 10, 11, 18, 20, 19 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { - -1, 9, 10, 11, 12 + -1, 10, 11, 12, 13 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -9 +#define YYPACT_NINF -10 static const yytype_int8 yypact[] = { - 1, -9, -9, -6, 20, 4, 20, 20, 20, 5, - -9, 35, -9, -9, 22, 18, -9, -9, 27, -9, - 1, 20, 20, 20, 20, 8, 20, 20, -9, -9, - -8, -8, -9, -9, -9, 35, 35 + 1, -10, -10, -6, 4, 21, 9, 21, 21, 21, + 5, -10, 36, -10, -10, -10, 23, 19, -10, -10, + 28, -10, 1, 21, 21, 21, 21, 24, 21, 21, + -10, -10, -9, -9, -10, -10, -10, 36, 36 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { - -9, -9, 9, -4, -9 + -10, -10, 7, -5, -10 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -523,32 +529,32 @@ static const yytype_int8 yypgoto[] = #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { - 14, 13, 16, 17, 18, 19, 1, 2, 23, 24, - 15, 3, 4, 5, 34, 6, 7, 30, 31, 32, - 33, 8, 35, 36, 20, 1, 2, 26, 0, 29, - 25, 27, 0, 0, 6, 7, 21, 22, 23, 24, - 8, 21, 22, 23, 24, 0, 0, 0, 28, 21, - 22, 23, 24 + 16, 14, 18, 19, 20, 21, 1, 2, 25, 26, + 15, 3, 4, 5, 6, 17, 7, 8, 32, 33, + 34, 35, 9, 37, 38, 22, 1, 2, 28, 31, + 36, 27, 0, 29, 0, 0, 7, 8, 23, 24, + 25, 26, 9, 23, 24, 25, 26, 0, 0, 0, + 30, 23, 24, 25, 26 }; static const yytype_int8 yycheck[] = { - 4, 7, 6, 7, 8, 0, 5, 6, 16, 17, - 6, 10, 11, 12, 6, 14, 15, 21, 22, 23, - 24, 20, 26, 27, 19, 5, 6, 9, -1, 20, - 8, 13, -1, -1, 14, 15, 14, 15, 16, 17, - 20, 14, 15, 16, 17, -1, -1, -1, 21, 14, - 15, 16, 17 + 5, 7, 7, 8, 9, 0, 5, 6, 17, 18, + 6, 10, 11, 12, 13, 6, 15, 16, 23, 24, + 25, 26, 21, 28, 29, 20, 5, 6, 9, 22, + 6, 8, -1, 14, -1, -1, 15, 16, 15, 16, + 17, 18, 21, 15, 16, 17, 18, -1, -1, -1, + 22, 15, 16, 17, 18 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 5, 6, 10, 11, 12, 14, 15, 20, 23, - 24, 25, 26, 7, 25, 6, 25, 25, 25, 0, - 19, 14, 15, 16, 17, 8, 9, 13, 21, 24, - 25, 25, 25, 25, 6, 25, 25 + 0, 5, 6, 10, 11, 12, 13, 15, 16, 21, + 24, 25, 26, 27, 7, 6, 26, 6, 26, 26, + 26, 0, 20, 15, 16, 17, 18, 8, 9, 14, + 22, 25, 26, 26, 26, 26, 6, 26, 26 }; #define yyerrok (yyerrstatus = 0) @@ -1363,83 +1369,88 @@ yyreduce: switch (yyn) { case 4: -#line 70 "engines/director/lingo/lingo-gr.y" +#line 71 "engines/director/lingo/lingo-gr.y" { warning("%d", (yyvsp[(1) - (1)].i)); ;} break; case 5: -#line 71 "engines/director/lingo/lingo-gr.y" +#line 72 "engines/director/lingo/lingo-gr.y" { warning("%d", (yyvsp[(1) - (1)].i)); ;} break; case 6: -#line 74 "engines/director/lingo/lingo-gr.y" +#line 75 "engines/director/lingo/lingo-gr.y" { (yyval.i) = g_lingo->code2(g_lingo->func_constpush, (inst)(yyvsp[(1) - (1)].i)); ;} break; case 7: -#line 75 "engines/director/lingo/lingo-gr.y" +#line 76 "engines/director/lingo/lingo-gr.y" { (yyval.i) = vars[*(yyvsp[(1) - (1)].s)]; delete (yyvsp[(1) - (1)].s); ;} break; case 8: -#line 76 "engines/director/lingo/lingo-gr.y" +#line 77 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->func_add); ;} break; case 9: -#line 77 "engines/director/lingo/lingo-gr.y" +#line 78 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->func_sub); ;} break; case 10: -#line 78 "engines/director/lingo/lingo-gr.y" +#line 79 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->func_mul); ;} break; case 11: -#line 79 "engines/director/lingo/lingo-gr.y" +#line 80 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->func_div); ;} break; case 12: -#line 80 "engines/director/lingo/lingo-gr.y" +#line 81 "engines/director/lingo/lingo-gr.y" { (yyval.i) = (yyvsp[(2) - (2)].i); ;} break; case 13: -#line 81 "engines/director/lingo/lingo-gr.y" +#line 82 "engines/director/lingo/lingo-gr.y" { (yyval.i) = (yyvsp[(2) - (2)].i); g_lingo->code1(g_lingo->func_negate); ;} break; case 14: -#line 82 "engines/director/lingo/lingo-gr.y" +#line 83 "engines/director/lingo/lingo-gr.y" { (yyval.i) = (yyvsp[(2) - (3)].i); ;} break; case 16: -#line 86 "engines/director/lingo/lingo-gr.y" +#line 87 "engines/director/lingo/lingo-gr.y" { g_lingo->func_mci((yyvsp[(2) - (2)].s)); delete (yyvsp[(2) - (2)].s); ;} break; case 17: -#line 87 "engines/director/lingo/lingo-gr.y" - { (yyval.i) = vars[*(yyvsp[(4) - (4)].s)] = (yyvsp[(2) - (4)].i); delete (yyvsp[(4) - (4)].s); ;} +#line 88 "engines/director/lingo/lingo-gr.y" + { g_lingo->func_mciwait((yyvsp[(2) - (2)].s)); ;} break; case 18: -#line 88 "engines/director/lingo/lingo-gr.y" - { (yyval.i) = vars[*(yyvsp[(2) - (4)].s)] = (yyvsp[(4) - (4)].i); delete (yyvsp[(2) - (4)].s); ;} +#line 89 "engines/director/lingo/lingo-gr.y" + { (yyval.i) = vars[*(yyvsp[(4) - (4)].s)] = (yyvsp[(2) - (4)].i); delete (yyvsp[(4) - (4)].s); ;} break; case 19: -#line 89 "engines/director/lingo/lingo-gr.y" +#line 90 "engines/director/lingo/lingo-gr.y" + { (yyval.i) = vars[*(yyvsp[(2) - (4)].s)] = (yyvsp[(4) - (4)].i); delete (yyvsp[(2) - (4)].s); ;} + break; + + case 20: +#line 91 "engines/director/lingo/lingo-gr.y" { (yyval.i) = vars[*(yyvsp[(2) - (4)].s)] = (yyvsp[(4) - (4)].i); delete (yyvsp[(2) - (4)].s); ;} break; /* Line 1267 of yacc.c. */ -#line 1443 "engines/director/lingo/lingo-gr.cpp" +#line 1454 "engines/director/lingo/lingo-gr.cpp" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -1653,6 +1664,6 @@ yyreturn: } -#line 92 "engines/director/lingo/lingo-gr.y" +#line 94 "engines/director/lingo/lingo-gr.y" diff --git a/engines/director/lingo/lingo-gr.h b/engines/director/lingo/lingo-gr.h index ae10d1f618..90f23d642e 100644 --- a/engines/director/lingo/lingo-gr.h +++ b/engines/director/lingo/lingo-gr.h @@ -47,8 +47,9 @@ OP_INTO = 263, OP_TO = 264, FUNC_MCI = 265, - FUNC_PUT = 266, - FUNC_SET = 267 + FUNC_MCIWAIT = 266, + FUNC_PUT = 267, + FUNC_SET = 268 }; #endif /* Tokens. */ @@ -60,8 +61,9 @@ #define OP_INTO 263 #define OP_TO 264 #define FUNC_MCI 265 -#define FUNC_PUT 266 -#define FUNC_SET 267 +#define FUNC_MCIWAIT 266 +#define FUNC_PUT 267 +#define FUNC_SET 268 @@ -71,7 +73,7 @@ typedef union YYSTYPE #line 43 "engines/director/lingo/lingo-gr.y" { float f; int i; Common::String *s; } /* Line 1529 of yacc.c. */ -#line 75 "engines/director/lingo/lingo-gr.hpp" +#line 77 "engines/director/lingo/lingo-gr.hpp" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 diff --git a/engines/director/lingo/lingo-gr.y b/engines/director/lingo/lingo-gr.y index 14d80d31fd..d9a33f7bcb 100644 --- a/engines/director/lingo/lingo-gr.y +++ b/engines/director/lingo/lingo-gr.y @@ -50,6 +50,7 @@ extern Lingo *g_lingo; %token OP_INTO %token OP_TO %token FUNC_MCI +%token FUNC_MCIWAIT %token FUNC_PUT %token FUNC_SET @@ -84,6 +85,7 @@ expr: INT { $$ = g_lingo->code2(g_lingo->func_constpush, (inst)$1); } ; func: FUNC_MCI STRING { g_lingo->func_mci($2); delete $2; } + | FUNC_MCIWAIT VAR { g_lingo->func_mciwait($2); } | FUNC_PUT expr OP_INTO VAR { $$ = vars[*$4] = $2; delete $4; } | FUNC_SET VAR '=' expr { $$ = vars[*$2] = $4; delete $2; } | FUNC_SET VAR OP_TO expr { $$ = vars[*$2] = $4; delete $2; } diff --git a/engines/director/lingo/lingo-lex.cpp b/engines/director/lingo/lingo-lex.cpp index b639d53749..e1130aa79b 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 13 -#define YY_END_OF_BUFFER 14 +#define YY_NUM_RULES 14 +#define YY_END_OF_BUFFER 15 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -373,12 +373,12 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[36] = +static yyconst flex_int16_t yy_accept[40] = { 0, - 0, 0, 14, 13, 11, 13, 10, 10, 9, 7, - 7, 7, 7, 7, 7, 11, 0, 12, 1, 8, - 9, 7, 7, 7, 7, 7, 6, 1, 8, 7, - 3, 4, 5, 2, 0 + 0, 0, 15, 14, 12, 14, 11, 11, 10, 8, + 8, 8, 8, 8, 8, 12, 0, 13, 1, 9, + 10, 8, 8, 8, 8, 8, 7, 1, 9, 8, + 3, 5, 6, 2, 8, 8, 8, 4, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -392,10 +392,10 @@ static yyconst flex_int32_t yy_ec[256] = 5, 1, 1, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 1, 1, 1, 5, 9, 1, 9, 9, 10, 9, + 1, 1, 1, 5, 9, 1, 10, 9, 11, 9, - 11, 9, 9, 9, 12, 9, 9, 9, 13, 14, - 15, 16, 9, 9, 17, 18, 19, 9, 9, 9, + 12, 9, 9, 9, 13, 9, 9, 9, 14, 15, + 16, 17, 9, 9, 18, 19, 20, 9, 21, 9, 9, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -413,48 +413,53 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[20] = +static yyconst flex_int32_t yy_meta[22] = { 0, 1, 2, 3, 1, 1, 1, 1, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4 } ; -static yyconst flex_int16_t yy_base[39] = +static yyconst flex_int16_t yy_base[43] = { 0, - 0, 0, 49, 50, 18, 44, 50, 41, 15, 0, - 32, 35, 25, 32, 27, 22, 37, 50, 0, 32, - 19, 0, 21, 26, 19, 18, 0, 0, 26, 18, - 0, 0, 0, 0, 50, 27, 25, 31 + 0, 0, 55, 56, 20, 50, 56, 47, 17, 0, + 37, 40, 30, 37, 32, 24, 43, 56, 0, 38, + 21, 0, 26, 31, 24, 23, 0, 0, 33, 24, + 18, 0, 0, 0, 28, 23, 16, 0, 56, 29, + 27, 33 } ; -static yyconst flex_int16_t yy_def[39] = +static yyconst flex_int16_t yy_def[43] = { 0, - 35, 1, 35, 35, 35, 36, 35, 35, 35, 37, - 37, 37, 37, 37, 37, 35, 36, 35, 38, 35, - 35, 37, 37, 37, 37, 37, 37, 38, 35, 37, - 37, 37, 37, 37, 0, 35, 35, 35 + 39, 1, 39, 39, 39, 40, 39, 39, 39, 41, + 41, 41, 41, 41, 41, 39, 40, 39, 42, 39, + 39, 41, 41, 41, 41, 41, 41, 42, 39, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 0, 39, + 39, 39 } ; -static yyconst flex_int16_t yy_nxt[70] = +static yyconst flex_int16_t yy_nxt[78] = { 0, 4, 5, 5, 6, 7, 8, 4, 9, 10, 10, - 10, 11, 12, 10, 10, 13, 14, 15, 10, 16, - 16, 20, 21, 16, 16, 20, 21, 17, 22, 17, - 17, 28, 34, 29, 28, 33, 32, 31, 30, 29, - 18, 27, 26, 25, 24, 23, 19, 18, 35, 3, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35 + 10, 10, 11, 12, 10, 10, 13, 14, 15, 10, + 10, 16, 16, 20, 21, 16, 16, 20, 21, 17, + 22, 17, 17, 28, 38, 37, 28, 36, 35, 34, + 29, 33, 32, 31, 30, 29, 18, 27, 26, 25, + 24, 23, 19, 18, 39, 3, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39 } ; -static yyconst flex_int16_t yy_chk[70] = +static yyconst flex_int16_t yy_chk[78] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, - 5, 9, 9, 16, 16, 21, 21, 36, 37, 36, - 36, 38, 30, 29, 38, 26, 25, 24, 23, 20, - 17, 15, 14, 13, 12, 11, 8, 6, 3, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 5, 5, 9, 9, 16, 16, 21, 21, 40, + 41, 40, 40, 42, 37, 36, 42, 35, 31, 30, + 29, 26, 25, 24, 23, 20, 17, 15, 14, 13, + 12, 11, 8, 6, 3, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39 } ; static yy_state_type yy_last_accepting_state; @@ -504,7 +509,7 @@ char *yytext; int yyparse(); -#line 508 "engines/director/lingo/lingo-lex.cpp" +#line 513 "engines/director/lingo/lingo-lex.cpp" #define INITIAL 0 @@ -689,7 +694,7 @@ YY_DECL #line 44 "engines/director/lingo/lingo-lex.l" -#line 693 "engines/director/lingo/lingo-lex.cpp" +#line 698 "engines/director/lingo/lingo-lex.cpp" if ( !(yy_init) ) { @@ -742,13 +747,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 >= 36 ) + if ( yy_current_state >= 40 ) 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] != 50 ); + while ( yy_base[yy_current_state] != 56 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -790,55 +795,60 @@ YY_RULE_SETUP case 4: YY_RULE_SETUP #line 49 "engines/director/lingo/lingo-lex.l" -{ return FUNC_PUT; } +{ return FUNC_MCIWAIT; } YY_BREAK case 5: YY_RULE_SETUP #line 50 "engines/director/lingo/lingo-lex.l" -{ return FUNC_SET; } +{ return FUNC_PUT; } YY_BREAK case 6: YY_RULE_SETUP #line 51 "engines/director/lingo/lingo-lex.l" -{ return OP_TO; } +{ return FUNC_SET; } YY_BREAK case 7: YY_RULE_SETUP -#line 53 "engines/director/lingo/lingo-lex.l" -{ yylval.s = new Common::String(yytext); return VAR; } +#line 52 "engines/director/lingo/lingo-lex.l" +{ return OP_TO; } YY_BREAK case 8: YY_RULE_SETUP #line 54 "engines/director/lingo/lingo-lex.l" -{ yylval.f = atof(yytext); return FLOAT; } +{ yylval.s = new Common::String(yytext); return VAR; } YY_BREAK case 9: YY_RULE_SETUP #line 55 "engines/director/lingo/lingo-lex.l" -{ yylval.i = strtol(yytext, NULL, 10); return INT; } +{ yylval.f = atof(yytext); return FLOAT; } YY_BREAK case 10: YY_RULE_SETUP #line 56 "engines/director/lingo/lingo-lex.l" -{ return *yytext; } +{ yylval.i = strtol(yytext, NULL, 10); return INT; } YY_BREAK case 11: -/* rule 11 can match eol */ YY_RULE_SETUP #line 57 "engines/director/lingo/lingo-lex.l" -{ return '\n'; } +{ return *yytext; } YY_BREAK case 12: +/* rule 12 can match eol */ YY_RULE_SETUP #line 58 "engines/director/lingo/lingo-lex.l" -{ yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return STRING; } +{ return '\n'; } YY_BREAK case 13: YY_RULE_SETUP -#line 60 "engines/director/lingo/lingo-lex.l" +#line 59 "engines/director/lingo/lingo-lex.l" +{ yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return STRING; } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 61 "engines/director/lingo/lingo-lex.l" ECHO; YY_BREAK -#line 842 "engines/director/lingo/lingo-lex.cpp" +#line 852 "engines/director/lingo/lingo-lex.cpp" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1130,7 +1140,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 >= 36 ) + if ( yy_current_state >= 40 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1158,11 +1168,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 >= 36 ) + if ( yy_current_state >= 40 ) 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 == 35); + yy_is_jam = (yy_current_state == 39); return yy_is_jam ? 0 : yy_current_state; } @@ -1835,7 +1845,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 60 "engines/director/lingo/lingo-lex.l" +#line 61 "engines/director/lingo/lingo-lex.l" diff --git a/engines/director/lingo/lingo-lex.l b/engines/director/lingo/lingo-lex.l index a206f961c6..e2a57d71b2 100644 --- a/engines/director/lingo/lingo-lex.l +++ b/engines/director/lingo/lingo-lex.l @@ -46,6 +46,7 @@ newline [\n\r]+ --[^\r\n]* into { return OP_INTO; } mci { return FUNC_MCI; } +mciwait { return FUNC_MCIWAIT; } put { return FUNC_PUT; } set { return FUNC_SET; } to { return OP_TO; } diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h index 2e5c7b47eb..65a9fec417 100644 --- a/engines/director/lingo/lingo.h +++ b/engines/director/lingo/lingo.h @@ -99,6 +99,7 @@ public: static void func_negate(); static void func_constpush(); int func_mci(Common::String *s); + void func_mciwait(Common::String *s); private: Common::HashMap<uint32, const char *> _eventHandlerTypes; |