summaryrefslogtreecommitdiff
path: root/lib/parse-datetime.c
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2013-02-16 14:42:43 +0000
committerIgor Pashev <pashev.igor@gmail.com>2013-02-16 14:42:43 +0000
commit974ab3dd887985e3aa347f3c6521f819296396a0 (patch)
tree802fb82c9f8ec8acd7a60fba7824c2df6f0073ad /lib/parse-datetime.c
parent8e7ba70eba02f88d4f3ba12e07ab9c7bdf32240a (diff)
downloadcoreutils-974ab3dd887985e3aa347f3c6521f819296396a0.tar.gz
Imported Upstream version 8.21upstream/8.21
Diffstat (limited to 'lib/parse-datetime.c')
-rw-r--r--lib/parse-datetime.c1703
1 files changed, 818 insertions, 885 deletions
diff --git a/lib/parse-datetime.c b/lib/parse-datetime.c
index 8790e8d1..5c21d0ba 100644
--- a/lib/parse-datetime.c
+++ b/lib/parse-datetime.c
@@ -1,19 +1,20 @@
-/* A Bison parser, made by GNU Bison 2.5.821-45d4c. */
-
-/* Bison implementation for Yacc-like parsers in C
-
- Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
+/* A Bison parser, made by GNU Bison 2.4.3. */
+/* Skeleton implementation for Bison's Yacc-like parsers in C
+
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+ 2009, 2010 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 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
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
@@ -26,7 +27,7 @@
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.
-
+
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
@@ -44,7 +45,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.5.821-45d4c"
+#define YYBISON_VERSION "2.4.3"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -64,12 +65,13 @@
/* Copy the first part of user declarations. */
-/* Line 269 of yacc.c */
+
+/* Line 189 of yacc.c */
#line 1 "parse-datetime.y"
/* Parse a string into an internal time stamp.
- Copyright (C) 1999-2000, 2002-2012 Free Software Foundation, Inc.
+ Copyright (C) 1999-2000, 2002-2013 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
@@ -181,6 +183,11 @@ typedef long int long_time_t;
typedef time_t long_time_t;
#endif
+/* Convert a possibly-signed character to an unsigned character. This is
+ a bit safer than casting to unsigned char, since it catches some type
+ errors that the cast doesn't. */
+static unsigned char to_uchar (char ch) { return ch; }
+
/* Lots of this code assumes time_t and time_t-like values fit into
long_time_t. */
verify (TYPE_MINIMUM (long_time_t) <= TYPE_MINIMUM (time_t)
@@ -346,16 +353,9 @@ set_hhmmss (parser_control *pc, long int hour, long int minutes,
}
-/* Line 269 of yacc.c */
-#line 351 "parse-datetime.c"
-# ifndef YY_NULL
-# if defined __cplusplus && 201103L <= __cplusplus
-# define YY_NULL nullptr
-# else
-# define YY_NULL 0
-# endif
-# endif
+/* Line 189 of yacc.c */
+#line 359 "parse-datetime.c"
/* Enabling traces. */
#ifndef YYDEBUG
@@ -432,8 +432,9 @@ set_hhmmss (parser_control *pc, long int hour, long int minutes,
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
{
-/* Line 296 of yacc.c */
-#line 292 "parse-datetime.y"
+
+/* Line 214 of yacc.c */
+#line 297 "parse-datetime.y"
long int intval;
textint textintval;
@@ -441,8 +442,9 @@ typedef union YYSTYPE
relative_time rel;
-/* Line 296 of yacc.c */
-#line 446 "parse-datetime.c"
+
+/* Line 214 of yacc.c */
+#line 448 "parse-datetime.c"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
@@ -452,8 +454,9 @@ typedef union YYSTYPE
/* Copy the second part of user declarations. */
-/* Line 346 of yacc.c */
-#line 457 "parse-datetime.c"
+
+/* Line 264 of yacc.c */
+#line 460 "parse-datetime.c"
#ifdef short
# undef short
@@ -556,12 +559,11 @@ YYID (yyi)
# define alloca _alloca
# else
# define YYSTACK_ALLOC alloca
-# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
+# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
- /* Use EXIT_SUCCESS as a witness for stdlib.h. */
-# ifndef EXIT_SUCCESS
-# define EXIT_SUCCESS 0
+# ifndef _STDLIB_H
+# define _STDLIB_H 1
# endif
# endif
# endif
@@ -584,24 +586,24 @@ YYID (yyi)
# ifndef YYSTACK_ALLOC_MAXIMUM
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
# endif
-# if (defined __cplusplus && ! defined EXIT_SUCCESS \
+# if (defined __cplusplus && ! defined _STDLIB_H \
&& ! ((defined YYMALLOC || defined malloc) \
- && (defined YYFREE || defined free)))
+ && (defined YYFREE || defined free)))
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# ifndef EXIT_SUCCESS
-# define EXIT_SUCCESS 0
+# ifndef _STDLIB_H
+# define _STDLIB_H 1
# endif
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
-# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
+# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# ifndef YYFREE
# define YYFREE free
-# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
+# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
@@ -612,7 +614,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
#if (! defined yyoverflow \
&& (! defined __cplusplus \
- || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
@@ -630,46 +632,42 @@ union yyalloc
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
-# define YYCOPY_NEEDED 1
+/* 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 \
+ { \
+ YYSIZE_T yyi; \
+ for (yyi = 0; yyi < (Count); yyi++) \
+ (To)[yyi] = (From)[yyi]; \
+ } \
+ while (YYID (0))
+# endif
+# endif
/* 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_alloc, Stack) \
- do \
- { \
- YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
- Stack = &yyptr->Stack_alloc; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
- yyptr += yynewbytes / sizeof (*yyptr); \
- } \
+# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
+ do \
+ { \
+ YYSIZE_T yynewbytes; \
+ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
+ Stack = &yyptr->Stack_alloc; \
+ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+ yyptr += yynewbytes / sizeof (*yyptr); \
+ } \
while (YYID (0))
#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, (Count) * sizeof (*(Src)))
-# else
-# define YYCOPY(Dst, Src, Count) \
- do \
- { \
- YYSIZE_T yyi; \
- for (yyi = 0; yyi < (Count); yyi++) \
- (Dst)[yyi] = (Src)[yyi]; \
- } \
- while (YYID (0))
-# endif
-# endif
-#endif /* !YYCOPY_NEEDED */
-
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 12
/* YYLAST -- Last index in YYTABLE. */
@@ -681,19 +679,17 @@ union yyalloc
#define YYNNTS 26
/* YYNRULES -- Number of rules. */
#define YYNRULES 91
-/* YYNSTATES -- Number of states. */
+/* YYNRULES -- Number of states. */
#define YYNSTATES 114
-/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
- by yylex, with out-of-bounds checking. */
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
#define YYMAXUTOK 277
-#define YYTRANSLATE(YYX) \
+#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
- as returned by yylex, without out-of-bounds checking. */
+/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
static const yytype_uint8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -727,19 +723,66 @@ static const yytype_uint8 yytranslate[] =
};
#if YYDEBUG
- /* YYRLINEYYN -- Source line where rule number YYN was defined. */
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+ YYRHS. */
+static const yytype_uint8 yyprhs[] =
+{
+ 0, 0, 3, 5, 7, 10, 11, 14, 16, 18,
+ 20, 22, 24, 26, 28, 30, 32, 34, 38, 41,
+ 46, 53, 55, 58, 63, 70, 71, 73, 76, 78,
+ 81, 83, 85, 88, 91, 95, 97, 100, 102, 105,
+ 108, 111, 115, 121, 125, 129, 132, 137, 140, 144,
+ 146, 150, 153, 155, 157, 160, 163, 165, 168, 171,
+ 173, 176, 179, 181, 184, 187, 189, 192, 195, 197,
+ 200, 203, 206, 209, 211, 213, 216, 219, 222, 225,
+ 228, 231, 233, 235, 237, 239, 241, 243, 245, 247,
+ 250, 251
+};
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS. */
+static const yytype_int8 yyrhs[] =
+{
+ 29, 0, -1, 30, -1, 31, -1, 23, 48, -1,
+ -1, 31, 32, -1, 33, -1, 35, -1, 39, -1,
+ 40, -1, 42, -1, 41, -1, 44, -1, 51, -1,
+ 52, -1, 34, -1, 43, 24, 36, -1, 20, 15,
+ -1, 20, 25, 20, 15, -1, 20, 25, 20, 25,
+ 50, 15, -1, 36, -1, 20, 38, -1, 20, 25,
+ 20, 37, -1, 20, 25, 20, 25, 50, 37, -1,
+ -1, 38, -1, 19, 53, -1, 14, -1, 14, 4,
+ -1, 18, -1, 24, -1, 18, 46, -1, 24, 46,
+ -1, 18, 19, 53, -1, 13, -1, 18, 4, -1,
+ 12, -1, 12, 26, -1, 17, 12, -1, 20, 12,
+ -1, 20, 27, 20, -1, 20, 27, 20, 27, 20,
+ -1, 20, 16, 19, -1, 16, 19, 19, -1, 16,
+ 20, -1, 16, 20, 26, 20, -1, 20, 16, -1,
+ 20, 16, 20, -1, 43, -1, 20, 19, 19, -1,
+ 45, 3, -1, 45, -1, 47, -1, 17, 5, -1,
+ 20, 5, -1, 5, -1, 17, 6, -1, 20, 6,
+ -1, 6, -1, 17, 10, -1, 20, 10, -1, 10,
+ -1, 17, 7, -1, 20, 7, -1, 7, -1, 17,
+ 8, -1, 20, 8, -1, 8, -1, 17, 9, -1,
+ 20, 9, -1, 21, 9, -1, 22, 9, -1, 9,
+ -1, 46, -1, 19, 5, -1, 19, 6, -1, 19,
+ 10, -1, 19, 7, -1, 19, 8, -1, 19, 9,
+ -1, 11, -1, 49, -1, 50, -1, 21, -1, 19,
+ -1, 22, -1, 20, -1, 20, -1, 20, 46, -1,
+ -1, 25, 20, -1
+};
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 319, 319, 320, 324, 331, 333, 337, 339, 341,
- 343, 345, 347, 349, 350, 351, 355, 359, 363, 368,
- 373, 378, 382, 387, 392, 399, 401, 405, 413, 418,
- 428, 430, 432, 435, 438, 440, 442, 447, 452, 457,
- 462, 470, 475, 495, 503, 511, 516, 522, 527, 533,
- 537, 547, 549, 551, 556, 558, 560, 562, 564, 566,
- 568, 570, 572, 574, 576, 578, 580, 582, 584, 586,
- 588, 590, 592, 594, 596, 600, 602, 604, 606, 608,
- 610, 615, 619, 619, 622, 623, 628, 629, 634, 639,
- 650, 651
+ 0, 324, 324, 325, 329, 336, 338, 342, 344, 346,
+ 348, 350, 352, 354, 355, 356, 360, 364, 368, 373,
+ 378, 383, 387, 392, 397, 404, 406, 410, 418, 423,
+ 433, 435, 437, 440, 443, 445, 447, 452, 457, 462,
+ 467, 475, 480, 500, 508, 516, 521, 527, 532, 538,
+ 542, 552, 554, 556, 561, 563, 565, 567, 569, 571,
+ 573, 575, 577, 579, 581, 583, 585, 587, 589, 591,
+ 593, 595, 597, 599, 601, 605, 607, 609, 611, 613,
+ 615, 620, 624, 624, 627, 628, 633, 634, 639, 644,
+ 655, 656
};
#endif
@@ -757,13 +800,13 @@ static const char *const yytname[] =
"iso_8601_time", "o_zone_offset", "zone_offset", "local_zone", "zone",
"day", "date", "iso_8601_date", "rel", "relunit", "relunit_snumber",
"dayshift", "seconds", "signed_seconds", "unsigned_seconds", "number",
- "hybrid", "o_colon_minutes", YY_NULL
+ "hybrid", "o_colon_minutes", 0
};
#endif
# ifdef YYPRINT
-/* YYTOKNUM[NUM] -- (External) token number corresponding to the
- (internal) symbol number NUM (which must be that of a token). */
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+ token YYLEX-NUM. */
static const yytype_uint16 yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
@@ -772,37 +815,39 @@ static const yytype_uint16 yytoknum[] =
};
# endif
-#define YYPACT_NINF -93
-
-#define yypact_value_is_default(yystate) \
- ((yystate) == (-93))
-
-#define YYTABLE_NINF -1
-
-#define yytable_value_is_error(yytable_value) \
- YYID (0)
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
+static const yytype_uint8 yyr1[] =
+{
+ 0, 28, 29, 29, 30, 31, 31, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 33, 34, 35, 35,
+ 35, 35, 36, 36, 36, 37, 37, 38, 39, 39,
+ 40, 40, 40, 40, 40, 40, 40, 41, 41, 41,
+ 41, 42, 42, 42, 42, 42, 42, 42, 42, 42,
+ 43, 44, 44, 44, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 46, 46, 46, 46, 46,
+ 46, 47, 48, 48, 49, 49, 50, 50, 51, 52,
+ 53, 53
+};
- /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
- STATE-NUM. */
-static const yytype_int8 yypact[] =
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
+static const yytype_uint8 yyr2[] =
{
- 38, 27, 77, -93, 46, -93, -93, -93, -93, -93,
- -93, -93, -93, -93, -93, -93, -93, -93, -93, -93,
- 62, -93, 82, -3, 66, 3, 74, -4, 83, 84,
- 75, -93, -93, -93, -93, -93, -93, -93, -93, -93,
- 71, -93, 93, -93, -93, -93, -93, -93, -93, 78,
- 72, -93, -93, -93, -93, -93, -93, -93, -93, 25,
- -93, -93, -93, -93, -93, -93, -93, -93, -93, -93,
- -93, -93, -93, -93, -93, 21, 19, 79, 80, -93,
- -93, -93, -93, -93, 81, -93, -93, 85, 86, -93,
- -93, -93, -93, -93, -6, 76, 17, -93, -93, -93,
- -93, 87, 69, -93, -93, 88, 89, -1, -93, 18,
- -93, -93, 69, 91
+ 0, 2, 1, 1, 2, 0, 2, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 3, 2, 4,
+ 6, 1, 2, 4, 6, 0, 1, 2, 1, 2,
+ 1, 1, 2, 2, 3, 1, 2, 1, 2, 2,
+ 2, 3, 5, 3, 3, 2, 4, 2, 3, 1,
+ 3, 2, 1, 1, 2, 2, 1, 2, 2, 1,
+ 2, 2, 1, 2, 2, 1, 2, 2, 1, 2,
+ 2, 2, 2, 1, 1, 2, 2, 2, 2, 2,
+ 2, 1, 1, 1, 1, 1, 1, 1, 1, 2,
+ 0, 2
};
- /* YYDEFACT[S] -- default reduction number in state S. Performed when
- YYTABLE does not specify something else to do. Zero means the default
- is an error. */
+/* 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 yytype_uint8 yydefact[] =
{
5, 0, 0, 2, 3, 85, 87, 84, 86, 4,
@@ -819,15 +864,7 @@ static const yytype_uint8 yydefact[] =
20, 24, 0, 25
};
- /* YYPGOTO[NTERM-NUM]. */
-static const yytype_int8 yypgoto[] =
-{
- -93, -93, -93, -93, -93, -93, -93, -93, 20, -68,
- -27, -93, -93, -93, -93, -93, -93, -93, 60, -93,
- -93, -93, -92, -93, -93, 43
-};
-
- /* YYDEFGOTO[NTERM-NUM]. */
+/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int8 yydefgoto[] =
{
-1, 2, 3, 4, 31, 32, 33, 34, 35, 103,
@@ -835,9 +872,38 @@ static const yytype_int8 yydefgoto[] =
9, 10, 11, 45, 46, 93
};
- /* 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 YYTABLE_NINF, syntax error. */
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+ STATE-NUM. */
+#define YYPACT_NINF -93
+static const yytype_int8 yypact[] =
+{
+ 38, 27, 77, -93, 46, -93, -93, -93, -93, -93,
+ -93, -93, -93, -93, -93, -93, -93, -93, -93, -93,
+ 62, -93, 82, -3, 66, 3, 74, -4, 83, 84,
+ 75, -93, -93, -93, -93, -93, -93, -93, -93, -93,
+ 71, -93, 93, -93, -93, -93, -93, -93, -93, 78,
+ 72, -93, -93, -93, -93, -93, -93, -93, -93, 25,
+ -93, -93, -93, -93, -93, -93, -93, -93, -93, -93,
+ -93, -93, -93, -93, -93, 21, 19, 79, 80, -93,
+ -93, -93, -93, -93, 81, -93, -93, 85, 86, -93,
+ -93, -93, -93, -93, -6, 76, 17, -93, -93, -93,
+ -93, 87, 69, -93, -93, 88, 89, -1, -93, 18,
+ -93, -93, 69, 91
+};
+
+/* YYPGOTO[NTERM-NUM]. */
+static const yytype_int8 yypgoto[] =
+{
+ -93, -93, -93, -93, -93, -93, -93, -93, 20, -68,
+ -27, -93, -93, -93, -93, -93, -93, -93, 60, -93,
+ -93, -93, -92, -93, -93, 43
+};
+
+/* 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 yytype_uint8 yytable[] =
{
79, 67, 68, 69, 70, 71, 72, 58, 73, 100,
@@ -870,8 +936,8 @@ static const yytype_int8 yycheck[] =
19, -1, 25
};
- /* STOS_[STATE-NUM] -- The (internal number of the) accessing
- symbol of state STATE-NUM. */
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+ symbol of state STATE-NUM. */
static const yytype_uint8 yystos[] =
{
0, 23, 29, 30, 31, 19, 20, 21, 22, 48,
@@ -888,45 +954,14 @@ static const yytype_uint8 yystos[] =
15, 37, 25, 50
};
- /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const yytype_uint8 yyr1[] =
-{
- 0, 28, 29, 29, 30, 31, 31, 32, 32, 32,
- 32, 32, 32, 32, 32, 32, 33, 34, 35, 35,
- 35, 35, 36, 36, 36, 37, 37, 38, 39, 39,
- 40, 40, 40, 40, 40, 40, 40, 41, 41, 41,
- 41, 42, 42, 42, 42, 42, 42, 42, 42, 42,
- 43, 44, 44, 44, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 46, 46, 46, 46, 46,
- 46, 47, 48, 48, 49, 49, 50, 50, 51, 52,
- 53, 53
-};
-
- /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
-static const yytype_uint8 yyr2[] =
-{
- 0, 2, 1, 1, 2, 0, 2, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 3, 2, 4,
- 6, 1, 2, 4, 6, 0, 1, 2, 1, 2,
- 1, 1, 2, 2, 3, 1, 2, 1, 2, 2,
- 2, 3, 5, 3, 3, 2, 4, 2, 3, 1,
- 3, 2, 1, 1, 2, 2, 1, 2, 2, 1,
- 2, 2, 1, 2, 2, 1, 2, 2, 1, 2,
- 2, 2, 2, 1, 1, 2, 2, 2, 2, 2,
- 2, 1, 1, 1, 1, 1, 1, 1, 1, 2,
- 0, 2
-};
-
-
-#define yyerrok (yyerrstatus = 0)
-#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY (-2)
-#define YYEOF 0
+#define yyerrok (yyerrstatus = 0)
+#define yyclearin (yychar = YYEMPTY)
+#define YYEMPTY (-2)
+#define YYEOF 0
-#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
-#define YYERROR goto yyerrorlab
+#define YYACCEPT goto yyacceptlab
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrorlab
/* Like YYERROR except do call yyerror. This remains here temporarily
@@ -936,7 +971,7 @@ static const yytype_uint8 yyr2[] =
in Bison 2.4.2's NEWS entry, where a plan to phase it out is
discussed. */
-#define YYFAIL goto yyerrlab
+#define YYFAIL goto yyerrlab
#if defined YYFAIL
/* This is here to suppress warnings from the GCC cpp's
-Wunused-macros. Normally we don't worry about that warning, but
@@ -946,26 +981,26 @@ 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 \
- { \
+#define YYBACKUP(Token, Value) \
+do \
+ if (yychar == YYEMPTY && yylen == 1) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ yytoken = YYTRANSLATE (yychar); \
+ YYPOPSTACK (1); \
+ goto yybackup; \
+ } \
+ else \
+ { \
yyerror (pc, YY_("syntax error: cannot back up")); \
- YYERROR; \
- } \
+ YYERROR; \
+ } \
while (YYID (0))
-#define YYTERROR 1
-#define YYERRCODE 256
+#define YYTERROR 1
+#define YYERRCODE 256
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
@@ -974,30 +1009,39 @@ while (YYID (0))
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- do \
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+ do \
if (YYID (N)) \
- { \
- (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
- (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
- (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
- (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
- } \
- else \
- { \
- (Current).first_line = (Current).last_line = \
- YYRHSLOC (Rhs, 0).last_line; \
- (Current).first_column = (Current).last_column = \
- YYRHSLOC (Rhs, 0).last_column; \
- } \
+ { \
+ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
+ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
+ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
+ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
+ } \
+ else \
+ { \
+ (Current).first_line = (Current).last_line = \
+ YYRHSLOC (Rhs, 0).last_line; \
+ (Current).first_column = (Current).last_column = \
+ YYRHSLOC (Rhs, 0).last_column; \
+ } \
while (YYID (0))
#endif
-/* This macro is provided for backward compatibility. */
+/* YY_LOCATION_PRINT -- Print the location on the stream.
+ This macro was not mandated originally: define only if we know
+ we won't break user code: when these are the locations we know. */
#ifndef YY_LOCATION_PRINT
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
+# define YY_LOCATION_PRINT(File, Loc) \
+ fprintf (File, "%d.%d-%d.%d", \
+ (Loc).first_line, (Loc).first_column, \
+ (Loc).last_line, (Loc).last_column)
+# else
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
#endif
@@ -1017,21 +1061,21 @@ while (YYID (0))
# define YYFPRINTF fprintf
# endif
-# define YYDPRINTF(Args) \
-do { \
- if (yydebug) \
- YYFPRINTF Args; \
+# define YYDPRINTF(Args) \
+do { \
+ if (yydebug) \
+ YYFPRINTF Args; \
} while (YYID (0))
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
-do { \
- if (yydebug) \
- { \
- YYFPRINTF (stderr, "%s ", Title); \
- yy_symbol_print (stderr, \
- Type, Value, pc); \
- YYFPRINTF (stderr, "\n"); \
- } \
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
+do { \
+ if (yydebug) \
+ { \
+ YYFPRINTF (stderr, "%s ", Title); \
+ yy_symbol_print (stderr, \
+ Type, Value, pc); \
+ YYFPRINTF (stderr, "\n"); \
+ } \
} while (YYID (0))
@@ -1053,18 +1097,19 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, pc)
parser_control *pc;
#endif
{
- YYUSE(yyoutput);
- YYUSE (pc);
if (!yyvaluep)
return;
+ YYUSE (pc);
# ifdef YYPRINT
if (yytype < YYNTOKENS)
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# else
+ YYUSE (yyoutput);
# endif
switch (yytype)
{
default:
- break;
+ break;
}
}
@@ -1120,10 +1165,10 @@ yy_stack_print (yybottom, yytop)
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 (YYID (0))
@@ -1134,37 +1179,35 @@ do { \
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
-yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, parser_control *pc)
+yy_reduce_print (YYSTYPE *yyvsp, int yyrule, parser_control *pc)
#else
static void
-yy_reduce_print (yyssp, yyvsp, yyrule, pc)
- yytype_int16 *yyssp;
+yy_reduce_print (yyvsp, yyrule, pc)
YYSTYPE *yyvsp;
int yyrule;
parser_control *pc;
#endif
{
- unsigned long int yylno = yyrline[yyrule];
int yynrhs = yyr2[yyrule];
int yyi;
+ unsigned long int yylno = yyrline[yyrule];
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
- yyrule - 1, yylno);
+ 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)])
- , pc);
+ yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
+ &(yyvsp[(yyi + 1) - (yynrhs)])
+ , pc);
YYFPRINTF (stderr, "\n");
}
}
-# define YY_REDUCE_PRINT(Rule) \
-do { \
- if (yydebug) \
- yy_reduce_print (yyssp, yyvsp, Rule, pc); \
+# define YY_REDUCE_PRINT(Rule) \
+do { \
+ if (yydebug) \
+ yy_reduce_print (yyvsp, Rule, pc); \
} while (YYID (0))
/* Nonzero means print parse trace. It is left uninitialized so that
@@ -1179,7 +1222,7 @@ int yydebug;
/* YYINITDEPTH -- initial size of the parser's stacks. */
-#ifndef YYINITDEPTH
+#ifndef YYINITDEPTH
# define YYINITDEPTH 200
#endif
@@ -1194,6 +1237,7 @@ int yydebug;
# define YYMAXDEPTH 10000
#endif
+
#if YYERROR_VERBOSE
@@ -1265,27 +1309,27 @@ yytnamerr (char *yyres, const char *yystr)
char const *yyp = yystr;
for (;;)
- switch (*++yyp)
- {
- case '\'':
- case ',':
- goto do_not_strip_quotes;
-
- case '\\':
- if (*++yyp != '\\')
- goto do_not_strip_quotes;
- /* Fall through. */
- default:
- if (yyres)
- yyres[yyn] = *yyp;
- yyn++;
- break;
-
- case '"':
- if (yyres)
- yyres[yyn] = '\0';
- return yyn;
- }
+ switch (*++yyp)
+ {
+ case '\'':
+ case ',':
+ goto do_not_strip_quotes;
+
+ case '\\':
+ if (*++yyp != '\\')
+ goto do_not_strip_quotes;
+ /* Fall through. */
+ default:
+ if (yyres)
+ yyres[yyn] = *yyp;
+ yyn++;
+ break;
+
+ case '"':
+ if (yyres)
+ yyres[yyn] = '\0';
+ return yyn;
+ }
do_not_strip_quotes: ;
}
@@ -1296,142 +1340,115 @@ yytnamerr (char *yyres, const char *yystr)
}
# endif
-/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
- about the unexpected token YYTOKEN for the state stack whose top is
- YYSSP.
-
- Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
- not large enough to hold the message. In that case, also set
- *YYMSG_ALLOC to the required number of bytes. Return 2 if the
- required number of bytes is too large to store. */
-static int
-yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
- yytype_int16 *yyssp, int yytoken)
+/* Copy into YYRESULT an error message about the unexpected token
+ YYCHAR while in state YYSTATE. Return the number of bytes copied,
+ including the terminating null byte. If YYRESULT is null, do not
+ copy anything; just return the number of bytes that would be
+ copied. As a special case, return 0 if an ordinary "syntax error"
+ message will do. Return YYSIZE_MAXIMUM if overflow occurs during
+ size calculation. */
+static YYSIZE_T
+yysyntax_error (char *yyresult, int yystate, int yychar)
{
- YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
- YYSIZE_T yysize = yysize0;
- YYSIZE_T yysize1;
- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
- /* Internationalized format string. */
- const char *yyformat = YY_NULL;
- /* Arguments of yyformat. */
- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
- /* Number of reported tokens (one for the "unexpected", one per
- "expected"). */
- int yycount = 0;
-
- /* There are many possibilities here to consider:
- - Assume YYFAIL is not used. It's too flawed to consider. See
- <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
- for details. YYERROR is fine as it does not invoke this
- function.
- - If this state is a consistent state with a default action, then
- the only way this function was invoked is if the default action
- is an error action. In that case, don't check for expected
- tokens because there are none.
- - The only way there can be no lookahead present (in yychar) is if
- this state is a consistent state with a default action. Thus,
- detecting the absence of a lookahead is sufficient to determine
- that there is no unexpected or expected token to report. In that
- case, just report a simple "syntax error".
- - Don't assume there isn't a lookahead just because this state is a
- consistent state with a default action. There might have been a
- previous inconsistent state, consistent state with a non-default
- action, or user semantic action that manipulated yychar.
- - Of course, the expected token list depends on states to have
- correct lookahead information, and it depends on the parser not
- to perform extra reductions after fetching a lookahead from the
- scanner and before detecting a syntax error. Thus, state merging
- (from LALR or IELR) and default reductions corrupt the expected
- token list. However, the list is correct for canonical LR with
- one exception: it will still contain any token that will not be
- accepted due to an error action in a later state.
- */
- if (yytoken != YYEMPTY)
- {
- int yyn = yypact[*yyssp];
- yyarg[yycount++] = yytname[yytoken];
- if (!yypact_value_is_default (yyn))
- {
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. In other words, skip the first -YYN actions for
- this state because they are default actions. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn + 1;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yyx;
-
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
- && !yytable_value_is_error (yytable[yyx + yyn]))
- {
- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
- {
- yycount = 1;
- yysize = yysize0;
- break;
- }
- yyarg[yycount++] = yytname[yyx];
- yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
- if (! (yysize <= yysize1
- && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
- return 2;
- yysize = yysize1;
- }
- }
- }
+ int yyn = yypact[yystate];
- switch (yycount)
- {
-# define YYCASE_(N, S) \
- case N: \
- yyformat = S; \
- break
- YYCASE_(0, YY_("syntax error"));
- YYCASE_(1, YY_("syntax error, unexpected %s"));
- YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
- YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
- YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
- YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
-# undef YYCASE_
- }
-
- yysize1 = yysize + yystrlen (yyformat);
- if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
- return 2;
- yysize = yysize1;
-
- if (*yymsg_alloc < yysize)
+ if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
+ return 0;
+ else
{
- *yymsg_alloc = 2 * yysize;
- if (! (yysize <= *yymsg_alloc
- && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
- *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
- return 1;
+ int yytype = YYTRANSLATE (yychar);
+ YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
+ YYSIZE_T yysize = yysize0;
+ YYSIZE_T yysize1;
+ int yysize_overflow = 0;
+ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+ int yyx;
+
+# if 0
+ /* This is so xgettext sees the translatable formats that are
+ constructed on the fly. */
+ YY_("syntax error, unexpected %s");
+ YY_("syntax error, unexpected %s, expecting %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s or %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
+# endif
+ char *yyfmt;
+ char const *yyf;
+ static char const yyunexpected[] = "syntax error, unexpected %s";
+ static char const yyexpecting[] = ", expecting %s";
+ static char const yyor[] = " or %s";
+ char yyformat[sizeof yyunexpected
+ + sizeof yyexpecting - 1
+ + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
+ * (sizeof yyor - 1))];
+ char const *yyprefix = yyexpecting;
+
+ /* 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 + 1;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yycount = 1;
+
+ yyarg[0] = yytname[yytype];
+ yyfmt = yystpcpy (yyformat, yyunexpected);
+
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+ {
+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+ {
+ yycount = 1;
+ yysize = yysize0;
+ yyformat[sizeof yyunexpected - 1] = '\0';
+ break;
+ }
+ yyarg[yycount++] = yytname[yyx];
+ yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+ yysize_overflow |= (yysize1 < yysize);
+ yysize = yysize1;
+ yyfmt = yystpcpy (yyfmt, yyprefix);
+ yyprefix = yyor;
+ }
+
+ yyf = YY_(yyformat);
+ yysize1 = yysize + yystrlen (yyf);
+ yysize_overflow |= (yysize1 < yysize);
+ yysize = yysize1;
+
+ if (yysize_overflow)
+ return YYSIZE_MAXIMUM;
+
+ if (yyresult)
+ {
+ /* Avoid sprintf, as that infringes on the user's name space.
+ Don't have undefined behavior even if the translation
+ produced a string with the wrong number of "%s"s. */
+ char *yyp = yyresult;
+ int yyi = 0;
+ while ((*yyp = *yyf) != '\0')
+ {
+ if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+ {
+ yyp += yytnamerr (yyp, yyarg[yyi++]);
+ yyf += 2;
+ }
+ else
+ {
+ yyp++;
+ yyf++;
+ }
+ }
+ }
+ return yysize;
}
-
- /* Avoid sprintf, as that infringes on the user's name space.
- Don't have undefined behavior even if the translation
- produced a string with the wrong number of "%s"s. */
- {
- char *yyp = *yymsg;
- int yyi = 0;
- while ((*yyp = *yyformat) != '\0')
- if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
- {
- yyp += yytnamerr (yyp, yyarg[yyi++]);
- yyformat += 2;
- }
- else
- {
- yyp++;
- yyformat++;
- }
- }
- return 0;
}
#endif /* YYERROR_VERBOSE */
+
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
@@ -1451,31 +1468,30 @@ yydestruct (yymsg, yytype, yyvaluep, pc)
parser_control *pc;
#endif
{
- YYUSE(yyvaluep);
+ YYUSE (yyvaluep);
YYUSE (pc);
+
if (!yymsg)
yymsg = "Deleting";
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
switch (yytype)
{
+
default:
- break;
+ break;
}
}
-
/* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
+#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
#else
int yyparse ();
#endif
#else /* ! YYPARSE_PARAM */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
+#if defined __STDC__ || defined __cplusplus
int yyparse (parser_control *pc);
#else
int yyparse ();
@@ -1483,9 +1499,12 @@ int yyparse ();
#endif /* ! YYPARSE_PARAM */
-/*----------.
-| yyparse. |
-`----------*/
+
+
+
+/*-------------------------.
+| yyparse or yypush_parse. |
+`-------------------------*/
#ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \
@@ -1601,23 +1620,23 @@ YYSTYPE yylval;
#ifdef 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;
- 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),
- &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. */
+ 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),
+ &yystacksize);
+
+ yyss = yyss1;
+ yyvs = yyvs1;
}
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
@@ -1625,22 +1644,22 @@ YYSTYPE yylval;
# else
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
- goto yyexhaustedlab;
+ goto yyexhaustedlab;
yystacksize *= 2;
if (YYMAXDEPTH < yystacksize)
- yystacksize = YYMAXDEPTH;
+ yystacksize = YYMAXDEPTH;
{
- yytype_int16 *yyss1 = yyss;
- union yyalloc *yyptr =
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
- if (! yyptr)
- goto yyexhaustedlab;
- YYSTACK_RELOCATE (yyss_alloc, yyss);
- YYSTACK_RELOCATE (yyvs_alloc, yyvs);
+ yytype_int16 *yyss1 = yyss;
+ union yyalloc *yyptr =
+ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+ if (! yyptr)
+ goto yyexhaustedlab;
+ 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 */
@@ -1649,10 +1668,10 @@ YYSTYPE yylval;
yyvsp = yyvs + yysize - 1;
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
+ (unsigned long int) yystacksize));
if (yyss + yystacksize - 1 <= yyssp)
- YYABORT;
+ YYABORT;
}
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
@@ -1672,7 +1691,7 @@ yybackup:
/* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
- if (yypact_value_is_default (yyn))
+ if (yyn == YYPACT_NINF)
goto yydefault;
/* Not known => get a lookahead token if don't already have one. */
@@ -1703,8 +1722,8 @@ yybackup:
yyn = yytable[yyn];
if (yyn <= 0)
{
- if (yytable_value_is_error (yyn))
- goto yyerrlab;
+ if (yyn == 0 || yyn == YYTABLE_NINF)
+ goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
@@ -1758,698 +1777,616 @@ yyreduce:
switch (yyn)
{
case 4:
-/* Line 1744 of yacc.c */
-#line 325 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 330 "parse-datetime.y"
{
- pc->seconds = (yyvsp[0].timespec);
+ pc->seconds = (yyvsp[(2) - (2)].timespec);
pc->timespec_seen = true;
}
-/* Line 1744 of yacc.c */
-#line 1769 "parse-datetime.c"
break;
case 7:
-/* Line 1744 of yacc.c */
-#line 338 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 343 "parse-datetime.y"
{ pc->times_seen++; pc->dates_seen++; }
-/* Line 1744 of yacc.c */
-#line 1777 "parse-datetime.c"
break;
case 8:
-/* Line 1744 of yacc.c */
-#line 340 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 345 "parse-datetime.y"
{ pc->times_seen++; }
-/* Line 1744 of yacc.c */
-#line 1785 "parse-datetime.c"
break;
case 9:
-/* Line 1744 of yacc.c */
-#line 342 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 347 "parse-datetime.y"
{ pc->local_zones_seen++; }
-/* Line 1744 of yacc.c */
-#line 1793 "parse-datetime.c"
break;
case 10:
-/* Line 1744 of yacc.c */
-#line 344 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 349 "parse-datetime.y"
{ pc->zones_seen++; }
-/* Line 1744 of yacc.c */
-#line 1801 "parse-datetime.c"
break;
case 11:
-/* Line 1744 of yacc.c */
-#line 346 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 351 "parse-datetime.y"
{ pc->dates_seen++; }
-/* Line 1744 of yacc.c */
-#line 1809 "parse-datetime.c"
break;
case 12:
-/* Line 1744 of yacc.c */
-#line 348 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 353 "parse-datetime.y"
{ pc->days_seen++; }
-/* Line 1744 of yacc.c */
-#line 1817 "parse-datetime.c"
break;
case 18:
-/* Line 1744 of yacc.c */
-#line 364 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 369 "parse-datetime.y"
{
- set_hhmmss (pc, (yyvsp[-1].textintval).value, 0, 0, 0);
- pc->meridian = (yyvsp[0].intval);
+ set_hhmmss (pc, (yyvsp[(1) - (2)].textintval).value, 0, 0, 0);
+ pc->meridian = (yyvsp[(2) - (2)].intval);
}
-/* Line 1744 of yacc.c */
-#line 1828 "parse-datetime.c"
break;
case 19:
-/* Line 1744 of yacc.c */
-#line 369 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 374 "parse-datetime.y"
{
- set_hhmmss (pc, (yyvsp[-3].textintval).value, (yyvsp[-1].textintval).value, 0, 0);
- pc->meridian = (yyvsp[0].intval);
+ set_hhmmss (pc, (yyvsp[(1) - (4)].textintval).value, (yyvsp[(3) - (4)].textintval).value, 0, 0);
+ pc->meridian = (yyvsp[(4) - (4)].intval);
}
-/* Line 1744 of yacc.c */
-#line 1839 "parse-datetime.c"
break;
case 20:
-/* Line 1744 of yacc.c */
-#line 374 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 379 "parse-datetime.y"
{
- set_hhmmss (pc, (yyvsp[-5].textintval).value, (yyvsp[-3].textintval).value, (yyvsp[-1].timespec).tv_sec, (yyvsp[-1].timespec).tv_nsec);
- pc->meridian = (yyvsp[0].intval);
+ set_hhmmss (pc, (yyvsp[(1) - (6)].textintval).value, (yyvsp[(3) - (6)].textintval).value, (yyvsp[(5) - (6)].timespec).tv_sec, (yyvsp[(5) - (6)].timespec).tv_nsec);
+ pc->meridian = (yyvsp[(6) - (6)].intval);
}
-/* Line 1744 of yacc.c */
-#line 1850 "parse-datetime.c"
break;
case 22:
-/* Line 1744 of yacc.c */
-#line 383 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 388 "parse-datetime.y"
{
- set_hhmmss (pc, (yyvsp[-1].textintval).value, 0, 0, 0);
+ set_hhmmss (pc, (yyvsp[(1) - (2)].textintval).value, 0, 0, 0);
pc->meridian = MER24;
}
-/* Line 1744 of yacc.c */
-#line 1861 "parse-datetime.c"
break;
case 23:
-/* Line 1744 of yacc.c */
-#line 388 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 393 "parse-datetime.y"
{
- set_hhmmss (pc, (yyvsp[-3].textintval).value, (yyvsp[-1].textintval).value, 0, 0);
+ set_hhmmss (pc, (yyvsp[(1) - (4)].textintval).value, (yyvsp[(3) - (4)].textintval).value, 0, 0);
pc->meridian = MER24;
}
-/* Line 1744 of yacc.c */
-#line 1872 "parse-datetime.c"
break;
case 24:
-/* Line 1744 of yacc.c */
-#line 393 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 398 "parse-datetime.y"
{
- set_hhmmss (pc, (yyvsp[-5].textintval).value, (yyvsp[-3].textintval).value, (yyvsp[-1].timespec).tv_sec, (yyvsp[-1].timespec).tv_nsec);
+ set_hhmmss (pc, (yyvsp[(1) - (6)].textintval).value, (yyvsp[(3) - (6)].textintval).value, (yyvsp[(5) - (6)].timespec).tv_sec, (yyvsp[(5) - (6)].timespec).tv_nsec);
pc->meridian = MER24;
}
-/* Line 1744 of yacc.c */
-#line 1883 "parse-datetime.c"
break;
case 27:
-/* Line 1744 of yacc.c */
-#line 406 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 411 "parse-datetime.y"
{
pc->zones_seen++;
- pc->time_zone = time_zone_hhmm (pc, (yyvsp[-1].textintval), (yyvsp[0].intval));
+ pc->time_zone = time_zone_hhmm (pc, (yyvsp[(1) - (2)].textintval), (yyvsp[(2) - (2)].intval));
}
-/* Line 1744 of yacc.c */
-#line 1894 "parse-datetime.c"
break;
case 28:
-/* Line 1744 of yacc.c */
-#line 414 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 419 "parse-datetime.y"
{
- pc->local_isdst = (yyvsp[0].intval);
- pc->dsts_seen += (0 < (yyvsp[0].intval));
+ pc->local_isdst = (yyvsp[(1) - (1)].intval);
+ pc->dsts_seen += (0 < (yyvsp[(1) - (1)].intval));
}
-/* Line 1744 of yacc.c */
-#line 1905 "parse-datetime.c"
break;
case 29:
-/* Line 1744 of yacc.c */
-#line 419 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 424 "parse-datetime.y"
{
pc->local_isdst = 1;
- pc->dsts_seen += (0 < (yyvsp[-1].intval)) + 1;
+ pc->dsts_seen += (0 < (yyvsp[(1) - (2)].intval)) + 1;
}
-/* Line 1744 of yacc.c */
-#line 1916 "parse-datetime.c"
break;
case 30:
-/* Line 1744 of yacc.c */
-#line 429 "parse-datetime.y"
- { pc->time_zone = (yyvsp[0].intval); }
-/* Line 1744 of yacc.c */
-#line 1924 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 434 "parse-datetime.y"
+ { pc->time_zone = (yyvsp[(1) - (1)].intval); }
break;
case 31:
-/* Line 1744 of yacc.c */
-#line 431 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 436 "parse-datetime.y"
{ pc->time_zone = HOUR(7); }
-/* Line 1744 of yacc.c */
-#line 1932 "parse-datetime.c"
break;
case 32:
-/* Line 1744 of yacc.c */
-#line 433 "parse-datetime.y"
- { pc->time_zone = (yyvsp[-1].intval);
- apply_relative_time (pc, (yyvsp[0].rel), 1); }
-/* Line 1744 of yacc.c */
-#line 1941 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 438 "parse-datetime.y"
+ { pc->time_zone = (yyvsp[(1) - (2)].intval);
+ apply_relative_time (pc, (yyvsp[(2) - (2)].rel), 1); }
break;
case 33:
-/* Line 1744 of yacc.c */
-#line 436 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 441 "parse-datetime.y"
{ pc->time_zone = HOUR(7);
- apply_relative_time (pc, (yyvsp[0].rel), 1); }
-/* Line 1744 of yacc.c */
-#line 1950 "parse-datetime.c"
+ apply_relative_time (pc, (yyvsp[(2) - (2)].rel), 1); }
break;
case 34:
-/* Line 1744 of yacc.c */
-#line 439 "parse-datetime.y"
- { pc->time_zone = (yyvsp[-2].intval) + time_zone_hhmm (pc, (yyvsp[-1].textintval), (yyvsp[0].intval)); }
-/* Line 1744 of yacc.c */
-#line 1958 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 444 "parse-datetime.y"
+ { pc->time_zone = (yyvsp[(1) - (3)].intval) + time_zone_hhmm (pc, (yyvsp[(2) - (3)].textintval), (yyvsp[(3) - (3)].intval)); }
break;
case 35:
-/* Line 1744 of yacc.c */
-#line 441 "parse-datetime.y"
- { pc->time_zone = (yyvsp[0].intval) + 60; }
-/* Line 1744 of yacc.c */
-#line 1966 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 446 "parse-datetime.y"
+ { pc->time_zone = (yyvsp[(1) - (1)].intval) + 60; }
break;
case 36:
-/* Line 1744 of yacc.c */
-#line 443 "parse-datetime.y"
- { pc->time_zone = (yyvsp[-1].intval) + 60; }
-/* Line 1744 of yacc.c */
-#line 1974 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 448 "parse-datetime.y"
+ { pc->time_zone = (yyvsp[(1) - (2)].intval) + 60; }
break;
case 37:
-/* Line 1744 of yacc.c */
-#line 448 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 453 "parse-datetime.y"
{
pc->day_ordinal = 0;
- pc->day_number = (yyvsp[0].intval);
+ pc->day_number = (yyvsp[(1) - (1)].intval);
}
-/* Line 1744 of yacc.c */
-#line 1985 "parse-datetime.c"
break;
case 38:
-/* Line 1744 of yacc.c */
-#line 453 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 458 "parse-datetime.y"
{
pc->day_ordinal = 0;
- pc->day_number = (yyvsp[-1].intval);
+ pc->day_number = (yyvsp[(1) - (2)].intval);
}
-/* Line 1744 of yacc.c */
-#line 1996 "parse-datetime.c"
break;
case 39:
-/* Line 1744 of yacc.c */
-#line 458 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 463 "parse-datetime.y"
{
- pc->day_ordinal = (yyvsp[-1].intval);
- pc->day_number = (yyvsp[0].intval);
+ pc->day_ordinal = (yyvsp[(1) - (2)].intval);
+ pc->day_number = (yyvsp[(2) - (2)].intval);
}
-/* Line 1744 of yacc.c */
-#line 2007 "parse-datetime.c"
break;
case 40:
-/* Line 1744 of yacc.c */
-#line 463 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 468 "parse-datetime.y"
{
- pc->day_ordinal = (yyvsp[-1].textintval).value;
- pc->day_number = (yyvsp[0].intval);
+ pc->day_ordinal = (yyvsp[(1) - (2)].textintval).value;
+ pc->day_number = (yyvsp[(2) - (2)].intval);
}
-/* Line 1744 of yacc.c */
-#line 2018 "parse-datetime.c"
break;
case 41:
-/* Line 1744 of yacc.c */
-#line 471 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 476 "parse-datetime.y"
{
- pc->month = (yyvsp[-2].textintval).value;
- pc->day = (yyvsp[0].textintval).value;
+ pc->month = (yyvsp[(1) - (3)].textintval).value;
+ pc->day = (yyvsp[(3) - (3)].textintval).value;
}
-/* Line 1744 of yacc.c */
-#line 2029 "parse-datetime.c"
break;
case 42:
-/* Line 1744 of yacc.c */
-#line 476 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 481 "parse-datetime.y"
{
/* Interpret as YYYY/MM/DD if the first value has 4 or more digits,
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
you want portability, use the ISO 8601 format. */
- if (4 <= (yyvsp[-4].textintval).digits)
+ if (4 <= (yyvsp[(1) - (5)].textintval).digits)
{
- pc->year = (yyvsp[-4].textintval);
- pc->month = (yyvsp[-2].textintval).value;
- pc->day = (yyvsp[0].textintval).value;
+ pc->year = (yyvsp[(1) - (5)].textintval);
+ pc->month = (yyvsp[(3) - (5)].textintval).value;
+ pc->day = (yyvsp[(5) - (5)].textintval).value;
}
else
{
- pc->month = (yyvsp[-4].textintval).value;
- pc->day = (yyvsp[-2].textintval).value;
- pc->year = (yyvsp[0].textintval);
+ pc->month = (yyvsp[(1) - (5)].textintval).value;
+ pc->day = (yyvsp[(3) - (5)].textintval).value;
+ pc->year = (yyvsp[(5) - (5)].textintval);
}
}
-/* Line 1744 of yacc.c */
-#line 2055 "parse-datetime.c"
break;
case 43:
-/* Line 1744 of yacc.c */
-#line 496 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 501 "parse-datetime.y"
{
/* e.g. 17-JUN-1992. */
- pc->day = (yyvsp[-2].textintval).value;
- pc->month = (yyvsp[-1].intval);
- pc->year.value = -(yyvsp[0].textintval).value;
- pc->year.digits = (yyvsp[0].textintval).digits;
+ pc->day = (yyvsp[(1) - (3)].textintval).value;
+ pc->month = (yyvsp[(2) - (3)].intval);
+ pc->year.value = -(yyvsp[(3) - (3)].textintval).value;
+ pc->year.digits = (yyvsp[(3) - (3)].textintval).digits;
}
-/* Line 1744 of yacc.c */
-#line 2069 "parse-datetime.c"
break;
case 44:
-/* Line 1744 of yacc.c */
-#line 504 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 509 "parse-datetime.y"
{
/* e.g. JUN-17-1992. */
- pc->month = (yyvsp[-2].intval);
- pc->day = -(yyvsp[-1].textintval).value;
- pc->year.value = -(yyvsp[0].textintval).value;
- pc->year.digits = (yyvsp[0].textintval).digits;
+ pc->month = (yyvsp[(1) - (3)].intval);
+ pc->day = -(yyvsp[(2) - (3)].textintval).value;
+ pc->year.value = -(yyvsp[(3) - (3)].textintval).value;
+ pc->year.digits = (yyvsp[(3) - (3)].textintval).digits;
}
-/* Line 1744 of yacc.c */
-#line 2083 "parse-datetime.c"
break;
case 45:
-/* Line 1744 of yacc.c */
-#line 512 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 517 "parse-datetime.y"
{
- pc->month = (yyvsp[-1].intval);
- pc->day = (yyvsp[0].textintval).value;
+ pc->month = (yyvsp[(1) - (2)].intval);
+ pc->day = (yyvsp[(2) - (2)].textintval).value;
}
-/* Line 1744 of yacc.c */
-#line 2094 "parse-datetime.c"
break;
case 46:
-/* Line 1744 of yacc.c */
-#line 517 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 522 "parse-datetime.y"
{
- pc->month = (yyvsp[-3].intval);
- pc->day = (yyvsp[-2].textintval).value;
- pc->year = (yyvsp[0].textintval);
+ pc->month = (yyvsp[(1) - (4)].intval);
+ pc->day = (yyvsp[(2) - (4)].textintval).value;
+ pc->year = (yyvsp[(4) - (4)].textintval);
}
-/* Line 1744 of yacc.c */
-#line 2106 "parse-datetime.c"
break;
case 47:
-/* Line 1744 of yacc.c */
-#line 523 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 528 "parse-datetime.y"
{
- pc->day = (yyvsp[-1].textintval).value;
- pc->month = (yyvsp[0].intval);
+ pc->day = (yyvsp[(1) - (2)].textintval).value;
+ pc->month = (yyvsp[(2) - (2)].intval);
}
-/* Line 1744 of yacc.c */
-#line 2117 "parse-datetime.c"
break;
case 48:
-/* Line 1744 of yacc.c */
-#line 528 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 533 "parse-datetime.y"
{
- pc->day = (yyvsp[-2].textintval).value;
- pc->month = (yyvsp[-1].intval);
- pc->year = (yyvsp[0].textintval);
+ pc->day = (yyvsp[(1) - (3)].textintval).value;
+ pc->month = (yyvsp[(2) - (3)].intval);
+ pc->year = (yyvsp[(3) - (3)].textintval);
}
-/* Line 1744 of yacc.c */
-#line 2129 "parse-datetime.c"
break;
case 50:
-/* Line 1744 of yacc.c */
-#line 538 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 543 "parse-datetime.y"
{
/* ISO 8601 format. YYYY-MM-DD. */
- pc->year = (yyvsp[-2].textintval);
- pc->month = -(yyvsp[-1].textintval).value;
- pc->day = -(yyvsp[0].textintval).value;
+ pc->year = (yyvsp[(1) - (3)].textintval);
+ pc->month = -(yyvsp[(2) - (3)].textintval).value;
+ pc->day = -(yyvsp[(3) - (3)].textintval).value;
}
-/* Line 1744 of yacc.c */
-#line 2142 "parse-datetime.c"
break;
case 51:
-/* Line 1744 of yacc.c */
-#line 548 "parse-datetime.y"
- { apply_relative_time (pc, (yyvsp[-1].rel), (yyvsp[0].intval)); }
-/* Line 1744 of yacc.c */
-#line 2150 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 553 "parse-datetime.y"
+ { apply_relative_time (pc, (yyvsp[(1) - (2)].rel), (yyvsp[(2) - (2)].intval)); }
break;
case 52:
-/* Line 1744 of yacc.c */
-#line 550 "parse-datetime.y"
- { apply_relative_time (pc, (yyvsp[0].rel), 1); }
-/* Line 1744 of yacc.c */
-#line 2158 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 555 "parse-datetime.y"
+ { apply_relative_time (pc, (yyvsp[(1) - (1)].rel), 1); }
break;
case 53:
-/* Line 1744 of yacc.c */
-#line 552 "parse-datetime.y"
- { apply_relative_time (pc, (yyvsp[0].rel), 1); }
-/* Line 1744 of yacc.c */
-#line 2166 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 557 "parse-datetime.y"
+ { apply_relative_time (pc, (yyvsp[(1) - (1)].rel), 1); }
break;
case 54:
-/* Line 1744 of yacc.c */
-#line 557 "parse-datetime.y"
- { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = (yyvsp[-1].intval); }
-/* Line 1744 of yacc.c */
-#line 2174 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 562 "parse-datetime.y"
+ { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = (yyvsp[(1) - (2)].intval); }
break;
case 55:
-/* Line 1744 of yacc.c */
-#line 559 "parse-datetime.y"
- { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = (yyvsp[-1].textintval).value; }
-/* Line 1744 of yacc.c */
-#line 2182 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 564 "parse-datetime.y"
+ { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = (yyvsp[(1) - (2)].textintval).value; }
break;
case 56:
-/* Line 1744 of yacc.c */
-#line 561 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 566 "parse-datetime.y"
{ (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = 1; }
-/* Line 1744 of yacc.c */
-#line 2190 "parse-datetime.c"
break;
case 57:
-/* Line 1744 of yacc.c */
-#line 563 "parse-datetime.y"
- { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = (yyvsp[-1].intval); }
-/* Line 1744 of yacc.c */
-#line 2198 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 568 "parse-datetime.y"
+ { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = (yyvsp[(1) - (2)].intval); }
break;
case 58:
-/* Line 1744 of yacc.c */
-#line 565 "parse-datetime.y"
- { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = (yyvsp[-1].textintval).value; }
-/* Line 1744 of yacc.c */
-#line 2206 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 570 "parse-datetime.y"
+ { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = (yyvsp[(1) - (2)].textintval).value; }
break;
case 59:
-/* Line 1744 of yacc.c */
-#line 567 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 572 "parse-datetime.y"
{ (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = 1; }
-/* Line 1744 of yacc.c */
-#line 2214 "parse-datetime.c"
break;
case 60:
-/* Line 1744 of yacc.c */
-#line 569 "parse-datetime.y"
- { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[-1].intval) * (yyvsp[0].intval); }
-/* Line 1744 of yacc.c */
-#line 2222 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 574 "parse-datetime.y"
+ { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[(1) - (2)].intval) * (yyvsp[(2) - (2)].intval); }
break;
case 61:
-/* Line 1744 of yacc.c */
-#line 571 "parse-datetime.y"
- { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[-1].textintval).value * (yyvsp[0].intval); }
-/* Line 1744 of yacc.c */
-#line 2230 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 576 "parse-datetime.y"
+ { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[(1) - (2)].textintval).value * (yyvsp[(2) - (2)].intval); }
break;
case 62:
-/* Line 1744 of yacc.c */
-#line 573 "parse-datetime.y"
- { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[0].intval); }
-/* Line 1744 of yacc.c */
-#line 2238 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 578 "parse-datetime.y"
+ { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[(1) - (1)].intval); }
break;
case 63:
-/* Line 1744 of yacc.c */
-#line 575 "parse-datetime.y"
- { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = (yyvsp[-1].intval); }
-/* Line 1744 of yacc.c */
-#line 2246 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 580 "parse-datetime.y"
+ { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = (yyvsp[(1) - (2)].intval); }
break;
case 64:
-/* Line 1744 of yacc.c */
-#line 577 "parse-datetime.y"
- { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = (yyvsp[-1].textintval).value; }
-/* Line 1744 of yacc.c */
-#line 2254 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 582 "parse-datetime.y"
+ { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = (yyvsp[(1) - (2)].textintval).value; }
break;
case 65:
-/* Line 1744 of yacc.c */
-#line 579 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 584 "parse-datetime.y"
{ (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = 1; }
-/* Line 1744 of yacc.c */
-#line 2262 "parse-datetime.c"
break;
case 66:
-/* Line 1744 of yacc.c */
-#line 581 "parse-datetime.y"
- { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = (yyvsp[-1].intval); }
-/* Line 1744 of yacc.c */
-#line 2270 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 586 "parse-datetime.y"
+ { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = (yyvsp[(1) - (2)].intval); }
break;
case 67:
-/* Line 1744 of yacc.c */
-#line 583 "parse-datetime.y"
- { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = (yyvsp[-1].textintval).value; }
-/* Line 1744 of yacc.c */
-#line 2278 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 588 "parse-datetime.y"
+ { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = (yyvsp[(1) - (2)].textintval).value; }
break;
case 68:
-/* Line 1744 of yacc.c */
-#line 585 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 590 "parse-datetime.y"
{ (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = 1; }
-/* Line 1744 of yacc.c */
-#line 2286 "parse-datetime.c"
break;
case 69:
-/* Line 1744 of yacc.c */
-#line 587 "parse-datetime.y"
- { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[-1].intval); }
-/* Line 1744 of yacc.c */
-#line 2294 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 592 "parse-datetime.y"
+ { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[(1) - (2)].intval); }
break;
case 70:
-/* Line 1744 of yacc.c */
-#line 589 "parse-datetime.y"
- { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[-1].textintval).value; }
-/* Line 1744 of yacc.c */
-#line 2302 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 594 "parse-datetime.y"
+ { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[(1) - (2)].textintval).value; }
break;
case 71:
-/* Line 1744 of yacc.c */
-#line 591 "parse-datetime.y"
- { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[-1].timespec).tv_sec; (yyval.rel).ns = (yyvsp[-1].timespec).tv_nsec; }
-/* Line 1744 of yacc.c */
-#line 2310 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 596 "parse-datetime.y"
+ { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[(1) - (2)].timespec).tv_sec; (yyval.rel).ns = (yyvsp[(1) - (2)].timespec).tv_nsec; }
break;
case 72:
-/* Line 1744 of yacc.c */
-#line 593 "parse-datetime.y"
- { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[-1].timespec).tv_sec; (yyval.rel).ns = (yyvsp[-1].timespec).tv_nsec; }
-/* Line 1744 of yacc.c */
-#line 2318 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 598 "parse-datetime.y"
+ { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[(1) - (2)].timespec).tv_sec; (yyval.rel).ns = (yyvsp[(1) - (2)].timespec).tv_nsec; }
break;
case 73:
-/* Line 1744 of yacc.c */
-#line 595 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 600 "parse-datetime.y"
{ (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = 1; }
-/* Line 1744 of yacc.c */
-#line 2326 "parse-datetime.c"
break;
case 75:
-/* Line 1744 of yacc.c */
-#line 601 "parse-datetime.y"
- { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = (yyvsp[-1].textintval).value; }
-/* Line 1744 of yacc.c */
-#line 2334 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 606 "parse-datetime.y"
+ { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = (yyvsp[(1) - (2)].textintval).value; }
break;
case 76:
-/* Line 1744 of yacc.c */
-#line 603 "parse-datetime.y"
- { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = (yyvsp[-1].textintval).value; }
-/* Line 1744 of yacc.c */
-#line 2342 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 608 "parse-datetime.y"
+ { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = (yyvsp[(1) - (2)].textintval).value; }
break;
case 77:
-/* Line 1744 of yacc.c */
-#line 605 "parse-datetime.y"
- { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[-1].textintval).value * (yyvsp[0].intval); }
-/* Line 1744 of yacc.c */
-#line 2350 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 610 "parse-datetime.y"
+ { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[(1) - (2)].textintval).value * (yyvsp[(2) - (2)].intval); }
break;
case 78:
-/* Line 1744 of yacc.c */
-#line 607 "parse-datetime.y"
- { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = (yyvsp[-1].textintval).value; }
-/* Line 1744 of yacc.c */
-#line 2358 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 612 "parse-datetime.y"
+ { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = (yyvsp[(1) - (2)].textintval).value; }
break;
case 79:
-/* Line 1744 of yacc.c */
-#line 609 "parse-datetime.y"
- { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = (yyvsp[-1].textintval).value; }
-/* Line 1744 of yacc.c */
-#line 2366 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 614 "parse-datetime.y"
+ { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = (yyvsp[(1) - (2)].textintval).value; }
break;
case 80:
-/* Line 1744 of yacc.c */
-#line 611 "parse-datetime.y"
- { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[-1].textintval).value; }
-/* Line 1744 of yacc.c */
-#line 2374 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 616 "parse-datetime.y"
+ { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[(1) - (2)].textintval).value; }
break;
case 81:
-/* Line 1744 of yacc.c */
-#line 616 "parse-datetime.y"
- { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[0].intval); }
-/* Line 1744 of yacc.c */
-#line 2382 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 621 "parse-datetime.y"
+ { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[(1) - (1)].intval); }
break;
case 85:
-/* Line 1744 of yacc.c */
-#line 624 "parse-datetime.y"
- { (yyval.timespec).tv_sec = (yyvsp[0].textintval).value; (yyval.timespec).tv_nsec = 0; }
-/* Line 1744 of yacc.c */
-#line 2390 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 629 "parse-datetime.y"
+ { (yyval.timespec).tv_sec = (yyvsp[(1) - (1)].textintval).value; (yyval.timespec).tv_nsec = 0; }
break;
case 87:
-/* Line 1744 of yacc.c */
-#line 630 "parse-datetime.y"
- { (yyval.timespec).tv_sec = (yyvsp[0].textintval).value; (yyval.timespec).tv_nsec = 0; }
-/* Line 1744 of yacc.c */
-#line 2398 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 635 "parse-datetime.y"
+ { (yyval.timespec).tv_sec = (yyvsp[(1) - (1)].textintval).value; (yyval.timespec).tv_nsec = 0; }
break;
case 88:
-/* Line 1744 of yacc.c */
-#line 635 "parse-datetime.y"
- { digits_to_date_time (pc, (yyvsp[0].textintval)); }
-/* Line 1744 of yacc.c */
-#line 2406 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 640 "parse-datetime.y"
+ { digits_to_date_time (pc, (yyvsp[(1) - (1)].textintval)); }
break;
case 89:
-/* Line 1744 of yacc.c */
-#line 640 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 645 "parse-datetime.y"
{
/* Hybrid all-digit and relative offset, so that we accept e.g.,
"YYYYMMDD +N days" as well as "YYYYMMDD N days". */
- digits_to_date_time (pc, (yyvsp[-1].textintval));
- apply_relative_time (pc, (yyvsp[0].rel), 1);
+ digits_to_date_time (pc, (yyvsp[(1) - (2)].textintval));
+ apply_relative_time (pc, (yyvsp[(2) - (2)].rel), 1);
}
-/* Line 1744 of yacc.c */
-#line 2419 "parse-datetime.c"
break;
case 90:
-/* Line 1744 of yacc.c */
-#line 650 "parse-datetime.y"
+
+/* Line 1464 of yacc.c */
+#line 655 "parse-datetime.y"
{ (yyval.intval) = -1; }
-/* Line 1744 of yacc.c */
-#line 2427 "parse-datetime.c"
break;
case 91:
-/* Line 1744 of yacc.c */
-#line 652 "parse-datetime.y"
- { (yyval.intval) = (yyvsp[0].textintval).value; }
-/* Line 1744 of yacc.c */
-#line 2435 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 657 "parse-datetime.y"
+ { (yyval.intval) = (yyvsp[(2) - (2)].textintval).value; }
break;
-/* Line 1744 of yacc.c */
-#line 2440 "parse-datetime.c"
+
+/* Line 1464 of yacc.c */
+#line 2388 "parse-datetime.c"
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 ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
YYPOPSTACK (yylen);
@@ -2477,10 +2414,6 @@ yyreduce:
| 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 ? YYEMPTY : YYTRANSLATE (yychar);
-
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
@@ -2488,36 +2421,37 @@ yyerrlab:
#if ! YYERROR_VERBOSE
yyerror (pc, YY_("syntax error"));
#else
-# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
- yyssp, yytoken)
{
- char const *yymsgp = YY_("syntax error");
- int yysyntax_error_status;
- yysyntax_error_status = YYSYNTAX_ERROR;
- if (yysyntax_error_status == 0)
- yymsgp = yymsg;
- else if (yysyntax_error_status == 1)
- {
- if (yymsg != yymsgbuf)
- YYSTACK_FREE (yymsg);
- yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
- if (!yymsg)
- {
- yymsg = yymsgbuf;
- yymsg_alloc = sizeof yymsgbuf;
- yysyntax_error_status = 2;
- }
- else
- {
- yysyntax_error_status = YYSYNTAX_ERROR;
- yymsgp = yymsg;
- }
- }
- yyerror (pc, yymsgp);
- if (yysyntax_error_status == 2)
- goto yyexhaustedlab;
+ YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
+ if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
+ {
+ YYSIZE_T yyalloc = 2 * yysize;
+ if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
+ yyalloc = YYSTACK_ALLOC_MAXIMUM;
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+ yymsg = (char *) YYSTACK_ALLOC (yyalloc);
+ if (yymsg)
+ yymsg_alloc = yyalloc;
+ else
+ {
+ yymsg = yymsgbuf;
+ yymsg_alloc = sizeof yymsgbuf;
+ }
+ }
+
+ if (0 < yysize && yysize <= yymsg_alloc)
+ {
+ (void) yysyntax_error (yymsg, yystate, yychar);
+ yyerror (pc, yymsg);
+ }
+ else
+ {
+ yyerror (pc, YY_("syntax error"));
+ if (yysize != 0)
+ goto yyexhaustedlab;
+ }
}
-# undef YYSYNTAX_ERROR
#endif
}
@@ -2526,20 +2460,20 @@ yyerrlab:
if (yyerrstatus == 3)
{
/* If just tried and failed to reuse lookahead token after an
- error, discard it. */
+ error, discard it. */
if (yychar <= YYEOF)
- {
- /* Return failure if at end of input. */
- if (yychar == YYEOF)
- YYABORT;
- }
+ {
+ /* Return failure if at end of input. */
+ if (yychar == YYEOF)
+ YYABORT;
+ }
else
- {
- yydestruct ("Error: discarding",
- yytoken, &yylval, pc);
- yychar = YYEMPTY;
- }
+ {
+ yydestruct ("Error: discarding",
+ yytoken, &yylval, pc);
+ yychar = YYEMPTY;
+ }
}
/* Else will try to reuse lookahead token after shifting the error
@@ -2571,29 +2505,29 @@ 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. */
for (;;)
{
yyn = yypact[yystate];
- if (!yypact_value_is_default (yyn))
- {
- yyn += YYTERROR;
- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
- {
- yyn = yytable[yyn];
- if (0 < yyn)
- break;
- }
- }
+ if (yyn != YYPACT_NINF)
+ {
+ yyn += YYTERROR;
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+ {
+ yyn = yytable[yyn];
+ if (0 < yyn)
+ break;
+ }
+ }
/* Pop the current state because it cannot handle the error token. */
if (yyssp == yyss)
- YYABORT;
+ YYABORT;
yydestruct ("Error: popping",
- yystos[yystate], yyvsp, pc);
+ yystos[yystate], yyvsp, pc);
YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
@@ -2623,7 +2557,7 @@ yyabortlab:
yyresult = 1;
goto yyreturn;
-#if !defined yyoverflow || YYERROR_VERBOSE
+#if !defined(yyoverflow) || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
@@ -2635,13 +2569,8 @@ yyexhaustedlab:
yyreturn:
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, pc);
- }
+ yydestruct ("Cleanup: discarding lookahead",
+ yytoken, &yylval, pc);
/* Do not reclaim the symbols of the rule which action triggered
this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen);
@@ -2649,7 +2578,7 @@ yyreturn:
while (yyssp != yyss)
{
yydestruct ("Cleanup: popping",
- yystos[*yyssp], yyvsp, pc);
+ yystos[*yyssp], yyvsp, pc);
YYPOPSTACK (1);
}
#ifndef yyoverflow
@@ -2664,8 +2593,10 @@ yyreturn:
return YYID (yyresult);
}
-/* Line 2004 of yacc.c */
-#line 655 "parse-datetime.y"
+
+
+/* Line 1684 of yacc.c */
+#line 660 "parse-datetime.y"
static table const meridian_table[] =
@@ -3185,7 +3116,8 @@ yylex (YYSTYPE *lvalp, parser_control *pc)
}
if (c != '(')
- return *pc->input++;
+ return to_uchar (*pc->input++);
+
count = 0;
do
{
@@ -3629,3 +3561,4 @@ main (int ac, char **av)
return 0;
}
#endif /* TEST */
+