mirror of
https://github.com/gryf/gentoo-patches.git
synced 2026-04-26 14:41:23 +02:00
2710 lines
78 KiB
Diff
2710 lines
78 KiB
Diff
diff --git a/src/parsedate.c b/src/parsedate.c
|
|
index 8d53362..af11d95 100644
|
|
--- a/src/parsedate.c
|
|
+++ b/src/parsedate.c
|
|
@@ -1,12 +1,14 @@
|
|
-/* A Bison parser, made by GNU Bison 1.875d. */
|
|
+/* A Bison parser, made by GNU Bison 3.8.2. */
|
|
|
|
-/* Skeleton parser for Yacc-like parsing with Bison,
|
|
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
|
|
+/* Bison implementation for Yacc-like parsers in C
|
|
|
|
- This program is free software; you can redistribute it and/or modify
|
|
+ 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
|
|
- the Free Software Foundation; either version 2, or (at your option)
|
|
- any later version.
|
|
+ the Free Software Foundation, either version 3 of the License, or
|
|
+ (at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
@@ -14,17 +16,27 @@
|
|
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, write to the Free Software
|
|
- Foundation, Inc., 59 Temple Place - Suite 330,
|
|
- Boston, MA 02111-1307, USA. */
|
|
+ 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
|
|
+ under terms of your choice, so long as that work isn't itself a
|
|
+ parser generator using the skeleton or a modified version thereof
|
|
+ as a parser skeleton. Alternatively, if you modify or redistribute
|
|
+ the parser skeleton itself, you may (at your option) remove this
|
|
+ special exception, which will cause the skeleton and the resulting
|
|
+ Bison output files to be licensed under the GNU General Public
|
|
+ License without this special exception.
|
|
|
|
-/* As a special exception, when this file is copied by Bison into a
|
|
- Bison output file, you may use that output file without restriction.
|
|
- This special exception was added by the Free Software Foundation
|
|
- in version 1.24 of Bison. */
|
|
+ This special exception was added by the Free Software Foundation in
|
|
+ version 2.2 of Bison. */
|
|
|
|
-/* Written by Richard Stallman by simplifying the original so called
|
|
- ``semantic'' parser. */
|
|
+/* 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
|
|
@@ -33,8 +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 string. */
|
|
+#define YYBISON_VERSION "3.8.2"
|
|
|
|
/* Skeleton name. */
|
|
#define YYSKELETON_NAME "yacc.c"
|
|
@@ -42,42 +57,16 @@
|
|
/* Pure parsers. */
|
|
#define YYPURE 0
|
|
|
|
-/* Using locations. */
|
|
-#define YYLSP_NEEDED 0
|
|
+/* Push parsers. */
|
|
+#define YYPUSH 0
|
|
|
|
-
|
|
-
|
|
-/* Tokens. */
|
|
-#ifndef YYTOKENTYPE
|
|
-# define YYTOKENTYPE
|
|
- /* Put the tokens into the symbol table, so that GDB and other debuggers
|
|
- know about them. */
|
|
- enum yytokentype {
|
|
- tDAY = 258,
|
|
- tDAYZONE = 259,
|
|
- tMERIDIAN = 260,
|
|
- tMONTH = 261,
|
|
- tMONTH_UNIT = 262,
|
|
- tSEC_UNIT = 263,
|
|
- tSNUMBER = 264,
|
|
- tUNUMBER = 265,
|
|
- tZONE = 266
|
|
- };
|
|
-#endif
|
|
-#define tDAY 258
|
|
-#define tDAYZONE 259
|
|
-#define tMERIDIAN 260
|
|
-#define tMONTH 261
|
|
-#define tMONTH_UNIT 262
|
|
-#define tSEC_UNIT 263
|
|
-#define tSNUMBER 264
|
|
-#define tUNUMBER 265
|
|
-#define tZONE 266
|
|
+/* Pull parsers. */
|
|
+#define YYPULL 1
|
|
|
|
|
|
|
|
|
|
-/* Copy the first part of user declarations. */
|
|
+/* First part of user prologue. */
|
|
#line 1 "parsedate.y"
|
|
|
|
/* $Revision: 1.16 $
|
|
@@ -175,168 +164,481 @@ static time_t yyRelMonth;
|
|
static time_t yyRelSeconds;
|
|
|
|
|
|
-extern struct tm *localtime();
|
|
-static void date_error();
|
|
+static void date_error(char *s);
|
|
+
|
|
+#line 170 "parsedate.c"
|
|
+
|
|
+# 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_CAST(Type, Val) ((Type) (Val))
|
|
+# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
|
|
+# endif
|
|
+# endif
|
|
+# ifndef YY_NULLPTR
|
|
+# if defined __cplusplus
|
|
+# if 201103L <= __cplusplus
|
|
+# define YY_NULLPTR nullptr
|
|
+# else
|
|
+# define YY_NULLPTR 0
|
|
+# endif
|
|
+# else
|
|
+# define YY_NULLPTR ((void*)0)
|
|
+# endif
|
|
+# endif
|
|
|
|
|
|
-/* Enabling traces. */
|
|
+/* Debug traces. */
|
|
#ifndef YYDEBUG
|
|
# define YYDEBUG 0
|
|
#endif
|
|
+#if YYDEBUG
|
|
+extern int yydebug;
|
|
+#endif
|
|
|
|
-/* Enabling verbose error messages. */
|
|
-#ifdef YYERROR_VERBOSE
|
|
-# undef YYERROR_VERBOSE
|
|
-# define YYERROR_VERBOSE 1
|
|
-#else
|
|
-# define YYERROR_VERBOSE 0
|
|
+/* Token kinds. */
|
|
+#ifndef YYTOKENTYPE
|
|
+# define YYTOKENTYPE
|
|
+ enum yytokentype
|
|
+ {
|
|
+ YYEMPTY = -2,
|
|
+ YYEOF = 0, /* "end of file" */
|
|
+ YYerror = 256, /* error */
|
|
+ YYUNDEF = 257, /* "invalid token" */
|
|
+ tDAY = 258, /* tDAY */
|
|
+ tDAYZONE = 259, /* tDAYZONE */
|
|
+ tMERIDIAN = 260, /* tMERIDIAN */
|
|
+ tMONTH = 261, /* tMONTH */
|
|
+ tMONTH_UNIT = 262, /* tMONTH_UNIT */
|
|
+ tSEC_UNIT = 263, /* tSEC_UNIT */
|
|
+ tSNUMBER = 264, /* tSNUMBER */
|
|
+ tUNUMBER = 265, /* tUNUMBER */
|
|
+ tZONE = 266 /* tZONE */
|
|
+ };
|
|
+ typedef enum yytokentype yytoken_kind_t;
|
|
#endif
|
|
+/* Token kinds. */
|
|
+#define YYEMPTY -2
|
|
+#define YYEOF 0
|
|
+#define YYerror 256
|
|
+#define YYUNDEF 257
|
|
+#define tDAY 258
|
|
+#define tDAYZONE 259
|
|
+#define tMERIDIAN 260
|
|
+#define tMONTH 261
|
|
+#define tMONTH_UNIT 262
|
|
+#define tSEC_UNIT 263
|
|
+#define tSNUMBER 264
|
|
+#define tUNUMBER 265
|
|
+#define tZONE 266
|
|
+
|
|
+/* Value type. */
|
|
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
|
+union YYSTYPE
|
|
+{
|
|
+#line 100 "parsedate.y"
|
|
|
|
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
|
|
-#line 101 "parsedate.y"
|
|
-typedef union YYSTYPE {
|
|
time_t Number;
|
|
enum _MERIDIAN Meridian;
|
|
-} YYSTYPE;
|
|
-/* Line 191 of yacc.c. */
|
|
-#line 203 "parsedate.c"
|
|
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
|
-# define YYSTYPE_IS_DECLARED 1
|
|
+
|
|
+#line 247 "parsedate.c"
|
|
+
|
|
+};
|
|
+typedef union YYSTYPE YYSTYPE;
|
|
# define YYSTYPE_IS_TRIVIAL 1
|
|
+# define YYSTYPE_IS_DECLARED 1
|
|
#endif
|
|
|
|
|
|
+extern YYSTYPE yylval;
|
|
+
|
|
+
|
|
+int yyparse (void);
|
|
|
|
-/* Copy the second part of user declarations. */
|
|
|
|
|
|
-/* Line 214 of yacc.c. */
|
|
-#line 215 "parsedate.c"
|
|
+/* Symbol kind. */
|
|
+enum yysymbol_kind_t
|
|
+{
|
|
+ YYSYMBOL_YYEMPTY = -2,
|
|
+ YYSYMBOL_YYEOF = 0, /* "end of file" */
|
|
+ YYSYMBOL_YYerror = 1, /* error */
|
|
+ YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
|
|
+ YYSYMBOL_tDAY = 3, /* tDAY */
|
|
+ YYSYMBOL_tDAYZONE = 4, /* tDAYZONE */
|
|
+ YYSYMBOL_tMERIDIAN = 5, /* tMERIDIAN */
|
|
+ YYSYMBOL_tMONTH = 6, /* tMONTH */
|
|
+ YYSYMBOL_tMONTH_UNIT = 7, /* tMONTH_UNIT */
|
|
+ YYSYMBOL_tSEC_UNIT = 8, /* tSEC_UNIT */
|
|
+ YYSYMBOL_tSNUMBER = 9, /* tSNUMBER */
|
|
+ YYSYMBOL_tUNUMBER = 10, /* tUNUMBER */
|
|
+ YYSYMBOL_tZONE = 11, /* tZONE */
|
|
+ YYSYMBOL_12_ = 12, /* ':' */
|
|
+ YYSYMBOL_13_ = 13, /* '/' */
|
|
+ YYSYMBOL_14_ = 14, /* ',' */
|
|
+ YYSYMBOL_YYACCEPT = 15, /* $accept */
|
|
+ YYSYMBOL_spec = 16, /* spec */
|
|
+ YYSYMBOL_item = 17, /* item */
|
|
+ YYSYMBOL_time = 18, /* time */
|
|
+ YYSYMBOL_zone = 19, /* zone */
|
|
+ YYSYMBOL_numzone = 20, /* numzone */
|
|
+ YYSYMBOL_date = 21, /* date */
|
|
+ YYSYMBOL_rel = 22, /* rel */
|
|
+ YYSYMBOL_o_merid = 23 /* o_merid */
|
|
+};
|
|
+typedef enum yysymbol_kind_t yysymbol_kind_t;
|
|
|
|
-#if ! defined (yyoverflow) || YYERROR_VERBOSE
|
|
|
|
-# ifndef YYFREE
|
|
-# define YYFREE free
|
|
+
|
|
+
|
|
+#ifdef short
|
|
+# undef short
|
|
+#endif
|
|
+
|
|
+/* 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. */
|
|
+
|
|
+#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
|
|
+
|
|
+/* 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 __INT_LEAST16_MAX__
|
|
+typedef __INT_LEAST16_TYPE__ yytype_int16;
|
|
+#elif defined YY_STDINT_H
|
|
+typedef int_least16_t yytype_int16;
|
|
+#else
|
|
+typedef short yytype_int16;
|
|
+#endif
|
|
+
|
|
+/* 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
|
|
+
|
|
+#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_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 <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
|
|
+# ifdef __SIZE_TYPE__
|
|
+# define YYSIZE_T __SIZE_TYPE__
|
|
+# elif defined size_t
|
|
+# define YYSIZE_T size_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
|
|
+# endif
|
|
+#endif
|
|
+
|
|
+#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
|
|
+# if ENABLE_NLS
|
|
+# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
|
|
+# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
|
|
+# endif
|
|
# endif
|
|
-# ifndef YYMALLOC
|
|
-# define YYMALLOC malloc
|
|
+# ifndef YY_
|
|
+# define YY_(Msgid) Msgid
|
|
# endif
|
|
+#endif
|
|
+
|
|
+
|
|
+#ifndef 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
|
|
+# 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 YY_USE(E) ((void) (E))
|
|
+#else
|
|
+# define YY_USE(E) /* empty */
|
|
+#endif
|
|
+
|
|
+/* Suppress an incorrect diagnostic about yylval being uninitialized. */
|
|
+#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\"")
|
|
+# endif
|
|
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
|
|
+ _Pragma ("GCC diagnostic pop")
|
|
+#else
|
|
+# define YY_INITIAL_VALUE(Value) Value
|
|
+#endif
|
|
+#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
|
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
|
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END
|
|
+#endif
|
|
+#ifndef YY_INITIAL_VALUE
|
|
+# 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
|
|
|
|
/* The parser invokes alloca or malloc; define the necessary symbols. */
|
|
|
|
# ifdef YYSTACK_USE_ALLOCA
|
|
# if YYSTACK_USE_ALLOCA
|
|
-# define YYSTACK_ALLOC alloca
|
|
-# endif
|
|
-# else
|
|
-# if defined (alloca) || defined (_ALLOCA_H)
|
|
-# define YYSTACK_ALLOC alloca
|
|
-# else
|
|
# ifdef __GNUC__
|
|
# define YYSTACK_ALLOC __builtin_alloca
|
|
+# elif defined __BUILTIN_VA_ARG_INCR
|
|
+# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
|
|
+# elif defined _AIX
|
|
+# define YYSTACK_ALLOC __alloca
|
|
+# elif defined _MSC_VER
|
|
+# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
|
|
+# define alloca _alloca
|
|
+# else
|
|
+# define YYSTACK_ALLOC alloca
|
|
+# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
|
|
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
|
|
+ /* Use EXIT_SUCCESS as a witness for stdlib.h. */
|
|
+# ifndef EXIT_SUCCESS
|
|
+# define EXIT_SUCCESS 0
|
|
+# endif
|
|
+# endif
|
|
# endif
|
|
# endif
|
|
# endif
|
|
|
|
# ifdef YYSTACK_ALLOC
|
|
- /* Pacify GCC's `empty if-body' warning. */
|
|
+ /* Pacify GCC's 'empty if-body' warning. */
|
|
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
|
|
-# else
|
|
-# if defined (__STDC__) || defined (__cplusplus)
|
|
-# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
|
|
-# define YYSIZE_T size_t
|
|
+# ifndef YYSTACK_ALLOC_MAXIMUM
|
|
+ /* The OS might guarantee only one guard page at the bottom of the stack,
|
|
+ and a page size can be as small as 4096 bytes. So we cannot safely
|
|
+ invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
|
|
+ to allow for a few compiler-allocated temporary stack slots. */
|
|
+# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
|
|
# endif
|
|
+# else
|
|
# define YYSTACK_ALLOC YYMALLOC
|
|
# define YYSTACK_FREE YYFREE
|
|
+# ifndef YYSTACK_ALLOC_MAXIMUM
|
|
+# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
|
|
+# endif
|
|
+# if (defined __cplusplus && ! defined EXIT_SUCCESS \
|
|
+ && ! ((defined YYMALLOC || defined malloc) \
|
|
+ && (defined YYFREE || defined free)))
|
|
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
|
|
+# ifndef EXIT_SUCCESS
|
|
+# define EXIT_SUCCESS 0
|
|
+# endif
|
|
+# endif
|
|
+# ifndef YYMALLOC
|
|
+# define YYMALLOC malloc
|
|
+# if ! defined malloc && ! defined EXIT_SUCCESS
|
|
+void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
|
|
+# endif
|
|
+# endif
|
|
+# ifndef YYFREE
|
|
+# define YYFREE free
|
|
+# if ! defined free && ! defined EXIT_SUCCESS
|
|
+void free (void *); /* INFRINGES ON USER NAME SPACE */
|
|
+# endif
|
|
+# endif
|
|
# endif
|
|
-#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
|
|
-
|
|
+#endif /* !defined yyoverflow */
|
|
|
|
-#if (! defined (yyoverflow) \
|
|
- && (! defined (__cplusplus) \
|
|
- || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
|
|
+#if (! defined yyoverflow \
|
|
+ && (! defined __cplusplus \
|
|
+ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
|
|
|
|
/* A type that is properly aligned for any stack member. */
|
|
union yyalloc
|
|
{
|
|
- short int yyss;
|
|
- YYSTYPE yyvs;
|
|
- };
|
|
+ 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 (short int) + sizeof (YYSTYPE)) \
|
|
+ ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
|
|
+ YYSTACK_GAP_MAXIMUM)
|
|
|
|
-/* Copy COUNT objects from FROM to TO. The source and destination do
|
|
- not overlap. */
|
|
-# ifndef YYCOPY
|
|
-# if defined (__GNUC__) && 1 < __GNUC__
|
|
-# define YYCOPY(To, From, Count) \
|
|
- __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
|
|
-# else
|
|
-# define YYCOPY(To, From, Count) \
|
|
- do \
|
|
- { \
|
|
- register YYSIZE_T yyi; \
|
|
- for (yyi = 0; yyi < (Count); yyi++) \
|
|
- (To)[yyi] = (From)[yyi]; \
|
|
- } \
|
|
- while (0)
|
|
-# endif
|
|
-# endif
|
|
+# define YYCOPY_NEEDED 1
|
|
|
|
/* Relocate STACK from its old location to the new one. The
|
|
local variables YYSIZE and YYSTACKSIZE give the old and new number of
|
|
elements in the stack, and YYPTR gives the new location of the
|
|
stack. Advance YYPTR to a properly aligned location for the next
|
|
stack. */
|
|
-# define YYSTACK_RELOCATE(Stack) \
|
|
- do \
|
|
- { \
|
|
- YYSIZE_T yynewbytes; \
|
|
- YYCOPY (&yyptr->Stack, Stack, yysize); \
|
|
- Stack = &yyptr->Stack; \
|
|
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
|
|
- yyptr += yynewbytes / sizeof (*yyptr); \
|
|
- } \
|
|
+# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
|
|
+ do \
|
|
+ { \
|
|
+ YYPTRDIFF_T yynewbytes; \
|
|
+ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
|
|
+ Stack = &yyptr->Stack_alloc; \
|
|
+ yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
|
|
+ yyptr += yynewbytes / YYSIZEOF (*yyptr); \
|
|
+ } \
|
|
while (0)
|
|
|
|
#endif
|
|
|
|
-#if defined (__STDC__) || defined (__cplusplus)
|
|
- typedef signed char yysigned_char;
|
|
-#else
|
|
- typedef short int yysigned_char;
|
|
-#endif
|
|
+#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
|
|
+/* Copy COUNT objects from SRC to DST. The source and destination do
|
|
+ not overlap. */
|
|
+# ifndef YYCOPY
|
|
+# if defined __GNUC__ && 1 < __GNUC__
|
|
+# define YYCOPY(Dst, Src, Count) \
|
|
+ __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
|
|
+# else
|
|
+# define YYCOPY(Dst, Src, Count) \
|
|
+ do \
|
|
+ { \
|
|
+ YYPTRDIFF_T yyi; \
|
|
+ for (yyi = 0; yyi < (Count); yyi++) \
|
|
+ (Dst)[yyi] = (Src)[yyi]; \
|
|
+ } \
|
|
+ while (0)
|
|
+# endif
|
|
+# endif
|
|
+#endif /* !YYCOPY_NEEDED */
|
|
|
|
-/* YYFINAL -- State number of the termination state. */
|
|
+/* YYFINAL -- State number of the termination state. */
|
|
#define YYFINAL 2
|
|
/* YYLAST -- Last index in YYTABLE. */
|
|
#define YYLAST 40
|
|
|
|
-/* YYNTOKENS -- Number of terminals. */
|
|
+/* YYNTOKENS -- Number of terminals. */
|
|
#define YYNTOKENS 15
|
|
-/* YYNNTS -- Number of nonterminals. */
|
|
+/* YYNNTS -- Number of nonterminals. */
|
|
#define YYNNTS 9
|
|
-/* YYNRULES -- Number of rules. */
|
|
+/* YYNRULES -- Number of rules. */
|
|
#define YYNRULES 30
|
|
-/* YYNRULES -- Number of states. */
|
|
+/* YYNSTATES -- Number of states. */
|
|
#define YYNSTATES 44
|
|
|
|
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
|
|
-#define YYUNDEFTOK 2
|
|
+/* YYMAXUTOK -- Last valid token kind. */
|
|
#define YYMAXUTOK 266
|
|
|
|
-#define YYTRANSLATE(YYX) \
|
|
- ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
|
|
|
|
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
|
|
-static const unsigned char yytranslate[] =
|
|
+/* 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. */
|
|
+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,
|
|
@@ -368,103 +670,54 @@ static const unsigned char yytranslate[] =
|
|
};
|
|
|
|
#if YYDEBUG
|
|
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
|
|
- YYRHS. */
|
|
-static const unsigned char yyprhs[] =
|
|
+/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
|
|
+static const yytype_int16 yyrline[] =
|
|
{
|
|
- 0, 0, 3, 4, 7, 9, 12, 14, 16, 19,
|
|
- 24, 29, 36, 43, 45, 47, 50, 52, 54, 58,
|
|
- 64, 67, 72, 75, 79, 85, 88, 91, 94, 97,
|
|
- 98
|
|
+ 0, 114, 114, 115, 118, 127, 131, 134, 139, 151,
|
|
+ 157, 164, 170, 180, 184, 188, 196, 202, 223, 227,
|
|
+ 239, 243, 248, 252, 257, 264, 267, 270, 273, 278,
|
|
+ 281
|
|
};
|
|
+#endif
|
|
|
|
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
|
|
-static const yysigned_char yyrhs[] =
|
|
-{
|
|
- 16, 0, -1, -1, 16, 17, -1, 18, -1, 18,
|
|
- 19, -1, 21, -1, 22, -1, 10, 23, -1, 10,
|
|
- 12, 10, 23, -1, 10, 12, 10, 20, -1, 10,
|
|
- 12, 10, 12, 10, 23, -1, 10, 12, 10, 12,
|
|
- 10, 20, -1, 11, -1, 4, -1, 11, 20, -1,
|
|
- 20, -1, 9, -1, 10, 13, 10, -1, 10, 13,
|
|
- 10, 13, 10, -1, 6, 10, -1, 6, 10, 14,
|
|
- 10, -1, 10, 6, -1, 10, 6, 10, -1, 3,
|
|
- 14, 10, 6, 10, -1, 9, 8, -1, 10, 8,
|
|
- -1, 9, 7, -1, 10, 7, -1, -1, 5, -1
|
|
-};
|
|
+/** Accessing symbol of state STATE. */
|
|
+#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
|
|
|
|
-/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
|
|
-static const unsigned short int yyrline[] =
|
|
-{
|
|
- 0, 115, 115, 116, 119, 128, 132, 135, 140, 152,
|
|
- 158, 165, 171, 181, 185, 189, 197, 203, 224, 228,
|
|
- 240, 244, 249, 253, 258, 265, 268, 271, 274, 279,
|
|
- 282
|
|
-};
|
|
-#endif
|
|
+#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;
|
|
|
|
-#if YYDEBUG || YYERROR_VERBOSE
|
|
-/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
|
|
- First, the terminals, then, starting at YYNTOKENS, nonterminals. */
|
|
+/* 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", "tDAY", "tDAYZONE", "tMERIDIAN",
|
|
- "tMONTH", "tMONTH_UNIT", "tSEC_UNIT", "tSNUMBER", "tUNUMBER", "tZONE",
|
|
- "':'", "'/'", "','", "$accept", "spec", "item", "time", "zone",
|
|
- "numzone", "date", "rel", "o_merid", 0
|
|
+ "\"end of file\"", "error", "\"invalid token\"", "tDAY", "tDAYZONE",
|
|
+ "tMERIDIAN", "tMONTH", "tMONTH_UNIT", "tSEC_UNIT", "tSNUMBER",
|
|
+ "tUNUMBER", "tZONE", "':'", "'/'", "','", "$accept", "spec", "item",
|
|
+ "time", "zone", "numzone", "date", "rel", "o_merid", YY_NULLPTR
|
|
};
|
|
-#endif
|
|
|
|
-# ifdef YYPRINT
|
|
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
|
|
- token YYLEX-NUM. */
|
|
-static const unsigned short int yytoknum[] =
|
|
+static const char *
|
|
+yysymbol_name (yysymbol_kind_t yysymbol)
|
|
{
|
|
- 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
|
|
- 265, 266, 58, 47, 44
|
|
-};
|
|
-# endif
|
|
+ return yytname[yysymbol];
|
|
+}
|
|
+#endif
|
|
|
|
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
|
|
-static const unsigned char yyr1[] =
|
|
-{
|
|
- 0, 15, 16, 16, 17, 17, 17, 17, 18, 18,
|
|
- 18, 18, 18, 19, 19, 19, 19, 20, 21, 21,
|
|
- 21, 21, 21, 21, 21, 22, 22, 22, 22, 23,
|
|
- 23
|
|
-};
|
|
+#define YYPACT_NINF (-29)
|
|
|
|
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
|
|
-static const unsigned char yyr2[] =
|
|
-{
|
|
- 0, 2, 0, 2, 1, 2, 1, 1, 2, 4,
|
|
- 4, 6, 6, 1, 1, 2, 1, 1, 3, 5,
|
|
- 2, 4, 2, 3, 5, 2, 2, 2, 2, 0,
|
|
- 1
|
|
-};
|
|
+#define yypact_value_is_default(Yyn) \
|
|
+ ((Yyn) == YYPACT_NINF)
|
|
|
|
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
|
|
- STATE-NUM when YYTABLE doesn't specify something else to do. Zero
|
|
- means the default is an error. */
|
|
-static const unsigned char yydefact[] =
|
|
-{
|
|
- 2, 0, 1, 0, 0, 0, 29, 3, 4, 6,
|
|
- 7, 0, 20, 27, 25, 30, 22, 28, 26, 0,
|
|
- 0, 8, 14, 17, 13, 5, 16, 0, 0, 23,
|
|
- 29, 18, 15, 0, 21, 0, 10, 9, 0, 24,
|
|
- 29, 19, 12, 11
|
|
-};
|
|
+#define YYTABLE_NINF (-1)
|
|
|
|
-/* YYDEFGOTO[NTERM-NUM]. */
|
|
-static const yysigned_char yydefgoto[] =
|
|
-{
|
|
- -1, 1, 7, 8, 25, 26, 9, 10, 21
|
|
-};
|
|
+#define yytable_value_is_error(Yyn) \
|
|
+ 0
|
|
|
|
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
|
|
STATE-NUM. */
|
|
-#define YYPACT_NINF -29
|
|
-static const yysigned_char yypact[] =
|
|
+static const yytype_int8 yypact[] =
|
|
{
|
|
-29, 1, -29, -11, 11, 20, 12, -29, 4, -29,
|
|
-29, 13, 16, -29, -29, -29, 21, -29, -29, 22,
|
|
@@ -473,18 +726,34 @@ static const yysigned_char yypact[] =
|
|
0, -29, -29, -29
|
|
};
|
|
|
|
+/* 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, 1, 0, 0, 0, 29, 3, 4, 6,
|
|
+ 7, 0, 20, 27, 25, 30, 22, 28, 26, 0,
|
|
+ 0, 8, 14, 17, 13, 5, 16, 0, 0, 23,
|
|
+ 29, 18, 15, 0, 21, 0, 10, 9, 0, 24,
|
|
+ 29, 19, 12, 11
|
|
+};
|
|
+
|
|
/* YYPGOTO[NTERM-NUM]. */
|
|
-static const yysigned_char yypgoto[] =
|
|
+static const yytype_int8 yypgoto[] =
|
|
{
|
|
-29, -29, -29, -29, -29, -24, -29, -29, -28
|
|
};
|
|
|
|
-/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
|
|
- positive, shift that token. If negative, reduce the rule which
|
|
- number is the opposite. If zero, do what YYDEFACT says.
|
|
- If YYTABLE_NINF, syntax error. */
|
|
-#define YYTABLE_NINF -1
|
|
-static const unsigned char yytable[] =
|
|
+/* YYDEFGOTO[NTERM-NUM]. */
|
|
+static const yytype_int8 yydefgoto[] =
|
|
+{
|
|
+ 0, 1, 7, 8, 25, 26, 9, 10, 21
|
|
+};
|
|
+
|
|
+/* 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[] =
|
|
{
|
|
32, 2, 37, 11, 3, 15, 36, 4, 22, 23,
|
|
5, 6, 43, 23, 23, 24, 42, 15, 16, 17,
|
|
@@ -493,7 +762,7 @@ static const unsigned char yytable[] =
|
|
41
|
|
};
|
|
|
|
-static const yysigned_char yycheck[] =
|
|
+static const yytype_int8 yycheck[] =
|
|
{
|
|
24, 0, 30, 14, 3, 5, 30, 6, 4, 9,
|
|
9, 10, 40, 9, 9, 11, 40, 5, 6, 7,
|
|
@@ -502,9 +771,9 @@ static const yysigned_char yycheck[] =
|
|
10
|
|
};
|
|
|
|
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
|
|
- symbol of state STATE-NUM. */
|
|
-static const unsigned char yystos[] =
|
|
+/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
|
|
+ state STATE-NUM. */
|
|
+static const yytype_int8 yystos[] =
|
|
{
|
|
0, 16, 0, 3, 6, 9, 10, 17, 18, 21,
|
|
22, 14, 10, 7, 8, 5, 6, 7, 8, 12,
|
|
@@ -513,78 +782,59 @@ static const unsigned char yystos[] =
|
|
10, 10, 20, 23
|
|
};
|
|
|
|
-#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
|
|
-# define YYSIZE_T __SIZE_TYPE__
|
|
-#endif
|
|
-#if ! defined (YYSIZE_T) && defined (size_t)
|
|
-# define YYSIZE_T size_t
|
|
-#endif
|
|
-#if ! defined (YYSIZE_T)
|
|
-# if defined (__STDC__) || defined (__cplusplus)
|
|
-# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
|
|
-# define YYSIZE_T size_t
|
|
-# endif
|
|
-#endif
|
|
-#if ! defined (YYSIZE_T)
|
|
-# define YYSIZE_T unsigned int
|
|
-#endif
|
|
+/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
|
|
+static const yytype_int8 yyr1[] =
|
|
+{
|
|
+ 0, 15, 16, 16, 17, 17, 17, 17, 18, 18,
|
|
+ 18, 18, 18, 19, 19, 19, 19, 20, 21, 21,
|
|
+ 21, 21, 21, 21, 21, 22, 22, 22, 22, 23,
|
|
+ 23
|
|
+};
|
|
+
|
|
+/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
|
|
+static const yytype_int8 yyr2[] =
|
|
+{
|
|
+ 0, 2, 0, 2, 1, 2, 1, 1, 2, 4,
|
|
+ 4, 6, 6, 1, 1, 2, 1, 1, 3, 5,
|
|
+ 2, 4, 2, 3, 5, 2, 2, 2, 2, 0,
|
|
+ 1
|
|
+};
|
|
|
|
-#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
|
|
+enum { YYENOMEM = -2 };
|
|
|
|
+#define yyerrok (yyerrstatus = 0)
|
|
+#define yyclearin (yychar = YYEMPTY)
|
|
|
|
-/* Like YYERROR except do call yyerror. This remains here temporarily
|
|
- to ease the transition to the new meaning of YYERROR, for GCC.
|
|
- Once GCC version 2 has supplanted version 1, this can go. */
|
|
+#define YYACCEPT goto yyacceptlab
|
|
+#define YYABORT goto yyabortlab
|
|
+#define YYERROR goto yyerrorlab
|
|
+#define YYNOMEM goto yyexhaustedlab
|
|
|
|
-#define YYFAIL goto yyerrlab
|
|
|
|
#define YYRECOVERING() (!!yyerrstatus)
|
|
|
|
-#define YYBACKUP(Token, Value) \
|
|
-do \
|
|
- if (yychar == YYEMPTY && yylen == 1) \
|
|
- { \
|
|
- yychar = (Token); \
|
|
- yylval = (Value); \
|
|
- yytoken = YYTRANSLATE (yychar); \
|
|
- YYPOPSTACK; \
|
|
- goto yybackup; \
|
|
- } \
|
|
- else \
|
|
- { \
|
|
- yyerror ("syntax error: cannot back up");\
|
|
- YYERROR; \
|
|
- } \
|
|
-while (0)
|
|
-
|
|
-#define YYTERROR 1
|
|
-#define YYERRCODE 256
|
|
-
|
|
-/* YYLLOC_DEFAULT -- Compute the default location (before the actions
|
|
- are run). */
|
|
-
|
|
-#ifndef YYLLOC_DEFAULT
|
|
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
|
- ((Current).first_line = (Rhs)[1].first_line, \
|
|
- (Current).first_column = (Rhs)[1].first_column, \
|
|
- (Current).last_line = (Rhs)[N].last_line, \
|
|
- (Current).last_column = (Rhs)[N].last_column)
|
|
-#endif
|
|
+#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)
|
|
+
|
|
+/* Backward compatibility with an undocumented macro.
|
|
+ Use YYerror or YYUNDEF. */
|
|
+#define YYERRCODE YYUNDEF
|
|
|
|
-/* YYLEX -- calling `yylex' with the right arguments. */
|
|
-
|
|
-#ifdef YYLEX_PARAM
|
|
-# define YYLEX yylex (YYLEX_PARAM)
|
|
-#else
|
|
-# define YYLEX yylex ()
|
|
-#endif
|
|
|
|
/* Enable debugging if requested. */
|
|
#if YYDEBUG
|
|
@@ -594,54 +844,81 @@ while (0)
|
|
# define YYFPRINTF fprintf
|
|
# endif
|
|
|
|
-# define YYDPRINTF(Args) \
|
|
-do { \
|
|
- if (yydebug) \
|
|
- YYFPRINTF Args; \
|
|
+# define YYDPRINTF(Args) \
|
|
+do { \
|
|
+ if (yydebug) \
|
|
+ YYFPRINTF Args; \
|
|
} while (0)
|
|
|
|
-# define YYDSYMPRINT(Args) \
|
|
-do { \
|
|
- if (yydebug) \
|
|
- yysymprint Args; \
|
|
-} while (0)
|
|
|
|
-# define YYDSYMPRINTF(Title, Token, Value, Location) \
|
|
-do { \
|
|
- if (yydebug) \
|
|
- { \
|
|
- YYFPRINTF (stderr, "%s ", Title); \
|
|
- yysymprint (stderr, \
|
|
- Token, Value); \
|
|
- YYFPRINTF (stderr, "\n"); \
|
|
- } \
|
|
+
|
|
+
|
|
+# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
|
|
+do { \
|
|
+ if (yydebug) \
|
|
+ { \
|
|
+ YYFPRINTF (stderr, "%s ", Title); \
|
|
+ yy_symbol_print (stderr, \
|
|
+ Kind, Value); \
|
|
+ YYFPRINTF (stderr, "\n"); \
|
|
+ } \
|
|
} while (0)
|
|
|
|
+
|
|
+/*-----------------------------------.
|
|
+| Print this symbol's value on YYO. |
|
|
+`-----------------------------------*/
|
|
+
|
|
+static void
|
|
+yy_symbol_value_print (FILE *yyo,
|
|
+ yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
|
|
+{
|
|
+ FILE *yyoutput = yyo;
|
|
+ YY_USE (yyoutput);
|
|
+ if (!yyvaluep)
|
|
+ return;
|
|
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
|
+ YY_USE (yykind);
|
|
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
|
|
+}
|
|
+
|
|
+
|
|
+/*---------------------------.
|
|
+| Print this symbol on YYO. |
|
|
+`---------------------------*/
|
|
+
|
|
+static void
|
|
+yy_symbol_print (FILE *yyo,
|
|
+ yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
|
|
+{
|
|
+ YYFPRINTF (yyo, "%s %s (",
|
|
+ yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
|
|
+
|
|
+ yy_symbol_value_print (yyo, yykind, yyvaluep);
|
|
+ YYFPRINTF (yyo, ")");
|
|
+}
|
|
+
|
|
/*------------------------------------------------------------------.
|
|
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
|
|
| TOP (included). |
|
|
`------------------------------------------------------------------*/
|
|
|
|
-#if defined (__STDC__) || defined (__cplusplus)
|
|
static void
|
|
-yy_stack_print (short int *bottom, short int *top)
|
|
-#else
|
|
-static void
|
|
-yy_stack_print (bottom, top)
|
|
- short int *bottom;
|
|
- short int *top;
|
|
-#endif
|
|
+yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
|
|
{
|
|
YYFPRINTF (stderr, "Stack now");
|
|
- for (/* Nothing. */; bottom <= top; ++bottom)
|
|
- YYFPRINTF (stderr, " %d", *bottom);
|
|
+ for (; yybottom <= yytop; yybottom++)
|
|
+ {
|
|
+ int yybot = *yybottom;
|
|
+ YYFPRINTF (stderr, " %d", yybot);
|
|
+ }
|
|
YYFPRINTF (stderr, "\n");
|
|
}
|
|
|
|
-# define YY_STACK_PRINT(Bottom, Top) \
|
|
-do { \
|
|
- if (yydebug) \
|
|
- yy_stack_print ((Bottom), (Top)); \
|
|
+# define YY_STACK_PRINT(Bottom, Top) \
|
|
+do { \
|
|
+ if (yydebug) \
|
|
+ yy_stack_print ((Bottom), (Top)); \
|
|
} while (0)
|
|
|
|
|
|
@@ -649,45 +926,45 @@ do { \
|
|
| Report that the YYRULE is going to be reduced. |
|
|
`------------------------------------------------*/
|
|
|
|
-#if defined (__STDC__) || defined (__cplusplus)
|
|
-static void
|
|
-yy_reduce_print (int yyrule)
|
|
-#else
|
|
static void
|
|
-yy_reduce_print (yyrule)
|
|
- int yyrule;
|
|
-#endif
|
|
+yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
|
|
+ int yyrule)
|
|
{
|
|
+ int yylno = yyrline[yyrule];
|
|
+ int yynrhs = yyr2[yyrule];
|
|
int yyi;
|
|
- unsigned int yylno = yyrline[yyrule];
|
|
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
|
|
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
|
|
yyrule - 1, yylno);
|
|
- /* Print the symbols being reduced, and their result. */
|
|
- for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
|
|
- YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
|
|
- YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
|
|
+ /* The symbols being reduced. */
|
|
+ for (yyi = 0; yyi < yynrhs; yyi++)
|
|
+ {
|
|
+ YYFPRINTF (stderr, " $%d = ", yyi + 1);
|
|
+ yy_symbol_print (stderr,
|
|
+ YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
|
|
+ &yyvsp[(yyi + 1) - (yynrhs)]);
|
|
+ YYFPRINTF (stderr, "\n");
|
|
+ }
|
|
}
|
|
|
|
-# define YY_REDUCE_PRINT(Rule) \
|
|
-do { \
|
|
- if (yydebug) \
|
|
- yy_reduce_print (Rule); \
|
|
+# define YY_REDUCE_PRINT(Rule) \
|
|
+do { \
|
|
+ if (yydebug) \
|
|
+ yy_reduce_print (yyssp, yyvsp, Rule); \
|
|
} while (0)
|
|
|
|
/* Nonzero means print parse trace. It is left uninitialized so that
|
|
multiple parsers can coexist. */
|
|
int yydebug;
|
|
#else /* !YYDEBUG */
|
|
-# define YYDPRINTF(Args)
|
|
-# define YYDSYMPRINT(Args)
|
|
-# define YYDSYMPRINTF(Title, Token, 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 */
|
|
|
|
|
|
/* YYINITDEPTH -- initial size of the parser's stacks. */
|
|
-#ifndef YYINITDEPTH
|
|
+#ifndef YYINITDEPTH
|
|
# define YYINITDEPTH 200
|
|
#endif
|
|
|
|
@@ -695,363 +972,230 @@ int yydebug;
|
|
if the built-in stack extension method is used).
|
|
|
|
Do not make this value too large; the results are undefined if
|
|
- SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
|
|
+ YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
|
|
evaluated with infinite-precision integer arithmetic. */
|
|
|
|
-#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
|
|
-# undef YYMAXDEPTH
|
|
-#endif
|
|
-
|
|
#ifndef YYMAXDEPTH
|
|
# define YYMAXDEPTH 10000
|
|
#endif
|
|
|
|
-
|
|
|
|
-#if YYERROR_VERBOSE
|
|
-
|
|
-# ifndef yystrlen
|
|
-# if defined (__GLIBC__) && defined (_STRING_H)
|
|
-# define yystrlen strlen
|
|
-# else
|
|
-/* Return the length of YYSTR. */
|
|
-static YYSIZE_T
|
|
-# if defined (__STDC__) || defined (__cplusplus)
|
|
-yystrlen (const char *yystr)
|
|
-# else
|
|
-yystrlen (yystr)
|
|
- const char *yystr;
|
|
-# endif
|
|
-{
|
|
- register const char *yys = yystr;
|
|
|
|
- while (*yys++ != '\0')
|
|
- continue;
|
|
|
|
- return yys - yystr - 1;
|
|
-}
|
|
-# 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 *
|
|
-# if defined (__STDC__) || defined (__cplusplus)
|
|
-yystpcpy (char *yydest, const char *yysrc)
|
|
-# else
|
|
-yystpcpy (yydest, yysrc)
|
|
- char *yydest;
|
|
- const char *yysrc;
|
|
-# endif
|
|
-{
|
|
- register char *yyd = yydest;
|
|
- register const char *yys = yysrc;
|
|
-
|
|
- while ((*yyd++ = *yys++) != '\0')
|
|
- continue;
|
|
-
|
|
- return yyd - 1;
|
|
-}
|
|
-# endif
|
|
-# endif
|
|
|
|
-#endif /* !YYERROR_VERBOSE */
|
|
|
|
-
|
|
-
|
|
-#if YYDEBUG
|
|
-/*--------------------------------.
|
|
-| Print this symbol on YYOUTPUT. |
|
|
-`--------------------------------*/
|
|
-
|
|
-#if defined (__STDC__) || defined (__cplusplus)
|
|
-static void
|
|
-yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
|
|
-#else
|
|
-static void
|
|
-yysymprint (yyoutput, yytype, yyvaluep)
|
|
- FILE *yyoutput;
|
|
- int yytype;
|
|
- YYSTYPE *yyvaluep;
|
|
-#endif
|
|
-{
|
|
- /* Pacify ``unused variable'' warnings. */
|
|
- (void) yyvaluep;
|
|
-
|
|
- if (yytype < YYNTOKENS)
|
|
- {
|
|
- YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
|
|
-# ifdef YYPRINT
|
|
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
|
|
-# endif
|
|
- }
|
|
- else
|
|
- YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
|
|
-
|
|
- switch (yytype)
|
|
- {
|
|
- default:
|
|
- break;
|
|
- }
|
|
- YYFPRINTF (yyoutput, ")");
|
|
-}
|
|
-
|
|
-#endif /* ! YYDEBUG */
|
|
/*-----------------------------------------------.
|
|
| Release the memory associated to this symbol. |
|
|
`-----------------------------------------------*/
|
|
|
|
-#if defined (__STDC__) || defined (__cplusplus)
|
|
static void
|
|
-yydestruct (int yytype, YYSTYPE *yyvaluep)
|
|
-#else
|
|
-static void
|
|
-yydestruct (yytype, yyvaluep)
|
|
- int yytype;
|
|
- YYSTYPE *yyvaluep;
|
|
-#endif
|
|
+yydestruct (const char *yymsg,
|
|
+ yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
|
|
{
|
|
- /* Pacify ``unused variable'' warnings. */
|
|
- (void) yyvaluep;
|
|
-
|
|
- switch (yytype)
|
|
- {
|
|
-
|
|
- default:
|
|
- break;
|
|
- }
|
|
+ YY_USE (yyvaluep);
|
|
+ if (!yymsg)
|
|
+ yymsg = "Deleting";
|
|
+ YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
|
|
+
|
|
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
|
+ YY_USE (yykind);
|
|
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
|
|
}
|
|
-
|
|
-
|
|
-/* Prevent warnings from -Wmissing-prototypes. */
|
|
-
|
|
-#ifdef YYPARSE_PARAM
|
|
-# if defined (__STDC__) || defined (__cplusplus)
|
|
-int yyparse (void *YYPARSE_PARAM);
|
|
-# else
|
|
-int yyparse ();
|
|
-# endif
|
|
-#else /* ! YYPARSE_PARAM */
|
|
-#if defined (__STDC__) || defined (__cplusplus)
|
|
-int yyparse (void);
|
|
-#else
|
|
-int yyparse ();
|
|
-#endif
|
|
-#endif /* ! YYPARSE_PARAM */
|
|
-
|
|
|
|
|
|
-/* The lookahead symbol. */
|
|
+/* Lookahead token kind. */
|
|
int yychar;
|
|
|
|
/* The semantic value of the lookahead symbol. */
|
|
YYSTYPE yylval;
|
|
-
|
|
/* Number of syntax errors so far. */
|
|
int yynerrs;
|
|
|
|
|
|
|
|
+
|
|
/*----------.
|
|
| yyparse. |
|
|
`----------*/
|
|
|
|
-#ifdef YYPARSE_PARAM
|
|
-# if defined (__STDC__) || defined (__cplusplus)
|
|
-int yyparse (void *YYPARSE_PARAM)
|
|
-# else
|
|
-int yyparse (YYPARSE_PARAM)
|
|
- void *YYPARSE_PARAM;
|
|
-# endif
|
|
-#else /* ! YYPARSE_PARAM */
|
|
-#if defined (__STDC__) || defined (__cplusplus)
|
|
int
|
|
yyparse (void)
|
|
-#else
|
|
-int
|
|
-yyparse ()
|
|
-
|
|
-#endif
|
|
-#endif
|
|
{
|
|
-
|
|
- register int yystate;
|
|
- register int yyn;
|
|
- int yyresult;
|
|
- /* Number of tokens to shift before error messages enabled. */
|
|
- int yyerrstatus;
|
|
- /* Lookahead token as an internal (translated) token number. */
|
|
- int yytoken = 0;
|
|
-
|
|
- /* Three stacks and their tools:
|
|
- `yyss': related to states,
|
|
- `yyvs': related to semantic values,
|
|
- `yyls': related to locations.
|
|
-
|
|
- Refer to the stacks thru separate pointers, to allow yyoverflow
|
|
- to reallocate them elsewhere. */
|
|
+ yy_state_fast_t yystate = 0;
|
|
+ /* Number of tokens to shift before error messages enabled. */
|
|
+ int yyerrstatus = 0;
|
|
|
|
- /* The state stack. */
|
|
- short int yyssa[YYINITDEPTH];
|
|
- short int *yyss = yyssa;
|
|
- register short int *yyssp;
|
|
+ /* Refer to the stacks through separate pointers, to allow yyoverflow
|
|
+ to reallocate them elsewhere. */
|
|
|
|
- /* The semantic value stack. */
|
|
- YYSTYPE yyvsa[YYINITDEPTH];
|
|
- YYSTYPE *yyvs = yyvsa;
|
|
- register YYSTYPE *yyvsp;
|
|
+ /* Their size. */
|
|
+ YYPTRDIFF_T yystacksize = YYINITDEPTH;
|
|
|
|
+ /* The state stack: array, bottom, top. */
|
|
+ yy_state_t yyssa[YYINITDEPTH];
|
|
+ yy_state_t *yyss = yyssa;
|
|
+ yy_state_t *yyssp = yyss;
|
|
|
|
+ /* The semantic value stack: array, bottom, top. */
|
|
+ YYSTYPE yyvsa[YYINITDEPTH];
|
|
+ YYSTYPE *yyvs = yyvsa;
|
|
+ YYSTYPE *yyvsp = yyvs;
|
|
|
|
-#define YYPOPSTACK (yyvsp--, yyssp--)
|
|
-
|
|
- YYSIZE_T yystacksize = YYINITDEPTH;
|
|
-
|
|
+ int yyn;
|
|
+ /* The return value of yyparse. */
|
|
+ int yyresult;
|
|
+ /* Lookahead symbol kind. */
|
|
+ yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
|
|
/* The variables used to return semantic value and location from the
|
|
action routines. */
|
|
YYSTYPE yyval;
|
|
|
|
|
|
- /* When reducing, the number of symbols on the RHS of the reduced
|
|
- rule. */
|
|
- int yylen;
|
|
|
|
- YYDPRINTF ((stderr, "Starting parse\n"));
|
|
-
|
|
- yystate = 0;
|
|
- yyerrstatus = 0;
|
|
- yynerrs = 0;
|
|
- yychar = YYEMPTY; /* Cause a token to be read. */
|
|
+#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
|
|
|
|
- /* Initialize stack pointers.
|
|
- Waste one element of value and location stack
|
|
- so that they stay on the same level as the state stack.
|
|
- The wasted elements are never initialized. */
|
|
+ /* The number of symbols on the RHS of the reduced rule.
|
|
+ Keep to zero when no symbol should be popped. */
|
|
+ int yylen = 0;
|
|
|
|
- yyssp = yyss;
|
|
- yyvsp = yyvs;
|
|
+ YYDPRINTF ((stderr, "Starting parse\n"));
|
|
|
|
+ yychar = YYEMPTY; /* 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.
|
|
- */
|
|
+ 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. */
|
|
- YYSTYPE *yyvs1 = yyvs;
|
|
- short int *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 ("parser stack overflow",
|
|
- &yyss1, yysize * sizeof (*yyssp),
|
|
- &yyvs1, yysize * sizeof (*yyvsp),
|
|
-
|
|
- &yystacksize);
|
|
-
|
|
- yyss = yyss1;
|
|
- yyvs = yyvs1;
|
|
+ /* 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;
|
|
+
|
|
+ /* 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 * YYSIZEOF (*yyssp),
|
|
+ &yyvs1, yysize * YYSIZEOF (*yyvsp),
|
|
+ &yystacksize);
|
|
+ yyss = yyss1;
|
|
+ yyvs = yyvs1;
|
|
}
|
|
-#else /* no yyoverflow */
|
|
-# ifndef YYSTACK_RELOCATE
|
|
- goto yyoverflowlab;
|
|
-# else
|
|
+# else /* defined YYSTACK_RELOCATE */
|
|
/* Extend the stack our own way. */
|
|
if (YYMAXDEPTH <= yystacksize)
|
|
- goto yyoverflowlab;
|
|
+ YYNOMEM;
|
|
yystacksize *= 2;
|
|
if (YYMAXDEPTH < yystacksize)
|
|
- yystacksize = YYMAXDEPTH;
|
|
+ yystacksize = YYMAXDEPTH;
|
|
|
|
{
|
|
- short int *yyss1 = yyss;
|
|
- union yyalloc *yyptr =
|
|
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
|
|
- if (! yyptr)
|
|
- goto yyoverflowlab;
|
|
- YYSTACK_RELOCATE (yyss);
|
|
- YYSTACK_RELOCATE (yyvs);
|
|
-
|
|
+ yy_state_t *yyss1 = yyss;
|
|
+ union yyalloc *yyptr =
|
|
+ YY_CAST (union yyalloc *,
|
|
+ YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
|
|
+ if (! yyptr)
|
|
+ YYNOMEM;
|
|
+ YYSTACK_RELOCATE (yyss_alloc, yyss);
|
|
+ YYSTACK_RELOCATE (yyvs_alloc, yyvs);
|
|
# undef YYSTACK_RELOCATE
|
|
- if (yyss1 != yyssa)
|
|
- YYSTACK_FREE (yyss1);
|
|
+ if (yyss1 != yyssa)
|
|
+ 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;
|
|
+ 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. */
|
|
-/* yyresume: */
|
|
+ /* Do appropriate processing given the current state. Read a
|
|
+ lookahead token if we need one and don't already have one. */
|
|
|
|
/* First try to decide what to do without reference to lookahead token. */
|
|
-
|
|
yyn = yypact[yystate];
|
|
- if (yyn == YYPACT_NINF)
|
|
+ if (yypact_value_is_default (yyn))
|
|
goto yydefault;
|
|
|
|
/* 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: "));
|
|
- yychar = YYLEX;
|
|
+ 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);
|
|
- YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
|
|
+ YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
|
|
}
|
|
|
|
/* If the proper action on seeing token YYTOKEN is to reduce or to
|
|
@@ -1062,31 +1206,26 @@ yybackup:
|
|
yyn = yytable[yyn];
|
|
if (yyn <= 0)
|
|
{
|
|
- if (yyn == 0 || yyn == YYTABLE_NINF)
|
|
- goto yyerrlab;
|
|
+ if (yytable_value_is_error (yyn))
|
|
+ goto yyerrlab;
|
|
yyn = -yyn;
|
|
goto yyreduce;
|
|
}
|
|
|
|
- if (yyn == YYFINAL)
|
|
- YYACCEPT;
|
|
-
|
|
- /* Shift the lookahead token. */
|
|
- YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
|
|
-
|
|
- /* Discard the token being shifted unless it is eof. */
|
|
- if (yychar != YYEOF)
|
|
- yychar = YYEMPTY;
|
|
-
|
|
- *++yyvsp = yylval;
|
|
-
|
|
-
|
|
/* Count tokens shifted since error; after three, turn off error
|
|
status. */
|
|
if (yyerrstatus)
|
|
yyerrstatus--;
|
|
|
|
+ /* Shift the lookahead token. */
|
|
+ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
|
|
yystate = yyn;
|
|
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
|
+ *++yyvsp = yylval;
|
|
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
|
|
+
|
|
+ /* Discard the shifted token. */
|
|
+ yychar = YYEMPTY;
|
|
goto yynewstate;
|
|
|
|
|
|
@@ -1101,14 +1240,14 @@ yydefault:
|
|
|
|
|
|
/*-----------------------------.
|
|
-| yyreduce -- Do a reduction. |
|
|
+| yyreduce -- do a reduction. |
|
|
`-----------------------------*/
|
|
yyreduce:
|
|
/* yyn is the number of a rule to reduce with. */
|
|
yylen = yyr2[yyn];
|
|
|
|
/* If YYLEN is nonzero, implement the default value of the action:
|
|
- `$$ = $1'.
|
|
+ '$$ = $1'.
|
|
|
|
Otherwise, the following line sets YYVAL to garbage.
|
|
This behavior is undocumented and Bison
|
|
@@ -1121,9 +1260,9 @@ yyreduce:
|
|
YY_REDUCE_PRINT (yyn);
|
|
switch (yyn)
|
|
{
|
|
- case 4:
|
|
-#line 119 "parsedate.y"
|
|
- {
|
|
+ case 4: /* item: time */
|
|
+#line 118 "parsedate.y"
|
|
+ {
|
|
yyHaveTime++;
|
|
#ifdef lint
|
|
/* I am compulsive about lint natterings... */
|
|
@@ -1132,385 +1271,352 @@ yyreduce:
|
|
}
|
|
#endif /* lint */
|
|
}
|
|
+#line 1275 "parsedate.c"
|
|
break;
|
|
|
|
- case 5:
|
|
-#line 128 "parsedate.y"
|
|
- {
|
|
+ case 5: /* item: time zone */
|
|
+#line 127 "parsedate.y"
|
|
+ {
|
|
yyHaveTime++;
|
|
- yyTimezone = yyvsp[0].Number;
|
|
+ yyTimezone = (yyvsp[0].Number);
|
|
}
|
|
+#line 1284 "parsedate.c"
|
|
break;
|
|
|
|
- case 6:
|
|
-#line 132 "parsedate.y"
|
|
- {
|
|
+ case 6: /* item: date */
|
|
+#line 131 "parsedate.y"
|
|
+ {
|
|
yyHaveDate++;
|
|
}
|
|
+#line 1292 "parsedate.c"
|
|
break;
|
|
|
|
- case 7:
|
|
-#line 135 "parsedate.y"
|
|
- {
|
|
+ case 7: /* item: rel */
|
|
+#line 134 "parsedate.y"
|
|
+ {
|
|
yyHaveRel = 1;
|
|
}
|
|
+#line 1300 "parsedate.c"
|
|
break;
|
|
|
|
- case 8:
|
|
-#line 140 "parsedate.y"
|
|
- {
|
|
- if (yyvsp[-1].Number < 100) {
|
|
- yyHour = yyvsp[-1].Number;
|
|
+ case 8: /* time: tUNUMBER o_merid */
|
|
+#line 139 "parsedate.y"
|
|
+ {
|
|
+ if ((yyvsp[-1].Number) < 100) {
|
|
+ yyHour = (yyvsp[-1].Number);
|
|
yyMinutes = 0;
|
|
}
|
|
else {
|
|
- yyHour = yyvsp[-1].Number / 100;
|
|
- yyMinutes = yyvsp[-1].Number % 100;
|
|
+ yyHour = (yyvsp[-1].Number) / 100;
|
|
+ yyMinutes = (yyvsp[-1].Number) % 100;
|
|
}
|
|
yySeconds = 0;
|
|
- yyMeridian = yyvsp[0].Meridian;
|
|
+ yyMeridian = (yyvsp[0].Meridian);
|
|
}
|
|
+#line 1317 "parsedate.c"
|
|
break;
|
|
|
|
- case 9:
|
|
-#line 152 "parsedate.y"
|
|
- {
|
|
- yyHour = yyvsp[-3].Number;
|
|
- yyMinutes = yyvsp[-1].Number;
|
|
+ case 9: /* time: tUNUMBER ':' tUNUMBER o_merid */
|
|
+#line 151 "parsedate.y"
|
|
+ {
|
|
+ yyHour = (yyvsp[-3].Number);
|
|
+ yyMinutes = (yyvsp[-1].Number);
|
|
yySeconds = 0;
|
|
- yyMeridian = yyvsp[0].Meridian;
|
|
+ yyMeridian = (yyvsp[0].Meridian);
|
|
}
|
|
+#line 1328 "parsedate.c"
|
|
break;
|
|
|
|
- case 10:
|
|
-#line 158 "parsedate.y"
|
|
- {
|
|
- yyHour = yyvsp[-3].Number;
|
|
- yyMinutes = yyvsp[-1].Number;
|
|
- yyTimezone = yyvsp[0].Number;
|
|
+ case 10: /* time: tUNUMBER ':' tUNUMBER numzone */
|
|
+#line 157 "parsedate.y"
|
|
+ {
|
|
+ yyHour = (yyvsp[-3].Number);
|
|
+ yyMinutes = (yyvsp[-1].Number);
|
|
+ yyTimezone = (yyvsp[0].Number);
|
|
yyMeridian = MER24;
|
|
yyDSTmode = DSToff;
|
|
}
|
|
+#line 1340 "parsedate.c"
|
|
break;
|
|
|
|
- case 11:
|
|
-#line 165 "parsedate.y"
|
|
- {
|
|
- yyHour = yyvsp[-5].Number;
|
|
- yyMinutes = yyvsp[-3].Number;
|
|
- yySeconds = yyvsp[-1].Number;
|
|
- yyMeridian = yyvsp[0].Meridian;
|
|
+ case 11: /* time: tUNUMBER ':' tUNUMBER ':' tUNUMBER o_merid */
|
|
+#line 164 "parsedate.y"
|
|
+ {
|
|
+ yyHour = (yyvsp[-5].Number);
|
|
+ yyMinutes = (yyvsp[-3].Number);
|
|
+ yySeconds = (yyvsp[-1].Number);
|
|
+ yyMeridian = (yyvsp[0].Meridian);
|
|
}
|
|
+#line 1351 "parsedate.c"
|
|
break;
|
|
|
|
- case 12:
|
|
-#line 171 "parsedate.y"
|
|
- {
|
|
- yyHour = yyvsp[-5].Number;
|
|
- yyMinutes = yyvsp[-3].Number;
|
|
- yySeconds = yyvsp[-1].Number;
|
|
- yyTimezone = yyvsp[0].Number;
|
|
+ case 12: /* time: tUNUMBER ':' tUNUMBER ':' tUNUMBER numzone */
|
|
+#line 170 "parsedate.y"
|
|
+ {
|
|
+ yyHour = (yyvsp[-5].Number);
|
|
+ yyMinutes = (yyvsp[-3].Number);
|
|
+ yySeconds = (yyvsp[-1].Number);
|
|
+ yyTimezone = (yyvsp[0].Number);
|
|
yyMeridian = MER24;
|
|
yyDSTmode = DSToff;
|
|
}
|
|
+#line 1364 "parsedate.c"
|
|
break;
|
|
|
|
- case 13:
|
|
-#line 181 "parsedate.y"
|
|
- {
|
|
- yyval.Number = yyvsp[0].Number;
|
|
+ case 13: /* zone: tZONE */
|
|
+#line 180 "parsedate.y"
|
|
+ {
|
|
+ (yyval.Number) = (yyvsp[0].Number);
|
|
yyDSTmode = DSToff;
|
|
}
|
|
+#line 1373 "parsedate.c"
|
|
break;
|
|
|
|
- case 14:
|
|
-#line 185 "parsedate.y"
|
|
- {
|
|
- yyval.Number = yyvsp[0].Number;
|
|
+ case 14: /* zone: tDAYZONE */
|
|
+#line 184 "parsedate.y"
|
|
+ {
|
|
+ (yyval.Number) = (yyvsp[0].Number);
|
|
yyDSTmode = DSTon;
|
|
}
|
|
+#line 1382 "parsedate.c"
|
|
break;
|
|
|
|
- case 15:
|
|
-#line 189 "parsedate.y"
|
|
- {
|
|
+ case 15: /* zone: tZONE numzone */
|
|
+#line 188 "parsedate.y"
|
|
+ {
|
|
/* Only allow "GMT+300" and "GMT-0800" */
|
|
- if (yyvsp[-1].Number != 0) {
|
|
+ if ((yyvsp[-1].Number) != 0) {
|
|
YYABORT;
|
|
}
|
|
- yyval.Number = yyvsp[0].Number;
|
|
+ (yyval.Number) = (yyvsp[0].Number);
|
|
yyDSTmode = DSToff;
|
|
}
|
|
+#line 1395 "parsedate.c"
|
|
break;
|
|
|
|
- case 16:
|
|
-#line 197 "parsedate.y"
|
|
- {
|
|
- yyval.Number = yyvsp[0].Number;
|
|
+ case 16: /* zone: numzone */
|
|
+#line 196 "parsedate.y"
|
|
+ {
|
|
+ (yyval.Number) = (yyvsp[0].Number);
|
|
yyDSTmode = DSToff;
|
|
}
|
|
+#line 1404 "parsedate.c"
|
|
break;
|
|
|
|
- case 17:
|
|
-#line 203 "parsedate.y"
|
|
- {
|
|
+ case 17: /* numzone: tSNUMBER */
|
|
+#line 202 "parsedate.y"
|
|
+ {
|
|
int i;
|
|
|
|
/* Unix and GMT and numeric timezones -- a little confusing. */
|
|
- if (yyvsp[0].Number < 0) {
|
|
+ if ((yyvsp[0].Number) < 0) {
|
|
/* Don't work with negative modulus. */
|
|
- yyvsp[0].Number = -yyvsp[0].Number;
|
|
- if (yyvsp[0].Number > 9999 || (i = yyvsp[0].Number % 100) >= 60) {
|
|
+ (yyvsp[0].Number) = -(yyvsp[0].Number);
|
|
+ if ((yyvsp[0].Number) > 9999 || (i = (yyvsp[0].Number) % 100) >= 60) {
|
|
YYABORT;
|
|
}
|
|
- yyval.Number = (yyvsp[0].Number / 100) * 60 + i;
|
|
+ (yyval.Number) = ((yyvsp[0].Number) / 100) * 60 + i;
|
|
}
|
|
else {
|
|
- if (yyvsp[0].Number > 9999 || (i = yyvsp[0].Number % 100) >= 60) {
|
|
+ if ((yyvsp[0].Number) > 9999 || (i = (yyvsp[0].Number) % 100) >= 60) {
|
|
YYABORT;
|
|
}
|
|
- yyval.Number = -((yyvsp[0].Number / 100) * 60 + i);
|
|
+ (yyval.Number) = -(((yyvsp[0].Number) / 100) * 60 + i);
|
|
}
|
|
}
|
|
+#line 1428 "parsedate.c"
|
|
break;
|
|
|
|
- case 18:
|
|
-#line 224 "parsedate.y"
|
|
- {
|
|
- yyMonth = yyvsp[-2].Number;
|
|
- yyDay = yyvsp[0].Number;
|
|
+ case 18: /* date: tUNUMBER '/' tUNUMBER */
|
|
+#line 223 "parsedate.y"
|
|
+ {
|
|
+ yyMonth = (yyvsp[-2].Number);
|
|
+ yyDay = (yyvsp[0].Number);
|
|
}
|
|
+#line 1437 "parsedate.c"
|
|
break;
|
|
|
|
- case 19:
|
|
-#line 228 "parsedate.y"
|
|
- {
|
|
- if (yyvsp[-4].Number > 100) {
|
|
- yyYear = yyvsp[-4].Number;
|
|
- yyMonth = yyvsp[-2].Number;
|
|
- yyDay = yyvsp[0].Number;
|
|
+ case 19: /* date: tUNUMBER '/' tUNUMBER '/' tUNUMBER */
|
|
+#line 227 "parsedate.y"
|
|
+ {
|
|
+ if ((yyvsp[-4].Number) > 100) {
|
|
+ yyYear = (yyvsp[-4].Number);
|
|
+ yyMonth = (yyvsp[-2].Number);
|
|
+ yyDay = (yyvsp[0].Number);
|
|
}
|
|
else {
|
|
- yyMonth = yyvsp[-4].Number;
|
|
- yyDay = yyvsp[-2].Number;
|
|
- yyYear = yyvsp[0].Number;
|
|
+ yyMonth = (yyvsp[-4].Number);
|
|
+ yyDay = (yyvsp[-2].Number);
|
|
+ yyYear = (yyvsp[0].Number);
|
|
}
|
|
}
|
|
+#line 1454 "parsedate.c"
|
|
break;
|
|
|
|
- case 20:
|
|
-#line 240 "parsedate.y"
|
|
- {
|
|
- yyMonth = yyvsp[-1].Number;
|
|
- yyDay = yyvsp[0].Number;
|
|
+ case 20: /* date: tMONTH tUNUMBER */
|
|
+#line 239 "parsedate.y"
|
|
+ {
|
|
+ yyMonth = (yyvsp[-1].Number);
|
|
+ yyDay = (yyvsp[0].Number);
|
|
}
|
|
+#line 1463 "parsedate.c"
|
|
break;
|
|
|
|
- case 21:
|
|
-#line 244 "parsedate.y"
|
|
- {
|
|
- yyMonth = yyvsp[-3].Number;
|
|
- yyDay = yyvsp[-2].Number;
|
|
- yyYear = yyvsp[0].Number;
|
|
+ case 21: /* date: tMONTH tUNUMBER ',' tUNUMBER */
|
|
+#line 243 "parsedate.y"
|
|
+ {
|
|
+ yyMonth = (yyvsp[-3].Number);
|
|
+ yyDay = (yyvsp[-2].Number);
|
|
+ yyYear = (yyvsp[0].Number);
|
|
}
|
|
+#line 1473 "parsedate.c"
|
|
break;
|
|
|
|
- case 22:
|
|
-#line 249 "parsedate.y"
|
|
- {
|
|
- yyDay = yyvsp[-1].Number;
|
|
- yyMonth = yyvsp[0].Number;
|
|
+ case 22: /* date: tUNUMBER tMONTH */
|
|
+#line 248 "parsedate.y"
|
|
+ {
|
|
+ yyDay = (yyvsp[-1].Number);
|
|
+ yyMonth = (yyvsp[0].Number);
|
|
}
|
|
+#line 1482 "parsedate.c"
|
|
break;
|
|
|
|
- case 23:
|
|
-#line 253 "parsedate.y"
|
|
- {
|
|
- yyDay = yyvsp[-2].Number;
|
|
- yyMonth = yyvsp[-1].Number;
|
|
- yyYear = yyvsp[0].Number;
|
|
+ case 23: /* date: tUNUMBER tMONTH tUNUMBER */
|
|
+#line 252 "parsedate.y"
|
|
+ {
|
|
+ yyDay = (yyvsp[-2].Number);
|
|
+ yyMonth = (yyvsp[-1].Number);
|
|
+ yyYear = (yyvsp[0].Number);
|
|
}
|
|
+#line 1492 "parsedate.c"
|
|
break;
|
|
|
|
- case 24:
|
|
-#line 258 "parsedate.y"
|
|
- {
|
|
- yyDay = yyvsp[-2].Number;
|
|
- yyMonth = yyvsp[-1].Number;
|
|
- yyYear = yyvsp[0].Number;
|
|
+ case 24: /* date: tDAY ',' tUNUMBER tMONTH tUNUMBER */
|
|
+#line 257 "parsedate.y"
|
|
+ {
|
|
+ yyDay = (yyvsp[-2].Number);
|
|
+ yyMonth = (yyvsp[-1].Number);
|
|
+ yyYear = (yyvsp[0].Number);
|
|
}
|
|
+#line 1502 "parsedate.c"
|
|
break;
|
|
|
|
- case 25:
|
|
-#line 265 "parsedate.y"
|
|
- {
|
|
- yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number;
|
|
+ case 25: /* rel: tSNUMBER tSEC_UNIT */
|
|
+#line 264 "parsedate.y"
|
|
+ {
|
|
+ yyRelSeconds += (yyvsp[-1].Number) * (yyvsp[0].Number);
|
|
}
|
|
+#line 1510 "parsedate.c"
|
|
break;
|
|
|
|
- case 26:
|
|
-#line 268 "parsedate.y"
|
|
- {
|
|
- yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number;
|
|
+ case 26: /* rel: tUNUMBER tSEC_UNIT */
|
|
+#line 267 "parsedate.y"
|
|
+ {
|
|
+ yyRelSeconds += (yyvsp[-1].Number) * (yyvsp[0].Number);
|
|
}
|
|
+#line 1518 "parsedate.c"
|
|
break;
|
|
|
|
- case 27:
|
|
-#line 271 "parsedate.y"
|
|
- {
|
|
- yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number;
|
|
+ case 27: /* rel: tSNUMBER tMONTH_UNIT */
|
|
+#line 270 "parsedate.y"
|
|
+ {
|
|
+ yyRelMonth += (yyvsp[-1].Number) * (yyvsp[0].Number);
|
|
}
|
|
+#line 1526 "parsedate.c"
|
|
break;
|
|
|
|
- case 28:
|
|
-#line 274 "parsedate.y"
|
|
- {
|
|
- yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number;
|
|
+ case 28: /* rel: tUNUMBER tMONTH_UNIT */
|
|
+#line 273 "parsedate.y"
|
|
+ {
|
|
+ yyRelMonth += (yyvsp[-1].Number) * (yyvsp[0].Number);
|
|
}
|
|
+#line 1534 "parsedate.c"
|
|
break;
|
|
|
|
- case 29:
|
|
-#line 279 "parsedate.y"
|
|
- {
|
|
- yyval.Meridian = MER24;
|
|
+ case 29: /* o_merid: %empty */
|
|
+#line 278 "parsedate.y"
|
|
+ {
|
|
+ (yyval.Meridian) = MER24;
|
|
}
|
|
+#line 1542 "parsedate.c"
|
|
break;
|
|
|
|
- case 30:
|
|
-#line 282 "parsedate.y"
|
|
- {
|
|
- yyval.Meridian = yyvsp[0].Meridian;
|
|
+ case 30: /* o_merid: tMERIDIAN */
|
|
+#line 281 "parsedate.y"
|
|
+ {
|
|
+ (yyval.Meridian) = (yyvsp[0].Meridian);
|
|
}
|
|
+#line 1550 "parsedate.c"
|
|
break;
|
|
|
|
|
|
- }
|
|
-
|
|
-/* Line 1010 of yacc.c. */
|
|
-#line 1391 "parsedate.c"
|
|
-
|
|
- yyvsp -= yylen;
|
|
- yyssp -= yylen;
|
|
-
|
|
+#line 1554 "parsedate.c"
|
|
|
|
- YY_STACK_PRINT (yyss, yyssp);
|
|
+ default: break;
|
|
+ }
|
|
+ /* User semantic actions sometimes alter yychar, and that requires
|
|
+ that yytoken be updated with the new translation. We take the
|
|
+ approach of translating immediately before every use of yytoken.
|
|
+ One alternative is translating here after every semantic action,
|
|
+ but that translation would be missed if the semantic action invokes
|
|
+ YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
|
|
+ if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
|
|
+ incorrect destructor might then be invoked immediately. In the
|
|
+ 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 ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
|
|
+
|
|
+ YYPOPSTACK (yylen);
|
|
+ yylen = 0;
|
|
|
|
*++yyvsp = yyval;
|
|
|
|
-
|
|
- /* Now `shift' the result of the reduction. Determine what state
|
|
+ /* 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;
|
|
|
|
|
|
-/*------------------------------------.
|
|
-| yyerrlab -- here on detecting error |
|
|
-`------------------------------------*/
|
|
+/*--------------------------------------.
|
|
+| yyerrlab -- here on detecting error. |
|
|
+`--------------------------------------*/
|
|
yyerrlab:
|
|
+ /* Make sure we have latest lookahead translation. See comments at
|
|
+ user semantic actions for why this is necessary. */
|
|
+ yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
|
|
/* If not already recovering from an error, report this error. */
|
|
if (!yyerrstatus)
|
|
{
|
|
++yynerrs;
|
|
-#if YYERROR_VERBOSE
|
|
- yyn = yypact[yystate];
|
|
-
|
|
- if (YYPACT_NINF < yyn && yyn < YYLAST)
|
|
- {
|
|
- YYSIZE_T yysize = 0;
|
|
- int yytype = YYTRANSLATE (yychar);
|
|
- const char* yyprefix;
|
|
- char *yymsg;
|
|
- int yyx;
|
|
-
|
|
- /* Start YYX at -YYN if negative to avoid negative indexes in
|
|
- YYCHECK. */
|
|
- int yyxbegin = yyn < 0 ? -yyn : 0;
|
|
-
|
|
- /* Stay within bounds of both yycheck and yytname. */
|
|
- int yychecklim = YYLAST - yyn;
|
|
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
|
|
- int yycount = 0;
|
|
-
|
|
- yyprefix = ", expecting ";
|
|
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
|
|
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
|
|
- {
|
|
- yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
|
|
- yycount += 1;
|
|
- if (yycount == 5)
|
|
- {
|
|
- yysize = 0;
|
|
- break;
|
|
- }
|
|
- }
|
|
- yysize += (sizeof ("syntax error, unexpected ")
|
|
- + yystrlen (yytname[yytype]));
|
|
- yymsg = (char *) YYSTACK_ALLOC (yysize);
|
|
- if (yymsg != 0)
|
|
- {
|
|
- char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
|
|
- yyp = yystpcpy (yyp, yytname[yytype]);
|
|
-
|
|
- if (yycount < 5)
|
|
- {
|
|
- yyprefix = ", expecting ";
|
|
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
|
|
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
|
|
- {
|
|
- yyp = yystpcpy (yyp, yyprefix);
|
|
- yyp = yystpcpy (yyp, yytname[yyx]);
|
|
- yyprefix = " or ";
|
|
- }
|
|
- }
|
|
- yyerror (yymsg);
|
|
- YYSTACK_FREE (yymsg);
|
|
- }
|
|
- else
|
|
- yyerror ("syntax error; also virtual memory exhausted");
|
|
- }
|
|
- else
|
|
-#endif /* YYERROR_VERBOSE */
|
|
- yyerror ("syntax error");
|
|
+ yyerror (YY_("syntax error"));
|
|
}
|
|
|
|
-
|
|
-
|
|
if (yyerrstatus == 3)
|
|
{
|
|
/* If just tried and failed to reuse lookahead token after an
|
|
- error, discard it. */
|
|
+ error, discard it. */
|
|
|
|
if (yychar <= YYEOF)
|
|
{
|
|
- /* If at end of input, pop the error token,
|
|
- then the rest of the stack, then return failure. */
|
|
- if (yychar == YYEOF)
|
|
- for (;;)
|
|
- {
|
|
- YYPOPSTACK;
|
|
- if (yyssp == yyss)
|
|
- YYABORT;
|
|
- YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
|
|
- yydestruct (yystos[*yyssp], yyvsp);
|
|
- }
|
|
+ /* Return failure if at end of input. */
|
|
+ if (yychar == YYEOF)
|
|
+ YYABORT;
|
|
}
|
|
else
|
|
- {
|
|
- YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
|
|
- yydestruct (yytoken, &yylval);
|
|
- yychar = YYEMPTY;
|
|
-
|
|
- }
|
|
+ {
|
|
+ yydestruct ("Error: discarding",
|
|
+ yytoken, &yylval);
|
|
+ yychar = YYEMPTY;
|
|
+ }
|
|
}
|
|
|
|
/* Else will try to reuse lookahead token after shifting the error
|
|
@@ -1522,16 +1628,17 @@ yyerrlab:
|
|
| yyerrorlab -- error raised explicitly by YYERROR. |
|
|
`---------------------------------------------------*/
|
|
yyerrorlab:
|
|
-
|
|
-#ifdef __GNUC__
|
|
- /* Pacify GCC when the user code never invokes YYERROR and the label
|
|
- yyerrorlab therefore never appears in user code. */
|
|
+ /* Pacify compilers when the user code never invokes YYERROR and the
|
|
+ label yyerrorlab therefore never appears in user code. */
|
|
if (0)
|
|
- goto yyerrorlab;
|
|
-#endif
|
|
+ YYERROR;
|
|
+ ++yynerrs;
|
|
|
|
- yyvsp -= yylen;
|
|
- yyssp -= yylen;
|
|
+ /* Do not reclaim the symbols of the rule whose action triggered
|
|
+ this YYERROR. */
|
|
+ YYPOPSTACK (yylen);
|
|
+ yylen = 0;
|
|
+ YY_STACK_PRINT (yyss, yyssp);
|
|
yystate = *yyssp;
|
|
goto yyerrlab1;
|
|
|
|
@@ -1540,41 +1647,43 @@ yyerrorlab:
|
|
| yyerrlab1 -- common code for both syntax error and YYERROR. |
|
|
`-------------------------------------------------------------*/
|
|
yyerrlab1:
|
|
- yyerrstatus = 3; /* Each real token shifted decrements this. */
|
|
+ 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 (yyn != YYPACT_NINF)
|
|
- {
|
|
- yyn += YYTERROR;
|
|
- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
|
|
- {
|
|
- yyn = yytable[yyn];
|
|
- if (0 < yyn)
|
|
- break;
|
|
- }
|
|
- }
|
|
+ if (!yypact_value_is_default (yyn))
|
|
+ {
|
|
+ yyn += YYSYMBOL_YYerror;
|
|
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
|
|
+ {
|
|
+ yyn = yytable[yyn];
|
|
+ if (0 < yyn)
|
|
+ break;
|
|
+ }
|
|
+ }
|
|
|
|
/* Pop the current state because it cannot handle the error token. */
|
|
if (yyssp == yyss)
|
|
- YYABORT;
|
|
+ YYABORT;
|
|
+
|
|
|
|
- YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
|
|
- yydestruct (yystos[yystate], yyvsp);
|
|
- YYPOPSTACK;
|
|
+ yydestruct ("Error: popping",
|
|
+ YY_ACCESSING_SYMBOL (yystate), yyvsp);
|
|
+ YYPOPSTACK (1);
|
|
yystate = *yyssp;
|
|
YY_STACK_PRINT (yyss, yyssp);
|
|
}
|
|
|
|
- if (yyn == YYFINAL)
|
|
- YYACCEPT;
|
|
-
|
|
- YYDPRINTF ((stderr, "Shifting error token, "));
|
|
-
|
|
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
|
*++yyvsp = yylval;
|
|
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
|
|
|
|
|
|
+ /* Shift the error token. */
|
|
+ YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
|
|
+
|
|
yystate = yyn;
|
|
goto yynewstate;
|
|
|
|
@@ -1584,35 +1693,57 @@ yyerrlab1:
|
|
`-------------------------------------*/
|
|
yyacceptlab:
|
|
yyresult = 0;
|
|
- goto yyreturn;
|
|
+ goto yyreturnlab;
|
|
+
|
|
|
|
/*-----------------------------------.
|
|
| yyabortlab -- YYABORT comes here. |
|
|
`-----------------------------------*/
|
|
yyabortlab:
|
|
yyresult = 1;
|
|
- goto yyreturn;
|
|
+ goto yyreturnlab;
|
|
|
|
-#ifndef yyoverflow
|
|
-/*----------------------------------------------.
|
|
-| yyoverflowlab -- parser overflow comes here. |
|
|
-`----------------------------------------------*/
|
|
-yyoverflowlab:
|
|
- yyerror ("parser stack overflow");
|
|
+
|
|
+/*-----------------------------------------------------------.
|
|
+| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
|
|
+`-----------------------------------------------------------*/
|
|
+yyexhaustedlab:
|
|
+ yyerror (YY_("memory exhausted"));
|
|
yyresult = 2;
|
|
- /* Fall through. */
|
|
-#endif
|
|
+ goto yyreturnlab;
|
|
|
|
-yyreturn:
|
|
+
|
|
+/*----------------------------------------------------------.
|
|
+| yyreturnlab -- parsing is finished, clean up and return. |
|
|
+`----------------------------------------------------------*/
|
|
+yyreturnlab:
|
|
+ if (yychar != YYEMPTY)
|
|
+ {
|
|
+ /* Make sure we have latest lookahead translation. See comments at
|
|
+ user semantic actions for why this is necessary. */
|
|
+ yytoken = YYTRANSLATE (yychar);
|
|
+ yydestruct ("Cleanup: discarding lookahead",
|
|
+ yytoken, &yylval);
|
|
+ }
|
|
+ /* Do not reclaim the symbols of the rule whose action triggered
|
|
+ this YYABORT or YYACCEPT. */
|
|
+ YYPOPSTACK (yylen);
|
|
+ YY_STACK_PRINT (yyss, yyssp);
|
|
+ while (yyssp != yyss)
|
|
+ {
|
|
+ yydestruct ("Cleanup: popping",
|
|
+ YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
|
|
+ YYPOPSTACK (1);
|
|
+ }
|
|
#ifndef yyoverflow
|
|
if (yyss != yyssa)
|
|
YYSTACK_FREE (yyss);
|
|
#endif
|
|
+
|
|
return yyresult;
|
|
}
|
|
|
|
-
|
|
-#line 287 "parsedate.y"
|
|
+#line 286 "parsedate.y"
|
|
|
|
|
|
/* Month and day table. */
|
|
@@ -1768,19 +1899,14 @@ static TABLE TimezoneTable[] = {
|
|
|
|
/* ARGSUSED */
|
|
static void
|
|
-date_error(s)
|
|
- char *s;
|
|
+date_error(char *s)
|
|
{
|
|
/* NOTREACHED */
|
|
}
|
|
|
|
|
|
static time_t
|
|
-ToSeconds(Hours, Minutes, Seconds, Meridian)
|
|
- time_t Hours;
|
|
- time_t Minutes;
|
|
- time_t Seconds;
|
|
- MERIDIAN Meridian;
|
|
+ToSeconds(time_t Hours, time_t Minutes, time_t Seconds, MERIDIAN Meridian)
|
|
{
|
|
if (Minutes < 0 || Minutes > 59 || Seconds < 0 || Seconds > 61)
|
|
return -1;
|
|
@@ -1801,15 +1927,7 @@ ToSeconds(Hours, Minutes, Seconds, Meridian)
|
|
|
|
|
|
static time_t
|
|
-Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, dst)
|
|
- time_t Month;
|
|
- time_t Day;
|
|
- time_t Year;
|
|
- time_t Hours;
|
|
- time_t Minutes;
|
|
- time_t Seconds;
|
|
- MERIDIAN Meridian;
|
|
- DSTMODE dst;
|
|
+Convert(time_t Month, time_t Day, time_t Year, time_t Hours, time_t Minutes, time_t Seconds, MERIDIAN Meridian, DSTMODE dst)
|
|
{
|
|
static int DaysNormal[13] = {
|
|
0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
|
|
@@ -1863,9 +1981,7 @@ Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, dst)
|
|
|
|
|
|
static time_t
|
|
-DSTcorrect(Start, Future)
|
|
- time_t Start;
|
|
- time_t Future;
|
|
+DSTcorrect(time_t Start, time_t Future)
|
|
{
|
|
time_t StartDay;
|
|
time_t FutureDay;
|
|
@@ -1877,9 +1993,7 @@ DSTcorrect(Start, Future)
|
|
|
|
|
|
static time_t
|
|
-RelativeMonth(Start, RelMonth)
|
|
- time_t Start;
|
|
- time_t RelMonth;
|
|
+RelativeMonth(time_t Start, time_t RelMonth)
|
|
{
|
|
struct tm *tm;
|
|
time_t Month;
|
|
@@ -1897,9 +2011,7 @@ RelativeMonth(Start, RelMonth)
|
|
|
|
|
|
static int
|
|
-LookupWord(buff, length)
|
|
- char *buff;
|
|
- register int length;
|
|
+LookupWord(char *buff, register int length)
|
|
{
|
|
register char *p;
|
|
register char *q;
|
|
@@ -2052,8 +2164,7 @@ date_lex()
|
|
|
|
|
|
time_t
|
|
-parsedate(p)
|
|
- char *p;
|
|
+parsedate(char *p)
|
|
{
|
|
extern int date_parse();
|
|
time_t Start;
|
|
@@ -2105,9 +2216,7 @@ extern int yydebug;
|
|
|
|
/* ARGSUSED */
|
|
int
|
|
-main(ac, av)
|
|
- int ac;
|
|
- char *av[];
|
|
+main(int ac, char *av[])
|
|
{
|
|
char buff[128];
|
|
time_t d;
|
|
@@ -2140,5 +2249,3 @@ main(ac, av)
|
|
/* NOTREACHED */
|
|
}
|
|
#endif /* TEST */
|
|
-
|
|
-
|
|
diff --git a/src/parsedate.y b/src/parsedate.y
|
|
index 43d6a23..588ee67 100644
|
|
--- a/src/parsedate.y
|
|
+++ b/src/parsedate.y
|
|
@@ -94,8 +94,7 @@ static time_t yyRelMonth;
|
|
static time_t yyRelSeconds;
|
|
|
|
|
|
-extern struct tm *localtime();
|
|
-static void date_error();
|
|
+static void date_error(char *s);
|
|
%}
|
|
|
|
%union {
|
|
@@ -439,19 +438,14 @@ static TABLE TimezoneTable[] = {
|
|
|
|
/* ARGSUSED */
|
|
static void
|
|
-date_error(s)
|
|
- char *s;
|
|
+date_error(char *s)
|
|
{
|
|
/* NOTREACHED */
|
|
}
|
|
|
|
|
|
static time_t
|
|
-ToSeconds(Hours, Minutes, Seconds, Meridian)
|
|
- time_t Hours;
|
|
- time_t Minutes;
|
|
- time_t Seconds;
|
|
- MERIDIAN Meridian;
|
|
+ToSeconds(time_t Hours, time_t Minutes, time_t Seconds, MERIDIAN Meridian)
|
|
{
|
|
if (Minutes < 0 || Minutes > 59 || Seconds < 0 || Seconds > 61)
|
|
return -1;
|
|
@@ -472,15 +466,7 @@ ToSeconds(Hours, Minutes, Seconds, Meridian)
|
|
|
|
|
|
static time_t
|
|
-Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, dst)
|
|
- time_t Month;
|
|
- time_t Day;
|
|
- time_t Year;
|
|
- time_t Hours;
|
|
- time_t Minutes;
|
|
- time_t Seconds;
|
|
- MERIDIAN Meridian;
|
|
- DSTMODE dst;
|
|
+Convert(time_t Month, time_t Day, time_t Year, time_t Hours, time_t Minutes, time_t Seconds, MERIDIAN Meridian, DSTMODE dst)
|
|
{
|
|
static int DaysNormal[13] = {
|
|
0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
|
|
@@ -534,9 +520,7 @@ Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, dst)
|
|
|
|
|
|
static time_t
|
|
-DSTcorrect(Start, Future)
|
|
- time_t Start;
|
|
- time_t Future;
|
|
+DSTcorrect(time_t Start, time_t Future)
|
|
{
|
|
time_t StartDay;
|
|
time_t FutureDay;
|
|
@@ -548,9 +532,7 @@ DSTcorrect(Start, Future)
|
|
|
|
|
|
static time_t
|
|
-RelativeMonth(Start, RelMonth)
|
|
- time_t Start;
|
|
- time_t RelMonth;
|
|
+RelativeMonth(time_t Start, time_t RelMonth)
|
|
{
|
|
struct tm *tm;
|
|
time_t Month;
|
|
@@ -568,9 +550,7 @@ RelativeMonth(Start, RelMonth)
|
|
|
|
|
|
static int
|
|
-LookupWord(buff, length)
|
|
- char *buff;
|
|
- register int length;
|
|
+LookupWord(char *buff, register int length)
|
|
{
|
|
register char *p;
|
|
register char *q;
|
|
@@ -723,8 +703,7 @@ date_lex()
|
|
|
|
|
|
time_t
|
|
-parsedate(p)
|
|
- char *p;
|
|
+parsedate(char *p)
|
|
{
|
|
extern int date_parse();
|
|
time_t Start;
|
|
@@ -776,9 +755,7 @@ extern int yydebug;
|
|
|
|
/* ARGSUSED */
|
|
int
|
|
-main(ac, av)
|
|
- int ac;
|
|
- char *av[];
|
|
+main(int ac, char *av[])
|
|
{
|
|
char buff[128];
|
|
time_t d;
|