kamailio-3.3.x: add ldap and h350 module
[feed/telephony.git] / libs / pwlib / patches / 001-bison3-fix.patch
1 --- /dev/null   2013-09-17 15:58:48.159024252 +0200
2 +++ pwlib-new/src/ptlib/common/getdate.tab.c    2013-10-06 16:52:52.000000000 +0200
3 @@ -0,0 +1,2864 @@
4 +/* A Bison parser, made by GNU Bison 2.7.  */
5 +
6 +/* Bison implementation for Yacc-like parsers in C
7 +   
8 +      Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
9 +   
10 +   This program is free software: you can redistribute it and/or modify
11 +   it under the terms of the GNU General Public License as published by
12 +   the Free Software Foundation, either version 3 of the License, or
13 +   (at your option) any later version.
14 +   
15 +   This program is distributed in the hope that it will be useful,
16 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
17 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 +   GNU General Public License for more details.
19 +   
20 +   You should have received a copy of the GNU General Public License
21 +   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
22 +
23 +/* As a special exception, you may create a larger work that contains
24 +   part or all of the Bison parser skeleton and distribute that work
25 +   under terms of your choice, so long as that work isn't itself a
26 +   parser generator using the skeleton or a modified version thereof
27 +   as a parser skeleton.  Alternatively, if you modify or redistribute
28 +   the parser skeleton itself, you may (at your option) remove this
29 +   special exception, which will cause the skeleton and the resulting
30 +   Bison output files to be licensed under the GNU General Public
31 +   License without this special exception.
32 +   
33 +   This special exception was added by the Free Software Foundation in
34 +   version 2.2 of Bison.  */
35 +
36 +/* C LALR(1) parser skeleton written by Richard Stallman, by
37 +   simplifying the original so-called "semantic" parser.  */
38 +
39 +/* All symbols defined below should begin with yy or YY, to avoid
40 +   infringing on user name space.  This should be done even for local
41 +   variables, as they might otherwise be expanded by user macros.
42 +   There are some unavoidable exceptions within include files to
43 +   define necessary library symbols; they are noted "INFRINGES ON
44 +   USER NAME SPACE" below.  */
45 +
46 +/* Identify Bison output.  */
47 +#define YYBISON 1
48 +
49 +/* Bison version.  */
50 +#define YYBISON_VERSION "2.7"
51 +
52 +/* Skeleton name.  */
53 +#define YYSKELETON_NAME "yacc.c"
54 +
55 +/* Pure parsers.  */
56 +#define YYPURE 1
57 +
58 +/* Push parsers.  */
59 +#define YYPUSH 0
60 +
61 +/* Pull parsers.  */
62 +#define YYPULL 1
63 +
64 +
65 +
66 +
67 +/* Copy the first part of user declarations.  */
68 +/* Line 371 of yacc.c  */
69 +#line 1 "../common/getdate.y"
70 +
71 +/*
72 +**  Originally written by Steven M. Bellovin <smb@research.att.com> while
73 +**  at the University of North Carolina at Chapel Hill.  Later tweaked by
74 +**  a couple of people on Usenet.  Completely overhauled by Rich $alz
75 +**  <rsalz@bbn.com> and Jim Berets <jberets@bbn.com> in August, 1990;
76 +**
77 +**  Major hack to coerce it into use with the Equivalence Portable
78 +**  Windows Library.
79 +**
80 +**  This grammar has 10 shift/reduce conflicts.
81 +**
82 +**  This code is in the public domain and has no copyright.
83 +*/
84 +/* SUPPRESS 287 on yaccpar_sccsid *//* Unused static variable */
85 +/* SUPPRESS 288 on yyerrlab *//* Label unused */
86 +
87 +
88 +#include <time.h>
89 +#include <string.h>
90 +#include <ctype.h>
91 +#include <stdlib.h>
92 +
93 +#ifndef EOF
94 +#include <stdio.h>
95 +#endif
96 +
97 +
98 +#ifdef _WIN32
99 +#ifdef _MSC_VER
100 +#pragma warning(disable:4131 4701 4996)
101 +#endif
102 +#define STDAPICALLTYPE __stdcall
103 +#define MSDOS
104 +#else
105 +#define STDAPICALLTYPE
106 +#endif
107 +
108 +
109 +extern int  STDAPICALLTYPE PTimeGetChar(void * stream);
110 +extern void STDAPICALLTYPE PTimeUngetChar(void * stream, int c);
111 +int STDAPICALLTYPE PTimeGetDateOrder();
112 +int STDAPICALLTYPE PTimeIsMonthName(const char *, int, int);
113 +int STDAPICALLTYPE PTimeIsDayName(const char *, int, int);
114 +
115 +
116 +#define EPOCH          1970
117 +#define HOUR(x)                ((time_t)(x) * 60)
118 +#define SECSPERDAY     (24L * 60L * 60L)
119 +
120 +
121 +/*
122 +**  An entry in the lexical lookup table.
123 +*/
124 +typedef struct _TABLE {
125 +    char       *name;
126 +    int                type;
127 +    time_t     value;
128 +} TABLE;
129 +
130 +
131 +/*
132 +**  Daylight-savings mode:  on, off, or not yet known.
133 +*/
134 +typedef enum _DSTMODE {
135 +    DSTon, DSToff, DSTmaybe
136 +} DSTMODE;
137 +
138 +/*
139 +**  Meridian:  am, pm, or 24-hour style.
140 +*/
141 +typedef enum _MERIDIAN {
142 +    MERam, MERpm, MER24
143 +} MERIDIAN;
144 +
145 +
146 +/*
147 +**  Global variables.  We could get rid of most of these by using a good
148 +**  union as the yacc stack.  (This routine was originally written before
149 +**  yacc had the %union construct.)  Maybe someday; right now we only use
150 +**  the %union very rarely.
151 +*/
152 +struct Variables {
153 +    void       *yyInput;
154 +    DSTMODE    yyDSTmode;
155 +    time_t     yyDayOrdinal;
156 +    time_t     yyDayNumber;
157 +    int        yyHaveDate;
158 +    int        yyHaveDay;
159 +    int        yyHaveRel;
160 +    int        yyHaveTime;
161 +    int        yyHaveZone;
162 +    time_t     yyTimezone;
163 +    time_t     yyDay;
164 +    time_t     yyHour;
165 +    time_t     yyMinutes;
166 +    time_t     yyMonth;
167 +    time_t     yySeconds;
168 +    time_t     yyYear;
169 +    MERIDIAN   yyMeridian;
170 +    time_t     yyRelMonth;
171 +    time_t     yyRelSeconds;
172 +};
173 +
174 +#define VARIABLE ((struct Variables*)parseParam)
175 +
176 +
177 +#define YYPURE         1
178 +#define YYLEX_PARAM    VARIABLE->yyInput
179 +#define YYPARSE_PARAM  parseParam
180 +
181 +#define yyparse                PTime_yyparse
182 +#define yylex          PTime_yylex
183 +#define yyerror                PTime_yyerror
184 +
185 +static int yyparse(void *); 
186 +static int yylex();
187 +
188 +#ifdef __GNUC__
189 +static int yyerror();
190 +#else
191 +static void yyerror();
192 +#endif
193 +
194 +
195 +static void SetPossibleDate(struct Variables*, time_t, time_t, time_t);
196 +
197 +
198 +
199 +/* Line 371 of yacc.c  */
200 +#line 198 "../common/getdate.tab.c"
201 +
202 +# ifndef YY_NULL
203 +#  if defined __cplusplus && 201103L <= __cplusplus
204 +#   define YY_NULL nullptr
205 +#  else
206 +#   define YY_NULL 0
207 +#  endif
208 +# endif
209 +
210 +/* Enabling verbose error messages.  */
211 +#ifdef YYERROR_VERBOSE
212 +# undef YYERROR_VERBOSE
213 +# define YYERROR_VERBOSE 1
214 +#else
215 +# define YYERROR_VERBOSE 0
216 +#endif
217 +
218 +
219 +/* Enabling traces.  */
220 +#ifndef YYDEBUG
221 +# define YYDEBUG 0
222 +#endif
223 +#if YYDEBUG
224 +extern int yydebug;
225 +#endif
226 +
227 +/* Tokens.  */
228 +#ifndef YYTOKENTYPE
229 +# define YYTOKENTYPE
230 +   /* Put the tokens into the symbol table, so that GDB and other debuggers
231 +      know about them.  */
232 +   enum yytokentype {
233 +     tAGO = 258,
234 +     tDAY = 259,
235 +     tDAYZONE = 260,
236 +     tID = 261,
237 +     tMERIDIAN = 262,
238 +     tMINUTE_UNIT = 263,
239 +     tMONTH = 264,
240 +     tMONTH_UNIT = 265,
241 +     tSNUMBER = 266,
242 +     tUNUMBER = 267,
243 +     t4DIGITNUMBER = 268,
244 +     t6DIGITNUMBER = 269,
245 +     tSEC_UNIT = 270,
246 +     tZONE = 271,
247 +     tMILZONE = 272,
248 +     tDST = 273
249 +   };
250 +#endif
251 +
252 +
253 +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
254 +typedef union YYSTYPE
255 +{
256 +/* Line 387 of yacc.c  */
257 +#line 133 "../common/getdate.y"
258 +
259 +    time_t             Number;
260 +    enum _MERIDIAN     Meridian;
261 +
262 +
263 +/* Line 387 of yacc.c  */
264 +#line 262 "../common/getdate.tab.c"
265 +} YYSTYPE;
266 +# define YYSTYPE_IS_TRIVIAL 1
267 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */
268 +# define YYSTYPE_IS_DECLARED 1
269 +#endif
270 +
271 +
272 +#ifdef YYPARSE_PARAM
273 +#if defined __STDC__ || defined __cplusplus
274 +int yyparse (void *YYPARSE_PARAM);
275 +#else
276 +int yyparse ();
277 +#endif
278 +#else /* ! YYPARSE_PARAM */
279 +#if defined __STDC__ || defined __cplusplus
280 +int yyparse (void);
281 +#else
282 +int yyparse ();
283 +#endif
284 +#endif /* ! YYPARSE_PARAM */
285 +
286 +
287 +
288 +/* Copy the second part of user declarations.  */
289 +
290 +/* Line 390 of yacc.c  */
291 +#line 289 "../common/getdate.tab.c"
292 +
293 +#ifdef short
294 +# undef short
295 +#endif
296 +
297 +#ifdef YYTYPE_UINT8
298 +typedef YYTYPE_UINT8 yytype_uint8;
299 +#else
300 +typedef unsigned char yytype_uint8;
301 +#endif
302 +
303 +#ifdef YYTYPE_INT8
304 +typedef YYTYPE_INT8 yytype_int8;
305 +#elif (defined __STDC__ || defined __C99__FUNC__ \
306 +     || defined __cplusplus || defined _MSC_VER)
307 +typedef signed char yytype_int8;
308 +#else
309 +typedef short int yytype_int8;
310 +#endif
311 +
312 +#ifdef YYTYPE_UINT16
313 +typedef YYTYPE_UINT16 yytype_uint16;
314 +#else
315 +typedef unsigned short int yytype_uint16;
316 +#endif
317 +
318 +#ifdef YYTYPE_INT16
319 +typedef YYTYPE_INT16 yytype_int16;
320 +#else
321 +typedef short int yytype_int16;
322 +#endif
323 +
324 +#ifndef YYSIZE_T
325 +# ifdef __SIZE_TYPE__
326 +#  define YYSIZE_T __SIZE_TYPE__
327 +# elif defined size_t
328 +#  define YYSIZE_T size_t
329 +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
330 +     || defined __cplusplus || defined _MSC_VER)
331 +#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
332 +#  define YYSIZE_T size_t
333 +# else
334 +#  define YYSIZE_T unsigned int
335 +# endif
336 +#endif
337 +
338 +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
339 +
340 +#ifndef YY_
341 +# if defined YYENABLE_NLS && YYENABLE_NLS
342 +#  if ENABLE_NLS
343 +#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
344 +#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
345 +#  endif
346 +# endif
347 +# ifndef YY_
348 +#  define YY_(Msgid) Msgid
349 +# endif
350 +#endif
351 +
352 +/* Suppress unused-variable warnings by "using" E.  */
353 +#if ! defined lint || defined __GNUC__
354 +# define YYUSE(E) ((void) (E))
355 +#else
356 +# define YYUSE(E) /* empty */
357 +#endif
358 +
359 +/* Identity function, used to suppress warnings about constant conditions.  */
360 +#ifndef lint
361 +# define YYID(N) (N)
362 +#else
363 +#if (defined __STDC__ || defined __C99__FUNC__ \
364 +     || defined __cplusplus || defined _MSC_VER)
365 +static int
366 +YYID (int yyi)
367 +#else
368 +static int
369 +YYID (yyi)
370 +    int yyi;
371 +#endif
372 +{
373 +  return yyi;
374 +}
375 +#endif
376 +
377 +#if ! defined yyoverflow || YYERROR_VERBOSE
378 +
379 +/* The parser invokes alloca or malloc; define the necessary symbols.  */
380 +
381 +# ifdef YYSTACK_USE_ALLOCA
382 +#  if YYSTACK_USE_ALLOCA
383 +#   ifdef __GNUC__
384 +#    define YYSTACK_ALLOC __builtin_alloca
385 +#   elif defined __BUILTIN_VA_ARG_INCR
386 +#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
387 +#   elif defined _AIX
388 +#    define YYSTACK_ALLOC __alloca
389 +#   elif defined _MSC_VER
390 +#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
391 +#    define alloca _alloca
392 +#   else
393 +#    define YYSTACK_ALLOC alloca
394 +#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
395 +     || defined __cplusplus || defined _MSC_VER)
396 +#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
397 +      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
398 +#     ifndef EXIT_SUCCESS
399 +#      define EXIT_SUCCESS 0
400 +#     endif
401 +#    endif
402 +#   endif
403 +#  endif
404 +# endif
405 +
406 +# ifdef YYSTACK_ALLOC
407 +   /* Pacify GCC's `empty if-body' warning.  */
408 +#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
409 +#  ifndef YYSTACK_ALLOC_MAXIMUM
410 +    /* The OS might guarantee only one guard page at the bottom of the stack,
411 +       and a page size can be as small as 4096 bytes.  So we cannot safely
412 +       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
413 +       to allow for a few compiler-allocated temporary stack slots.  */
414 +#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
415 +#  endif
416 +# else
417 +#  define YYSTACK_ALLOC YYMALLOC
418 +#  define YYSTACK_FREE YYFREE
419 +#  ifndef YYSTACK_ALLOC_MAXIMUM
420 +#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
421 +#  endif
422 +#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
423 +       && ! ((defined YYMALLOC || defined malloc) \
424 +            && (defined YYFREE || defined free)))
425 +#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
426 +#   ifndef EXIT_SUCCESS
427 +#    define EXIT_SUCCESS 0
428 +#   endif
429 +#  endif
430 +#  ifndef YYMALLOC
431 +#   define YYMALLOC malloc
432 +#   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
433 +     || defined __cplusplus || defined _MSC_VER)
434 +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
435 +#   endif
436 +#  endif
437 +#  ifndef YYFREE
438 +#   define YYFREE free
439 +#   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
440 +     || defined __cplusplus || defined _MSC_VER)
441 +void free (void *); /* INFRINGES ON USER NAME SPACE */
442 +#   endif
443 +#  endif
444 +# endif
445 +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
446 +
447 +
448 +#if (! defined yyoverflow \
449 +     && (! defined __cplusplus \
450 +        || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
451 +
452 +/* A type that is properly aligned for any stack member.  */
453 +union yyalloc
454 +{
455 +  yytype_int16 yyss_alloc;
456 +  YYSTYPE yyvs_alloc;
457 +};
458 +
459 +/* The size of the maximum gap between one aligned stack and the next.  */
460 +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
461 +
462 +/* The size of an array large to enough to hold all stacks, each with
463 +   N elements.  */
464 +# define YYSTACK_BYTES(N) \
465 +     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
466 +      + YYSTACK_GAP_MAXIMUM)
467 +
468 +# define YYCOPY_NEEDED 1
469 +
470 +/* Relocate STACK from its old location to the new one.  The
471 +   local variables YYSIZE and YYSTACKSIZE give the old and new number of
472 +   elements in the stack, and YYPTR gives the new location of the
473 +   stack.  Advance YYPTR to a properly aligned location for the next
474 +   stack.  */
475 +# define YYSTACK_RELOCATE(Stack_alloc, Stack)                          \
476 +    do                                                                 \
477 +      {                                                                        \
478 +       YYSIZE_T yynewbytes;                                            \
479 +       YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
480 +       Stack = &yyptr->Stack_alloc;                                    \
481 +       yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
482 +       yyptr += yynewbytes / sizeof (*yyptr);                          \
483 +      }                                                                        \
484 +    while (YYID (0))
485 +
486 +#endif
487 +
488 +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
489 +/* Copy COUNT objects from SRC to DST.  The source and destination do
490 +   not overlap.  */
491 +# ifndef YYCOPY
492 +#  if defined __GNUC__ && 1 < __GNUC__
493 +#   define YYCOPY(Dst, Src, Count) \
494 +      __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
495 +#  else
496 +#   define YYCOPY(Dst, Src, Count)              \
497 +      do                                        \
498 +        {                                       \
499 +          YYSIZE_T yyi;                         \
500 +          for (yyi = 0; yyi < (Count); yyi++)   \
501 +            (Dst)[yyi] = (Src)[yyi];            \
502 +        }                                       \
503 +      while (YYID (0))
504 +#  endif
505 +# endif
506 +#endif /* !YYCOPY_NEEDED */
507 +
508 +/* YYFINAL -- State number of the termination state.  */
509 +#define YYFINAL  2
510 +/* YYLAST -- Last index in YYTABLE.  */
511 +#define YYLAST   90
512 +
513 +/* YYNTOKENS -- Number of terminals.  */
514 +#define YYNTOKENS  22
515 +/* YYNNTS -- Number of nonterminals.  */
516 +#define YYNNTS  12
517 +/* YYNRULES -- Number of rules.  */
518 +#define YYNRULES  50
519 +/* YYNRULES -- Number of states.  */
520 +#define YYNSTATES  61
521 +
522 +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
523 +#define YYUNDEFTOK  2
524 +#define YYMAXUTOK   273
525 +
526 +#define YYTRANSLATE(YYX)                                               \
527 +  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
528 +
529 +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
530 +static const yytype_uint8 yytranslate[] =
531 +{
532 +       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
533 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
534 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
535 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
536 +       2,     2,     2,     2,    20,     2,     2,    21,     2,     2,
537 +       2,     2,     2,     2,     2,     2,     2,     2,    19,     2,
538 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
539 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
540 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
541 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
542 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
543 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
544 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
545 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
546 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
547 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
548 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
549 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
550 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
551 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
552 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
553 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
554 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
555 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
556 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
557 +       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
558 +       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
559 +      15,    16,    17,    18
560 +};
561 +
562 +#if YYDEBUG
563 +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
564 +   YYRHS.  */
565 +static const yytype_uint8 yyprhs[] =
566 +{
567 +       0,     0,     3,     4,     7,     9,    11,    13,    15,    17,
568 +      19,    22,    25,    28,    33,    38,    45,    52,    54,    56,
569 +      59,    61,    63,    66,    69,    73,    79,    83,    87,    90,
570 +      95,    98,   102,   105,   107,   110,   113,   115,   118,   121,
571 +     123,   126,   129,   131,   133,   135,   137,   139,   141,   143,
572 +     144
573 +};
574 +
575 +/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
576 +static const yytype_int8 yyrhs[] =
577 +{
578 +      23,     0,    -1,    -1,    23,    24,    -1,    25,    -1,    26,
579 +      -1,    28,    -1,    27,    -1,    29,    -1,    32,    -1,    12,
580 +       7,    -1,    13,    11,    -1,    14,    11,    -1,    31,    19,
581 +      31,    33,    -1,    31,    19,    31,    11,    -1,    31,    19,
582 +      31,    19,    31,    33,    -1,    31,    19,    31,    19,    31,
583 +      11,    -1,    16,    -1,     5,    -1,    16,    18,    -1,    17,
584 +      -1,     4,    -1,     4,    20,    -1,    31,     4,    -1,    31,
585 +      21,    31,    -1,    31,    21,    31,    21,    31,    -1,    31,
586 +      11,    11,    -1,    31,     9,    11,    -1,     9,    31,    -1,
587 +       9,    31,    20,    31,    -1,    31,     9,    -1,    31,     9,
588 +      31,    -1,    30,     3,    -1,    30,    -1,    31,     8,    -1,
589 +      11,     8,    -1,     8,    -1,    11,    15,    -1,    31,    15,
590 +      -1,    15,    -1,    11,    10,    -1,    31,    10,    -1,    10,
591 +      -1,    12,    -1,    13,    -1,    14,    -1,    12,    -1,    13,
592 +      -1,    14,    -1,    -1,     7,    -1
593 +};
594 +
595 +/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
596 +static const yytype_uint16 yyrline[] =
597 +{
598 +       0,   149,   149,   150,   153,   156,   159,   162,   165,   168,
599 +     171,   177,   185,   193,   199,   206,   212,   222,   226,   231,
600 +     235,   245,   249,   253,   259,   262,   265,   275,   281,   285,
601 +     290,   294,   301,   305,   308,   311,   314,   317,   320,   323,
602 +     326,   329,   332,   337,   340,   343,   348,   374,   385,   402,
603 +     405
604 +};
605 +#endif
606 +
607 +#if YYDEBUG || YYERROR_VERBOSE || 0
608 +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
609 +   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
610 +static const char *const yytname[] =
611 +{
612 +  "$end", "error", "$undefined", "tAGO", "tDAY", "tDAYZONE", "tID",
613 +  "tMERIDIAN", "tMINUTE_UNIT", "tMONTH", "tMONTH_UNIT", "tSNUMBER",
614 +  "tUNUMBER", "t4DIGITNUMBER", "t6DIGITNUMBER", "tSEC_UNIT", "tZONE",
615 +  "tMILZONE", "tDST", "':'", "','", "'/'", "$accept", "spec", "item",
616 +  "time", "zone", "day", "date", "rel", "relunit", "unumber", "number",
617 +  "o_merid", YY_NULL
618 +};
619 +#endif
620 +
621 +# ifdef YYPRINT
622 +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
623 +   token YYLEX-NUM.  */
624 +static const yytype_uint16 yytoknum[] =
625 +{
626 +       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
627 +     265,   266,   267,   268,   269,   270,   271,   272,   273,    58,
628 +      44,    47
629 +};
630 +# endif
631 +
632 +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
633 +static const yytype_uint8 yyr1[] =
634 +{
635 +       0,    22,    23,    23,    24,    24,    24,    24,    24,    24,
636 +      25,    25,    25,    25,    25,    25,    25,    26,    26,    26,
637 +      26,    27,    27,    27,    28,    28,    28,    28,    28,    28,
638 +      28,    28,    29,    29,    30,    30,    30,    30,    30,    30,
639 +      30,    30,    30,    31,    31,    31,    32,    32,    32,    33,
640 +      33
641 +};
642 +
643 +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
644 +static const yytype_uint8 yyr2[] =
645 +{
646 +       0,     2,     0,     2,     1,     1,     1,     1,     1,     1,
647 +       2,     2,     2,     4,     4,     6,     6,     1,     1,     2,
648 +       1,     1,     2,     2,     3,     5,     3,     3,     2,     4,
649 +       2,     3,     2,     1,     2,     2,     1,     2,     2,     1,
650 +       2,     2,     1,     1,     1,     1,     1,     1,     1,     0,
651 +       1
652 +};
653 +
654 +/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
655 +   Performed when YYTABLE doesn't specify something else to do.  Zero
656 +   means the default is an error.  */
657 +static const yytype_uint8 yydefact[] =
658 +{
659 +       2,     0,     1,    21,    18,    36,     0,    42,     0,    43,
660 +      44,    45,    39,    17,    20,     3,     4,     5,     7,     6,
661 +       8,    33,     0,     9,    22,    43,    44,    45,    28,    35,
662 +      40,    37,    10,    11,    12,    19,    32,    23,    34,    30,
663 +      41,     0,    38,     0,     0,     0,    27,    31,    26,    49,
664 +      24,    29,    50,    14,     0,    13,     0,    49,    25,    16,
665 +      15
666 +};
667 +
668 +/* YYDEFGOTO[NTERM-NUM].  */
669 +static const yytype_int8 yydefgoto[] =
670 +{
671 +      -1,     1,    15,    16,    17,    18,    19,    20,    21,    22,
672 +      23,    55
673 +};
674 +
675 +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
676 +   STATE-NUM.  */
677 +#define YYPACT_NINF -28
678 +static const yytype_int8 yypact[] =
679 +{
680 +     -28,     1,   -28,   -18,   -28,   -28,     8,   -28,    17,    29,
681 +      44,    54,   -28,   -14,   -28,   -28,   -28,   -28,   -28,   -28,
682 +     -28,     5,    65,   -28,   -28,   -28,   -28,   -28,     4,   -28,
683 +     -28,   -28,   -28,   -28,   -28,   -28,   -28,   -28,   -28,    76,
684 +     -28,    15,   -28,     8,     8,     8,   -28,   -28,   -28,    12,
685 +       7,   -28,   -28,   -28,     8,   -28,     8,    -4,   -28,   -28,
686 +     -28
687 +};
688 +
689 +/* YYPGOTO[NTERM-NUM].  */
690 +static const yytype_int8 yypgoto[] =
691 +{
692 +     -28,   -28,   -28,   -28,   -28,   -28,   -28,   -28,   -28,    -6,
693 +     -28,   -27
694 +};
695 +
696 +/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
697 +   positive, shift that token.  If negative, reduce the rule which
698 +   number is the opposite.  If YYTABLE_NINF, syntax error.  */
699 +#define YYTABLE_NINF -49
700 +static const yytype_int8 yytable[] =
701 +{
702 +      28,     2,    24,    52,    35,     3,     4,    59,    36,     5,
703 +       6,     7,     8,     9,    10,    11,    12,    13,    14,    52,
704 +      25,    26,    27,    53,    45,    29,    48,    30,    56,   -46,
705 +      60,    54,    31,    47,   -46,     0,    32,    49,    50,    51,
706 +       0,   -46,   -46,   -46,   -47,   -46,   -46,     0,    57,   -47,
707 +      58,     0,     0,     0,   -48,    33,   -47,   -47,   -47,   -48,
708 +     -47,   -47,     0,     0,     0,    34,   -48,   -48,   -48,    37,
709 +     -48,   -48,     0,    38,    39,    40,    41,     0,     0,     0,
710 +      42,     0,     0,     0,    43,     0,    44,    46,    25,    26,
711 +      27
712 +};
713 +
714 +#define yypact_value_is_default(Yystate) \
715 +  (!!((Yystate) == (-28)))
716 +
717 +#define yytable_value_is_error(Yytable_value) \
718 +  YYID (0)
719 +
720 +static const yytype_int8 yycheck[] =
721 +{
722 +       6,     0,    20,     7,    18,     4,     5,    11,     3,     8,
723 +       9,    10,    11,    12,    13,    14,    15,    16,    17,     7,
724 +      12,    13,    14,    11,    20,     8,    11,    10,    21,     0,
725 +      57,    19,    15,    39,     5,    -1,     7,    43,    44,    45,
726 +      -1,    12,    13,    14,     0,    16,    17,    -1,    54,     5,
727 +      56,    -1,    -1,    -1,     0,    11,    12,    13,    14,     5,
728 +      16,    17,    -1,    -1,    -1,    11,    12,    13,    14,     4,
729 +      16,    17,    -1,     8,     9,    10,    11,    -1,    -1,    -1,
730 +      15,    -1,    -1,    -1,    19,    -1,    21,    11,    12,    13,
731 +      14
732 +};
733 +
734 +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
735 +   symbol of state STATE-NUM.  */
736 +static const yytype_uint8 yystos[] =
737 +{
738 +       0,    23,     0,     4,     5,     8,     9,    10,    11,    12,
739 +      13,    14,    15,    16,    17,    24,    25,    26,    27,    28,
740 +      29,    30,    31,    32,    20,    12,    13,    14,    31,     8,
741 +      10,    15,     7,    11,    11,    18,     3,     4,     8,     9,
742 +      10,    11,    15,    19,    21,    20,    11,    31,    11,    31,
743 +      31,    31,     7,    11,    19,    33,    21,    31,    31,    11,
744 +      33
745 +};
746 +
747 +#define yyerrok                (yyerrstatus = 0)
748 +#define yyclearin      (yychar = YYEMPTY)
749 +#define YYEMPTY                (-2)
750 +#define YYEOF          0
751 +
752 +#define YYACCEPT       goto yyacceptlab
753 +#define YYABORT                goto yyabortlab
754 +#define YYERROR                goto yyerrorlab
755 +
756 +
757 +/* Like YYERROR except do call yyerror.  This remains here temporarily
758 +   to ease the transition to the new meaning of YYERROR, for GCC.
759 +   Once GCC version 2 has supplanted version 1, this can go.  However,
760 +   YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
761 +   in Bison 2.4.2's NEWS entry, where a plan to phase it out is
762 +   discussed.  */
763 +
764 +#define YYFAIL         goto yyerrlab
765 +#if defined YYFAIL
766 +  /* This is here to suppress warnings from the GCC cpp's
767 +     -Wunused-macros.  Normally we don't worry about that warning, but
768 +     some users do, and we want to make it easy for users to remove
769 +     YYFAIL uses, which will produce warnings from Bison 2.5.  */
770 +#endif
771 +
772 +#define YYRECOVERING()  (!!yyerrstatus)
773 +
774 +#define YYBACKUP(Token, Value)                                  \
775 +do                                                              \
776 +  if (yychar == YYEMPTY)                                        \
777 +    {                                                           \
778 +      yychar = (Token);                                         \
779 +      yylval = (Value);                                         \
780 +      YYPOPSTACK (yylen);                                       \
781 +      yystate = *yyssp;                                         \
782 +      goto yybackup;                                            \
783 +    }                                                           \
784 +  else                                                          \
785 +    {                                                           \
786 +      yyerror (YY_("syntax error: cannot back up")); \
787 +      YYERROR;                                                 \
788 +    }                                                          \
789 +while (YYID (0))
790 +
791 +/* Error token number */
792 +#define YYTERROR       1
793 +#define YYERRCODE      256
794 +
795 +
796 +/* This macro is provided for backward compatibility. */
797 +#ifndef YY_LOCATION_PRINT
798 +# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
799 +#endif
800 +
801 +
802 +/* YYLEX -- calling `yylex' with the right arguments.  */
803 +#ifdef YYLEX_PARAM
804 +# define YYLEX yylex (&yylval, YYLEX_PARAM)
805 +#else
806 +# define YYLEX yylex (&yylval)
807 +#endif
808 +
809 +/* Enable debugging if requested.  */
810 +#if YYDEBUG
811 +
812 +# ifndef YYFPRINTF
813 +#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
814 +#  define YYFPRINTF fprintf
815 +# endif
816 +
817 +# define YYDPRINTF(Args)                       \
818 +do {                                           \
819 +  if (yydebug)                                 \
820 +    YYFPRINTF Args;                            \
821 +} while (YYID (0))
822 +
823 +# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                   \
824 +do {                                                                     \
825 +  if (yydebug)                                                           \
826 +    {                                                                    \
827 +      YYFPRINTF (stderr, "%s ", Title);                                          \
828 +      yy_symbol_print (stderr,                                           \
829 +                 Type, Value); \
830 +      YYFPRINTF (stderr, "\n");                                                  \
831 +    }                                                                    \
832 +} while (YYID (0))
833 +
834 +
835 +/*--------------------------------.
836 +| Print this symbol on YYOUTPUT.  |
837 +`--------------------------------*/
838 +
839 +/*ARGSUSED*/
840 +#if (defined __STDC__ || defined __C99__FUNC__ \
841 +     || defined __cplusplus || defined _MSC_VER)
842 +static void
843 +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
844 +#else
845 +static void
846 +yy_symbol_value_print (yyoutput, yytype, yyvaluep)
847 +    FILE *yyoutput;
848 +    int yytype;
849 +    YYSTYPE const * const yyvaluep;
850 +#endif
851 +{
852 +  FILE *yyo = yyoutput;
853 +  YYUSE (yyo);
854 +  if (!yyvaluep)
855 +    return;
856 +# ifdef YYPRINT
857 +  if (yytype < YYNTOKENS)
858 +    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
859 +# else
860 +  YYUSE (yyoutput);
861 +# endif
862 +  switch (yytype)
863 +    {
864 +      default:
865 +        break;
866 +    }
867 +}
868 +
869 +
870 +/*--------------------------------.
871 +| Print this symbol on YYOUTPUT.  |
872 +`--------------------------------*/
873 +
874 +#if (defined __STDC__ || defined __C99__FUNC__ \
875 +     || defined __cplusplus || defined _MSC_VER)
876 +static void
877 +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
878 +#else
879 +static void
880 +yy_symbol_print (yyoutput, yytype, yyvaluep)
881 +    FILE *yyoutput;
882 +    int yytype;
883 +    YYSTYPE const * const yyvaluep;
884 +#endif
885 +{
886 +  if (yytype < YYNTOKENS)
887 +    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
888 +  else
889 +    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
890 +
891 +  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
892 +  YYFPRINTF (yyoutput, ")");
893 +}
894 +
895 +/*------------------------------------------------------------------.
896 +| yy_stack_print -- Print the state stack from its BOTTOM up to its |
897 +| TOP (included).                                                   |
898 +`------------------------------------------------------------------*/
899 +
900 +#if (defined __STDC__ || defined __C99__FUNC__ \
901 +     || defined __cplusplus || defined _MSC_VER)
902 +static void
903 +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
904 +#else
905 +static void
906 +yy_stack_print (yybottom, yytop)
907 +    yytype_int16 *yybottom;
908 +    yytype_int16 *yytop;
909 +#endif
910 +{
911 +  YYFPRINTF (stderr, "Stack now");
912 +  for (; yybottom <= yytop; yybottom++)
913 +    {
914 +      int yybot = *yybottom;
915 +      YYFPRINTF (stderr, " %d", yybot);
916 +    }
917 +  YYFPRINTF (stderr, "\n");
918 +}
919 +
920 +# define YY_STACK_PRINT(Bottom, Top)                           \
921 +do {                                                           \
922 +  if (yydebug)                                                 \
923 +    yy_stack_print ((Bottom), (Top));                          \
924 +} while (YYID (0))
925 +
926 +
927 +/*------------------------------------------------.
928 +| Report that the YYRULE is going to be reduced.  |
929 +`------------------------------------------------*/
930 +
931 +#if (defined __STDC__ || defined __C99__FUNC__ \
932 +     || defined __cplusplus || defined _MSC_VER)
933 +static void
934 +yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
935 +#else
936 +static void
937 +yy_reduce_print (yyvsp, yyrule)
938 +    YYSTYPE *yyvsp;
939 +    int yyrule;
940 +#endif
941 +{
942 +  int yynrhs = yyr2[yyrule];
943 +  int yyi;
944 +  unsigned long int yylno = yyrline[yyrule];
945 +  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
946 +            yyrule - 1, yylno);
947 +  /* The symbols being reduced.  */
948 +  for (yyi = 0; yyi < yynrhs; yyi++)
949 +    {
950 +      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
951 +      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
952 +                      &(yyvsp[(yyi + 1) - (yynrhs)])
953 +                                      );
954 +      YYFPRINTF (stderr, "\n");
955 +    }
956 +}
957 +
958 +# define YY_REDUCE_PRINT(Rule)         \
959 +do {                                   \
960 +  if (yydebug)                         \
961 +    yy_reduce_print (yyvsp, Rule); \
962 +} while (YYID (0))
963 +
964 +/* Nonzero means print parse trace.  It is left uninitialized so that
965 +   multiple parsers can coexist.  */
966 +int yydebug;
967 +#else /* !YYDEBUG */
968 +# define YYDPRINTF(Args)
969 +# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
970 +# define YY_STACK_PRINT(Bottom, Top)
971 +# define YY_REDUCE_PRINT(Rule)
972 +#endif /* !YYDEBUG */
973 +
974 +
975 +/* YYINITDEPTH -- initial size of the parser's stacks.  */
976 +#ifndef        YYINITDEPTH
977 +# define YYINITDEPTH 200
978 +#endif
979 +
980 +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
981 +   if the built-in stack extension method is used).
982 +
983 +   Do not make this value too large; the results are undefined if
984 +   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
985 +   evaluated with infinite-precision integer arithmetic.  */
986 +
987 +#ifndef YYMAXDEPTH
988 +# define YYMAXDEPTH 10000
989 +#endif
990 +
991 +
992 +#if YYERROR_VERBOSE
993 +
994 +# ifndef yystrlen
995 +#  if defined __GLIBC__ && defined _STRING_H
996 +#   define yystrlen strlen
997 +#  else
998 +/* Return the length of YYSTR.  */
999 +#if (defined __STDC__ || defined __C99__FUNC__ \
1000 +     || defined __cplusplus || defined _MSC_VER)
1001 +static YYSIZE_T
1002 +yystrlen (const char *yystr)
1003 +#else
1004 +static YYSIZE_T
1005 +yystrlen (yystr)
1006 +    const char *yystr;
1007 +#endif
1008 +{
1009 +  YYSIZE_T yylen;
1010 +  for (yylen = 0; yystr[yylen]; yylen++)
1011 +    continue;
1012 +  return yylen;
1013 +}
1014 +#  endif
1015 +# endif
1016 +
1017 +# ifndef yystpcpy
1018 +#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1019 +#   define yystpcpy stpcpy
1020 +#  else
1021 +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1022 +   YYDEST.  */
1023 +#if (defined __STDC__ || defined __C99__FUNC__ \
1024 +     || defined __cplusplus || defined _MSC_VER)
1025 +static char *
1026 +yystpcpy (char *yydest, const char *yysrc)
1027 +#else
1028 +static char *
1029 +yystpcpy (yydest, yysrc)
1030 +    char *yydest;
1031 +    const char *yysrc;
1032 +#endif
1033 +{
1034 +  char *yyd = yydest;
1035 +  const char *yys = yysrc;
1036 +
1037 +  while ((*yyd++ = *yys++) != '\0')
1038 +    continue;
1039 +
1040 +  return yyd - 1;
1041 +}
1042 +#  endif
1043 +# endif
1044 +
1045 +# ifndef yytnamerr
1046 +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1047 +   quotes and backslashes, so that it's suitable for yyerror.  The
1048 +   heuristic is that double-quoting is unnecessary unless the string
1049 +   contains an apostrophe, a comma, or backslash (other than
1050 +   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
1051 +   null, do not copy; instead, return the length of what the result
1052 +   would have been.  */
1053 +static YYSIZE_T
1054 +yytnamerr (char *yyres, const char *yystr)
1055 +{
1056 +  if (*yystr == '"')
1057 +    {
1058 +      YYSIZE_T yyn = 0;
1059 +      char const *yyp = yystr;
1060 +
1061 +      for (;;)
1062 +       switch (*++yyp)
1063 +         {
1064 +         case '\'':
1065 +         case ',':
1066 +           goto do_not_strip_quotes;
1067 +
1068 +         case '\\':
1069 +           if (*++yyp != '\\')
1070 +             goto do_not_strip_quotes;
1071 +           /* Fall through.  */
1072 +         default:
1073 +           if (yyres)
1074 +             yyres[yyn] = *yyp;
1075 +           yyn++;
1076 +           break;
1077 +
1078 +         case '"':
1079 +           if (yyres)
1080 +             yyres[yyn] = '\0';
1081 +           return yyn;
1082 +         }
1083 +    do_not_strip_quotes: ;
1084 +    }
1085 +
1086 +  if (! yyres)
1087 +    return yystrlen (yystr);
1088 +
1089 +  return yystpcpy (yyres, yystr) - yyres;
1090 +}
1091 +# endif
1092 +
1093 +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1094 +   about the unexpected token YYTOKEN for the state stack whose top is
1095 +   YYSSP.
1096 +
1097 +   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
1098 +   not large enough to hold the message.  In that case, also set
1099 +   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
1100 +   required number of bytes is too large to store.  */
1101 +static int
1102 +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1103 +                yytype_int16 *yyssp, int yytoken)
1104 +{
1105 +  YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
1106 +  YYSIZE_T yysize = yysize0;
1107 +  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1108 +  /* Internationalized format string. */
1109 +  const char *yyformat = YY_NULL;
1110 +  /* Arguments of yyformat. */
1111 +  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1112 +  /* Number of reported tokens (one for the "unexpected", one per
1113 +     "expected"). */
1114 +  int yycount = 0;
1115 +
1116 +  /* There are many possibilities here to consider:
1117 +     - Assume YYFAIL is not used.  It's too flawed to consider.  See
1118 +       <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1119 +       for details.  YYERROR is fine as it does not invoke this
1120 +       function.
1121 +     - If this state is a consistent state with a default action, then
1122 +       the only way this function was invoked is if the default action
1123 +       is an error action.  In that case, don't check for expected
1124 +       tokens because there are none.
1125 +     - The only way there can be no lookahead present (in yychar) is if
1126 +       this state is a consistent state with a default action.  Thus,
1127 +       detecting the absence of a lookahead is sufficient to determine
1128 +       that there is no unexpected or expected token to report.  In that
1129 +       case, just report a simple "syntax error".
1130 +     - Don't assume there isn't a lookahead just because this state is a
1131 +       consistent state with a default action.  There might have been a
1132 +       previous inconsistent state, consistent state with a non-default
1133 +       action, or user semantic action that manipulated yychar.
1134 +     - Of course, the expected token list depends on states to have
1135 +       correct lookahead information, and it depends on the parser not
1136 +       to perform extra reductions after fetching a lookahead from the
1137 +       scanner and before detecting a syntax error.  Thus, state merging
1138 +       (from LALR or IELR) and default reductions corrupt the expected
1139 +       token list.  However, the list is correct for canonical LR with
1140 +       one exception: it will still contain any token that will not be
1141 +       accepted due to an error action in a later state.
1142 +  */
1143 +  if (yytoken != YYEMPTY)
1144 +    {
1145 +      int yyn = yypact[*yyssp];
1146 +      yyarg[yycount++] = yytname[yytoken];
1147 +      if (!yypact_value_is_default (yyn))
1148 +        {
1149 +          /* Start YYX at -YYN if negative to avoid negative indexes in
1150 +             YYCHECK.  In other words, skip the first -YYN actions for
1151 +             this state because they are default actions.  */
1152 +          int yyxbegin = yyn < 0 ? -yyn : 0;
1153 +          /* Stay within bounds of both yycheck and yytname.  */
1154 +          int yychecklim = YYLAST - yyn + 1;
1155 +          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1156 +          int yyx;
1157 +
1158 +          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1159 +            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1160 +                && !yytable_value_is_error (yytable[yyx + yyn]))
1161 +              {
1162 +                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1163 +                  {
1164 +                    yycount = 1;
1165 +                    yysize = yysize0;
1166 +                    break;
1167 +                  }
1168 +                yyarg[yycount++] = yytname[yyx];
1169 +                {
1170 +                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1171 +                  if (! (yysize <= yysize1
1172 +                         && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1173 +                    return 2;
1174 +                  yysize = yysize1;
1175 +                }
1176 +              }
1177 +        }
1178 +    }
1179 +
1180 +  switch (yycount)
1181 +    {
1182 +# define YYCASE_(N, S)                      \
1183 +      case N:                               \
1184 +        yyformat = S;                       \
1185 +      break
1186 +      YYCASE_(0, YY_("syntax error"));
1187 +      YYCASE_(1, YY_("syntax error, unexpected %s"));
1188 +      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1189 +      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1190 +      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1191 +      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1192 +# undef YYCASE_
1193 +    }
1194 +
1195 +  {
1196 +    YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1197 +    if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1198 +      return 2;
1199 +    yysize = yysize1;
1200 +  }
1201 +
1202 +  if (*yymsg_alloc < yysize)
1203 +    {
1204 +      *yymsg_alloc = 2 * yysize;
1205 +      if (! (yysize <= *yymsg_alloc
1206 +             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1207 +        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1208 +      return 1;
1209 +    }
1210 +
1211 +  /* Avoid sprintf, as that infringes on the user's name space.
1212 +     Don't have undefined behavior even if the translation
1213 +     produced a string with the wrong number of "%s"s.  */
1214 +  {
1215 +    char *yyp = *yymsg;
1216 +    int yyi = 0;
1217 +    while ((*yyp = *yyformat) != '\0')
1218 +      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1219 +        {
1220 +          yyp += yytnamerr (yyp, yyarg[yyi++]);
1221 +          yyformat += 2;
1222 +        }
1223 +      else
1224 +        {
1225 +          yyp++;
1226 +          yyformat++;
1227 +        }
1228 +  }
1229 +  return 0;
1230 +}
1231 +#endif /* YYERROR_VERBOSE */
1232 +
1233 +/*-----------------------------------------------.
1234 +| Release the memory associated to this symbol.  |
1235 +`-----------------------------------------------*/
1236 +
1237 +/*ARGSUSED*/
1238 +#if (defined __STDC__ || defined __C99__FUNC__ \
1239 +     || defined __cplusplus || defined _MSC_VER)
1240 +static void
1241 +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1242 +#else
1243 +static void
1244 +yydestruct (yymsg, yytype, yyvaluep)
1245 +    const char *yymsg;
1246 +    int yytype;
1247 +    YYSTYPE *yyvaluep;
1248 +#endif
1249 +{
1250 +  YYUSE (yyvaluep);
1251 +
1252 +  if (!yymsg)
1253 +    yymsg = "Deleting";
1254 +  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1255 +
1256 +  switch (yytype)
1257 +    {
1258 +
1259 +      default:
1260 +        break;
1261 +    }
1262 +}
1263 +
1264 +
1265 +
1266 +
1267 +/*----------.
1268 +| yyparse.  |
1269 +`----------*/
1270 +
1271 +#ifdef YYPARSE_PARAM
1272 +#if (defined __STDC__ || defined __C99__FUNC__ \
1273 +     || defined __cplusplus || defined _MSC_VER)
1274 +int
1275 +yyparse (void *YYPARSE_PARAM)
1276 +#else
1277 +int
1278 +yyparse (YYPARSE_PARAM)
1279 +    void *YYPARSE_PARAM;
1280 +#endif
1281 +#else /* ! YYPARSE_PARAM */
1282 +#if (defined __STDC__ || defined __C99__FUNC__ \
1283 +     || defined __cplusplus || defined _MSC_VER)
1284 +int
1285 +yyparse (void)
1286 +#else
1287 +int
1288 +yyparse ()
1289 +
1290 +#endif
1291 +#endif
1292 +{
1293 +/* The lookahead symbol.  */
1294 +int yychar;
1295 +
1296 +
1297 +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
1298 +/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
1299 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1300 +    _Pragma ("GCC diagnostic push") \
1301 +    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
1302 +    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
1303 +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
1304 +    _Pragma ("GCC diagnostic pop")
1305 +#else
1306 +/* Default value used for initialization, for pacifying older GCCs
1307 +   or non-GCC compilers.  */
1308 +static YYSTYPE yyval_default;
1309 +# define YY_INITIAL_VALUE(Value) = Value
1310 +#endif
1311 +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1312 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1313 +# define YY_IGNORE_MAYBE_UNINITIALIZED_END
1314 +#endif
1315 +#ifndef YY_INITIAL_VALUE
1316 +# define YY_INITIAL_VALUE(Value) /* Nothing. */
1317 +#endif
1318 +
1319 +/* The semantic value of the lookahead symbol.  */
1320 +YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
1321 +
1322 +    /* Number of syntax errors so far.  */
1323 +    int yynerrs;
1324 +
1325 +    int yystate;
1326 +    /* Number of tokens to shift before error messages enabled.  */
1327 +    int yyerrstatus;
1328 +
1329 +    /* The stacks and their tools:
1330 +       `yyss': related to states.
1331 +       `yyvs': related to semantic values.
1332 +
1333 +       Refer to the stacks through separate pointers, to allow yyoverflow
1334 +       to reallocate them elsewhere.  */
1335 +
1336 +    /* The state stack.  */
1337 +    yytype_int16 yyssa[YYINITDEPTH];
1338 +    yytype_int16 *yyss;
1339 +    yytype_int16 *yyssp;
1340 +
1341 +    /* The semantic value stack.  */
1342 +    YYSTYPE yyvsa[YYINITDEPTH];
1343 +    YYSTYPE *yyvs;
1344 +    YYSTYPE *yyvsp;
1345 +
1346 +    YYSIZE_T yystacksize;
1347 +
1348 +  int yyn;
1349 +  int yyresult;
1350 +  /* Lookahead token as an internal (translated) token number.  */
1351 +  int yytoken = 0;
1352 +  /* The variables used to return semantic value and location from the
1353 +     action routines.  */
1354 +  YYSTYPE yyval;
1355 +
1356 +#if YYERROR_VERBOSE
1357 +  /* Buffer for error messages, and its allocated size.  */
1358 +  char yymsgbuf[128];
1359 +  char *yymsg = yymsgbuf;
1360 +  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1361 +#endif
1362 +
1363 +#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1364 +
1365 +  /* The number of symbols on the RHS of the reduced rule.
1366 +     Keep to zero when no symbol should be popped.  */
1367 +  int yylen = 0;
1368 +
1369 +  yyssp = yyss = yyssa;
1370 +  yyvsp = yyvs = yyvsa;
1371 +  yystacksize = YYINITDEPTH;
1372 +
1373 +  YYDPRINTF ((stderr, "Starting parse\n"));
1374 +
1375 +  yystate = 0;
1376 +  yyerrstatus = 0;
1377 +  yynerrs = 0;
1378 +  yychar = YYEMPTY; /* Cause a token to be read.  */
1379 +  goto yysetstate;
1380 +
1381 +/*------------------------------------------------------------.
1382 +| yynewstate -- Push a new state, which is found in yystate.  |
1383 +`------------------------------------------------------------*/
1384 + yynewstate:
1385 +  /* In all cases, when you get here, the value and location stacks
1386 +     have just been pushed.  So pushing a state here evens the stacks.  */
1387 +  yyssp++;
1388 +
1389 + yysetstate:
1390 +  *yyssp = yystate;
1391 +
1392 +  if (yyss + yystacksize - 1 <= yyssp)
1393 +    {
1394 +      /* Get the current used size of the three stacks, in elements.  */
1395 +      YYSIZE_T yysize = yyssp - yyss + 1;
1396 +
1397 +#ifdef yyoverflow
1398 +      {
1399 +       /* Give user a chance to reallocate the stack.  Use copies of
1400 +          these so that the &'s don't force the real ones into
1401 +          memory.  */
1402 +       YYSTYPE *yyvs1 = yyvs;
1403 +       yytype_int16 *yyss1 = yyss;
1404 +
1405 +       /* Each stack pointer address is followed by the size of the
1406 +          data in use in that stack, in bytes.  This used to be a
1407 +          conditional around just the two extra args, but that might
1408 +          be undefined if yyoverflow is a macro.  */
1409 +       yyoverflow (YY_("memory exhausted"),
1410 +                   &yyss1, yysize * sizeof (*yyssp),
1411 +                   &yyvs1, yysize * sizeof (*yyvsp),
1412 +                   &yystacksize);
1413 +
1414 +       yyss = yyss1;
1415 +       yyvs = yyvs1;
1416 +      }
1417 +#else /* no yyoverflow */
1418 +# ifndef YYSTACK_RELOCATE
1419 +      goto yyexhaustedlab;
1420 +# else
1421 +      /* Extend the stack our own way.  */
1422 +      if (YYMAXDEPTH <= yystacksize)
1423 +       goto yyexhaustedlab;
1424 +      yystacksize *= 2;
1425 +      if (YYMAXDEPTH < yystacksize)
1426 +       yystacksize = YYMAXDEPTH;
1427 +
1428 +      {
1429 +       yytype_int16 *yyss1 = yyss;
1430 +       union yyalloc *yyptr =
1431 +         (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1432 +       if (! yyptr)
1433 +         goto yyexhaustedlab;
1434 +       YYSTACK_RELOCATE (yyss_alloc, yyss);
1435 +       YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1436 +#  undef YYSTACK_RELOCATE
1437 +       if (yyss1 != yyssa)
1438 +         YYSTACK_FREE (yyss1);
1439 +      }
1440 +# endif
1441 +#endif /* no yyoverflow */
1442 +
1443 +      yyssp = yyss + yysize - 1;
1444 +      yyvsp = yyvs + yysize - 1;
1445 +
1446 +      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1447 +                 (unsigned long int) yystacksize));
1448 +
1449 +      if (yyss + yystacksize - 1 <= yyssp)
1450 +       YYABORT;
1451 +    }
1452 +
1453 +  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1454 +
1455 +  if (yystate == YYFINAL)
1456 +    YYACCEPT;
1457 +
1458 +  goto yybackup;
1459 +
1460 +/*-----------.
1461 +| yybackup.  |
1462 +`-----------*/
1463 +yybackup:
1464 +
1465 +  /* Do appropriate processing given the current state.  Read a
1466 +     lookahead token if we need one and don't already have one.  */
1467 +
1468 +  /* First try to decide what to do without reference to lookahead token.  */
1469 +  yyn = yypact[yystate];
1470 +  if (yypact_value_is_default (yyn))
1471 +    goto yydefault;
1472 +
1473 +  /* Not known => get a lookahead token if don't already have one.  */
1474 +
1475 +  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1476 +  if (yychar == YYEMPTY)
1477 +    {
1478 +      YYDPRINTF ((stderr, "Reading a token: "));
1479 +      yychar = YYLEX;
1480 +    }
1481 +
1482 +  if (yychar <= YYEOF)
1483 +    {
1484 +      yychar = yytoken = YYEOF;
1485 +      YYDPRINTF ((stderr, "Now at end of input.\n"));
1486 +    }
1487 +  else
1488 +    {
1489 +      yytoken = YYTRANSLATE (yychar);
1490 +      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1491 +    }
1492 +
1493 +  /* If the proper action on seeing token YYTOKEN is to reduce or to
1494 +     detect an error, take that action.  */
1495 +  yyn += yytoken;
1496 +  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1497 +    goto yydefault;
1498 +  yyn = yytable[yyn];
1499 +  if (yyn <= 0)
1500 +    {
1501 +      if (yytable_value_is_error (yyn))
1502 +        goto yyerrlab;
1503 +      yyn = -yyn;
1504 +      goto yyreduce;
1505 +    }
1506 +
1507 +  /* Count tokens shifted since error; after three, turn off error
1508 +     status.  */
1509 +  if (yyerrstatus)
1510 +    yyerrstatus--;
1511 +
1512 +  /* Shift the lookahead token.  */
1513 +  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1514 +
1515 +  /* Discard the shifted token.  */
1516 +  yychar = YYEMPTY;
1517 +
1518 +  yystate = yyn;
1519 +  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1520 +  *++yyvsp = yylval;
1521 +  YY_IGNORE_MAYBE_UNINITIALIZED_END
1522 +
1523 +  goto yynewstate;
1524 +
1525 +
1526 +/*-----------------------------------------------------------.
1527 +| yydefault -- do the default action for the current state.  |
1528 +`-----------------------------------------------------------*/
1529 +yydefault:
1530 +  yyn = yydefact[yystate];
1531 +  if (yyn == 0)
1532 +    goto yyerrlab;
1533 +  goto yyreduce;
1534 +
1535 +
1536 +/*-----------------------------.
1537 +| yyreduce -- Do a reduction.  |
1538 +`-----------------------------*/
1539 +yyreduce:
1540 +  /* yyn is the number of a rule to reduce with.  */
1541 +  yylen = yyr2[yyn];
1542 +
1543 +  /* If YYLEN is nonzero, implement the default value of the action:
1544 +     `$$ = $1'.
1545 +
1546 +     Otherwise, the following line sets YYVAL to garbage.
1547 +     This behavior is undocumented and Bison
1548 +     users should not rely upon it.  Assigning to YYVAL
1549 +     unconditionally makes the parser a bit smaller, and it avoids a
1550 +     GCC warning that YYVAL may be used uninitialized.  */
1551 +  yyval = yyvsp[1-yylen];
1552 +
1553 +
1554 +  YY_REDUCE_PRINT (yyn);
1555 +  switch (yyn)
1556 +    {
1557 +        case 4:
1558 +/* Line 1792 of yacc.c  */
1559 +#line 153 "../common/getdate.y"
1560 +    {
1561 +           VARIABLE->yyHaveTime++;
1562 +       }
1563 +    break;
1564 +
1565 +  case 5:
1566 +/* Line 1792 of yacc.c  */
1567 +#line 156 "../common/getdate.y"
1568 +    {
1569 +           VARIABLE->yyHaveZone++;
1570 +       }
1571 +    break;
1572 +
1573 +  case 6:
1574 +/* Line 1792 of yacc.c  */
1575 +#line 159 "../common/getdate.y"
1576 +    {
1577 +           VARIABLE->yyHaveDate++;
1578 +       }
1579 +    break;
1580 +
1581 +  case 7:
1582 +/* Line 1792 of yacc.c  */
1583 +#line 162 "../common/getdate.y"
1584 +    {
1585 +           VARIABLE->yyHaveDay++;
1586 +       }
1587 +    break;
1588 +
1589 +  case 8:
1590 +/* Line 1792 of yacc.c  */
1591 +#line 165 "../common/getdate.y"
1592 +    {
1593 +           VARIABLE->yyHaveRel++;
1594 +       }
1595 +    break;
1596 +
1597 +  case 10:
1598 +/* Line 1792 of yacc.c  */
1599 +#line 171 "../common/getdate.y"
1600 +    {
1601 +           VARIABLE->yyHour = (yyvsp[(1) - (2)].Number);
1602 +           VARIABLE->yyMinutes = 0;
1603 +           VARIABLE->yySeconds = 0;
1604 +           VARIABLE->yyMeridian = (yyvsp[(2) - (2)].Meridian);
1605 +       }
1606 +    break;
1607 +
1608 +  case 11:
1609 +/* Line 1792 of yacc.c  */
1610 +#line 177 "../common/getdate.y"
1611 +    {
1612 +           VARIABLE->yyHour = (yyvsp[(1) - (2)].Number)/100;
1613 +           VARIABLE->yyMinutes = (yyvsp[(1) - (2)].Number)%100;
1614 +           VARIABLE->yySeconds = 0;
1615 +           VARIABLE->yyMeridian = MER24;
1616 +           VARIABLE->yyDSTmode = DSToff;
1617 +           VARIABLE->yyTimezone = - ((yyvsp[(2) - (2)].Number) % 100 + ((yyvsp[(2) - (2)].Number) / 100) * 60);
1618 +        }
1619 +    break;
1620 +
1621 +  case 12:
1622 +/* Line 1792 of yacc.c  */
1623 +#line 185 "../common/getdate.y"
1624 +    {
1625 +           VARIABLE->yyHour = (yyvsp[(1) - (2)].Number)/10000;
1626 +           VARIABLE->yyMinutes = ((yyvsp[(1) - (2)].Number)/100)%100;
1627 +           VARIABLE->yySeconds = (yyvsp[(1) - (2)].Number) % 100;
1628 +           VARIABLE->yyMeridian = MER24;
1629 +           VARIABLE->yyDSTmode = DSToff;
1630 +           VARIABLE->yyTimezone = - ((yyvsp[(2) - (2)].Number) % 100 + ((yyvsp[(2) - (2)].Number) / 100) * 60);
1631 +        }
1632 +    break;
1633 +
1634 +  case 13:
1635 +/* Line 1792 of yacc.c  */
1636 +#line 193 "../common/getdate.y"
1637 +    {
1638 +           VARIABLE->yyHour = (yyvsp[(1) - (4)].Number);
1639 +           VARIABLE->yyMinutes = (yyvsp[(3) - (4)].Number);
1640 +           VARIABLE->yySeconds = 0;
1641 +           VARIABLE->yyMeridian = (yyvsp[(4) - (4)].Meridian);
1642 +       }
1643 +    break;
1644 +
1645 +  case 14:
1646 +/* Line 1792 of yacc.c  */
1647 +#line 199 "../common/getdate.y"
1648 +    {
1649 +           VARIABLE->yyHour = (yyvsp[(1) - (4)].Number);
1650 +           VARIABLE->yyMinutes = (yyvsp[(3) - (4)].Number);
1651 +           VARIABLE->yyMeridian = MER24;
1652 +           VARIABLE->yyDSTmode = DSToff;
1653 +           VARIABLE->yyTimezone = - ((yyvsp[(4) - (4)].Number) % 100 + ((yyvsp[(4) - (4)].Number) / 100) * 60);
1654 +       }
1655 +    break;
1656 +
1657 +  case 15:
1658 +/* Line 1792 of yacc.c  */
1659 +#line 206 "../common/getdate.y"
1660 +    {
1661 +           VARIABLE->yyHour = (yyvsp[(1) - (6)].Number);
1662 +           VARIABLE->yyMinutes = (yyvsp[(3) - (6)].Number);
1663 +           VARIABLE->yySeconds = (yyvsp[(5) - (6)].Number);
1664 +           VARIABLE->yyMeridian = (yyvsp[(6) - (6)].Meridian);
1665 +       }
1666 +    break;
1667 +
1668 +  case 16:
1669 +/* Line 1792 of yacc.c  */
1670 +#line 212 "../common/getdate.y"
1671 +    {
1672 +           VARIABLE->yyHour = (yyvsp[(1) - (6)].Number);
1673 +           VARIABLE->yyMinutes = (yyvsp[(3) - (6)].Number);
1674 +           VARIABLE->yySeconds = (yyvsp[(5) - (6)].Number);
1675 +           VARIABLE->yyMeridian = MER24;
1676 +           VARIABLE->yyDSTmode = DSToff;
1677 +           VARIABLE->yyTimezone = - ((yyvsp[(6) - (6)].Number) % 100 + ((yyvsp[(6) - (6)].Number) / 100) * 60);
1678 +       }
1679 +    break;
1680 +
1681 +  case 17:
1682 +/* Line 1792 of yacc.c  */
1683 +#line 222 "../common/getdate.y"
1684 +    {
1685 +           VARIABLE->yyTimezone = (yyvsp[(1) - (1)].Number);
1686 +           VARIABLE->yyDSTmode = DSToff;
1687 +       }
1688 +    break;
1689 +
1690 +  case 18:
1691 +/* Line 1792 of yacc.c  */
1692 +#line 226 "../common/getdate.y"
1693 +    {
1694 +           VARIABLE->yyTimezone = (yyvsp[(1) - (1)].Number);
1695 +           VARIABLE->yyDSTmode = DSTon;
1696 +       }
1697 +    break;
1698 +
1699 +  case 19:
1700 +/* Line 1792 of yacc.c  */
1701 +#line 231 "../common/getdate.y"
1702 +    {
1703 +           VARIABLE->yyTimezone = (yyvsp[(1) - (2)].Number);
1704 +           VARIABLE->yyDSTmode = DSTon;
1705 +       }
1706 +    break;
1707 +
1708 +  case 20:
1709 +/* Line 1792 of yacc.c  */
1710 +#line 235 "../common/getdate.y"
1711 +    {
1712 +            if (VARIABLE->yyHaveTime > 0) {
1713 +             VARIABLE->yyTimezone = (yyvsp[(1) - (1)].Number);
1714 +             VARIABLE->yyDSTmode = DSToff;
1715 +            }
1716 +            else
1717 +              VARIABLE->yyHaveZone--;
1718 +        }
1719 +    break;
1720 +
1721 +  case 21:
1722 +/* Line 1792 of yacc.c  */
1723 +#line 245 "../common/getdate.y"
1724 +    {
1725 +           VARIABLE->yyDayOrdinal = 1;
1726 +           VARIABLE->yyDayNumber = (yyvsp[(1) - (1)].Number);
1727 +       }
1728 +    break;
1729 +
1730 +  case 22:
1731 +/* Line 1792 of yacc.c  */
1732 +#line 249 "../common/getdate.y"
1733 +    {
1734 +           VARIABLE->yyDayOrdinal = 1;
1735 +           VARIABLE->yyDayNumber = (yyvsp[(1) - (2)].Number);
1736 +       }
1737 +    break;
1738 +
1739 +  case 23:
1740 +/* Line 1792 of yacc.c  */
1741 +#line 253 "../common/getdate.y"
1742 +    {
1743 +           VARIABLE->yyDayOrdinal = (yyvsp[(1) - (2)].Number);
1744 +           VARIABLE->yyDayNumber = (yyvsp[(2) - (2)].Number);
1745 +       }
1746 +    break;
1747 +
1748 +  case 24:
1749 +/* Line 1792 of yacc.c  */
1750 +#line 259 "../common/getdate.y"
1751 +    {
1752 +           SetPossibleDate(VARIABLE, (yyvsp[(1) - (3)].Number), (yyvsp[(3) - (3)].Number), VARIABLE->yyYear);
1753 +       }
1754 +    break;
1755 +
1756 +  case 25:
1757 +/* Line 1792 of yacc.c  */
1758 +#line 262 "../common/getdate.y"
1759 +    {
1760 +           SetPossibleDate(VARIABLE, (yyvsp[(1) - (5)].Number), (yyvsp[(3) - (5)].Number), (yyvsp[(5) - (5)].Number));
1761 +       }
1762 +    break;
1763 +
1764 +  case 26:
1765 +/* Line 1792 of yacc.c  */
1766 +#line 265 "../common/getdate.y"
1767 +    {
1768 +           /* ISO 8601 format.  yyyy-mm-dd.  */
1769 +           if ((yyvsp[(1) - (3)].Number) > 31) {
1770 +               VARIABLE->yyYear = (yyvsp[(1) - (3)].Number);
1771 +               VARIABLE->yyMonth = -(yyvsp[(2) - (3)].Number);
1772 +               VARIABLE->yyDay = -(yyvsp[(3) - (3)].Number);
1773 +           }
1774 +           else
1775 +               SetPossibleDate(VARIABLE, (yyvsp[(1) - (3)].Number), -(yyvsp[(2) - (3)].Number), -(yyvsp[(3) - (3)].Number));
1776 +       }
1777 +    break;
1778 +
1779 +  case 27:
1780 +/* Line 1792 of yacc.c  */
1781 +#line 275 "../common/getdate.y"
1782 +    {
1783 +           /* e.g. 17-JUN-1992.  */
1784 +           VARIABLE->yyDay = (yyvsp[(1) - (3)].Number);
1785 +           VARIABLE->yyMonth = (yyvsp[(2) - (3)].Number);
1786 +           VARIABLE->yyYear = -(yyvsp[(3) - (3)].Number);
1787 +       }
1788 +    break;
1789 +
1790 +  case 28:
1791 +/* Line 1792 of yacc.c  */
1792 +#line 281 "../common/getdate.y"
1793 +    {
1794 +           VARIABLE->yyMonth = (yyvsp[(1) - (2)].Number);
1795 +           VARIABLE->yyDay = (yyvsp[(2) - (2)].Number);
1796 +       }
1797 +    break;
1798 +
1799 +  case 29:
1800 +/* Line 1792 of yacc.c  */
1801 +#line 285 "../common/getdate.y"
1802 +    {
1803 +           VARIABLE->yyMonth = (yyvsp[(1) - (4)].Number);
1804 +           VARIABLE->yyDay = (yyvsp[(2) - (4)].Number);
1805 +           VARIABLE->yyYear = (yyvsp[(4) - (4)].Number);
1806 +       }
1807 +    break;
1808 +
1809 +  case 30:
1810 +/* Line 1792 of yacc.c  */
1811 +#line 290 "../common/getdate.y"
1812 +    {
1813 +           VARIABLE->yyMonth = (yyvsp[(2) - (2)].Number);
1814 +           VARIABLE->yyDay = (yyvsp[(1) - (2)].Number);
1815 +       }
1816 +    break;
1817 +
1818 +  case 31:
1819 +/* Line 1792 of yacc.c  */
1820 +#line 294 "../common/getdate.y"
1821 +    {
1822 +           VARIABLE->yyMonth = (yyvsp[(2) - (3)].Number);
1823 +           VARIABLE->yyDay = (yyvsp[(1) - (3)].Number);
1824 +           VARIABLE->yyYear = (yyvsp[(3) - (3)].Number);
1825 +       }
1826 +    break;
1827 +
1828 +  case 32:
1829 +/* Line 1792 of yacc.c  */
1830 +#line 301 "../common/getdate.y"
1831 +    {
1832 +           VARIABLE->yyRelSeconds = -VARIABLE->yyRelSeconds;
1833 +           VARIABLE->yyRelMonth = -VARIABLE->yyRelMonth;
1834 +       }
1835 +    break;
1836 +
1837 +  case 34:
1838 +/* Line 1792 of yacc.c  */
1839 +#line 308 "../common/getdate.y"
1840 +    {
1841 +           VARIABLE->yyRelSeconds += (yyvsp[(1) - (2)].Number) * (yyvsp[(2) - (2)].Number) * 60L;
1842 +       }
1843 +    break;
1844 +
1845 +  case 35:
1846 +/* Line 1792 of yacc.c  */
1847 +#line 311 "../common/getdate.y"
1848 +    {
1849 +           VARIABLE->yyRelSeconds += (yyvsp[(1) - (2)].Number) * (yyvsp[(2) - (2)].Number) * 60L;
1850 +       }
1851 +    break;
1852 +
1853 +  case 36:
1854 +/* Line 1792 of yacc.c  */
1855 +#line 314 "../common/getdate.y"
1856 +    {
1857 +           VARIABLE->yyRelSeconds += (yyvsp[(1) - (1)].Number) * 60L;
1858 +       }
1859 +    break;
1860 +
1861 +  case 37:
1862 +/* Line 1792 of yacc.c  */
1863 +#line 317 "../common/getdate.y"
1864 +    {
1865 +           VARIABLE->yyRelSeconds += (yyvsp[(1) - (2)].Number);
1866 +       }
1867 +    break;
1868 +
1869 +  case 38:
1870 +/* Line 1792 of yacc.c  */
1871 +#line 320 "../common/getdate.y"
1872 +    {
1873 +           VARIABLE->yyRelSeconds += (yyvsp[(1) - (2)].Number);
1874 +       }
1875 +    break;
1876 +
1877 +  case 39:
1878 +/* Line 1792 of yacc.c  */
1879 +#line 323 "../common/getdate.y"
1880 +    {
1881 +           VARIABLE->yyRelSeconds++;
1882 +       }
1883 +    break;
1884 +
1885 +  case 40:
1886 +/* Line 1792 of yacc.c  */
1887 +#line 326 "../common/getdate.y"
1888 +    {
1889 +           VARIABLE->yyRelMonth += (yyvsp[(1) - (2)].Number) * (yyvsp[(2) - (2)].Number);
1890 +       }
1891 +    break;
1892 +
1893 +  case 41:
1894 +/* Line 1792 of yacc.c  */
1895 +#line 329 "../common/getdate.y"
1896 +    {
1897 +           VARIABLE->yyRelMonth += (yyvsp[(1) - (2)].Number) * (yyvsp[(2) - (2)].Number);
1898 +       }
1899 +    break;
1900 +
1901 +  case 42:
1902 +/* Line 1792 of yacc.c  */
1903 +#line 332 "../common/getdate.y"
1904 +    {
1905 +           VARIABLE->yyRelMonth += (yyvsp[(1) - (1)].Number);
1906 +       }
1907 +    break;
1908 +
1909 +  case 43:
1910 +/* Line 1792 of yacc.c  */
1911 +#line 337 "../common/getdate.y"
1912 +    {
1913 +           (yyval.Number) = (yyvsp[(1) - (1)].Number);
1914 +       }
1915 +    break;
1916 +
1917 +  case 44:
1918 +/* Line 1792 of yacc.c  */
1919 +#line 340 "../common/getdate.y"
1920 +    {
1921 +           (yyval.Number) = (yyvsp[(1) - (1)].Number);
1922 +       }
1923 +    break;
1924 +
1925 +  case 45:
1926 +/* Line 1792 of yacc.c  */
1927 +#line 343 "../common/getdate.y"
1928 +    {
1929 +           (yyval.Number) = (yyvsp[(1) - (1)].Number);
1930 +       }
1931 +    break;
1932 +
1933 +  case 46:
1934 +/* Line 1792 of yacc.c  */
1935 +#line 348 "../common/getdate.y"
1936 +    {
1937 +           if (VARIABLE->yyHaveTime && VARIABLE->yyHaveDate && !VARIABLE->yyHaveRel)
1938 +               VARIABLE->yyYear = (yyvsp[(1) - (1)].Number);
1939 +           else {
1940 +               if((yyvsp[(1) - (1)].Number)>240000) {
1941 +                   VARIABLE->yyHaveDate++;
1942 +                   VARIABLE->yyDay= ((yyvsp[(1) - (1)].Number))%100;
1943 +                   VARIABLE->yyMonth= ((yyvsp[(1) - (1)].Number)/100)%100;
1944 +                   VARIABLE->yyYear = (yyvsp[(1) - (1)].Number)/10000;
1945 +               }
1946 +               else {
1947 +                   VARIABLE->yyHaveTime++;
1948 +                   if ((yyvsp[(1) - (1)].Number) < 10000) {
1949 +                       VARIABLE->yyHour = (yyvsp[(1) - (1)].Number) / 100;
1950 +                       VARIABLE->yyMinutes = (yyvsp[(1) - (1)].Number) % 100;
1951 +                       VARIABLE->yySeconds = 0;
1952 +                   }
1953 +                   else {
1954 +                       VARIABLE->yyHour = (yyvsp[(1) - (1)].Number)/10000;
1955 +                       VARIABLE->yyMinutes = ((yyvsp[(1) - (1)].Number)/100)%100;
1956 +                       VARIABLE->yySeconds = (yyvsp[(1) - (1)].Number) % 100;
1957 +                    }
1958 +                   VARIABLE->yyMeridian = MER24;
1959 +               }
1960 +           }
1961 +       }
1962 +    break;
1963 +
1964 +  case 47:
1965 +/* Line 1792 of yacc.c  */
1966 +#line 374 "../common/getdate.y"
1967 +    {
1968 +           if (VARIABLE->yyHaveTime && VARIABLE->yyHaveDate && !VARIABLE->yyHaveRel)
1969 +               VARIABLE->yyYear = (yyvsp[(1) - (1)].Number);
1970 +           else {
1971 +               VARIABLE->yyHaveTime++;
1972 +               VARIABLE->yyHour = (yyvsp[(1) - (1)].Number)/100;
1973 +               VARIABLE->yyMinutes = (yyvsp[(1) - (1)].Number)%100;
1974 +               VARIABLE->yySeconds = 0;
1975 +               VARIABLE->yyMeridian = MER24;
1976 +            }
1977 +        }
1978 +    break;
1979 +
1980 +  case 48:
1981 +/* Line 1792 of yacc.c  */
1982 +#line 385 "../common/getdate.y"
1983 +    {
1984 +           if (!VARIABLE->yyHaveDate && (yyvsp[(1) - (1)].Number)>240000) {
1985 +               VARIABLE->yyHaveDate++;
1986 +               VARIABLE->yyDay= ((yyvsp[(1) - (1)].Number))%100;
1987 +               VARIABLE->yyMonth= ((yyvsp[(1) - (1)].Number)/100)%100;
1988 +               VARIABLE->yyYear = (yyvsp[(1) - (1)].Number)/10000;
1989 +           }
1990 +           else if (!VARIABLE->yyHaveTime) {
1991 +               VARIABLE->yyHaveTime++;
1992 +               VARIABLE->yyHour = (yyvsp[(1) - (1)].Number)/10000;
1993 +               VARIABLE->yyMinutes = ((yyvsp[(1) - (1)].Number)/100)%100;
1994 +               VARIABLE->yySeconds = (yyvsp[(1) - (1)].Number) % 100;
1995 +               VARIABLE->yyMeridian = MER24;
1996 +            }
1997 +        }
1998 +    break;
1999 +
2000 +  case 49:
2001 +/* Line 1792 of yacc.c  */
2002 +#line 402 "../common/getdate.y"
2003 +    {
2004 +           (yyval.Meridian) = MER24;
2005 +       }
2006 +    break;
2007 +
2008 +  case 50:
2009 +/* Line 1792 of yacc.c  */
2010 +#line 405 "../common/getdate.y"
2011 +    {
2012 +           (yyval.Meridian) = (yyvsp[(1) - (1)].Meridian);
2013 +       }
2014 +    break;
2015 +
2016 +
2017 +/* Line 1792 of yacc.c  */
2018 +#line 2016 "../common/getdate.tab.c"
2019 +      default: break;
2020 +    }
2021 +  /* User semantic actions sometimes alter yychar, and that requires
2022 +     that yytoken be updated with the new translation.  We take the
2023 +     approach of translating immediately before every use of yytoken.
2024 +     One alternative is translating here after every semantic action,
2025 +     but that translation would be missed if the semantic action invokes
2026 +     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2027 +     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
2028 +     incorrect destructor might then be invoked immediately.  In the
2029 +     case of YYERROR or YYBACKUP, subsequent parser actions might lead
2030 +     to an incorrect destructor call or verbose syntax error message
2031 +     before the lookahead is translated.  */
2032 +  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2033 +
2034 +  YYPOPSTACK (yylen);
2035 +  yylen = 0;
2036 +  YY_STACK_PRINT (yyss, yyssp);
2037 +
2038 +  *++yyvsp = yyval;
2039 +
2040 +  /* Now `shift' the result of the reduction.  Determine what state
2041 +     that goes to, based on the state we popped back to and the rule
2042 +     number reduced by.  */
2043 +
2044 +  yyn = yyr1[yyn];
2045 +
2046 +  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2047 +  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2048 +    yystate = yytable[yystate];
2049 +  else
2050 +    yystate = yydefgoto[yyn - YYNTOKENS];
2051 +
2052 +  goto yynewstate;
2053 +
2054 +
2055 +/*------------------------------------.
2056 +| yyerrlab -- here on detecting error |
2057 +`------------------------------------*/
2058 +yyerrlab:
2059 +  /* Make sure we have latest lookahead translation.  See comments at
2060 +     user semantic actions for why this is necessary.  */
2061 +  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2062 +
2063 +  /* If not already recovering from an error, report this error.  */
2064 +  if (!yyerrstatus)
2065 +    {
2066 +      ++yynerrs;
2067 +#if ! YYERROR_VERBOSE
2068 +      yyerror (YY_("syntax error"));
2069 +#else
2070 +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2071 +                                        yyssp, yytoken)
2072 +      {
2073 +        char const *yymsgp = YY_("syntax error");
2074 +        int yysyntax_error_status;
2075 +        yysyntax_error_status = YYSYNTAX_ERROR;
2076 +        if (yysyntax_error_status == 0)
2077 +          yymsgp = yymsg;
2078 +        else if (yysyntax_error_status == 1)
2079 +          {
2080 +            if (yymsg != yymsgbuf)
2081 +              YYSTACK_FREE (yymsg);
2082 +            yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2083 +            if (!yymsg)
2084 +              {
2085 +                yymsg = yymsgbuf;
2086 +                yymsg_alloc = sizeof yymsgbuf;
2087 +                yysyntax_error_status = 2;
2088 +              }
2089 +            else
2090 +              {
2091 +                yysyntax_error_status = YYSYNTAX_ERROR;
2092 +                yymsgp = yymsg;
2093 +              }
2094 +          }
2095 +        yyerror (yymsgp);
2096 +        if (yysyntax_error_status == 2)
2097 +          goto yyexhaustedlab;
2098 +      }
2099 +# undef YYSYNTAX_ERROR
2100 +#endif
2101 +    }
2102 +
2103 +
2104 +
2105 +  if (yyerrstatus == 3)
2106 +    {
2107 +      /* If just tried and failed to reuse lookahead token after an
2108 +        error, discard it.  */
2109 +
2110 +      if (yychar <= YYEOF)
2111 +       {
2112 +         /* Return failure if at end of input.  */
2113 +         if (yychar == YYEOF)
2114 +           YYABORT;
2115 +       }
2116 +      else
2117 +       {
2118 +         yydestruct ("Error: discarding",
2119 +                     yytoken, &yylval);
2120 +         yychar = YYEMPTY;
2121 +       }
2122 +    }
2123 +
2124 +  /* Else will try to reuse lookahead token after shifting the error
2125 +     token.  */
2126 +  goto yyerrlab1;
2127 +
2128 +
2129 +/*---------------------------------------------------.
2130 +| yyerrorlab -- error raised explicitly by YYERROR.  |
2131 +`---------------------------------------------------*/
2132 +yyerrorlab:
2133 +
2134 +  /* Pacify compilers like GCC when the user code never invokes
2135 +     YYERROR and the label yyerrorlab therefore never appears in user
2136 +     code.  */
2137 +  if (/*CONSTCOND*/ 0)
2138 +     goto yyerrorlab;
2139 +
2140 +  /* Do not reclaim the symbols of the rule which action triggered
2141 +     this YYERROR.  */
2142 +  YYPOPSTACK (yylen);
2143 +  yylen = 0;
2144 +  YY_STACK_PRINT (yyss, yyssp);
2145 +  yystate = *yyssp;
2146 +  goto yyerrlab1;
2147 +
2148 +
2149 +/*-------------------------------------------------------------.
2150 +| yyerrlab1 -- common code for both syntax error and YYERROR.  |
2151 +`-------------------------------------------------------------*/
2152 +yyerrlab1:
2153 +  yyerrstatus = 3;     /* Each real token shifted decrements this.  */
2154 +
2155 +  for (;;)
2156 +    {
2157 +      yyn = yypact[yystate];
2158 +      if (!yypact_value_is_default (yyn))
2159 +       {
2160 +         yyn += YYTERROR;
2161 +         if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2162 +           {
2163 +             yyn = yytable[yyn];
2164 +             if (0 < yyn)
2165 +               break;
2166 +           }
2167 +       }
2168 +
2169 +      /* Pop the current state because it cannot handle the error token.  */
2170 +      if (yyssp == yyss)
2171 +       YYABORT;
2172 +
2173 +
2174 +      yydestruct ("Error: popping",
2175 +                 yystos[yystate], yyvsp);
2176 +      YYPOPSTACK (1);
2177 +      yystate = *yyssp;
2178 +      YY_STACK_PRINT (yyss, yyssp);
2179 +    }
2180 +
2181 +  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2182 +  *++yyvsp = yylval;
2183 +  YY_IGNORE_MAYBE_UNINITIALIZED_END
2184 +
2185 +
2186 +  /* Shift the error token.  */
2187 +  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2188 +
2189 +  yystate = yyn;
2190 +  goto yynewstate;
2191 +
2192 +
2193 +/*-------------------------------------.
2194 +| yyacceptlab -- YYACCEPT comes here.  |
2195 +`-------------------------------------*/
2196 +yyacceptlab:
2197 +  yyresult = 0;
2198 +  goto yyreturn;
2199 +
2200 +/*-----------------------------------.
2201 +| yyabortlab -- YYABORT comes here.  |
2202 +`-----------------------------------*/
2203 +yyabortlab:
2204 +  yyresult = 1;
2205 +  goto yyreturn;
2206 +
2207 +#if !defined yyoverflow || YYERROR_VERBOSE
2208 +/*-------------------------------------------------.
2209 +| yyexhaustedlab -- memory exhaustion comes here.  |
2210 +`-------------------------------------------------*/
2211 +yyexhaustedlab:
2212 +  yyerror (YY_("memory exhausted"));
2213 +  yyresult = 2;
2214 +  /* Fall through.  */
2215 +#endif
2216 +
2217 +yyreturn:
2218 +  if (yychar != YYEMPTY)
2219 +    {
2220 +      /* Make sure we have latest lookahead translation.  See comments at
2221 +         user semantic actions for why this is necessary.  */
2222 +      yytoken = YYTRANSLATE (yychar);
2223 +      yydestruct ("Cleanup: discarding lookahead",
2224 +                  yytoken, &yylval);
2225 +    }
2226 +  /* Do not reclaim the symbols of the rule which action triggered
2227 +     this YYABORT or YYACCEPT.  */
2228 +  YYPOPSTACK (yylen);
2229 +  YY_STACK_PRINT (yyss, yyssp);
2230 +  while (yyssp != yyss)
2231 +    {
2232 +      yydestruct ("Cleanup: popping",
2233 +                 yystos[*yyssp], yyvsp);
2234 +      YYPOPSTACK (1);
2235 +    }
2236 +#ifndef yyoverflow
2237 +  if (yyss != yyssa)
2238 +    YYSTACK_FREE (yyss);
2239 +#endif
2240 +#if YYERROR_VERBOSE
2241 +  if (yymsg != yymsgbuf)
2242 +    YYSTACK_FREE (yymsg);
2243 +#endif
2244 +  /* Make sure YYID is used.  */
2245 +  return YYID (yyresult);
2246 +}
2247 +
2248 +
2249 +/* Line 2055 of yacc.c  */
2250 +#line 410 "../common/getdate.y"
2251 +
2252 +
2253 +/* Month and day table. */
2254 +static TABLE const MonthDayTable[] = {
2255 +    { "january",       tMONTH,  1 },
2256 +    { "february",      tMONTH,  2 },
2257 +    { "march",         tMONTH,  3 },
2258 +    { "april",         tMONTH,  4 },
2259 +    { "may",           tMONTH,  5 },
2260 +    { "june",          tMONTH,  6 },
2261 +    { "july",          tMONTH,  7 },
2262 +    { "august",                tMONTH,  8 },
2263 +    { "september",     tMONTH,  9 },
2264 +    { "sept",          tMONTH,  9 },
2265 +    { "october",       tMONTH, 10 },
2266 +    { "november",      tMONTH, 11 },
2267 +    { "december",      tMONTH, 12 },
2268 +    { "sunday",                tDAY, 0 },
2269 +    { "monday",                tDAY, 1 },
2270 +    { "tuesday",       tDAY, 2 },
2271 +    { "tues",          tDAY, 2 },
2272 +    { "wednesday",     tDAY, 3 },
2273 +    { "wednes",                tDAY, 3 },
2274 +    { "thursday",      tDAY, 4 },
2275 +    { "thur",          tDAY, 4 },
2276 +    { "thurs",         tDAY, 4 },
2277 +    { "friday",                tDAY, 5 },
2278 +    { "saturday",      tDAY, 6 },
2279 +    { NULL }
2280 +};
2281 +
2282 +/* Time units table. */
2283 +static TABLE const UnitsTable[] = {
2284 +    { "year",          tMONTH_UNIT,    12 },
2285 +    { "month",         tMONTH_UNIT,    1 },
2286 +    { "fortnight",     tMINUTE_UNIT,   14 * 24 * 60 },
2287 +    { "week",          tMINUTE_UNIT,   7 * 24 * 60 },
2288 +    { "day",           tMINUTE_UNIT,   1 * 24 * 60 },
2289 +    { "hour",          tMINUTE_UNIT,   60 },
2290 +    { "minute",                tMINUTE_UNIT,   1 },
2291 +    { "min",           tMINUTE_UNIT,   1 },
2292 +    { "second",                tSEC_UNIT,      1 },
2293 +    { "sec",           tSEC_UNIT,      1 },
2294 +    { NULL }
2295 +};
2296 +
2297 +/* Assorted relative-time words. */
2298 +static TABLE const OtherTable[] = {
2299 +    { "tomorrow",      tMINUTE_UNIT,   1 * 24 * 60 },
2300 +    { "yesterday",     tMINUTE_UNIT,   -1 * 24 * 60 },
2301 +    { "today",         tMINUTE_UNIT,   0 },
2302 +    { "now",           tMINUTE_UNIT,   0 },
2303 +    { "last",          tUNUMBER,       -1 },
2304 +    { "this",          tMINUTE_UNIT,   0 },
2305 +    { "next",          tUNUMBER,       2 },
2306 +    { "first",         tUNUMBER,       1 },
2307 +/*  { "second",                tUNUMBER,       2 }, */
2308 +    { "third",         tUNUMBER,       3 },
2309 +    { "fourth",                tUNUMBER,       4 },
2310 +    { "fifth",         tUNUMBER,       5 },
2311 +    { "sixth",         tUNUMBER,       6 },
2312 +    { "seventh",       tUNUMBER,       7 },
2313 +    { "eighth",                tUNUMBER,       8 },
2314 +    { "ninth",         tUNUMBER,       9 },
2315 +    { "tenth",         tUNUMBER,       10 },
2316 +    { "eleventh",      tUNUMBER,       11 },
2317 +    { "twelfth",       tUNUMBER,       12 },
2318 +    { "ago",           tAGO,   1 },
2319 +    { NULL }
2320 +};
2321 +
2322 +/* The timezone table. */
2323 +/* Some of these are commented out because a time_t can't store a float. */
2324 +static TABLE const TimezoneTable[] = {
2325 +    { "gmt",   tZONE,     HOUR( 0) },  /* Greenwich Mean */
2326 +    { "ut",    tZONE,     HOUR( 0) },  /* Universal (Coordinated) */
2327 +    { "utc",   tZONE,     HOUR( 0) },
2328 +    { "wet",   tZONE,     HOUR( 0) },  /* Western European */
2329 +    { "bst",   tDAYZONE,  HOUR( 0) },  /* British Summer */
2330 +    { "wat",   tZONE,     HOUR( 1) },  /* West Africa */
2331 +    { "at",    tZONE,     HOUR( 2) },  /* Azores */
2332 +#if    0
2333 +    /* For completeness.  BST is also British Summer, and GST is
2334 +     * also Guam Standard. */
2335 +    { "bst",   tZONE,     HOUR( 3) },  /* Brazil Standard */
2336 +    { "gst",   tZONE,     HOUR( 3) },  /* Greenland Standard */
2337 +#endif
2338 +#if 0
2339 +    { "nft",   tZONE,     HOUR(3.5) }, /* Newfoundland */
2340 +    { "nst",   tZONE,     HOUR(3.5) }, /* Newfoundland Standard */
2341 +    { "ndt",   tDAYZONE,  HOUR(3.5) }, /* Newfoundland Daylight */
2342 +#endif
2343 +    { "ast",   tZONE,     HOUR( 4) },  /* Atlantic Standard */
2344 +    { "adt",   tDAYZONE,  HOUR( 4) },  /* Atlantic Daylight */
2345 +    { "est",   tZONE,     HOUR( 5) },  /* Eastern Standard */
2346 +    { "edt",   tDAYZONE,  HOUR( 5) },  /* Eastern Daylight */
2347 +    { "cst",   tZONE,     HOUR( 6) },  /* Central Standard */
2348 +    { "cdt",   tDAYZONE,  HOUR( 6) },  /* Central Daylight */
2349 +    { "mst",   tZONE,     HOUR( 7) },  /* Mountain Standard */
2350 +    { "mdt",   tDAYZONE,  HOUR( 7) },  /* Mountain Daylight */
2351 +    { "pst",   tZONE,     HOUR( 8) },  /* Pacific Standard */
2352 +    { "pdt",   tDAYZONE,  HOUR( 8) },  /* Pacific Daylight */
2353 +    { "yst",   tZONE,     HOUR( 9) },  /* Yukon Standard */
2354 +    { "ydt",   tDAYZONE,  HOUR( 9) },  /* Yukon Daylight */
2355 +    { "hst",   tZONE,     HOUR(10) },  /* Hawaii Standard */
2356 +    { "hdt",   tDAYZONE,  HOUR(10) },  /* Hawaii Daylight */
2357 +    { "cat",   tZONE,     HOUR(10) },  /* Central Alaska */
2358 +    { "ahst",  tZONE,     HOUR(10) },  /* Alaska-Hawaii Standard */
2359 +    { "nt",    tZONE,     HOUR(11) },  /* Nome */
2360 +    { "idlw",  tZONE,     HOUR(12) },  /* International Date Line West */
2361 +    { "cet",   tZONE,     -HOUR(1) },  /* Central European */
2362 +    { "met",   tZONE,     -HOUR(1) },  /* Middle European */
2363 +    { "mewt",  tZONE,     -HOUR(1) },  /* Middle European Winter */
2364 +    { "mest",  tDAYZONE,  -HOUR(1) },  /* Middle European Summer */
2365 +    { "swt",   tZONE,     -HOUR(1) },  /* Swedish Winter */
2366 +    { "sst",   tDAYZONE,  -HOUR(1) },  /* Swedish Summer */
2367 +    { "fwt",   tZONE,     -HOUR(1) },  /* French Winter */
2368 +    { "fst",   tDAYZONE,  -HOUR(1) },  /* French Summer */
2369 +    { "eet",   tZONE,     -HOUR(2) },  /* Eastern Europe, USSR Zone 1 */
2370 +    { "bt",    tZONE,     -HOUR(3) },  /* Baghdad, USSR Zone 2 */
2371 +#if 0
2372 +    { "it",    tZONE,     -HOUR(3.5) },/* Iran */
2373 +#endif
2374 +    { "zp4",   tZONE,     -HOUR(4) },  /* USSR Zone 3 */
2375 +    { "zp5",   tZONE,     -HOUR(5) },  /* USSR Zone 4 */
2376 +#if 0
2377 +    { "ist",   tZONE,     -HOUR(5.5) },/* Indian Standard */
2378 +#endif
2379 +    { "zp6",   tZONE,     -HOUR(6) },  /* USSR Zone 5 */
2380 +#if    0
2381 +    /* For completeness.  NST is also Newfoundland Stanard, and SST is
2382 +     * also Swedish Summer. */
2383 +    { "nst",   tZONE,     -HOUR(6.5) },/* North Sumatra */
2384 +    { "sst",   tZONE,     -HOUR(7) },  /* South Sumatra, USSR Zone 6 */
2385 +#endif /* 0 */
2386 +    { "wast",  tZONE,     -HOUR(7) },  /* West Australian Standard */
2387 +    { "wadt",  tDAYZONE,  -HOUR(7) },  /* West Australian Daylight */
2388 +#if 0
2389 +    { "jt",    tZONE,     -HOUR(7.5) },/* Java (3pm in Cronusland!) */
2390 +#endif
2391 +    { "cct",   tZONE,     -HOUR(8) },  /* China Coast, USSR Zone 7 */
2392 +    { "jst",   tZONE,     -HOUR(9) },  /* Japan Standard, USSR Zone 8 */
2393 +#if 0
2394 +    { "cast",  tZONE,     -HOUR(9.5) },/* Central Australian Standard */
2395 +    { "cadt",  tDAYZONE,  -HOUR(9.5) },/* Central Australian Daylight */
2396 +#endif
2397 +    { "east",  tZONE,     -HOUR(10) }, /* Eastern Australian Standard */
2398 +    { "eadt",  tDAYZONE,  -HOUR(10) }, /* Eastern Australian Daylight */
2399 +    { "gst",   tZONE,     -HOUR(10) }, /* Guam Standard, USSR Zone 9 */
2400 +    { "nzt",   tZONE,     -HOUR(12) }, /* New Zealand */
2401 +    { "nzst",  tZONE,     -HOUR(12) }, /* New Zealand Standard */
2402 +    { "nzdt",  tDAYZONE,  -HOUR(12) }, /* New Zealand Daylight */
2403 +    { "idle",  tZONE,     -HOUR(12) }, /* International Date Line East */
2404 +    {  NULL  }
2405 +};
2406 +
2407 +/* Military timezone table. */
2408 +static TABLE const MilitaryTable[] = {
2409 +    { "a",     tMILZONE,       HOUR(  1) },
2410 +    { "b",     tMILZONE,       HOUR(  2) },
2411 +    { "c",     tMILZONE,       HOUR(  3) },
2412 +    { "d",     tMILZONE,       HOUR(  4) },
2413 +    { "e",     tMILZONE,       HOUR(  5) },
2414 +    { "f",     tMILZONE,       HOUR(  6) },
2415 +    { "g",     tMILZONE,       HOUR(  7) },
2416 +    { "h",     tMILZONE,       HOUR(  8) },
2417 +    { "i",     tMILZONE,       HOUR(  9) },
2418 +    { "k",     tMILZONE,       HOUR( 10) },
2419 +    { "l",     tMILZONE,       HOUR( 11) },
2420 +    { "m",     tMILZONE,       HOUR( 12) },
2421 +    { "n",     tMILZONE,       HOUR(- 1) },
2422 +    { "o",     tMILZONE,       HOUR(- 2) },
2423 +    { "p",     tMILZONE,       HOUR(- 3) },
2424 +    { "q",     tMILZONE,       HOUR(- 4) },
2425 +    { "r",     tMILZONE,       HOUR(- 5) },
2426 +    { "s",     tMILZONE,       HOUR(- 6) },
2427 +    { "t",     tMILZONE,       HOUR(- 7) },
2428 +    { "u",     tMILZONE,       HOUR(- 8) },
2429 +    { "v",     tMILZONE,       HOUR(- 9) },
2430 +    { "w",     tMILZONE,       HOUR(-10) },
2431 +    { "x",     tMILZONE,       HOUR(-11) },
2432 +    { "y",     tMILZONE,       HOUR(-12) },
2433 +    { "z",     tZONE,          HOUR(  0) }, /* Deliberately tZONE */
2434 +    { NULL }
2435 +};
2436 +
2437 +static int LookupWord(char * buff, YYSTYPE * yylval)
2438 +{
2439 +    register char      *p;
2440 +    register char      *q;
2441 +    register const TABLE       *tp;
2442 +    int                        i;
2443 +    int                        abbrev;
2444 +
2445 +    /* Make it lowercase. */
2446 +    for (p = buff; *p != '\0'; p++)
2447 +        *p = (char)tolower(*p);
2448 +
2449 +    if (strcmp(buff, "am") == 0 || strcmp(buff, "a.m.") == 0) {
2450 +       yylval->Meridian = MERam;
2451 +       return tMERIDIAN;
2452 +    }
2453 +    if (strcmp(buff, "pm") == 0 || strcmp(buff, "p.m.") == 0) {
2454 +       yylval->Meridian = MERpm;
2455 +       return tMERIDIAN;
2456 +    }
2457 +
2458 +    /* See if we have an abbreviation for a month. */
2459 +    if (strlen(buff) == 3)
2460 +       abbrev = 1;
2461 +    else if (strlen(buff) == 4 && buff[3] == '.') {
2462 +       abbrev = 1;
2463 +       buff[3] = '\0';
2464 +    }
2465 +    else
2466 +       abbrev = 0;
2467 +
2468 +    for (tp = MonthDayTable; tp->name; tp++) {
2469 +       if (abbrev) {
2470 +           if (strncmp(buff, tp->name, 3) == 0) {
2471 +               yylval->Number = tp->value;
2472 +               return tp->type;
2473 +           }
2474 +       }
2475 +       else if (strcmp(buff, tp->name) == 0) {
2476 +           yylval->Number = tp->value;
2477 +           return tp->type;
2478 +       }
2479 +    }
2480 +
2481 +    for (tp = TimezoneTable; tp->name; tp++)
2482 +       if (strcmp(buff, tp->name) == 0) {
2483 +           yylval->Number = tp->value;
2484 +           return tp->type;
2485 +       }
2486 +
2487 +    if (strcmp(buff, "dst") == 0) 
2488 +       return tDST;
2489 +
2490 +    for (tp = UnitsTable; tp->name; tp++)
2491 +       if (strcmp(buff, tp->name) == 0) {
2492 +           yylval->Number = tp->value;
2493 +           return tp->type;
2494 +       }
2495 +
2496 +    /* Strip off any plural and try the units table again. */
2497 +    i = strlen(buff) - 1;
2498 +    if (buff[i] == 's') {
2499 +       buff[i] = '\0';
2500 +       for (tp = UnitsTable; tp->name; tp++)
2501 +           if (strcmp(buff, tp->name) == 0) {
2502 +               yylval->Number = tp->value;
2503 +               return tp->type;
2504 +           }
2505 +       buff[i] = 's';          /* Put back for "this" in OtherTable. */
2506 +    }
2507 +
2508 +    for (tp = OtherTable; tp->name; tp++)
2509 +       if (strcmp(buff, tp->name) == 0) {
2510 +           yylval->Number = tp->value;
2511 +           return tp->type;
2512 +       }
2513 +
2514 +    /* Military timezones. */
2515 +    if (buff[1] == '\0' && isalpha(*buff)) {
2516 +       for (tp = MilitaryTable; tp->name; tp++)
2517 +           if (strcmp(buff, tp->name) == 0) {
2518 +               yylval->Number = tp->value;
2519 +               return tp->type;
2520 +           }
2521 +    }
2522 +
2523 +    /* Drop out any periods and try the timezone table again. */
2524 +    for (i = 0, p = q = buff; *q; q++)
2525 +       if (*q != '.')
2526 +           *p++ = *q;
2527 +       else
2528 +           i++;
2529 +    *p = '\0';
2530 +    if (i)
2531 +       for (tp = TimezoneTable; tp->name; tp++)
2532 +           if (strcmp(buff, tp->name) == 0) {
2533 +               yylval->Number = tp->value;
2534 +               return tp->type;
2535 +           }
2536 +
2537 +    for (i = 1; i <= 12; i++)
2538 +       for (abbrev = 0; abbrev < 2; abbrev++)
2539 +           if (PTimeIsMonthName(buff, i, abbrev)) {
2540 +               yylval->Number = i;
2541 +               return tMONTH;
2542 +           }
2543 +
2544 +    for (i = 1; i <= 7; i++)
2545 +       for (abbrev = 0; abbrev < 2; abbrev++)
2546 +           if (PTimeIsDayName(buff, i, abbrev)) {
2547 +               yylval->Number = i;
2548 +               return tDAY;
2549 +           }
2550 +
2551 +    return tID;
2552 +}
2553 +
2554 +
2555 +#ifdef _MSC_VER
2556 +#pragma warning(disable:4211)
2557 +#endif
2558 +
2559 +#ifndef __GNUC__
2560 +static
2561 +#endif
2562 +int yylex(YYSTYPE * yylval, void * yyInput)
2563 +{
2564 +    register char      *p;
2565 +    char               buff[20];
2566 +    int                        Count;
2567 +    int                        sign;
2568 +    register int       c = PTimeGetChar(yyInput);
2569 +
2570 +    while (c != EOF && c != '\0' && c != '\n') {
2571 +       while (isspace(c))
2572 +           c = PTimeGetChar(yyInput);
2573 +
2574 +       if (isdigit(c) || c == '-' || c == '+') {
2575 +           if (c == '-' || c == '+') {
2576 +               sign = c == '-' ? -1 : 1;
2577 +               if (!isdigit(c = PTimeGetChar(yyInput)))
2578 +                   /* skip the '-' sign */
2579 +                   continue;
2580 +           }
2581 +           else
2582 +               sign = 0;
2583 +           yylval->Number = 0;
2584 +            Count = 0; /* Count number of digits */
2585 +           while (isdigit(c)) {
2586 +               yylval->Number = 10 * yylval->Number + c - '0';
2587 +               c = PTimeGetChar(yyInput);
2588 +                Count++;
2589 +           }
2590 +           PTimeUngetChar(yyInput, c);
2591 +           if (sign < 0)
2592 +               yylval->Number = -yylval->Number;
2593 +           if (sign)
2594 +              return tSNUMBER;
2595 +            if (Count == 4)
2596 +              return t4DIGITNUMBER;
2597 +            if (Count == 6)
2598 +              return t6DIGITNUMBER;
2599 +            return tUNUMBER;
2600 +       }
2601 +
2602 +       if (isalpha(c)) {
2603 +           for (p = buff; isalpha(c) || c == '.'; c = PTimeGetChar(yyInput)) {
2604 +               if (p < &buff[sizeof(buff)-1])
2605 +                   *p++ = (char)c;
2606 +           }
2607 +           *p = '\0';
2608 +           PTimeUngetChar(yyInput, c);
2609 +           return LookupWord(buff, yylval);
2610 +       }
2611 +
2612 +       if (c != '(')
2613 +           return c;
2614 +
2615 +       Count = 0;
2616 +       do {
2617 +           c = PTimeGetChar(yyInput);
2618 +           if (c == '\0' || c == EOF)
2619 +               return c;
2620 +           if (c == '(')
2621 +               Count++;
2622 +           else if (c == ')')
2623 +               Count--;
2624 +       } while (Count > 0);
2625 +    }
2626 +
2627 +    return EOF;
2628 +}
2629 +
2630 +#ifdef _MSC_VER
2631 +#pragma warning(default:4211)
2632 +#endif
2633 +
2634 +
2635 +static time_t ToSeconds(time_t Hours, time_t Minutes, time_t Seconds,
2636 +                       MERIDIAN Meridian)
2637 +{
2638 +    if (Minutes < 0 || Minutes > 59 || Seconds < 0 || Seconds > 59)
2639 +       return -1;
2640 +    switch (Meridian) {
2641 +    case MER24:
2642 +       if (Hours < 0 || Hours > 23)
2643 +           return -1;
2644 +       return (Hours * 60L + Minutes) * 60L + Seconds;
2645 +    case MERam:
2646 +       if (Hours < 1 || Hours > 12)
2647 +           return -1;
2648 +       if (Hours == 12)
2649 +           Hours = 0;
2650 +       return (Hours * 60L + Minutes) * 60L + Seconds;
2651 +    case MERpm:
2652 +       if (Hours < 1 || Hours > 12)
2653 +           return -1;
2654 +       if (Hours == 12)
2655 +           Hours = 0;
2656 +       return ((Hours + 12) * 60L + Minutes) * 60L + Seconds;
2657 +    }
2658 +
2659 +    return -1;
2660 +}
2661 +
2662 +
2663 +static time_t Convert(time_t Month, time_t Day, time_t Year,
2664 +                     time_t Hours, time_t Minutes, time_t Seconds,
2665 +                     MERIDIAN Meridian, DSTMODE DSTmode, time_t yyTimezone)
2666 +{
2667 +    static int DaysInMonth[12] = {
2668 +       31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
2669 +    };
2670 +    time_t     tod;
2671 +    time_t     Julian;
2672 +    int                i;
2673 +
2674 +    if (Year < 0)
2675 +       Year = -Year;
2676 +    if (Year < 70)
2677 +       Year += 2000;
2678 +    else if (Year < 100)
2679 +       Year += 1900;
2680 +    DaysInMonth[1] = Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0)
2681 +                   ? 29 : 28;
2682 +    /* Checking for 2038 bogusly assumes that time_t is 32 bits.  But
2683 +       I'm too lazy to try to check for time_t overflow in another way.  */
2684 +    if (Year < EPOCH || Year > 2038
2685 +     || Month < 1 || Month > 12
2686 +     /* Lint fluff:  "conversion from long may lose accuracy" */
2687 +     || Day < 1 || Day > DaysInMonth[(int)--Month])
2688 +       return -1;
2689 +
2690 +    for (Julian = Day - 1, i = 0; i < Month; i++)
2691 +       Julian += DaysInMonth[i];
2692 +    for (i = EPOCH; i < Year; i++)
2693 +       Julian += 365 + (i % 4 == 0);
2694 +    Julian *= SECSPERDAY;
2695 +    Julian += yyTimezone * 60L;
2696 +    if ((tod = ToSeconds(Hours, Minutes, Seconds, Meridian)) < 0)
2697 +       return -1;
2698 +    Julian += tod;
2699 +    if (DSTmode == DSTon
2700 +     || (DSTmode == DSTmaybe && localtime(&Julian)->tm_isdst))
2701 +       Julian -= 60 * 60;
2702 +    return Julian;
2703 +}
2704 +
2705 +
2706 +static time_t DSTcorrect(time_t Start, time_t Future)
2707 +{
2708 +    time_t     StartDay;
2709 +    time_t     FutureDay;
2710 +
2711 +    StartDay = (localtime(&Start)->tm_hour + 1) % 24;
2712 +    FutureDay = (localtime(&Future)->tm_hour + 1) % 24;
2713 +    return (Future - Start) + (StartDay - FutureDay) * 60L * 60L;
2714 +}
2715 +
2716 +
2717 +static time_t RelativeDate(time_t Start, time_t DayOrdinal, time_t DayNumber)
2718 +{
2719 +    struct tm  *tm;
2720 +    time_t     now;
2721 +
2722 +    now = Start;
2723 +    tm = localtime(&now);
2724 +    now += SECSPERDAY * ((DayNumber - tm->tm_wday + 7) % 7);
2725 +    now += 7 * SECSPERDAY * (DayOrdinal <= 0 ? DayOrdinal : DayOrdinal - 1);
2726 +    return DSTcorrect(Start, now);
2727 +}
2728 +
2729 +
2730 +static time_t RelativeMonth(time_t Start, time_t RelMonth, time_t yyTimezone)
2731 +{
2732 +    struct tm  *tm;
2733 +    time_t     Month;
2734 +    time_t     Year;
2735 +
2736 +    if (RelMonth == 0)
2737 +       return 0;
2738 +    tm = localtime(&Start);
2739 +    Month = 12 * tm->tm_year + tm->tm_mon + RelMonth;
2740 +    Year = Month / 12 + 1900;
2741 +    Month = Month % 12 + 1;
2742 +    return DSTcorrect(Start,
2743 +           Convert(Month, (time_t)tm->tm_mday, Year,
2744 +               (time_t)tm->tm_hour, (time_t)tm->tm_min, (time_t)tm->tm_sec,
2745 +               MER24, DSTmaybe, yyTimezone));
2746 +}
2747 +
2748 +
2749 +static void SetPossibleDate(struct Variables * var,
2750 +                             time_t possible_day,
2751 +                             time_t possible_month,
2752 +                             time_t possible_year)
2753 +{
2754 +    int date_order;
2755 +
2756 +    if (possible_day > 31) /* test for ymd */
2757 +       date_order = 2;
2758 +    else if (possible_day > 12) /* test for dmy */
2759 +       date_order = 1;
2760 +    else if (possible_month > 12) /* test for mdy */
2761 +       date_order = 0;
2762 +    else {
2763 +       static int default_date_order = -1;
2764 +       if (default_date_order < 0)
2765 +           default_date_order = PTimeGetDateOrder();
2766 +       date_order = default_date_order;
2767 +    }
2768 +
2769 +    switch (date_order) {
2770 +      case 0 :
2771 +       var->yyDay   = possible_month;
2772 +       var->yyMonth = possible_day;
2773 +       var->yyYear  = possible_year;
2774 +       break;
2775 +      case 1 :
2776 +       var->yyDay   = possible_day;
2777 +       var->yyMonth = possible_month;
2778 +       var->yyYear  = possible_year;
2779 +       break;
2780 +      default :
2781 +       var->yyDay   = possible_year;
2782 +       var->yyMonth = possible_month;
2783 +       var->yyYear  = possible_day;
2784 +    }
2785 +}
2786 +
2787 +
2788 +time_t STDAPICALLTYPE PTimeParse(void * inputStream, struct tm * now, int timezone)
2789 +{
2790 +    time_t             Start;
2791 +    struct Variables   var;
2792 +
2793 +
2794 +    var.yyInput = inputStream;
2795 +    var.yyYear = now->tm_year + 1900;
2796 +    var.yyMonth = now->tm_mon + 1;
2797 +    var.yyDay = now->tm_mday;
2798 +    var.yyTimezone = -timezone;
2799 +    var.yyDSTmode = DSTmaybe;
2800 +    var.yyHour = 0;
2801 +    var.yyMinutes = 0;
2802 +    var.yySeconds = 0;
2803 +    var.yyMeridian = MER24;
2804 +    var.yyRelSeconds = 0;
2805 +    var.yyRelMonth = 0;
2806 +    var.yyHaveDate = 0;
2807 +    var.yyHaveDay = 0;
2808 +    var.yyHaveRel = 0;
2809 +    var.yyHaveTime = 0;
2810 +    var.yyHaveZone = 0;
2811 +
2812 +    yyparse(&var);
2813 +
2814 +    if (var.yyHaveTime > 1 || var.yyHaveZone > 1 ||
2815 +       var.yyHaveDate > 1 || var.yyHaveDay > 1)
2816 +       return -1;
2817 +
2818 +    if (var.yyHaveTime == 0 && var.yyHaveZone == 0 &&
2819 +       var.yyHaveDate == 0 && var.yyHaveDay == 0 && var.yyHaveRel == 0)
2820 +       return -1;
2821 +
2822 +    if (var.yyHaveDate || var.yyHaveTime || var.yyHaveDay) {
2823 +       Start = Convert(var.yyMonth, var.yyDay, var.yyYear,
2824 +                       var.yyHour, var.yyMinutes, var.yySeconds,
2825 +                       var.yyMeridian, var.yyDSTmode, var.yyTimezone);
2826 +       if (Start < 0)
2827 +           return -1;
2828 +    }
2829 +    else {
2830 +       time(&Start);
2831 +       if (!var.yyHaveRel)
2832 +           Start -= ((now->tm_hour * 60L + now->tm_min) * 60L) + now->tm_sec;
2833 +    }
2834 +
2835 +    Start += var.yyRelSeconds;
2836 +    Start += RelativeMonth(Start, var.yyRelMonth, var.yyTimezone);
2837 +
2838 +    if (var.yyHaveDay && !var.yyHaveDate)
2839 +       Start += RelativeDate(Start, var.yyDayOrdinal, var.yyDayNumber);
2840 +
2841 +    /* Have to do *something* with a legitimate -1 so it's distinguishable
2842 +     * from the error return value.  (Alternately could set errno on error.) */
2843 +    return Start == -1 ? 0 : Start;
2844 +}
2845 +
2846 +
2847 +#ifdef _MSC_VER
2848 +#pragma warning(disable:4100 4211)
2849 +#endif
2850 +
2851 +#ifdef __GNUC__
2852 +int yyerror(const char * s)
2853 +{
2854 +  return 0;
2855 +}
2856 +#else
2857 +static void yyerror(const char * s)
2858 +{
2859 +}
2860 +#endif
2861 +
2862 +#ifdef _MSC_VER
2863 +#pragma warning(default:4100 4211)
2864 +#endif
2865 +
2866 +
2867 +/* End of file ***************************************************************/