[Scummvm-git-logs] scummvm master -> 3c9d76b6b67afdc85fab7265c00e8507d092d5bf
neuromancer
noreply at scummvm.org
Fri Jan 7 18:28:26 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
3c9d76b6b6 HPYNO: demo fixes and initial implementation of timeout action
Commit: 3c9d76b6b67afdc85fab7265c00e8507d092d5bf
https://github.com/scummvm/scummvm/commit/3c9d76b6b67afdc85fab7265c00e8507d092d5bf
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-01-07T19:28:17+01:00
Commit Message:
HPYNO: demo fixes and initial implementation of timeout action
Changed paths:
engines/hypno/actions.cpp
engines/hypno/grammar.h
engines/hypno/grammar_mis.cpp
engines/hypno/grammar_mis.y
engines/hypno/hypno.cpp
engines/hypno/hypno.h
engines/hypno/lexer_mis.cpp
engines/hypno/scene.cpp
engines/hypno/spider/spider.cpp
engines/hypno/tokens_mis.h
diff --git a/engines/hypno/actions.cpp b/engines/hypno/actions.cpp
index 54d0b22a086..1d670c19676 100644
--- a/engines/hypno/actions.cpp
+++ b/engines/hypno/actions.cpp
@@ -38,6 +38,9 @@ void HypnoEngine::runMenu(Hotspots hs) {
case QuitAction:
runQuit((Quit *)action);
break;
+ case TimerAction:
+ runTimer((Timer *)action);
+ break;
case BackgroundAction:
runBackground((Background *)action);
break;
@@ -84,6 +87,17 @@ void HypnoEngine::runBackground(Background *a) {
loadImage(a->path, a->origin.x, a->origin.y, false);
}
+void HypnoEngine::runTimer(Timer *a) {
+ if (_timerStarted)
+ return; // Do not start another timer
+
+ uint32 delay = a->delay/1000;
+ debugC(1, kHypnoDebugScene, "Starting timer with %d secons", delay);
+
+ if (delay == 0 || !startCountdown(delay))
+ error("Failed to start countdown");
+}
+
void HypnoEngine::runOverlay(Overlay *a) {
loadImage(a->path, a->origin.x, a->origin.y, false);
}
diff --git a/engines/hypno/grammar.h b/engines/hypno/grammar.h
index e2aaff09ce0..19568d872f9 100644
--- a/engines/hypno/grammar.h
+++ b/engines/hypno/grammar.h
@@ -49,6 +49,7 @@ enum HotspotType {
enum ActionType {
MiceAction,
+ TimerAction,
PaletteAction,
BackgroundAction,
OverlayAction,
@@ -121,6 +122,15 @@ public:
uint32 index;
};
+class Timer : public Action {
+public:
+ Timer(uint32 delay_) {
+ type = TimerAction;
+ delay = delay_;
+ }
+ uint32 delay;
+};
+
class Palette : public Action {
public:
Palette(Filename path_) {
diff --git a/engines/hypno/grammar_mis.cpp b/engines/hypno/grammar_mis.cpp
index 879ef374a01..cdb7b395fad 100644
--- a/engines/hypno/grammar_mis.cpp
+++ b/engines/hypno/grammar_mis.cpp
@@ -1,8 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.0.4. */
+/* A Bison parser, made by GNU Bison 3.8.2. */
/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
+ Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -15,7 +16,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -33,6 +34,10 @@
/* C LALR(1) parser skeleton written by Richard Stallman, by
simplifying the original so-called "semantic" parser. */
+/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
+ especially those whose name start with YY_ or yy_. They are
+ private implementation details that can be changed or removed. */
+
/* All symbols defined below should begin with yy or YY, to avoid
infringing on user name space. This should be done even for local
variables, as they might otherwise be expanded by user macros.
@@ -40,11 +45,11 @@
define necessary library symbols; they are noted "INFRINGES ON
USER NAME SPACE" below. */
-/* Identify Bison output. */
-#define YYBISON 1
+/* Identify Bison output, and Bison version. */
+#define YYBISON 30802
-/* Bison version. */
-#define YYBISON_VERSION "3.0.4"
+/* Bison version string. */
+#define YYBISON_VERSION "3.8.2"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -66,12 +71,11 @@
#define yyerror HYPNO_MIS_error
#define yydebug HYPNO_MIS_debug
#define yynerrs HYPNO_MIS_nerrs
-
#define yylval HYPNO_MIS_lval
#define yychar HYPNO_MIS_char
-/* Copy the first part of user declarations. */
-#line 27 "engines/hypno/grammar_mis.y" /* yacc.c:339 */
+/* First part of user prologue. */
+#line 27 "engines/hypno/grammar_mis.y"
#include "common/array.h"
@@ -100,155 +104,187 @@ int HYPNO_MIS_wrap() {
using namespace Hypno;
-#line 104 "engines/hypno/grammar_mis.cpp" /* yacc.c:339 */
+#line 108 "engines/hypno/grammar_mis.cpp"
-# ifndef YY_NULLPTR
-# if defined __cplusplus && 201103L <= __cplusplus
-# define YY_NULLPTR nullptr
+# ifndef YY_CAST
+# ifdef __cplusplus
+# define YY_CAST(Type, Val) static_cast<Type> (Val)
+# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
# else
-# define YY_NULLPTR 0
+# define YY_CAST(Type, Val) ((Type) (Val))
+# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
# endif
# endif
-
-/* Enabling verbose error messages. */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-/* In a future release of Bison, this section will be replaced
- by #include "tokens_mis.h". */
-#ifndef YY_HYPNO_MIS_ENGINES_HYPNO_TOKENS_MIS_H_INCLUDED
-# define YY_HYPNO_MIS_ENGINES_HYPNO_TOKENS_MIS_H_INCLUDED
-/* Debug traces. */
-#ifndef HYPNO_MIS_DEBUG
-# if defined YYDEBUG
-#if YYDEBUG
-# define HYPNO_MIS_DEBUG 1
+# ifndef YY_NULLPTR
+# if defined __cplusplus
+# if 201103L <= __cplusplus
+# define YY_NULLPTR nullptr
+# else
+# define YY_NULLPTR 0
+# endif
# else
-# define HYPNO_MIS_DEBUG 0
+# define YY_NULLPTR ((void*)0)
# endif
-# else /* ! defined YYDEBUG */
-# define HYPNO_MIS_DEBUG 0
-# endif /* ! defined YYDEBUG */
-#endif /* ! defined HYPNO_MIS_DEBUG */
-#if HYPNO_MIS_DEBUG
-extern int HYPNO_MIS_debug;
-#endif
-
-/* Token type. */
-#ifndef HYPNO_MIS_TOKENTYPE
-# define HYPNO_MIS_TOKENTYPE
- enum HYPNO_MIS_tokentype
- {
- NAME = 258,
- FILENAME = 259,
- FLAG = 260,
- COMMENT = 261,
- GSSWITCH = 262,
- COMMAND = 263,
- WALNTOK = 264,
- NUM = 265,
- HOTSTOK = 266,
- CUTSTOK = 267,
- BACKTOK = 268,
- INTRTOK = 269,
- RETTOK = 270,
- TIMETOK = 271,
- PALETOK = 272,
- BBOXTOK = 273,
- OVERTOK = 274,
- MICETOK = 275,
- PLAYTOK = 276,
- ENDTOK = 277,
- MENUTOK = 278,
- SMENTOK = 279,
- ESCPTOK = 280,
- NRTOK = 281,
- AMBITOK = 282,
- SWPTTOK = 283,
- MPTRTOK = 284,
- GLOBTOK = 285,
- TONTOK = 286,
- TOFFTOK = 287,
- TALKTOK = 288,
- INACTOK = 289,
- FDTOK = 290,
- BOXXTOK = 291,
- ESCAPETOK = 292,
- SECONDTOK = 293,
- INTROTOK = 294,
- DEFAULTTOK = 295,
- PG = 296,
- PA = 297,
- PD = 298,
- PH = 299,
- PF = 300,
- PE = 301,
- PP = 302,
- PI = 303,
- PL = 304,
- PS = 305
- };
-#endif
-
-/* Value type. */
-#if ! defined HYPNO_MIS_STYPE && ! defined HYPNO_MIS_STYPE_IS_DECLARED
+# endif
-union HYPNO_MIS_STYPE
+#include "tokens_mis.h"
+/* Symbol kind. */
+enum yysymbol_kind_t
{
-#line 56 "engines/hypno/grammar_mis.y" /* yacc.c:355 */
-
- char *s; /* string value */
- int i; /* integer value */
-
-#line 208 "engines/hypno/grammar_mis.cpp" /* yacc.c:355 */
+ YYSYMBOL_YYEMPTY = -2,
+ YYSYMBOL_YYEOF = 0, /* "end of file" */
+ YYSYMBOL_YYerror = 1, /* error */
+ YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
+ 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_NUM = 10, /* NUM */
+ 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_PLAYTOK = 21, /* PLAYTOK */
+ YYSYMBOL_ENDTOK = 22, /* ENDTOK */
+ YYSYMBOL_MENUTOK = 23, /* MENUTOK */
+ YYSYMBOL_SMENTOK = 24, /* SMENTOK */
+ YYSYMBOL_ESCPTOK = 25, /* ESCPTOK */
+ YYSYMBOL_NRTOK = 26, /* NRTOK */
+ YYSYMBOL_AMBITOK = 27, /* AMBITOK */
+ YYSYMBOL_SWPTTOK = 28, /* SWPTTOK */
+ YYSYMBOL_MPTRTOK = 29, /* MPTRTOK */
+ YYSYMBOL_GLOBTOK = 30, /* GLOBTOK */
+ YYSYMBOL_TONTOK = 31, /* TONTOK */
+ YYSYMBOL_TOFFTOK = 32, /* TOFFTOK */
+ YYSYMBOL_TALKTOK = 33, /* TALKTOK */
+ YYSYMBOL_INACTOK = 34, /* INACTOK */
+ YYSYMBOL_FDTOK = 35, /* FDTOK */
+ YYSYMBOL_BOXXTOK = 36, /* BOXXTOK */
+ YYSYMBOL_ESCAPETOK = 37, /* ESCAPETOK */
+ YYSYMBOL_SECONDTOK = 38, /* SECONDTOK */
+ YYSYMBOL_INTROTOK = 39, /* INTROTOK */
+ YYSYMBOL_DEFAULTTOK = 40, /* DEFAULTTOK */
+ YYSYMBOL_PG = 41, /* PG */
+ YYSYMBOL_PA = 42, /* PA */
+ YYSYMBOL_PD = 43, /* PD */
+ YYSYMBOL_PH = 44, /* PH */
+ YYSYMBOL_PF = 45, /* PF */
+ YYSYMBOL_PE = 46, /* PE */
+ YYSYMBOL_PP = 47, /* PP */
+ YYSYMBOL_PI = 48, /* PI */
+ YYSYMBOL_PL = 49, /* PL */
+ YYSYMBOL_PS = 50, /* PS */
+ YYSYMBOL_YYACCEPT = 51, /* $accept */
+ YYSYMBOL_start = 52, /* start */
+ YYSYMBOL_init = 53, /* init */
+ YYSYMBOL_lines = 54, /* lines */
+ YYSYMBOL_line = 55, /* line */
+ YYSYMBOL_anything = 56, /* anything */
+ YYSYMBOL_alloctalk = 57, /* alloctalk */
+ YYSYMBOL_talk = 58, /* talk */
+ YYSYMBOL_mflag = 59, /* mflag */
+ YYSYMBOL_flag = 60, /* flag */
+ YYSYMBOL_gsswitch = 61 /* gsswitch */
};
+typedef enum yysymbol_kind_t yysymbol_kind_t;
-typedef union HYPNO_MIS_STYPE HYPNO_MIS_STYPE;
-# define HYPNO_MIS_STYPE_IS_TRIVIAL 1
-# define HYPNO_MIS_STYPE_IS_DECLARED 1
-#endif
-extern HYPNO_MIS_STYPE HYPNO_MIS_lval;
-int HYPNO_MIS_parse (void);
+#ifdef short
+# undef short
+#endif
-#endif /* !YY_HYPNO_MIS_ENGINES_HYPNO_TOKENS_MIS_H_INCLUDED */
+/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
+ <limits.h> and (if available) <stdint.h> are included
+ so that the code can choose integer types of a good width. */
-/* Copy the second part of user declarations. */
+#ifndef __PTRDIFF_MAX__
+# include <limits.h> /* INFRINGES ON USER NAME SPACE */
+# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
+# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
+# define YY_STDINT_H
+# endif
+#endif
-#line 225 "engines/hypno/grammar_mis.cpp" /* yacc.c:358 */
+/* Narrow types that promote to a signed type and that can represent a
+ signed or unsigned integer of at least N bits. In tables they can
+ save space and decrease cache pressure. Promoting to a signed type
+ helps avoid bugs in integer arithmetic. */
-#ifdef short
-# undef short
+#ifdef __INT_LEAST8_MAX__
+typedef __INT_LEAST8_TYPE__ yytype_int8;
+#elif defined YY_STDINT_H
+typedef int_least8_t yytype_int8;
+#else
+typedef signed char yytype_int8;
#endif
-#ifdef YYTYPE_UINT8
-typedef YYTYPE_UINT8 yytype_uint8;
+#ifdef __INT_LEAST16_MAX__
+typedef __INT_LEAST16_TYPE__ yytype_int16;
+#elif defined YY_STDINT_H
+typedef int_least16_t yytype_int16;
#else
-typedef unsigned char yytype_uint8;
+typedef short yytype_int16;
#endif
-#ifdef YYTYPE_INT8
-typedef YYTYPE_INT8 yytype_int8;
-#else
-typedef signed char yytype_int8;
+/* Work around bug in HP-UX 11.23, which defines these macros
+ incorrectly for preprocessor constants. This workaround can likely
+ be removed in 2023, as HPE has promised support for HP-UX 11.23
+ (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
+ <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
+#ifdef __hpux
+# undef UINT_LEAST8_MAX
+# undef UINT_LEAST16_MAX
+# define UINT_LEAST8_MAX 255
+# define UINT_LEAST16_MAX 65535
#endif
-#ifdef YYTYPE_UINT16
-typedef YYTYPE_UINT16 yytype_uint16;
+#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
+typedef __UINT_LEAST8_TYPE__ yytype_uint8;
+#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
+ && UINT_LEAST8_MAX <= INT_MAX)
+typedef uint_least8_t yytype_uint8;
+#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
+typedef unsigned char yytype_uint8;
#else
-typedef unsigned short int yytype_uint16;
+typedef short yytype_uint8;
#endif
-#ifdef YYTYPE_INT16
-typedef YYTYPE_INT16 yytype_int16;
+#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
+typedef __UINT_LEAST16_TYPE__ yytype_uint16;
+#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
+ && UINT_LEAST16_MAX <= INT_MAX)
+typedef uint_least16_t yytype_uint16;
+#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
+typedef unsigned short yytype_uint16;
#else
-typedef short int yytype_int16;
+typedef int yytype_uint16;
+#endif
+
+#ifndef YYPTRDIFF_T
+# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
+# define YYPTRDIFF_T __PTRDIFF_TYPE__
+# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
+# elif defined PTRDIFF_MAX
+# ifndef ptrdiff_t
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+# endif
+# define YYPTRDIFF_T ptrdiff_t
+# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
+# else
+# define YYPTRDIFF_T long
+# define YYPTRDIFF_MAXIMUM LONG_MAX
+# endif
#endif
#ifndef YYSIZE_T
@@ -256,15 +292,28 @@ typedef short int yytype_int16;
# define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
# define YYSIZE_T size_t
-# elif ! defined YYSIZE_T
+# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# else
-# define YYSIZE_T unsigned int
+# define YYSIZE_T unsigned
# endif
#endif
-#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+#define YYSIZE_MAXIMUM \
+ YY_CAST (YYPTRDIFF_T, \
+ (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
+ ? YYPTRDIFF_MAXIMUM \
+ : YY_CAST (YYSIZE_T, -1)))
+
+#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
+
+
+/* Stored state numbers (used for stacks). */
+typedef yytype_uint8 yy_state_t;
+
+/* State numbers in computations. */
+typedef int yy_state_fast_t;
#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
@@ -278,47 +327,43 @@ typedef short int yytype_int16;
# endif
#endif
-#ifndef YY_ATTRIBUTE
-# if (defined __GNUC__ \
- && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
- || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
-# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
-# else
-# define YY_ATTRIBUTE(Spec) /* empty */
-# endif
-#endif
#ifndef YY_ATTRIBUTE_PURE
-# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
+# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
+# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+# define YY_ATTRIBUTE_PURE
+# endif
#endif
#ifndef YY_ATTRIBUTE_UNUSED
-# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
-#endif
-
-#if !defined _Noreturn \
- && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
-# if defined _MSC_VER && 1200 <= _MSC_VER
-# define _Noreturn __declspec (noreturn)
+# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
+# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
# else
-# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
+# define YY_ATTRIBUTE_UNUSED
# endif
#endif
/* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__
-# define YYUSE(E) ((void) (E))
+# define YY_USE(E) ((void) (E))
#else
-# define YYUSE(E) /* empty */
+# define YY_USE(E) /* empty */
#endif
-#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
- _Pragma ("GCC diagnostic push") \
- _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
+#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
+# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
+# else
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
+# endif
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
_Pragma ("GCC diagnostic pop")
#else
# define YY_INITIAL_VALUE(Value) Value
@@ -331,8 +376,22 @@ typedef short int yytype_int16;
# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif
+#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
+# define YY_IGNORE_USELESS_CAST_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
+# define YY_IGNORE_USELESS_CAST_END \
+ _Pragma ("GCC diagnostic pop")
+#endif
+#ifndef YY_IGNORE_USELESS_CAST_BEGIN
+# define YY_IGNORE_USELESS_CAST_BEGIN
+# define YY_IGNORE_USELESS_CAST_END
+#endif
+
-#if ! defined yyoverflow || YYERROR_VERBOSE
+#define YY_ASSERT(E) ((void) (0 && (E)))
+
+#if !defined yyoverflow
/* The parser invokes alloca or malloc; define the necessary symbols. */
@@ -397,8 +456,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# endif
-#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
-
+#endif /* !defined yyoverflow */
#if (! defined yyoverflow \
&& (! defined __cplusplus \
@@ -407,17 +465,17 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
/* A type that is properly aligned for any stack member. */
union yyalloc
{
- yytype_int16 yyss_alloc;
+ yy_state_t yyss_alloc;
YYSTYPE yyvs_alloc;
};
/* The size of the maximum gap between one aligned stack and the next. */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
/* The size of an array large to enough to hold all stacks, each with
N elements. */
# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
# define YYCOPY_NEEDED 1
@@ -430,11 +488,11 @@ union yyalloc
# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
do \
{ \
- YYSIZE_T yynewbytes; \
+ YYPTRDIFF_T yynewbytes; \
YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
Stack = &yyptr->Stack_alloc; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
- yyptr += yynewbytes / sizeof (*yyptr); \
+ yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
+ yyptr += yynewbytes / YYSIZEOF (*yyptr); \
} \
while (0)
@@ -446,12 +504,12 @@ union yyalloc
# ifndef YYCOPY
# if defined __GNUC__ && 1 < __GNUC__
# define YYCOPY(Dst, Src, Count) \
- __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
+ __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
# else
# define YYCOPY(Dst, Src, Count) \
do \
{ \
- YYSIZE_T yyi; \
+ YYPTRDIFF_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(Dst)[yyi] = (Src)[yyi]; \
} \
@@ -474,17 +532,20 @@ union yyalloc
/* YYNSTATES -- Number of states. */
#define YYNSTATES 137
-/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
- by yylex, with out-of-bounds checking. */
-#define YYUNDEFTOK 2
+/* YYMAXUTOK -- Last valid token kind. */
#define YYMAXUTOK 305
-#define YYTRANSLATE(YYX) \
- ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
+ as returned by yylex, with out-of-bounds checking. */
+#define YYTRANSLATE(YYX) \
+ (0 <= (YYX) && (YYX) <= YYMAXUTOK \
+ ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
+ : YYSYMBOL_YYUNDEF)
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
- as returned by yylex, without out-of-bounds checking. */
-static const yytype_uint8 yytranslate[] =
+ as returned by yylex. */
+static const yytype_int8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -520,61 +581,61 @@ static const yytype_uint8 yytranslate[] =
};
#if HYPNO_MIS_DEBUG
- /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
-static const yytype_uint16 yyrline[] =
+/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
+static const yytype_int16 yyrline[] =
{
0, 73, 73, 76, 83, 84, 88, 100, 106, 121,
- 127, 128, 129, 136, 143, 149, 155, 161, 168, 175,
- 182, 189, 195, 201, 204, 210, 216, 219, 220, 223,
- 230, 233, 234, 238, 241, 244, 248, 252, 257, 263,
- 264, 270, 276, 282, 289, 296, 302, 307, 308, 311,
- 312, 315, 316, 319, 320
+ 127, 133, 134, 141, 148, 154, 160, 166, 173, 180,
+ 187, 194, 200, 206, 209, 215, 221, 224, 225, 228,
+ 235, 238, 239, 243, 246, 249, 253, 257, 262, 268,
+ 269, 275, 281, 287, 294, 301, 307, 312, 313, 316,
+ 317, 320, 321, 324, 325
};
#endif
-#if HYPNO_MIS_DEBUG || YYERROR_VERBOSE || 0
+/** Accessing symbol of state STATE. */
+#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
+
+#if HYPNO_MIS_DEBUG || 0
+/* The user-facing name of the symbol whose (internal) number is
+ YYSYMBOL. No bounds checking. */
+static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
+
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
- "$end", "error", "$undefined", "NAME", "FILENAME", "FLAG", "COMMENT",
- "GSSWITCH", "COMMAND", "WALNTOK", "NUM", "HOTSTOK", "CUTSTOK", "BACKTOK",
- "INTRTOK", "RETTOK", "TIMETOK", "PALETOK", "BBOXTOK", "OVERTOK",
- "MICETOK", "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", "init", "lines", "line", "anything",
- "alloctalk", "talk", "mflag", "flag", "gsswitch", YY_NULLPTR
+ "\"end of file\"", "error", "\"invalid token\"", "NAME", "FILENAME",
+ "FLAG", "COMMENT", "GSSWITCH", "COMMAND", "WALNTOK", "NUM", "HOTSTOK",
+ "CUTSTOK", "BACKTOK", "INTRTOK", "RETTOK", "TIMETOK", "PALETOK",
+ "BBOXTOK", "OVERTOK", "MICETOK", "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", "init",
+ "lines", "line", "anything", "alloctalk", "talk", "mflag", "flag",
+ "gsswitch", YY_NULLPTR
};
-#endif
-# ifdef YYPRINT
-/* YYTOKNUM[NUM] -- (External) token number corresponding to the
- (internal) symbol number NUM (which must be that of a token). */
-static const yytype_uint16 yytoknum[] =
+static const char *
+yysymbol_name (yysymbol_kind_t yysymbol)
{
- 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
- 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
- 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
- 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
- 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
- 305
-};
-# endif
+ return yytname[yysymbol];
+}
+#endif
-#define YYPACT_NINF -85
+#define YYPACT_NINF (-85)
-#define yypact_value_is_default(Yystate) \
- (!!((Yystate) == (-85)))
+#define yypact_value_is_default(Yyn) \
+ ((Yyn) == YYPACT_NINF)
-#define YYTABLE_NINF -1
+#define YYTABLE_NINF (-1)
-#define yytable_value_is_error(Yytable_value) \
+#define yytable_value_is_error(Yyn) \
0
- /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
- STATE-NUM. */
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+ STATE-NUM. */
static const yytype_int8 yypact[] =
{
-85, 5, 77, -85, 9, -4, 13, 14, 15, -85,
@@ -593,10 +654,10 @@ static const yytype_int8 yypact[] =
-85, -85, -85, 82, -85, -85, -85
};
- /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
- Performed when YYTABLE does not specify something else to do. Zero
- means the default is an error. */
-static const yytype_uint8 yydefact[] =
+/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
+ Performed when YYTABLE does not specify something else to do. Zero
+ means the default is an error. */
+static const yytype_int8 yydefact[] =
{
3, 0, 5, 1, 0, 0, 0, 0, 0, 26,
0, 0, 0, 0, 0, 28, 50, 8, 9, 0,
@@ -614,23 +675,23 @@ static const yytype_uint8 yydefact[] =
44, 12, 23, 52, 35, 43, 32
};
- /* YYPGOTO[NTERM-NUM]. */
+/* YYPGOTO[NTERM-NUM]. */
static const yytype_int8 yypgoto[] =
{
-85, -85, -85, 100, -85, 3, -85, -61, -27, -84,
-78
};
- /* YYDEFGOTO[NTERM-NUM]. */
+/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int8 yydefgoto[] =
{
- -1, 1, 2, 24, 25, 37, 44, 78, 39, 109,
+ 0, 1, 2, 24, 25, 37, 44, 78, 39, 109,
105
};
- /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
- positive, shift that token. If negative, reduce the rule whose
- number is the opposite. If YYTABLE_NINF, syntax error. */
+/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
+ positive, shift that token. If negative, reduce the rule whose
+ number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_uint8 yytable[] =
{
89, 90, 111, 107, 50, 3, 110, 95, 96, 97,
@@ -665,9 +726,9 @@ static const yytype_uint8 yycheck[] =
10, 10, 10, 10, 10, 25
};
- /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
- symbol of state STATE-NUM. */
-static const yytype_uint8 yystos[] =
+/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
+ state STATE-NUM. */
+static const yytype_int8 yystos[] =
{
0, 52, 53, 0, 9, 11, 12, 13, 14, 15,
16, 17, 19, 20, 21, 22, 23, 24, 25, 27,
@@ -685,8 +746,8 @@ static const yytype_uint8 yystos[] =
58, 60, 10, 61, 60, 58, 60
};
- /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const yytype_uint8 yyr1[] =
+/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
+static const yytype_int8 yyr1[] =
{
0, 51, 52, 53, 54, 54, 55, 55, 55, 55,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
@@ -696,8 +757,8 @@ static const yytype_uint8 yyr1[] =
59, 60, 60, 61, 61
};
- /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
-static const yytype_uint8 yyr2[] =
+/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
+static const yytype_int8 yyr2[] =
{
0, 2, 2, 0, 2, 0, 4, 6, 1, 1,
3, 2, 7, 3, 5, 6, 5, 2, 4, 2,
@@ -708,39 +769,39 @@ static const yytype_uint8 yyr2[] =
};
+enum { YYENOMEM = -2 };
+
#define yyerrok (yyerrstatus = 0)
-#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY (-2)
-#define YYEOF 0
+#define yyclearin (yychar = HYPNO_MIS_EMPTY)
#define YYACCEPT goto yyacceptlab
#define YYABORT goto yyabortlab
#define YYERROR goto yyerrorlab
+#define YYNOMEM goto yyexhaustedlab
#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- YYPOPSTACK (yylen); \
- yystate = *yyssp; \
- goto yybackup; \
- } \
- else \
- { \
- yyerror (YY_("syntax error: cannot back up")); \
- YYERROR; \
- } \
-while (0)
-
-/* Error token number */
-#define YYTERROR 1
-#define YYERRCODE 256
-
+#define YYBACKUP(Token, Value) \
+ do \
+ if (yychar == HYPNO_MIS_EMPTY) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ YYPOPSTACK (yylen); \
+ yystate = *yyssp; \
+ goto yybackup; \
+ } \
+ else \
+ { \
+ yyerror (YY_("syntax error: cannot back up")); \
+ YYERROR; \
+ } \
+ while (0)
+
+/* Backward compatibility with an undocumented macro.
+ Use HYPNO_MIS_error or HYPNO_MIS_UNDEF. */
+#define YYERRCODE HYPNO_MIS_UNDEF
/* Enable debugging if requested. */
@@ -757,55 +818,52 @@ do { \
YYFPRINTF Args; \
} while (0)
-/* This macro is provided for backward compatibility. */
-#ifndef YY_LOCATION_PRINT
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-#endif
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
+
+# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
do { \
if (yydebug) \
{ \
YYFPRINTF (stderr, "%s ", Title); \
yy_symbol_print (stderr, \
- Type, Value); \
+ Kind, Value); \
YYFPRINTF (stderr, "\n"); \
} \
} while (0)
-/*----------------------------------------.
-| Print this symbol's value on YYOUTPUT. |
-`----------------------------------------*/
+/*-----------------------------------.
+| Print this symbol's value on YYO. |
+`-----------------------------------*/
static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+yy_symbol_value_print (FILE *yyo,
+ yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
{
- FILE *yyo = yyoutput;
- YYUSE (yyo);
+ FILE *yyoutput = yyo;
+ YY_USE (yyoutput);
if (!yyvaluep)
return;
-# ifdef YYPRINT
- if (yytype < YYNTOKENS)
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# endif
- YYUSE (yytype);
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+ YY_USE (yykind);
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
}
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
+/*---------------------------.
+| Print this symbol on YYO. |
+`---------------------------*/
static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+yy_symbol_print (FILE *yyo,
+ yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
{
- YYFPRINTF (yyoutput, "%s %s (",
- yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
+ YYFPRINTF (yyo, "%s %s (",
+ yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
- yy_symbol_value_print (yyoutput, yytype, yyvaluep);
- YYFPRINTF (yyoutput, ")");
+ yy_symbol_value_print (yyo, yykind, yyvaluep);
+ YYFPRINTF (yyo, ")");
}
/*------------------------------------------------------------------.
@@ -814,7 +872,7 @@ yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
`------------------------------------------------------------------*/
static void
-yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
+yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
{
YYFPRINTF (stderr, "Stack now");
for (; yybottom <= yytop; yybottom++)
@@ -837,21 +895,21 @@ do { \
`------------------------------------------------*/
static void
-yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
+yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
+ int yyrule)
{
- unsigned long int yylno = yyrline[yyrule];
+ int yylno = yyrline[yyrule];
int yynrhs = yyr2[yyrule];
int yyi;
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
yyrule - 1, yylno);
/* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++)
{
YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr,
- yystos[yyssp[yyi + 1 - yynrhs]],
- &(yyvsp[(yyi + 1) - (yynrhs)])
- );
+ YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
+ &yyvsp[(yyi + 1) - (yynrhs)]);
YYFPRINTF (stderr, "\n");
}
}
@@ -866,8 +924,8 @@ do { \
multiple parsers can coexist. */
int yydebug;
#else /* !HYPNO_MIS_DEBUG */
-# define YYDPRINTF(Args)
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
+# define YYDPRINTF(Args) ((void) 0)
+# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#endif /* !HYPNO_MIS_DEBUG */
@@ -890,249 +948,30 @@ int yydebug;
#endif
-#if YYERROR_VERBOSE
-
-# ifndef yystrlen
-# if defined __GLIBC__ && defined _STRING_H
-# define yystrlen strlen
-# else
-/* Return the length of YYSTR. */
-static YYSIZE_T
-yystrlen (const char *yystr)
-{
- YYSIZE_T yylen;
- for (yylen = 0; yystr[yylen]; yylen++)
- continue;
- return yylen;
-}
-# endif
-# endif
-
-# ifndef yystpcpy
-# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
-# define yystpcpy stpcpy
-# else
-/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
- YYDEST. */
-static char *
-yystpcpy (char *yydest, const char *yysrc)
-{
- char *yyd = yydest;
- const char *yys = yysrc;
-
- while ((*yyd++ = *yys++) != '\0')
- continue;
-
- return yyd - 1;
-}
-# endif
-# endif
-
-# ifndef yytnamerr
-/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
- quotes and backslashes, so that it's suitable for yyerror. The
- heuristic is that double-quoting is unnecessary unless the string
- contains an apostrophe, a comma, or backslash (other than
- backslash-backslash). YYSTR is taken from yytname. If YYRES is
- null, do not copy; instead, return the length of what the result
- would have been. */
-static YYSIZE_T
-yytnamerr (char *yyres, const char *yystr)
-{
- if (*yystr == '"')
- {
- YYSIZE_T yyn = 0;
- char const *yyp = yystr;
-
- for (;;)
- switch (*++yyp)
- {
- case '\'':
- case ',':
- goto do_not_strip_quotes;
-
- case '\\':
- if (*++yyp != '\\')
- goto do_not_strip_quotes;
- /* Fall through. */
- default:
- if (yyres)
- yyres[yyn] = *yyp;
- yyn++;
- break;
-
- case '"':
- if (yyres)
- yyres[yyn] = '\0';
- return yyn;
- }
- do_not_strip_quotes: ;
- }
-
- if (! yyres)
- return yystrlen (yystr);
-
- return yystpcpy (yyres, yystr) - yyres;
-}
-# endif
-/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
- about the unexpected token YYTOKEN for the state stack whose top is
- YYSSP.
-
- Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
- not large enough to hold the message. In that case, also set
- *YYMSG_ALLOC to the required number of bytes. Return 2 if the
- required number of bytes is too large to store. */
-static int
-yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
- yytype_int16 *yyssp, int yytoken)
-{
- YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
- YYSIZE_T yysize = yysize0;
- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
- /* Internationalized format string. */
- const char *yyformat = YY_NULLPTR;
- /* Arguments of yyformat. */
- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
- /* Number of reported tokens (one for the "unexpected", one per
- "expected"). */
- int yycount = 0;
-
- /* There are many possibilities here to consider:
- - If this state is a consistent state with a default action, then
- the only way this function was invoked is if the default action
- is an error action. In that case, don't check for expected
- tokens because there are none.
- - The only way there can be no lookahead present (in yychar) is if
- this state is a consistent state with a default action. Thus,
- detecting the absence of a lookahead is sufficient to determine
- that there is no unexpected or expected token to report. In that
- case, just report a simple "syntax error".
- - Don't assume there isn't a lookahead just because this state is a
- consistent state with a default action. There might have been a
- previous inconsistent state, consistent state with a non-default
- action, or user semantic action that manipulated yychar.
- - Of course, the expected token list depends on states to have
- correct lookahead information, and it depends on the parser not
- to perform extra reductions after fetching a lookahead from the
- scanner and before detecting a syntax error. Thus, state merging
- (from LALR or IELR) and default reductions corrupt the expected
- token list. However, the list is correct for canonical LR with
- one exception: it will still contain any token that will not be
- accepted due to an error action in a later state.
- */
- if (yytoken != YYEMPTY)
- {
- int yyn = yypact[*yyssp];
- yyarg[yycount++] = yytname[yytoken];
- if (!yypact_value_is_default (yyn))
- {
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. In other words, skip the first -YYN actions for
- this state because they are default actions. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn + 1;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yyx;
-
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
- && !yytable_value_is_error (yytable[yyx + yyn]))
- {
- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
- {
- yycount = 1;
- yysize = yysize0;
- break;
- }
- yyarg[yycount++] = yytname[yyx];
- {
- YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
- if (! (yysize <= yysize1
- && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
- return 2;
- yysize = yysize1;
- }
- }
- }
- }
- switch (yycount)
- {
-# define YYCASE_(N, S) \
- case N: \
- yyformat = S; \
- break
- YYCASE_(0, YY_("syntax error"));
- YYCASE_(1, YY_("syntax error, unexpected %s"));
- YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
- YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
- YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
- YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
-# undef YYCASE_
- }
-
- {
- YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
- if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
- return 2;
- yysize = yysize1;
- }
- if (*yymsg_alloc < yysize)
- {
- *yymsg_alloc = 2 * yysize;
- if (! (yysize <= *yymsg_alloc
- && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
- *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
- return 1;
- }
-
- /* Avoid sprintf, as that infringes on the user's name space.
- Don't have undefined behavior even if the translation
- produced a string with the wrong number of "%s"s. */
- {
- char *yyp = *yymsg;
- int yyi = 0;
- while ((*yyp = *yyformat) != '\0')
- if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
- {
- yyp += yytnamerr (yyp, yyarg[yyi++]);
- yyformat += 2;
- }
- else
- {
- yyp++;
- yyformat++;
- }
- }
- return 0;
-}
-#endif /* YYERROR_VERBOSE */
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
+yydestruct (const char *yymsg,
+ yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
{
- YYUSE (yyvaluep);
+ YY_USE (yyvaluep);
if (!yymsg)
yymsg = "Deleting";
- YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
+ YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
- YYUSE (yytype);
+ YY_USE (yykind);
YY_IGNORE_MAYBE_UNINITIALIZED_END
}
-
-
-/* The lookahead symbol. */
+/* Lookahead token kind. */
int yychar;
/* The semantic value of the lookahead symbol. */
@@ -1141,6 +980,8 @@ YYSTYPE yylval;
int yynerrs;
+
+
/*----------.
| yyparse. |
`----------*/
@@ -1148,43 +989,36 @@ int yynerrs;
int
yyparse (void)
{
- int yystate;
+ yy_state_fast_t yystate = 0;
/* Number of tokens to shift before error messages enabled. */
- int yyerrstatus;
-
- /* The stacks and their tools:
- 'yyss': related to states.
- 'yyvs': related to semantic values.
+ int yyerrstatus = 0;
- Refer to the stacks through separate pointers, to allow yyoverflow
+ /* Refer to the stacks through separate pointers, to allow yyoverflow
to reallocate them elsewhere. */
- /* The state stack. */
- yytype_int16 yyssa[YYINITDEPTH];
- yytype_int16 *yyss;
- yytype_int16 *yyssp;
+ /* Their size. */
+ YYPTRDIFF_T yystacksize = YYINITDEPTH;
- /* The semantic value stack. */
- YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs;
- YYSTYPE *yyvsp;
+ /* The state stack: array, bottom, top. */
+ yy_state_t yyssa[YYINITDEPTH];
+ yy_state_t *yyss = yyssa;
+ yy_state_t *yyssp = yyss;
- YYSIZE_T yystacksize;
+ /* The semantic value stack: array, bottom, top. */
+ YYSTYPE yyvsa[YYINITDEPTH];
+ YYSTYPE *yyvs = yyvsa;
+ YYSTYPE *yyvsp = yyvs;
int yyn;
+ /* The return value of yyparse. */
int yyresult;
- /* Lookahead token as an internal (translated) token number. */
- int yytoken = 0;
+ /* Lookahead symbol kind. */
+ yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
-#if YYERROR_VERBOSE
- /* Buffer for error messages, and its allocated size. */
- char yymsgbuf[128];
- char *yymsg = yymsgbuf;
- YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
-#endif
+
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
@@ -1192,71 +1026,75 @@ yyparse (void)
Keep to zero when no symbol should be popped. */
int yylen = 0;
- yyssp = yyss = yyssa;
- yyvsp = yyvs = yyvsa;
- yystacksize = YYINITDEPTH;
-
YYDPRINTF ((stderr, "Starting parse\n"));
- yystate = 0;
- yyerrstatus = 0;
- yynerrs = 0;
- yychar = YYEMPTY; /* Cause a token to be read. */
+ yychar = HYPNO_MIS_EMPTY; /* Cause a token to be read. */
+
goto yysetstate;
+
/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate. |
+| yynewstate -- push a new state, which is found in yystate. |
`------------------------------------------------------------*/
- yynewstate:
+yynewstate:
/* In all cases, when you get here, the value and location stacks
have just been pushed. So pushing a state here evens the stacks. */
yyssp++;
- yysetstate:
- *yyssp = yystate;
+
+/*--------------------------------------------------------------------.
+| yysetstate -- set current state (the top of the stack) to yystate. |
+`--------------------------------------------------------------------*/
+yysetstate:
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+ YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
+ YY_IGNORE_USELESS_CAST_BEGIN
+ *yyssp = YY_CAST (yy_state_t, yystate);
+ YY_IGNORE_USELESS_CAST_END
+ YY_STACK_PRINT (yyss, yyssp);
if (yyss + yystacksize - 1 <= yyssp)
+#if !defined yyoverflow && !defined YYSTACK_RELOCATE
+ YYNOMEM;
+#else
{
/* Get the current used size of the three stacks, in elements. */
- YYSIZE_T yysize = yyssp - yyss + 1;
+ YYPTRDIFF_T yysize = yyssp - yyss + 1;
-#ifdef yyoverflow
+# if defined yyoverflow
{
/* Give user a chance to reallocate the stack. Use copies of
these so that the &'s don't force the real ones into
memory. */
+ yy_state_t *yyss1 = yyss;
YYSTYPE *yyvs1 = yyvs;
- yytype_int16 *yyss1 = yyss;
/* Each stack pointer address is followed by the size of the
data in use in that stack, in bytes. This used to be a
conditional around just the two extra args, but that might
be undefined if yyoverflow is a macro. */
yyoverflow (YY_("memory exhausted"),
- &yyss1, yysize * sizeof (*yyssp),
- &yyvs1, yysize * sizeof (*yyvsp),
+ &yyss1, yysize * YYSIZEOF (*yyssp),
+ &yyvs1, yysize * YYSIZEOF (*yyvsp),
&yystacksize);
-
yyss = yyss1;
yyvs = yyvs1;
}
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
- goto yyexhaustedlab;
-# else
+# else /* defined YYSTACK_RELOCATE */
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
- goto yyexhaustedlab;
+ YYNOMEM;
yystacksize *= 2;
if (YYMAXDEPTH < yystacksize)
yystacksize = YYMAXDEPTH;
{
- yytype_int16 *yyss1 = yyss;
+ yy_state_t *yyss1 = yyss;
union yyalloc *yyptr =
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+ YY_CAST (union yyalloc *,
+ YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
if (! yyptr)
- goto yyexhaustedlab;
+ YYNOMEM;
YYSTACK_RELOCATE (yyss_alloc, yyss);
YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# undef YYSTACK_RELOCATE
@@ -1264,30 +1102,31 @@ yyparse (void)
YYSTACK_FREE (yyss1);
}
# endif
-#endif /* no yyoverflow */
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
- YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
+ YY_IGNORE_USELESS_CAST_BEGIN
+ YYDPRINTF ((stderr, "Stack size increased to %ld\n",
+ YY_CAST (long, yystacksize)));
+ YY_IGNORE_USELESS_CAST_END
if (yyss + yystacksize - 1 <= yyssp)
YYABORT;
}
+#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
if (yystate == YYFINAL)
YYACCEPT;
goto yybackup;
+
/*-----------.
| yybackup. |
`-----------*/
yybackup:
-
/* Do appropriate processing given the current state. Read a
lookahead token if we need one and don't already have one. */
@@ -1298,18 +1137,29 @@ yybackup:
/* Not known => get a lookahead token if don't already have one. */
- /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
- if (yychar == YYEMPTY)
+ /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
+ if (yychar == HYPNO_MIS_EMPTY)
{
- YYDPRINTF ((stderr, "Reading a token: "));
+ YYDPRINTF ((stderr, "Reading a token\n"));
yychar = yylex ();
}
- if (yychar <= YYEOF)
+ if (yychar <= HYPNO_MIS_EOF)
{
- yychar = yytoken = YYEOF;
+ yychar = HYPNO_MIS_EOF;
+ yytoken = YYSYMBOL_YYEOF;
YYDPRINTF ((stderr, "Now at end of input.\n"));
}
+ else if (yychar == HYPNO_MIS_error)
+ {
+ /* The scanner already issued an error message, process directly
+ to error recovery. But do not keep the error token as
+ lookahead, it is too special and may lead us to an endless
+ loop in error recovery. */
+ yychar = HYPNO_MIS_UNDEF;
+ yytoken = YYSYMBOL_YYerror;
+ goto yyerrlab1;
+ }
else
{
yytoken = YYTRANSLATE (yychar);
@@ -1337,15 +1187,13 @@ yybackup:
/* Shift the lookahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
-
- /* Discard the shifted token. */
- yychar = YYEMPTY;
-
yystate = yyn;
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
YY_IGNORE_MAYBE_UNINITIALIZED_END
+ /* Discard the shifted token. */
+ yychar = HYPNO_MIS_EMPTY;
goto yynewstate;
@@ -1360,7 +1208,7 @@ yydefault:
/*-----------------------------.
-| yyreduce -- Do a reduction. |
+| yyreduce -- do a reduction. |
`-----------------------------*/
yyreduce:
/* yyn is the number of a rule to reduce with. */
@@ -1380,20 +1228,20 @@ yyreduce:
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
- case 3:
-#line 76 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 3: /* init: %empty */
+#line 76 "engines/hypno/grammar_mis.y"
+ {
smenu_idx = new Common::Array<uint32>();
smenu_idx->push_back(-1);
stack = new Hypno::HotspotsStack();
stack->push_back(new Hotspots());
}
-#line 1392 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1240 "engines/hypno/grammar_mis.cpp"
break;
- case 6:
-#line 88 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 6: /* line: MENUTOK mflag mflag mflag */
+#line 88 "engines/hypno/grammar_mis.y"
+ {
Hotspot *hot = new Hotspot(MakeMenu, (yyvsp[-2].s));
debugC(1, kHypnoDebugParser, "MENU %s %s", (yyvsp[-2].s), (yyvsp[-1].s));
Hotspots *cur = stack->back();
@@ -1405,23 +1253,23 @@ yyreduce:
smenu_idx->pop_back();
smenu_idx->push_back(idx);
}
-#line 1409 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1257 "engines/hypno/grammar_mis.cpp"
break;
- case 7:
-#line 100 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 7: /* line: HOTSTOK BBOXTOK NUM NUM NUM NUM */
+#line 100 "engines/hypno/grammar_mis.y"
+ {
Hotspot *hot = new Hotspot(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 1420 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1268 "engines/hypno/grammar_mis.cpp"
break;
- case 8:
-#line 106 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 8: /* line: SMENTOK */
+#line 106 "engines/hypno/grammar_mis.y"
+ {
// This should always point to a hotspot
int idx = smenu_idx->back();
idx++;
@@ -1436,412 +1284,418 @@ yyreduce:
stack->push_back(hot->smenu);
debugC(1, kHypnoDebugParser, "SUBMENU");
}
-#line 1440 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1288 "engines/hypno/grammar_mis.cpp"
break;
- case 9:
-#line 121 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 9: /* line: ESCPTOK */
+#line 121 "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 1451 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1299 "engines/hypno/grammar_mis.cpp"
break;
- case 10:
-#line 127 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- { debugC(1, kHypnoDebugParser, "TIME %d", (yyvsp[-1].i)); }
-#line 1457 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+ case 10: /* line: TIMETOK NUM mflag */
+#line 127 "engines/hypno/grammar_mis.y"
+ {
+ Timer *a = new Timer((yyvsp[-1].i));
+ Hotspots *cur = stack->back();
+ Hotspot *hot = &cur->back();
+ hot->actions.push_back(a);
+ debugC(1, kHypnoDebugParser, "TIME %d", (yyvsp[-1].i)); }
+#line 1310 "engines/hypno/grammar_mis.cpp"
break;
- case 11:
-#line 128 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- { debugC(1, kHypnoDebugParser, "SWPT %d", (yyvsp[0].i)); }
-#line 1463 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+ case 11: /* line: SWPTTOK NUM */
+#line 133 "engines/hypno/grammar_mis.y"
+ { debugC(1, kHypnoDebugParser, "SWPT %d", (yyvsp[0].i)); }
+#line 1316 "engines/hypno/grammar_mis.cpp"
break;
- case 12:
-#line 129 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 12: /* line: BACKTOK FILENAME NUM NUM gsswitch flag flag */
+#line 134 "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");
}
-#line 1475 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1328 "engines/hypno/grammar_mis.cpp"
break;
- case 13:
-#line 136 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 13: /* line: GLOBTOK GSSWITCH NAME */
+#line 141 "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");
}
-#line 1487 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1340 "engines/hypno/grammar_mis.cpp"
break;
- case 14:
-#line 143 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 14: /* line: AMBITOK FILENAME NUM NUM flag */
+#line 148 "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 1498 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1351 "engines/hypno/grammar_mis.cpp"
break;
- case 15:
-#line 149 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 15: /* line: PLAYTOK FILENAME NUM NUM gsswitch flag */
+#line 154 "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 1509 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1362 "engines/hypno/grammar_mis.cpp"
break;
- case 16:
-#line 155 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 16: /* line: OVERTOK FILENAME NUM NUM flag */
+#line 160 "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);
}
-#line 1520 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1373 "engines/hypno/grammar_mis.cpp"
break;
- case 17:
-#line 161 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 17: /* line: PALETOK FILENAME */
+#line 166 "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");
}
-#line 1532 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1385 "engines/hypno/grammar_mis.cpp"
break;
- case 18:
-#line 168 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 18: /* line: INTRTOK FILENAME NUM NUM */
+#line 173 "engines/hypno/grammar_mis.y"
+ {
Cutscene *a = new Cutscene(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));
}
-#line 1544 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1397 "engines/hypno/grammar_mis.cpp"
break;
- case 19:
-#line 175 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 19: /* line: INTRTOK FILENAME */
+#line 180 "engines/hypno/grammar_mis.y"
+ {
Cutscene *a = new Cutscene(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));
}
-#line 1556 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1409 "engines/hypno/grammar_mis.cpp"
break;
- case 20:
-#line 182 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 20: /* line: CUTSTOK FILENAME */
+#line 187 "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));
}
-#line 1568 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1421 "engines/hypno/grammar_mis.cpp"
break;
- case 21:
-#line 189 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 21: /* line: WALNTOK FILENAME NUM NUM gsswitch flag */
+#line 194 "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 1579 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1432 "engines/hypno/grammar_mis.cpp"
break;
- case 22:
-#line 195 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 22: /* line: MICETOK FILENAME NUM */
+#line 200 "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);
}
-#line 1590 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1443 "engines/hypno/grammar_mis.cpp"
break;
- case 23:
-#line 201 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 23: /* line: MPTRTOK FILENAME NUM NUM NUM NUM NUM */
+#line 206 "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));
}
-#line 1598 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1451 "engines/hypno/grammar_mis.cpp"
break;
- case 24:
-#line 204 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 24: /* line: TALKTOK alloctalk talk */
+#line 209 "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 1609 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1462 "engines/hypno/grammar_mis.cpp"
break;
- case 25:
-#line 210 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 25: /* line: ENDTOK anything RETTOK */
+#line 215 "engines/hypno/grammar_mis.y"
+ {
debugC(1, kHypnoDebugParser, "explicit END");
g_parsedHots = stack->back();
stack->pop_back();
smenu_idx->pop_back();
}
-#line 1620 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1473 "engines/hypno/grammar_mis.cpp"
break;
- case 26:
-#line 216 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- { debugC(1, kHypnoDebugParser, "implicit END"); }
-#line 1626 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+ case 26: /* line: RETTOK */
+#line 221 "engines/hypno/grammar_mis.y"
+ { debugC(1, kHypnoDebugParser, "implicit END"); }
+#line 1479 "engines/hypno/grammar_mis.cpp"
break;
- case 29:
-#line 223 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 29: /* alloctalk: %empty */
+#line 228 "engines/hypno/grammar_mis.y"
+ {
assert(talk_action == nullptr);
talk_action = new Talk();
talk_action->escape = false;
talk_action->active = true;
}
-#line 1637 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1490 "engines/hypno/grammar_mis.cpp"
break;
- case 30:
-#line 230 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 30: /* talk: INACTOK talk */
+#line 235 "engines/hypno/grammar_mis.y"
+ {
talk_action->active = false;
debugC(1, kHypnoDebugParser, "inactive"); }
-#line 1645 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1498 "engines/hypno/grammar_mis.cpp"
break;
- case 31:
-#line 233 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- { debugC(1, kHypnoDebugParser, "inactive"); }
-#line 1651 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+ case 31: /* talk: FDTOK talk */
+#line 238 "engines/hypno/grammar_mis.y"
+ { debugC(1, kHypnoDebugParser, "inactive"); }
+#line 1504 "engines/hypno/grammar_mis.cpp"
break;
- case 32:
-#line 234 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 32: /* talk: BACKTOK FILENAME NUM NUM gsswitch flag */
+#line 239 "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 1660 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1513 "engines/hypno/grammar_mis.cpp"
break;
- case 33:
-#line 238 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 33: /* talk: BOXXTOK NUM NUM */
+#line 243 "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 1668 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1521 "engines/hypno/grammar_mis.cpp"
break;
- case 34:
-#line 241 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 34: /* talk: ESCAPETOK */
+#line 246 "engines/hypno/grammar_mis.y"
+ {
talk_action->escape = true;
debugC(1, kHypnoDebugParser, "ESCAPE"); }
-#line 1676 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1529 "engines/hypno/grammar_mis.cpp"
break;
- case 35:
-#line 244 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 35: /* talk: SECONDTOK FILENAME NUM NUM flag */
+#line 249 "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 1685 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1538 "engines/hypno/grammar_mis.cpp"
break;
- case 36:
-#line 248 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 36: /* talk: INTROTOK FILENAME NUM NUM */
+#line 253 "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 1694 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1547 "engines/hypno/grammar_mis.cpp"
break;
- case 37:
-#line 252 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 37: /* talk: DEFAULTTOK FILENAME NUM NUM */
+#line 257 "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 1704 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1557 "engines/hypno/grammar_mis.cpp"
break;
- case 38:
-#line 257 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 38: /* talk: PG talk */
+#line 262 "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 1715 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1568 "engines/hypno/grammar_mis.cpp"
break;
- case 39:
-#line 263 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- { debugC(1, kHypnoDebugParser, "%s", (yyvsp[-1].s)); }
-#line 1721 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+ case 39: /* talk: PH talk */
+#line 268 "engines/hypno/grammar_mis.y"
+ { debugC(1, kHypnoDebugParser, "%s", (yyvsp[-1].s)); }
+#line 1574 "engines/hypno/grammar_mis.cpp"
break;
- case 40:
-#line 264 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 40: /* talk: PF talk */
+#line 269 "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 1732 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1585 "engines/hypno/grammar_mis.cpp"
break;
- case 41:
-#line 270 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 41: /* talk: PA talk */
+#line 275 "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 1743 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1596 "engines/hypno/grammar_mis.cpp"
break;
- case 42:
-#line 276 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 42: /* talk: PD talk */
+#line 281 "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 1754 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1607 "engines/hypno/grammar_mis.cpp"
break;
- case 43:
-#line 282 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 43: /* talk: PP NUM NUM flag talk */
+#line 287 "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 1766 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1619 "engines/hypno/grammar_mis.cpp"
break;
- case 44:
-#line 289 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 44: /* talk: PI NUM NUM talk */
+#line 294 "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 1778 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1631 "engines/hypno/grammar_mis.cpp"
break;
- case 45:
-#line 296 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 45: /* talk: PS talk */
+#line 301 "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 1789 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1642 "engines/hypno/grammar_mis.cpp"
break;
- case 46:
-#line 302 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- {
+ case 46: /* talk: PL talk */
+#line 307 "engines/hypno/grammar_mis.y"
+ {
TalkCommand talk_cmd;
talk_cmd.command = "L";
talk_action->commands.push_back(talk_cmd);
debugC(1, kHypnoDebugParser, "|L"); }
-#line 1799 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1652 "engines/hypno/grammar_mis.cpp"
break;
- case 47:
-#line 307 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- { debugC(1, kHypnoDebugParser, "|E"); }
-#line 1805 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+ case 47: /* talk: PE */
+#line 312 "engines/hypno/grammar_mis.y"
+ { debugC(1, kHypnoDebugParser, "|E"); }
+#line 1658 "engines/hypno/grammar_mis.cpp"
break;
- case 49:
-#line 311 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- { (yyval.s) = (yyvsp[0].s); }
-#line 1811 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+ case 49: /* mflag: NAME */
+#line 316 "engines/hypno/grammar_mis.y"
+ { (yyval.s) = (yyvsp[0].s); }
+#line 1664 "engines/hypno/grammar_mis.cpp"
break;
- case 50:
-#line 312 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- { (yyval.s) = scumm_strdup(""); }
-#line 1817 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+ case 50: /* mflag: %empty */
+#line 317 "engines/hypno/grammar_mis.y"
+ { (yyval.s) = scumm_strdup(""); }
+#line 1670 "engines/hypno/grammar_mis.cpp"
break;
- case 51:
-#line 315 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- { (yyval.s) = (yyvsp[0].s); debugC(1, kHypnoDebugParser, "flag: %s", (yyvsp[0].s)); }
-#line 1823 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+ case 51: /* flag: FLAG */
+#line 320 "engines/hypno/grammar_mis.y"
+ { (yyval.s) = (yyvsp[0].s); debugC(1, kHypnoDebugParser, "flag: %s", (yyvsp[0].s)); }
+#line 1676 "engines/hypno/grammar_mis.cpp"
break;
- case 52:
-#line 316 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- { (yyval.s) = scumm_strdup(""); }
-#line 1829 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+ case 52: /* flag: %empty */
+#line 321 "engines/hypno/grammar_mis.y"
+ { (yyval.s) = scumm_strdup(""); }
+#line 1682 "engines/hypno/grammar_mis.cpp"
break;
- case 53:
-#line 319 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- { (yyval.s) = (yyvsp[0].s); debugC(1, kHypnoDebugParser, "switch %s", (yyvsp[0].s)); }
-#line 1835 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+ case 53: /* gsswitch: GSSWITCH */
+#line 324 "engines/hypno/grammar_mis.y"
+ { (yyval.s) = (yyvsp[0].s); debugC(1, kHypnoDebugParser, "switch %s", (yyvsp[0].s)); }
+#line 1688 "engines/hypno/grammar_mis.cpp"
break;
- case 54:
-#line 320 "engines/hypno/grammar_mis.y" /* yacc.c:1646 */
- { (yyval.s) = scumm_strdup(""); }
-#line 1841 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+ case 54: /* gsswitch: %empty */
+#line 325 "engines/hypno/grammar_mis.y"
+ { (yyval.s) = scumm_strdup(""); }
+#line 1694 "engines/hypno/grammar_mis.cpp"
break;
-#line 1845 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646 */
+#line 1698 "engines/hypno/grammar_mis.cpp"
+
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -1855,25 +1709,23 @@ yyreduce:
case of YYERROR or YYBACKUP, subsequent parser actions might lead
to an incorrect destructor call or verbose syntax error message
before the lookahead is translated. */
- YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
+ YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
YYPOPSTACK (yylen);
yylen = 0;
- YY_STACK_PRINT (yyss, yyssp);
*++yyvsp = yyval;
/* Now 'shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule
number reduced by. */
-
- yyn = yyr1[yyn];
-
- yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
- if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
- yystate = yytable[yystate];
- else
- yystate = yydefgoto[yyn - YYNTOKENS];
+ {
+ const int yylhs = yyr1[yyn] - YYNTOKENS;
+ const int yyi = yypgoto[yylhs] + *yyssp;
+ yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
+ ? yytable[yyi]
+ : yydefgoto[yylhs]);
+ }
goto yynewstate;
@@ -1884,66 +1736,30 @@ yyreduce:
yyerrlab:
/* Make sure we have latest lookahead translation. See comments at
user semantic actions for why this is necessary. */
- yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
-
+ yytoken = yychar == HYPNO_MIS_EMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
++yynerrs;
-#if ! YYERROR_VERBOSE
yyerror (YY_("syntax error"));
-#else
-# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
- yyssp, yytoken)
- {
- char const *yymsgp = YY_("syntax error");
- int yysyntax_error_status;
- yysyntax_error_status = YYSYNTAX_ERROR;
- if (yysyntax_error_status == 0)
- yymsgp = yymsg;
- else if (yysyntax_error_status == 1)
- {
- if (yymsg != yymsgbuf)
- YYSTACK_FREE (yymsg);
- yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
- if (!yymsg)
- {
- yymsg = yymsgbuf;
- yymsg_alloc = sizeof yymsgbuf;
- yysyntax_error_status = 2;
- }
- else
- {
- yysyntax_error_status = YYSYNTAX_ERROR;
- yymsgp = yymsg;
- }
- }
- yyerror (yymsgp);
- if (yysyntax_error_status == 2)
- goto yyexhaustedlab;
- }
-# undef YYSYNTAX_ERROR
-#endif
}
-
-
if (yyerrstatus == 3)
{
/* If just tried and failed to reuse lookahead token after an
error, discard it. */
- if (yychar <= YYEOF)
+ if (yychar <= HYPNO_MIS_EOF)
{
/* Return failure if at end of input. */
- if (yychar == YYEOF)
+ if (yychar == HYPNO_MIS_EOF)
YYABORT;
}
else
{
yydestruct ("Error: discarding",
yytoken, &yylval);
- yychar = YYEMPTY;
+ yychar = HYPNO_MIS_EMPTY;
}
}
@@ -1956,12 +1772,11 @@ yyerrlab:
| yyerrorlab -- error raised explicitly by YYERROR. |
`---------------------------------------------------*/
yyerrorlab:
-
- /* Pacify compilers like GCC when the user code never invokes
- YYERROR and the label yyerrorlab therefore never appears in user
- code. */
- if (/*CONSTCOND*/ 0)
- goto yyerrorlab;
+ /* Pacify compilers when the user code never invokes YYERROR and the
+ label yyerrorlab therefore never appears in user code. */
+ if (0)
+ YYERROR;
+ ++yynerrs;
/* Do not reclaim the symbols of the rule whose action triggered
this YYERROR. */
@@ -1978,13 +1793,14 @@ yyerrorlab:
yyerrlab1:
yyerrstatus = 3; /* Each real token shifted decrements this. */
+ /* Pop stack until we find a state that shifts the error token. */
for (;;)
{
yyn = yypact[yystate];
if (!yypact_value_is_default (yyn))
{
- yyn += YYTERROR;
- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+ yyn += YYSYMBOL_YYerror;
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
{
yyn = yytable[yyn];
if (0 < yyn)
@@ -1998,7 +1814,7 @@ yyerrlab1:
yydestruct ("Error: popping",
- yystos[yystate], yyvsp);
+ YY_ACCESSING_SYMBOL (yystate), yyvsp);
YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
@@ -2010,7 +1826,7 @@ yyerrlab1:
/* Shift the error token. */
- YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+ YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
yystate = yyn;
goto yynewstate;
@@ -2021,27 +1837,31 @@ yyerrlab1:
`-------------------------------------*/
yyacceptlab:
yyresult = 0;
- goto yyreturn;
+ goto yyreturnlab;
+
/*-----------------------------------.
| yyabortlab -- YYABORT comes here. |
`-----------------------------------*/
yyabortlab:
yyresult = 1;
- goto yyreturn;
+ goto yyreturnlab;
-#if !defined yyoverflow || YYERROR_VERBOSE
-/*-------------------------------------------------.
-| yyexhaustedlab -- memory exhaustion comes here. |
-`-------------------------------------------------*/
+
+/*-----------------------------------------------------------.
+| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
+`-----------------------------------------------------------*/
yyexhaustedlab:
yyerror (YY_("memory exhausted"));
yyresult = 2;
- /* Fall through. */
-#endif
+ goto yyreturnlab;
+
-yyreturn:
- if (yychar != YYEMPTY)
+/*----------------------------------------------------------.
+| yyreturnlab -- parsing is finished, clean up and return. |
+`----------------------------------------------------------*/
+yyreturnlab:
+ if (yychar != HYPNO_MIS_EMPTY)
{
/* Make sure we have latest lookahead translation. See comments at
user semantic actions for why this is necessary. */
@@ -2056,16 +1876,14 @@ yyreturn:
while (yyssp != yyss)
{
yydestruct ("Cleanup: popping",
- yystos[*yyssp], yyvsp);
+ YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
YYPOPSTACK (1);
}
#ifndef yyoverflow
if (yyss != yyssa)
YYSTACK_FREE (yyss);
#endif
-#if YYERROR_VERBOSE
- if (yymsg != yymsgbuf)
- YYSTACK_FREE (yymsg);
-#endif
+
return yyresult;
}
+
diff --git a/engines/hypno/grammar_mis.y b/engines/hypno/grammar_mis.y
index 62e65c9cbdb..2fbb4b9fefc 100644
--- a/engines/hypno/grammar_mis.y
+++ b/engines/hypno/grammar_mis.y
@@ -124,7 +124,12 @@ line: MENUTOK mflag mflag mflag {
Hotspot *hot = &cur->back();
hot->actions.push_back(a);
debugC(1, kHypnoDebugParser, "ESC SUBMENU"); }
- | TIMETOK NUM mflag { debugC(1, kHypnoDebugParser, "TIME %d", $2); }
+ | TIMETOK NUM mflag {
+ Timer *a = new Timer($2);
+ Hotspots *cur = stack->back();
+ Hotspot *hot = &cur->back();
+ hot->actions.push_back(a);
+ debugC(1, kHypnoDebugParser, "TIME %d", $2); }
| SWPTTOK NUM { debugC(1, kHypnoDebugParser, "SWPT %d", $2); }
| BACKTOK FILENAME NUM NUM gsswitch flag flag {
Background *a = new Background($2, Common::Point($3, $4), $5, $6, $7);
diff --git a/engines/hypno/hypno.cpp b/engines/hypno/hypno.cpp
index 3555e894666..ec1a7217933 100644
--- a/engines/hypno/hypno.cpp
+++ b/engines/hypno/hypno.cpp
@@ -504,19 +504,33 @@ Common::String HypnoEngine::convertPath(const Common::String &name) {
}
// Timers
-static void timerCallback(void *refCon) {
- g_hypno->removeTimer();
+static void alarmCallback(void *refCon) {
+ g_system->getTimerManager()->removeTimerProc(&alarmCallback);
Common::String *level = (Common::String *)refCon;
g_hypno->_nextLevel = *level;
delete level;
}
-bool HypnoEngine::installTimer(uint32 delay, Common::String *ns) {
- return g_system->getTimerManager()->installTimerProc(&timerCallback, delay, (void *)ns, "timerCallback");
+static void countdownCallback(void *refCon) {
+ g_hypno->_countdown = g_hypno->_countdown - 1;
+ debug("countdown: %d", g_hypno->_countdown);
}
-void HypnoEngine::removeTimer() {
- g_system->getTimerManager()->removeTimerProc(&timerCallback);
+bool HypnoEngine::startAlarm(uint32 delay, Common::String *ns) {
+ return g_system->getTimerManager()->installTimerProc(&alarmCallback, delay, (void *)ns, "alarm");
+}
+
+bool HypnoEngine::startCountdown(uint32 delay) {
+ _countdown = delay;
+ _timerStarted = true;
+ uint32 oneSecond = 1000000;
+ return g_system->getTimerManager()->installTimerProc(&countdownCallback, oneSecond, 0x0, "countdown");
+}
+
+void HypnoEngine::removeTimers() {
+ _timerStarted = false;
+ g_system->getTimerManager()->removeTimerProc(&alarmCallback);
+ g_system->getTimerManager()->removeTimerProc(&countdownCallback);
}
} // End of namespace Hypno
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index ca380afa67a..29e9dd6790f 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -155,6 +155,7 @@ public:
void runSave(Save *a);
void runLoad(Load *a);
void runLoadCheckpoint(LoadCheckpoint *a);
+ void runTimer(Timer *a);
void runQuit(Quit *a);
void runCutscene(Cutscene *a);
void runPlay(Play *a);
@@ -244,8 +245,11 @@ public:
virtual void showCredits();
// Timers
- bool installTimer(uint32, Common::String *);
- void removeTimer();
+ int32 _countdown;
+ bool _timerStarted;
+ bool startAlarm(uint32, Common::String *);
+ bool startCountdown(uint32);
+ void removeTimers();
};
struct chapterEntry {
diff --git a/engines/hypno/lexer_mis.cpp b/engines/hypno/lexer_mis.cpp
index ffde5dc99ff..c0e09133e6d 100644
--- a/engines/hypno/lexer_mis.cpp
+++ b/engines/hypno/lexer_mis.cpp
@@ -1,6 +1,6 @@
-#line 2 "engines/hypno/lexer_mis.cpp"
+#line 1 "engines/hypno/lexer_mis.cpp"
-#line 4 "engines/hypno/lexer_mis.cpp"
+#line 3 "engines/hypno/lexer_mis.cpp"
#define YY_INT_ALIGNED short int
@@ -881,8 +881,8 @@ char *yytext;
#include "hypno/grammar.h"
#include "hypno/tokens_mis.h"
+#line 884 "engines/hypno/lexer_mis.cpp"
#line 885 "engines/hypno/lexer_mis.cpp"
-#line 886 "engines/hypno/lexer_mis.cpp"
#define INITIAL 0
@@ -1099,7 +1099,7 @@ YY_DECL
{
#line 41 "engines/hypno/lexer_mis.l"
-#line 1103 "engines/hypno/lexer_mis.cpp"
+#line 1102 "engines/hypno/lexer_mis.cpp"
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
@@ -1403,7 +1403,7 @@ YY_RULE_SETUP
#line 89 "engines/hypno/lexer_mis.l"
ECHO;
YY_BREAK
-#line 1407 "engines/hypno/lexer_mis.cpp"
+#line 1406 "engines/hypno/lexer_mis.cpp"
case YY_STATE_EOF(INITIAL):
yyterminate();
diff --git a/engines/hypno/scene.cpp b/engines/hypno/scene.cpp
index 026327b9754..cde51b02f56 100644
--- a/engines/hypno/scene.cpp
+++ b/engines/hypno/scene.cpp
@@ -246,15 +246,17 @@ void HypnoEngine::runTransition(Transition *trans) {
sframe->free();
delete sframe;
Common::String *ptr = new Common::String(nextLevel);
- if (!installTimer(2 * 1000000, ptr)) // 2 seconds
- error("Failed to install timer");
+ if (!startAlarm(2 * 1000000, ptr)) // 2 seconds
+ error("Failed to install alarm");
} else
_nextLevel = nextLevel;
}
void HypnoEngine::runScene(Scene *scene) {
+ _font = FontMan.getFontByUsage(Graphics::FontManager::kConsoleFont);
_refreshConversation = false;
+ _timerStarted = false;
_conversation.clear();
Common::Event event;
Common::Point mousePos;
@@ -270,6 +272,23 @@ void HypnoEngine::runScene(Scene *scene) {
defaultCursor();
while (!shouldQuit() && _nextLevel.empty()) {
+
+ if (_timerStarted && _videosPlaying.empty() && !_nextHotsToRemove) {
+ if (_countdown > 0) {
+ uint32 c = _pixelFormat.RGBToColor(255, 0, 0);
+ runMenu(*stack.back());
+ uint32 minutes = _countdown / 60;
+ uint32 seconds = _countdown % 60;
+ _font->drawString(_compositeSurface, Common::String::format("TIME: %d:%d", minutes, seconds), 80, 10, 60, c);
+ drawScreen();
+ } else {
+ assert(!scene->levelIfLose.empty());
+ _nextLevel = scene->levelIfLose;
+ debugC(1, kHypnoDebugScene, "Finishing level and jumping to %s", _nextLevel.c_str());
+ resetSceneState();
+ continue;
+ }
+ }
while (g_system->getEventManager()->pollEvent(event)) {
mousePos = g_system->getEventManager()->getMousePos();
diff --git a/engines/hypno/spider/spider.cpp b/engines/hypno/spider/spider.cpp
index deaa69dd731..304df4273e1 100644
--- a/engines/hypno/spider/spider.cpp
+++ b/engines/hypno/spider/spider.cpp
@@ -885,24 +885,25 @@ void SpiderEngine::loadAssetsDemo() {
SearchMan.add("DATA.Z", (Common::Archive *) &_installerArchive, 0, false);
Common::ArchiveMemberList files;
- LibFile *missions = loadLib("", "sixdemo/c_misc/missions.lib", true);
+ LibFile *missions = loadLib("", "c_misc/missions.lib", true);
if (missions == nullptr || missions->listMembers(files) == 0)
error("Failed to load any file from missions.lib");
// start level
Transition *start = new Transition("sixdemo/mis/demo.mis");
- start->intros.push_back("sixdemo/demo/dcine1.smk");
- start->intros.push_back("sixdemo/demo/dcine2.smk");
+ start->intros.push_back("demo/dcine1.smk");
+ start->intros.push_back("demo/dcine2.smk");
_levels["<start>"] = start;
- loadArcadeLevel("c1.mi_", "sixdemo/mis/demo.mis", "sixdemo");
+ loadArcadeLevel("c1.mi_", "mis/demo.mis", "");
+ _levels["c1.mi_"]->levelIfLose = "sixdemo/mis/demo.mis";
- loadLib("", "sixdemo/c_misc/fonts.lib", true);
- loadLib("sixdemo/c_misc/sound.lib/", "sixdemo/c_misc/sound.lib", true);
- loadLib("sixdemo/demo/sound.lib/", "sixdemo/demo/sound.lib", true);
+ loadLib("", "c_misc/fonts.lib", true);
+ loadLib("c_misc/sound.lib/", "c_misc/sound.lib", true);
+ loadLib("demo/sound.lib/", "demo/sound.lib", true);
// Read assets from mis files
- loadSceneLevel("sixdemo/mis/demo.mis", "", "sixdemo");
+ loadSceneLevel("sixdemo/mis/demo.mis", "", "");
ChangeLevel *cl = new ChangeLevel("c1.mi_");
Scene *sc = (Scene *) _levels["sixdemo/mis/demo.mis"];
@@ -921,12 +922,12 @@ void SpiderEngine::loadAssetsDemo() {
sc->hots[5].actions.push_back(cl);
sc->music = "demo/sound.lib/menu_mus.raw";
- loadSceneLevel("sixdemo/mis/order.mis", "", "sixdemo");
+ loadSceneLevel("sixdemo/mis/order.mis", "", "");
sc = (Scene *) _levels["sixdemo/mis/order.mis"];
cl = new ChangeLevel("<quit>");
sc->hots[1].actions.push_back(cl);
- loadSceneLevel("sixdemo/mis/alley.mis", "", "sixdemo");
+ loadSceneLevel("sixdemo/mis/alley.mis", "", "");
sc = (Scene *) _levels["sixdemo/mis/alley.mis"];
sc->intros.push_back("demo/aleyc01s.smk");
@@ -934,7 +935,7 @@ void SpiderEngine::loadAssetsDemo() {
sc->levelIfWin = "sixdemo/mis/demo.mis";
sc->levelIfLose = "sixdemo/mis/demo.mis";
- loadSceneLevel("sixdemo/mis/shoctalk.mis", "", "sixdemo");
+ loadSceneLevel("sixdemo/mis/shoctalk.mis", "", "");
Code *matrix = new Code();
matrix->name = "<puz_matr>";
diff --git a/engines/hypno/tokens_mis.h b/engines/hypno/tokens_mis.h
index 51b999bc603..bf33c2cc3ea 100644
--- a/engines/hypno/tokens_mis.h
+++ b/engines/hypno/tokens_mis.h
@@ -1,8 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.0.4. */
+/* A Bison parser, made by GNU Bison 3.8.2. */
/* Bison interface for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
+ Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -15,7 +16,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -30,6 +31,10 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
+/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
+ especially those whose name start with YY_ or yy_. They are
+ private implementation details that can be changed or removed. */
+
#ifndef YY_HYPNO_MIS_ENGINES_HYPNO_TOKENS_MIS_H_INCLUDED
# define YY_HYPNO_MIS_ENGINES_HYPNO_TOKENS_MIS_H_INCLUDED
/* Debug traces. */
@@ -48,75 +53,79 @@
extern int HYPNO_MIS_debug;
#endif
-/* Token type. */
+/* Token kinds. */
#ifndef HYPNO_MIS_TOKENTYPE
# define HYPNO_MIS_TOKENTYPE
enum HYPNO_MIS_tokentype
{
- NAME = 258,
- FILENAME = 259,
- FLAG = 260,
- COMMENT = 261,
- GSSWITCH = 262,
- COMMAND = 263,
- WALNTOK = 264,
- NUM = 265,
- HOTSTOK = 266,
- CUTSTOK = 267,
- BACKTOK = 268,
- INTRTOK = 269,
- RETTOK = 270,
- TIMETOK = 271,
- PALETOK = 272,
- BBOXTOK = 273,
- OVERTOK = 274,
- MICETOK = 275,
- PLAYTOK = 276,
- ENDTOK = 277,
- MENUTOK = 278,
- SMENTOK = 279,
- ESCPTOK = 280,
- NRTOK = 281,
- AMBITOK = 282,
- SWPTTOK = 283,
- MPTRTOK = 284,
- GLOBTOK = 285,
- TONTOK = 286,
- TOFFTOK = 287,
- TALKTOK = 288,
- INACTOK = 289,
- FDTOK = 290,
- BOXXTOK = 291,
- ESCAPETOK = 292,
- SECONDTOK = 293,
- INTROTOK = 294,
- DEFAULTTOK = 295,
- PG = 296,
- PA = 297,
- PD = 298,
- PH = 299,
- PF = 300,
- PE = 301,
- PP = 302,
- PI = 303,
- PL = 304,
- PS = 305
+ HYPNO_MIS_EMPTY = -2,
+ HYPNO_MIS_EOF = 0, /* "end of file" */
+ HYPNO_MIS_error = 256, /* error */
+ HYPNO_MIS_UNDEF = 257, /* "invalid token" */
+ NAME = 258, /* NAME */
+ FILENAME = 259, /* FILENAME */
+ FLAG = 260, /* FLAG */
+ COMMENT = 261, /* COMMENT */
+ GSSWITCH = 262, /* GSSWITCH */
+ COMMAND = 263, /* COMMAND */
+ WALNTOK = 264, /* WALNTOK */
+ NUM = 265, /* NUM */
+ 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 */
+ PLAYTOK = 276, /* PLAYTOK */
+ ENDTOK = 277, /* ENDTOK */
+ MENUTOK = 278, /* MENUTOK */
+ SMENTOK = 279, /* SMENTOK */
+ ESCPTOK = 280, /* ESCPTOK */
+ NRTOK = 281, /* NRTOK */
+ AMBITOK = 282, /* AMBITOK */
+ SWPTTOK = 283, /* SWPTTOK */
+ MPTRTOK = 284, /* MPTRTOK */
+ GLOBTOK = 285, /* GLOBTOK */
+ TONTOK = 286, /* TONTOK */
+ TOFFTOK = 287, /* TOFFTOK */
+ TALKTOK = 288, /* TALKTOK */
+ INACTOK = 289, /* INACTOK */
+ FDTOK = 290, /* FDTOK */
+ BOXXTOK = 291, /* BOXXTOK */
+ ESCAPETOK = 292, /* ESCAPETOK */
+ SECONDTOK = 293, /* SECONDTOK */
+ INTROTOK = 294, /* INTROTOK */
+ DEFAULTTOK = 295, /* DEFAULTTOK */
+ PG = 296, /* PG */
+ PA = 297, /* PA */
+ PD = 298, /* PD */
+ PH = 299, /* PH */
+ PF = 300, /* PF */
+ PE = 301, /* PE */
+ PP = 302, /* PP */
+ PI = 303, /* PI */
+ PL = 304, /* PL */
+ PS = 305 /* PS */
};
+ typedef enum HYPNO_MIS_tokentype HYPNO_MIS_token_kind_t;
#endif
/* Value type. */
#if ! defined HYPNO_MIS_STYPE && ! defined HYPNO_MIS_STYPE_IS_DECLARED
-
union HYPNO_MIS_STYPE
{
-#line 56 "engines/hypno/grammar_mis.y" /* yacc.c:1909 */
+#line 56 "engines/hypno/grammar_mis.y"
char *s; /* string value */
int i; /* integer value */
-#line 118 "engines/hypno/tokens_mis.h" /* yacc.c:1909 */
-};
+#line 127 "engines/hypno/tokens_mis.h"
+};
typedef union HYPNO_MIS_STYPE HYPNO_MIS_STYPE;
# define HYPNO_MIS_STYPE_IS_TRIVIAL 1
# define HYPNO_MIS_STYPE_IS_DECLARED 1
@@ -125,6 +134,8 @@ typedef union HYPNO_MIS_STYPE HYPNO_MIS_STYPE;
extern HYPNO_MIS_STYPE HYPNO_MIS_lval;
+
int HYPNO_MIS_parse (void);
+
#endif /* !YY_HYPNO_MIS_ENGINES_HYPNO_TOKENS_MIS_H_INCLUDED */
More information about the Scummvm-git-logs
mailing list