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