diff options
Diffstat (limited to 'libmisc/getdate.c')
-rw-r--r-- | libmisc/getdate.c | 766 |
1 files changed, 433 insertions, 333 deletions
diff --git a/libmisc/getdate.c b/libmisc/getdate.c index 390f9efd..af6424e7 100644 --- a/libmisc/getdate.c +++ b/libmisc/getdate.c @@ -1,8 +1,9 @@ -/* A Bison parser, made by GNU Bison 3.0.4. */ +/* A Bison parser, made by GNU Bison 3.5.1. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 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 @@ -40,11 +41,14 @@ 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 /* Bison version. */ -#define YYBISON_VERSION "3.0.4" +#define YYBISON_VERSION "3.5.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -61,8 +65,8 @@ -/* Copy the first part of user declarations. */ -#line 1 "getdate.y" /* yacc.c:339 */ +/* First part of user prologue. */ +#line 1 "getdate.y" /* ** Originally written by Steven M. Bellovin <smb@research.att.com> while @@ -126,7 +130,7 @@ /* Some old versions of bison generate parsers that use bcopy. That loses on systems that don't provide the function, so we have to redefine it here. */ -#if !defined (HAVE_BCOPY) && defined (HAVE_MEMCPY) && !defined (bcopy) +#if !defined (HAVE_BCOPY) && !defined (bcopy) # define bcopy(from, to, len) memcpy ((to), (from), (len)) #endif @@ -233,13 +237,26 @@ static int yyRelSeconds; static int yyRelYear; -#line 237 "getdate.c" /* yacc.c:339 */ +#line 241 "getdate.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 && 201103L <= __cplusplus -# define YY_NULLPTR nullptr +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif # else -# define YY_NULLPTR 0 +# define YY_NULLPTR ((void*)0) # endif # endif @@ -303,17 +320,16 @@ extern int yydebug; /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED - union YYSTYPE { -#line 172 "getdate.y" /* yacc.c:355 */ +#line 172 "getdate.y" int Number; enum _MERIDIAN Meridian; -#line 315 "getdate.c" /* yacc.c:355 */ -}; +#line 331 "getdate.c" +}; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 @@ -326,36 +342,81 @@ int yyparse (void); -/* Copy the second part of user declarations. */ -#line 332 "getdate.c" /* yacc.c:358 */ #ifdef short # 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 + <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 -#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 short yytype_int16; +#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 unsigned short int yytype_uint16; +typedef short yytype_uint8; #endif -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; +#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST16_TYPE__ yytype_uint16; +#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST16_MAX <= INT_MAX) +typedef uint_least16_t yytype_uint16; +#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX +typedef unsigned short yytype_uint16; #else -typedef short int yytype_int16; +typedef int yytype_uint16; +#endif + +#ifndef YYPTRDIFF_T +# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ +# define YYPTRDIFF_T __PTRDIFF_TYPE__ +# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ +# elif defined PTRDIFF_MAX +# ifndef ptrdiff_t +# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ +# endif +# define YYPTRDIFF_T ptrdiff_t +# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX +# else +# define YYPTRDIFF_T long +# define YYPTRDIFF_MAXIMUM LONG_MAX +# endif #endif #ifndef YYSIZE_T @@ -363,15 +424,27 @@ typedef short int yytype_int16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T +# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else -# define YYSIZE_T unsigned int +# define YYSIZE_T unsigned # endif #endif -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) +#define YYSIZE_MAXIMUM \ + YY_CAST (YYPTRDIFF_T, \ + (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ + ? YYPTRDIFF_MAXIMUM \ + : YY_CAST (YYSIZE_T, -1))) + +#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) + +/* Stored state numbers (used for stacks). */ +typedef yytype_int8 yy_state_t; + +/* State numbers in computations. */ +typedef int yy_state_fast_t; #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS @@ -385,30 +458,19 @@ typedef short int yytype_int16; # endif #endif -#ifndef YY_ATTRIBUTE -# if (defined __GNUC__ \ - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +#ifndef YY_ATTRIBUTE_PURE +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) # else -# define YY_ATTRIBUTE(Spec) /* empty */ +# define YY_ATTRIBUTE_PURE # endif #endif -#ifndef YY_ATTRIBUTE_PURE -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) -#endif - #ifndef YY_ATTRIBUTE_UNUSED -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) -#endif - -#if !defined _Noreturn \ - && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) -# if defined _MSC_VER && 1200 <= _MSC_VER -# define _Noreturn __declspec (noreturn) +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) # else -# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) +# define YY_ATTRIBUTE_UNUSED # endif #endif @@ -419,13 +481,13 @@ typedef short int yytype_int16; # define YYUSE(E) /* empty */ #endif -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +#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\"")\ +# 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 \ +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value @@ -438,6 +500,20 @@ typedef short int yytype_int16; # define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END +#endif + + +#define YY_ASSERT(E) ((void) (0 && (E))) #if ! defined yyoverflow || YYERROR_VERBOSE @@ -514,17 +590,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 @@ -537,11 +613,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) @@ -553,12 +629,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]; \ } \ @@ -581,17 +657,18 @@ union yyalloc /* YYNSTATES -- Number of states. */ #define YYNSTATES 61 -/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned - by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 273 + +/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, with out-of-bounds checking. */ #define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, without out-of-bounds checking. */ -static const yytype_uint8 yytranslate[] = + as returned by yylex. */ +static const yytype_int8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -625,7 +702,7 @@ static const yytype_uint8 yytranslate[] = #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = +static const yytype_int16 yyrline[] = { 0, 188, 188, 189, 192, 195, 198, 201, 204, 207, 210, 216, 222, 231, 237, 249, 252, 256, 261, 265, @@ -652,7 +729,7 @@ static const char *const yytname[] = # 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 yytype_int16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 58, @@ -660,14 +737,14 @@ static const yytype_uint16 yytoknum[] = }; # endif -#define YYPACT_NINF -20 +#define YYPACT_NINF (-20) -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-20))) +#define yypact_value_is_default(Yyn) \ + ((Yyn) == YYPACT_NINF) -#define YYTABLE_NINF -1 +#define YYTABLE_NINF (-1) -#define yytable_value_is_error(Yytable_value) \ +#define yytable_value_is_error(Yyn) \ 0 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing @@ -686,7 +763,7 @@ static const yytype_int8 yypact[] = /* 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[] = +static const yytype_int8 yydefact[] = { 2, 0, 1, 18, 39, 16, 42, 45, 0, 36, 48, 0, 49, 33, 15, 3, 4, 5, 7, 6, @@ -714,7 +791,7 @@ static const yytype_int8 yydefgoto[] = /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule whose number is the opposite. If YYTABLE_NINF, syntax error. */ -static const yytype_uint8 yytable[] = +static const yytype_int8 yytable[] = { 2, 23, 52, 24, 3, 4, 5, 59, 6, 46, 47, 7, 8, 9, 10, 11, 12, 13, 14, 31, @@ -724,7 +801,7 @@ static const yytype_uint8 yytable[] = 60 }; -static const yytype_uint8 yycheck[] = +static const yytype_int8 yycheck[] = { 0, 20, 10, 16, 4, 5, 6, 15, 8, 15, 16, 11, 12, 13, 14, 15, 16, 17, 18, 4, @@ -736,7 +813,7 @@ static const yytype_uint8 yycheck[] = /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = +static const yytype_int8 yystos[] = { 0, 23, 0, 4, 5, 6, 8, 11, 12, 13, 14, 15, 16, 17, 18, 24, 25, 26, 27, 28, @@ -748,7 +825,7 @@ static const yytype_uint8 yystos[] = }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = +static const yytype_int8 yyr1[] = { 0, 22, 23, 23, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 26, 26, 26, 27, 27, @@ -759,7 +836,7 @@ static const yytype_uint8 yyr1[] = }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = +static const yytype_int8 yyr2[] = { 0, 2, 0, 2, 1, 1, 1, 1, 1, 1, 2, 4, 4, 6, 6, 1, 1, 2, 1, 2, @@ -782,22 +859,22 @@ static const yytype_uint8 yyr2[] = #define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) +#define YYBACKUP(Token, Value) \ + do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ + while (0) /* Error token number */ #define YYTERROR 1 @@ -837,37 +914,39 @@ do { \ } while (0) -/*----------------------------------------. -| Print this symbol's value on YYOUTPUT. | -`----------------------------------------*/ +/*-----------------------------------. +| Print this symbol's value on YYO. | +`-----------------------------------*/ static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) { - FILE *yyo = yyoutput; - YYUSE (yyo); + FILE *yyoutput = yyo; + YYUSE (yyoutput); if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); + YYPRINT (yyo, yytoknum[yytype], *yyvaluep); # endif + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +/*---------------------------. +| Print this symbol on YYO. | +`---------------------------*/ static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) { - YYFPRINTF (yyoutput, "%s %s (", + YYFPRINTF (yyo, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); + yy_symbol_value_print (yyo, yytype, yyvaluep); + YYFPRINTF (yyo, ")"); } /*------------------------------------------------------------------. @@ -876,7 +955,7 @@ yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) `------------------------------------------------------------------*/ static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -899,20 +978,20 @@ do { \ `------------------------------------------------*/ static void -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) +yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule) { - unsigned long int yylno = yyrline[yyrule]; + int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, - yystos[yyssp[yyi + 1 - yynrhs]], - &(yyvsp[(yyi + 1) - (yynrhs)]) + yystos[+yyssp[yyi + 1 - yynrhs]], + &yyvsp[(yyi + 1) - (yynrhs)] ); YYFPRINTF (stderr, "\n"); } @@ -956,13 +1035,13 @@ int yydebug; # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen +# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) # else /* Return the length of YYSTR. */ -static YYSIZE_T +static YYPTRDIFF_T yystrlen (const char *yystr) { - YYSIZE_T yylen; + YYPTRDIFF_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; @@ -998,12 +1077,12 @@ yystpcpy (char *yydest, const char *yysrc) 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 +static YYPTRDIFF_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { - YYSIZE_T yyn = 0; + YYPTRDIFF_T yyn = 0; char const *yyp = yystr; for (;;) @@ -1016,7 +1095,10 @@ yytnamerr (char *yyres, const char *yystr) case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; - /* Fall through. */ + else + goto append; + + append: default: if (yyres) yyres[yyn] = *yyp; @@ -1031,10 +1113,10 @@ yytnamerr (char *yyres, const char *yystr) do_not_strip_quotes: ; } - if (! yyres) + if (yyres) + return yystpcpy (yyres, yystr) - yyres; + else return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; } # endif @@ -1047,19 +1129,19 @@ yytnamerr (char *yyres, const char *yystr) *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) +yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, + yy_state_t *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. */ + /* Arguments of yyformat: reported tokens (one for the "unexpected", + one per "expected"). */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ + /* Actual size of YYARG. */ int yycount = 0; + /* Cumulated lengths of YYARG. */ + YYPTRDIFF_T yysize = 0; /* There are many possibilities here to consider: - If this state is a consistent state with a default action, then @@ -1086,7 +1168,9 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, */ if (yytoken != YYEMPTY) { - int yyn = yypact[*yyssp]; + int yyn = yypact[+*yyssp]; + YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); + yysize = yysize0; yyarg[yycount++] = yytname[yytoken]; if (!yypact_value_is_default (yyn)) { @@ -1111,11 +1195,12 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, } yyarg[yycount++] = yytname[yyx]; { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + YYPTRDIFF_T yysize1 + = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else return 2; - yysize = yysize1; } } } @@ -1127,6 +1212,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, 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")); @@ -1137,10 +1223,13 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, } { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + /* Don't count the "%s"s in the final size, but reserve room for + the terminator. */ + YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1; + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else return 2; - yysize = yysize1; } if (*yymsg_alloc < yysize) @@ -1166,8 +1255,8 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, } else { - yyp++; - yyformat++; + ++yyp; + ++yyformat; } } return 0; @@ -1210,7 +1299,7 @@ int yynerrs; int yyparse (void) { - int yystate; + yy_state_fast_t yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; @@ -1222,16 +1311,16 @@ yyparse (void) to reallocate them elsewhere. */ /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; + yy_state_t yyssa[YYINITDEPTH]; + yy_state_t *yyss; + yy_state_t *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs; YYSTYPE *yyvsp; - YYSIZE_T yystacksize; + YYPTRDIFF_T yystacksize; int yyn; int yyresult; @@ -1245,7 +1334,7 @@ yyparse (void) /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; + YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf; #endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) @@ -1266,46 +1355,54 @@ yyparse (void) 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. */ 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 if (yyss + yystacksize - 1 <= yyssp) +#if !defined yyoverflow && !defined YYSTACK_RELOCATE + goto yyexhaustedlab; +#else { /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; + YYPTRDIFF_T yysize = yyssp - yyss + 1; -#ifdef yyoverflow +# if defined yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ + yy_state_t *yyss1 = yyss; YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), + &yyss1, yysize * YYSIZEOF (*yyssp), + &yyvs1, yysize * YYSIZEOF (*yyvsp), &yystacksize); - yyss = yyss1; yyvs = yyvs1; } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else +# else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; @@ -1314,42 +1411,43 @@ yyparse (void) 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; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE +# undef YYSTACK_RELOCATE 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; } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); +#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ 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. */ @@ -1399,15 +1497,13 @@ yybackup: /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END + /* Discard the shifted token. */ + yychar = YYEMPTY; goto yynewstate; @@ -1422,7 +1518,7 @@ yydefault: /*-----------------------------. -| yyreduce -- Do a reduction. | +| yyreduce -- do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ @@ -1442,71 +1538,71 @@ yyreduce: YY_REDUCE_PRINT (yyn); switch (yyn) { - case 4: -#line 192 "getdate.y" /* yacc.c:1646 */ - { + case 4: +#line 192 "getdate.y" + { yyHaveTime++; } -#line 1451 "getdate.c" /* yacc.c:1646 */ +#line 1547 "getdate.c" break; case 5: -#line 195 "getdate.y" /* yacc.c:1646 */ - { +#line 195 "getdate.y" + { yyHaveZone++; } -#line 1459 "getdate.c" /* yacc.c:1646 */ +#line 1555 "getdate.c" break; case 6: -#line 198 "getdate.y" /* yacc.c:1646 */ - { +#line 198 "getdate.y" + { yyHaveDate++; } -#line 1467 "getdate.c" /* yacc.c:1646 */ +#line 1563 "getdate.c" break; case 7: -#line 201 "getdate.y" /* yacc.c:1646 */ - { +#line 201 "getdate.y" + { yyHaveDay++; } -#line 1475 "getdate.c" /* yacc.c:1646 */ +#line 1571 "getdate.c" break; case 8: -#line 204 "getdate.y" /* yacc.c:1646 */ - { +#line 204 "getdate.y" + { yyHaveRel++; } -#line 1483 "getdate.c" /* yacc.c:1646 */ +#line 1579 "getdate.c" break; case 10: -#line 210 "getdate.y" /* yacc.c:1646 */ - { +#line 210 "getdate.y" + { yyHour = (yyvsp[-1].Number); yyMinutes = 0; yySeconds = 0; yyMeridian = (yyvsp[0].Meridian); } -#line 1494 "getdate.c" /* yacc.c:1646 */ +#line 1590 "getdate.c" break; case 11: -#line 216 "getdate.y" /* yacc.c:1646 */ - { +#line 216 "getdate.y" + { yyHour = (yyvsp[-3].Number); yyMinutes = (yyvsp[-1].Number); yySeconds = 0; yyMeridian = (yyvsp[0].Meridian); } -#line 1505 "getdate.c" /* yacc.c:1646 */ +#line 1601 "getdate.c" break; case 12: -#line 222 "getdate.y" /* yacc.c:1646 */ - { +#line 222 "getdate.y" + { yyHour = (yyvsp[-3].Number); yyMinutes = (yyvsp[-1].Number); yyMeridian = MER24; @@ -1515,23 +1611,23 @@ yyreduce: ? -(yyvsp[0].Number) % 100 + (-(yyvsp[0].Number) / 100) * 60 : - ((yyvsp[0].Number) % 100 + ((yyvsp[0].Number) / 100) * 60)); } -#line 1519 "getdate.c" /* yacc.c:1646 */ +#line 1615 "getdate.c" break; case 13: -#line 231 "getdate.y" /* yacc.c:1646 */ - { +#line 231 "getdate.y" + { yyHour = (yyvsp[-5].Number); yyMinutes = (yyvsp[-3].Number); yySeconds = (yyvsp[-1].Number); yyMeridian = (yyvsp[0].Meridian); } -#line 1530 "getdate.c" /* yacc.c:1646 */ +#line 1626 "getdate.c" break; case 14: -#line 237 "getdate.y" /* yacc.c:1646 */ - { +#line 237 "getdate.y" + { yyHour = (yyvsp[-5].Number); yyMinutes = (yyvsp[-3].Number); yySeconds = (yyvsp[-1].Number); @@ -1541,72 +1637,72 @@ yyreduce: ? -(yyvsp[0].Number) % 100 + (-(yyvsp[0].Number) / 100) * 60 : - ((yyvsp[0].Number) % 100 + ((yyvsp[0].Number) / 100) * 60)); } -#line 1545 "getdate.c" /* yacc.c:1646 */ +#line 1641 "getdate.c" break; case 15: -#line 249 "getdate.y" /* yacc.c:1646 */ - { +#line 249 "getdate.y" + { yyTimezone = (yyvsp[0].Number); } -#line 1553 "getdate.c" /* yacc.c:1646 */ +#line 1649 "getdate.c" break; case 16: -#line 252 "getdate.y" /* yacc.c:1646 */ - { +#line 252 "getdate.y" + { yyTimezone = (yyvsp[0].Number) - 60; } -#line 1561 "getdate.c" /* yacc.c:1646 */ +#line 1657 "getdate.c" break; case 17: -#line 256 "getdate.y" /* yacc.c:1646 */ - { +#line 256 "getdate.y" + { yyTimezone = (yyvsp[-1].Number) - 60; } -#line 1569 "getdate.c" /* yacc.c:1646 */ +#line 1665 "getdate.c" break; case 18: -#line 261 "getdate.y" /* yacc.c:1646 */ - { +#line 261 "getdate.y" + { yyDayOrdinal = 1; yyDayNumber = (yyvsp[0].Number); } -#line 1578 "getdate.c" /* yacc.c:1646 */ +#line 1674 "getdate.c" break; case 19: -#line 265 "getdate.y" /* yacc.c:1646 */ - { +#line 265 "getdate.y" + { yyDayOrdinal = 1; yyDayNumber = (yyvsp[-1].Number); } -#line 1587 "getdate.c" /* yacc.c:1646 */ +#line 1683 "getdate.c" break; case 20: -#line 269 "getdate.y" /* yacc.c:1646 */ - { +#line 269 "getdate.y" + { yyDayOrdinal = (yyvsp[-1].Number); yyDayNumber = (yyvsp[0].Number); } -#line 1596 "getdate.c" /* yacc.c:1646 */ +#line 1692 "getdate.c" break; case 21: -#line 275 "getdate.y" /* yacc.c:1646 */ - { +#line 275 "getdate.y" + { yyMonth = (yyvsp[-2].Number); yyDay = (yyvsp[0].Number); } -#line 1605 "getdate.c" /* yacc.c:1646 */ +#line 1701 "getdate.c" break; case 22: -#line 279 "getdate.y" /* yacc.c:1646 */ - { +#line 279 "getdate.y" + { /* Interpret as YYYY/MM/DD if $1 >= 1000, otherwise as MM/DD/YY. The goal in recognizing YYYY/MM/DD is solely to support legacy machine-generated dates like those in an RCS log listing. If @@ -1624,72 +1720,72 @@ yyreduce: yyYear = (yyvsp[0].Number); } } -#line 1628 "getdate.c" /* yacc.c:1646 */ +#line 1724 "getdate.c" break; case 23: -#line 297 "getdate.y" /* yacc.c:1646 */ - { +#line 297 "getdate.y" + { /* ISO 8601 format. yyyy-mm-dd. */ yyYear = (yyvsp[-2].Number); yyMonth = -(yyvsp[-1].Number); yyDay = -(yyvsp[0].Number); } -#line 1639 "getdate.c" /* yacc.c:1646 */ +#line 1735 "getdate.c" break; case 24: -#line 303 "getdate.y" /* yacc.c:1646 */ - { +#line 303 "getdate.y" + { /* e.g. 17-JUN-1992. */ yyDay = (yyvsp[-2].Number); yyMonth = (yyvsp[-1].Number); yyYear = -(yyvsp[0].Number); } -#line 1650 "getdate.c" /* yacc.c:1646 */ +#line 1746 "getdate.c" break; case 25: -#line 309 "getdate.y" /* yacc.c:1646 */ - { +#line 309 "getdate.y" + { yyMonth = (yyvsp[-1].Number); yyDay = (yyvsp[0].Number); } -#line 1659 "getdate.c" /* yacc.c:1646 */ +#line 1755 "getdate.c" break; case 26: -#line 313 "getdate.y" /* yacc.c:1646 */ - { +#line 313 "getdate.y" + { yyMonth = (yyvsp[-3].Number); yyDay = (yyvsp[-2].Number); yyYear = (yyvsp[0].Number); } -#line 1669 "getdate.c" /* yacc.c:1646 */ +#line 1765 "getdate.c" break; case 27: -#line 318 "getdate.y" /* yacc.c:1646 */ - { +#line 318 "getdate.y" + { yyMonth = (yyvsp[0].Number); yyDay = (yyvsp[-1].Number); } -#line 1678 "getdate.c" /* yacc.c:1646 */ +#line 1774 "getdate.c" break; case 28: -#line 322 "getdate.y" /* yacc.c:1646 */ - { +#line 322 "getdate.y" + { yyMonth = (yyvsp[-1].Number); yyDay = (yyvsp[-2].Number); yyYear = (yyvsp[0].Number); } -#line 1688 "getdate.c" /* yacc.c:1646 */ +#line 1784 "getdate.c" break; case 29: -#line 329 "getdate.y" /* yacc.c:1646 */ - { +#line 329 "getdate.y" + { yyRelSeconds = -yyRelSeconds; yyRelMinutes = -yyRelMinutes; yyRelHour = -yyRelHour; @@ -1697,156 +1793,156 @@ yyreduce: yyRelMonth = -yyRelMonth; yyRelYear = -yyRelYear; } -#line 1701 "getdate.c" /* yacc.c:1646 */ +#line 1797 "getdate.c" break; case 31: -#line 340 "getdate.y" /* yacc.c:1646 */ - { +#line 340 "getdate.y" + { yyRelYear += (yyvsp[-1].Number) * (yyvsp[0].Number); } -#line 1709 "getdate.c" /* yacc.c:1646 */ +#line 1805 "getdate.c" break; case 32: -#line 343 "getdate.y" /* yacc.c:1646 */ - { +#line 343 "getdate.y" + { yyRelYear += (yyvsp[-1].Number) * (yyvsp[0].Number); } -#line 1717 "getdate.c" /* yacc.c:1646 */ +#line 1813 "getdate.c" break; case 33: -#line 346 "getdate.y" /* yacc.c:1646 */ - { +#line 346 "getdate.y" + { yyRelYear++; } -#line 1725 "getdate.c" /* yacc.c:1646 */ +#line 1821 "getdate.c" break; case 34: -#line 349 "getdate.y" /* yacc.c:1646 */ - { +#line 349 "getdate.y" + { yyRelMonth += (yyvsp[-1].Number) * (yyvsp[0].Number); } -#line 1733 "getdate.c" /* yacc.c:1646 */ +#line 1829 "getdate.c" break; case 35: -#line 352 "getdate.y" /* yacc.c:1646 */ - { +#line 352 "getdate.y" + { yyRelMonth += (yyvsp[-1].Number) * (yyvsp[0].Number); } -#line 1741 "getdate.c" /* yacc.c:1646 */ +#line 1837 "getdate.c" break; case 36: -#line 355 "getdate.y" /* yacc.c:1646 */ - { +#line 355 "getdate.y" + { yyRelMonth++; } -#line 1749 "getdate.c" /* yacc.c:1646 */ +#line 1845 "getdate.c" break; case 37: -#line 358 "getdate.y" /* yacc.c:1646 */ - { +#line 358 "getdate.y" + { yyRelDay += (yyvsp[-1].Number) * (yyvsp[0].Number); } -#line 1757 "getdate.c" /* yacc.c:1646 */ +#line 1853 "getdate.c" break; case 38: -#line 361 "getdate.y" /* yacc.c:1646 */ - { +#line 361 "getdate.y" + { yyRelDay += (yyvsp[-1].Number) * (yyvsp[0].Number); } -#line 1765 "getdate.c" /* yacc.c:1646 */ +#line 1861 "getdate.c" break; case 39: -#line 364 "getdate.y" /* yacc.c:1646 */ - { +#line 364 "getdate.y" + { yyRelDay++; } -#line 1773 "getdate.c" /* yacc.c:1646 */ +#line 1869 "getdate.c" break; case 40: -#line 367 "getdate.y" /* yacc.c:1646 */ - { +#line 367 "getdate.y" + { yyRelHour += (yyvsp[-1].Number) * (yyvsp[0].Number); } -#line 1781 "getdate.c" /* yacc.c:1646 */ +#line 1877 "getdate.c" break; case 41: -#line 370 "getdate.y" /* yacc.c:1646 */ - { +#line 370 "getdate.y" + { yyRelHour += (yyvsp[-1].Number) * (yyvsp[0].Number); } -#line 1789 "getdate.c" /* yacc.c:1646 */ +#line 1885 "getdate.c" break; case 42: -#line 373 "getdate.y" /* yacc.c:1646 */ - { +#line 373 "getdate.y" + { yyRelHour++; } -#line 1797 "getdate.c" /* yacc.c:1646 */ +#line 1893 "getdate.c" break; case 43: -#line 376 "getdate.y" /* yacc.c:1646 */ - { +#line 376 "getdate.y" + { yyRelMinutes += (yyvsp[-1].Number) * (yyvsp[0].Number); } -#line 1805 "getdate.c" /* yacc.c:1646 */ +#line 1901 "getdate.c" break; case 44: -#line 379 "getdate.y" /* yacc.c:1646 */ - { +#line 379 "getdate.y" + { yyRelMinutes += (yyvsp[-1].Number) * (yyvsp[0].Number); } -#line 1813 "getdate.c" /* yacc.c:1646 */ +#line 1909 "getdate.c" break; case 45: -#line 382 "getdate.y" /* yacc.c:1646 */ - { +#line 382 "getdate.y" + { yyRelMinutes++; } -#line 1821 "getdate.c" /* yacc.c:1646 */ +#line 1917 "getdate.c" break; case 46: -#line 385 "getdate.y" /* yacc.c:1646 */ - { +#line 385 "getdate.y" + { yyRelSeconds += (yyvsp[-1].Number) * (yyvsp[0].Number); } -#line 1829 "getdate.c" /* yacc.c:1646 */ +#line 1925 "getdate.c" break; case 47: -#line 388 "getdate.y" /* yacc.c:1646 */ - { +#line 388 "getdate.y" + { yyRelSeconds += (yyvsp[-1].Number) * (yyvsp[0].Number); } -#line 1837 "getdate.c" /* yacc.c:1646 */ +#line 1933 "getdate.c" break; case 48: -#line 391 "getdate.y" /* yacc.c:1646 */ - { +#line 391 "getdate.y" + { yyRelSeconds++; } -#line 1845 "getdate.c" /* yacc.c:1646 */ +#line 1941 "getdate.c" break; case 49: -#line 397 "getdate.y" /* yacc.c:1646 */ - { +#line 397 "getdate.y" + { if ((yyHaveTime != 0) && (yyHaveDate != 0) && (yyHaveRel == 0)) yyYear = (yyvsp[0].Number); else @@ -1876,27 +1972,28 @@ yyreduce: } } } -#line 1880 "getdate.c" /* yacc.c:1646 */ +#line 1976 "getdate.c" break; case 50: -#line 430 "getdate.y" /* yacc.c:1646 */ - { +#line 430 "getdate.y" + { (yyval.Meridian) = MER24; } -#line 1888 "getdate.c" /* yacc.c:1646 */ +#line 1984 "getdate.c" break; case 51: -#line 434 "getdate.y" /* yacc.c:1646 */ - { +#line 434 "getdate.y" + { (yyval.Meridian) = (yyvsp[0].Meridian); } -#line 1896 "getdate.c" /* yacc.c:1646 */ +#line 1992 "getdate.c" break; -#line 1900 "getdate.c" /* yacc.c:1646 */ +#line 1996 "getdate.c" + default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -1921,14 +2018,13 @@ yyreduce: /* 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; @@ -1960,7 +2056,7 @@ yyerrlab: { if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); + yymsg = YY_CAST (char *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc))); if (!yymsg) { yymsg = yymsgbuf; @@ -2011,12 +2107,10 @@ yyerrlab: | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; + /* Pacify compilers when the user code never invokes YYERROR and the + label yyerrorlab therefore never appears in user code. */ + if (0) + YYERROR; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ @@ -2078,6 +2172,7 @@ yyacceptlab: yyresult = 0; goto yyreturn; + /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ @@ -2085,6 +2180,7 @@ yyabortlab: yyresult = 1; goto yyreturn; + #if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | @@ -2095,6 +2191,10 @@ yyexhaustedlab: /* Fall through. */ #endif + +/*-----------------------------------------------------. +| yyreturn -- parsing is finished, return the result. | +`-----------------------------------------------------*/ yyreturn: if (yychar != YYEMPTY) { @@ -2111,7 +2211,7 @@ yyreturn: while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); + yystos[+*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow @@ -2124,7 +2224,7 @@ yyreturn: #endif return yyresult; } -#line 439 "getdate.y" /* yacc.c:1906 */ +#line 439 "getdate.y" /* Month and day table. */ |