Skip to content

Commit

Permalink
DIRECTOR: Lingo: Added mciwait function stub
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Aug 3, 2016
1 parent f58de43 commit 612a480
Show file tree
Hide file tree
Showing 7 changed files with 174 additions and 143 deletions.
4 changes: 4 additions & 0 deletions engines/director/lingo/lingo-funcs.cpp
Expand Up @@ -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() {
}

Expand Down
173 changes: 92 additions & 81 deletions engines/director/lingo/lingo-gr.cpp
Expand Up @@ -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. */
Expand All @@ -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



Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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,
Expand All @@ -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
Expand All @@ -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

Expand All @@ -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

Expand All @@ -463,57 +467,59 @@ 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
STATE-NUM when YYTABLE doesn't specify something else to do. Zero
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
Expand All @@ -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)
Expand Down Expand Up @@ -1363,83 +1369,88 @@ yyparse ()
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);
Expand Down Expand Up @@ -1653,6 +1664,6 @@ yyparse ()
}


#line 92 "engines/director/lingo/lingo-gr.y"
#line 94 "engines/director/lingo/lingo-gr.y"


0 comments on commit 612a480

Please sign in to comment.