diff --git a/src/sparse.c b/src/sparse.c
index f220086..4112d87 100644
--- a/src/sparse.c
+++ b/src/sparse.c
@@ -1,8 +1,8 @@
-/* A Bison parser, made by GNU Bison 3.4.2. */
+/* 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, 2018-2019 Free Software Foundation,
+ 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
@@ -16,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 . */
+ along with this program. If not, see . */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -34,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.
@@ -41,14 +45,11 @@
define necessary library symbols; they are noted "INFRINGES ON
USER NAME SPACE" below. */
-/* Undocumented macros, especially those whose name start with YY_,
- are private implementation details. Do not rely on them. */
-
-/* Identify Bison output. */
-#define YYBISON 1
+/* Identify Bison output, and Bison version. */
+#define YYBISON 30802
-/* Bison version. */
-#define YYBISON_VERSION "3.4.2"
+/* Bison version string. */
+#define YYBISON_VERSION "3.8.2"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -69,12 +70,11 @@
#define yyerror sphere_yyerror
#define yydebug sphere_yydebug
#define yynerrs sphere_yynerrs
-
#define yylval sphere_yylval
#define yychar sphere_yychar
/* First part of user prologue. */
-#line 1 "sparse.y"
+#line 1 "src/sparse.y"
#include
#include
@@ -110,8 +110,17 @@ static double human2dec(double d, double m, double s)
}
-#line 114 "sparse.c"
+#line 114 "src/sparse.c"
+# ifndef YY_CAST
+# ifdef __cplusplus
+# define YY_CAST(Type, Val) static_cast (Val)
+# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val)
+# else
+# define YY_CAST(Type, Val) ((Type) (Val))
+# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
+# endif
+# endif
# ifndef YY_NULLPTR
# if defined __cplusplus
# if 201103L <= __cplusplus
@@ -124,89 +133,48 @@ static double human2dec(double d, double m, double s)
# endif
# endif
-/* Enabling verbose error messages. */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-/* Use api.header.include to #include this header
- instead of duplicating it here. */
-#ifndef YY_SPHERE_YY_SPARSE_H_INCLUDED
-# define YY_SPHERE_YY_SPARSE_H_INCLUDED
-/* Debug traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-#if YYDEBUG
-extern int sphere_yydebug;
-#endif
-
-/* Token type. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- enum yytokentype
- {
- HOUR = 258,
- DEG = 259,
- MIN = 260,
- SEC = 261,
- COMMA = 262,
- OPENCIRC = 263,
- CLOSECIRC = 264,
- OPENPOINT = 265,
- CLOSEPOINT = 266,
- OPENARR = 267,
- CLOSEARR = 268,
- SIGN = 269,
- INT = 270,
- FLOAT = 271,
- EULERAXIS = 272
- };
-#endif
-/* Tokens. */
-#define HOUR 258
-#define DEG 259
-#define MIN 260
-#define SEC 261
-#define COMMA 262
-#define OPENCIRC 263
-#define CLOSECIRC 264
-#define OPENPOINT 265
-#define CLOSEPOINT 266
-#define OPENARR 267
-#define CLOSEARR 268
-#define SIGN 269
-#define INT 270
-#define FLOAT 271
-#define EULERAXIS 272
-
-/* Value type. */
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-union YYSTYPE
+#include "sparse.h"
+/* Symbol kind. */
+enum yysymbol_kind_t
{
-#line 41 "sparse.y"
-
- int i;
- double d;
- char c[3];
-
-#line 197 "sparse.c"
-
+ YYSYMBOL_YYEMPTY = -2,
+ YYSYMBOL_YYEOF = 0, /* "end of file" */
+ YYSYMBOL_YYerror = 1, /* error */
+ YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
+ YYSYMBOL_HOUR = 3, /* HOUR */
+ YYSYMBOL_DEG = 4, /* DEG */
+ YYSYMBOL_MIN = 5, /* MIN */
+ YYSYMBOL_SEC = 6, /* SEC */
+ YYSYMBOL_COMMA = 7, /* COMMA */
+ YYSYMBOL_OPENCIRC = 8, /* OPENCIRC */
+ YYSYMBOL_CLOSECIRC = 9, /* CLOSECIRC */
+ YYSYMBOL_OPENPOINT = 10, /* OPENPOINT */
+ YYSYMBOL_CLOSEPOINT = 11, /* CLOSEPOINT */
+ YYSYMBOL_OPENARR = 12, /* OPENARR */
+ YYSYMBOL_CLOSEARR = 13, /* CLOSEARR */
+ YYSYMBOL_TOK_SIGN = 14, /* TOK_SIGN */
+ YYSYMBOL_TOK_INT = 15, /* TOK_INT */
+ YYSYMBOL_TOK_FLOAT = 16, /* TOK_FLOAT */
+ YYSYMBOL_TOK_EULERAXIS = 17, /* TOK_EULERAXIS */
+ YYSYMBOL_YYACCEPT = 18, /* $accept */
+ YYSYMBOL_commands = 19, /* commands */
+ YYSYMBOL_command = 20, /* command */
+ YYSYMBOL_number = 21, /* number */
+ YYSYMBOL_angle_lat_us = 22, /* angle_lat_us */
+ YYSYMBOL_angle_long_us = 23, /* angle_long_us */
+ YYSYMBOL_angle_long = 24, /* angle_long */
+ YYSYMBOL_angle_lat = 25, /* angle_lat */
+ YYSYMBOL_spherepoint = 26, /* spherepoint */
+ YYSYMBOL_spherecircle = 27, /* spherecircle */
+ YYSYMBOL_eulertrans = 28, /* eulertrans */
+ YYSYMBOL_sphereline = 29, /* sphereline */
+ YYSYMBOL_spherepointlist = 30, /* spherepointlist */
+ YYSYMBOL_spherepath = 31, /* spherepath */
+ YYSYMBOL_sphereellipse = 32, /* sphereellipse */
+ YYSYMBOL_spherebox = 33 /* spherebox */
};
-typedef union YYSTYPE YYSTYPE;
-# define YYSTYPE_IS_TRIVIAL 1
-# define YYSTYPE_IS_DECLARED 1
-#endif
-
-
-extern YYSTYPE sphere_yylval;
+typedef enum yysymbol_kind_t yysymbol_kind_t;
-int sphere_yyparse (void);
-
-#endif /* !YY_SPHERE_YY_SPARSE_H_INCLUDED */
@@ -214,28 +182,87 @@ int sphere_yyparse (void);
# undef short
#endif
-#ifdef YYTYPE_UINT8
-typedef YYTYPE_UINT8 yytype_uint8;
-#else
-typedef unsigned char yytype_uint8;
+/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
+ and (if available) are included
+ so that the code can choose integer types of a good width. */
+
+#ifndef __PTRDIFF_MAX__
+# include /* INFRINGES ON USER NAME SPACE */
+# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
+# include /* INFRINGES ON USER NAME SPACE */
+# define YY_STDINT_H
+# endif
#endif
-#ifdef YYTYPE_INT8
-typedef YYTYPE_INT8 yytype_int8;
+/* 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 __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_UINT16
-typedef YYTYPE_UINT16 yytype_uint16;
+#ifdef __INT_LEAST16_MAX__
+typedef __INT_LEAST16_TYPE__ yytype_int16;
+#elif defined YY_STDINT_H
+typedef int_least16_t yytype_int16;
#else
-typedef unsigned short yytype_uint16;
+typedef short yytype_int16;
#endif
-#ifdef YYTYPE_INT16
-typedef YYTYPE_INT16 yytype_int16;
+/* 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
+ . */
+#ifdef __hpux
+# undef UINT_LEAST8_MAX
+# undef UINT_LEAST16_MAX
+# define UINT_LEAST8_MAX 255
+# define UINT_LEAST16_MAX 65535
+#endif
+
+#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 short yytype_int16;
+typedef short yytype_uint8;
+#endif
+
+#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 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 /* 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
@@ -243,7 +270,7 @@ typedef short 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 /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# else
@@ -251,7 +278,20 @@ typedef short yytype_int16;
# 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_int8 yy_state_t;
+
+/* State numbers in computations. */
+typedef int yy_state_fast_t;
#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
@@ -265,38 +305,43 @@ typedef short 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__))
+# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
+# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
+# else
+# 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__ && ! defined __ICC && 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
@@ -309,10 +354,22 @@ typedef short 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
+
#define YY_ASSERT(E) ((void) (0 && (E)))
-#if ! defined yyoverflow || YYERROR_VERBOSE
+#if !defined yyoverflow
/* The parser invokes alloca or malloc; define the necessary symbols. */
@@ -377,8 +434,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 \
@@ -387,17 +443,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
@@ -410,11 +466,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)
@@ -426,12 +482,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]; \
} \
@@ -454,17 +510,20 @@ union yyalloc
/* YYNSTATES -- Number of states. */
#define YYNSTATES 109
-#define YYUNDEFTOK 2
+/* YYMAXUTOK -- Last valid token kind. */
#define YYMAXUTOK 272
+
/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
as returned by yylex, with out-of-bounds checking. */
-#define YYTRANSLATE(YYX) \
- ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+#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. */
-static const yytype_uint8 yytranslate[] =
+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,
@@ -497,7 +556,7 @@ static const yytype_uint8 yytranslate[] =
};
#if YYDEBUG
- /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
+/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint8 yyrline[] =
{
0, 64, 64, 66, 70, 71, 72, 73, 74, 75,
@@ -508,42 +567,46 @@ static const yytype_uint8 yyrline[] =
};
#endif
-#if YYDEBUG || YYERROR_VERBOSE || 0
+/** Accessing symbol of state STATE. */
+#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
+
+#if YYDEBUG || 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", "HOUR", "DEG", "MIN", "SEC", "COMMA",
- "OPENCIRC", "CLOSECIRC", "OPENPOINT", "CLOSEPOINT", "OPENARR",
- "CLOSEARR", "SIGN", "INT", "FLOAT", "EULERAXIS", "$accept", "commands",
- "command", "number", "angle_lat_us", "angle_long_us", "angle_long",
- "angle_lat", "spherepoint", "spherecircle", "eulertrans", "sphereline",
+ "\"end of file\"", "error", "\"invalid token\"", "HOUR", "DEG", "MIN",
+ "SEC", "COMMA", "OPENCIRC", "CLOSECIRC", "OPENPOINT", "CLOSEPOINT",
+ "OPENARR", "CLOSEARR", "TOK_SIGN", "TOK_INT", "TOK_FLOAT",
+ "TOK_EULERAXIS", "$accept", "commands", "command", "number",
+ "angle_lat_us", "angle_long_us", "angle_long", "angle_lat",
+ "spherepoint", "spherecircle", "eulertrans", "sphereline",
"spherepointlist", "spherepath", "sphereellipse", "spherebox", 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
-};
-# endif
+ return yytname[yysymbol];
+}
+#endif
-#define YYPACT_NINF -18
+#define YYPACT_NINF (-18)
-#define yypact_value_is_default(Yystate) \
- (!!((Yystate) == (-18)))
+#define yypact_value_is_default(Yyn) \
+ ((Yyn) == YYPACT_NINF)
-#define YYTABLE_NINF -29
+#define YYTABLE_NINF (-29)
-#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[] =
{
58, 9, 33, -4, -2, 27, 11, 26, -18, -18,
@@ -559,10 +622,10 @@ static const yytype_int8 yypact[] =
118, -18, -18, 119, 87, 69, 120, 111, -18
};
- /* 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[] =
{
2, 0, 0, 0, 0, 12, 11, 0, 3, 21,
32, 0, 4, 5, 7, 6, 8, 9, 10, 0,
@@ -577,23 +640,23 @@ static const yytype_uint8 yydefact[] =
17, 39, 20, 0, 19, 0, 20, 0, 44
};
- /* YYPGOTO[NTERM-NUM]. */
+/* YYPGOTO[NTERM-NUM]. */
static const yytype_int8 yypgoto[] =
{
-18, -18, -18, -17, -12, 0, 5, 16, -1, -18,
126, -18, -18, -18, -18, -18
};
- /* YYDEFGOTO[NTERM-NUM]. */
+/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int8 yydefgoto[] =
{
- -1, 7, 8, 9, 62, 10, 51, 63, 12, 13,
+ 0, 7, 8, 9, 62, 10, 51, 63, 12, 13,
14, 15, 26, 16, 17, 18
};
- /* 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_int8 yytable[] =
{
21, 23, 25, 37, 27, 11, 19, 22, 38, -23,
@@ -628,9 +691,9 @@ static const yytype_int8 yycheck[] =
9, 105, 7, 6, 17, 7, 7, 7, 2
};
- /* 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, 8, 10, 12, 14, 15, 16, 19, 20, 21,
23, 24, 26, 27, 28, 29, 31, 32, 33, 10,
@@ -645,8 +708,8 @@ static const yytype_uint8 yystos[] =
5, 17, 6, 26, 21, 7, 6, 25, 9
};
- /* 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, 18, 19, 19, 20, 20, 20, 20, 20, 20,
20, 21, 21, 22, 22, 22, 22, 22, 22, 22,
@@ -655,8 +718,8 @@ static const yytype_uint8 yyr1[] =
29, 30, 30, 31, 32, 33, 33
};
- /* 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, 0, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 2, 2, 3, 4, 4, 5,
@@ -666,14 +729,15 @@ static const yytype_uint8 yyr2[] =
};
+enum { YYENOMEM = -2 };
+
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY (-2)
-#define YYEOF 0
#define YYACCEPT goto yyacceptlab
#define YYABORT goto yyabortlab
#define YYERROR goto yyerrorlab
+#define YYNOMEM goto yyexhaustedlab
#define YYRECOVERING() (!!yyerrstatus)
@@ -695,10 +759,9 @@ static const yytype_uint8 yyr2[] =
} \
while (0)
-/* Error token number */
-#define YYTERROR 1
-#define YYERRCODE 256
-
+/* Backward compatibility with an undocumented macro.
+ Use YYerror or YYUNDEF. */
+#define YYERRCODE YYUNDEF
/* Enable debugging if requested. */
@@ -715,19 +778,16 @@ 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)
@@ -738,18 +798,15 @@ do { \
`-----------------------------------*/
static void
-yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
+yy_symbol_value_print (FILE *yyo,
+ yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
{
FILE *yyoutput = yyo;
- YYUSE (yyoutput);
+ YY_USE (yyoutput);
if (!yyvaluep)
return;
-# ifdef YYPRINT
- if (yytype < YYNTOKENS)
- YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
-# endif
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
- YYUSE (yytype);
+ YY_USE (yykind);
YY_IGNORE_MAYBE_UNINITIALIZED_END
}
@@ -759,12 +816,13 @@ yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
`---------------------------*/
static void
-yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
+yy_symbol_print (FILE *yyo,
+ yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
{
YYFPRINTF (yyo, "%s %s (",
- yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
+ yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
- yy_symbol_value_print (yyo, yytype, yyvaluep);
+ yy_symbol_value_print (yyo, yykind, yyvaluep);
YYFPRINTF (yyo, ")");
}
@@ -774,7 +832,7 @@ yy_symbol_print (FILE *yyo, 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++)
@@ -797,21 +855,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 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");
}
}
@@ -826,8 +884,8 @@ do { \
multiple parsers can coexist. */
int yydebug;
#else /* !YYDEBUG */
-# 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 /* !YYDEBUG */
@@ -850,254 +908,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;
- else
- goto append;
-
- append:
- 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 (YYSIZE_T) (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)
- yysize = yysize1;
- else
- return 2;
- }
- }
- }
- }
-
- switch (yycount)
- {
-# define YYCASE_(N, S) \
- case N: \
- yyformat = S; \
- break
- default: /* Avoid compiler warnings. */
- 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)
- yysize = yysize1;
- else
- return 2;
- }
- 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. */
@@ -1106,6 +940,8 @@ YYSTYPE yylval;
int yynerrs;
+
+
/*----------.
| yyparse. |
`----------*/
@@ -1113,43 +949,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))
@@ -1157,16 +986,10 @@ 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. */
+
goto yysetstate;
@@ -1180,36 +1003,39 @@ yyparse (void)
/*--------------------------------------------------------------------.
-| yynewstate -- set current state (the top of the stack) to 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);
- *yyssp = (yytype_int16) yystate;
+ 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
- goto yyexhaustedlab;
+ YYNOMEM;
#else
{
/* Get the current used size of the three stacks, in elements. */
- YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);
+ YYPTRDIFF_T yysize = yyssp - yyss + 1;
# 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;
@@ -1217,20 +1043,21 @@ yyparse (void)
# 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
+# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
}
@@ -1239,14 +1066,17 @@ yyparse (void)
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
- YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long) 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 */
+
if (yystate == YYFINAL)
YYACCEPT;
@@ -1267,18 +1097,29 @@ yyparse (void)
/* Not known => get a lookahead token if don't already have one. */
- /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
+ /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
if (yychar == YYEMPTY)
{
- YYDPRINTF ((stderr, "Reading a token: "));
+ YYDPRINTF ((stderr, "Reading a token\n"));
yychar = yylex ();
}
if (yychar <= YYEOF)
{
- yychar = yytoken = YYEOF;
+ yychar = YYEOF;
+ yytoken = YYSYMBOL_YYEOF;
YYDPRINTF ((stderr, "Now at end of input.\n"));
}
+ else if (yychar == YYerror)
+ {
+ /* 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 = YYUNDEF;
+ yytoken = YYSYMBOL_YYerror;
+ goto yyerrlab1;
+ }
else
{
yytoken = YYTRANSLATE (yychar);
@@ -1306,14 +1147,13 @@ yyparse (void)
/* 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 = YYEMPTY;
goto yynewstate;
@@ -1348,266 +1188,266 @@ yyparse (void)
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
- case 4:
-#line 70 "sparse.y"
- { set_spheretype( STYPE_POINT ); }
-#line 1355 "sparse.c"
+ case 4: /* command: spherepoint */
+#line 70 "src/sparse.y"
+ { set_spheretype( STYPE_POINT ); }
+#line 1195 "src/sparse.c"
break;
- case 5:
-#line 71 "sparse.y"
- { set_spheretype( STYPE_CIRCLE ); }
-#line 1361 "sparse.c"
+ case 5: /* command: spherecircle */
+#line 71 "src/sparse.y"
+ { set_spheretype( STYPE_CIRCLE ); }
+#line 1201 "src/sparse.c"
break;
- case 6:
-#line 72 "sparse.y"
- { set_spheretype( STYPE_LINE ); }
-#line 1367 "sparse.c"
+ case 6: /* command: sphereline */
+#line 72 "src/sparse.y"
+ { set_spheretype( STYPE_LINE ); }
+#line 1207 "src/sparse.c"
break;
- case 7:
-#line 73 "sparse.y"
- { set_spheretype( STYPE_EULER ); }
-#line 1373 "sparse.c"
+ case 7: /* command: eulertrans */
+#line 73 "src/sparse.y"
+ { set_spheretype( STYPE_EULER ); }
+#line 1213 "src/sparse.c"
break;
- case 8:
-#line 74 "sparse.y"
- { set_spheretype( STYPE_PATH ); }
-#line 1379 "sparse.c"
+ case 8: /* command: spherepath */
+#line 74 "src/sparse.y"
+ { set_spheretype( STYPE_PATH ); }
+#line 1219 "src/sparse.c"
break;
- case 9:
-#line 75 "sparse.y"
- { set_spheretype( STYPE_ELLIPSE ); }
-#line 1385 "sparse.c"
+ case 9: /* command: sphereellipse */
+#line 75 "src/sparse.y"
+ { set_spheretype( STYPE_ELLIPSE ); }
+#line 1225 "src/sparse.c"
break;
- case 10:
-#line 76 "sparse.y"
- { set_spheretype( STYPE_BOX ); }
-#line 1391 "sparse.c"
+ case 10: /* command: spherebox */
+#line 76 "src/sparse.y"
+ { set_spheretype( STYPE_BOX ); }
+#line 1231 "src/sparse.c"
break;
- case 11:
-#line 81 "sparse.y"
- { (yyval.d) = (yyvsp[0].d); }
-#line 1397 "sparse.c"
+ case 11: /* number: TOK_FLOAT */
+#line 81 "src/sparse.y"
+ { (yyval.d) = (yyvsp[0].d); }
+#line 1237 "src/sparse.c"
break;
- case 12:
-#line 82 "sparse.y"
- { (yyval.d) = (yyvsp[0].i); }
-#line 1403 "sparse.c"
+ case 12: /* number: TOK_INT */
+#line 82 "src/sparse.y"
+ { (yyval.d) = (yyvsp[0].i); }
+#line 1243 "src/sparse.c"
break;
- case 13:
-#line 87 "sparse.y"
- { (yyval.i) = set_angle(0, (yyvsp[0].d) ); }
-#line 1409 "sparse.c"
+ case 13: /* angle_lat_us: number */
+#line 87 "src/sparse.y"
+ { (yyval.i) = set_angle(0, (yyvsp[0].d) ); }
+#line 1249 "src/sparse.c"
break;
- case 14:
-#line 88 "sparse.y"
- { (yyval.i) = set_angle(1, human2dec((yyvsp[-1].d), 0, 0) ); }
-#line 1415 "sparse.c"
+ case 14: /* angle_lat_us: TOK_FLOAT DEG */
+#line 88 "src/sparse.y"
+ { (yyval.i) = set_angle(1, human2dec((yyvsp[-1].d), 0, 0) ); }
+#line 1255 "src/sparse.c"
break;
- case 15:
-#line 89 "sparse.y"
- { (yyval.i) = set_angle(1, human2dec((yyvsp[-1].i), 0, 0) ); }
-#line 1421 "sparse.c"
+ case 15: /* angle_lat_us: TOK_INT DEG */
+#line 89 "src/sparse.y"
+ { (yyval.i) = set_angle(1, human2dec((yyvsp[-1].i), 0, 0) ); }
+#line 1261 "src/sparse.c"
break;
- case 16:
-#line 90 "sparse.y"
- { (yyval.i) = set_angle(1, human2dec((yyvsp[-2].i), (yyvsp[0].d), 0) ); }
-#line 1427 "sparse.c"
+ case 16: /* angle_lat_us: TOK_INT DEG number */
+#line 90 "src/sparse.y"
+ { (yyval.i) = set_angle(1, human2dec((yyvsp[-2].i), (yyvsp[0].d), 0) ); }
+#line 1267 "src/sparse.c"
break;
- case 17:
-#line 91 "sparse.y"
- { (yyval.i) = set_angle(1, human2dec((yyvsp[-3].i), (yyvsp[-1].d), 0) ); }
-#line 1433 "sparse.c"
+ case 17: /* angle_lat_us: TOK_INT DEG TOK_FLOAT MIN */
+#line 91 "src/sparse.y"
+ { (yyval.i) = set_angle(1, human2dec((yyvsp[-3].i), (yyvsp[-1].d), 0) ); }
+#line 1273 "src/sparse.c"
break;
- case 18:
-#line 92 "sparse.y"
- { (yyval.i) = set_angle(1, human2dec((yyvsp[-3].i), (yyvsp[-1].i), 0) ); }
-#line 1439 "sparse.c"
+ case 18: /* angle_lat_us: TOK_INT DEG TOK_INT MIN */
+#line 92 "src/sparse.y"
+ { (yyval.i) = set_angle(1, human2dec((yyvsp[-3].i), (yyvsp[-1].i), 0) ); }
+#line 1279 "src/sparse.c"
break;
- case 19:
-#line 93 "sparse.y"
- { (yyval.i) = set_angle(1, human2dec((yyvsp[-4].i), (yyvsp[-2].i), (yyvsp[0].d)) ); }
-#line 1445 "sparse.c"
+ case 19: /* angle_lat_us: TOK_INT DEG TOK_INT MIN number */
+#line 93 "src/sparse.y"
+ { (yyval.i) = set_angle(1, human2dec((yyvsp[-4].i), (yyvsp[-2].i), (yyvsp[0].d)) ); }
+#line 1285 "src/sparse.c"
break;
- case 20:
-#line 94 "sparse.y"
- { (yyval.i) = set_angle(1, human2dec((yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].d)) ); }
-#line 1451 "sparse.c"
+ case 20: /* angle_lat_us: TOK_INT DEG TOK_INT MIN number SEC */
+#line 94 "src/sparse.y"
+ { (yyval.i) = set_angle(1, human2dec((yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].d)) ); }
+#line 1291 "src/sparse.c"
break;
- case 21:
-#line 99 "sparse.y"
- { (yyval.i) = set_angle(0, (yyvsp[0].d)); }
-#line 1457 "sparse.c"
+ case 21: /* angle_long_us: number */
+#line 99 "src/sparse.y"
+ { (yyval.i) = set_angle(0, (yyvsp[0].d)); }
+#line 1297 "src/sparse.c"
break;
- case 22:
-#line 100 "sparse.y"
- { (yyval.i) = set_angle(1, human2dec((yyvsp[-1].d), 0, 0)); }
-#line 1463 "sparse.c"
+ case 22: /* angle_long_us: TOK_FLOAT DEG */
+#line 100 "src/sparse.y"
+ { (yyval.i) = set_angle(1, human2dec((yyvsp[-1].d), 0, 0)); }
+#line 1303 "src/sparse.c"
break;
- case 23:
-#line 101 "sparse.y"
- { (yyval.i) = set_angle(1, human2dec((yyvsp[-1].i), 0, 0)); }
-#line 1469 "sparse.c"
+ case 23: /* angle_long_us: TOK_INT DEG */
+#line 101 "src/sparse.y"
+ { (yyval.i) = set_angle(1, human2dec((yyvsp[-1].i), 0, 0)); }
+#line 1309 "src/sparse.c"
break;
- case 24:
-#line 102 "sparse.y"
- { (yyval.i) = set_angle(1, human2dec((yyvsp[-2].i), (yyvsp[0].d), 0)); }
-#line 1475 "sparse.c"
+ case 24: /* angle_long_us: TOK_INT DEG number */
+#line 102 "src/sparse.y"
+ { (yyval.i) = set_angle(1, human2dec((yyvsp[-2].i), (yyvsp[0].d), 0)); }
+#line 1315 "src/sparse.c"
break;
- case 25:
-#line 103 "sparse.y"
- { (yyval.i) = set_angle(1, human2dec((yyvsp[-3].i), (yyvsp[-1].d), 0)); }
-#line 1481 "sparse.c"
+ case 25: /* angle_long_us: TOK_INT DEG TOK_FLOAT MIN */
+#line 103 "src/sparse.y"
+ { (yyval.i) = set_angle(1, human2dec((yyvsp[-3].i), (yyvsp[-1].d), 0)); }
+#line 1321 "src/sparse.c"
break;
- case 26:
-#line 104 "sparse.y"
- { (yyval.i) = set_angle(1, human2dec((yyvsp[-3].i), (yyvsp[-1].i), 0)); }
-#line 1487 "sparse.c"
+ case 26: /* angle_long_us: TOK_INT DEG TOK_INT MIN */
+#line 104 "src/sparse.y"
+ { (yyval.i) = set_angle(1, human2dec((yyvsp[-3].i), (yyvsp[-1].i), 0)); }
+#line 1327 "src/sparse.c"
break;
- case 27:
-#line 105 "sparse.y"
- { (yyval.i) = set_angle(1, human2dec((yyvsp[-4].i), (yyvsp[-2].i), (yyvsp[0].d))); }
-#line 1493 "sparse.c"
+ case 27: /* angle_long_us: TOK_INT DEG TOK_INT MIN number */
+#line 105 "src/sparse.y"
+ { (yyval.i) = set_angle(1, human2dec((yyvsp[-4].i), (yyvsp[-2].i), (yyvsp[0].d))); }
+#line 1333 "src/sparse.c"
break;
- case 28:
-#line 106 "sparse.y"
- { (yyval.i) = set_angle(1, human2dec((yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].d))); }
-#line 1499 "sparse.c"
+ case 28: /* angle_long_us: TOK_INT DEG TOK_INT MIN number SEC */
+#line 106 "src/sparse.y"
+ { (yyval.i) = set_angle(1, human2dec((yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].d))); }
+#line 1339 "src/sparse.c"
break;
- case 29:
-#line 107 "sparse.y"
- { (yyval.i) = set_angle(1, 15 * human2dec((yyvsp[-2].i), (yyvsp[0].d), 0)); }
-#line 1505 "sparse.c"
+ case 29: /* angle_long_us: TOK_INT HOUR number */
+#line 107 "src/sparse.y"
+ { (yyval.i) = set_angle(1, 15 * human2dec((yyvsp[-2].i), (yyvsp[0].d), 0)); }
+#line 1345 "src/sparse.c"
break;
- case 30:
-#line 108 "sparse.y"
- { (yyval.i) = set_angle(1, 15 * human2dec((yyvsp[-4].i), (yyvsp[-2].i), (yyvsp[0].d))); }
-#line 1511 "sparse.c"
+ case 30: /* angle_long_us: TOK_INT HOUR TOK_INT MIN number */
+#line 108 "src/sparse.y"
+ { (yyval.i) = set_angle(1, 15 * human2dec((yyvsp[-4].i), (yyvsp[-2].i), (yyvsp[0].d))); }
+#line 1351 "src/sparse.c"
break;
- case 31:
-#line 109 "sparse.y"
- { (yyval.i) = set_angle(1, 15 * human2dec((yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].d))); }
-#line 1517 "sparse.c"
+ case 31: /* angle_long_us: TOK_INT HOUR TOK_INT MIN number SEC */
+#line 109 "src/sparse.y"
+ { (yyval.i) = set_angle(1, 15 * human2dec((yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].d))); }
+#line 1357 "src/sparse.c"
break;
- case 32:
-#line 114 "sparse.y"
- { (yyval.i) = set_angle_sign((yyvsp[0].i), 1); }
-#line 1523 "sparse.c"
+ case 32: /* angle_long: angle_long_us */
+#line 114 "src/sparse.y"
+ { (yyval.i) = set_angle_sign((yyvsp[0].i), 1); }
+#line 1363 "src/sparse.c"
break;
- case 33:
-#line 115 "sparse.y"
- { (yyval.i) = set_angle_sign((yyvsp[0].i), (yyvsp[-1].i)); }
-#line 1529 "sparse.c"
+ case 33: /* angle_long: TOK_SIGN angle_long_us */
+#line 115 "src/sparse.y"
+ { (yyval.i) = set_angle_sign((yyvsp[0].i), (yyvsp[-1].i)); }
+#line 1369 "src/sparse.c"
break;
- case 34:
-#line 120 "sparse.y"
- { (yyval.i) = set_angle_sign((yyvsp[0].i), 1); }
-#line 1535 "sparse.c"
+ case 34: /* angle_lat: angle_lat_us */
+#line 120 "src/sparse.y"
+ { (yyval.i) = set_angle_sign((yyvsp[0].i), 1); }
+#line 1375 "src/sparse.c"
break;
- case 35:
-#line 121 "sparse.y"
- { (yyval.i) = set_angle_sign((yyvsp[0].i), (yyvsp[-1].i)); }
-#line 1541 "sparse.c"
+ case 35: /* angle_lat: TOK_SIGN angle_lat_us */
+#line 121 "src/sparse.y"
+ { (yyval.i) = set_angle_sign((yyvsp[0].i), (yyvsp[-1].i)); }
+#line 1381 "src/sparse.c"
break;
- case 36:
-#line 128 "sparse.y"
- {
+ case 36: /* spherepoint: OPENPOINT angle_long COMMA angle_lat CLOSEPOINT */
+#line 128 "src/sparse.y"
+ {
(yyval.i) = set_point((yyvsp[-3].i), (yyvsp[-1].i));
}
-#line 1549 "sparse.c"
+#line 1389 "src/sparse.c"
break;
- case 37:
-#line 136 "sparse.y"
- {
+ case 37: /* spherecircle: OPENCIRC spherepoint COMMA angle_lat_us CLOSECIRC */
+#line 136 "src/sparse.y"
+ {
set_circle((yyvsp[-3].i), (yyvsp[-1].i));
}
-#line 1557 "sparse.c"
+#line 1397 "src/sparse.c"
break;
- case 38:
-#line 144 "sparse.y"
- {
+ case 38: /* eulertrans: angle_long COMMA angle_long COMMA angle_long */
+#line 144 "src/sparse.y"
+ {
set_euler((yyvsp[-4].i), (yyvsp[-2].i), (yyvsp[0].i), "ZXZ");
}
-#line 1565 "sparse.c"
+#line 1405 "src/sparse.c"
break;
- case 39:
-#line 148 "sparse.y"
- {
+ case 39: /* eulertrans: angle_long COMMA angle_long COMMA angle_long COMMA TOK_EULERAXIS */
+#line 148 "src/sparse.y"
+ {
set_euler((yyvsp[-6].i), (yyvsp[-4].i), (yyvsp[-2].i), (yyvsp[0].c));
}
-#line 1573 "sparse.c"
+#line 1413 "src/sparse.c"
break;
- case 40:
-#line 156 "sparse.y"
- {
+ case 40: /* sphereline: OPENPOINT eulertrans CLOSEPOINT COMMA angle_long_us */
+#line 156 "src/sparse.y"
+ {
set_line ((yyvsp[0].i));
}
-#line 1581 "sparse.c"
+#line 1421 "src/sparse.c"
break;
- case 43:
-#line 168 "sparse.y"
- { }
-#line 1587 "sparse.c"
+ case 43: /* spherepath: OPENARR spherepointlist spherepoint CLOSEARR */
+#line 168 "src/sparse.y"
+ { }
+#line 1427 "src/sparse.c"
break;
- case 44:
-#line 174 "sparse.y"
- {
+ case 44: /* sphereellipse: OPENCIRC OPENARR angle_lat_us COMMA angle_lat_us CLOSEARR COMMA spherepoint COMMA angle_lat CLOSECIRC */
+#line 174 "src/sparse.y"
+ {
set_ellipse((yyvsp[-8].i), (yyvsp[-6].i), (yyvsp[-3].i), (yyvsp[-1].i));
}
-#line 1595 "sparse.c"
+#line 1435 "src/sparse.c"
break;
- case 45:
-#line 181 "sparse.y"
- { }
-#line 1601 "sparse.c"
+ case 45: /* spherebox: OPENPOINT spherepoint COMMA spherepoint CLOSEPOINT */
+#line 181 "src/sparse.y"
+ { }
+#line 1441 "src/sparse.c"
break;
- case 46:
-#line 182 "sparse.y"
- { }
-#line 1607 "sparse.c"
+ case 46: /* spherebox: spherepoint COMMA spherepoint */
+#line 182 "src/sparse.y"
+ { }
+#line 1447 "src/sparse.c"
break;
-#line 1611 "sparse.c"
+#line 1451 "src/sparse.c"
default: break;
}
@@ -1622,11 +1462,10 @@ yyparse (void)
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;
@@ -1650,50 +1489,14 @@ yyparse (void)
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 == YYEMPTY ? 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
@@ -1726,6 +1529,7 @@ yyparse (void)
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. */
@@ -1742,13 +1546,14 @@ yyparse (void)
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)
@@ -1762,7 +1567,7 @@ yyparse (void)
yydestruct ("Error: popping",
- yystos[yystate], yyvsp);
+ YY_ACCESSING_SYMBOL (yystate), yyvsp);
YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
@@ -1774,7 +1579,7 @@ yyparse (void)
/* 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;
@@ -1785,7 +1590,7 @@ yyparse (void)
`-------------------------------------*/
yyacceptlab:
yyresult = 0;
- goto yyreturn;
+ goto yyreturnlab;
/*-----------------------------------.
@@ -1793,24 +1598,22 @@ yyparse (void)
`-----------------------------------*/
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 -- parsing is finished, return the result. |
-`-----------------------------------------------------*/
-yyreturn:
+/*----------------------------------------------------------.
+| yyreturnlab -- parsing is finished, clean up and return. |
+`----------------------------------------------------------*/
+yyreturnlab:
if (yychar != YYEMPTY)
{
/* Make sure we have latest lookahead translation. See comments at
@@ -1826,16 +1629,14 @@ yyparse (void)
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/src/sparse.h b/src/sparse.h
index 032b5fd..02ef235 100644
--- a/src/sparse.h
+++ b/src/sparse.h
@@ -1,8 +1,8 @@
-/* A Bison parser, made by GNU Bison 3.4.2. */
+/* 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, 2018-2019 Free Software Foundation,
+ 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
@@ -16,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 . */
+ along with this program. If not, see . */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -31,11 +31,12 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
-/* Undocumented macros, especially those whose name start with YY_,
- are private implementation details. Do not rely on them. */
+/* 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_SPHERE_YY_SPARSE_H_INCLUDED
-# define YY_SPHERE_YY_SPARSE_H_INCLUDED
+#ifndef YY_SPHERE_YY_SRC_SPARSE_H_INCLUDED
+# define YY_SPHERE_YY_SRC_SPARSE_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
@@ -44,29 +45,38 @@
extern int sphere_yydebug;
#endif
-/* Token type. */
+/* Token kinds. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
enum yytokentype
{
- HOUR = 258,
- DEG = 259,
- MIN = 260,
- SEC = 261,
- COMMA = 262,
- OPENCIRC = 263,
- CLOSECIRC = 264,
- OPENPOINT = 265,
- CLOSEPOINT = 266,
- OPENARR = 267,
- CLOSEARR = 268,
- SIGN = 269,
- INT = 270,
- FLOAT = 271,
- EULERAXIS = 272
+ YYEMPTY = -2,
+ YYEOF = 0, /* "end of file" */
+ YYerror = 256, /* error */
+ YYUNDEF = 257, /* "invalid token" */
+ HOUR = 258, /* HOUR */
+ DEG = 259, /* DEG */
+ MIN = 260, /* MIN */
+ SEC = 261, /* SEC */
+ COMMA = 262, /* COMMA */
+ OPENCIRC = 263, /* OPENCIRC */
+ CLOSECIRC = 264, /* CLOSECIRC */
+ OPENPOINT = 265, /* OPENPOINT */
+ CLOSEPOINT = 266, /* CLOSEPOINT */
+ OPENARR = 267, /* OPENARR */
+ CLOSEARR = 268, /* CLOSEARR */
+ TOK_SIGN = 269, /* TOK_SIGN */
+ TOK_INT = 270, /* TOK_INT */
+ TOK_FLOAT = 271, /* TOK_FLOAT */
+ TOK_EULERAXIS = 272 /* TOK_EULERAXIS */
};
+ typedef enum yytokentype yytoken_kind_t;
#endif
-/* Tokens. */
+/* Token kinds. */
+#define YYEMPTY -2
+#define YYEOF 0
+#define YYerror 256
+#define YYUNDEF 257
#define HOUR 258
#define DEG 259
#define MIN 260
@@ -78,22 +88,22 @@ extern int sphere_yydebug;
#define CLOSEPOINT 266
#define OPENARR 267
#define CLOSEARR 268
-#define SIGN 269
-#define INT 270
-#define FLOAT 271
-#define EULERAXIS 272
+#define TOK_SIGN 269
+#define TOK_INT 270
+#define TOK_FLOAT 271
+#define TOK_EULERAXIS 272
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
union YYSTYPE
{
-#line 41 "sparse.y"
+#line 41 "src/sparse.y"
int i;
double d;
char c[3];
-#line 97 "sparse.h"
+#line 107 "src/sparse.h"
};
typedef union YYSTYPE YYSTYPE;
@@ -104,6 +114,8 @@ typedef union YYSTYPE YYSTYPE;
extern YYSTYPE sphere_yylval;
+
int sphere_yyparse (void);
-#endif /* !YY_SPHERE_YY_SPARSE_H_INCLUDED */
+
+#endif /* !YY_SPHERE_YY_SRC_SPARSE_H_INCLUDED */
diff --git a/src/sparse.y b/src/sparse.y
index 22e8778..225c5cf 100644
--- a/src/sparse.y
+++ b/src/sparse.y
@@ -44,10 +44,10 @@ static double human2dec(double d, double m, double s)
char c[3];
}
-%token SIGN
-%token INT
-%token FLOAT
-%token EULERAXIS
+%token TOK_SIGN
+%token TOK_INT
+%token TOK_FLOAT
+%token TOK_EULERAXIS
%left COMMA
@@ -78,47 +78,47 @@ command:
/* unsigned number */
number :
- FLOAT { $$ = $1; }
- | INT { $$ = $1; }
+ TOK_FLOAT { $$ = $1; }
+ | TOK_INT { $$ = $1; }
;
/* unsigned longitude */
angle_lat_us :
number { $$ = set_angle(0, $1 ); }
- | FLOAT DEG { $$ = set_angle(1, human2dec($1, 0, 0) ); }
- | INT DEG { $$ = set_angle(1, human2dec($1, 0, 0) ); }
- | INT DEG number { $$ = set_angle(1, human2dec($1, $3, 0) ); }
- | INT DEG FLOAT MIN { $$ = set_angle(1, human2dec($1, $3, 0) ); }
- | INT DEG INT MIN { $$ = set_angle(1, human2dec($1, $3, 0) ); }
- | INT DEG INT MIN number { $$ = set_angle(1, human2dec($1, $3, $5) ); }
- | INT DEG INT MIN number SEC { $$ = set_angle(1, human2dec($1, $3, $5) ); }
+ | TOK_FLOAT DEG { $$ = set_angle(1, human2dec($1, 0, 0) ); }
+ | TOK_INT DEG { $$ = set_angle(1, human2dec($1, 0, 0) ); }
+ | TOK_INT DEG number { $$ = set_angle(1, human2dec($1, $3, 0) ); }
+ | TOK_INT DEG TOK_FLOAT MIN { $$ = set_angle(1, human2dec($1, $3, 0) ); }
+ | TOK_INT DEG TOK_INT MIN { $$ = set_angle(1, human2dec($1, $3, 0) ); }
+ | TOK_INT DEG TOK_INT MIN number { $$ = set_angle(1, human2dec($1, $3, $5) ); }
+ | TOK_INT DEG TOK_INT MIN number SEC { $$ = set_angle(1, human2dec($1, $3, $5) ); }
;
/* unsigned latitude */
angle_long_us :
number { $$ = set_angle(0, $1); }
- | FLOAT DEG { $$ = set_angle(1, human2dec($1, 0, 0)); }
- | INT DEG { $$ = set_angle(1, human2dec($1, 0, 0)); }
- | INT DEG number { $$ = set_angle(1, human2dec($1, $3, 0)); }
- | INT DEG FLOAT MIN { $$ = set_angle(1, human2dec($1, $3, 0)); }
- | INT DEG INT MIN { $$ = set_angle(1, human2dec($1, $3, 0)); }
- | INT DEG INT MIN number { $$ = set_angle(1, human2dec($1, $3, $5)); }
- | INT DEG INT MIN number SEC { $$ = set_angle(1, human2dec($1, $3, $5)); }
- | INT HOUR number { $$ = set_angle(1, 15 * human2dec($1, $3, 0)); }
- | INT HOUR INT MIN number { $$ = set_angle(1, 15 * human2dec($1, $3, $5)); }
- | INT HOUR INT MIN number SEC { $$ = set_angle(1, 15 * human2dec($1, $3, $5)); }
+ | TOK_FLOAT DEG { $$ = set_angle(1, human2dec($1, 0, 0)); }
+ | TOK_INT DEG { $$ = set_angle(1, human2dec($1, 0, 0)); }
+ | TOK_INT DEG number { $$ = set_angle(1, human2dec($1, $3, 0)); }
+ | TOK_INT DEG TOK_FLOAT MIN { $$ = set_angle(1, human2dec($1, $3, 0)); }
+ | TOK_INT DEG TOK_INT MIN { $$ = set_angle(1, human2dec($1, $3, 0)); }
+ | TOK_INT DEG TOK_INT MIN number { $$ = set_angle(1, human2dec($1, $3, $5)); }
+ | TOK_INT DEG TOK_INT MIN number SEC { $$ = set_angle(1, human2dec($1, $3, $5)); }
+ | TOK_INT HOUR number { $$ = set_angle(1, 15 * human2dec($1, $3, 0)); }
+ | TOK_INT HOUR TOK_INT MIN number { $$ = set_angle(1, 15 * human2dec($1, $3, $5)); }
+ | TOK_INT HOUR TOK_INT MIN number SEC { $$ = set_angle(1, 15 * human2dec($1, $3, $5)); }
;
/* longitude */
angle_long :
angle_long_us { $$ = set_angle_sign($1, 1); }
- | SIGN angle_long_us { $$ = set_angle_sign($2, $1); }
+ | TOK_SIGN angle_long_us { $$ = set_angle_sign($2, $1); }
;
/* latitude */
angle_lat :
angle_lat_us { $$ = set_angle_sign($1, 1); }
- | SIGN angle_lat_us { $$ = set_angle_sign($2, $1); }
+ | TOK_SIGN angle_lat_us { $$ = set_angle_sign($2, $1); }
;
@@ -144,7 +144,7 @@ eulertrans :
{
set_euler($1, $3, $5, "ZXZ");
}
- | angle_long COMMA angle_long COMMA angle_long COMMA EULERAXIS
+ | angle_long COMMA angle_long COMMA angle_long COMMA TOK_EULERAXIS
{
set_euler($1, $3, $5, $7);
}
diff --git a/src/sscan.c b/src/sscan.c
index 3d904c6..f502eac 100644
--- a/src/sscan.c
+++ b/src/sscan.c
@@ -1,6 +1,6 @@
-#line 2 "sscan.c"
+#line 2 "src/sscan.c"
-#line 4 "sscan.c"
+#line 4 "src/sscan.c"
#define YY_INT_ALIGNED short int
@@ -722,8 +722,8 @@ int yy_flex_debug = 0;
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
-#line 1 "sscan.l"
-#line 2 "sscan.l"
+#line 1 "src/sscan.l"
+#line 2 "src/sscan.l"
#include
#include "string.h"
#include "sparse.h"
@@ -745,8 +745,8 @@ void sphere_flush_scanner_buffer(void)
{
YY_FLUSH_BUFFER;
}
-#line 749 "sscan.c"
-#line 750 "sscan.c"
+#line 749 "src/sscan.c"
+#line 750 "src/sscan.c"
#define INITIAL 0
@@ -961,9 +961,9 @@ YY_DECL
}
{
-#line 35 "sscan.l"
+#line 35 "src/sscan.l"
-#line 967 "sscan.c"
+#line 967 "src/sscan.c"
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
@@ -1018,106 +1018,106 @@ YY_DECL
case 1:
YY_RULE_SETUP
-#line 36 "sscan.l"
-sphere_yylval.i = (strcmp("-", yytext)) ? (1) : (-1); return SIGN;
+#line 36 "src/sscan.l"
+sphere_yylval.i = (strcmp("-", yytext)) ? (1) : (-1); return TOK_SIGN;
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 37 "sscan.l"
-sphere_yylval.i = atoi(yytext); return INT;
+#line 37 "src/sscan.l"
+sphere_yylval.i = atoi(yytext); return TOK_INT;
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 38 "sscan.l"
-sphere_yylval.d = atof(yytext); return FLOAT;
+#line 38 "src/sscan.l"
+sphere_yylval.d = atof(yytext); return TOK_FLOAT;
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 39 "sscan.l"
-memcpy(&sphere_yylval.c[0], yytext, 3); return EULERAXIS;
+#line 39 "src/sscan.l"
+memcpy(&sphere_yylval.c[0], yytext, 3); return TOK_EULERAXIS;
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 40 "sscan.l"
+#line 40 "src/sscan.l"
return HOUR;
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 41 "sscan.l"
+#line 41 "src/sscan.l"
return DEG;
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 42 "sscan.l"
+#line 42 "src/sscan.l"
return MIN;
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 43 "sscan.l"
+#line 43 "src/sscan.l"
return MIN;
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 44 "sscan.l"
+#line 44 "src/sscan.l"
return SEC;
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 45 "sscan.l"
+#line 45 "src/sscan.l"
return SEC;
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 46 "sscan.l"
+#line 46 "src/sscan.l"
return COMMA;
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 47 "sscan.l"
+#line 47 "src/sscan.l"
return OPENCIRC;
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 48 "sscan.l"
+#line 48 "src/sscan.l"
return CLOSECIRC;
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 49 "sscan.l"
+#line 49 "src/sscan.l"
return OPENPOINT;
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 50 "sscan.l"
+#line 50 "src/sscan.l"
return CLOSEPOINT;
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 51 "sscan.l"
+#line 51 "src/sscan.l"
return OPENARR;
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 52 "sscan.l"
+#line 52 "src/sscan.l"
return CLOSEARR;
YY_BREAK
case 18:
/* rule 18 can match eol */
YY_RULE_SETUP
-#line 53 "sscan.l"
+#line 53 "src/sscan.l"
/* discard spaces */
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 54 "sscan.l"
+#line 54 "src/sscan.l"
/* alert parser of the garbage */
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 55 "sscan.l"
+#line 55 "src/sscan.l"
ECHO;
YY_BREAK
-#line 1121 "sscan.c"
+#line 1121 "src/sscan.c"
case YY_STATE_EOF(INITIAL):
yyterminate();
@@ -2086,6 +2086,6 @@ void yyfree (void * ptr )
#define YYTABLES_NAME "yytables"
-#line 55 "sscan.l"
+#line 55 "src/sscan.l"
diff --git a/src/sscan.l b/src/sscan.l
index 99bd8ac..dd0f73d 100644
--- a/src/sscan.l
+++ b/src/sscan.l
@@ -33,10 +33,10 @@ real ({int})?\.({int})
float ({int}|{real})([eE]{sign}{int})?
%%
-{sign} sphere_yylval.i = (strcmp("-", yytext)) ? (1) : (-1); return SIGN;
-{int} sphere_yylval.i = atoi(yytext); return INT;
-{float} sphere_yylval.d = atof(yytext); return FLOAT;
-[x-zX-Z]{3} memcpy(&sphere_yylval.c[0], yytext, 3); return EULERAXIS;
+{sign} sphere_yylval.i = (strcmp("-", yytext)) ? (1) : (-1); return TOK_SIGN;
+{int} sphere_yylval.i = atoi(yytext); return TOK_INT;
+{float} sphere_yylval.d = atof(yytext); return TOK_FLOAT;
+[x-zX-Z]{3} memcpy(&sphere_yylval.c[0], yytext, 3); return TOK_EULERAXIS;
h return HOUR;
d return DEG;
' return MIN;