[Scummvm-git-logs] scummvm master -> ca7b45c2ed07cebbb2c55a3801d33a6238d886dd
neuromancer
noreply at scummvm.org
Mon Nov 17 10:10:12 UTC 2025
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
2f56f7ba9f HYPNO: Fix memory leaks in grammars
ca7b45c2ed HYPNO: Fix memory leaks
Commit: 2f56f7ba9f3e8306333ce32c31acfbea3f632e37
https://github.com/scummvm/scummvm/commit/2f56f7ba9f3e8306333ce32c31acfbea3f632e37
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-11-17T11:10:07+01:00
Commit Message:
HYPNO: Fix memory leaks in grammars
Also move the global variables in the Hypno namespace.
Fix the token types when they don't return a string.
Changed paths:
engines/hypno/grammar_arc.cpp
engines/hypno/grammar_arc.y
engines/hypno/grammar_mis.cpp
engines/hypno/grammar_mis.y
engines/hypno/lexer_arc.cpp
engines/hypno/lexer_arc.l
engines/hypno/lexer_mis.cpp
engines/hypno/lexer_mis.l
engines/hypno/tokens_arc.h
engines/hypno/tokens_mis.h
diff --git a/engines/hypno/grammar_arc.cpp b/engines/hypno/grammar_arc.cpp
index b66af7d024c..1e2ffc41a10 100644
--- a/engines/hypno/grammar_arc.cpp
+++ b/engines/hypno/grammar_arc.cpp
@@ -84,7 +84,9 @@
#undef yyerror
#define yyerror HYPNO_ARC_xerror
-Hypno::Shoot *shoot;
+namespace Hypno {
+Shoot *shoot = NULL;
+}
extern int HYPNO_ARC_lex();
extern int HYPNO_ARC_lineno;
@@ -143,7 +145,7 @@ void parseSN(const char *sn, const char *path, const char *enc, const char *flag
}
-#line 147 "engines/hypno/grammar_arc.cpp"
+#line 149 "engines/hypno/grammar_arc.cpp"
# ifndef YY_CAST
# ifdef __cplusplus
@@ -178,24 +180,24 @@ enum yysymbol_kind_t
YYSYMBOL_FILENAME = 4, /* FILENAME */
YYSYMBOL_BNTOK = 5, /* BNTOK */
YYSYMBOL_SNTOK = 6, /* SNTOK */
- YYSYMBOL_KNTOK = 7, /* KNTOK */
- YYSYMBOL_YXTOK = 8, /* YXTOK */
- YYSYMBOL_FNTOK = 9, /* FNTOK */
- YYSYMBOL_ENCTOK = 10, /* ENCTOK */
- YYSYMBOL_ONTOK = 11, /* ONTOK */
- YYSYMBOL_H12TOK = 12, /* H12TOK */
- YYSYMBOL_NUM = 13, /* NUM */
- YYSYMBOL_BYTE = 14, /* BYTE */
- YYSYMBOL_COMMENT = 15, /* COMMENT */
- YYSYMBOL_ALTOK = 16, /* ALTOK */
- YYSYMBOL_AVTOK = 17, /* AVTOK */
- YYSYMBOL_ABTOK = 18, /* ABTOK */
- YYSYMBOL_CTOK = 19, /* CTOK */
- YYSYMBOL_DTOK = 20, /* DTOK */
- YYSYMBOL_HTOK = 21, /* HTOK */
- YYSYMBOL_HETOK = 22, /* HETOK */
- YYSYMBOL_HLTOK = 23, /* HLTOK */
- YYSYMBOL_HUTOK = 24, /* HUTOK */
+ YYSYMBOL_YXTOK = 7, /* YXTOK */
+ YYSYMBOL_FNTOK = 8, /* FNTOK */
+ YYSYMBOL_ENCTOK = 9, /* ENCTOK */
+ YYSYMBOL_ONTOK = 10, /* ONTOK */
+ YYSYMBOL_H12TOK = 11, /* H12TOK */
+ YYSYMBOL_NUM = 12, /* NUM */
+ YYSYMBOL_BYTE = 13, /* BYTE */
+ YYSYMBOL_COMMENT = 14, /* COMMENT */
+ YYSYMBOL_ALTOK = 15, /* ALTOK */
+ YYSYMBOL_AVTOK = 16, /* AVTOK */
+ YYSYMBOL_ABTOK = 17, /* ABTOK */
+ YYSYMBOL_CTOK = 18, /* CTOK */
+ YYSYMBOL_DTOK = 19, /* DTOK */
+ YYSYMBOL_HTOK = 20, /* HTOK */
+ YYSYMBOL_HETOK = 21, /* HETOK */
+ YYSYMBOL_HLTOK = 22, /* HLTOK */
+ YYSYMBOL_HUTOK = 23, /* HUTOK */
+ YYSYMBOL_KNTOK = 24, /* KNTOK */
YYSYMBOL_RETTOK = 25, /* RETTOK */
YYSYMBOL_QTOK = 26, /* QTOK */
YYSYMBOL_RESTOK = 27, /* RESTOK */
@@ -567,7 +569,7 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 6
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 217
+#define YYLAST 216
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 60
@@ -631,18 +633,18 @@ static const yytype_int8 yytranslate[] =
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_int16 yyrline[] =
{
- 0, 120, 120, 120, 121, 124, 125, 126, 129, 133,
- 137, 141, 142, 145, 149, 154, 158, 162, 167, 177,
- 186, 191, 197, 202, 215, 220, 224, 228, 232, 235,
- 239, 242, 243, 271, 274, 277, 283, 288, 293, 299,
- 304, 309, 314, 319, 324, 331, 332, 335, 336, 339,
- 340, 341, 344, 354, 359, 364, 369, 372, 375, 380,
- 385, 390, 394, 398, 402, 406, 410, 414, 418, 422,
- 426, 430, 434, 438, 442, 446, 450, 454, 458, 462,
- 466, 470, 474, 478, 481, 485, 490, 495, 498, 503,
- 508, 512, 518, 522, 525, 526, 527, 530, 534, 537,
- 542, 545, 546, 550, 557, 561, 576, 580, 581, 587,
- 591, 595, 598, 601, 603
+ 0, 122, 122, 122, 123, 126, 127, 128, 131, 135,
+ 139, 143, 144, 147, 152, 157, 161, 165, 170, 182,
+ 192, 198, 205, 212, 228, 234, 238, 243, 248, 253,
+ 258, 262, 263, 293, 300, 307, 313, 318, 323, 330,
+ 335, 340, 345, 350, 356, 363, 364, 367, 368, 371,
+ 372, 373, 376, 389, 394, 399, 404, 407, 410, 415,
+ 422, 429, 434, 439, 443, 447, 451, 455, 459, 463,
+ 468, 472, 476, 480, 484, 488, 492, 496, 500, 505,
+ 509, 513, 517, 521, 524, 528, 533, 538, 541, 547,
+ 552, 556, 562, 566, 569, 570, 571, 574, 578, 581,
+ 586, 589, 590, 594, 601, 605, 624, 629, 630, 636,
+ 640, 644, 647, 650, 652
};
#endif
@@ -659,9 +661,9 @@ static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
static const char *const yytname[] =
{
"\"end of file\"", "error", "\"invalid token\"", "NAME", "FILENAME",
- "BNTOK", "SNTOK", "KNTOK", "YXTOK", "FNTOK", "ENCTOK", "ONTOK", "H12TOK",
- "NUM", "BYTE", "COMMENT", "ALTOK", "AVTOK", "ABTOK", "CTOK", "DTOK",
- "HTOK", "HETOK", "HLTOK", "HUTOK", "RETTOK", "QTOK", "RESTOK", "PTOK",
+ "BNTOK", "SNTOK", "YXTOK", "FNTOK", "ENCTOK", "ONTOK", "H12TOK", "NUM",
+ "BYTE", "COMMENT", "ALTOK", "AVTOK", "ABTOK", "CTOK", "DTOK", "HTOK",
+ "HETOK", "HLTOK", "HUTOK", "KNTOK", "RETTOK", "QTOK", "RESTOK", "PTOK",
"FTOK", "TTOK", "TATOK", "TPTOK", "TSTOK", "ATOK", "VTOK", "OTOK",
"LTOK", "MTOK", "NTOK", "NRTOK", "NSTOK", "RTOK", "R0TOK", "R1TOK",
"ITOK", "I1TOK", "GTOK", "JTOK", "J0TOK", "KTOK", "UTOK", "ZTOK",
@@ -691,28 +693,28 @@ yysymbol_name (yysymbol_kind_t yysymbol)
STATE-NUM. */
static const yytype_int16 yypact[] =
{
- 46, -123, 46, 11, 101, -123, -123, 15, 16, 10,
- 44, 48, 49, 135, 50, 51, 53, 101, 55, 56,
- 57, 0, 59, 2, 20, 63, 36, 64, 75, 77,
- 81, 82, 83, 85, 84, 42, 101, -123, 19, 87,
- 90, -123, -123, 95, 96, 97, 98, 102, 103, 104,
- 105, 106, -123, 115, 128, -123, 131, 132, 91, 137,
- 138, 140, 141, 142, -123, 143, -123, -123, -123, -123,
- -123, -123, 144, 73, -123, -123, -123, 111, 148, -123,
- 146, 147, 149, 151, 152, 153, 154, 155, 157, 158,
- -123, -123, -123, -123, 111, 169, 170, 162, -123, -123,
- -123, 163, -4, -123, -123, -123, -123, -123, -123, -123,
- -123, -123, -123, -123, -123, 148, -123, -123, -123, 165,
- 166, 176, 168, 3, 171, 172, 173, 174, 5, 175,
- -4, 178, 177, 179, 180, 181, 182, -123, -123, 183,
- 184, 185, 54, -123, 186, 187, 188, -123, 189, 190,
- 191, 126, -4, -123, -123, 192, 148, 193, -123, -123,
- -123, -123, -123, -123, -123, -123, -123, -123, -123, -123,
- 194, -123, 195, 196, -123, 197, 198, 199, -123, -123,
+ 42, -123, 42, 18, 101, -123, -123, 15, 24, 41,
+ 45, 49, 50, 66, 51, 53, 55, 101, 58, 59,
+ 63, 1, 64, 2, 73, 69, -3, 74, 81, 83,
+ 85, 91, 93, 94, 97, 11, 101, -123, 20, 98,
+ 102, -123, -123, 103, 104, 105, 106, 113, 116, 126,
+ 129, 132, -123, 133, 136, -123, 137, 138, 109, 139,
+ 141, 142, 143, 144, -123, 145, -123, -123, -123, -123,
+ -123, -123, 146, 134, -123, -123, -123, 157, 152, -123,
+ 150, 151, 153, 154, 155, 156, 158, 159, 160, 161,
+ -123, -123, -123, -123, 157, 165, 170, 163, -123, -123,
+ -123, 164, -4, -123, -123, -123, -123, -123, -123, -123,
+ -123, -123, -123, -123, -123, 152, -123, -123, -123, 166,
+ 167, 173, 3, 168, 169, 171, 172, 5, 174, 175,
+ -4, 178, 176, 177, 179, 180, 181, -123, -123, 182,
+ 183, 184, 54, -123, 185, 186, 187, -123, 188, 189,
+ 190, 107, -4, -123, -123, 191, 152, -123, -123, -123,
+ -123, -123, -123, -123, -123, -123, -123, 192, -123, -123,
+ 193, -123, 194, 195, -123, 196, 197, 198, -123, -123,
-123, -123, -123, -123, -123, -123, -123, -123, -123, -123,
-123, -123, -123, -123, -123, -123, -123, -123, -123, -123,
- -123, -123, 200, 201, 202, -123, -123, -123, -123, -123,
- -123, 203, -123, -123, -123, -123, -123, 204, -123, -123,
+ -123, -123, 199, 200, 201, -123, -123, -123, -123, -123,
+ -123, 202, -123, -123, -123, -123, -123, 203, -123, -123,
-123, -123
};
@@ -736,8 +738,8 @@ static const yytype_int8 yydefact[] =
0, 106, 0, 0, 0, 0, 0, 0, 0, 0,
51, 0, 110, 95, 0, 0, 111, 112, 113, 0,
0, 0, 0, 107, 0, 0, 101, 114, 0, 0,
- 0, 0, 51, 23, 14, 0, 46, 0, 52, 59,
- 54, 53, 55, 92, 97, 56, 57, 93, 50, 60,
+ 0, 0, 51, 23, 14, 0, 46, 52, 59, 54,
+ 53, 55, 92, 97, 56, 57, 93, 0, 50, 60,
109, 94, 0, 99, 100, 0, 0, 0, 61, 62,
78, 69, 64, 65, 68, 76, 75, 66, 79, 63,
74, 80, 81, 73, 77, 70, 67, 71, 72, 82,
@@ -749,7 +751,7 @@ static const yytype_int8 yydefact[] =
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
- -123, 159, -123, -8, -123, -78, -67, -122, -123
+ -123, 214, -123, -14, -123, -78, -67, -122, -123
};
/* YYDEFGOTO[NTERM-NUM]. */
@@ -763,83 +765,83 @@ static const yytype_uint8 yydefgoto[] =
number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_uint8 yytable[] =
{
- 104, 120, 121, 122, 56, 123, 59, 158, 168, 52,
- 103, 6, 124, 125, 126, 127, 128, 129, 164, 37,
- 38, 130, 75, 39, 61, 131, 132, 115, 74, 76,
+ 104, 120, 121, 52, 122, 56, 59, 157, 168, 63,
+ 103, 123, 124, 125, 126, 127, 128, 163, 6, 37,
+ 129, 130, 74, 75, 64, 131, 132, 115, 38, 76,
207, 133, 134, 135, 136, 137, 138, 153, 139, 140,
- 141, 142, 165, 143, 144, 145, 146, 166, 147, 63,
- 148, 149, 150, 57, 1, 60, 159, 178, 40, 179,
- 180, 41, 42, 64, 49, 50, 181, 51, 53, 54,
- 55, 2, 58, 182, 183, 184, 62, 65, 209, 66,
- 185, 67, 186, 187, 188, 68, 69, 70, 189, 71,
- 190, 191, 192, 193, 73, 94, 194, 72, 102, 195,
- 79, 196, 197, 80, 198, 199, 7, 8, 81, 82,
- 83, 84, 9, 10, 75, 85, 86, 87, 88, 89,
- 11, 12, 13, 14, 15, 16, 17, 18, 90, 19,
- 20, 21, 22, 23, 24, 25, 26, 27, 43, 28,
- 29, 91, 30, 31, 92, 93, 32, 33, 0, 44,
- 95, 96, 34, 97, 98, 99, 100, 101, 76, 105,
- 106, 5, 107, 45, 108, 109, 110, 111, 112, 46,
- 113, 114, 47, 116, 117, 118, 119, 48, 154, 155,
- 156, 157, 169, 206, 160, 161, 162, 163, 167, 0,
- 170, 0, 171, 172, 173, 174, 175, 176, 177, 200,
- 201, 202, 203, 204, 205, 208, 210, 211, 212, 213,
- 214, 215, 216, 217, 218, 219, 220, 221
+ 141, 142, 164, 143, 144, 145, 146, 165, 147, 1,
+ 148, 149, 150, 39, 57, 60, 158, 178, 40, 179,
+ 180, 41, 42, 73, 49, 181, 50, 2, 51, 43,
+ 53, 54, 182, 183, 184, 55, 58, 61, 209, 44,
+ 185, 62, 186, 187, 188, 66, 65, 67, 189, 68,
+ 190, 191, 192, 193, 45, 69, 194, 70, 71, 195,
+ 46, 196, 197, 47, 198, 199, 7, 8, 48, 72,
+ 79, 9, 10, 94, 80, 81, 82, 83, 84, 11,
+ 12, 13, 14, 15, 16, 85, 17, 18, 86, 19,
+ 20, 21, 22, 23, 24, 25, 26, 27, 87, 28,
+ 29, 88, 30, 31, 89, 90, 32, 33, 91, 92,
+ 93, 95, 34, 96, 97, 98, 99, 100, 101, 102,
+ 75, 76, 105, 106, 206, 107, 108, 109, 110, 116,
+ 111, 112, 113, 114, 117, 118, 119, 156, 154, 155,
+ 159, 160, 169, 161, 162, 0, 166, 167, 170, 171,
+ 0, 172, 173, 174, 175, 176, 177, 200, 201, 202,
+ 203, 204, 205, 208, 210, 211, 212, 213, 214, 215,
+ 216, 217, 218, 219, 220, 221, 5
};
static const yytype_int16 yycheck[] =
{
- 78, 5, 6, 7, 4, 9, 4, 4, 130, 17,
- 77, 0, 16, 17, 18, 19, 20, 21, 13, 4,
- 4, 25, 3, 13, 4, 29, 30, 94, 36, 10,
+ 78, 5, 6, 17, 8, 4, 4, 4, 130, 12,
+ 77, 15, 16, 17, 18, 19, 20, 12, 0, 4,
+ 24, 25, 36, 3, 27, 29, 30, 94, 4, 9,
152, 35, 36, 37, 38, 39, 40, 115, 42, 43,
- 44, 45, 37, 47, 48, 49, 50, 42, 52, 13,
- 54, 55, 56, 53, 8, 53, 53, 3, 14, 5,
- 6, 13, 13, 27, 14, 14, 12, 14, 13, 13,
- 13, 25, 13, 19, 20, 21, 13, 13, 156, 4,
- 26, 4, 28, 29, 30, 4, 4, 4, 34, 4,
- 36, 37, 38, 39, 52, 4, 42, 13, 25, 45,
- 13, 47, 48, 13, 50, 51, 5, 6, 13, 13,
- 13, 13, 11, 12, 3, 13, 13, 13, 13, 13,
- 19, 20, 21, 22, 23, 24, 25, 26, 13, 28,
- 29, 30, 31, 32, 33, 34, 35, 36, 3, 38,
- 39, 13, 41, 42, 13, 13, 45, 46, -1, 14,
- 13, 13, 51, 13, 13, 13, 13, 13, 10, 13,
- 13, 2, 13, 28, 13, 13, 13, 13, 13, 34,
- 13, 13, 37, 4, 4, 13, 13, 42, 13, 13,
- 4, 13, 4, 57, 13, 13, 13, 13, 13, -1,
- 13, -1, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13
+ 44, 45, 37, 47, 48, 49, 50, 42, 52, 7,
+ 54, 55, 56, 12, 53, 53, 53, 3, 13, 5,
+ 6, 12, 12, 52, 13, 11, 13, 25, 13, 3,
+ 12, 12, 18, 19, 20, 12, 12, 4, 156, 13,
+ 26, 12, 28, 29, 30, 4, 12, 4, 34, 4,
+ 36, 37, 38, 39, 28, 4, 42, 4, 4, 45,
+ 34, 47, 48, 37, 50, 51, 5, 6, 42, 12,
+ 12, 10, 11, 4, 12, 12, 12, 12, 12, 18,
+ 19, 20, 21, 22, 23, 12, 25, 26, 12, 28,
+ 29, 30, 31, 32, 33, 34, 35, 36, 12, 38,
+ 39, 12, 41, 42, 12, 12, 45, 46, 12, 12,
+ 12, 12, 51, 12, 12, 12, 12, 12, 12, 25,
+ 3, 9, 12, 12, 57, 12, 12, 12, 12, 4,
+ 12, 12, 12, 12, 4, 12, 12, 4, 12, 12,
+ 12, 12, 4, 12, 12, -1, 12, 12, 12, 12,
+ -1, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 2
};
/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
state STATE-NUM. */
static const yytype_int8 yystos[] =
{
- 0, 8, 25, 61, 62, 61, 0, 5, 6, 11,
- 12, 19, 20, 21, 22, 23, 24, 25, 26, 28,
+ 0, 7, 25, 61, 62, 61, 0, 5, 6, 10,
+ 11, 18, 19, 20, 21, 22, 23, 25, 26, 28,
29, 30, 31, 32, 33, 34, 35, 36, 38, 39,
- 41, 42, 45, 46, 51, 63, 64, 4, 4, 13,
- 14, 13, 13, 3, 14, 28, 34, 37, 42, 14,
- 14, 14, 63, 13, 13, 13, 4, 53, 13, 4,
- 53, 4, 13, 13, 27, 13, 4, 4, 4, 4,
- 4, 4, 13, 52, 63, 3, 10, 65, 66, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 4, 13, 13, 13, 13, 13,
- 13, 13, 25, 66, 65, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 66, 4, 4, 13, 13,
- 5, 6, 7, 9, 16, 17, 18, 19, 20, 21,
+ 41, 42, 45, 46, 51, 63, 64, 4, 4, 12,
+ 13, 12, 12, 3, 13, 28, 34, 37, 42, 13,
+ 13, 13, 63, 12, 12, 12, 4, 53, 12, 4,
+ 53, 4, 12, 12, 27, 12, 4, 4, 4, 4,
+ 4, 4, 12, 52, 63, 3, 9, 65, 66, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 4, 12, 12, 12, 12, 12,
+ 12, 12, 25, 66, 65, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 66, 4, 4, 12, 12,
+ 5, 6, 8, 15, 16, 17, 18, 19, 20, 24,
25, 29, 30, 35, 36, 37, 38, 39, 40, 42,
43, 44, 45, 47, 48, 49, 50, 52, 54, 55,
- 56, 67, 68, 65, 13, 13, 4, 13, 4, 53,
- 13, 13, 13, 13, 13, 37, 42, 13, 67, 4,
- 13, 13, 13, 13, 13, 13, 13, 13, 3, 5,
- 6, 12, 19, 20, 21, 26, 28, 29, 30, 34,
+ 56, 67, 68, 65, 12, 12, 4, 4, 53, 12,
+ 12, 12, 12, 12, 37, 42, 12, 12, 67, 4,
+ 12, 12, 12, 12, 12, 12, 12, 12, 3, 5,
+ 6, 11, 18, 19, 20, 26, 28, 29, 30, 34,
36, 37, 38, 39, 42, 45, 47, 48, 50, 51,
- 13, 13, 13, 13, 13, 13, 57, 67, 13, 65,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13
+ 12, 12, 12, 12, 12, 12, 57, 67, 12, 65,
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12
};
/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
@@ -1337,101 +1339,102 @@ yyreduce:
switch (yyn)
{
case 2: /* $@1: %empty */
-#line 120 "engines/hypno/grammar_arc.y"
- { g_parsedArc->mode = (yyvsp[0].s); }
-#line 1343 "engines/hypno/grammar_arc.cpp"
+#line 122 "engines/hypno/grammar_arc.y"
+ { g_parsedArc->mode = (yyvsp[0].s); free((yyvsp[0].s)); }
+#line 1345 "engines/hypno/grammar_arc.cpp"
break;
case 8: /* hline: CTOK NUM */
-#line 129 "engines/hypno/grammar_arc.y"
+#line 131 "engines/hypno/grammar_arc.y"
{
g_parsedArc->id = (yyvsp[0].i);
HYPNO_ARC_default_sound_rate = 0;
debugC(1, kHypnoDebugParser, "C %d", (yyvsp[0].i)); }
-#line 1352 "engines/hypno/grammar_arc.cpp"
+#line 1354 "engines/hypno/grammar_arc.cpp"
break;
case 9: /* hline: FTOK NUM */
-#line 133 "engines/hypno/grammar_arc.y"
+#line 135 "engines/hypno/grammar_arc.y"
{
HYPNO_ARC_default_sound_rate = (yyvsp[0].i);
debugC(1, kHypnoDebugParser, "F %d", (yyvsp[0].i));
}
-#line 1361 "engines/hypno/grammar_arc.cpp"
+#line 1363 "engines/hypno/grammar_arc.cpp"
break;
case 10: /* hline: DTOK NUM */
-#line 137 "engines/hypno/grammar_arc.y"
+#line 139 "engines/hypno/grammar_arc.y"
{
g_parsedArc->frameDelay = (yyvsp[0].i);
debugC(1, kHypnoDebugParser, "D %d", (yyvsp[0].i));
}
-#line 1370 "engines/hypno/grammar_arc.cpp"
+#line 1372 "engines/hypno/grammar_arc.cpp"
break;
case 11: /* hline: PTOK NUM NUM */
-#line 141 "engines/hypno/grammar_arc.y"
+#line 143 "engines/hypno/grammar_arc.y"
{ debugC(1, kHypnoDebugParser, "P %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1376 "engines/hypno/grammar_arc.cpp"
+#line 1378 "engines/hypno/grammar_arc.cpp"
break;
case 12: /* hline: ATOK NUM NUM */
-#line 142 "engines/hypno/grammar_arc.y"
+#line 144 "engines/hypno/grammar_arc.y"
{ g_parsedArc->anchor = Common::Point((yyvsp[-1].i), (yyvsp[0].i));
debugC(1, kHypnoDebugParser, "A %d %d", (yyvsp[-1].i), (yyvsp[0].i));
}
-#line 1384 "engines/hypno/grammar_arc.cpp"
+#line 1386 "engines/hypno/grammar_arc.cpp"
break;
case 13: /* hline: MTOK FILENAME */
-#line 145 "engines/hypno/grammar_arc.y"
+#line 147 "engines/hypno/grammar_arc.y"
{
debugC(1, kHypnoDebugParser, "M %s", (yyvsp[0].s));
g_parsedArc->maskVideo = (yyvsp[0].s);
+ free((yyvsp[0].s));
}
-#line 1393 "engines/hypno/grammar_arc.cpp"
+#line 1396 "engines/hypno/grammar_arc.cpp"
break;
case 14: /* hline: UTOK NUM NUM NUM NUM */
-#line 149 "engines/hypno/grammar_arc.y"
+#line 152 "engines/hypno/grammar_arc.y"
{
debugC(1, kHypnoDebugParser, "U %d %d %d %d", (yyvsp[-3].i), (yyvsp[-2].i), (yyvsp[-1].i), (yyvsp[0].i));
ScriptInfo si((yyvsp[-3].i), (yyvsp[-2].i), (yyvsp[-1].i), (yyvsp[0].i));
g_parsedArc->script.push_back(si);
}
-#line 1403 "engines/hypno/grammar_arc.cpp"
+#line 1406 "engines/hypno/grammar_arc.cpp"
break;
case 15: /* hline: VTOK NUM NUM */
-#line 154 "engines/hypno/grammar_arc.y"
+#line 157 "engines/hypno/grammar_arc.y"
{
debugC(1, kHypnoDebugParser, "V %d %d", (yyvsp[-1].i), (yyvsp[0].i));
g_parsedArc->mouseBox = Common::Rect(0, 0, (yyvsp[-1].i), (yyvsp[0].i));
}
-#line 1412 "engines/hypno/grammar_arc.cpp"
+#line 1415 "engines/hypno/grammar_arc.cpp"
break;
case 16: /* hline: VTOK RESTOK */
-#line 158 "engines/hypno/grammar_arc.y"
+#line 161 "engines/hypno/grammar_arc.y"
{
debugC(1, kHypnoDebugParser, "V 320,200");
g_parsedArc->mouseBox = Common::Rect(0, 0, 320, 200);
}
-#line 1421 "engines/hypno/grammar_arc.cpp"
+#line 1424 "engines/hypno/grammar_arc.cpp"
break;
case 17: /* hline: OTOK NUM NUM */
-#line 162 "engines/hypno/grammar_arc.y"
+#line 165 "engines/hypno/grammar_arc.y"
{
g_parsedArc->objKillsRequired[0] = (yyvsp[-1].i);
g_parsedArc->objMissesAllowed[0] = (yyvsp[0].i);
debugC(1, kHypnoDebugParser, "O %d %d", (yyvsp[-1].i), (yyvsp[0].i));
}
-#line 1431 "engines/hypno/grammar_arc.cpp"
+#line 1434 "engines/hypno/grammar_arc.cpp"
break;
case 18: /* hline: ONTOK NUM NUM */
-#line 167 "engines/hypno/grammar_arc.y"
+#line 170 "engines/hypno/grammar_arc.y"
{
if (Common::String("O0") == (yyvsp[-2].s)) {
g_parsedArc->objKillsRequired[0] = (yyvsp[-1].i);
@@ -1441,12 +1444,14 @@ yyreduce:
g_parsedArc->objMissesAllowed[1] = (yyvsp[0].i);
} else
error("Invalid objective: '%s'", (yyvsp[-2].s));
- debugC(1, kHypnoDebugParser, "ON %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1446 "engines/hypno/grammar_arc.cpp"
+ debugC(1, kHypnoDebugParser, "ON %d %d", (yyvsp[-1].i), (yyvsp[0].i));
+ free((yyvsp[-2].s));
+ }
+#line 1451 "engines/hypno/grammar_arc.cpp"
break;
case 19: /* hline: ONTOK NUM */
-#line 177 "engines/hypno/grammar_arc.y"
+#line 182 "engines/hypno/grammar_arc.y"
{
if (Common::String("O0") == (yyvsp[-1].s)) {
g_parsedArc->objKillsRequired[0] = (yyvsp[0].i);
@@ -1455,43 +1460,48 @@ yyreduce:
} else
error("Invalid objective: '%s'", (yyvsp[-1].s));
debugC(1, kHypnoDebugParser, "ON %d", (yyvsp[0].i));
+ free((yyvsp[-1].s));
}
-#line 1460 "engines/hypno/grammar_arc.cpp"
+#line 1466 "engines/hypno/grammar_arc.cpp"
break;
case 20: /* hline: TPTOK NONETOK NUM FILENAME */
-#line 186 "engines/hypno/grammar_arc.y"
+#line 192 "engines/hypno/grammar_arc.y"
{
ArcadeTransition at("NONE", (yyvsp[0].s), "", 0, (yyvsp[-1].i));
g_parsedArc->transitions.push_back(at);
debugC(1, kHypnoDebugParser, "Tp %s %d %s", "NONE", (yyvsp[-1].i), (yyvsp[0].s));
+ free((yyvsp[0].s));
}
-#line 1470 "engines/hypno/grammar_arc.cpp"
+#line 1477 "engines/hypno/grammar_arc.cpp"
break;
case 21: /* hline: TSTOK FILENAME NUM NUM */
-#line 191 "engines/hypno/grammar_arc.y"
+#line 198 "engines/hypno/grammar_arc.y"
{
ArcadeTransition at((yyvsp[-2].s), "", "", 0, (yyvsp[-1].i));
at.selection = true;
g_parsedArc->transitions.push_back(at);
debugC(1, kHypnoDebugParser, "Ts %s %d %d", (yyvsp[-2].s), (yyvsp[-1].i), (yyvsp[0].i));
+ free((yyvsp[-2].s));
}
-#line 1481 "engines/hypno/grammar_arc.cpp"
+#line 1489 "engines/hypno/grammar_arc.cpp"
break;
case 22: /* hline: TPTOK FILENAME NUM FILENAME */
-#line 197 "engines/hypno/grammar_arc.y"
+#line 205 "engines/hypno/grammar_arc.y"
{
ArcadeTransition at((yyvsp[-2].s), (yyvsp[0].s), "", 0, (yyvsp[-1].i));
g_parsedArc->transitions.push_back(at);
debugC(1, kHypnoDebugParser, "Tp %s %d %s", (yyvsp[-2].s), (yyvsp[-1].i), (yyvsp[0].s));
+ free((yyvsp[-2].s));
+ free((yyvsp[0].s));
}
-#line 1491 "engines/hypno/grammar_arc.cpp"
+#line 1501 "engines/hypno/grammar_arc.cpp"
break;
case 23: /* hline: TATOK NUM FILENAME flag enc */
-#line 202 "engines/hypno/grammar_arc.y"
+#line 212 "engines/hypno/grammar_arc.y"
{
uint32 sampleRate = 11025;
bool stereo = false;
@@ -1504,80 +1514,90 @@ yyreduce:
at.soundStereo = stereo;
g_parsedArc->transitions.push_back(at);
debugC(1, kHypnoDebugParser, "Ta %d %s", (yyvsp[-3].i), (yyvsp[-2].s));
+ free((yyvsp[-2].s));
+ free((yyvsp[-1].s));
+ free((yyvsp[0].s));
}
-#line 1509 "engines/hypno/grammar_arc.cpp"
+#line 1522 "engines/hypno/grammar_arc.cpp"
break;
case 24: /* hline: TTOK FILENAME NUM */
-#line 215 "engines/hypno/grammar_arc.y"
+#line 228 "engines/hypno/grammar_arc.y"
{
ArcadeTransition at((yyvsp[-1].s), "", "", 0, (yyvsp[0].i));
g_parsedArc->transitions.push_back(at);
debugC(1, kHypnoDebugParser, "T %s %d", (yyvsp[-1].s), (yyvsp[0].i));
+ free((yyvsp[-1].s));
}
-#line 1519 "engines/hypno/grammar_arc.cpp"
+#line 1533 "engines/hypno/grammar_arc.cpp"
break;
case 25: /* hline: TTOK NONETOK NUM */
-#line 220 "engines/hypno/grammar_arc.y"
+#line 234 "engines/hypno/grammar_arc.y"
{
ArcadeTransition at("NONE", "", "", 0, (yyvsp[0].i));
g_parsedArc->transitions.push_back(at);
debugC(1, kHypnoDebugParser, "T NONE %d", (yyvsp[0].i)); }
-#line 1528 "engines/hypno/grammar_arc.cpp"
+#line 1542 "engines/hypno/grammar_arc.cpp"
break;
case 26: /* hline: NTOK FILENAME */
-#line 224 "engines/hypno/grammar_arc.y"
+#line 238 "engines/hypno/grammar_arc.y"
{
g_parsedArc->backgroundVideo = (yyvsp[0].s);
debugC(1, kHypnoDebugParser, "N %s", (yyvsp[0].s));
+ free((yyvsp[0].s));
}
-#line 1537 "engines/hypno/grammar_arc.cpp"
+#line 1552 "engines/hypno/grammar_arc.cpp"
break;
case 27: /* hline: NSTOK FILENAME */
-#line 228 "engines/hypno/grammar_arc.y"
+#line 243 "engines/hypno/grammar_arc.y"
{
g_parsedArc->backgroundVideo = (yyvsp[0].s);
debugC(1, kHypnoDebugParser, "N* %s", (yyvsp[0].s));
+ free((yyvsp[0].s));
}
-#line 1546 "engines/hypno/grammar_arc.cpp"
+#line 1562 "engines/hypno/grammar_arc.cpp"
break;
case 28: /* hline: RTOK FILENAME */
-#line 232 "engines/hypno/grammar_arc.y"
+#line 248 "engines/hypno/grammar_arc.y"
{
g_parsedArc->backgroundPalette = (yyvsp[0].s);
- debugC(1, kHypnoDebugParser, "R %s", (yyvsp[0].s)); }
-#line 1554 "engines/hypno/grammar_arc.cpp"
+ debugC(1, kHypnoDebugParser, "R %s", (yyvsp[0].s));
+ free((yyvsp[0].s));
+ }
+#line 1572 "engines/hypno/grammar_arc.cpp"
break;
case 29: /* hline: ITOK FILENAME */
-#line 235 "engines/hypno/grammar_arc.y"
+#line 253 "engines/hypno/grammar_arc.y"
{
g_parsedArc->player = (yyvsp[0].s);
debugC(1, kHypnoDebugParser, "I %s", (yyvsp[0].s));
+ free((yyvsp[0].s));
}
-#line 1563 "engines/hypno/grammar_arc.cpp"
+#line 1582 "engines/hypno/grammar_arc.cpp"
break;
case 30: /* hline: I1TOK FILENAME */
-#line 239 "engines/hypno/grammar_arc.y"
+#line 258 "engines/hypno/grammar_arc.y"
{
debugC(1, kHypnoDebugParser, "I1 %s", (yyvsp[0].s));
+ free((yyvsp[0].s));
}
-#line 1571 "engines/hypno/grammar_arc.cpp"
+#line 1591 "engines/hypno/grammar_arc.cpp"
break;
case 31: /* hline: QTOK NUM NUM */
-#line 242 "engines/hypno/grammar_arc.y"
+#line 262 "engines/hypno/grammar_arc.y"
{ debugC(1, kHypnoDebugParser, "Q %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1577 "engines/hypno/grammar_arc.cpp"
+#line 1597 "engines/hypno/grammar_arc.cpp"
break;
case 32: /* hline: BNTOK FILENAME */
-#line 243 "engines/hypno/grammar_arc.y"
+#line 263 "engines/hypno/grammar_arc.y"
{
if (Common::String("B0") == (yyvsp[-1].s))
g_parsedArc->beforeVideo = (yyvsp[0].s);
@@ -1605,155 +1625,168 @@ yyreduce:
g_parsedArc->postStatsVideo = (yyvsp[0].s);
debugC(1, kHypnoDebugParser, "BN %s", (yyvsp[0].s));
+ free((yyvsp[-1].s));
+ free((yyvsp[0].s));
}
-#line 1610 "engines/hypno/grammar_arc.cpp"
+#line 1632 "engines/hypno/grammar_arc.cpp"
break;
case 33: /* hline: SNTOK FILENAME enc flag */
-#line 271 "engines/hypno/grammar_arc.y"
+#line 293 "engines/hypno/grammar_arc.y"
{
parseSN((yyvsp[-3].s), (yyvsp[-2].s), (yyvsp[-1].s), (yyvsp[0].s));
+ free((yyvsp[-3].s));
+ free((yyvsp[-2].s));
+ free((yyvsp[-1].s));
+ free((yyvsp[0].s));
}
-#line 1618 "engines/hypno/grammar_arc.cpp"
+#line 1644 "engines/hypno/grammar_arc.cpp"
break;
case 34: /* hline: SNTOK FILENAME flag enc */
-#line 274 "engines/hypno/grammar_arc.y"
+#line 300 "engines/hypno/grammar_arc.y"
{
parseSN((yyvsp[-3].s), (yyvsp[-2].s), (yyvsp[0].s), (yyvsp[-1].s));
+ free((yyvsp[-3].s));
+ free((yyvsp[-2].s));
+ free((yyvsp[-1].s));
+ free((yyvsp[0].s));
}
-#line 1626 "engines/hypno/grammar_arc.cpp"
+#line 1656 "engines/hypno/grammar_arc.cpp"
break;
case 35: /* hline: HETOK BYTE NUM NUM */
-#line 277 "engines/hypno/grammar_arc.y"
+#line 307 "engines/hypno/grammar_arc.y"
{
Segment segment((yyvsp[-2].i), (yyvsp[0].i), (yyvsp[-1].i));
segment.end = true;
g_parsedArc->segments.push_back(segment);
debugC(1, kHypnoDebugParser, "HE %x %d %d", (yyvsp[-2].i), (yyvsp[-1].i), (yyvsp[0].i));
}
-#line 1637 "engines/hypno/grammar_arc.cpp"
+#line 1667 "engines/hypno/grammar_arc.cpp"
break;
case 36: /* hline: HLTOK BYTE NUM NUM */
-#line 283 "engines/hypno/grammar_arc.y"
+#line 313 "engines/hypno/grammar_arc.y"
{
Segment segment((yyvsp[-2].i), (yyvsp[0].i), (yyvsp[-1].i));
g_parsedArc->segments.push_back(segment);
debugC(1, kHypnoDebugParser, "HL %x %d %d", (yyvsp[-2].i), (yyvsp[-1].i), (yyvsp[0].i));
}
-#line 1647 "engines/hypno/grammar_arc.cpp"
+#line 1677 "engines/hypno/grammar_arc.cpp"
break;
case 37: /* hline: HUTOK BYTE NUM NUM */
-#line 288 "engines/hypno/grammar_arc.y"
+#line 318 "engines/hypno/grammar_arc.y"
{
Segment segment((yyvsp[-2].i), (yyvsp[0].i), (yyvsp[-1].i));
g_parsedArc->segments.push_back(segment);
debugC(1, kHypnoDebugParser, "HU %x %d %d", (yyvsp[-2].i), (yyvsp[-1].i), (yyvsp[0].i));
}
-#line 1657 "engines/hypno/grammar_arc.cpp"
+#line 1687 "engines/hypno/grammar_arc.cpp"
break;
case 38: /* hline: HTOK NAME NUM NUM */
-#line 293 "engines/hypno/grammar_arc.y"
+#line 323 "engines/hypno/grammar_arc.y"
{
assert(Common::String((yyvsp[-2].s)).size() == 1);
Segment segment((yyvsp[-2].s)[0], (yyvsp[0].i), (yyvsp[-1].i));
g_parsedArc->segments.push_back(segment);
debugC(1, kHypnoDebugParser, "H %s %d %d", (yyvsp[-2].s), (yyvsp[-1].i), (yyvsp[0].i));
+ free((yyvsp[-2].s));
}
-#line 1668 "engines/hypno/grammar_arc.cpp"
+#line 1699 "engines/hypno/grammar_arc.cpp"
break;
case 39: /* hline: HTOK RTOK NUM NUM */
-#line 299 "engines/hypno/grammar_arc.y"
+#line 330 "engines/hypno/grammar_arc.y"
{ // Workaround for BYTE == R
Segment segment('R', (yyvsp[0].i), (yyvsp[-1].i));
g_parsedArc->segments.push_back(segment);
debugC(1, kHypnoDebugParser, "H R %d %d", (yyvsp[-1].i), (yyvsp[0].i));
}
-#line 1678 "engines/hypno/grammar_arc.cpp"
+#line 1709 "engines/hypno/grammar_arc.cpp"
break;
case 40: /* hline: HTOK ATOK NUM NUM */
-#line 304 "engines/hypno/grammar_arc.y"
+#line 335 "engines/hypno/grammar_arc.y"
{ // Workaround for BYTE == A
Segment segment('A', (yyvsp[0].i), (yyvsp[-1].i));
g_parsedArc->segments.push_back(segment);
debugC(1, kHypnoDebugParser, "H A %d %d", (yyvsp[-1].i), (yyvsp[0].i));
}
-#line 1688 "engines/hypno/grammar_arc.cpp"
+#line 1719 "engines/hypno/grammar_arc.cpp"
break;
case 41: /* hline: HTOK PTOK NUM NUM */
-#line 309 "engines/hypno/grammar_arc.y"
+#line 340 "engines/hypno/grammar_arc.y"
{ // Workaround for BYTE == P
Segment segment('P', (yyvsp[0].i), (yyvsp[-1].i));
g_parsedArc->segments.push_back(segment);
debugC(1, kHypnoDebugParser, "H P %d %d", (yyvsp[-1].i), (yyvsp[0].i));
}
-#line 1698 "engines/hypno/grammar_arc.cpp"
+#line 1729 "engines/hypno/grammar_arc.cpp"
break;
case 42: /* hline: HTOK LTOK NUM NUM */
-#line 314 "engines/hypno/grammar_arc.y"
+#line 345 "engines/hypno/grammar_arc.y"
{ // Workaround for BYTE == P
Segment segment('L', (yyvsp[0].i), (yyvsp[-1].i));
g_parsedArc->segments.push_back(segment);
debugC(1, kHypnoDebugParser, "H P %d %d", (yyvsp[-1].i), (yyvsp[0].i));
}
-#line 1708 "engines/hypno/grammar_arc.cpp"
+#line 1739 "engines/hypno/grammar_arc.cpp"
break;
case 43: /* hline: H12TOK BYTE NUM NUM */
-#line 319 "engines/hypno/grammar_arc.y"
+#line 350 "engines/hypno/grammar_arc.y"
{
Segment segment((yyvsp[-2].i), (yyvsp[0].i), (yyvsp[-1].i));
g_parsedArc->segments.push_back(segment);
debugC(1, kHypnoDebugParser, "HN %x %d %d", (yyvsp[-2].i), (yyvsp[-1].i), (yyvsp[0].i));
+ free((yyvsp[-3].s));
}
-#line 1718 "engines/hypno/grammar_arc.cpp"
+#line 1750 "engines/hypno/grammar_arc.cpp"
break;
case 44: /* hline: HTOK BYTE NUM NUM */
-#line 324 "engines/hypno/grammar_arc.y"
+#line 356 "engines/hypno/grammar_arc.y"
{
Segment segment((yyvsp[-2].i), (yyvsp[0].i), (yyvsp[-1].i));
g_parsedArc->segments.push_back(segment);
debugC(1, kHypnoDebugParser, "H %x %d %d", (yyvsp[-2].i), (yyvsp[-1].i), (yyvsp[0].i));
}
-#line 1728 "engines/hypno/grammar_arc.cpp"
+#line 1760 "engines/hypno/grammar_arc.cpp"
break;
case 45: /* enc: ENCTOK */
-#line 331 "engines/hypno/grammar_arc.y"
+#line 363 "engines/hypno/grammar_arc.y"
{ (yyval.s) = (yyvsp[0].s); }
-#line 1734 "engines/hypno/grammar_arc.cpp"
+#line 1766 "engines/hypno/grammar_arc.cpp"
break;
case 46: /* enc: %empty */
-#line 332 "engines/hypno/grammar_arc.y"
+#line 364 "engines/hypno/grammar_arc.y"
{ (yyval.s) = scumm_strdup(""); }
-#line 1740 "engines/hypno/grammar_arc.cpp"
+#line 1772 "engines/hypno/grammar_arc.cpp"
break;
case 47: /* flag: NAME */
-#line 335 "engines/hypno/grammar_arc.y"
+#line 367 "engines/hypno/grammar_arc.y"
{ (yyval.s) = (yyvsp[0].s); }
-#line 1746 "engines/hypno/grammar_arc.cpp"
+#line 1778 "engines/hypno/grammar_arc.cpp"
break;
case 48: /* flag: %empty */
-#line 336 "engines/hypno/grammar_arc.y"
+#line 368 "engines/hypno/grammar_arc.y"
{ (yyval.s) = scumm_strdup(""); }
-#line 1752 "engines/hypno/grammar_arc.cpp"
+#line 1784 "engines/hypno/grammar_arc.cpp"
break;
case 52: /* bline: FNTOK FILENAME */
-#line 344 "engines/hypno/grammar_arc.y"
+#line 376 "engines/hypno/grammar_arc.y"
{
+ if (shoot) delete shoot;
shoot = new Shoot();
if (Common::String("F0") == (yyvsp[-1].s))
shoot->animation = (yyvsp[0].s);
@@ -1762,458 +1795,469 @@ yyreduce:
else if (Common::String("F6") == (yyvsp[-1].s))
shoot->additionalVideo = (yyvsp[0].s);
debugC(1, kHypnoDebugParser, "FN %s", (yyvsp[0].s));
+ free((yyvsp[-1].s));
+ free((yyvsp[0].s));
}
-#line 1767 "engines/hypno/grammar_arc.cpp"
+#line 1802 "engines/hypno/grammar_arc.cpp"
break;
case 53: /* bline: AVTOK NUM */
-#line 354 "engines/hypno/grammar_arc.y"
+#line 389 "engines/hypno/grammar_arc.y"
{
assert((yyvsp[0].i) == 0);
shoot->nonHostile = true;
debugC(1, kHypnoDebugParser, "AV %d", (yyvsp[0].i));
}
-#line 1777 "engines/hypno/grammar_arc.cpp"
+#line 1812 "engines/hypno/grammar_arc.cpp"
break;
case 54: /* bline: ALTOK NUM */
-#line 359 "engines/hypno/grammar_arc.y"
+#line 394 "engines/hypno/grammar_arc.y"
{
assert(g_parsedArc->shoots.size() > 0);
shoot->checkIfDestroyed = g_parsedArc->shoots.back().name;
debugC(1, kHypnoDebugParser, "AL %d", (yyvsp[0].i));
}
-#line 1787 "engines/hypno/grammar_arc.cpp"
+#line 1822 "engines/hypno/grammar_arc.cpp"
break;
case 55: /* bline: ABTOK NUM */
-#line 364 "engines/hypno/grammar_arc.y"
+#line 399 "engines/hypno/grammar_arc.y"
{
assert((yyvsp[0].i) == 1);
shoot->playInteractionAudio = true;
debugC(1, kHypnoDebugParser, "AB %d", (yyvsp[0].i));
}
-#line 1797 "engines/hypno/grammar_arc.cpp"
+#line 1832 "engines/hypno/grammar_arc.cpp"
break;
case 56: /* bline: DTOK LTOK */
-#line 369 "engines/hypno/grammar_arc.y"
+#line 404 "engines/hypno/grammar_arc.y"
{
shoot->direction = 'L';
debugC(1, kHypnoDebugParser, "D L"); }
-#line 1805 "engines/hypno/grammar_arc.cpp"
+#line 1840 "engines/hypno/grammar_arc.cpp"
break;
case 57: /* bline: DTOK RTOK */
-#line 372 "engines/hypno/grammar_arc.y"
+#line 407 "engines/hypno/grammar_arc.y"
{
shoot->direction = 'R';
debugC(1, kHypnoDebugParser, "D R"); }
-#line 1813 "engines/hypno/grammar_arc.cpp"
+#line 1848 "engines/hypno/grammar_arc.cpp"
break;
case 58: /* bline: J0TOK NUM */
-#line 375 "engines/hypno/grammar_arc.y"
+#line 410 "engines/hypno/grammar_arc.y"
{
assert((yyvsp[0].i) > 0);
shoot->warningVideoIdx = (yyvsp[0].i);
debugC(1, kHypnoDebugParser, "J0 %d", (yyvsp[0].i));
}
-#line 1823 "engines/hypno/grammar_arc.cpp"
+#line 1858 "engines/hypno/grammar_arc.cpp"
break;
case 59: /* bline: FNTOK NONETOK */
-#line 380 "engines/hypno/grammar_arc.y"
+#line 415 "engines/hypno/grammar_arc.y"
{
+ if (shoot) delete shoot;
shoot = new Shoot();
shoot->animation = "NONE";
debugC(1, kHypnoDebugParser, "FN NONE");
+ free((yyvsp[-1].s));
}
-#line 1833 "engines/hypno/grammar_arc.cpp"
+#line 1870 "engines/hypno/grammar_arc.cpp"
break;
case 60: /* bline: FTOK FILENAME */
-#line 385 "engines/hypno/grammar_arc.y"
+#line 422 "engines/hypno/grammar_arc.y"
{
+ if (shoot) delete shoot;
shoot = new Shoot();
shoot->animation = (yyvsp[0].s);
debugC(1, kHypnoDebugParser, "FN %s", (yyvsp[0].s));
+ free((yyvsp[0].s));
}
-#line 1843 "engines/hypno/grammar_arc.cpp"
+#line 1882 "engines/hypno/grammar_arc.cpp"
break;
case 61: /* bline: ITOK NAME */
-#line 390 "engines/hypno/grammar_arc.y"
+#line 429 "engines/hypno/grammar_arc.y"
{
shoot->name = (yyvsp[0].s);
debugC(1, kHypnoDebugParser, "I %s", (yyvsp[0].s));
+ free((yyvsp[0].s));
}
-#line 1852 "engines/hypno/grammar_arc.cpp"
+#line 1892 "engines/hypno/grammar_arc.cpp"
break;
case 62: /* bline: ITOK BNTOK */
-#line 394 "engines/hypno/grammar_arc.y"
+#line 434 "engines/hypno/grammar_arc.y"
{ // Workaround for NAME == B1
shoot->name = (yyvsp[0].s);
debugC(1, kHypnoDebugParser, "I %s", (yyvsp[0].s));
+ free((yyvsp[0].s));
}
-#line 1861 "engines/hypno/grammar_arc.cpp"
+#line 1902 "engines/hypno/grammar_arc.cpp"
break;
case 63: /* bline: ITOK ATOK */
-#line 398 "engines/hypno/grammar_arc.y"
+#line 439 "engines/hypno/grammar_arc.y"
{ // Workaround for NAME == A
shoot->name = "A";
debugC(1, kHypnoDebugParser, "I A");
}
-#line 1870 "engines/hypno/grammar_arc.cpp"
+#line 1911 "engines/hypno/grammar_arc.cpp"
break;
case 64: /* bline: ITOK CTOK */
-#line 402 "engines/hypno/grammar_arc.y"
+#line 443 "engines/hypno/grammar_arc.y"
{ // Workaround for NAME == C
shoot->name = "C";
debugC(1, kHypnoDebugParser, "I C");
}
-#line 1879 "engines/hypno/grammar_arc.cpp"
+#line 1920 "engines/hypno/grammar_arc.cpp"
break;
case 65: /* bline: ITOK DTOK */
-#line 406 "engines/hypno/grammar_arc.y"
+#line 447 "engines/hypno/grammar_arc.y"
{ // Workaround for NAME == D
shoot->name = "D";
debugC(1, kHypnoDebugParser, "I D");
}
-#line 1888 "engines/hypno/grammar_arc.cpp"
+#line 1929 "engines/hypno/grammar_arc.cpp"
break;
case 66: /* bline: ITOK FTOK */
-#line 410 "engines/hypno/grammar_arc.y"
+#line 451 "engines/hypno/grammar_arc.y"
{ // Workaround for NAME == F
shoot->name = "F";
debugC(1, kHypnoDebugParser, "I F");
}
-#line 1897 "engines/hypno/grammar_arc.cpp"
+#line 1938 "engines/hypno/grammar_arc.cpp"
break;
case 67: /* bline: ITOK GTOK */
-#line 414 "engines/hypno/grammar_arc.y"
+#line 455 "engines/hypno/grammar_arc.y"
{ // Workaround for NAME == G
shoot->name = "G";
debugC(1, kHypnoDebugParser, "I G");
}
-#line 1906 "engines/hypno/grammar_arc.cpp"
+#line 1947 "engines/hypno/grammar_arc.cpp"
break;
case 68: /* bline: ITOK HTOK */
-#line 418 "engines/hypno/grammar_arc.y"
+#line 459 "engines/hypno/grammar_arc.y"
{ // Workaround for NAME == H
shoot->name = "H";
debugC(1, kHypnoDebugParser, "I H");
}
-#line 1915 "engines/hypno/grammar_arc.cpp"
+#line 1956 "engines/hypno/grammar_arc.cpp"
break;
case 69: /* bline: ITOK H12TOK */
-#line 422 "engines/hypno/grammar_arc.y"
+#line 463 "engines/hypno/grammar_arc.y"
{ // Workaround for NAME == H1/H2
shoot->name = (yyvsp[0].s);
debugC(1, kHypnoDebugParser, "I %s", (yyvsp[0].s));
+ free((yyvsp[0].s));
}
-#line 1924 "engines/hypno/grammar_arc.cpp"
+#line 1966 "engines/hypno/grammar_arc.cpp"
break;
case 70: /* bline: ITOK ITOK */
-#line 426 "engines/hypno/grammar_arc.y"
+#line 468 "engines/hypno/grammar_arc.y"
{ // Workaround for NAME == I
shoot->name = "I";
debugC(1, kHypnoDebugParser, "I I");
}
-#line 1933 "engines/hypno/grammar_arc.cpp"
+#line 1975 "engines/hypno/grammar_arc.cpp"
break;
case 71: /* bline: ITOK JTOK */
-#line 430 "engines/hypno/grammar_arc.y"
+#line 472 "engines/hypno/grammar_arc.y"
{ // Workaround for NAME == J
shoot->name = "J";
debugC(1, kHypnoDebugParser, "I J");
}
-#line 1942 "engines/hypno/grammar_arc.cpp"
+#line 1984 "engines/hypno/grammar_arc.cpp"
break;
case 72: /* bline: ITOK KTOK */
-#line 434 "engines/hypno/grammar_arc.y"
+#line 476 "engines/hypno/grammar_arc.y"
{ // Workaround for NAME == K
shoot->name = "K";
debugC(1, kHypnoDebugParser, "I K");
}
-#line 1951 "engines/hypno/grammar_arc.cpp"
+#line 1993 "engines/hypno/grammar_arc.cpp"
break;
case 73: /* bline: ITOK NTOK */
-#line 438 "engines/hypno/grammar_arc.y"
+#line 480 "engines/hypno/grammar_arc.y"
{ // Workaround for NAME == N
shoot->name = "N";
debugC(1, kHypnoDebugParser, "I N");
}
-#line 1960 "engines/hypno/grammar_arc.cpp"
+#line 2002 "engines/hypno/grammar_arc.cpp"
break;
case 74: /* bline: ITOK OTOK */
-#line 442 "engines/hypno/grammar_arc.y"
+#line 484 "engines/hypno/grammar_arc.y"
{ // Workaround for NAME == O
shoot->name = "O";
debugC(1, kHypnoDebugParser, "I O");
}
-#line 1969 "engines/hypno/grammar_arc.cpp"
+#line 2011 "engines/hypno/grammar_arc.cpp"
break;
case 75: /* bline: ITOK PTOK */
-#line 446 "engines/hypno/grammar_arc.y"
+#line 488 "engines/hypno/grammar_arc.y"
{ // Workaround for NAME == P
shoot->name = "P";
debugC(1, kHypnoDebugParser, "I P");
}
-#line 1978 "engines/hypno/grammar_arc.cpp"
+#line 2020 "engines/hypno/grammar_arc.cpp"
break;
case 76: /* bline: ITOK QTOK */
-#line 450 "engines/hypno/grammar_arc.y"
+#line 492 "engines/hypno/grammar_arc.y"
{ // Workaround for NAME == Q
shoot->name = "Q";
debugC(1, kHypnoDebugParser, "I Q");
}
-#line 1987 "engines/hypno/grammar_arc.cpp"
+#line 2029 "engines/hypno/grammar_arc.cpp"
break;
case 77: /* bline: ITOK RTOK */
-#line 454 "engines/hypno/grammar_arc.y"
+#line 496 "engines/hypno/grammar_arc.y"
{ // Workaround for NAME == R
shoot->name = "R";
debugC(1, kHypnoDebugParser, "I R");
}
-#line 1996 "engines/hypno/grammar_arc.cpp"
+#line 2038 "engines/hypno/grammar_arc.cpp"
break;
case 78: /* bline: ITOK SNTOK */
-#line 458 "engines/hypno/grammar_arc.y"
+#line 500 "engines/hypno/grammar_arc.y"
{ // Workaround for NAME == S1
shoot->name = (yyvsp[0].s);
debugC(1, kHypnoDebugParser, "I %s", (yyvsp[0].s));
+ free((yyvsp[0].s));
}
-#line 2005 "engines/hypno/grammar_arc.cpp"
+#line 2048 "engines/hypno/grammar_arc.cpp"
break;
case 79: /* bline: ITOK TTOK */
-#line 462 "engines/hypno/grammar_arc.y"
+#line 505 "engines/hypno/grammar_arc.y"
{ // Workaround for NAME == T
shoot->name = "T";
debugC(1, kHypnoDebugParser, "I T");
}
-#line 2014 "engines/hypno/grammar_arc.cpp"
+#line 2057 "engines/hypno/grammar_arc.cpp"
break;
case 80: /* bline: ITOK LTOK */
-#line 466 "engines/hypno/grammar_arc.y"
+#line 509 "engines/hypno/grammar_arc.y"
{ // Workaround for NAME == L
shoot->name = "L";
debugC(1, kHypnoDebugParser, "I L");
}
-#line 2023 "engines/hypno/grammar_arc.cpp"
+#line 2066 "engines/hypno/grammar_arc.cpp"
break;
case 81: /* bline: ITOK MTOK */
-#line 470 "engines/hypno/grammar_arc.y"
+#line 513 "engines/hypno/grammar_arc.y"
{ // Workaround for NAME == M
shoot->name = "M";
debugC(1, kHypnoDebugParser, "I M");
}
-#line 2032 "engines/hypno/grammar_arc.cpp"
+#line 2075 "engines/hypno/grammar_arc.cpp"
break;
case 82: /* bline: ITOK UTOK */
-#line 474 "engines/hypno/grammar_arc.y"
+#line 517 "engines/hypno/grammar_arc.y"
{ // Workaround for NAME == U
shoot->name = "U";
debugC(1, kHypnoDebugParser, "I U");
}
-#line 2041 "engines/hypno/grammar_arc.cpp"
+#line 2084 "engines/hypno/grammar_arc.cpp"
break;
case 83: /* bline: JTOK NUM */
-#line 478 "engines/hypno/grammar_arc.y"
+#line 521 "engines/hypno/grammar_arc.y"
{
debugC(1, kHypnoDebugParser, "J %d", (yyvsp[0].i));
}
-#line 2049 "engines/hypno/grammar_arc.cpp"
+#line 2092 "engines/hypno/grammar_arc.cpp"
break;
case 84: /* bline: A0TOK NUM NUM */
-#line 481 "engines/hypno/grammar_arc.y"
+#line 524 "engines/hypno/grammar_arc.y"
{
shoot->position = Common::Point((yyvsp[-1].i), (yyvsp[0].i));
debugC(1, kHypnoDebugParser, "A0 %d %d", (yyvsp[-1].i), (yyvsp[0].i));
}
-#line 2058 "engines/hypno/grammar_arc.cpp"
+#line 2101 "engines/hypno/grammar_arc.cpp"
break;
case 85: /* bline: RTOK NUM NUM */
-#line 485 "engines/hypno/grammar_arc.y"
+#line 528 "engines/hypno/grammar_arc.y"
{
shoot->objKillsCount = (yyvsp[-1].i);
shoot->objMissesCount = (yyvsp[0].i);
debugC(1, kHypnoDebugParser, "R %d %d", (yyvsp[-1].i), (yyvsp[0].i));
}
-#line 2068 "engines/hypno/grammar_arc.cpp"
+#line 2111 "engines/hypno/grammar_arc.cpp"
break;
case 86: /* bline: R0TOK NUM NUM */
-#line 490 "engines/hypno/grammar_arc.y"
+#line 533 "engines/hypno/grammar_arc.y"
{
shoot->objKillsCount = (yyvsp[-1].i);
shoot->objMissesCount = (yyvsp[0].i);
debugC(1, kHypnoDebugParser, "R0 %d %d", (yyvsp[-1].i), (yyvsp[0].i));
}
-#line 2078 "engines/hypno/grammar_arc.cpp"
+#line 2121 "engines/hypno/grammar_arc.cpp"
break;
case 87: /* bline: R1TOK NUM NUM */
-#line 495 "engines/hypno/grammar_arc.y"
+#line 538 "engines/hypno/grammar_arc.y"
{
debugC(1, kHypnoDebugParser, "R1 %d %d", (yyvsp[-1].i), (yyvsp[0].i));
}
-#line 2086 "engines/hypno/grammar_arc.cpp"
+#line 2129 "engines/hypno/grammar_arc.cpp"
break;
case 88: /* bline: BNTOK NUM NUM */
-#line 498 "engines/hypno/grammar_arc.y"
+#line 541 "engines/hypno/grammar_arc.y"
{
FrameInfo fi((yyvsp[0].i), (yyvsp[-1].i));
shoot->bodyFrames.push_back(fi);
debugC(1, kHypnoDebugParser, "BN %d %d", (yyvsp[-1].i), (yyvsp[0].i));
+ free((yyvsp[-2].s));
}
-#line 2096 "engines/hypno/grammar_arc.cpp"
+#line 2140 "engines/hypno/grammar_arc.cpp"
break;
case 89: /* bline: KNTOK NUM NUM */
-#line 503 "engines/hypno/grammar_arc.y"
+#line 547 "engines/hypno/grammar_arc.y"
{
FrameInfo fi((yyvsp[0].i), (yyvsp[-1].i));
shoot->explosionFrames.push_back(fi);
debugC(1, kHypnoDebugParser, "KN %d %d", (yyvsp[-1].i), (yyvsp[0].i));
}
-#line 2106 "engines/hypno/grammar_arc.cpp"
+#line 2150 "engines/hypno/grammar_arc.cpp"
break;
case 90: /* bline: P0TOK NUM NUM */
-#line 508 "engines/hypno/grammar_arc.y"
+#line 552 "engines/hypno/grammar_arc.y"
{
shoot->paletteSize = (yyvsp[-1].i);
shoot->paletteOffset = (yyvsp[0].i);
debugC(1, kHypnoDebugParser, "P0 %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 2115 "engines/hypno/grammar_arc.cpp"
+#line 2159 "engines/hypno/grammar_arc.cpp"
break;
case 91: /* bline: OTOK NUM NUM */
-#line 512 "engines/hypno/grammar_arc.y"
+#line 556 "engines/hypno/grammar_arc.y"
{
if ((yyvsp[-1].i) == 0 && (yyvsp[0].i) == 0)
error("Invalid O command (0, 0)");
shoot->deathPosition = Common::Point((yyvsp[-1].i), (yyvsp[0].i));
debugC(1, kHypnoDebugParser, "O %d %d", (yyvsp[-1].i), (yyvsp[0].i));
}
-#line 2126 "engines/hypno/grammar_arc.cpp"
+#line 2170 "engines/hypno/grammar_arc.cpp"
break;
case 92: /* bline: CTOK NUM */
-#line 518 "engines/hypno/grammar_arc.y"
+#line 562 "engines/hypno/grammar_arc.y"
{
shoot->timesToShoot = (yyvsp[0].i);
debugC(1, kHypnoDebugParser, "C %d", (yyvsp[0].i));
}
-#line 2135 "engines/hypno/grammar_arc.cpp"
+#line 2179 "engines/hypno/grammar_arc.cpp"
break;
case 93: /* bline: HTOK NUM */
-#line 522 "engines/hypno/grammar_arc.y"
+#line 566 "engines/hypno/grammar_arc.y"
{
shoot->attackFrames.push_back((yyvsp[0].i));
debugC(1, kHypnoDebugParser, "H %d", (yyvsp[0].i)); }
-#line 2143 "engines/hypno/grammar_arc.cpp"
+#line 2187 "engines/hypno/grammar_arc.cpp"
break;
case 94: /* bline: VTOK NUM */
-#line 525 "engines/hypno/grammar_arc.y"
+#line 569 "engines/hypno/grammar_arc.y"
{ debugC(1, kHypnoDebugParser, "V %d", (yyvsp[0].i)); }
-#line 2149 "engines/hypno/grammar_arc.cpp"
+#line 2193 "engines/hypno/grammar_arc.cpp"
break;
case 95: /* bline: VTOK */
-#line 526 "engines/hypno/grammar_arc.y"
+#line 570 "engines/hypno/grammar_arc.y"
{ debugC(1, kHypnoDebugParser, "V"); }
-#line 2155 "engines/hypno/grammar_arc.cpp"
+#line 2199 "engines/hypno/grammar_arc.cpp"
break;
case 96: /* bline: WTOK NUM */
-#line 527 "engines/hypno/grammar_arc.y"
+#line 571 "engines/hypno/grammar_arc.y"
{
shoot->attackWeight = (yyvsp[0].i);
debugC(1, kHypnoDebugParser, "W %d", (yyvsp[0].i)); }
-#line 2163 "engines/hypno/grammar_arc.cpp"
+#line 2207 "engines/hypno/grammar_arc.cpp"
break;
case 97: /* bline: DTOK NUM */
-#line 530 "engines/hypno/grammar_arc.y"
+#line 574 "engines/hypno/grammar_arc.y"
{
shoot->pointsToShoot = (yyvsp[0].i);
debugC(1, kHypnoDebugParser, "D %d", (yyvsp[0].i));
}
-#line 2172 "engines/hypno/grammar_arc.cpp"
+#line 2216 "engines/hypno/grammar_arc.cpp"
break;
case 98: /* bline: LTOK NUM NUM */
-#line 534 "engines/hypno/grammar_arc.y"
+#line 578 "engines/hypno/grammar_arc.y"
{
debugC(1, kHypnoDebugParser, "L %d %d", (yyvsp[-1].i), (yyvsp[0].i));
}
-#line 2180 "engines/hypno/grammar_arc.cpp"
+#line 2224 "engines/hypno/grammar_arc.cpp"
break;
case 99: /* bline: LTOK NUM */
-#line 537 "engines/hypno/grammar_arc.y"
+#line 581 "engines/hypno/grammar_arc.y"
{
debugC(1, kHypnoDebugParser, "L %d", (yyvsp[0].i));
FrameInfo fi((yyvsp[0].i)-1, 0);
shoot->bodyFrames.push_back(fi);
}
-#line 2190 "engines/hypno/grammar_arc.cpp"
+#line 2234 "engines/hypno/grammar_arc.cpp"
break;
case 100: /* bline: MTOK NUM */
-#line 542 "engines/hypno/grammar_arc.y"
+#line 586 "engines/hypno/grammar_arc.y"
{ debugC(1, kHypnoDebugParser, "M %d", (yyvsp[0].i));
shoot->missedAnimation = (yyvsp[0].i);
}
-#line 2198 "engines/hypno/grammar_arc.cpp"
+#line 2242 "engines/hypno/grammar_arc.cpp"
break;
case 101: /* bline: KTOK */
-#line 545 "engines/hypno/grammar_arc.y"
+#line 589 "engines/hypno/grammar_arc.y"
{ debugC(1, kHypnoDebugParser, "K"); }
-#line 2204 "engines/hypno/grammar_arc.cpp"
+#line 2248 "engines/hypno/grammar_arc.cpp"
break;
case 102: /* bline: KTOK NUM */
-#line 546 "engines/hypno/grammar_arc.y"
+#line 590 "engines/hypno/grammar_arc.y"
{ debugC(1, kHypnoDebugParser, "K %d", (yyvsp[0].i));
FrameInfo fi((yyvsp[0].i), 1);
shoot->explosionFrames.push_back(fi);
}
-#line 2213 "engines/hypno/grammar_arc.cpp"
+#line 2257 "engines/hypno/grammar_arc.cpp"
break;
case 103: /* bline: KTOK NUM NUM NUM */
-#line 550 "engines/hypno/grammar_arc.y"
+#line 594 "engines/hypno/grammar_arc.y"
{
assert((yyvsp[-1].i) > (yyvsp[-2].i));
FrameInfo fi((yyvsp[-2].i), (yyvsp[-1].i) - (yyvsp[-2].i));
@@ -2221,20 +2265,20 @@ yyreduce:
shoot->explosionFrames.push_back(fi);
debugC(1, kHypnoDebugParser, "K %d %d %d", (yyvsp[-2].i), (yyvsp[-1].i), (yyvsp[0].i));
}
-#line 2225 "engines/hypno/grammar_arc.cpp"
+#line 2269 "engines/hypno/grammar_arc.cpp"
break;
case 104: /* bline: KTOK NUM NUM */
-#line 557 "engines/hypno/grammar_arc.y"
+#line 601 "engines/hypno/grammar_arc.y"
{ debugC(1, kHypnoDebugParser, "K %d %d", (yyvsp[-1].i), (yyvsp[0].i));
FrameInfo fi((yyvsp[-1].i), 1);
shoot->explosionFrames.push_back(fi);
}
-#line 2234 "engines/hypno/grammar_arc.cpp"
+#line 2278 "engines/hypno/grammar_arc.cpp"
break;
case 105: /* bline: SNTOK FILENAME enc */
-#line 561 "engines/hypno/grammar_arc.y"
+#line 605 "engines/hypno/grammar_arc.y"
{
if (Common::String("S0") == (yyvsp[-2].s)) {
shoot->enemySound = (yyvsp[-1].s);
@@ -2249,89 +2293,94 @@ yyreduce:
else if (Common::String("S4") == (yyvsp[-2].s))
shoot->animalSound = (yyvsp[-1].s);
- debugC(1, kHypnoDebugParser, "SN %s", (yyvsp[-1].s)); }
-#line 2254 "engines/hypno/grammar_arc.cpp"
+ debugC(1, kHypnoDebugParser, "SN %s", (yyvsp[-1].s));
+ free((yyvsp[-2].s));
+ free((yyvsp[-1].s));
+ free((yyvsp[0].s));
+ }
+#line 2302 "engines/hypno/grammar_arc.cpp"
break;
case 106: /* bline: SNTOK */
-#line 576 "engines/hypno/grammar_arc.y"
+#line 624 "engines/hypno/grammar_arc.y"
{
debugC(1, kHypnoDebugParser, "SN");
+ free((yyvsp[0].s));
}
-#line 2262 "engines/hypno/grammar_arc.cpp"
+#line 2311 "engines/hypno/grammar_arc.cpp"
break;
case 107: /* bline: GTOK */
-#line 580 "engines/hypno/grammar_arc.y"
+#line 629 "engines/hypno/grammar_arc.y"
{ debugC(1, kHypnoDebugParser, "G"); }
-#line 2268 "engines/hypno/grammar_arc.cpp"
+#line 2317 "engines/hypno/grammar_arc.cpp"
break;
case 108: /* bline: TTOK NUM NUM NUM */
-#line 581 "engines/hypno/grammar_arc.y"
+#line 630 "engines/hypno/grammar_arc.y"
{
shoot->interactionFrame = (yyvsp[-2].i);
assert((yyvsp[-1].i) == 0);
shoot->waitForClickAfterInteraction = (yyvsp[0].i);
debugC(1, kHypnoDebugParser, "T %d %d %d", (yyvsp[-2].i), (yyvsp[-1].i), (yyvsp[0].i));
}
-#line 2279 "engines/hypno/grammar_arc.cpp"
+#line 2328 "engines/hypno/grammar_arc.cpp"
break;
case 109: /* bline: TTOK NUM */
-#line 587 "engines/hypno/grammar_arc.y"
+#line 636 "engines/hypno/grammar_arc.y"
{
shoot->interactionFrame = (yyvsp[0].i);
debugC(1, kHypnoDebugParser, "T %d", (yyvsp[0].i));
}
-#line 2288 "engines/hypno/grammar_arc.cpp"
+#line 2337 "engines/hypno/grammar_arc.cpp"
break;
case 110: /* bline: TTOK */
-#line 591 "engines/hypno/grammar_arc.y"
+#line 640 "engines/hypno/grammar_arc.y"
{
shoot->isAnimal = true;
debugC(1, kHypnoDebugParser, "T");
}
-#line 2297 "engines/hypno/grammar_arc.cpp"
+#line 2346 "engines/hypno/grammar_arc.cpp"
break;
case 111: /* bline: MTOK */
-#line 595 "engines/hypno/grammar_arc.y"
+#line 644 "engines/hypno/grammar_arc.y"
{
debugC(1, kHypnoDebugParser, "M");
}
-#line 2305 "engines/hypno/grammar_arc.cpp"
+#line 2354 "engines/hypno/grammar_arc.cpp"
break;
case 112: /* bline: NTOK */
-#line 598 "engines/hypno/grammar_arc.y"
+#line 647 "engines/hypno/grammar_arc.y"
{
shoot->noEnemySound = true;
debugC(1, kHypnoDebugParser, "N"); }
-#line 2313 "engines/hypno/grammar_arc.cpp"
+#line 2362 "engines/hypno/grammar_arc.cpp"
break;
case 113: /* bline: NRTOK */
-#line 601 "engines/hypno/grammar_arc.y"
+#line 650 "engines/hypno/grammar_arc.y"
{
debugC(1, kHypnoDebugParser, "NR"); }
-#line 2320 "engines/hypno/grammar_arc.cpp"
+#line 2369 "engines/hypno/grammar_arc.cpp"
break;
case 114: /* bline: ZTOK */
-#line 603 "engines/hypno/grammar_arc.y"
+#line 652 "engines/hypno/grammar_arc.y"
{
g_parsedArc->shoots.push_back(*shoot);
//delete shoot;
//shoot = nullptr;
debugC(1, kHypnoDebugParser, "Z");
}
-#line 2331 "engines/hypno/grammar_arc.cpp"
+#line 2380 "engines/hypno/grammar_arc.cpp"
break;
-#line 2335 "engines/hypno/grammar_arc.cpp"
+#line 2384 "engines/hypno/grammar_arc.cpp"
default: break;
}
diff --git a/engines/hypno/grammar_arc.y b/engines/hypno/grammar_arc.y
index bc4cc3ad59f..92e4c38ad32 100644
--- a/engines/hypno/grammar_arc.y
+++ b/engines/hypno/grammar_arc.y
@@ -32,7 +32,9 @@
#undef yyerror
#define yyerror HYPNO_ARC_xerror
-Hypno::Shoot *shoot;
+namespace Hypno {
+Shoot *shoot = NULL;
+}
extern int HYPNO_ARC_lex();
extern int HYPNO_ARC_lineno;
@@ -97,10 +99,10 @@ void parseSN(const char *sn, const char *path, const char *enc, const char *flag
int i; /* integer value */
}
-%token<s> NAME FILENAME BNTOK SNTOK KNTOK YXTOK FNTOK ENCTOK ONTOK H12TOK
+%token<s> NAME FILENAME BNTOK SNTOK YXTOK FNTOK ENCTOK ONTOK H12TOK
%token<i> NUM BYTE
// header
-%token COMMENT ALTOK AVTOK ABTOK CTOK DTOK HTOK HETOK HLTOK HUTOK RETTOK QTOK RESTOK
+%token COMMENT ALTOK AVTOK ABTOK CTOK DTOK HTOK HETOK HLTOK HUTOK KNTOK RETTOK QTOK RESTOK
%token PTOK FTOK TTOK TATOK TPTOK TSTOK ATOK VTOK OTOK LTOK MTOK NTOK NRTOK NSTOK RTOK R0TOK R1TOK
%token ITOK I1TOK GTOK JTOK J0TOK KTOK UTOK ZTOK
@@ -117,7 +119,7 @@ void parseSN(const char *sn, const char *path, const char *enc, const char *flag
%%
-start: YXTOK { g_parsedArc->mode = $1; } header ZTOK RETTOK body XTOK
+start: YXTOK { g_parsedArc->mode = $1; free($1); } header ZTOK RETTOK body XTOK
| RETTOK start
;
@@ -145,6 +147,7 @@ hline: CTOK NUM {
| MTOK FILENAME {
debugC(1, kHypnoDebugParser, "M %s", $2);
g_parsedArc->maskVideo = $2;
+ free($2);
}
| UTOK NUM NUM NUM NUM {
debugC(1, kHypnoDebugParser, "U %d %d %d %d", $2, $3, $4, $5);
@@ -173,7 +176,9 @@ hline: CTOK NUM {
g_parsedArc->objMissesAllowed[1] = $3;
} else
error("Invalid objective: '%s'", $1);
- debugC(1, kHypnoDebugParser, "ON %d %d", $2, $3); }
+ debugC(1, kHypnoDebugParser, "ON %d %d", $2, $3);
+ free($1);
+ }
| ONTOK NUM {
if (Common::String("O0") == $1) {
g_parsedArc->objKillsRequired[0] = $2;
@@ -182,22 +187,27 @@ hline: CTOK NUM {
} else
error("Invalid objective: '%s'", $1);
debugC(1, kHypnoDebugParser, "ON %d", $2);
+ free($1);
}
| TPTOK NONETOK NUM FILENAME {
ArcadeTransition at("NONE", $4, "", 0, $3);
g_parsedArc->transitions.push_back(at);
debugC(1, kHypnoDebugParser, "Tp %s %d %s", "NONE", $3, $4);
+ free($4);
}
| TSTOK FILENAME NUM NUM {
ArcadeTransition at($2, "", "", 0, $3);
at.selection = true;
g_parsedArc->transitions.push_back(at);
debugC(1, kHypnoDebugParser, "Ts %s %d %d", $2, $3, $4);
+ free($2);
}
| TPTOK FILENAME NUM FILENAME {
ArcadeTransition at($2, $4, "", 0, $3);
g_parsedArc->transitions.push_back(at);
debugC(1, kHypnoDebugParser, "Tp %s %d %s", $2, $3, $4);
+ free($2);
+ free($4);
}
| TATOK NUM FILENAME flag enc {
uint32 sampleRate = 11025;
@@ -211,11 +221,15 @@ hline: CTOK NUM {
at.soundStereo = stereo;
g_parsedArc->transitions.push_back(at);
debugC(1, kHypnoDebugParser, "Ta %d %s", $2, $3);
+ free($3);
+ free($4);
+ free($5);
}
| TTOK FILENAME NUM {
ArcadeTransition at($2, "", "", 0, $3);
g_parsedArc->transitions.push_back(at);
debugC(1, kHypnoDebugParser, "T %s %d", $2, $3);
+ free($2);
}
| TTOK NONETOK NUM {
ArcadeTransition at("NONE", "", "", 0, $3);
@@ -224,20 +238,26 @@ hline: CTOK NUM {
| NTOK FILENAME {
g_parsedArc->backgroundVideo = $2;
debugC(1, kHypnoDebugParser, "N %s", $2);
+ free($2);
}
| NSTOK FILENAME {
g_parsedArc->backgroundVideo = $2;
debugC(1, kHypnoDebugParser, "N* %s", $2);
+ free($2);
}
| RTOK FILENAME {
g_parsedArc->backgroundPalette = $2;
- debugC(1, kHypnoDebugParser, "R %s", $2); }
+ debugC(1, kHypnoDebugParser, "R %s", $2);
+ free($2);
+ }
| ITOK FILENAME {
g_parsedArc->player = $2;
debugC(1, kHypnoDebugParser, "I %s", $2);
+ free($2);
}
| I1TOK FILENAME {
debugC(1, kHypnoDebugParser, "I1 %s", $2);
+ free($2);
}
| QTOK NUM NUM { debugC(1, kHypnoDebugParser, "Q %d %d", $2, $3); }
| BNTOK FILENAME {
@@ -267,12 +287,22 @@ hline: CTOK NUM {
g_parsedArc->postStatsVideo = $2;
debugC(1, kHypnoDebugParser, "BN %s", $2);
+ free($1);
+ free($2);
}
| SNTOK FILENAME enc flag {
parseSN($1, $2, $3, $4);
+ free($1);
+ free($2);
+ free($3);
+ free($4);
}
| SNTOK FILENAME flag enc {
parseSN($1, $2, $4, $3);
+ free($1);
+ free($2);
+ free($3);
+ free($4);
}
| HETOK BYTE NUM NUM {
Segment segment($2, $4, $3);
@@ -295,6 +325,7 @@ hline: CTOK NUM {
Segment segment($2[0], $4, $3);
g_parsedArc->segments.push_back(segment);
debugC(1, kHypnoDebugParser, "H %s %d %d", $2, $3, $4);
+ free($2);
}
| HTOK RTOK NUM NUM { // Workaround for BYTE == R
Segment segment('R', $4, $3);
@@ -320,6 +351,7 @@ hline: CTOK NUM {
Segment segment($2, $4, $3);
g_parsedArc->segments.push_back(segment);
debugC(1, kHypnoDebugParser, "HN %x %d %d", $2, $3, $4);
+ free($1);
}
| HTOK BYTE NUM NUM {
Segment segment($2, $4, $3);
@@ -342,6 +374,7 @@ body: bline body
;
bline: FNTOK FILENAME {
+ if (shoot) delete shoot;
shoot = new Shoot();
if (Common::String("F0") == $1)
shoot->animation = $2;
@@ -350,6 +383,8 @@ bline: FNTOK FILENAME {
else if (Common::String("F6") == $1)
shoot->additionalVideo = $2;
debugC(1, kHypnoDebugParser, "FN %s", $2);
+ free($1);
+ free($2);
}
| AVTOK NUM {
assert($2 == 0);
@@ -378,22 +413,28 @@ bline: FNTOK FILENAME {
debugC(1, kHypnoDebugParser, "J0 %d", $2);
}
| FNTOK NONETOK {
+ if (shoot) delete shoot;
shoot = new Shoot();
shoot->animation = "NONE";
debugC(1, kHypnoDebugParser, "FN NONE");
+ free($1);
}
| FTOK FILENAME {
+ if (shoot) delete shoot;
shoot = new Shoot();
shoot->animation = $2;
debugC(1, kHypnoDebugParser, "FN %s", $2);
+ free($2);
}
| ITOK NAME {
shoot->name = $2;
debugC(1, kHypnoDebugParser, "I %s", $2);
+ free($2);
}
| ITOK BNTOK { // Workaround for NAME == B1
shoot->name = $2;
debugC(1, kHypnoDebugParser, "I %s", $2);
+ free($2);
}
| ITOK ATOK { // Workaround for NAME == A
shoot->name = "A";
@@ -422,6 +463,7 @@ bline: FNTOK FILENAME {
| ITOK H12TOK { // Workaround for NAME == H1/H2
shoot->name = $2;
debugC(1, kHypnoDebugParser, "I %s", $2);
+ free($2);
}
| ITOK ITOK { // Workaround for NAME == I
shoot->name = "I";
@@ -458,6 +500,7 @@ bline: FNTOK FILENAME {
| ITOK SNTOK { // Workaround for NAME == S1
shoot->name = $2;
debugC(1, kHypnoDebugParser, "I %s", $2);
+ free($2);
}
| ITOK TTOK { // Workaround for NAME == T
shoot->name = "T";
@@ -499,6 +542,7 @@ bline: FNTOK FILENAME {
FrameInfo fi($3, $2);
shoot->bodyFrames.push_back(fi);
debugC(1, kHypnoDebugParser, "BN %d %d", $2, $3);
+ free($1);
}
| KNTOK NUM NUM {
FrameInfo fi($3, $2);
@@ -572,9 +616,14 @@ bline: FNTOK FILENAME {
else if (Common::String("S4") == $1)
shoot->animalSound = $2;
- debugC(1, kHypnoDebugParser, "SN %s", $2); }
+ debugC(1, kHypnoDebugParser, "SN %s", $2);
+ free($1);
+ free($2);
+ free($3);
+ }
| SNTOK {
debugC(1, kHypnoDebugParser, "SN");
+ free($1);
}
| GTOK { debugC(1, kHypnoDebugParser, "G"); }
diff --git a/engines/hypno/grammar_mis.cpp b/engines/hypno/grammar_mis.cpp
index 3af0ed9e501..07c2a6169cd 100644
--- a/engines/hypno/grammar_mis.cpp
+++ b/engines/hypno/grammar_mis.cpp
@@ -88,9 +88,11 @@
extern int HYPNO_MIS_lex();
extern int yylineno;
+namespace Hypno {
Common::Array<uint32> *smenu_idx = nullptr;
-Hypno::HotspotsStack *stack = nullptr;
-Hypno::Talk *talk_action = nullptr;
+HotspotsStack *stack = nullptr;
+Talk *talk_action = nullptr;
+}
void HYPNO_MIS_xerror(const char *str) {
error("ERROR: %s", str);
@@ -103,7 +105,7 @@ int HYPNO_MIS_wrap() {
using namespace Hypno;
-#line 107 "engines/hypno/grammar_mis.cpp"
+#line 109 "engines/hypno/grammar_mis.cpp"
# ifndef YY_CAST
# ifdef __cplusplus
@@ -137,64 +139,63 @@ enum yysymbol_kind_t
YYSYMBOL_NAME = 3, /* NAME */
YYSYMBOL_FILENAME = 4, /* FILENAME */
YYSYMBOL_FLAG = 5, /* FLAG */
- YYSYMBOL_COMMENT = 6, /* COMMENT */
- YYSYMBOL_GSSWITCH = 7, /* GSSWITCH */
- YYSYMBOL_COMMAND = 8, /* COMMAND */
- YYSYMBOL_WALNTOK = 9, /* WALNTOK */
- YYSYMBOL_ENCTOK = 10, /* ENCTOK */
- YYSYMBOL_NUM = 11, /* NUM */
- YYSYMBOL_HOTSTOK = 12, /* HOTSTOK */
- YYSYMBOL_CUTSTOK = 13, /* CUTSTOK */
- YYSYMBOL_BACKTOK = 14, /* BACKTOK */
- YYSYMBOL_INTRTOK = 15, /* INTRTOK */
- YYSYMBOL_RETTOK = 16, /* RETTOK */
- YYSYMBOL_TIMETOK = 17, /* TIMETOK */
- YYSYMBOL_PALETOK = 18, /* PALETOK */
- YYSYMBOL_BBOXTOK = 19, /* BBOXTOK */
- YYSYMBOL_OVERTOK = 20, /* OVERTOK */
- YYSYMBOL_MICETOK = 21, /* MICETOK */
- YYSYMBOL_SONDTOK = 22, /* SONDTOK */
- YYSYMBOL_PLAYTOK = 23, /* PLAYTOK */
- YYSYMBOL_ENDTOK = 24, /* ENDTOK */
- YYSYMBOL_MENUTOK = 25, /* MENUTOK */
- YYSYMBOL_SMENTOK = 26, /* SMENTOK */
- YYSYMBOL_ESCPTOK = 27, /* ESCPTOK */
- YYSYMBOL_NRTOK = 28, /* NRTOK */
- YYSYMBOL_AMBITOK = 29, /* AMBITOK */
- YYSYMBOL_SWPTTOK = 30, /* SWPTTOK */
- YYSYMBOL_MPTRTOK = 31, /* MPTRTOK */
- YYSYMBOL_GLOBTOK = 32, /* GLOBTOK */
- YYSYMBOL_TONTOK = 33, /* TONTOK */
- YYSYMBOL_TOFFTOK = 34, /* TOFFTOK */
- YYSYMBOL_TALKTOK = 35, /* TALKTOK */
- YYSYMBOL_INACTOK = 36, /* INACTOK */
- YYSYMBOL_FDTOK = 37, /* FDTOK */
- YYSYMBOL_BOXXTOK = 38, /* BOXXTOK */
- YYSYMBOL_ESCAPETOK = 39, /* ESCAPETOK */
- YYSYMBOL_SECONDTOK = 40, /* SECONDTOK */
- YYSYMBOL_INTROTOK = 41, /* INTROTOK */
- YYSYMBOL_DEFAULTTOK = 42, /* DEFAULTTOK */
- YYSYMBOL_PG = 43, /* PG */
- YYSYMBOL_PA = 44, /* PA */
- YYSYMBOL_PD = 45, /* PD */
- YYSYMBOL_PH = 46, /* PH */
- YYSYMBOL_PF = 47, /* PF */
- YYSYMBOL_PE = 48, /* PE */
- YYSYMBOL_PP = 49, /* PP */
- YYSYMBOL_PI = 50, /* PI */
+ YYSYMBOL_GSSWITCH = 6, /* GSSWITCH */
+ YYSYMBOL_WALNTOK = 7, /* WALNTOK */
+ YYSYMBOL_ENCTOK = 8, /* ENCTOK */
+ YYSYMBOL_NUM = 9, /* NUM */
+ YYSYMBOL_COMMENT = 10, /* COMMENT */
+ YYSYMBOL_HOTSTOK = 11, /* HOTSTOK */
+ YYSYMBOL_CUTSTOK = 12, /* CUTSTOK */
+ YYSYMBOL_BACKTOK = 13, /* BACKTOK */
+ YYSYMBOL_INTRTOK = 14, /* INTRTOK */
+ YYSYMBOL_RETTOK = 15, /* RETTOK */
+ YYSYMBOL_TIMETOK = 16, /* TIMETOK */
+ YYSYMBOL_PALETOK = 17, /* PALETOK */
+ YYSYMBOL_BBOXTOK = 18, /* BBOXTOK */
+ YYSYMBOL_OVERTOK = 19, /* OVERTOK */
+ YYSYMBOL_MICETOK = 20, /* MICETOK */
+ YYSYMBOL_SONDTOK = 21, /* SONDTOK */
+ YYSYMBOL_PLAYTOK = 22, /* PLAYTOK */
+ YYSYMBOL_ENDTOK = 23, /* ENDTOK */
+ YYSYMBOL_MENUTOK = 24, /* MENUTOK */
+ YYSYMBOL_SMENTOK = 25, /* SMENTOK */
+ YYSYMBOL_ESCPTOK = 26, /* ESCPTOK */
+ YYSYMBOL_NRTOK = 27, /* NRTOK */
+ YYSYMBOL_AMBITOK = 28, /* AMBITOK */
+ YYSYMBOL_SWPTTOK = 29, /* SWPTTOK */
+ YYSYMBOL_MPTRTOK = 30, /* MPTRTOK */
+ YYSYMBOL_GLOBTOK = 31, /* GLOBTOK */
+ YYSYMBOL_TONTOK = 32, /* TONTOK */
+ YYSYMBOL_TOFFTOK = 33, /* TOFFTOK */
+ YYSYMBOL_TALKTOK = 34, /* TALKTOK */
+ YYSYMBOL_INACTOK = 35, /* INACTOK */
+ YYSYMBOL_FDTOK = 36, /* FDTOK */
+ YYSYMBOL_BOXXTOK = 37, /* BOXXTOK */
+ YYSYMBOL_ESCAPETOK = 38, /* ESCAPETOK */
+ YYSYMBOL_SECONDTOK = 39, /* SECONDTOK */
+ YYSYMBOL_INTROTOK = 40, /* INTROTOK */
+ YYSYMBOL_DEFAULTTOK = 41, /* DEFAULTTOK */
+ YYSYMBOL_PG = 42, /* PG */
+ YYSYMBOL_PA = 43, /* PA */
+ YYSYMBOL_PD = 44, /* PD */
+ YYSYMBOL_PH = 45, /* PH */
+ YYSYMBOL_PF = 46, /* PF */
+ YYSYMBOL_PP = 47, /* PP */
+ YYSYMBOL_PI = 48, /* PI */
+ YYSYMBOL_PS = 49, /* PS */
+ YYSYMBOL_PE = 50, /* PE */
YYSYMBOL_PL = 51, /* PL */
- YYSYMBOL_PS = 52, /* PS */
- YYSYMBOL_YYACCEPT = 53, /* $accept */
- YYSYMBOL_start = 54, /* start */
- YYSYMBOL_init = 55, /* init */
- YYSYMBOL_lines = 56, /* lines */
- YYSYMBOL_line = 57, /* line */
- YYSYMBOL_anything = 58, /* anything */
- YYSYMBOL_alloctalk = 59, /* alloctalk */
- YYSYMBOL_talk = 60, /* talk */
- YYSYMBOL_mflag = 61, /* mflag */
- YYSYMBOL_flag = 62, /* flag */
- YYSYMBOL_gsswitch = 63 /* gsswitch */
+ YYSYMBOL_YYACCEPT = 52, /* $accept */
+ YYSYMBOL_start = 53, /* start */
+ YYSYMBOL_init = 54, /* init */
+ YYSYMBOL_lines = 55, /* lines */
+ YYSYMBOL_line = 56, /* line */
+ YYSYMBOL_anything = 57, /* anything */
+ YYSYMBOL_alloctalk = 58, /* alloctalk */
+ YYSYMBOL_talk = 59, /* talk */
+ YYSYMBOL_mflag = 60, /* mflag */
+ YYSYMBOL_flag = 61, /* flag */
+ YYSYMBOL_gsswitch = 62 /* gsswitch */
};
typedef enum yysymbol_kind_t yysymbol_kind_t;
@@ -525,7 +526,7 @@ union yyalloc
#define YYLAST 131
/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 53
+#define YYNTOKENS 52
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 11
/* YYNRULES -- Number of rules. */
@@ -534,7 +535,7 @@ union yyalloc
#define YYNSTATES 141
/* YYMAXUTOK -- Last valid token kind. */
-#define YYMAXUTOK 307
+#define YYMAXUTOK 306
/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
@@ -578,19 +579,19 @@ static const yytype_int8 yytranslate[] =
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
- 45, 46, 47, 48, 49, 50, 51, 52
+ 45, 46, 47, 48, 49, 50, 51
};
#if HYPNO_MIS_DEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_int16 yyrline[] =
{
- 0, 72, 72, 75, 86, 87, 91, 107, 121, 127,
- 142, 148, 154, 160, 167, 174, 180, 186, 192, 198,
- 204, 211, 218, 225, 232, 238, 244, 247, 253, 259,
- 262, 263, 266, 273, 276, 277, 281, 284, 287, 291,
- 295, 300, 306, 307, 313, 319, 325, 332, 339, 345,
- 350, 351, 354, 355, 358, 359, 362, 363
+ 0, 75, 75, 78, 89, 90, 94, 113, 128, 134,
+ 149, 155, 163, 169, 180, 189, 198, 208, 217, 225,
+ 233, 241, 249, 257, 265, 276, 283, 287, 293, 299,
+ 302, 303, 306, 313, 316, 317, 325, 328, 331, 338,
+ 344, 351, 359, 363, 371, 379, 387, 397, 406, 414,
+ 420, 421, 424, 425, 428, 429, 432, 433
};
#endif
@@ -607,13 +608,13 @@ static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
static const char *const yytname[] =
{
"\"end of file\"", "error", "\"invalid token\"", "NAME", "FILENAME",
- "FLAG", "COMMENT", "GSSWITCH", "COMMAND", "WALNTOK", "ENCTOK", "NUM",
- "HOTSTOK", "CUTSTOK", "BACKTOK", "INTRTOK", "RETTOK", "TIMETOK",
- "PALETOK", "BBOXTOK", "OVERTOK", "MICETOK", "SONDTOK", "PLAYTOK",
- "ENDTOK", "MENUTOK", "SMENTOK", "ESCPTOK", "NRTOK", "AMBITOK", "SWPTTOK",
+ "FLAG", "GSSWITCH", "WALNTOK", "ENCTOK", "NUM", "COMMENT", "HOTSTOK",
+ "CUTSTOK", "BACKTOK", "INTRTOK", "RETTOK", "TIMETOK", "PALETOK",
+ "BBOXTOK", "OVERTOK", "MICETOK", "SONDTOK", "PLAYTOK", "ENDTOK",
+ "MENUTOK", "SMENTOK", "ESCPTOK", "NRTOK", "AMBITOK", "SWPTTOK",
"MPTRTOK", "GLOBTOK", "TONTOK", "TOFFTOK", "TALKTOK", "INACTOK", "FDTOK",
"BOXXTOK", "ESCAPETOK", "SECONDTOK", "INTROTOK", "DEFAULTTOK", "PG",
- "PA", "PD", "PH", "PF", "PE", "PP", "PI", "PL", "PS", "$accept", "start",
+ "PA", "PD", "PH", "PF", "PP", "PI", "PS", "PE", "PL", "$accept", "start",
"init", "lines", "line", "anything", "alloctalk", "talk", "mflag",
"flag", "gsswitch", YY_NULLPTR
};
@@ -639,20 +640,20 @@ yysymbol_name (yysymbol_kind_t yysymbol)
STATE-NUM. */
static const yytype_int8 yypact[] =
{
- -89, 5, 78, -89, 13, -1, 15, 16, 18, -89,
- 14, 20, 23, 24, 25, 26, 28, 9, -89, -89,
- 29, 30, 31, 32, -89, -89, 78, 33, 35, -89,
- 39, 40, 37, -89, 41, 42, 27, 43, 28, 44,
- -89, -89, 37, 45, -89, 46, 52, 34, -89, 48,
- 50, 51, 53, -89, 54, -89, -89, 55, -89, -89,
- 37, 56, 58, -89, 59, 34, 34, 77, -89, 85,
- 93, 102, 34, 34, 34, 34, 34, -89, 100, 101,
- 34, 34, -89, 36, 103, 36, -89, 110, 36, -89,
- 110, 105, 106, -89, -89, 107, 108, 109, 111, -89,
- -89, -89, -89, -89, 112, 113, -89, -89, -89, 110,
- 114, 110, -89, -89, 110, -89, 115, 116, -89, 117,
- 118, 119, 110, 34, -89, -89, 110, -89, 120, 36,
- 110, -89, -89, 34, -89, -89, -89, 110, -89, -89,
+ -89, 4, 80, -89, 13, 0, 15, 16, 18, -89,
+ 19, 20, 21, 23, 25, 26, 28, 9, -89, -89,
+ 31, 27, 33, 34, -89, -89, 80, 30, 32, -89,
+ 36, 37, 29, -89, 41, 42, 44, 45, 28, 38,
+ -89, -89, 29, 46, -89, 47, 40, 35, -89, 48,
+ 50, 51, 52, -89, 53, -89, -89, 54, -89, -89,
+ 29, 55, 56, -89, 62, 35, 35, 58, -89, 65,
+ 84, 85, 35, 35, 35, 35, 35, 81, 89, 35,
+ -89, 35, -89, 101, 103, 101, -89, 39, 101, -89,
+ 39, 104, 106, -89, -89, 107, 108, 109, 110, -89,
+ -89, -89, -89, -89, 111, 112, -89, -89, -89, 39,
+ 113, 39, -89, -89, 39, -89, 114, 115, -89, 116,
+ 117, 118, 39, 35, -89, -89, 39, -89, 119, 101,
+ 39, -89, -89, 35, -89, -89, -89, 39, -89, -89,
-89
};
@@ -668,10 +669,10 @@ static const yytype_int8 yydefact[] =
52, 7, 53, 0, 12, 0, 0, 51, 4, 0,
0, 0, 0, 11, 0, 25, 17, 0, 30, 28,
53, 0, 0, 14, 0, 51, 51, 0, 37, 0,
- 0, 0, 51, 51, 51, 51, 51, 50, 0, 0,
- 51, 51, 27, 57, 0, 57, 21, 55, 57, 6,
+ 0, 0, 51, 51, 51, 51, 51, 0, 0, 51,
+ 50, 51, 27, 57, 0, 57, 21, 55, 57, 6,
55, 0, 0, 33, 34, 0, 0, 0, 0, 41,
- 44, 45, 42, 43, 0, 0, 49, 48, 56, 55,
+ 44, 45, 42, 43, 0, 0, 48, 49, 56, 55,
0, 55, 54, 19, 55, 15, 0, 0, 36, 0,
0, 0, 55, 51, 24, 8, 55, 16, 0, 57,
55, 39, 40, 51, 47, 13, 26, 55, 38, 46,
@@ -681,7 +682,7 @@ static const yytype_int8 yydefact[] =
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int8 yypgoto[] =
{
- -89, -89, -89, 10, -89, 7, -89, -65, -28, -88,
+ -89, -89, -89, 105, -89, 91, -89, -65, -27, -88,
-82
};
@@ -697,70 +698,70 @@ static const yytype_int8 yydefgoto[] =
number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_uint8 yytable[] =
{
- 93, 94, 115, 111, 53, 3, 114, 99, 100, 101,
- 102, 103, 40, 41, 60, 106, 107, 27, 28, 29,
- 30, 124, 31, 126, 33, 32, 127, 34, 35, 36,
- 37, 38, 89, 43, 133, 45, 48, 56, 135, 46,
- 40, 44, 138, 108, 49, 58, 50, 137, 64, 140,
- 51, 52, 54, 55, 57, 63, 61, 62, 134, 83,
- 59, 84, 85, 92, 86, 87, 88, 90, 139, 91,
+ 93, 94, 115, 111, 3, 53, 114, 99, 100, 101,
+ 102, 103, 40, 41, 106, 60, 107, 27, 28, 29,
+ 30, 124, 31, 126, 33, 34, 127, 35, 32, 36,
+ 37, 38, 40, 89, 133, 43, 44, 45, 135, 49,
+ 46, 50, 138, 63, 112, 51, 52, 137, 64, 140,
+ 54, 55, 56, 59, 57, 61, 62, 83, 134, 84,
+ 85, 86, 87, 88, 90, 91, 92, 95, 139, 96,
65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
- 75, 76, 77, 78, 79, 80, 81, 4, 95, 96,
- 5, 6, 7, 8, 9, 10, 11, 97, 12, 13,
- 14, 15, 16, 17, 18, 19, 98, 20, 21, 22,
- 23, 104, 105, 24, 110, 112, 116, 117, 118, 119,
- 120, 0, 121, 122, 123, 125, 128, 129, 130, 131,
- 132, 136
+ 75, 76, 77, 78, 79, 80, 81, 4, 97, 98,
+ 104, 5, 6, 7, 8, 9, 10, 11, 105, 12,
+ 13, 14, 15, 16, 17, 18, 19, 108, 20, 21,
+ 22, 23, 110, 116, 24, 117, 118, 119, 120, 121,
+ 122, 123, 125, 128, 129, 130, 131, 132, 136, 58,
+ 0, 48
};
static const yytype_int16 yycheck[] =
{
- 65, 66, 90, 85, 32, 0, 88, 72, 73, 74,
- 75, 76, 3, 4, 42, 80, 81, 4, 19, 4,
- 4, 109, 4, 111, 4, 11, 114, 4, 4, 4,
- 4, 3, 60, 4, 122, 4, 26, 10, 126, 7,
- 3, 11, 130, 7, 11, 38, 11, 129, 14, 137,
- 11, 11, 11, 11, 11, 3, 11, 11, 123, 11,
- 16, 11, 11, 4, 11, 11, 11, 11, 133, 11,
- 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
- 46, 47, 48, 49, 50, 51, 52, 9, 11, 4,
- 12, 13, 14, 15, 16, 17, 18, 4, 20, 21,
- 22, 23, 24, 25, 26, 27, 4, 29, 30, 31,
- 32, 11, 11, 35, 11, 5, 11, 11, 11, 11,
- 11, -1, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11
+ 65, 66, 90, 85, 0, 32, 88, 72, 73, 74,
+ 75, 76, 3, 4, 79, 42, 81, 4, 18, 4,
+ 4, 109, 4, 111, 4, 4, 114, 4, 9, 4,
+ 4, 3, 3, 60, 122, 4, 9, 4, 126, 9,
+ 6, 9, 130, 3, 5, 9, 9, 129, 13, 137,
+ 9, 9, 8, 15, 9, 9, 9, 9, 123, 9,
+ 9, 9, 9, 9, 9, 9, 4, 9, 133, 4,
+ 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
+ 45, 46, 47, 48, 49, 50, 51, 7, 4, 4,
+ 9, 11, 12, 13, 14, 15, 16, 17, 9, 19,
+ 20, 21, 22, 23, 24, 25, 26, 6, 28, 29,
+ 30, 31, 9, 9, 34, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 38,
+ -1, 26
};
/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
state STATE-NUM. */
static const yytype_int8 yystos[] =
{
- 0, 54, 55, 0, 9, 12, 13, 14, 15, 16,
- 17, 18, 20, 21, 22, 23, 24, 25, 26, 27,
- 29, 30, 31, 32, 35, 56, 57, 4, 19, 4,
- 4, 4, 11, 4, 4, 4, 4, 4, 3, 58,
- 3, 4, 61, 4, 11, 4, 7, 59, 56, 11,
- 11, 11, 11, 61, 11, 11, 10, 11, 58, 16,
- 61, 11, 11, 3, 14, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
- 51, 52, 60, 11, 11, 11, 11, 11, 11, 61,
- 11, 11, 4, 60, 60, 11, 4, 4, 4, 60,
- 60, 60, 60, 60, 11, 11, 60, 60, 7, 63,
- 11, 63, 5, 62, 63, 62, 11, 11, 11, 11,
- 11, 11, 11, 11, 62, 11, 62, 62, 11, 11,
- 11, 11, 11, 62, 60, 62, 11, 63, 62, 60,
- 62
+ 0, 53, 54, 0, 7, 11, 12, 13, 14, 15,
+ 16, 17, 19, 20, 21, 22, 23, 24, 25, 26,
+ 28, 29, 30, 31, 34, 55, 56, 4, 18, 4,
+ 4, 4, 9, 4, 4, 4, 4, 4, 3, 57,
+ 3, 4, 60, 4, 9, 4, 6, 58, 55, 9,
+ 9, 9, 9, 60, 9, 9, 8, 9, 57, 15,
+ 60, 9, 9, 3, 13, 35, 36, 37, 38, 39,
+ 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
+ 50, 51, 59, 9, 9, 9, 9, 9, 9, 60,
+ 9, 9, 4, 59, 59, 9, 4, 4, 4, 59,
+ 59, 59, 59, 59, 9, 9, 59, 59, 6, 62,
+ 9, 62, 5, 61, 62, 61, 9, 9, 9, 9,
+ 9, 9, 9, 9, 61, 9, 61, 61, 9, 9,
+ 9, 9, 9, 61, 59, 61, 9, 62, 61, 59,
+ 61
};
/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
static const yytype_int8 yyr1[] =
{
- 0, 53, 54, 55, 56, 56, 57, 57, 57, 57,
- 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
- 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
- 58, 58, 59, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 61, 61, 62, 62, 63, 63
+ 0, 52, 53, 54, 55, 55, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+ 57, 57, 58, 59, 59, 59, 59, 59, 59, 59,
+ 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
+ 59, 59, 60, 60, 61, 61, 62, 62
};
/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
@@ -1235,7 +1236,7 @@ yyreduce:
switch (yyn)
{
case 3: /* init: %empty */
-#line 75 "engines/hypno/grammar_mis.y"
+#line 78 "engines/hypno/grammar_mis.y"
{
if (smenu_idx)
delete smenu_idx;
@@ -1246,11 +1247,11 @@ yyreduce:
stack = new Hypno::HotspotsStack();
stack->push_back(new Hotspots());
}
-#line 1250 "engines/hypno/grammar_mis.cpp"
+#line 1251 "engines/hypno/grammar_mis.cpp"
break;
case 6: /* line: MENUTOK mflag mflag mflag */
-#line 91 "engines/hypno/grammar_mis.y"
+#line 94 "engines/hypno/grammar_mis.y"
{
Hotspot hot(MakeMenu);
debugC(1, kHypnoDebugParser, "MENU %s %s", (yyvsp[-2].s), (yyvsp[-1].s));
@@ -1266,12 +1267,15 @@ yyreduce:
idx++;
smenu_idx->pop_back();
smenu_idx->push_back(idx);
+ free((yyvsp[-2].s));
+ free((yyvsp[-1].s));
+ free((yyvsp[0].s));
}
-#line 1271 "engines/hypno/grammar_mis.cpp"
+#line 1275 "engines/hypno/grammar_mis.cpp"
break;
case 7: /* line: MENUTOK FILENAME */
-#line 107 "engines/hypno/grammar_mis.y"
+#line 113 "engines/hypno/grammar_mis.y"
{
Hotspot hot(MakeMenu);
debugC(1, kHypnoDebugParser, "MENU %s", (yyvsp[0].s));
@@ -1285,23 +1289,24 @@ yyreduce:
idx++;
smenu_idx->pop_back();
smenu_idx->push_back(idx);
+ free((yyvsp[0].s));
}
-#line 1290 "engines/hypno/grammar_mis.cpp"
+#line 1295 "engines/hypno/grammar_mis.cpp"
break;
case 8: /* line: HOTSTOK BBOXTOK NUM NUM NUM NUM */
-#line 121 "engines/hypno/grammar_mis.y"
+#line 128 "engines/hypno/grammar_mis.y"
{
Hotspot hot(MakeHotspot, Common::Rect((yyvsp[-3].i), (yyvsp[-2].i), (yyvsp[-1].i), (yyvsp[0].i)));
debugC(1, kHypnoDebugParser, "HOTS %d.", hot.type);
Hotspots *cur = stack->back();
cur->push_back(hot);
}
-#line 1301 "engines/hypno/grammar_mis.cpp"
+#line 1306 "engines/hypno/grammar_mis.cpp"
break;
case 9: /* line: SMENTOK */
-#line 127 "engines/hypno/grammar_mis.y"
+#line 134 "engines/hypno/grammar_mis.y"
{
// This should always point to a hotspot
int idx = smenu_idx->back();
@@ -1317,444 +1322,513 @@ yyreduce:
stack->push_back(hot->smenu);
debugC(1, kHypnoDebugParser, "SUBMENU");
}
-#line 1321 "engines/hypno/grammar_mis.cpp"
+#line 1326 "engines/hypno/grammar_mis.cpp"
break;
case 10: /* line: ESCPTOK */
-#line 142 "engines/hypno/grammar_mis.y"
+#line 149 "engines/hypno/grammar_mis.y"
{
Escape *a = new Escape();
Hotspots *cur = stack->back();
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
debugC(1, kHypnoDebugParser, "ESC SUBMENU"); }
-#line 1332 "engines/hypno/grammar_mis.cpp"
+#line 1337 "engines/hypno/grammar_mis.cpp"
break;
case 11: /* line: TIMETOK NUM mflag */
-#line 148 "engines/hypno/grammar_mis.y"
+#line 155 "engines/hypno/grammar_mis.y"
{
Timer *a = new Timer((yyvsp[-1].i), (yyvsp[0].s));
Hotspots *cur = stack->back();
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
- debugC(1, kHypnoDebugParser, "TIME %d %s", (yyvsp[-1].i), (yyvsp[0].s)); }
-#line 1343 "engines/hypno/grammar_mis.cpp"
+ debugC(1, kHypnoDebugParser, "TIME %d %s", (yyvsp[-1].i), (yyvsp[0].s));
+ free((yyvsp[0].s));
+ }
+#line 1350 "engines/hypno/grammar_mis.cpp"
break;
case 12: /* line: SWPTTOK NUM */
-#line 154 "engines/hypno/grammar_mis.y"
+#line 163 "engines/hypno/grammar_mis.y"
{
SwapPointer *a = new SwapPointer((yyvsp[0].i));
Hotspots *cur = stack->back();
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
debugC(1, kHypnoDebugParser, "SWPT %d", (yyvsp[0].i)); }
-#line 1354 "engines/hypno/grammar_mis.cpp"
+#line 1361 "engines/hypno/grammar_mis.cpp"
break;
case 13: /* line: BACKTOK FILENAME NUM NUM gsswitch flag flag */
-#line 160 "engines/hypno/grammar_mis.y"
+#line 169 "engines/hypno/grammar_mis.y"
{
Background *a = new Background((yyvsp[-5].s), Common::Point((yyvsp[-4].i), (yyvsp[-3].i)), (yyvsp[-2].s), (yyvsp[-1].s), (yyvsp[0].s));
Hotspots *cur = stack->back();
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
debugC(1, kHypnoDebugParser, "BACK");
+ free((yyvsp[-5].s));
+ free((yyvsp[-2].s));
+ free((yyvsp[-1].s));
+ free((yyvsp[0].s));
}
-#line 1366 "engines/hypno/grammar_mis.cpp"
+#line 1377 "engines/hypno/grammar_mis.cpp"
break;
case 14: /* line: GLOBTOK GSSWITCH NAME */
-#line 167 "engines/hypno/grammar_mis.y"
+#line 180 "engines/hypno/grammar_mis.y"
{
Global *a = new Global((yyvsp[-1].s), (yyvsp[0].s));
Hotspots *cur = stack->back();
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
debugC(1, kHypnoDebugParser, "GLOB");
+ free((yyvsp[-1].s));
+ free((yyvsp[0].s));
}
-#line 1378 "engines/hypno/grammar_mis.cpp"
+#line 1391 "engines/hypno/grammar_mis.cpp"
break;
case 15: /* line: AMBITOK FILENAME NUM NUM flag */
-#line 174 "engines/hypno/grammar_mis.y"
+#line 189 "engines/hypno/grammar_mis.y"
{
Ambient *a = new Ambient((yyvsp[-3].s), Common::Point((yyvsp[-2].i), (yyvsp[-1].i)), (yyvsp[0].s));
Hotspots *cur = stack->back();
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
- debugC(1, kHypnoDebugParser, "AMBI %d %d", (yyvsp[-2].i), (yyvsp[-1].i)); }
-#line 1389 "engines/hypno/grammar_mis.cpp"
+ debugC(1, kHypnoDebugParser, "AMBI %d %d", (yyvsp[-2].i), (yyvsp[-1].i));
+ free((yyvsp[-3].s));
+ free((yyvsp[0].s));
+ }
+#line 1405 "engines/hypno/grammar_mis.cpp"
break;
case 16: /* line: PLAYTOK FILENAME NUM NUM gsswitch flag */
-#line 180 "engines/hypno/grammar_mis.y"
+#line 198 "engines/hypno/grammar_mis.y"
{
Play *a = new Play((yyvsp[-4].s), Common::Point((yyvsp[-3].i), (yyvsp[-2].i)), (yyvsp[-1].s), (yyvsp[0].s));
Hotspots *cur = stack->back();
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
- debugC(1, kHypnoDebugParser, "PLAY %s.", (yyvsp[-4].s)); }
-#line 1400 "engines/hypno/grammar_mis.cpp"
+ debugC(1, kHypnoDebugParser, "PLAY %s.", (yyvsp[-4].s));
+ free((yyvsp[-4].s));
+ free((yyvsp[-1].s));
+ free((yyvsp[0].s));
+ }
+#line 1420 "engines/hypno/grammar_mis.cpp"
break;
case 17: /* line: SONDTOK FILENAME ENCTOK */
-#line 186 "engines/hypno/grammar_mis.y"
+#line 208 "engines/hypno/grammar_mis.y"
{
//Play *a = new Play($2, Common::Point($3, $4), $5, $6);
//Hotspots *cur = stack->back();
//Hotspot *hot = &cur->back();
//hot->actions.push_back(a);
- debugC(1, kHypnoDebugParser, "SOND %s.", (yyvsp[-1].s)); }
-#line 1411 "engines/hypno/grammar_mis.cpp"
+ debugC(1, kHypnoDebugParser, "SOND %s.", (yyvsp[-1].s));
+ free((yyvsp[-1].s));
+ free((yyvsp[0].s));
+ }
+#line 1434 "engines/hypno/grammar_mis.cpp"
break;
case 18: /* line: SONDTOK FILENAME */
-#line 192 "engines/hypno/grammar_mis.y"
+#line 217 "engines/hypno/grammar_mis.y"
{
//Play *a = new Play($2, Common::Point($3, $4), $5, $6);
//Hotspots *cur = stack->back();
//Hotspot *hot = &cur->back();
//hot->actions.push_back(a);
- debugC(1, kHypnoDebugParser, "SOND %s.", (yyvsp[0].s)); }
-#line 1422 "engines/hypno/grammar_mis.cpp"
+ debugC(1, kHypnoDebugParser, "SOND %s.", (yyvsp[0].s));
+ free((yyvsp[0].s));
+ }
+#line 1447 "engines/hypno/grammar_mis.cpp"
break;
case 19: /* line: OVERTOK FILENAME NUM NUM flag */
-#line 198 "engines/hypno/grammar_mis.y"
+#line 225 "engines/hypno/grammar_mis.y"
{
Overlay *a = new Overlay((yyvsp[-3].s), Common::Point((yyvsp[-2].i), (yyvsp[-1].i)), (yyvsp[0].s));
Hotspots *cur = stack->back();
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
+ free((yyvsp[-3].s));
+ free((yyvsp[0].s));
}
-#line 1433 "engines/hypno/grammar_mis.cpp"
+#line 1460 "engines/hypno/grammar_mis.cpp"
break;
case 20: /* line: PALETOK FILENAME */
-#line 204 "engines/hypno/grammar_mis.y"
+#line 233 "engines/hypno/grammar_mis.y"
{
Palette *a = new Palette((yyvsp[0].s));
Hotspots *cur = stack->back();
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
debugC(1, kHypnoDebugParser, "PALE");
+ free((yyvsp[0].s));
}
-#line 1445 "engines/hypno/grammar_mis.cpp"
+#line 1473 "engines/hypno/grammar_mis.cpp"
break;
case 21: /* line: INTRTOK FILENAME NUM NUM */
-#line 211 "engines/hypno/grammar_mis.y"
+#line 241 "engines/hypno/grammar_mis.y"
{
Intro *a = new Intro(Common::String("cine/") + (yyvsp[-2].s));
Hotspots *cur = stack->back();
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
debugC(1, kHypnoDebugParser, "INTRO %s %d %d", (yyvsp[-2].s), (yyvsp[-1].i), (yyvsp[0].i));
+ free((yyvsp[-2].s));
}
-#line 1457 "engines/hypno/grammar_mis.cpp"
+#line 1486 "engines/hypno/grammar_mis.cpp"
break;
case 22: /* line: INTRTOK FILENAME */
-#line 218 "engines/hypno/grammar_mis.y"
+#line 249 "engines/hypno/grammar_mis.y"
{
Intro *a = new Intro(Common::String("cine/") + (yyvsp[0].s));
Hotspots *cur = stack->back();
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
debugC(1, kHypnoDebugParser, "INTRO %s", (yyvsp[0].s));
+ free((yyvsp[0].s));
}
-#line 1469 "engines/hypno/grammar_mis.cpp"
+#line 1499 "engines/hypno/grammar_mis.cpp"
break;
case 23: /* line: CUTSTOK FILENAME */
-#line 225 "engines/hypno/grammar_mis.y"
+#line 257 "engines/hypno/grammar_mis.y"
{
Cutscene *a = new Cutscene((yyvsp[0].s));
Hotspots *cur = stack->back();
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
debugC(1, kHypnoDebugParser, "CUTS %s", (yyvsp[0].s));
+ free((yyvsp[0].s));
}
-#line 1481 "engines/hypno/grammar_mis.cpp"
+#line 1512 "engines/hypno/grammar_mis.cpp"
break;
case 24: /* line: WALNTOK FILENAME NUM NUM gsswitch flag */
-#line 232 "engines/hypno/grammar_mis.y"
+#line 265 "engines/hypno/grammar_mis.y"
{
WalN *a = new WalN((yyvsp[-5].s), (yyvsp[-4].s), Common::Point((yyvsp[-3].i), (yyvsp[-2].i)), (yyvsp[-1].s), (yyvsp[0].s));
Hotspots *cur = stack->back();
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
- debugC(1, kHypnoDebugParser, "WALN %s %d %d", (yyvsp[-4].s), (yyvsp[-3].i), (yyvsp[-2].i)); }
-#line 1492 "engines/hypno/grammar_mis.cpp"
+ debugC(1, kHypnoDebugParser, "WALN %s %d %d", (yyvsp[-4].s), (yyvsp[-3].i), (yyvsp[-2].i));
+ free((yyvsp[-5].s));
+ free((yyvsp[-4].s));
+ free((yyvsp[-1].s));
+ free((yyvsp[0].s));
+ }
+#line 1528 "engines/hypno/grammar_mis.cpp"
break;
case 25: /* line: MICETOK FILENAME NUM */
-#line 238 "engines/hypno/grammar_mis.y"
+#line 276 "engines/hypno/grammar_mis.y"
{
Mice *a = new Mice((yyvsp[-1].s), (yyvsp[0].i)-1);
Hotspots *cur = stack->back();
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
+ free((yyvsp[-1].s));
}
-#line 1503 "engines/hypno/grammar_mis.cpp"
+#line 1540 "engines/hypno/grammar_mis.cpp"
break;
case 26: /* line: MPTRTOK FILENAME NUM NUM NUM NUM NUM */
-#line 244 "engines/hypno/grammar_mis.y"
+#line 283 "engines/hypno/grammar_mis.y"
{
debugC(1, kHypnoDebugParser, "MPTR %s %d %d %d %d %d", (yyvsp[-5].s), (yyvsp[-4].i), (yyvsp[-3].i), (yyvsp[-2].i), (yyvsp[-1].i), (yyvsp[0].i));
+ free((yyvsp[-5].s));
}
-#line 1511 "engines/hypno/grammar_mis.cpp"
+#line 1549 "engines/hypno/grammar_mis.cpp"
break;
case 27: /* line: TALKTOK alloctalk talk */
-#line 247 "engines/hypno/grammar_mis.y"
+#line 287 "engines/hypno/grammar_mis.y"
{
Hotspots *cur = stack->back();
Hotspot *hot = &cur->back();
hot->actions.push_back(talk_action);
talk_action = nullptr;
debugC(1, kHypnoDebugParser, "TALK"); }
-#line 1522 "engines/hypno/grammar_mis.cpp"
+#line 1560 "engines/hypno/grammar_mis.cpp"
break;
case 28: /* line: ENDTOK anything RETTOK */
-#line 253 "engines/hypno/grammar_mis.y"
+#line 293 "engines/hypno/grammar_mis.y"
{
debugC(1, kHypnoDebugParser, "explicit END");
g_parsedHots = stack->back();
stack->pop_back();
smenu_idx->pop_back();
}
-#line 1533 "engines/hypno/grammar_mis.cpp"
+#line 1571 "engines/hypno/grammar_mis.cpp"
break;
case 29: /* line: RETTOK */
-#line 259 "engines/hypno/grammar_mis.y"
+#line 299 "engines/hypno/grammar_mis.y"
{ debugC(1, kHypnoDebugParser, "implicit END"); }
-#line 1539 "engines/hypno/grammar_mis.cpp"
+#line 1577 "engines/hypno/grammar_mis.cpp"
+ break;
+
+ case 30: /* anything: NAME anything */
+#line 302 "engines/hypno/grammar_mis.y"
+ { free((yyvsp[-1].s)); }
+#line 1583 "engines/hypno/grammar_mis.cpp"
break;
case 32: /* alloctalk: %empty */
-#line 266 "engines/hypno/grammar_mis.y"
+#line 306 "engines/hypno/grammar_mis.y"
{
assert(talk_action == nullptr);
talk_action = new Talk();
talk_action->escape = false;
talk_action->active = true;
}
-#line 1550 "engines/hypno/grammar_mis.cpp"
+#line 1594 "engines/hypno/grammar_mis.cpp"
break;
case 33: /* talk: INACTOK talk */
-#line 273 "engines/hypno/grammar_mis.y"
+#line 313 "engines/hypno/grammar_mis.y"
{
talk_action->active = false;
debugC(1, kHypnoDebugParser, "inactive"); }
-#line 1558 "engines/hypno/grammar_mis.cpp"
+#line 1602 "engines/hypno/grammar_mis.cpp"
break;
case 34: /* talk: FDTOK talk */
-#line 276 "engines/hypno/grammar_mis.y"
+#line 316 "engines/hypno/grammar_mis.y"
{ debugC(1, kHypnoDebugParser, "inactive"); }
-#line 1564 "engines/hypno/grammar_mis.cpp"
+#line 1608 "engines/hypno/grammar_mis.cpp"
break;
case 35: /* talk: BACKTOK FILENAME NUM NUM gsswitch flag */
-#line 277 "engines/hypno/grammar_mis.y"
+#line 317 "engines/hypno/grammar_mis.y"
{
talk_action->background = (yyvsp[-4].s);
talk_action->backgroundPos = Common::Point((yyvsp[-3].i), (yyvsp[-2].i));
- debugC(1, kHypnoDebugParser, "BACK in TALK"); }
-#line 1573 "engines/hypno/grammar_mis.cpp"
+ debugC(1, kHypnoDebugParser, "BACK in TALK");
+ free((yyvsp[-4].s));
+ free((yyvsp[-1].s));
+ free((yyvsp[0].s));
+ }
+#line 1621 "engines/hypno/grammar_mis.cpp"
break;
case 36: /* talk: BOXXTOK NUM NUM */
-#line 281 "engines/hypno/grammar_mis.y"
+#line 325 "engines/hypno/grammar_mis.y"
{
talk_action->boxPos = Common::Point((yyvsp[-1].i), (yyvsp[0].i));
debugC(1, kHypnoDebugParser, "BOXX %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1581 "engines/hypno/grammar_mis.cpp"
+#line 1629 "engines/hypno/grammar_mis.cpp"
break;
case 37: /* talk: ESCAPETOK */
-#line 284 "engines/hypno/grammar_mis.y"
+#line 328 "engines/hypno/grammar_mis.y"
{
talk_action->escape = true;
debugC(1, kHypnoDebugParser, "ESCAPE"); }
-#line 1589 "engines/hypno/grammar_mis.cpp"
+#line 1637 "engines/hypno/grammar_mis.cpp"
break;
case 38: /* talk: SECONDTOK FILENAME NUM NUM flag */
-#line 287 "engines/hypno/grammar_mis.y"
+#line 331 "engines/hypno/grammar_mis.y"
{
talk_action->second = (yyvsp[-3].s);
talk_action->secondPos = Common::Point((yyvsp[-2].i), (yyvsp[-1].i));
- debugC(1, kHypnoDebugParser, "SECOND %s %d %d '%s'", (yyvsp[-3].s), (yyvsp[-2].i), (yyvsp[-1].i), (yyvsp[0].s)); }
-#line 1598 "engines/hypno/grammar_mis.cpp"
+ debugC(1, kHypnoDebugParser, "SECOND %s %d %d '%s'", (yyvsp[-3].s), (yyvsp[-2].i), (yyvsp[-1].i), (yyvsp[0].s));
+ free((yyvsp[-3].s));
+ free((yyvsp[0].s));
+ }
+#line 1649 "engines/hypno/grammar_mis.cpp"
break;
case 39: /* talk: INTROTOK FILENAME NUM NUM */
-#line 291 "engines/hypno/grammar_mis.y"
+#line 338 "engines/hypno/grammar_mis.y"
{
talk_action->intro = (yyvsp[-2].s);
talk_action->introPos = Common::Point((yyvsp[-1].i), (yyvsp[0].i));
- debugC(1, kHypnoDebugParser, "INTRO %s %d %d", (yyvsp[-2].s), (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1607 "engines/hypno/grammar_mis.cpp"
+ debugC(1, kHypnoDebugParser, "INTRO %s %d %d", (yyvsp[-2].s), (yyvsp[-1].i), (yyvsp[0].i));
+ free((yyvsp[-2].s));
+ }
+#line 1660 "engines/hypno/grammar_mis.cpp"
break;
case 40: /* talk: DEFAULTTOK FILENAME NUM NUM */
-#line 295 "engines/hypno/grammar_mis.y"
+#line 344 "engines/hypno/grammar_mis.y"
{
// Unsure how this is different from second
talk_action->second = (yyvsp[-2].s);
talk_action->secondPos = Common::Point((yyvsp[-1].i), (yyvsp[0].i));
- debugC(1, kHypnoDebugParser, "DEFAULT %s %d %d", (yyvsp[-2].s), (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1617 "engines/hypno/grammar_mis.cpp"
+ debugC(1, kHypnoDebugParser, "DEFAULT %s %d %d", (yyvsp[-2].s), (yyvsp[-1].i), (yyvsp[0].i));
+ free((yyvsp[-2].s));
+ }
+#line 1672 "engines/hypno/grammar_mis.cpp"
break;
case 41: /* talk: PG talk */
-#line 300 "engines/hypno/grammar_mis.y"
+#line 351 "engines/hypno/grammar_mis.y"
{
TalkCommand talk_cmd;
talk_cmd.command = "G";
talk_cmd.path = (yyvsp[-1].s)+2;
talk_action->commands.push_back(talk_cmd);
- debugC(1, kHypnoDebugParser, "%s", (yyvsp[-1].s)); }
-#line 1628 "engines/hypno/grammar_mis.cpp"
+ debugC(1, kHypnoDebugParser, "%s", (yyvsp[-1].s));
+ free((yyvsp[-1].s));
+ }
+#line 1685 "engines/hypno/grammar_mis.cpp"
break;
case 42: /* talk: PH talk */
-#line 306 "engines/hypno/grammar_mis.y"
- { debugC(1, kHypnoDebugParser, "%s", (yyvsp[-1].s)); }
-#line 1634 "engines/hypno/grammar_mis.cpp"
+#line 359 "engines/hypno/grammar_mis.y"
+ {
+ debugC(1, kHypnoDebugParser, "%s", (yyvsp[-1].s));
+ free((yyvsp[-1].s));
+ }
+#line 1694 "engines/hypno/grammar_mis.cpp"
break;
case 43: /* talk: PF talk */
-#line 307 "engines/hypno/grammar_mis.y"
+#line 363 "engines/hypno/grammar_mis.y"
{
TalkCommand talk_cmd;
talk_cmd.command = "F";
talk_cmd.num = atoi((yyvsp[-1].s)+2)-1;
talk_action->commands.push_back(talk_cmd);
- debugC(1, kHypnoDebugParser, "%s", (yyvsp[-1].s)); }
-#line 1645 "engines/hypno/grammar_mis.cpp"
+ debugC(1, kHypnoDebugParser, "%s", (yyvsp[-1].s));
+ free((yyvsp[-1].s));
+ }
+#line 1707 "engines/hypno/grammar_mis.cpp"
break;
case 44: /* talk: PA talk */
-#line 313 "engines/hypno/grammar_mis.y"
+#line 371 "engines/hypno/grammar_mis.y"
{
TalkCommand talk_cmd;
talk_cmd.command = "A";
talk_cmd.num = atoi((yyvsp[-1].s)+2)-1;
talk_action->commands.push_back(talk_cmd);
- debugC(1, kHypnoDebugParser, "|A%d", talk_cmd.num); }
-#line 1656 "engines/hypno/grammar_mis.cpp"
+ debugC(1, kHypnoDebugParser, "|A%d", talk_cmd.num);
+ free((yyvsp[-1].s));
+ }
+#line 1720 "engines/hypno/grammar_mis.cpp"
break;
case 45: /* talk: PD talk */
-#line 319 "engines/hypno/grammar_mis.y"
+#line 379 "engines/hypno/grammar_mis.y"
{
TalkCommand talk_cmd;
talk_cmd.command = "D";
talk_cmd.num = atoi((yyvsp[-1].s)+2)-1;
talk_action->commands.push_back(talk_cmd);
- debugC(1, kHypnoDebugParser, "%s", (yyvsp[-1].s)); }
-#line 1667 "engines/hypno/grammar_mis.cpp"
+ debugC(1, kHypnoDebugParser, "%s", (yyvsp[-1].s));
+ free((yyvsp[-1].s));
+ }
+#line 1733 "engines/hypno/grammar_mis.cpp"
break;
case 46: /* talk: PP NUM NUM flag talk */
-#line 325 "engines/hypno/grammar_mis.y"
+#line 387 "engines/hypno/grammar_mis.y"
{
TalkCommand talk_cmd;
talk_cmd.command = "P";
talk_cmd.path = (yyvsp[-4].s)+2;
talk_cmd.position = Common::Point((yyvsp[-3].i), (yyvsp[-2].i));
talk_action->commands.push_back(talk_cmd);
- debugC(1, kHypnoDebugParser, "%s %d %d '%s'", (yyvsp[-4].s), (yyvsp[-3].i), (yyvsp[-2].i), (yyvsp[-1].s)); }
-#line 1679 "engines/hypno/grammar_mis.cpp"
+ debugC(1, kHypnoDebugParser, "%s %d %d '%s'", (yyvsp[-4].s), (yyvsp[-3].i), (yyvsp[-2].i), (yyvsp[-1].s));
+ free((yyvsp[-4].s));
+ free((yyvsp[-1].s));
+ }
+#line 1748 "engines/hypno/grammar_mis.cpp"
break;
case 47: /* talk: PI NUM NUM talk */
-#line 332 "engines/hypno/grammar_mis.y"
+#line 397 "engines/hypno/grammar_mis.y"
{
TalkCommand talk_cmd;
talk_cmd.command = "I";
talk_cmd.path = (yyvsp[-3].s)+2;
talk_cmd.position = Common::Point((yyvsp[-2].i), (yyvsp[-1].i));
talk_action->commands.push_back(talk_cmd);
- debugC(1, kHypnoDebugParser, "%s %d %d", (yyvsp[-3].s), (yyvsp[-2].i), (yyvsp[-1].i)); }
-#line 1691 "engines/hypno/grammar_mis.cpp"
+ debugC(1, kHypnoDebugParser, "%s %d %d", (yyvsp[-3].s), (yyvsp[-2].i), (yyvsp[-1].i));
+ free((yyvsp[-3].s));
+ }
+#line 1762 "engines/hypno/grammar_mis.cpp"
break;
case 48: /* talk: PS talk */
-#line 339 "engines/hypno/grammar_mis.y"
+#line 406 "engines/hypno/grammar_mis.y"
{
TalkCommand talk_cmd;
talk_cmd.command = "S";
talk_cmd.variable = (yyvsp[-1].s)+2;
talk_action->commands.push_back(talk_cmd);
- debugC(1, kHypnoDebugParser, "%s", (yyvsp[-1].s)); }
-#line 1702 "engines/hypno/grammar_mis.cpp"
+ debugC(1, kHypnoDebugParser, "%s", (yyvsp[-1].s));
+ free((yyvsp[-1].s));
+ }
+#line 1775 "engines/hypno/grammar_mis.cpp"
break;
case 49: /* talk: PL talk */
-#line 345 "engines/hypno/grammar_mis.y"
+#line 414 "engines/hypno/grammar_mis.y"
{
TalkCommand talk_cmd;
talk_cmd.command = "L";
talk_action->commands.push_back(talk_cmd);
- debugC(1, kHypnoDebugParser, "|L"); }
-#line 1712 "engines/hypno/grammar_mis.cpp"
+ debugC(1, kHypnoDebugParser, "|L");
+ }
+#line 1786 "engines/hypno/grammar_mis.cpp"
break;
case 50: /* talk: PE */
-#line 350 "engines/hypno/grammar_mis.y"
+#line 420 "engines/hypno/grammar_mis.y"
{ debugC(1, kHypnoDebugParser, "|E"); }
-#line 1718 "engines/hypno/grammar_mis.cpp"
+#line 1792 "engines/hypno/grammar_mis.cpp"
break;
case 52: /* mflag: NAME */
-#line 354 "engines/hypno/grammar_mis.y"
+#line 424 "engines/hypno/grammar_mis.y"
{ (yyval.s) = (yyvsp[0].s); }
-#line 1724 "engines/hypno/grammar_mis.cpp"
+#line 1798 "engines/hypno/grammar_mis.cpp"
break;
case 53: /* mflag: %empty */
-#line 355 "engines/hypno/grammar_mis.y"
+#line 425 "engines/hypno/grammar_mis.y"
{ (yyval.s) = scumm_strdup(""); }
-#line 1730 "engines/hypno/grammar_mis.cpp"
+#line 1804 "engines/hypno/grammar_mis.cpp"
break;
case 54: /* flag: FLAG */
-#line 358 "engines/hypno/grammar_mis.y"
+#line 428 "engines/hypno/grammar_mis.y"
{ (yyval.s) = (yyvsp[0].s); debugC(1, kHypnoDebugParser, "flag: %s", (yyvsp[0].s)); }
-#line 1736 "engines/hypno/grammar_mis.cpp"
+#line 1810 "engines/hypno/grammar_mis.cpp"
break;
case 55: /* flag: %empty */
-#line 359 "engines/hypno/grammar_mis.y"
+#line 429 "engines/hypno/grammar_mis.y"
{ (yyval.s) = scumm_strdup(""); }
-#line 1742 "engines/hypno/grammar_mis.cpp"
+#line 1816 "engines/hypno/grammar_mis.cpp"
break;
case 56: /* gsswitch: GSSWITCH */
-#line 362 "engines/hypno/grammar_mis.y"
+#line 432 "engines/hypno/grammar_mis.y"
{ (yyval.s) = (yyvsp[0].s); debugC(1, kHypnoDebugParser, "switch %s", (yyvsp[0].s)); }
-#line 1748 "engines/hypno/grammar_mis.cpp"
+#line 1822 "engines/hypno/grammar_mis.cpp"
break;
case 57: /* gsswitch: %empty */
-#line 363 "engines/hypno/grammar_mis.y"
+#line 433 "engines/hypno/grammar_mis.y"
{ (yyval.s) = scumm_strdup(""); }
-#line 1754 "engines/hypno/grammar_mis.cpp"
+#line 1828 "engines/hypno/grammar_mis.cpp"
break;
-#line 1758 "engines/hypno/grammar_mis.cpp"
+#line 1832 "engines/hypno/grammar_mis.cpp"
default: break;
}
diff --git a/engines/hypno/grammar_mis.y b/engines/hypno/grammar_mis.y
index 66a1b6bd274..0ad098761f7 100644
--- a/engines/hypno/grammar_mis.y
+++ b/engines/hypno/grammar_mis.y
@@ -36,9 +36,11 @@
extern int HYPNO_MIS_lex();
extern int yylineno;
+namespace Hypno {
Common::Array<uint32> *smenu_idx = nullptr;
-Hypno::HotspotsStack *stack = nullptr;
-Hypno::Talk *talk_action = nullptr;
+HotspotsStack *stack = nullptr;
+Talk *talk_action = nullptr;
+}
void HYPNO_MIS_xerror(const char *str) {
error("ERROR: %s", str);
@@ -57,13 +59,14 @@ using namespace Hypno;
int i; /* integer value */
}
-%token<s> NAME FILENAME FLAG COMMENT GSSWITCH COMMAND WALNTOK ENCTOK
+%token<s> NAME FILENAME FLAG GSSWITCH WALNTOK ENCTOK
%token<i> NUM
-%token HOTSTOK CUTSTOK BACKTOK INTRTOK RETTOK TIMETOK PALETOK BBOXTOK OVERTOK MICETOK SONDTOK PLAYTOK ENDTOK
+%token COMMENT HOTSTOK CUTSTOK BACKTOK INTRTOK RETTOK TIMETOK PALETOK BBOXTOK OVERTOK MICETOK SONDTOK PLAYTOK ENDTOK
%token MENUTOK SMENTOK ESCPTOK NRTOK AMBITOK SWPTTOK MPTRTOK
%token GLOBTOK TONTOK TOFFTOK
%token TALKTOK INACTOK FDTOK BOXXTOK ESCAPETOK SECONDTOK INTROTOK DEFAULTTOK
-%token<s> PG PA PD PH PF PE PP PI PL PS
+%token<s> PG PA PD PH PF PP PI PS
+%token PE PL
%type<s> gsswitch flag mflag
@@ -103,6 +106,9 @@ line: MENUTOK mflag mflag mflag {
idx++;
smenu_idx->pop_back();
smenu_idx->push_back(idx);
+ free($2);
+ free($3);
+ free($4);
}
| MENUTOK FILENAME {
Hotspot hot(MakeMenu);
@@ -117,6 +123,7 @@ line: MENUTOK mflag mflag mflag {
idx++;
smenu_idx->pop_back();
smenu_idx->push_back(idx);
+ free($2);
}
| HOTSTOK BBOXTOK NUM NUM NUM NUM {
Hotspot hot(MakeHotspot, Common::Rect($3, $4, $5, $6));
@@ -150,7 +157,9 @@ line: MENUTOK mflag mflag mflag {
Hotspots *cur = stack->back();
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
- debugC(1, kHypnoDebugParser, "TIME %d %s", $2, $3); }
+ debugC(1, kHypnoDebugParser, "TIME %d %s", $2, $3);
+ free($3);
+ }
| SWPTTOK NUM {
SwapPointer *a = new SwapPointer($2);
Hotspots *cur = stack->back();
@@ -163,6 +172,10 @@ line: MENUTOK mflag mflag mflag {
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
debugC(1, kHypnoDebugParser, "BACK");
+ free($2);
+ free($5);
+ free($6);
+ free($7);
}
| GLOBTOK GSSWITCH NAME {
Global *a = new Global($2, $3);
@@ -170,36 +183,52 @@ line: MENUTOK mflag mflag mflag {
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
debugC(1, kHypnoDebugParser, "GLOB");
+ free($2);
+ free($3);
}
| AMBITOK FILENAME NUM NUM flag {
Ambient *a = new Ambient($2, Common::Point($3, $4), $5);
Hotspots *cur = stack->back();
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
- debugC(1, kHypnoDebugParser, "AMBI %d %d", $3, $4); }
+ debugC(1, kHypnoDebugParser, "AMBI %d %d", $3, $4);
+ free($2);
+ free($5);
+ }
| PLAYTOK FILENAME NUM NUM gsswitch flag {
Play *a = new Play($2, Common::Point($3, $4), $5, $6);
Hotspots *cur = stack->back();
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
- debugC(1, kHypnoDebugParser, "PLAY %s.", $2); }
+ debugC(1, kHypnoDebugParser, "PLAY %s.", $2);
+ free($2);
+ free($5);
+ free($6);
+ }
| SONDTOK FILENAME ENCTOK {
//Play *a = new Play($2, Common::Point($3, $4), $5, $6);
//Hotspots *cur = stack->back();
//Hotspot *hot = &cur->back();
//hot->actions.push_back(a);
- debugC(1, kHypnoDebugParser, "SOND %s.", $2); }
+ debugC(1, kHypnoDebugParser, "SOND %s.", $2);
+ free($2);
+ free($3);
+ }
| SONDTOK FILENAME {
//Play *a = new Play($2, Common::Point($3, $4), $5, $6);
//Hotspots *cur = stack->back();
//Hotspot *hot = &cur->back();
//hot->actions.push_back(a);
- debugC(1, kHypnoDebugParser, "SOND %s.", $2); }
+ debugC(1, kHypnoDebugParser, "SOND %s.", $2);
+ free($2);
+ }
| OVERTOK FILENAME NUM NUM flag {
Overlay *a = new Overlay($2, Common::Point($3, $4), $5);
Hotspots *cur = stack->back();
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
+ free($2);
+ free($5);
}
| PALETOK FILENAME {
Palette *a = new Palette($2);
@@ -207,6 +236,7 @@ line: MENUTOK mflag mflag mflag {
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
debugC(1, kHypnoDebugParser, "PALE");
+ free($2);
}
| INTRTOK FILENAME NUM NUM {
Intro *a = new Intro(Common::String("cine/") + $2);
@@ -214,6 +244,7 @@ line: MENUTOK mflag mflag mflag {
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
debugC(1, kHypnoDebugParser, "INTRO %s %d %d", $2, $3, $4);
+ free($2);
}
| INTRTOK FILENAME {
Intro *a = new Intro(Common::String("cine/") + $2);
@@ -221,6 +252,7 @@ line: MENUTOK mflag mflag mflag {
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
debugC(1, kHypnoDebugParser, "INTRO %s", $2);
+ free($2);
}
| CUTSTOK FILENAME {
Cutscene *a = new Cutscene($2);
@@ -228,21 +260,29 @@ line: MENUTOK mflag mflag mflag {
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
debugC(1, kHypnoDebugParser, "CUTS %s", $2);
+ free($2);
}
| WALNTOK FILENAME NUM NUM gsswitch flag {
WalN *a = new WalN($1, $2, Common::Point($3, $4), $5, $6);
Hotspots *cur = stack->back();
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
- debugC(1, kHypnoDebugParser, "WALN %s %d %d", $2, $3, $4); }
+ debugC(1, kHypnoDebugParser, "WALN %s %d %d", $2, $3, $4);
+ free($1);
+ free($2);
+ free($5);
+ free($6);
+ }
| MICETOK FILENAME NUM {
Mice *a = new Mice($2, $3-1);
Hotspots *cur = stack->back();
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
+ free($2);
}
| MPTRTOK FILENAME NUM NUM NUM NUM NUM {
debugC(1, kHypnoDebugParser, "MPTR %s %d %d %d %d %d", $2, $3, $4, $5, $6, $7);
+ free($2);
}
| TALKTOK alloctalk talk {
Hotspots *cur = stack->back();
@@ -259,7 +299,7 @@ line: MENUTOK mflag mflag mflag {
| RETTOK { debugC(1, kHypnoDebugParser, "implicit END"); }
;
-anything: NAME anything
+anything: NAME anything { free($1); }
| // nothing
;
@@ -277,7 +317,11 @@ talk: INACTOK talk {
| BACKTOK FILENAME NUM NUM gsswitch flag {
talk_action->background = $2;
talk_action->backgroundPos = Common::Point($3, $4);
- debugC(1, kHypnoDebugParser, "BACK in TALK"); }
+ debugC(1, kHypnoDebugParser, "BACK in TALK");
+ free($2);
+ free($5);
+ free($6);
+ }
| BOXXTOK NUM NUM {
talk_action->boxPos = Common::Point($2, $3);
debugC(1, kHypnoDebugParser, "BOXX %d %d", $2, $3); }
@@ -287,66 +331,92 @@ talk: INACTOK talk {
| SECONDTOK FILENAME NUM NUM flag {
talk_action->second = $2;
talk_action->secondPos = Common::Point($3, $4);
- debugC(1, kHypnoDebugParser, "SECOND %s %d %d '%s'", $2, $3, $4, $5); }
+ debugC(1, kHypnoDebugParser, "SECOND %s %d %d '%s'", $2, $3, $4, $5);
+ free($2);
+ free($5);
+ }
| INTROTOK FILENAME NUM NUM {
talk_action->intro = $2;
talk_action->introPos = Common::Point($3, $4);
- debugC(1, kHypnoDebugParser, "INTRO %s %d %d", $2, $3, $4); }
+ debugC(1, kHypnoDebugParser, "INTRO %s %d %d", $2, $3, $4);
+ free($2);
+ }
| DEFAULTTOK FILENAME NUM NUM {
// Unsure how this is different from second
talk_action->second = $2;
talk_action->secondPos = Common::Point($3, $4);
- debugC(1, kHypnoDebugParser, "DEFAULT %s %d %d", $2, $3, $4); }
+ debugC(1, kHypnoDebugParser, "DEFAULT %s %d %d", $2, $3, $4);
+ free($2);
+ }
| PG talk {
TalkCommand talk_cmd;
talk_cmd.command = "G";
talk_cmd.path = $1+2;
talk_action->commands.push_back(talk_cmd);
- debugC(1, kHypnoDebugParser, "%s", $1); }
- | PH talk { debugC(1, kHypnoDebugParser, "%s", $1); }
+ debugC(1, kHypnoDebugParser, "%s", $1);
+ free($1);
+ }
+ | PH talk {
+ debugC(1, kHypnoDebugParser, "%s", $1);
+ free($1);
+ }
| PF talk {
TalkCommand talk_cmd;
talk_cmd.command = "F";
talk_cmd.num = atoi($1+2)-1;
talk_action->commands.push_back(talk_cmd);
- debugC(1, kHypnoDebugParser, "%s", $1); }
+ debugC(1, kHypnoDebugParser, "%s", $1);
+ free($1);
+ }
| PA talk {
TalkCommand talk_cmd;
talk_cmd.command = "A";
talk_cmd.num = atoi($1+2)-1;
talk_action->commands.push_back(talk_cmd);
- debugC(1, kHypnoDebugParser, "|A%d", talk_cmd.num); }
+ debugC(1, kHypnoDebugParser, "|A%d", talk_cmd.num);
+ free($1);
+ }
| PD talk {
TalkCommand talk_cmd;
talk_cmd.command = "D";
talk_cmd.num = atoi($1+2)-1;
talk_action->commands.push_back(talk_cmd);
- debugC(1, kHypnoDebugParser, "%s", $1); }
+ debugC(1, kHypnoDebugParser, "%s", $1);
+ free($1);
+ }
| PP NUM NUM flag talk {
TalkCommand talk_cmd;
talk_cmd.command = "P";
talk_cmd.path = $1+2;
talk_cmd.position = Common::Point($2, $3);
talk_action->commands.push_back(talk_cmd);
- debugC(1, kHypnoDebugParser, "%s %d %d '%s'", $1, $2, $3, $4); }
+ debugC(1, kHypnoDebugParser, "%s %d %d '%s'", $1, $2, $3, $4);
+ free($1);
+ free($4);
+ }
| PI NUM NUM talk {
TalkCommand talk_cmd;
talk_cmd.command = "I";
talk_cmd.path = $1+2;
talk_cmd.position = Common::Point($2, $3);
talk_action->commands.push_back(talk_cmd);
- debugC(1, kHypnoDebugParser, "%s %d %d", $1, $2, $3); }
+ debugC(1, kHypnoDebugParser, "%s %d %d", $1, $2, $3);
+ free($1);
+ }
| PS talk {
TalkCommand talk_cmd;
talk_cmd.command = "S";
talk_cmd.variable = $1+2;
talk_action->commands.push_back(talk_cmd);
- debugC(1, kHypnoDebugParser, "%s", $1); }
+ debugC(1, kHypnoDebugParser, "%s", $1);
+ free($1);
+ }
| PL talk {
TalkCommand talk_cmd;
talk_cmd.command = "L";
talk_action->commands.push_back(talk_cmd);
- debugC(1, kHypnoDebugParser, "|L"); }
+ debugC(1, kHypnoDebugParser, "|L");
+ }
| PE { debugC(1, kHypnoDebugParser, "|E"); }
| /*nothing*/
;
diff --git a/engines/hypno/lexer_arc.cpp b/engines/hypno/lexer_arc.cpp
index 2cde66b46e0..7e4d2161585 100644
--- a/engines/hypno/lexer_arc.cpp
+++ b/engines/hypno/lexer_arc.cpp
@@ -1,4 +1,4 @@
-#line 2 "engines/hypno/lexer_arc.cpp"
+#line 1 "engines/hypno/lexer_arc.cpp"
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
@@ -36,7 +36,7 @@
#include "hypno/grammar.h"
#include "hypno/tokens_arc.h"
-#line 40 "engines/hypno/lexer_arc.cpp"
+#line 39 "engines/hypno/lexer_arc.cpp"
#define YY_INT_ALIGNED short int
@@ -312,6 +312,7 @@
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
+
#include <stdio.h>
#include <string.h>
#include <errno.h>
@@ -328,8 +329,8 @@
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types.
+/* C++ systems might need __STDC_LIMIT_MACROS defined before including
+ * <stdint.h>, if you want the limit (max/min) macros for int types.
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
@@ -2442,6 +2443,8 @@ void yyfree (void * ptr )
namespace Hypno {
+extern Shoot *shoot;
+
int parse_arc(const char *code) {
YY_BUFFER_STATE bp;
yy_delete_buffer(YY_CURRENT_BUFFER);
@@ -2449,6 +2452,8 @@ int parse_arc(const char *code) {
yy_switch_to_buffer(bp);
HYPNO_ARC_parse();
yy_delete_buffer(bp);
+ delete shoot;
+ shoot = nullptr;
return 0;
}
diff --git a/engines/hypno/lexer_arc.l b/engines/hypno/lexer_arc.l
index f763d559009..95aa9e10587 100644
--- a/engines/hypno/lexer_arc.l
+++ b/engines/hypno/lexer_arc.l
@@ -111,6 +111,8 @@ Y[A-Z0-9] HYPNO_ARC_lval.s = scumm_strdup(HYPNO_ARC_text); return YXTOK;
namespace Hypno {
+extern Shoot *shoot;
+
int parse_arc(const char *code) {
YY_BUFFER_STATE bp;
yy_delete_buffer(YY_CURRENT_BUFFER);
@@ -118,6 +120,8 @@ int parse_arc(const char *code) {
yy_switch_to_buffer(bp);
HYPNO_ARC_parse();
yy_delete_buffer(bp);
+ delete shoot;
+ shoot = nullptr;
return 0;
}
diff --git a/engines/hypno/lexer_mis.cpp b/engines/hypno/lexer_mis.cpp
index 8ddebd277cb..3a0eb579fff 100644
--- a/engines/hypno/lexer_mis.cpp
+++ b/engines/hypno/lexer_mis.cpp
@@ -1,4 +1,4 @@
-#line 2 "engines/hypno/lexer_mis.cpp"
+#line 1 "engines/hypno/lexer_mis.cpp"
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
@@ -35,7 +35,7 @@
#include "hypno/grammar.h"
#include "hypno/tokens_mis.h"
-#line 39 "engines/hypno/lexer_mis.cpp"
+#line 38 "engines/hypno/lexer_mis.cpp"
#define YY_INT_ALIGNED short int
@@ -311,6 +311,7 @@
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
+
#include <stdio.h>
#include <string.h>
#include <errno.h>
@@ -327,8 +328,8 @@
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types.
+/* C++ systems might need __STDC_LIMIT_MACROS defined before including
+ * <stdint.h>, if you want the limit (max/min) macros for int types.
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
@@ -2427,6 +2428,9 @@ void yyfree (void * ptr )
namespace Hypno {
+extern Common::Array<uint32> *smenu_idx;
+extern HotspotsStack *stack;
+
int parse_mis(const char *code) {
YY_BUFFER_STATE bp;
yy_delete_buffer(YY_CURRENT_BUFFER);
@@ -2434,6 +2438,10 @@ int parse_mis(const char *code) {
yy_switch_to_buffer(bp);
HYPNO_MIS_parse();
yy_delete_buffer(bp);
+ delete smenu_idx;
+ smenu_idx = nullptr;
+ delete stack;
+ stack = nullptr;
return 0;
}
diff --git a/engines/hypno/lexer_mis.l b/engines/hypno/lexer_mis.l
index bb62dfaa513..7458ffdecaf 100644
--- a/engines/hypno/lexer_mis.l
+++ b/engines/hypno/lexer_mis.l
@@ -101,6 +101,9 @@ GS_[A-Z_0-9]+ HYPNO_MIS_lval.s = scumm_strdup(HYPNO_MIS_text); return GSSWITC
namespace Hypno {
+extern Common::Array<uint32> *smenu_idx;
+extern HotspotsStack *stack;
+
int parse_mis(const char *code) {
YY_BUFFER_STATE bp;
yy_delete_buffer(YY_CURRENT_BUFFER);
@@ -108,6 +111,10 @@ int parse_mis(const char *code) {
yy_switch_to_buffer(bp);
HYPNO_MIS_parse();
yy_delete_buffer(bp);
+ delete smenu_idx;
+ smenu_idx = nullptr;
+ delete stack;
+ stack = nullptr;
return 0;
}
diff --git a/engines/hypno/tokens_arc.h b/engines/hypno/tokens_arc.h
index 4e4c8a7d625..0fbea0ba5d5 100644
--- a/engines/hypno/tokens_arc.h
+++ b/engines/hypno/tokens_arc.h
@@ -66,24 +66,24 @@ extern int HYPNO_ARC_debug;
FILENAME = 259, /* FILENAME */
BNTOK = 260, /* BNTOK */
SNTOK = 261, /* SNTOK */
- KNTOK = 262, /* KNTOK */
- YXTOK = 263, /* YXTOK */
- FNTOK = 264, /* FNTOK */
- ENCTOK = 265, /* ENCTOK */
- ONTOK = 266, /* ONTOK */
- H12TOK = 267, /* H12TOK */
- NUM = 268, /* NUM */
- BYTE = 269, /* BYTE */
- COMMENT = 270, /* COMMENT */
- ALTOK = 271, /* ALTOK */
- AVTOK = 272, /* AVTOK */
- ABTOK = 273, /* ABTOK */
- CTOK = 274, /* CTOK */
- DTOK = 275, /* DTOK */
- HTOK = 276, /* HTOK */
- HETOK = 277, /* HETOK */
- HLTOK = 278, /* HLTOK */
- HUTOK = 279, /* HUTOK */
+ YXTOK = 262, /* YXTOK */
+ FNTOK = 263, /* FNTOK */
+ ENCTOK = 264, /* ENCTOK */
+ ONTOK = 265, /* ONTOK */
+ H12TOK = 266, /* H12TOK */
+ NUM = 267, /* NUM */
+ BYTE = 268, /* BYTE */
+ COMMENT = 269, /* COMMENT */
+ ALTOK = 270, /* ALTOK */
+ AVTOK = 271, /* AVTOK */
+ ABTOK = 272, /* ABTOK */
+ CTOK = 273, /* CTOK */
+ DTOK = 274, /* DTOK */
+ HTOK = 275, /* HTOK */
+ HETOK = 276, /* HETOK */
+ HLTOK = 277, /* HLTOK */
+ HUTOK = 278, /* HUTOK */
+ KNTOK = 279, /* KNTOK */
RETTOK = 280, /* RETTOK */
QTOK = 281, /* QTOK */
RESTOK = 282, /* RESTOK */
@@ -127,7 +127,7 @@ extern int HYPNO_ARC_debug;
#if ! defined HYPNO_ARC_STYPE && ! defined HYPNO_ARC_STYPE_IS_DECLARED
union HYPNO_ARC_STYPE
{
-#line 95 "engines/hypno/grammar_arc.y"
+#line 97 "engines/hypno/grammar_arc.y"
char *s; /* string value */
int i; /* integer value */
diff --git a/engines/hypno/tokens_mis.h b/engines/hypno/tokens_mis.h
index 40885bba795..663af1157f1 100644
--- a/engines/hypno/tokens_mis.h
+++ b/engines/hypno/tokens_mis.h
@@ -65,53 +65,52 @@ extern int HYPNO_MIS_debug;
NAME = 258, /* NAME */
FILENAME = 259, /* FILENAME */
FLAG = 260, /* FLAG */
- COMMENT = 261, /* COMMENT */
- GSSWITCH = 262, /* GSSWITCH */
- COMMAND = 263, /* COMMAND */
- WALNTOK = 264, /* WALNTOK */
- ENCTOK = 265, /* ENCTOK */
- NUM = 266, /* NUM */
- HOTSTOK = 267, /* HOTSTOK */
- CUTSTOK = 268, /* CUTSTOK */
- BACKTOK = 269, /* BACKTOK */
- INTRTOK = 270, /* INTRTOK */
- RETTOK = 271, /* RETTOK */
- TIMETOK = 272, /* TIMETOK */
- PALETOK = 273, /* PALETOK */
- BBOXTOK = 274, /* BBOXTOK */
- OVERTOK = 275, /* OVERTOK */
- MICETOK = 276, /* MICETOK */
- SONDTOK = 277, /* SONDTOK */
- PLAYTOK = 278, /* PLAYTOK */
- ENDTOK = 279, /* ENDTOK */
- MENUTOK = 280, /* MENUTOK */
- SMENTOK = 281, /* SMENTOK */
- ESCPTOK = 282, /* ESCPTOK */
- NRTOK = 283, /* NRTOK */
- AMBITOK = 284, /* AMBITOK */
- SWPTTOK = 285, /* SWPTTOK */
- MPTRTOK = 286, /* MPTRTOK */
- GLOBTOK = 287, /* GLOBTOK */
- TONTOK = 288, /* TONTOK */
- TOFFTOK = 289, /* TOFFTOK */
- TALKTOK = 290, /* TALKTOK */
- INACTOK = 291, /* INACTOK */
- FDTOK = 292, /* FDTOK */
- BOXXTOK = 293, /* BOXXTOK */
- ESCAPETOK = 294, /* ESCAPETOK */
- SECONDTOK = 295, /* SECONDTOK */
- INTROTOK = 296, /* INTROTOK */
- DEFAULTTOK = 297, /* DEFAULTTOK */
- PG = 298, /* PG */
- PA = 299, /* PA */
- PD = 300, /* PD */
- PH = 301, /* PH */
- PF = 302, /* PF */
- PE = 303, /* PE */
- PP = 304, /* PP */
- PI = 305, /* PI */
- PL = 306, /* PL */
- PS = 307 /* PS */
+ GSSWITCH = 261, /* GSSWITCH */
+ WALNTOK = 262, /* WALNTOK */
+ ENCTOK = 263, /* ENCTOK */
+ NUM = 264, /* NUM */
+ COMMENT = 265, /* COMMENT */
+ HOTSTOK = 266, /* HOTSTOK */
+ CUTSTOK = 267, /* CUTSTOK */
+ BACKTOK = 268, /* BACKTOK */
+ INTRTOK = 269, /* INTRTOK */
+ RETTOK = 270, /* RETTOK */
+ TIMETOK = 271, /* TIMETOK */
+ PALETOK = 272, /* PALETOK */
+ BBOXTOK = 273, /* BBOXTOK */
+ OVERTOK = 274, /* OVERTOK */
+ MICETOK = 275, /* MICETOK */
+ SONDTOK = 276, /* SONDTOK */
+ PLAYTOK = 277, /* PLAYTOK */
+ ENDTOK = 278, /* ENDTOK */
+ MENUTOK = 279, /* MENUTOK */
+ SMENTOK = 280, /* SMENTOK */
+ ESCPTOK = 281, /* ESCPTOK */
+ NRTOK = 282, /* NRTOK */
+ AMBITOK = 283, /* AMBITOK */
+ SWPTTOK = 284, /* SWPTTOK */
+ MPTRTOK = 285, /* MPTRTOK */
+ GLOBTOK = 286, /* GLOBTOK */
+ TONTOK = 287, /* TONTOK */
+ TOFFTOK = 288, /* TOFFTOK */
+ TALKTOK = 289, /* TALKTOK */
+ INACTOK = 290, /* INACTOK */
+ FDTOK = 291, /* FDTOK */
+ BOXXTOK = 292, /* BOXXTOK */
+ ESCAPETOK = 293, /* ESCAPETOK */
+ SECONDTOK = 294, /* SECONDTOK */
+ INTROTOK = 295, /* INTROTOK */
+ DEFAULTTOK = 296, /* DEFAULTTOK */
+ PG = 297, /* PG */
+ PA = 298, /* PA */
+ PD = 299, /* PD */
+ PH = 300, /* PH */
+ PF = 301, /* PF */
+ PP = 302, /* PP */
+ PI = 303, /* PI */
+ PS = 304, /* PS */
+ PE = 305, /* PE */
+ PL = 306 /* PL */
};
typedef enum HYPNO_MIS_tokentype HYPNO_MIS_token_kind_t;
#endif
@@ -120,12 +119,12 @@ extern int HYPNO_MIS_debug;
#if ! defined HYPNO_MIS_STYPE && ! defined HYPNO_MIS_STYPE_IS_DECLARED
union HYPNO_MIS_STYPE
{
-#line 55 "engines/hypno/grammar_mis.y"
+#line 57 "engines/hypno/grammar_mis.y"
char *s; /* string value */
int i; /* integer value */
-#line 129 "engines/hypno/tokens_mis.h"
+#line 128 "engines/hypno/tokens_mis.h"
};
typedef union HYPNO_MIS_STYPE HYPNO_MIS_STYPE;
Commit: ca7b45c2ed07cebbb2c55a3801d33a6238d886dd
https://github.com/scummvm/scummvm/commit/ca7b45c2ed07cebbb2c55a3801d33a6238d886dd
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-11-17T11:10:07+01:00
Commit Message:
HYPNO: Fix memory leaks
Changed paths:
engines/hypno/hypno.cpp
diff --git a/engines/hypno/hypno.cpp b/engines/hypno/hypno.cpp
index fb3984e9556..c89fc668d6c 100644
--- a/engines/hypno/hypno.cpp
+++ b/engines/hypno/hypno.cpp
@@ -99,9 +99,7 @@ HypnoEngine::HypnoEngine(OSystem *syst, const ADGameDescription *gd)
Action *a = new Quit();
q.actions.push_back(a);
Scene *quit = new Scene();
- Hotspots hs;
- hs.push_back(q);
- quit->hots = hs;
+ quit->hots.push_back(q);
quit->resolution = "320x200";
_levels["<quit>"] = quit;
resetStatistics();
@@ -309,6 +307,12 @@ void HypnoEngine::runIntros(Videos &videos) {
g_system->updateScreen();
g_system->delayMillis(10);
}
+
+ for (Videos::iterator it = videos.begin(); it != videos.end(); ++it) {
+ delete it->decoder;
+ it->decoder = nullptr;
+ }
+
keymapper->getKeymap("intro")->setEnabled(false);
enableGameKeymaps();
}
More information about the Scummvm-git-logs
mailing list