1 Submitted By: Armin K. <krejzi at email dot com>
2 Updated By: Bruce Dubbs <bduubs at linuxfromscratch dot org>
5 Initial Package Version: 2.10.10
6 Upstream Status: Reported
8 Description: Adds pregenerated C file which isn't generated correctly
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
19 -# if __GNUC__ >= 4 && __GNUC_MINOR__ >= 2
20 +# if (__GNUC__ >= 4 && __GNUC_MINOR__ >= 2) || __GNUC__ >= 5
21 # include <ext/atomicity.h>
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
29 LDLIBS += -l$(PTLIB_BASE)$(LIB_TYPE)
31 +STDCCFLAGS += -Wno-deprecated-declarations
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
38 +/* A Bison parser, made by GNU Bison 2.7.12-4996. */
40 +/* Bison implementation for Yacc-like parsers in C
42 + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
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.
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.
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/>. */
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.
67 + This special exception was added by the Free Software Foundation in
68 + version 2.2 of Bison. */
70 +/* C LALR(1) parser skeleton written by Richard Stallman, by
71 + simplifying the original so-called "semantic" parser. */
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. */
80 +/* Identify Bison output. */
84 +#define YYBISON_VERSION "2.7.12-4996"
87 +#define YYSKELETON_NAME "yacc.c"
101 +/* Copy the first part of user declarations. */
102 +/* Line 371 of yacc.c */
103 +#line 1 "ptlib/common/getdate.y"
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;
111 +** Major hack to coerce it into use with the Equivalence Portable
114 +** This grammar has 10 shift/reduce conflicts.
116 +** This code is in the public domain and has no copyright.
118 +/* SUPPRESS 287 on yaccpar_sccsid *//* Unused static variable */
119 +/* SUPPRESS 288 on yyerrlab *//* Label unused */
134 +#pragma warning(disable:4131 4701 4996)
136 +#define STDAPICALLTYPE __stdcall
139 +#define STDAPICALLTYPE
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);
151 +#define HOUR(x) ((time_t)(x) * 60)
152 +#define SECSPERDAY (24L * 60L * 60L)
156 +** An entry in the lexical lookup table.
158 +typedef struct _TABLE {
166 +** Daylight-savings mode: on, off, or not yet known.
168 +typedef enum _DSTMODE {
169 + DSTon, DSToff, DSTmaybe
173 +** Meridian: am, pm, or 24-hour style.
175 +typedef enum _MERIDIAN {
176 + MERam, MERpm, MER24
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.
189 + time_t yyDayOrdinal;
190 + time_t yyDayNumber;
203 + MERIDIAN yyMeridian;
205 + time_t yyRelSeconds;
208 +#define VARIABLE ((struct Variables*)parseParam)
212 +#define YYLEX_PARAM VARIABLE
213 +#define YYPARSE_PARAM parseParam
215 +#define yyparse PTime_yyparse
216 +#define yylex PTime_yylex
217 +#define yyerror PTime_yyerror
219 +#define GCC_VERSION (__GNUC__ * 10000 \
220 + + __GNUC_MINOR__ * 100 \
221 + + __GNUC_PATCHLEVEL__)
223 +static int yyparse(void *);
227 +static int yyerror(char const *msg);
229 +static void yyerror(char const *msg);
233 +static void SetPossibleDate(struct Variables*, time_t, time_t, time_t);
237 +/* Line 371 of yacc.c */
238 +#line 202 "ptlib/common/getdate.tab.c"
241 +# if defined __cplusplus && 201103L <= __cplusplus
242 +# define YY_NULL nullptr
248 +/* Enabling verbose error messages. */
249 +#ifdef YYERROR_VERBOSE
250 +# undef YYERROR_VERBOSE
251 +# define YYERROR_VERBOSE 1
253 +# define YYERROR_VERBOSE 0
257 +/* Enabling traces. */
267 +# define YYTOKENTYPE
268 + /* Put the tokens into the symbol table, so that GDB and other debuggers
269 + know about them. */
276 + tMINUTE_UNIT = 263,
280 + tS4DIGITNUMBER = 267,
282 + t4DIGITNUMBER = 269,
283 + t6DIGITNUMBER = 270,
284 + t8DIGITNUMBER = 271,
294 +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
295 +typedef union YYSTYPE
297 +/* Line 387 of yacc.c */
298 +#line 137 "ptlib/common/getdate.y"
301 + enum _MERIDIAN Meridian;
304 +/* Line 387 of yacc.c */
305 +#line 269 "ptlib/common/getdate.tab.c"
307 +# define YYSTYPE_IS_TRIVIAL 1
308 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */
309 +# define YYSTYPE_IS_DECLARED 1
313 +#ifdef YYPARSE_PARAM
314 +#if defined __STDC__ || defined __cplusplus
315 +int yyparse (void *YYPARSE_PARAM);
319 +#else /* ! YYPARSE_PARAM */
320 +#if defined __STDC__ || defined __cplusplus
325 +#endif /* ! YYPARSE_PARAM */
329 +/* Copy the second part of user declarations. */
331 +/* Line 390 of yacc.c */
332 +#line 296 "ptlib/common/getdate.tab.c"
339 +typedef YYTYPE_UINT8 yytype_uint8;
341 +typedef unsigned char yytype_uint8;
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;
350 +typedef short int yytype_int8;
353 +#ifdef YYTYPE_UINT16
354 +typedef YYTYPE_UINT16 yytype_uint16;
356 +typedef unsigned short int yytype_uint16;
360 +typedef YYTYPE_INT16 yytype_int16;
362 +typedef short int yytype_int16;
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
375 +# define YYSIZE_T unsigned int
379 +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
382 +# if defined YYENABLE_NLS && YYENABLE_NLS
384 +# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
385 +# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
389 +# define YY_(Msgid) Msgid
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 */
401 +/* Suppress unused-variable warnings by "using" E. */
402 +#if ! defined lint || defined __GNUC__
403 +# define YYUSE(E) ((void) (E))
405 +# define YYUSE(E) /* empty */
409 +/* Identity function, used to suppress warnings about constant conditions. */
411 +# define YYID(N) (N)
413 +#if (defined __STDC__ || defined __C99__FUNC__ \
414 + || defined __cplusplus || defined _MSC_VER)
427 +#if ! defined yyoverflow || YYERROR_VERBOSE
429 +/* The parser invokes alloca or malloc; define the necessary symbols. */
431 +# ifdef YYSTACK_USE_ALLOCA
432 +# if YYSTACK_USE_ALLOCA
434 +# define YYSTACK_ALLOC __builtin_alloca
435 +# elif defined __BUILTIN_VA_ARG_INCR
436 +# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
438 +# define YYSTACK_ALLOC __alloca
439 +# elif defined _MSC_VER
440 +# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
441 +# define alloca _alloca
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
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 */
467 +# define YYSTACK_ALLOC YYMALLOC
468 +# define YYSTACK_FREE YYFREE
469 +# ifndef YYSTACK_ALLOC_MAXIMUM
470 +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
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
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 */
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 */
495 +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
498 +#if (! defined yyoverflow \
499 + && (! defined __cplusplus \
500 + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
502 +/* A type that is properly aligned for any stack member. */
505 + yytype_int16 yyss_alloc;
506 + YYSTYPE yyvs_alloc;
509 +/* The size of the maximum gap between one aligned stack and the next. */
510 +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
512 +/* The size of an array large to enough to hold all stacks, each with
514 +# define YYSTACK_BYTES(N) \
515 + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
516 + + YYSTACK_GAP_MAXIMUM)
518 +# define YYCOPY_NEEDED 1
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
525 +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
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); \
538 +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
539 +/* Copy COUNT objects from SRC to DST. The source and destination do
542 +# if defined __GNUC__ && 1 < __GNUC__
543 +# define YYCOPY(Dst, Src, Count) \
544 + __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
546 +# define YYCOPY(Dst, Src, Count) \
550 + for (yyi = 0; yyi < (Count); yyi++) \
551 + (Dst)[yyi] = (Src)[yyi]; \
556 +#endif /* !YYCOPY_NEEDED */
558 +/* YYFINAL -- State number of the termination state. */
560 +/* YYLAST -- Last index in YYTABLE. */
563 +/* YYNTOKENS -- Number of terminals. */
564 +#define YYNTOKENS 25
565 +/* YYNNTS -- Number of nonterminals. */
567 +/* YYNRULES -- Number of rules. */
569 +/* YYNRULES -- Number of states. */
570 +#define YYNSTATES 63
572 +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
573 +#define YYUNDEFTOK 2
574 +#define YYMAXUTOK 276
576 +#define YYTRANSLATE(YYX) \
577 + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
579 +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
580 +static const yytype_uint8 yytranslate[] =
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
613 +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
615 +static const yytype_uint8 yyprhs[] =
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,
625 +/* YYRHS -- A `-1'-separated list of the rules' RHS. */
626 +static const yytype_int8 yyrhs[] =
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
645 +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
646 +static const yytype_uint16 yyrline[] =
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,
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[] =
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
672 +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
673 + token YYLEX-NUM. */
674 +static const yytype_uint16 yytoknum[] =
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
682 +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
683 +static const yytype_uint8 yyr1[] =
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,
693 +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
694 +static const yytype_uint8 yyr2[] =
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,
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[] =
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,
718 +/* YYDEFGOTO[NTERM-NUM]. */
719 +static const yytype_int8 yydefgoto[] =
721 + -1, 1, 16, 17, 18, 19, 20, 21, 22, 23,
725 +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
727 +#define YYPACT_NINF -27
728 +static const yytype_int8 yypact[] =
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,
739 +/* YYPGOTO[NTERM-NUM]. */
740 +static const yytype_int8 yypgoto[] =
742 + -27, -27, -27, -27, -27, -27, -27, -27, -27, -6,
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[] =
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
765 +#define yypact_value_is_default(Yystate) \
766 + (!!((Yystate) == (-27)))
768 +#define yytable_value_is_error(Yytable_value) \
771 +static const yytype_int8 yycheck[] =
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
786 +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
787 + symbol of state STATE-NUM. */
788 +static const yytype_uint8 yystos[] =
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,
799 +#define yyerrok (yyerrstatus = 0)
800 +#define yyclearin (yychar = YYEMPTY)
801 +#define YYEMPTY (-2)
804 +#define YYACCEPT goto yyacceptlab
805 +#define YYABORT goto yyabortlab
806 +#define YYERROR goto yyerrorlab
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
816 +#define YYFAIL goto yyerrlab
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. */
824 +#define YYRECOVERING() (!!yyerrstatus)
826 +#define YYBACKUP(Token, Value) \
828 + if (yychar == YYEMPTY) \
830 + yychar = (Token); \
831 + yylval = (Value); \
832 + YYPOPSTACK (yylen); \
833 + yystate = *yyssp; \
838 + yyerror (YY_("syntax error: cannot back up")); \
843 +/* Error token number */
845 +#define YYERRCODE 256
848 +/* This macro is provided for backward compatibility. */
849 +#ifndef YY_LOCATION_PRINT
850 +# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
854 +/* YYLEX -- calling `yylex' with the right arguments. */
856 +# define YYLEX yylex (&yylval, YYLEX_PARAM)
858 +# define YYLEX yylex (&yylval)
861 +/* Enable debugging if requested. */
865 +# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
866 +# define YYFPRINTF fprintf
869 +# define YYDPRINTF(Args) \
875 +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
879 + YYFPRINTF (stderr, "%s ", Title); \
880 + yy_symbol_print (stderr, \
882 + YYFPRINTF (stderr, "\n"); \
887 +/*--------------------------------.
888 +| Print this symbol on YYOUTPUT. |
889 +`--------------------------------*/
892 +#if (defined __STDC__ || defined __C99__FUNC__ \
893 + || defined __cplusplus || defined _MSC_VER)
895 +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
898 +yy_symbol_value_print (yyoutput, yytype, yyvaluep)
901 + YYSTYPE const * const yyvaluep;
904 + FILE *yyo = yyoutput;
909 + if (yytype < YYNTOKENS)
910 + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
918 +/*--------------------------------.
919 +| Print this symbol on YYOUTPUT. |
920 +`--------------------------------*/
922 +#if (defined __STDC__ || defined __C99__FUNC__ \
923 + || defined __cplusplus || defined _MSC_VER)
925 +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
928 +yy_symbol_print (yyoutput, yytype, yyvaluep)
931 + YYSTYPE const * const yyvaluep;
934 + if (yytype < YYNTOKENS)
935 + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
937 + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
939 + yy_symbol_value_print (yyoutput, yytype, yyvaluep);
940 + YYFPRINTF (yyoutput, ")");
943 +/*------------------------------------------------------------------.
944 +| yy_stack_print -- Print the state stack from its BOTTOM up to its |
946 +`------------------------------------------------------------------*/
948 +#if (defined __STDC__ || defined __C99__FUNC__ \
949 + || defined __cplusplus || defined _MSC_VER)
951 +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
954 +yy_stack_print (yybottom, yytop)
955 + yytype_int16 *yybottom;
956 + yytype_int16 *yytop;
959 + YYFPRINTF (stderr, "Stack now");
960 + for (; yybottom <= yytop; yybottom++)
962 + int yybot = *yybottom;
963 + YYFPRINTF (stderr, " %d", yybot);
965 + YYFPRINTF (stderr, "\n");
968 +# define YY_STACK_PRINT(Bottom, Top) \
971 + yy_stack_print ((Bottom), (Top)); \
975 +/*------------------------------------------------.
976 +| Report that the YYRULE is going to be reduced. |
977 +`------------------------------------------------*/
979 +#if (defined __STDC__ || defined __C99__FUNC__ \
980 + || defined __cplusplus || defined _MSC_VER)
982 +yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
985 +yy_reduce_print (yyvsp, yyrule)
990 + int yynrhs = yyr2[yyrule];
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++)
998 + YYFPRINTF (stderr, " $%d = ", yyi + 1);
999 + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1000 + &(yyvsp[(yyi + 1) - (yynrhs)])
1002 + YYFPRINTF (stderr, "\n");
1006 +# define YY_REDUCE_PRINT(Rule) \
1009 + yy_reduce_print (yyvsp, Rule); \
1012 +/* Nonzero means print parse trace. It is left uninitialized so that
1013 + multiple parsers can coexist. */
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 */
1023 +/* YYINITDEPTH -- initial size of the parser's stacks. */
1024 +#ifndef YYINITDEPTH
1025 +# define YYINITDEPTH 200
1028 +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1029 + if the built-in stack extension method is used).
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. */
1036 +# define YYMAXDEPTH 10000
1040 +#if YYERROR_VERBOSE
1043 +# if defined __GLIBC__ && defined _STRING_H
1044 +# define yystrlen strlen
1046 +/* Return the length of YYSTR. */
1047 +#if (defined __STDC__ || defined __C99__FUNC__ \
1048 + || defined __cplusplus || defined _MSC_VER)
1050 +yystrlen (const char *yystr)
1054 + const char *yystr;
1058 + for (yylen = 0; yystr[yylen]; yylen++)
1066 +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1067 +# define yystpcpy stpcpy
1069 +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1071 +#if (defined __STDC__ || defined __C99__FUNC__ \
1072 + || defined __cplusplus || defined _MSC_VER)
1074 +yystpcpy (char *yydest, const char *yysrc)
1077 +yystpcpy (yydest, yysrc)
1079 + const char *yysrc;
1082 + char *yyd = yydest;
1083 + const char *yys = yysrc;
1085 + while ((*yyd++ = *yys++) != '\0')
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. */
1102 +yytnamerr (char *yyres, const char *yystr)
1104 + if (*yystr == '"')
1107 + char const *yyp = yystr;
1114 + goto do_not_strip_quotes;
1117 + if (*++yyp != '\\')
1118 + goto do_not_strip_quotes;
1119 + /* Fall through. */
1122 + yyres[yyn] = *yyp;
1128 + yyres[yyn] = '\0';
1131 + do_not_strip_quotes: ;
1135 + return yystrlen (yystr);
1137 + return yystpcpy (yyres, yystr) - yyres;
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
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. */
1150 +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1151 + yytype_int16 *yyssp, int yytoken)
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
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
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.
1191 + if (yytoken != YYEMPTY)
1193 + int yyn = yypact[*yyssp];
1194 + yyarg[yycount++] = yytname[yytoken];
1195 + if (!yypact_value_is_default (yyn))
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;
1206 + for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1207 + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1208 + && !yytable_value_is_error (yytable[yyx + yyn]))
1210 + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1216 + yyarg[yycount++] = yytname[yyx];
1218 + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1219 + if (! (yysize <= yysize1
1220 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1230 +# define YYCASE_(N, S) \
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"));
1244 + YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1245 + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1250 + if (*yymsg_alloc < yysize)
1252 + *yymsg_alloc = 2 * yysize;
1253 + if (! (yysize <= *yymsg_alloc
1254 + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1255 + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
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. */
1263 + char *yyp = *yymsg;
1265 + while ((*yyp = *yyformat) != '\0')
1266 + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1268 + yyp += yytnamerr (yyp, yyarg[yyi++]);
1279 +#endif /* YYERROR_VERBOSE */
1281 +/*-----------------------------------------------.
1282 +| Release the memory associated to this symbol. |
1283 +`-----------------------------------------------*/
1286 +#if (defined __STDC__ || defined __C99__FUNC__ \
1287 + || defined __cplusplus || defined _MSC_VER)
1289 +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1292 +yydestruct (yymsg, yytype, yyvaluep)
1293 + const char *yymsg;
1295 + YYSTYPE *yyvaluep;
1301 + yymsg = "Deleting";
1302 + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1314 +#ifdef YYPARSE_PARAM
1315 +#if (defined __STDC__ || defined __C99__FUNC__ \
1316 + || defined __cplusplus || defined _MSC_VER)
1318 +yyparse (void *YYPARSE_PARAM)
1321 +yyparse (YYPARSE_PARAM)
1322 + void *YYPARSE_PARAM;
1324 +#else /* ! YYPARSE_PARAM */
1325 +#if (defined __STDC__ || defined __C99__FUNC__ \
1326 + || defined __cplusplus || defined _MSC_VER)
1336 +/* The lookahead symbol. */
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")
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
1354 +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1355 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1356 +# define YY_IGNORE_MAYBE_UNINITIALIZED_END
1358 +#ifndef YY_INITIAL_VALUE
1359 +# define YY_INITIAL_VALUE(Value) /* Nothing. */
1362 +/* The semantic value of the lookahead symbol. */
1363 +YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
1365 + /* Number of syntax errors so far. */
1369 + /* Number of tokens to shift before error messages enabled. */
1372 + /* The stacks and their tools:
1373 + `yyss': related to states.
1374 + `yyvs': related to semantic values.
1376 + Refer to the stacks through separate pointers, to allow yyoverflow
1377 + to reallocate them elsewhere. */
1379 + /* The state stack. */
1380 + yytype_int16 yyssa[YYINITDEPTH];
1381 + yytype_int16 *yyss;
1382 + yytype_int16 *yyssp;
1384 + /* The semantic value stack. */
1385 + YYSTYPE yyvsa[YYINITDEPTH];
1389 + YYSIZE_T yystacksize;
1393 + /* Lookahead token as an internal (translated) token number. */
1395 + /* The variables used to return semantic value and location from the
1396 + action routines. */
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;
1406 +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1408 + /* The number of symbols on the RHS of the reduced rule.
1409 + Keep to zero when no symbol should be popped. */
1412 + yyssp = yyss = yyssa;
1413 + yyvsp = yyvs = yyvsa;
1414 + yystacksize = YYINITDEPTH;
1416 + YYDPRINTF ((stderr, "Starting parse\n"));
1421 + yychar = YYEMPTY; /* Cause a token to be read. */
1424 +/*------------------------------------------------------------.
1425 +| yynewstate -- Push a new state, which is found in yystate. |
1426 +`------------------------------------------------------------*/
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. */
1435 + if (yyss + yystacksize - 1 <= yyssp)
1437 + /* Get the current used size of the three stacks, in elements. */
1438 + YYSIZE_T yysize = yyssp - yyss + 1;
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
1445 + YYSTYPE *yyvs1 = yyvs;
1446 + yytype_int16 *yyss1 = yyss;
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),
1460 +#else /* no yyoverflow */
1461 +# ifndef YYSTACK_RELOCATE
1462 + goto yyexhaustedlab;
1464 + /* Extend the stack our own way. */
1465 + if (YYMAXDEPTH <= yystacksize)
1466 + goto yyexhaustedlab;
1468 + if (YYMAXDEPTH < yystacksize)
1469 + yystacksize = YYMAXDEPTH;
1472 + yytype_int16 *yyss1 = yyss;
1473 + union yyalloc *yyptr =
1474 + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
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);
1484 +#endif /* no yyoverflow */
1486 + yyssp = yyss + yysize - 1;
1487 + yyvsp = yyvs + yysize - 1;
1489 + YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1490 + (unsigned long int) yystacksize));
1492 + if (yyss + yystacksize - 1 <= yyssp)
1496 + YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1498 + if (yystate == YYFINAL)
1508 + /* Do appropriate processing given the current state. Read a
1509 + lookahead token if we need one and don't already have one. */
1511 + /* First try to decide what to do without reference to lookahead token. */
1512 + yyn = yypact[yystate];
1513 + if (yypact_value_is_default (yyn))
1516 + /* Not known => get a lookahead token if don't already have one. */
1518 + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1519 + if (yychar == YYEMPTY)
1521 + YYDPRINTF ((stderr, "Reading a token: "));
1525 + if (yychar <= YYEOF)
1527 + yychar = yytoken = YYEOF;
1528 + YYDPRINTF ((stderr, "Now at end of input.\n"));
1532 + yytoken = YYTRANSLATE (yychar);
1533 + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1536 + /* If the proper action on seeing token YYTOKEN is to reduce or to
1537 + detect an error, take that action. */
1539 + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1541 + yyn = yytable[yyn];
1544 + if (yytable_value_is_error (yyn))
1550 + /* Count tokens shifted since error; after three, turn off error
1555 + /* Shift the lookahead token. */
1556 + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1558 + /* Discard the shifted token. */
1562 + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1563 + *++yyvsp = yylval;
1564 + YY_IGNORE_MAYBE_UNINITIALIZED_END
1569 +/*-----------------------------------------------------------.
1570 +| yydefault -- do the default action for the current state. |
1571 +`-----------------------------------------------------------*/
1573 + yyn = yydefact[yystate];
1579 +/*-----------------------------.
1580 +| yyreduce -- Do a reduction. |
1581 +`-----------------------------*/
1583 + /* yyn is the number of a rule to reduce with. */
1584 + yylen = yyr2[yyn];
1586 + /* If YYLEN is nonzero, implement the default value of the action:
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];
1597 + YY_REDUCE_PRINT (yyn);
1601 +/* Line 1787 of yacc.c */
1602 +#line 157 "ptlib/common/getdate.y"
1604 + VARIABLE->yyHaveTime++;
1609 +/* Line 1787 of yacc.c */
1610 +#line 160 "ptlib/common/getdate.y"
1612 + VARIABLE->yyHaveZone++;
1617 +/* Line 1787 of yacc.c */
1618 +#line 163 "ptlib/common/getdate.y"
1620 + VARIABLE->yyHaveDate++;
1625 +/* Line 1787 of yacc.c */
1626 +#line 166 "ptlib/common/getdate.y"
1628 + VARIABLE->yyHaveDay++;
1633 +/* Line 1787 of yacc.c */
1634 +#line 169 "ptlib/common/getdate.y"
1636 + VARIABLE->yyHaveRel++;
1641 +/* Line 1787 of yacc.c */
1642 +#line 175 "ptlib/common/getdate.y"
1644 + VARIABLE->yyHour = (yyvsp[(1) - (2)].Number);
1645 + VARIABLE->yyMinutes = 0;
1646 + VARIABLE->yySeconds = 0;
1647 + VARIABLE->yyMeridian = (yyvsp[(2) - (2)].Meridian);
1652 +/* Line 1787 of yacc.c */
1653 +#line 181 "ptlib/common/getdate.y"
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);
1665 +/* Line 1787 of yacc.c */
1666 +#line 189 "ptlib/common/getdate.y"
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);
1678 +/* Line 1787 of yacc.c */
1679 +#line 197 "ptlib/common/getdate.y"
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);
1689 +/* Line 1787 of yacc.c */
1690 +#line 203 "ptlib/common/getdate.y"
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);
1701 +/* Line 1787 of yacc.c */
1702 +#line 210 "ptlib/common/getdate.y"
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);
1712 +/* Line 1787 of yacc.c */
1713 +#line 216 "ptlib/common/getdate.y"
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);
1725 +/* Line 1787 of yacc.c */
1726 +#line 226 "ptlib/common/getdate.y"
1728 + VARIABLE->yyTimezone = (yyvsp[(1) - (1)].Number);
1729 + VARIABLE->yyDSTmode = DSToff;
1734 +/* Line 1787 of yacc.c */
1735 +#line 230 "ptlib/common/getdate.y"
1737 + VARIABLE->yyTimezone = (yyvsp[(1) - (1)].Number);
1738 + VARIABLE->yyDSTmode = DSTon;
1743 +/* Line 1787 of yacc.c */
1744 +#line 235 "ptlib/common/getdate.y"
1746 + VARIABLE->yyTimezone = (yyvsp[(1) - (2)].Number);
1747 + VARIABLE->yyDSTmode = DSTon;
1752 +/* Line 1787 of yacc.c */
1753 +#line 239 "ptlib/common/getdate.y"
1755 + if (VARIABLE->yyHaveTime > 0) {
1756 + VARIABLE->yyTimezone = (yyvsp[(1) - (1)].Number);
1757 + VARIABLE->yyDSTmode = DSToff;
1760 + VARIABLE->yyHaveZone--;
1765 +/* Line 1787 of yacc.c */
1766 +#line 249 "ptlib/common/getdate.y"
1768 + VARIABLE->yyDayOrdinal = 1;
1769 + VARIABLE->yyDayNumber = (yyvsp[(1) - (1)].Number);
1774 +/* Line 1787 of yacc.c */
1775 +#line 253 "ptlib/common/getdate.y"
1777 + VARIABLE->yyDayOrdinal = 1;
1778 + VARIABLE->yyDayNumber = (yyvsp[(1) - (2)].Number);
1783 +/* Line 1787 of yacc.c */
1784 +#line 257 "ptlib/common/getdate.y"
1786 + VARIABLE->yyDayOrdinal = (yyvsp[(1) - (2)].Number);
1787 + VARIABLE->yyDayNumber = (yyvsp[(2) - (2)].Number);
1792 +/* Line 1787 of yacc.c */
1793 +#line 263 "ptlib/common/getdate.y"
1795 + SetPossibleDate(VARIABLE, (yyvsp[(1) - (3)].Number), (yyvsp[(3) - (3)].Number), VARIABLE->yyYear);
1800 +/* Line 1787 of yacc.c */
1801 +#line 266 "ptlib/common/getdate.y"
1803 + SetPossibleDate(VARIABLE, (yyvsp[(1) - (5)].Number), (yyvsp[(3) - (5)].Number), (yyvsp[(5) - (5)].Number));
1808 +/* Line 1787 of yacc.c */
1809 +#line 269 "ptlib/common/getdate.y"
1811 + /* ISO 8601 format. yyyy-mm-dd. */
1812 + SetPossibleDate(VARIABLE, (yyvsp[(1) - (4)].Number), -(yyvsp[(2) - (4)].Number), -(yyvsp[(3) - (4)].Number));
1817 +/* Line 1787 of yacc.c */
1818 +#line 273 "ptlib/common/getdate.y"
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;
1827 +/* Line 1787 of yacc.c */
1828 +#line 278 "ptlib/common/getdate.y"
1830 + /* e.g. 17-JUN-1992. */
1831 + SetPossibleDate(VARIABLE, (yyvsp[(1) - (3)].Number), (yyvsp[(2) - (3)].Number), -(yyvsp[(3) - (3)].Number));
1836 +/* Line 1787 of yacc.c */
1837 +#line 282 "ptlib/common/getdate.y"
1839 + VARIABLE->yyMonth = (yyvsp[(1) - (2)].Number);
1840 + if ((yyvsp[(2) - (2)].Number) > 31)
1841 + VARIABLE->yyYear = (yyvsp[(2) - (2)].Number);
1843 + VARIABLE->yyDay = (yyvsp[(2) - (2)].Number);
1848 +/* Line 1787 of yacc.c */
1849 +#line 289 "ptlib/common/getdate.y"
1851 + VARIABLE->yyMonth = (yyvsp[(1) - (4)].Number);
1852 + VARIABLE->yyDay = (yyvsp[(2) - (4)].Number);
1853 + VARIABLE->yyYear = (yyvsp[(4) - (4)].Number);
1858 +/* Line 1787 of yacc.c */
1859 +#line 294 "ptlib/common/getdate.y"
1861 + if ((yyvsp[(1) - (2)].Number) > 31)
1862 + VARIABLE->yyYear = (yyvsp[(1) - (2)].Number);
1864 + VARIABLE->yyDay = (yyvsp[(1) - (2)].Number);
1865 + VARIABLE->yyMonth = (yyvsp[(2) - (2)].Number);
1870 +/* Line 1787 of yacc.c */
1871 +#line 301 "ptlib/common/getdate.y"
1873 + SetPossibleDate(VARIABLE, (yyvsp[(1) - (3)].Number), (yyvsp[(2) - (3)].Number), (yyvsp[(3) - (3)].Number));
1878 +/* Line 1787 of yacc.c */
1879 +#line 306 "ptlib/common/getdate.y"
1881 + VARIABLE->yyRelSeconds = -VARIABLE->yyRelSeconds;
1882 + VARIABLE->yyRelMonth = -VARIABLE->yyRelMonth;
1887 +/* Line 1787 of yacc.c */
1888 +#line 313 "ptlib/common/getdate.y"
1890 + VARIABLE->yyRelSeconds += (yyvsp[(1) - (2)].Number) * (yyvsp[(2) - (2)].Number) * 60L;
1895 +/* Line 1787 of yacc.c */
1896 +#line 316 "ptlib/common/getdate.y"
1898 + VARIABLE->yyRelSeconds += (yyvsp[(1) - (2)].Number) * (yyvsp[(2) - (2)].Number) * 60L;
1903 +/* Line 1787 of yacc.c */
1904 +#line 319 "ptlib/common/getdate.y"
1906 + VARIABLE->yyRelSeconds += (yyvsp[(1) - (1)].Number) * 60L;
1911 +/* Line 1787 of yacc.c */
1912 +#line 322 "ptlib/common/getdate.y"
1914 + VARIABLE->yyRelSeconds += (yyvsp[(1) - (2)].Number);
1919 +/* Line 1787 of yacc.c */
1920 +#line 325 "ptlib/common/getdate.y"
1922 + VARIABLE->yyRelSeconds += (yyvsp[(1) - (2)].Number);
1927 +/* Line 1787 of yacc.c */
1928 +#line 328 "ptlib/common/getdate.y"
1930 + VARIABLE->yyRelSeconds++;
1935 +/* Line 1787 of yacc.c */
1936 +#line 331 "ptlib/common/getdate.y"
1938 + VARIABLE->yyRelMonth += (yyvsp[(1) - (2)].Number) * (yyvsp[(2) - (2)].Number);
1943 +/* Line 1787 of yacc.c */
1944 +#line 334 "ptlib/common/getdate.y"
1946 + VARIABLE->yyRelMonth += (yyvsp[(1) - (2)].Number) * (yyvsp[(2) - (2)].Number);
1951 +/* Line 1787 of yacc.c */
1952 +#line 337 "ptlib/common/getdate.y"
1954 + VARIABLE->yyRelMonth += (yyvsp[(1) - (1)].Number);
1959 +/* Line 1787 of yacc.c */
1960 +#line 342 "ptlib/common/getdate.y"
1962 + (yyval.Number) = (yyvsp[(1) - (1)].Number);
1967 +/* Line 1787 of yacc.c */
1968 +#line 345 "ptlib/common/getdate.y"
1970 + (yyval.Number) = (yyvsp[(1) - (1)].Number);
1975 +/* Line 1787 of yacc.c */
1976 +#line 348 "ptlib/common/getdate.y"
1978 + (yyval.Number) = (yyvsp[(1) - (1)].Number);
1983 +/* Line 1787 of yacc.c */
1984 +#line 353 "ptlib/common/getdate.y"
1986 + if (VARIABLE->yyHaveTime && VARIABLE->yyHaveDate && !VARIABLE->yyHaveRel)
1987 + VARIABLE->yyYear = (yyvsp[(1) - (1)].Number);
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;
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;
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;
2007 + VARIABLE->yyMeridian = MER24;
2014 +/* Line 1787 of yacc.c */
2015 +#line 379 "ptlib/common/getdate.y"
2017 + if (VARIABLE->yyHaveTime && VARIABLE->yyHaveDate && !VARIABLE->yyHaveRel)
2018 + VARIABLE->yyYear = (yyvsp[(1) - (1)].Number);
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;
2030 +/* Line 1787 of yacc.c */
2031 +#line 390 "ptlib/common/getdate.y"
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;
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;
2050 +/* Line 1787 of yacc.c */
2051 +#line 407 "ptlib/common/getdate.y"
2053 + (yyval.Meridian) = MER24;
2058 +/* Line 1787 of yacc.c */
2059 +#line 410 "ptlib/common/getdate.y"
2061 + (yyval.Meridian) = (yyvsp[(1) - (1)].Meridian);
2066 +/* Line 1787 of yacc.c */
2067 +#line 2031 "ptlib/common/getdate.tab.c"
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);
2083 + YYPOPSTACK (yylen);
2085 + YY_STACK_PRINT (yyss, yyssp);
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. */
2095 + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2096 + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2097 + yystate = yytable[yystate];
2099 + yystate = yydefgoto[yyn - YYNTOKENS];
2104 +/*------------------------------------.
2105 +| yyerrlab -- here on detecting error |
2106 +`------------------------------------*/
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);
2112 + /* If not already recovering from an error, report this error. */
2116 +#if ! YYERROR_VERBOSE
2117 + yyerror (YY_("syntax error"));
2119 +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2122 + char const *yymsgp = YY_("syntax error");
2123 + int yysyntax_error_status;
2124 + yysyntax_error_status = YYSYNTAX_ERROR;
2125 + if (yysyntax_error_status == 0)
2127 + else if (yysyntax_error_status == 1)
2129 + if (yymsg != yymsgbuf)
2130 + YYSTACK_FREE (yymsg);
2131 + yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2135 + yymsg_alloc = sizeof yymsgbuf;
2136 + yysyntax_error_status = 2;
2140 + yysyntax_error_status = YYSYNTAX_ERROR;
2145 + if (yysyntax_error_status == 2)
2146 + goto yyexhaustedlab;
2148 +# undef YYSYNTAX_ERROR
2154 + if (yyerrstatus == 3)
2156 + /* If just tried and failed to reuse lookahead token after an
2157 + error, discard it. */
2159 + if (yychar <= YYEOF)
2161 + /* Return failure if at end of input. */
2162 + if (yychar == YYEOF)
2167 + yydestruct ("Error: discarding",
2168 + yytoken, &yylval);
2173 + /* Else will try to reuse lookahead token after shifting the error
2178 +/*---------------------------------------------------.
2179 +| yyerrorlab -- error raised explicitly by YYERROR. |
2180 +`---------------------------------------------------*/
2183 + /* Pacify compilers like GCC when the user code never invokes
2184 + YYERROR and the label yyerrorlab therefore never appears in user
2186 + if (/*CONSTCOND*/ 0)
2189 + /* Do not reclaim the symbols of the rule which action triggered
2191 + YYPOPSTACK (yylen);
2193 + YY_STACK_PRINT (yyss, yyssp);
2198 +/*-------------------------------------------------------------.
2199 +| yyerrlab1 -- common code for both syntax error and YYERROR. |
2200 +`-------------------------------------------------------------*/
2202 + yyerrstatus = 3; /* Each real token shifted decrements this. */
2206 + yyn = yypact[yystate];
2207 + if (!yypact_value_is_default (yyn))
2210 + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2212 + yyn = yytable[yyn];
2218 + /* Pop the current state because it cannot handle the error token. */
2219 + if (yyssp == yyss)
2223 + yydestruct ("Error: popping",
2224 + yystos[yystate], yyvsp);
2227 + YY_STACK_PRINT (yyss, yyssp);
2230 + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2231 + *++yyvsp = yylval;
2232 + YY_IGNORE_MAYBE_UNINITIALIZED_END
2235 + /* Shift the error token. */
2236 + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2242 +/*-------------------------------------.
2243 +| yyacceptlab -- YYACCEPT comes here. |
2244 +`-------------------------------------*/
2249 +/*-----------------------------------.
2250 +| yyabortlab -- YYABORT comes here. |
2251 +`-----------------------------------*/
2256 +#if !defined yyoverflow || YYERROR_VERBOSE
2257 +/*-------------------------------------------------.
2258 +| yyexhaustedlab -- memory exhaustion comes here. |
2259 +`-------------------------------------------------*/
2261 + yyerror (YY_("memory exhausted"));
2263 + /* Fall through. */
2267 + if (yychar != YYEMPTY)
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);
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)
2281 + yydestruct ("Cleanup: popping",
2282 + yystos[*yyssp], yyvsp);
2286 + if (yyss != yyssa)
2287 + YYSTACK_FREE (yyss);
2289 +#if YYERROR_VERBOSE
2290 + if (yymsg != yymsgbuf)
2291 + YYSTACK_FREE (yymsg);
2293 + /* Make sure YYID is used. */
2294 + return YYID (yyresult);
2298 +/* Line 2050 of yacc.c */
2299 +#line 415 "ptlib/common/getdate.y"
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 },
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 },
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 },
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 */
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 */
2388 + { "nft", tZONE, HOUR(3.5) }, /* Newfoundland */
2389 + { "nst", tZONE, HOUR(3.5) }, /* Newfoundland Standard */
2390 + { "ndt", tDAYZONE, HOUR(3.5) }, /* Newfoundland Daylight */
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 */
2421 + { "it", tZONE, -HOUR(3.5) },/* Iran */
2423 + { "zp4", tZONE, -HOUR(4) }, /* USSR Zone 3 */
2424 + { "zp5", tZONE, -HOUR(5) }, /* USSR Zone 4 */
2426 + { "ist", tZONE, -HOUR(5.5) },/* Indian Standard */
2428 + { "zp6", tZONE, -HOUR(6) }, /* USSR Zone 5 */
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 */
2435 + { "wast", tZONE, -HOUR(7) }, /* West Australian Standard */
2436 + { "wadt", tDAYZONE, -HOUR(7) }, /* West Australian Daylight */
2438 + { "jt", tZONE, -HOUR(7.5) },/* Java (3pm in Cronusland!) */
2440 + { "cct", tZONE, -HOUR(8) }, /* China Coast, USSR Zone 7 */
2441 + { "jst", tZONE, -HOUR(9) }, /* Japan Standard, USSR Zone 8 */
2443 + { "cast", tZONE, -HOUR(9.5) },/* Central Australian Standard */
2444 + { "cadt", tDAYZONE, -HOUR(9.5) },/* Central Australian Daylight */
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 */
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 */
2486 +static int LookupWord(char * buff, YYSTYPE * yylval, struct Variables * vars)
2490 + register const TABLE *tp;
2494 + /* Make it lowercase. */
2495 + for (p = buff; *p != '\0'; p++)
2496 + *p = (char)tolower(*p);
2498 + if (strcmp(buff, "am") == 0 || strcmp(buff, "a.m.") == 0) {
2499 + yylval->Meridian = MERam;
2502 + if (strcmp(buff, "pm") == 0 || strcmp(buff, "p.m.") == 0) {
2503 + yylval->Meridian = MERpm;
2507 + /* See if we have an abbreviation for a month. */
2508 + if (strlen(buff) == 3)
2510 + else if (strlen(buff) == 4 && buff[3] == '.') {
2517 + for (tp = MonthDayTable; tp->name; tp++) {
2519 + if (strncmp(buff, tp->name, 3) == 0) {
2520 + yylval->Number = tp->value;
2524 + else if (strcmp(buff, tp->name) == 0) {
2525 + yylval->Number = tp->value;
2530 + for (tp = TimezoneTable; tp->name; tp++)
2531 + if (strcmp(buff, tp->name) == 0) {
2532 + yylval->Number = tp->value;
2536 + if (strcmp(buff, "dst") == 0)
2539 + for (tp = UnitsTable; tp->name; tp++)
2540 + if (strcmp(buff, tp->name) == 0) {
2541 + yylval->Number = tp->value;
2545 + /* Strip off any plural and try the units table again. */
2546 + i = strlen(buff) - 1;
2547 + if (buff[i] == 's') {
2549 + for (tp = UnitsTable; tp->name; tp++)
2550 + if (strcmp(buff, tp->name) == 0) {
2551 + yylval->Number = tp->value;
2554 + buff[i] = 's'; /* Put back for "this" in OtherTable. */
2557 + for (tp = OtherTable; tp->name; tp++)
2558 + if (strcmp(buff, tp->name) == 0) {
2559 + yylval->Number = tp->value;
2563 + /* Avoid confusion with 'T' in RFC3339 and 't' in Military timezones */
2564 + if (!vars->yyHaveTime && strcmp(buff, "t") == 0)
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;
2576 + /* Drop out any periods and try the timezone table again. */
2577 + for (i = 0, p = q = buff; *q; q++)
2584 + for (tp = TimezoneTable; tp->name; tp++)
2585 + if (strcmp(buff, tp->name) == 0) {
2586 + yylval->Number = tp->value;
2590 + for (i = 1; i <= 12; i++)
2591 + for (abbrev = 0; abbrev < 2; abbrev++)
2592 + if (PTimeIsMonthName(buff, i, abbrev)) {
2593 + yylval->Number = i;
2597 + for (i = 1; i <= 7; i++)
2598 + for (abbrev = 0; abbrev < 2; abbrev++)
2599 + if (PTimeIsDayName(buff, i, abbrev)) {
2600 + yylval->Number = i;
2609 +#pragma warning(disable:4211)
2615 +int yylex(YYSTYPE * yylval, struct Variables * vars)
2621 + register int c = PTimeGetChar(vars->yyInput);
2623 + while (c != EOF && c != '\0' && c != '\n') {
2624 + while (isspace(c))
2625 + c = PTimeGetChar(vars->yyInput);
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 */
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);
2643 + PTimeUngetChar(vars->yyInput, c);
2645 + yylval->Number = -yylval->Number;
2647 + return sign ? tS4DIGITNUMBER : t4DIGITNUMBER;
2651 + return t6DIGITNUMBER;
2653 + return t8DIGITNUMBER;
2658 + for (p = buff; isalpha(c) || c == '.'; c = PTimeGetChar(vars->yyInput)) {
2659 + if (p < &buff[sizeof(buff)-1])
2663 + PTimeUngetChar(vars->yyInput, c);
2664 + return LookupWord(buff, yylval, vars);
2672 + c = PTimeGetChar(vars->yyInput);
2673 + if (c == '\0' || c == EOF)
2677 + else if (c == ')')
2679 + } while (Count > 0);
2683 + PTimeUngetChar(vars->yyInput, c);
2689 +#pragma warning(default:4211)
2693 +static time_t ToSeconds(time_t Hours, time_t Minutes, time_t Seconds,
2694 + MERIDIAN Meridian)
2696 + if (Minutes < 0 || Minutes > 59 || Seconds < 0 || Seconds > 59)
2698 + switch (Meridian) {
2700 + if (Hours < 0 || Hours > 23)
2702 + return (Hours * 60L + Minutes) * 60L + Seconds;
2704 + if (Hours < 1 || Hours > 12)
2708 + return (Hours * 60L + Minutes) * 60L + Seconds;
2710 + if (Hours < 1 || Hours > 12)
2714 + return ((Hours + 12) * 60L + Minutes) * 60L + Seconds;
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)
2725 + static int DaysInMonth[12] = {
2726 + 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
2736 + else if (Year < 100)
2738 + DaysInMonth[1] = Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0)
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])
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)
2757 + if (DSTmode == DSTon
2758 + || (DSTmode == DSTmaybe && localtime(&Julian)->tm_isdst))
2759 + Julian -= 60 * 60;
2764 +static time_t DSTcorrect(time_t Start, time_t Future)
2769 + StartDay = (localtime(&Start)->tm_hour + 1) % 24;
2770 + FutureDay = (localtime(&Future)->tm_hour + 1) % 24;
2771 + return (Future - Start) + (StartDay - FutureDay) * 60L * 60L;
2775 +static time_t RelativeDate(time_t Start, time_t DayOrdinal, time_t DayNumber)
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);
2788 +static time_t RelativeMonth(time_t Start, time_t RelMonth, time_t yyTimezone)
2794 + if (RelMonth == 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));
2807 +static void SetPossibleDate(struct Variables * var,
2808 + time_t possible_day,
2809 + time_t possible_month,
2810 + time_t possible_year)
2814 + if (possible_day > 31) /* test for ymd */
2816 + else if (possible_day > 12) /* test for dmy */
2818 + else if (possible_month > 12) /* test for mdy */
2821 + date_order = PTimeGetDateOrder();
2823 + switch (date_order) {
2825 + var->yyDay = possible_month;
2826 + var->yyMonth = possible_day;
2827 + var->yyYear = possible_year;
2830 + var->yyDay = possible_day;
2831 + var->yyMonth = possible_month;
2832 + var->yyYear = possible_year;
2835 + var->yyDay = possible_year;
2836 + var->yyMonth = possible_month;
2837 + var->yyYear = possible_day;
2842 +time_t STDAPICALLTYPE PTimeParse(void * inputStream, struct tm * now, int timezone)
2845 + struct Variables var;
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;
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;
2868 + if (var.yyHaveTime > 1 || var.yyHaveZone > 1 ||
2869 + var.yyHaveDate > 1 || var.yyHaveDay > 1)
2872 + if (var.yyHaveTime == 0 && var.yyHaveZone == 0 &&
2873 + var.yyHaveDate == 0 && var.yyHaveDay == 0 && var.yyHaveRel == 0)
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);
2885 + if (!var.yyHaveRel)
2886 + Start -= ((now->tm_hour * 60L + now->tm_min) * 60L) + now->tm_sec;
2889 + Start += var.yyRelSeconds;
2890 + Start += RelativeMonth(Start, var.yyRelMonth, var.yyTimezone);
2892 + if (var.yyHaveDay && !var.yyHaveDate)
2893 + Start += RelativeDate(Start, var.yyDayOrdinal, var.yyDayNumber);
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;
2902 +#pragma warning(disable:4028 4100 4211)
2906 +int yyerror(const char * s)
2911 +static void yyerror(const char * s)
2917 +#pragma warning(default:4028 4100 4211)
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
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;
2935 // Run as a daemon, ie fork
2938 - ifstream pidfile(pidfilename);
2939 + ifstream pidfile((std::string&)pidfilename);
2940 if (pidfile.is_open()) {
2944 cout << "Daemon started with pid " << pid << endl;
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())