wok-next diff ptlib/stuff/patches/ptlib-2.10.11-bison_fixes-2.patch @ rev 20195

lirc: update bdeps
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Nov 03 11:41:58 2017 +0100 (2017-11-03)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ptlib/stuff/patches/ptlib-2.10.11-bison_fixes-2.patch	Fri Nov 03 11:41:58 2017 +0100
     1.3 @@ -0,0 +1,2951 @@
     1.4 +Submitted By:            Armin K. <krejzi at email dot com>
     1.5 +Updated By:              Bruce Dubbs <bduubs at linuxfromscratch dot org>
     1.6 +Date:                    2013-08-20
     1.7 +                         2016-05-04
     1.8 +Initial Package Version: 2.10.10
     1.9 +Upstream Status:         Reported
    1.10 +Origin:                  Self
    1.11 +Description:             Adds pregenerated C file which isn't generated correctly
    1.12 +                         with Bison 3.0.
    1.13 +Update:                  Add fixes for gcc-6
    1.14 +
    1.15 +diff -Naur ptlib-2.10.11.orig/include/ptlib/critsec.h ptlib-2.10.11/include/ptlib/critsec.h
    1.16 +--- ptlib-2.10.11.orig/include/ptlib/critsec.h	2013-08-14 18:20:32.000000000 -0500
    1.17 ++++ ptlib-2.10.11/include/ptlib/critsec.h	2016-05-04 19:40:01.626203961 -0500
    1.18 +@@ -40,7 +40,7 @@
    1.19 + #if P_HAS_ATOMIC_INT
    1.20 + 
    1.21 + #if defined(__GNUC__)
    1.22 +-#  if __GNUC__ >= 4 && __GNUC_MINOR__ >= 2
    1.23 ++#  if (__GNUC__ >= 4 && __GNUC_MINOR__ >= 2) || __GNUC__ >= 5
    1.24 + #     include <ext/atomicity.h>
    1.25 + #  else
    1.26 + #     include <bits/atomicity.h>
    1.27 +diff -Naur ptlib-2.10.11.orig/make/unix.mak ptlib-2.10.11/make/unix.mak
    1.28 +--- ptlib-2.10.11.orig/make/unix.mak	2013-08-14 18:20:27.000000000 -0500
    1.29 ++++ ptlib-2.10.11/make/unix.mak	2016-05-04 19:38:50.921583820 -0500
    1.30 +@@ -729,4 +729,6 @@
    1.31 + 
    1.32 + LDLIBS		+= -l$(PTLIB_BASE)$(LIB_TYPE)
    1.33 + 
    1.34 ++STDCCFLAGS  += -Wno-deprecated-declarations
    1.35 ++
    1.36 + # End of unix.mak
    1.37 +diff -Naur ptlib-2.10.11.orig/src/ptlib/common/getdate.tab.c ptlib-2.10.11/src/ptlib/common/getdate.tab.c
    1.38 +--- ptlib-2.10.11.orig/src/ptlib/common/getdate.tab.c	1969-12-31 18:00:00.000000000 -0600
    1.39 ++++ ptlib-2.10.11/src/ptlib/common/getdate.tab.c	2016-05-04 19:38:59.892281859 -0500
    1.40 +@@ -0,0 +1,2884 @@
    1.41 ++/* A Bison parser, made by GNU Bison 2.7.12-4996.  */
    1.42 ++
    1.43 ++/* Bison implementation for Yacc-like parsers in C
    1.44 ++   
    1.45 ++      Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
    1.46 ++   
    1.47 ++   This program is free software: you can redistribute it and/or modify
    1.48 ++   it under the terms of the GNU General Public License as published by
    1.49 ++   the Free Software Foundation, either version 3 of the License, or
    1.50 ++   (at your option) any later version.
    1.51 ++   
    1.52 ++   This program is distributed in the hope that it will be useful,
    1.53 ++   but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.54 ++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.55 ++   GNU General Public License for more details.
    1.56 ++   
    1.57 ++   You should have received a copy of the GNU General Public License
    1.58 ++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
    1.59 ++
    1.60 ++/* As a special exception, you may create a larger work that contains
    1.61 ++   part or all of the Bison parser skeleton and distribute that work
    1.62 ++   under terms of your choice, so long as that work isn't itself a
    1.63 ++   parser generator using the skeleton or a modified version thereof
    1.64 ++   as a parser skeleton.  Alternatively, if you modify or redistribute
    1.65 ++   the parser skeleton itself, you may (at your option) remove this
    1.66 ++   special exception, which will cause the skeleton and the resulting
    1.67 ++   Bison output files to be licensed under the GNU General Public
    1.68 ++   License without this special exception.
    1.69 ++   
    1.70 ++   This special exception was added by the Free Software Foundation in
    1.71 ++   version 2.2 of Bison.  */
    1.72 ++
    1.73 ++/* C LALR(1) parser skeleton written by Richard Stallman, by
    1.74 ++   simplifying the original so-called "semantic" parser.  */
    1.75 ++
    1.76 ++/* All symbols defined below should begin with yy or YY, to avoid
    1.77 ++   infringing on user name space.  This should be done even for local
    1.78 ++   variables, as they might otherwise be expanded by user macros.
    1.79 ++   There are some unavoidable exceptions within include files to
    1.80 ++   define necessary library symbols; they are noted "INFRINGES ON
    1.81 ++   USER NAME SPACE" below.  */
    1.82 ++
    1.83 ++/* Identify Bison output.  */
    1.84 ++#define YYBISON 1
    1.85 ++
    1.86 ++/* Bison version.  */
    1.87 ++#define YYBISON_VERSION "2.7.12-4996"
    1.88 ++
    1.89 ++/* Skeleton name.  */
    1.90 ++#define YYSKELETON_NAME "yacc.c"
    1.91 ++
    1.92 ++/* Pure parsers.  */
    1.93 ++#define YYPURE 1
    1.94 ++
    1.95 ++/* Push parsers.  */
    1.96 ++#define YYPUSH 0
    1.97 ++
    1.98 ++/* Pull parsers.  */
    1.99 ++#define YYPULL 1
   1.100 ++
   1.101 ++
   1.102 ++
   1.103 ++
   1.104 ++/* Copy the first part of user declarations.  */
   1.105 ++/* Line 371 of yacc.c  */
   1.106 ++#line 1 "ptlib/common/getdate.y"
   1.107 ++
   1.108 ++/*
   1.109 ++**  Originally written by Steven M. Bellovin <smb@research.att.com> while
   1.110 ++**  at the University of North Carolina at Chapel Hill.  Later tweaked by
   1.111 ++**  a couple of people on Usenet.  Completely overhauled by Rich $alz
   1.112 ++**  <rsalz@bbn.com> and Jim Berets <jberets@bbn.com> in August, 1990;
   1.113 ++**
   1.114 ++**  Major hack to coerce it into use with the Equivalence Portable
   1.115 ++**  Windows Library.
   1.116 ++**
   1.117 ++**  This grammar has 10 shift/reduce conflicts.
   1.118 ++**
   1.119 ++**  This code is in the public domain and has no copyright.
   1.120 ++*/
   1.121 ++/* SUPPRESS 287 on yaccpar_sccsid *//* Unused static variable */
   1.122 ++/* SUPPRESS 288 on yyerrlab *//* Label unused */
   1.123 ++
   1.124 ++
   1.125 ++#include <time.h>
   1.126 ++#include <string.h>
   1.127 ++#include <ctype.h>
   1.128 ++#include <stdlib.h>
   1.129 ++
   1.130 ++#ifndef EOF
   1.131 ++#include <stdio.h>
   1.132 ++#endif
   1.133 ++
   1.134 ++
   1.135 ++#ifdef _WIN32
   1.136 ++#ifdef _MSC_VER
   1.137 ++#pragma warning(disable:4131 4701 4996)
   1.138 ++#endif
   1.139 ++#define STDAPICALLTYPE __stdcall
   1.140 ++#define MSDOS
   1.141 ++#else
   1.142 ++#define STDAPICALLTYPE
   1.143 ++#endif
   1.144 ++
   1.145 ++
   1.146 ++extern int  STDAPICALLTYPE PTimeGetChar(void * stream);
   1.147 ++extern void STDAPICALLTYPE PTimeUngetChar(void * stream, int c);
   1.148 ++int STDAPICALLTYPE PTimeGetDateOrder();
   1.149 ++int STDAPICALLTYPE PTimeIsMonthName(const char *, int, int);
   1.150 ++int STDAPICALLTYPE PTimeIsDayName(const char *, int, int);
   1.151 ++
   1.152 ++
   1.153 ++#define EPOCH		1970
   1.154 ++#define HOUR(x)		((time_t)(x) * 60)
   1.155 ++#define SECSPERDAY	(24L * 60L * 60L)
   1.156 ++
   1.157 ++
   1.158 ++/*
   1.159 ++**  An entry in the lexical lookup table.
   1.160 ++*/
   1.161 ++typedef struct _TABLE {
   1.162 ++    char	*name;
   1.163 ++    int		type;
   1.164 ++    time_t	value;
   1.165 ++} TABLE;
   1.166 ++
   1.167 ++
   1.168 ++/*
   1.169 ++**  Daylight-savings mode:  on, off, or not yet known.
   1.170 ++*/
   1.171 ++typedef enum _DSTMODE {
   1.172 ++    DSTon, DSToff, DSTmaybe
   1.173 ++} DSTMODE;
   1.174 ++
   1.175 ++/*
   1.176 ++**  Meridian:  am, pm, or 24-hour style.
   1.177 ++*/
   1.178 ++typedef enum _MERIDIAN {
   1.179 ++    MERam, MERpm, MER24
   1.180 ++} MERIDIAN;
   1.181 ++
   1.182 ++
   1.183 ++/*
   1.184 ++**  Global variables.  We could get rid of most of these by using a good
   1.185 ++**  union as the yacc stack.  (This routine was originally written before
   1.186 ++**  yacc had the %union construct.)  Maybe someday; right now we only use
   1.187 ++**  the %union very rarely.
   1.188 ++*/
   1.189 ++struct Variables {
   1.190 ++    void	*yyInput;
   1.191 ++    DSTMODE	yyDSTmode;
   1.192 ++    time_t	yyDayOrdinal;
   1.193 ++    time_t	yyDayNumber;
   1.194 ++    int	yyHaveDate;
   1.195 ++    int	yyHaveDay;
   1.196 ++    int	yyHaveRel;
   1.197 ++    int	yyHaveTime;
   1.198 ++    int	yyHaveZone;
   1.199 ++    time_t	yyTimezone;
   1.200 ++    time_t	yyDay;
   1.201 ++    time_t	yyHour;
   1.202 ++    time_t	yyMinutes;
   1.203 ++    time_t	yyMonth;
   1.204 ++    time_t	yySeconds;
   1.205 ++    time_t	yyYear;
   1.206 ++    MERIDIAN	yyMeridian;
   1.207 ++    time_t	yyRelMonth;
   1.208 ++    time_t	yyRelSeconds;
   1.209 ++};
   1.210 ++
   1.211 ++#define VARIABLE ((struct Variables*)parseParam)
   1.212 ++
   1.213 ++
   1.214 ++#define YYPURE		1
   1.215 ++#define YYLEX_PARAM	VARIABLE
   1.216 ++#define YYPARSE_PARAM	parseParam
   1.217 ++
   1.218 ++#define yyparse		PTime_yyparse
   1.219 ++#define yylex		PTime_yylex
   1.220 ++#define yyerror		PTime_yyerror
   1.221 ++
   1.222 ++#define GCC_VERSION (__GNUC__ * 10000 \
   1.223 ++                    + __GNUC_MINOR__ * 100 \
   1.224 ++                    + __GNUC_PATCHLEVEL__)
   1.225 ++
   1.226 ++static int yyparse(void *); 
   1.227 ++static int yylex();
   1.228 ++
   1.229 ++#ifdef __GNUC__
   1.230 ++static int yyerror(char const *msg);
   1.231 ++#else
   1.232 ++static void yyerror(char const *msg);
   1.233 ++#endif
   1.234 ++
   1.235 ++
   1.236 ++static void SetPossibleDate(struct Variables*, time_t, time_t, time_t);
   1.237 ++
   1.238 ++
   1.239 ++
   1.240 ++/* Line 371 of yacc.c  */
   1.241 ++#line 202 "ptlib/common/getdate.tab.c"
   1.242 ++
   1.243 ++# ifndef YY_NULL
   1.244 ++#  if defined __cplusplus && 201103L <= __cplusplus
   1.245 ++#   define YY_NULL nullptr
   1.246 ++#  else
   1.247 ++#   define YY_NULL 0
   1.248 ++#  endif
   1.249 ++# endif
   1.250 ++
   1.251 ++/* Enabling verbose error messages.  */
   1.252 ++#ifdef YYERROR_VERBOSE
   1.253 ++# undef YYERROR_VERBOSE
   1.254 ++# define YYERROR_VERBOSE 1
   1.255 ++#else
   1.256 ++# define YYERROR_VERBOSE 0
   1.257 ++#endif
   1.258 ++
   1.259 ++
   1.260 ++/* Enabling traces.  */
   1.261 ++#ifndef YYDEBUG
   1.262 ++# define YYDEBUG 0
   1.263 ++#endif
   1.264 ++#if YYDEBUG
   1.265 ++extern int yydebug;
   1.266 ++#endif
   1.267 ++
   1.268 ++/* Tokens.  */
   1.269 ++#ifndef YYTOKENTYPE
   1.270 ++# define YYTOKENTYPE
   1.271 ++   /* Put the tokens into the symbol table, so that GDB and other debuggers
   1.272 ++      know about them.  */
   1.273 ++   enum yytokentype {
   1.274 ++     tAGO = 258,
   1.275 ++     tDAY = 259,
   1.276 ++     tDAYZONE = 260,
   1.277 ++     tID = 261,
   1.278 ++     tMERIDIAN = 262,
   1.279 ++     tMINUTE_UNIT = 263,
   1.280 ++     tMONTH = 264,
   1.281 ++     tMONTH_UNIT = 265,
   1.282 ++     tSNUMBER = 266,
   1.283 ++     tS4DIGITNUMBER = 267,
   1.284 ++     tUNUMBER = 268,
   1.285 ++     t4DIGITNUMBER = 269,
   1.286 ++     t6DIGITNUMBER = 270,
   1.287 ++     t8DIGITNUMBER = 271,
   1.288 ++     tSEC_UNIT = 272,
   1.289 ++     tZONE = 273,
   1.290 ++     tMILZONE = 274,
   1.291 ++     tRFC3339 = 275,
   1.292 ++     tDST = 276
   1.293 ++   };
   1.294 ++#endif
   1.295 ++
   1.296 ++
   1.297 ++#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
   1.298 ++typedef union YYSTYPE
   1.299 ++{
   1.300 ++/* Line 387 of yacc.c  */
   1.301 ++#line 137 "ptlib/common/getdate.y"
   1.302 ++
   1.303 ++    time_t		Number;
   1.304 ++    enum _MERIDIAN	Meridian;
   1.305 ++
   1.306 ++
   1.307 ++/* Line 387 of yacc.c  */
   1.308 ++#line 269 "ptlib/common/getdate.tab.c"
   1.309 ++} YYSTYPE;
   1.310 ++# define YYSTYPE_IS_TRIVIAL 1
   1.311 ++# define yystype YYSTYPE /* obsolescent; will be withdrawn */
   1.312 ++# define YYSTYPE_IS_DECLARED 1
   1.313 ++#endif
   1.314 ++
   1.315 ++
   1.316 ++#ifdef YYPARSE_PARAM
   1.317 ++#if defined __STDC__ || defined __cplusplus
   1.318 ++int yyparse (void *YYPARSE_PARAM);
   1.319 ++#else
   1.320 ++int yyparse ();
   1.321 ++#endif
   1.322 ++#else /* ! YYPARSE_PARAM */
   1.323 ++#if defined __STDC__ || defined __cplusplus
   1.324 ++int yyparse (void);
   1.325 ++#else
   1.326 ++int yyparse ();
   1.327 ++#endif
   1.328 ++#endif /* ! YYPARSE_PARAM */
   1.329 ++
   1.330 ++
   1.331 ++
   1.332 ++/* Copy the second part of user declarations.  */
   1.333 ++
   1.334 ++/* Line 390 of yacc.c  */
   1.335 ++#line 296 "ptlib/common/getdate.tab.c"
   1.336 ++
   1.337 ++#ifdef short
   1.338 ++# undef short
   1.339 ++#endif
   1.340 ++
   1.341 ++#ifdef YYTYPE_UINT8
   1.342 ++typedef YYTYPE_UINT8 yytype_uint8;
   1.343 ++#else
   1.344 ++typedef unsigned char yytype_uint8;
   1.345 ++#endif
   1.346 ++
   1.347 ++#ifdef YYTYPE_INT8
   1.348 ++typedef YYTYPE_INT8 yytype_int8;
   1.349 ++#elif (defined __STDC__ || defined __C99__FUNC__ \
   1.350 ++     || defined __cplusplus || defined _MSC_VER)
   1.351 ++typedef signed char yytype_int8;
   1.352 ++#else
   1.353 ++typedef short int yytype_int8;
   1.354 ++#endif
   1.355 ++
   1.356 ++#ifdef YYTYPE_UINT16
   1.357 ++typedef YYTYPE_UINT16 yytype_uint16;
   1.358 ++#else
   1.359 ++typedef unsigned short int yytype_uint16;
   1.360 ++#endif
   1.361 ++
   1.362 ++#ifdef YYTYPE_INT16
   1.363 ++typedef YYTYPE_INT16 yytype_int16;
   1.364 ++#else
   1.365 ++typedef short int yytype_int16;
   1.366 ++#endif
   1.367 ++
   1.368 ++#ifndef YYSIZE_T
   1.369 ++# ifdef __SIZE_TYPE__
   1.370 ++#  define YYSIZE_T __SIZE_TYPE__
   1.371 ++# elif defined size_t
   1.372 ++#  define YYSIZE_T size_t
   1.373 ++# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
   1.374 ++     || defined __cplusplus || defined _MSC_VER)
   1.375 ++#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
   1.376 ++#  define YYSIZE_T size_t
   1.377 ++# else
   1.378 ++#  define YYSIZE_T unsigned int
   1.379 ++# endif
   1.380 ++#endif
   1.381 ++
   1.382 ++#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
   1.383 ++
   1.384 ++#ifndef YY_
   1.385 ++# if defined YYENABLE_NLS && YYENABLE_NLS
   1.386 ++#  if ENABLE_NLS
   1.387 ++#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
   1.388 ++#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
   1.389 ++#  endif
   1.390 ++# endif
   1.391 ++# ifndef YY_
   1.392 ++#  define YY_(Msgid) Msgid
   1.393 ++# endif
   1.394 ++#endif
   1.395 ++
   1.396 ++#ifndef __attribute__
   1.397 ++/* This feature is available in gcc versions 2.5 and later.  */
   1.398 ++# if (! defined __GNUC__ || __GNUC__ < 2 \
   1.399 ++      || (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
   1.400 ++#  define __attribute__(Spec) /* empty */
   1.401 ++# endif
   1.402 ++#endif
   1.403 ++
   1.404 ++/* Suppress unused-variable warnings by "using" E.  */
   1.405 ++#if ! defined lint || defined __GNUC__
   1.406 ++# define YYUSE(E) ((void) (E))
   1.407 ++#else
   1.408 ++# define YYUSE(E) /* empty */
   1.409 ++#endif
   1.410 ++
   1.411 ++
   1.412 ++/* Identity function, used to suppress warnings about constant conditions.  */
   1.413 ++#ifndef lint
   1.414 ++# define YYID(N) (N)
   1.415 ++#else
   1.416 ++#if (defined __STDC__ || defined __C99__FUNC__ \
   1.417 ++     || defined __cplusplus || defined _MSC_VER)
   1.418 ++static int
   1.419 ++YYID (int yyi)
   1.420 ++#else
   1.421 ++static int
   1.422 ++YYID (yyi)
   1.423 ++    int yyi;
   1.424 ++#endif
   1.425 ++{
   1.426 ++  return yyi;
   1.427 ++}
   1.428 ++#endif
   1.429 ++
   1.430 ++#if ! defined yyoverflow || YYERROR_VERBOSE
   1.431 ++
   1.432 ++/* The parser invokes alloca or malloc; define the necessary symbols.  */
   1.433 ++
   1.434 ++# ifdef YYSTACK_USE_ALLOCA
   1.435 ++#  if YYSTACK_USE_ALLOCA
   1.436 ++#   ifdef __GNUC__
   1.437 ++#    define YYSTACK_ALLOC __builtin_alloca
   1.438 ++#   elif defined __BUILTIN_VA_ARG_INCR
   1.439 ++#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
   1.440 ++#   elif defined _AIX
   1.441 ++#    define YYSTACK_ALLOC __alloca
   1.442 ++#   elif defined _MSC_VER
   1.443 ++#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
   1.444 ++#    define alloca _alloca
   1.445 ++#   else
   1.446 ++#    define YYSTACK_ALLOC alloca
   1.447 ++#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
   1.448 ++     || defined __cplusplus || defined _MSC_VER)
   1.449 ++#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
   1.450 ++      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
   1.451 ++#     ifndef EXIT_SUCCESS
   1.452 ++#      define EXIT_SUCCESS 0
   1.453 ++#     endif
   1.454 ++#    endif
   1.455 ++#   endif
   1.456 ++#  endif
   1.457 ++# endif
   1.458 ++
   1.459 ++# ifdef YYSTACK_ALLOC
   1.460 ++   /* Pacify GCC's `empty if-body' warning.  */
   1.461 ++#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
   1.462 ++#  ifndef YYSTACK_ALLOC_MAXIMUM
   1.463 ++    /* The OS might guarantee only one guard page at the bottom of the stack,
   1.464 ++       and a page size can be as small as 4096 bytes.  So we cannot safely
   1.465 ++       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
   1.466 ++       to allow for a few compiler-allocated temporary stack slots.  */
   1.467 ++#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
   1.468 ++#  endif
   1.469 ++# else
   1.470 ++#  define YYSTACK_ALLOC YYMALLOC
   1.471 ++#  define YYSTACK_FREE YYFREE
   1.472 ++#  ifndef YYSTACK_ALLOC_MAXIMUM
   1.473 ++#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
   1.474 ++#  endif
   1.475 ++#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
   1.476 ++       && ! ((defined YYMALLOC || defined malloc) \
   1.477 ++	     && (defined YYFREE || defined free)))
   1.478 ++#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
   1.479 ++#   ifndef EXIT_SUCCESS
   1.480 ++#    define EXIT_SUCCESS 0
   1.481 ++#   endif
   1.482 ++#  endif
   1.483 ++#  ifndef YYMALLOC
   1.484 ++#   define YYMALLOC malloc
   1.485 ++#   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
   1.486 ++     || defined __cplusplus || defined _MSC_VER)
   1.487 ++void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
   1.488 ++#   endif
   1.489 ++#  endif
   1.490 ++#  ifndef YYFREE
   1.491 ++#   define YYFREE free
   1.492 ++#   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
   1.493 ++     || defined __cplusplus || defined _MSC_VER)
   1.494 ++void free (void *); /* INFRINGES ON USER NAME SPACE */
   1.495 ++#   endif
   1.496 ++#  endif
   1.497 ++# endif
   1.498 ++#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
   1.499 ++
   1.500 ++
   1.501 ++#if (! defined yyoverflow \
   1.502 ++     && (! defined __cplusplus \
   1.503 ++	 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
   1.504 ++
   1.505 ++/* A type that is properly aligned for any stack member.  */
   1.506 ++union yyalloc
   1.507 ++{
   1.508 ++  yytype_int16 yyss_alloc;
   1.509 ++  YYSTYPE yyvs_alloc;
   1.510 ++};
   1.511 ++
   1.512 ++/* The size of the maximum gap between one aligned stack and the next.  */
   1.513 ++# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
   1.514 ++
   1.515 ++/* The size of an array large to enough to hold all stacks, each with
   1.516 ++   N elements.  */
   1.517 ++# define YYSTACK_BYTES(N) \
   1.518 ++     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
   1.519 ++      + YYSTACK_GAP_MAXIMUM)
   1.520 ++
   1.521 ++# define YYCOPY_NEEDED 1
   1.522 ++
   1.523 ++/* Relocate STACK from its old location to the new one.  The
   1.524 ++   local variables YYSIZE and YYSTACKSIZE give the old and new number of
   1.525 ++   elements in the stack, and YYPTR gives the new location of the
   1.526 ++   stack.  Advance YYPTR to a properly aligned location for the next
   1.527 ++   stack.  */
   1.528 ++# define YYSTACK_RELOCATE(Stack_alloc, Stack)				\
   1.529 ++    do									\
   1.530 ++      {									\
   1.531 ++	YYSIZE_T yynewbytes;						\
   1.532 ++	YYCOPY (&yyptr->Stack_alloc, Stack, yysize);			\
   1.533 ++	Stack = &yyptr->Stack_alloc;					\
   1.534 ++	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
   1.535 ++	yyptr += yynewbytes / sizeof (*yyptr);				\
   1.536 ++      }									\
   1.537 ++    while (YYID (0))
   1.538 ++
   1.539 ++#endif
   1.540 ++
   1.541 ++#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
   1.542 ++/* Copy COUNT objects from SRC to DST.  The source and destination do
   1.543 ++   not overlap.  */
   1.544 ++# ifndef YYCOPY
   1.545 ++#  if defined __GNUC__ && 1 < __GNUC__
   1.546 ++#   define YYCOPY(Dst, Src, Count) \
   1.547 ++      __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
   1.548 ++#  else
   1.549 ++#   define YYCOPY(Dst, Src, Count)              \
   1.550 ++      do                                        \
   1.551 ++        {                                       \
   1.552 ++          YYSIZE_T yyi;                         \
   1.553 ++          for (yyi = 0; yyi < (Count); yyi++)   \
   1.554 ++            (Dst)[yyi] = (Src)[yyi];            \
   1.555 ++        }                                       \
   1.556 ++      while (YYID (0))
   1.557 ++#  endif
   1.558 ++# endif
   1.559 ++#endif /* !YYCOPY_NEEDED */
   1.560 ++
   1.561 ++/* YYFINAL -- State number of the termination state.  */
   1.562 ++#define YYFINAL  2
   1.563 ++/* YYLAST -- Last index in YYTABLE.  */
   1.564 ++#define YYLAST   105
   1.565 ++
   1.566 ++/* YYNTOKENS -- Number of terminals.  */
   1.567 ++#define YYNTOKENS  25
   1.568 ++/* YYNNTS -- Number of nonterminals.  */
   1.569 ++#define YYNNTS  12
   1.570 ++/* YYNRULES -- Number of rules.  */
   1.571 ++#define YYNRULES  51
   1.572 ++/* YYNRULES -- Number of states.  */
   1.573 ++#define YYNSTATES  63
   1.574 ++
   1.575 ++/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
   1.576 ++#define YYUNDEFTOK  2
   1.577 ++#define YYMAXUTOK   276
   1.578 ++
   1.579 ++#define YYTRANSLATE(YYX)						\
   1.580 ++  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
   1.581 ++
   1.582 ++/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
   1.583 ++static const yytype_uint8 yytranslate[] =
   1.584 ++{
   1.585 ++       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   1.586 ++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   1.587 ++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   1.588 ++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   1.589 ++       2,     2,     2,     2,    23,     2,     2,    24,     2,     2,
   1.590 ++       2,     2,     2,     2,     2,     2,     2,     2,    22,     2,
   1.591 ++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   1.592 ++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   1.593 ++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   1.594 ++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   1.595 ++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   1.596 ++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   1.597 ++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   1.598 ++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   1.599 ++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   1.600 ++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   1.601 ++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   1.602 ++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   1.603 ++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   1.604 ++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   1.605 ++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   1.606 ++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   1.607 ++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   1.608 ++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   1.609 ++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
   1.610 ++       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
   1.611 ++       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
   1.612 ++      15,    16,    17,    18,    19,    20,    21
   1.613 ++};
   1.614 ++
   1.615 ++#if YYDEBUG
   1.616 ++/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
   1.617 ++   YYRHS.  */
   1.618 ++static const yytype_uint8 yyprhs[] =
   1.619 ++{
   1.620 ++       0,     0,     3,     4,     7,     9,    11,    13,    15,    17,
   1.621 ++      19,    22,    25,    28,    33,    38,    45,    52,    54,    56,
   1.622 ++      59,    61,    63,    66,    69,    73,    79,    84,    86,    90,
   1.623 ++      93,    98,   101,   105,   108,   110,   113,   116,   118,   121,
   1.624 ++     124,   126,   129,   132,   134,   136,   138,   140,   142,   144,
   1.625 ++     146,   147
   1.626 ++};
   1.627 ++
   1.628 ++/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
   1.629 ++static const yytype_int8 yyrhs[] =
   1.630 ++{
   1.631 ++      26,     0,    -1,    -1,    26,    27,    -1,    28,    -1,    29,
   1.632 ++      -1,    31,    -1,    30,    -1,    32,    -1,    35,    -1,    13,
   1.633 ++       7,    -1,    14,    12,    -1,    15,    12,    -1,    34,    22,
   1.634 ++      34,    36,    -1,    34,    22,    34,    12,    -1,    34,    22,
   1.635 ++      34,    22,    34,    36,    -1,    34,    22,    34,    22,    34,
   1.636 ++      12,    -1,    18,    -1,     5,    -1,    18,    21,    -1,    19,
   1.637 ++      -1,     4,    -1,     4,    23,    -1,    34,     4,    -1,    34,
   1.638 ++      24,    34,    -1,    34,    24,    34,    24,    34,    -1,    34,
   1.639 ++      11,    11,    20,    -1,    16,    -1,    34,     9,    11,    -1,
   1.640 ++       9,    34,    -1,     9,    34,    23,    34,    -1,    34,     9,
   1.641 ++      -1,    34,     9,    34,    -1,    33,     3,    -1,    33,    -1,
   1.642 ++      34,     8,    -1,    11,     8,    -1,     8,    -1,    11,    17,
   1.643 ++      -1,    34,    17,    -1,    17,    -1,    11,    10,    -1,    34,
   1.644 ++      10,    -1,    10,    -1,    13,    -1,    14,    -1,    15,    -1,
   1.645 ++      13,    -1,    14,    -1,    15,    -1,    -1,     7,    -1
   1.646 ++};
   1.647 ++
   1.648 ++/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
   1.649 ++static const yytype_uint16 yyrline[] =
   1.650 ++{
   1.651 ++       0,   153,   153,   154,   157,   160,   163,   166,   169,   172,
   1.652 ++     175,   181,   189,   197,   203,   210,   216,   226,   230,   235,
   1.653 ++     239,   249,   253,   257,   263,   266,   269,   273,   278,   282,
   1.654 ++     289,   294,   301,   306,   310,   313,   316,   319,   322,   325,
   1.655 ++     328,   331,   334,   337,   342,   345,   348,   353,   379,   390,
   1.656 ++     407,   410
   1.657 ++};
   1.658 ++#endif
   1.659 ++
   1.660 ++#if YYDEBUG || YYERROR_VERBOSE || 0
   1.661 ++/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
   1.662 ++   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
   1.663 ++static const char *const yytname[] =
   1.664 ++{
   1.665 ++  "$end", "error", "$undefined", "tAGO", "tDAY", "tDAYZONE", "tID",
   1.666 ++  "tMERIDIAN", "tMINUTE_UNIT", "tMONTH", "tMONTH_UNIT", "tSNUMBER",
   1.667 ++  "tS4DIGITNUMBER", "tUNUMBER", "t4DIGITNUMBER", "t6DIGITNUMBER",
   1.668 ++  "t8DIGITNUMBER", "tSEC_UNIT", "tZONE", "tMILZONE", "tRFC3339", "tDST",
   1.669 ++  "':'", "','", "'/'", "$accept", "spec", "item", "time", "zone", "day",
   1.670 ++  "date", "rel", "relunit", "unumber", "number", "o_merid", YY_NULL
   1.671 ++};
   1.672 ++#endif
   1.673 ++
   1.674 ++# ifdef YYPRINT
   1.675 ++/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
   1.676 ++   token YYLEX-NUM.  */
   1.677 ++static const yytype_uint16 yytoknum[] =
   1.678 ++{
   1.679 ++       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
   1.680 ++     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
   1.681 ++     275,   276,    58,    44,    47
   1.682 ++};
   1.683 ++# endif
   1.684 ++
   1.685 ++/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
   1.686 ++static const yytype_uint8 yyr1[] =
   1.687 ++{
   1.688 ++       0,    25,    26,    26,    27,    27,    27,    27,    27,    27,
   1.689 ++      28,    28,    28,    28,    28,    28,    28,    29,    29,    29,
   1.690 ++      29,    30,    30,    30,    31,    31,    31,    31,    31,    31,
   1.691 ++      31,    31,    31,    32,    32,    33,    33,    33,    33,    33,
   1.692 ++      33,    33,    33,    33,    34,    34,    34,    35,    35,    35,
   1.693 ++      36,    36
   1.694 ++};
   1.695 ++
   1.696 ++/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
   1.697 ++static const yytype_uint8 yyr2[] =
   1.698 ++{
   1.699 ++       0,     2,     0,     2,     1,     1,     1,     1,     1,     1,
   1.700 ++       2,     2,     2,     4,     4,     6,     6,     1,     1,     2,
   1.701 ++       1,     1,     2,     2,     3,     5,     4,     1,     3,     2,
   1.702 ++       4,     2,     3,     2,     1,     2,     2,     1,     2,     2,
   1.703 ++       1,     2,     2,     1,     1,     1,     1,     1,     1,     1,
   1.704 ++       0,     1
   1.705 ++};
   1.706 ++
   1.707 ++/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
   1.708 ++   Performed when YYTABLE doesn't specify something else to do.  Zero
   1.709 ++   means the default is an error.  */
   1.710 ++static const yytype_uint8 yydefact[] =
   1.711 ++{
   1.712 ++       2,     0,     1,    21,    18,    37,     0,    43,     0,    44,
   1.713 ++      45,    46,    27,    40,    17,    20,     3,     4,     5,     7,
   1.714 ++       6,     8,    34,     0,     9,    22,    44,    45,    46,    29,
   1.715 ++      36,    41,    38,    10,    11,    12,    19,    33,    23,    35,
   1.716 ++      31,    42,     0,    39,     0,     0,     0,    28,    32,     0,
   1.717 ++      50,    24,    30,    26,    51,    14,     0,    13,     0,    50,
   1.718 ++      25,    16,    15
   1.719 ++};
   1.720 ++
   1.721 ++/* YYDEFGOTO[NTERM-NUM].  */
   1.722 ++static const yytype_int8 yydefgoto[] =
   1.723 ++{
   1.724 ++      -1,     1,    16,    17,    18,    19,    20,    21,    22,    23,
   1.725 ++      24,    57
   1.726 ++};
   1.727 ++
   1.728 ++/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
   1.729 ++   STATE-NUM.  */
   1.730 ++#define YYPACT_NINF -27
   1.731 ++static const yytype_int8 yypact[] =
   1.732 ++{
   1.733 ++     -27,    49,   -27,   -10,   -27,   -27,   -11,   -27,     1,    10,
   1.734 ++      69,    86,   -27,   -27,    -9,   -27,   -27,   -27,   -27,   -27,
   1.735 ++     -27,   -27,    13,    -3,   -27,   -27,   -27,   -27,   -27,     8,
   1.736 ++     -27,   -27,   -27,   -27,   -27,   -27,   -27,   -27,   -27,   -27,
   1.737 ++      30,   -27,     9,   -27,   -11,   -11,   -11,   -27,   -27,    12,
   1.738 ++      15,    18,   -27,   -27,   -27,   -27,   -11,   -27,   -11,    23,
   1.739 ++     -27,   -27,   -27
   1.740 ++};
   1.741 ++
   1.742 ++/* YYPGOTO[NTERM-NUM].  */
   1.743 ++static const yytype_int8 yypgoto[] =
   1.744 ++{
   1.745 ++     -27,   -27,   -27,   -27,   -27,   -27,   -27,   -27,   -27,    -6,
   1.746 ++     -27,   -26
   1.747 ++};
   1.748 ++
   1.749 ++/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
   1.750 ++   positive, shift that token.  If negative, reduce the rule which
   1.751 ++   number is the opposite.  If YYTABLE_NINF, syntax error.  */
   1.752 ++#define YYTABLE_NINF -50
   1.753 ++static const yytype_int8 yytable[] =
   1.754 ++{
   1.755 ++      29,    38,    26,    27,    28,    39,    40,    41,    42,    30,
   1.756 ++     -47,    31,    36,    25,    43,   -47,    37,    33,    32,    44,
   1.757 ++      49,    45,    54,   -47,   -47,   -47,   -47,    55,   -47,   -47,
   1.758 ++      54,    46,    53,    62,    48,    61,     0,    56,    50,    51,
   1.759 ++      52,    47,    58,    26,    27,    28,     0,     0,     0,     2,
   1.760 ++      59,     0,    60,     3,     4,     0,     0,     5,     6,     7,
   1.761 ++       8,     0,     9,    10,    11,    12,    13,    14,    15,   -48,
   1.762 ++       0,     0,     0,     0,   -48,     0,     0,     0,     0,     0,
   1.763 ++       0,    34,   -48,   -48,   -48,   -48,   -49,   -48,   -48,     0,
   1.764 ++       0,   -49,     0,     0,     0,     0,     0,     0,    35,   -49,
   1.765 ++     -49,   -49,   -49,     0,   -49,   -49
   1.766 ++};
   1.767 ++
   1.768 ++#define yypact_value_is_default(Yystate) \
   1.769 ++  (!!((Yystate) == (-27)))
   1.770 ++
   1.771 ++#define yytable_value_is_error(Yytable_value) \
   1.772 ++  YYID (0)
   1.773 ++
   1.774 ++static const yytype_int8 yycheck[] =
   1.775 ++{
   1.776 ++       6,     4,    13,    14,    15,     8,     9,    10,    11,     8,
   1.777 ++       0,    10,    21,    23,    17,     5,     3,     7,    17,    22,
   1.778 ++      11,    24,     7,    13,    14,    15,    16,    12,    18,    19,
   1.779 ++       7,    23,    20,    59,    40,    12,    -1,    22,    44,    45,
   1.780 ++      46,    11,    24,    13,    14,    15,    -1,    -1,    -1,     0,
   1.781 ++      56,    -1,    58,     4,     5,    -1,    -1,     8,     9,    10,
   1.782 ++      11,    -1,    13,    14,    15,    16,    17,    18,    19,     0,
   1.783 ++      -1,    -1,    -1,    -1,     5,    -1,    -1,    -1,    -1,    -1,
   1.784 ++      -1,    12,    13,    14,    15,    16,     0,    18,    19,    -1,
   1.785 ++      -1,     5,    -1,    -1,    -1,    -1,    -1,    -1,    12,    13,
   1.786 ++      14,    15,    16,    -1,    18,    19
   1.787 ++};
   1.788 ++
   1.789 ++/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
   1.790 ++   symbol of state STATE-NUM.  */
   1.791 ++static const yytype_uint8 yystos[] =
   1.792 ++{
   1.793 ++       0,    26,     0,     4,     5,     8,     9,    10,    11,    13,
   1.794 ++      14,    15,    16,    17,    18,    19,    27,    28,    29,    30,
   1.795 ++      31,    32,    33,    34,    35,    23,    13,    14,    15,    34,
   1.796 ++       8,    10,    17,     7,    12,    12,    21,     3,     4,     8,
   1.797 ++       9,    10,    11,    17,    22,    24,    23,    11,    34,    11,
   1.798 ++      34,    34,    34,    20,     7,    12,    22,    36,    24,    34,
   1.799 ++      34,    12,    36
   1.800 ++};
   1.801 ++
   1.802 ++#define yyerrok		(yyerrstatus = 0)
   1.803 ++#define yyclearin	(yychar = YYEMPTY)
   1.804 ++#define YYEMPTY		(-2)
   1.805 ++#define YYEOF		0
   1.806 ++
   1.807 ++#define YYACCEPT	goto yyacceptlab
   1.808 ++#define YYABORT		goto yyabortlab
   1.809 ++#define YYERROR		goto yyerrorlab
   1.810 ++
   1.811 ++
   1.812 ++/* Like YYERROR except do call yyerror.  This remains here temporarily
   1.813 ++   to ease the transition to the new meaning of YYERROR, for GCC.
   1.814 ++   Once GCC version 2 has supplanted version 1, this can go.  However,
   1.815 ++   YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
   1.816 ++   in Bison 2.4.2's NEWS entry, where a plan to phase it out is
   1.817 ++   discussed.  */
   1.818 ++
   1.819 ++#define YYFAIL		goto yyerrlab
   1.820 ++#if defined YYFAIL
   1.821 ++  /* This is here to suppress warnings from the GCC cpp's
   1.822 ++     -Wunused-macros.  Normally we don't worry about that warning, but
   1.823 ++     some users do, and we want to make it easy for users to remove
   1.824 ++     YYFAIL uses, which will produce warnings from Bison 2.5.  */
   1.825 ++#endif
   1.826 ++
   1.827 ++#define YYRECOVERING()  (!!yyerrstatus)
   1.828 ++
   1.829 ++#define YYBACKUP(Token, Value)                                  \
   1.830 ++do                                                              \
   1.831 ++  if (yychar == YYEMPTY)                                        \
   1.832 ++    {                                                           \
   1.833 ++      yychar = (Token);                                         \
   1.834 ++      yylval = (Value);                                         \
   1.835 ++      YYPOPSTACK (yylen);                                       \
   1.836 ++      yystate = *yyssp;                                         \
   1.837 ++      goto yybackup;                                            \
   1.838 ++    }                                                           \
   1.839 ++  else                                                          \
   1.840 ++    {                                                           \
   1.841 ++      yyerror (YY_("syntax error: cannot back up")); \
   1.842 ++      YYERROR;							\
   1.843 ++    }								\
   1.844 ++while (YYID (0))
   1.845 ++
   1.846 ++/* Error token number */
   1.847 ++#define YYTERROR	1
   1.848 ++#define YYERRCODE	256
   1.849 ++
   1.850 ++
   1.851 ++/* This macro is provided for backward compatibility. */
   1.852 ++#ifndef YY_LOCATION_PRINT
   1.853 ++# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
   1.854 ++#endif
   1.855 ++
   1.856 ++
   1.857 ++/* YYLEX -- calling `yylex' with the right arguments.  */
   1.858 ++#ifdef YYLEX_PARAM
   1.859 ++# define YYLEX yylex (&yylval, YYLEX_PARAM)
   1.860 ++#else
   1.861 ++# define YYLEX yylex (&yylval)
   1.862 ++#endif
   1.863 ++
   1.864 ++/* Enable debugging if requested.  */
   1.865 ++#if YYDEBUG
   1.866 ++
   1.867 ++# ifndef YYFPRINTF
   1.868 ++#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
   1.869 ++#  define YYFPRINTF fprintf
   1.870 ++# endif
   1.871 ++
   1.872 ++# define YYDPRINTF(Args)			\
   1.873 ++do {						\
   1.874 ++  if (yydebug)					\
   1.875 ++    YYFPRINTF Args;				\
   1.876 ++} while (YYID (0))
   1.877 ++
   1.878 ++# define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
   1.879 ++do {									  \
   1.880 ++  if (yydebug)								  \
   1.881 ++    {									  \
   1.882 ++      YYFPRINTF (stderr, "%s ", Title);					  \
   1.883 ++      yy_symbol_print (stderr,						  \
   1.884 ++		  Type, Value); \
   1.885 ++      YYFPRINTF (stderr, "\n");						  \
   1.886 ++    }									  \
   1.887 ++} while (YYID (0))
   1.888 ++
   1.889 ++
   1.890 ++/*--------------------------------.
   1.891 ++| Print this symbol on YYOUTPUT.  |
   1.892 ++`--------------------------------*/
   1.893 ++
   1.894 ++/*ARGSUSED*/
   1.895 ++#if (defined __STDC__ || defined __C99__FUNC__ \
   1.896 ++     || defined __cplusplus || defined _MSC_VER)
   1.897 ++static void
   1.898 ++yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
   1.899 ++#else
   1.900 ++static void
   1.901 ++yy_symbol_value_print (yyoutput, yytype, yyvaluep)
   1.902 ++    FILE *yyoutput;
   1.903 ++    int yytype;
   1.904 ++    YYSTYPE const * const yyvaluep;
   1.905 ++#endif
   1.906 ++{
   1.907 ++  FILE *yyo = yyoutput;
   1.908 ++  YYUSE (yyo);
   1.909 ++  if (!yyvaluep)
   1.910 ++    return;
   1.911 ++# ifdef YYPRINT
   1.912 ++  if (yytype < YYNTOKENS)
   1.913 ++    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
   1.914 ++# else
   1.915 ++  YYUSE (yyoutput);
   1.916 ++# endif
   1.917 ++  YYUSE (yytype);
   1.918 ++}
   1.919 ++
   1.920 ++
   1.921 ++/*--------------------------------.
   1.922 ++| Print this symbol on YYOUTPUT.  |
   1.923 ++`--------------------------------*/
   1.924 ++
   1.925 ++#if (defined __STDC__ || defined __C99__FUNC__ \
   1.926 ++     || defined __cplusplus || defined _MSC_VER)
   1.927 ++static void
   1.928 ++yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
   1.929 ++#else
   1.930 ++static void
   1.931 ++yy_symbol_print (yyoutput, yytype, yyvaluep)
   1.932 ++    FILE *yyoutput;
   1.933 ++    int yytype;
   1.934 ++    YYSTYPE const * const yyvaluep;
   1.935 ++#endif
   1.936 ++{
   1.937 ++  if (yytype < YYNTOKENS)
   1.938 ++    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
   1.939 ++  else
   1.940 ++    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
   1.941 ++
   1.942 ++  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
   1.943 ++  YYFPRINTF (yyoutput, ")");
   1.944 ++}
   1.945 ++
   1.946 ++/*------------------------------------------------------------------.
   1.947 ++| yy_stack_print -- Print the state stack from its BOTTOM up to its |
   1.948 ++| TOP (included).                                                   |
   1.949 ++`------------------------------------------------------------------*/
   1.950 ++
   1.951 ++#if (defined __STDC__ || defined __C99__FUNC__ \
   1.952 ++     || defined __cplusplus || defined _MSC_VER)
   1.953 ++static void
   1.954 ++yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
   1.955 ++#else
   1.956 ++static void
   1.957 ++yy_stack_print (yybottom, yytop)
   1.958 ++    yytype_int16 *yybottom;
   1.959 ++    yytype_int16 *yytop;
   1.960 ++#endif
   1.961 ++{
   1.962 ++  YYFPRINTF (stderr, "Stack now");
   1.963 ++  for (; yybottom <= yytop; yybottom++)
   1.964 ++    {
   1.965 ++      int yybot = *yybottom;
   1.966 ++      YYFPRINTF (stderr, " %d", yybot);
   1.967 ++    }
   1.968 ++  YYFPRINTF (stderr, "\n");
   1.969 ++}
   1.970 ++
   1.971 ++# define YY_STACK_PRINT(Bottom, Top)				\
   1.972 ++do {								\
   1.973 ++  if (yydebug)							\
   1.974 ++    yy_stack_print ((Bottom), (Top));				\
   1.975 ++} while (YYID (0))
   1.976 ++
   1.977 ++
   1.978 ++/*------------------------------------------------.
   1.979 ++| Report that the YYRULE is going to be reduced.  |
   1.980 ++`------------------------------------------------*/
   1.981 ++
   1.982 ++#if (defined __STDC__ || defined __C99__FUNC__ \
   1.983 ++     || defined __cplusplus || defined _MSC_VER)
   1.984 ++static void
   1.985 ++yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
   1.986 ++#else
   1.987 ++static void
   1.988 ++yy_reduce_print (yyvsp, yyrule)
   1.989 ++    YYSTYPE *yyvsp;
   1.990 ++    int yyrule;
   1.991 ++#endif
   1.992 ++{
   1.993 ++  int yynrhs = yyr2[yyrule];
   1.994 ++  int yyi;
   1.995 ++  unsigned long int yylno = yyrline[yyrule];
   1.996 ++  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
   1.997 ++	     yyrule - 1, yylno);
   1.998 ++  /* The symbols being reduced.  */
   1.999 ++  for (yyi = 0; yyi < yynrhs; yyi++)
  1.1000 ++    {
  1.1001 ++      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
  1.1002 ++      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
  1.1003 ++		       &(yyvsp[(yyi + 1) - (yynrhs)])
  1.1004 ++		       		       );
  1.1005 ++      YYFPRINTF (stderr, "\n");
  1.1006 ++    }
  1.1007 ++}
  1.1008 ++
  1.1009 ++# define YY_REDUCE_PRINT(Rule)		\
  1.1010 ++do {					\
  1.1011 ++  if (yydebug)				\
  1.1012 ++    yy_reduce_print (yyvsp, Rule); \
  1.1013 ++} while (YYID (0))
  1.1014 ++
  1.1015 ++/* Nonzero means print parse trace.  It is left uninitialized so that
  1.1016 ++   multiple parsers can coexist.  */
  1.1017 ++int yydebug;
  1.1018 ++#else /* !YYDEBUG */
  1.1019 ++# define YYDPRINTF(Args)
  1.1020 ++# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
  1.1021 ++# define YY_STACK_PRINT(Bottom, Top)
  1.1022 ++# define YY_REDUCE_PRINT(Rule)
  1.1023 ++#endif /* !YYDEBUG */
  1.1024 ++
  1.1025 ++
  1.1026 ++/* YYINITDEPTH -- initial size of the parser's stacks.  */
  1.1027 ++#ifndef	YYINITDEPTH
  1.1028 ++# define YYINITDEPTH 200
  1.1029 ++#endif
  1.1030 ++
  1.1031 ++/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
  1.1032 ++   if the built-in stack extension method is used).
  1.1033 ++
  1.1034 ++   Do not make this value too large; the results are undefined if
  1.1035 ++   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
  1.1036 ++   evaluated with infinite-precision integer arithmetic.  */
  1.1037 ++
  1.1038 ++#ifndef YYMAXDEPTH
  1.1039 ++# define YYMAXDEPTH 10000
  1.1040 ++#endif
  1.1041 ++
  1.1042 ++
  1.1043 ++#if YYERROR_VERBOSE
  1.1044 ++
  1.1045 ++# ifndef yystrlen
  1.1046 ++#  if defined __GLIBC__ && defined _STRING_H
  1.1047 ++#   define yystrlen strlen
  1.1048 ++#  else
  1.1049 ++/* Return the length of YYSTR.  */
  1.1050 ++#if (defined __STDC__ || defined __C99__FUNC__ \
  1.1051 ++     || defined __cplusplus || defined _MSC_VER)
  1.1052 ++static YYSIZE_T
  1.1053 ++yystrlen (const char *yystr)
  1.1054 ++#else
  1.1055 ++static YYSIZE_T
  1.1056 ++yystrlen (yystr)
  1.1057 ++    const char *yystr;
  1.1058 ++#endif
  1.1059 ++{
  1.1060 ++  YYSIZE_T yylen;
  1.1061 ++  for (yylen = 0; yystr[yylen]; yylen++)
  1.1062 ++    continue;
  1.1063 ++  return yylen;
  1.1064 ++}
  1.1065 ++#  endif
  1.1066 ++# endif
  1.1067 ++
  1.1068 ++# ifndef yystpcpy
  1.1069 ++#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
  1.1070 ++#   define yystpcpy stpcpy
  1.1071 ++#  else
  1.1072 ++/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
  1.1073 ++   YYDEST.  */
  1.1074 ++#if (defined __STDC__ || defined __C99__FUNC__ \
  1.1075 ++     || defined __cplusplus || defined _MSC_VER)
  1.1076 ++static char *
  1.1077 ++yystpcpy (char *yydest, const char *yysrc)
  1.1078 ++#else
  1.1079 ++static char *
  1.1080 ++yystpcpy (yydest, yysrc)
  1.1081 ++    char *yydest;
  1.1082 ++    const char *yysrc;
  1.1083 ++#endif
  1.1084 ++{
  1.1085 ++  char *yyd = yydest;
  1.1086 ++  const char *yys = yysrc;
  1.1087 ++
  1.1088 ++  while ((*yyd++ = *yys++) != '\0')
  1.1089 ++    continue;
  1.1090 ++
  1.1091 ++  return yyd - 1;
  1.1092 ++}
  1.1093 ++#  endif
  1.1094 ++# endif
  1.1095 ++
  1.1096 ++# ifndef yytnamerr
  1.1097 ++/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
  1.1098 ++   quotes and backslashes, so that it's suitable for yyerror.  The
  1.1099 ++   heuristic is that double-quoting is unnecessary unless the string
  1.1100 ++   contains an apostrophe, a comma, or backslash (other than
  1.1101 ++   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
  1.1102 ++   null, do not copy; instead, return the length of what the result
  1.1103 ++   would have been.  */
  1.1104 ++static YYSIZE_T
  1.1105 ++yytnamerr (char *yyres, const char *yystr)
  1.1106 ++{
  1.1107 ++  if (*yystr == '"')
  1.1108 ++    {
  1.1109 ++      YYSIZE_T yyn = 0;
  1.1110 ++      char const *yyp = yystr;
  1.1111 ++
  1.1112 ++      for (;;)
  1.1113 ++	switch (*++yyp)
  1.1114 ++	  {
  1.1115 ++	  case '\'':
  1.1116 ++	  case ',':
  1.1117 ++	    goto do_not_strip_quotes;
  1.1118 ++
  1.1119 ++	  case '\\':
  1.1120 ++	    if (*++yyp != '\\')
  1.1121 ++	      goto do_not_strip_quotes;
  1.1122 ++	    /* Fall through.  */
  1.1123 ++	  default:
  1.1124 ++	    if (yyres)
  1.1125 ++	      yyres[yyn] = *yyp;
  1.1126 ++	    yyn++;
  1.1127 ++	    break;
  1.1128 ++
  1.1129 ++	  case '"':
  1.1130 ++	    if (yyres)
  1.1131 ++	      yyres[yyn] = '\0';
  1.1132 ++	    return yyn;
  1.1133 ++	  }
  1.1134 ++    do_not_strip_quotes: ;
  1.1135 ++    }
  1.1136 ++
  1.1137 ++  if (! yyres)
  1.1138 ++    return yystrlen (yystr);
  1.1139 ++
  1.1140 ++  return yystpcpy (yyres, yystr) - yyres;
  1.1141 ++}
  1.1142 ++# endif
  1.1143 ++
  1.1144 ++/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
  1.1145 ++   about the unexpected token YYTOKEN for the state stack whose top is
  1.1146 ++   YYSSP.
  1.1147 ++
  1.1148 ++   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
  1.1149 ++   not large enough to hold the message.  In that case, also set
  1.1150 ++   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
  1.1151 ++   required number of bytes is too large to store.  */
  1.1152 ++static int
  1.1153 ++yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
  1.1154 ++                yytype_int16 *yyssp, int yytoken)
  1.1155 ++{
  1.1156 ++  YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
  1.1157 ++  YYSIZE_T yysize = yysize0;
  1.1158 ++  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
  1.1159 ++  /* Internationalized format string. */
  1.1160 ++  const char *yyformat = YY_NULL;
  1.1161 ++  /* Arguments of yyformat. */
  1.1162 ++  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
  1.1163 ++  /* Number of reported tokens (one for the "unexpected", one per
  1.1164 ++     "expected"). */
  1.1165 ++  int yycount = 0;
  1.1166 ++
  1.1167 ++  /* There are many possibilities here to consider:
  1.1168 ++     - Assume YYFAIL is not used.  It's too flawed to consider.  See
  1.1169 ++       <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
  1.1170 ++       for details.  YYERROR is fine as it does not invoke this
  1.1171 ++       function.
  1.1172 ++     - If this state is a consistent state with a default action, then
  1.1173 ++       the only way this function was invoked is if the default action
  1.1174 ++       is an error action.  In that case, don't check for expected
  1.1175 ++       tokens because there are none.
  1.1176 ++     - The only way there can be no lookahead present (in yychar) is if
  1.1177 ++       this state is a consistent state with a default action.  Thus,
  1.1178 ++       detecting the absence of a lookahead is sufficient to determine
  1.1179 ++       that there is no unexpected or expected token to report.  In that
  1.1180 ++       case, just report a simple "syntax error".
  1.1181 ++     - Don't assume there isn't a lookahead just because this state is a
  1.1182 ++       consistent state with a default action.  There might have been a
  1.1183 ++       previous inconsistent state, consistent state with a non-default
  1.1184 ++       action, or user semantic action that manipulated yychar.
  1.1185 ++     - Of course, the expected token list depends on states to have
  1.1186 ++       correct lookahead information, and it depends on the parser not
  1.1187 ++       to perform extra reductions after fetching a lookahead from the
  1.1188 ++       scanner and before detecting a syntax error.  Thus, state merging
  1.1189 ++       (from LALR or IELR) and default reductions corrupt the expected
  1.1190 ++       token list.  However, the list is correct for canonical LR with
  1.1191 ++       one exception: it will still contain any token that will not be
  1.1192 ++       accepted due to an error action in a later state.
  1.1193 ++  */
  1.1194 ++  if (yytoken != YYEMPTY)
  1.1195 ++    {
  1.1196 ++      int yyn = yypact[*yyssp];
  1.1197 ++      yyarg[yycount++] = yytname[yytoken];
  1.1198 ++      if (!yypact_value_is_default (yyn))
  1.1199 ++        {
  1.1200 ++          /* Start YYX at -YYN if negative to avoid negative indexes in
  1.1201 ++             YYCHECK.  In other words, skip the first -YYN actions for
  1.1202 ++             this state because they are default actions.  */
  1.1203 ++          int yyxbegin = yyn < 0 ? -yyn : 0;
  1.1204 ++          /* Stay within bounds of both yycheck and yytname.  */
  1.1205 ++          int yychecklim = YYLAST - yyn + 1;
  1.1206 ++          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
  1.1207 ++          int yyx;
  1.1208 ++
  1.1209 ++          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
  1.1210 ++            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
  1.1211 ++                && !yytable_value_is_error (yytable[yyx + yyn]))
  1.1212 ++              {
  1.1213 ++                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
  1.1214 ++                  {
  1.1215 ++                    yycount = 1;
  1.1216 ++                    yysize = yysize0;
  1.1217 ++                    break;
  1.1218 ++                  }
  1.1219 ++                yyarg[yycount++] = yytname[yyx];
  1.1220 ++                {
  1.1221 ++                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
  1.1222 ++                  if (! (yysize <= yysize1
  1.1223 ++                         && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
  1.1224 ++                    return 2;
  1.1225 ++                  yysize = yysize1;
  1.1226 ++                }
  1.1227 ++              }
  1.1228 ++        }
  1.1229 ++    }
  1.1230 ++
  1.1231 ++  switch (yycount)
  1.1232 ++    {
  1.1233 ++# define YYCASE_(N, S)                      \
  1.1234 ++      case N:                               \
  1.1235 ++        yyformat = S;                       \
  1.1236 ++      break
  1.1237 ++      YYCASE_(0, YY_("syntax error"));
  1.1238 ++      YYCASE_(1, YY_("syntax error, unexpected %s"));
  1.1239 ++      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
  1.1240 ++      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
  1.1241 ++      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
  1.1242 ++      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
  1.1243 ++# undef YYCASE_
  1.1244 ++    }
  1.1245 ++
  1.1246 ++  {
  1.1247 ++    YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
  1.1248 ++    if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
  1.1249 ++      return 2;
  1.1250 ++    yysize = yysize1;
  1.1251 ++  }
  1.1252 ++
  1.1253 ++  if (*yymsg_alloc < yysize)
  1.1254 ++    {
  1.1255 ++      *yymsg_alloc = 2 * yysize;
  1.1256 ++      if (! (yysize <= *yymsg_alloc
  1.1257 ++             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
  1.1258 ++        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
  1.1259 ++      return 1;
  1.1260 ++    }
  1.1261 ++
  1.1262 ++  /* Avoid sprintf, as that infringes on the user's name space.
  1.1263 ++     Don't have undefined behavior even if the translation
  1.1264 ++     produced a string with the wrong number of "%s"s.  */
  1.1265 ++  {
  1.1266 ++    char *yyp = *yymsg;
  1.1267 ++    int yyi = 0;
  1.1268 ++    while ((*yyp = *yyformat) != '\0')
  1.1269 ++      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
  1.1270 ++        {
  1.1271 ++          yyp += yytnamerr (yyp, yyarg[yyi++]);
  1.1272 ++          yyformat += 2;
  1.1273 ++        }
  1.1274 ++      else
  1.1275 ++        {
  1.1276 ++          yyp++;
  1.1277 ++          yyformat++;
  1.1278 ++        }
  1.1279 ++  }
  1.1280 ++  return 0;
  1.1281 ++}
  1.1282 ++#endif /* YYERROR_VERBOSE */
  1.1283 ++
  1.1284 ++/*-----------------------------------------------.
  1.1285 ++| Release the memory associated to this symbol.  |
  1.1286 ++`-----------------------------------------------*/
  1.1287 ++
  1.1288 ++/*ARGSUSED*/
  1.1289 ++#if (defined __STDC__ || defined __C99__FUNC__ \
  1.1290 ++     || defined __cplusplus || defined _MSC_VER)
  1.1291 ++static void
  1.1292 ++yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
  1.1293 ++#else
  1.1294 ++static void
  1.1295 ++yydestruct (yymsg, yytype, yyvaluep)
  1.1296 ++    const char *yymsg;
  1.1297 ++    int yytype;
  1.1298 ++    YYSTYPE *yyvaluep;
  1.1299 ++#endif
  1.1300 ++{
  1.1301 ++  YYUSE (yyvaluep);
  1.1302 ++
  1.1303 ++  if (!yymsg)
  1.1304 ++    yymsg = "Deleting";
  1.1305 ++  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
  1.1306 ++
  1.1307 ++  YYUSE (yytype);
  1.1308 ++}
  1.1309 ++
  1.1310 ++
  1.1311 ++
  1.1312 ++
  1.1313 ++/*----------.
  1.1314 ++| yyparse.  |
  1.1315 ++`----------*/
  1.1316 ++
  1.1317 ++#ifdef YYPARSE_PARAM
  1.1318 ++#if (defined __STDC__ || defined __C99__FUNC__ \
  1.1319 ++     || defined __cplusplus || defined _MSC_VER)
  1.1320 ++int
  1.1321 ++yyparse (void *YYPARSE_PARAM)
  1.1322 ++#else
  1.1323 ++int
  1.1324 ++yyparse (YYPARSE_PARAM)
  1.1325 ++    void *YYPARSE_PARAM;
  1.1326 ++#endif
  1.1327 ++#else /* ! YYPARSE_PARAM */
  1.1328 ++#if (defined __STDC__ || defined __C99__FUNC__ \
  1.1329 ++     || defined __cplusplus || defined _MSC_VER)
  1.1330 ++int
  1.1331 ++yyparse (void)
  1.1332 ++#else
  1.1333 ++int
  1.1334 ++yyparse ()
  1.1335 ++
  1.1336 ++#endif
  1.1337 ++#endif
  1.1338 ++{
  1.1339 ++/* The lookahead symbol.  */
  1.1340 ++int yychar;
  1.1341 ++
  1.1342 ++
  1.1343 ++#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
  1.1344 ++/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
  1.1345 ++# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
  1.1346 ++    _Pragma ("GCC diagnostic push") \
  1.1347 ++    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
  1.1348 ++    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
  1.1349 ++# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
  1.1350 ++    _Pragma ("GCC diagnostic pop")
  1.1351 ++#else
  1.1352 ++/* Default value used for initialization, for pacifying older GCCs
  1.1353 ++   or non-GCC compilers.  */
  1.1354 ++static YYSTYPE yyval_default;
  1.1355 ++# define YY_INITIAL_VALUE(Value) = Value
  1.1356 ++#endif
  1.1357 ++#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  1.1358 ++# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  1.1359 ++# define YY_IGNORE_MAYBE_UNINITIALIZED_END
  1.1360 ++#endif
  1.1361 ++#ifndef YY_INITIAL_VALUE
  1.1362 ++# define YY_INITIAL_VALUE(Value) /* Nothing. */
  1.1363 ++#endif
  1.1364 ++
  1.1365 ++/* The semantic value of the lookahead symbol.  */
  1.1366 ++YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
  1.1367 ++
  1.1368 ++    /* Number of syntax errors so far.  */
  1.1369 ++    int yynerrs;
  1.1370 ++
  1.1371 ++    int yystate;
  1.1372 ++    /* Number of tokens to shift before error messages enabled.  */
  1.1373 ++    int yyerrstatus;
  1.1374 ++
  1.1375 ++    /* The stacks and their tools:
  1.1376 ++       `yyss': related to states.
  1.1377 ++       `yyvs': related to semantic values.
  1.1378 ++
  1.1379 ++       Refer to the stacks through separate pointers, to allow yyoverflow
  1.1380 ++       to reallocate them elsewhere.  */
  1.1381 ++
  1.1382 ++    /* The state stack.  */
  1.1383 ++    yytype_int16 yyssa[YYINITDEPTH];
  1.1384 ++    yytype_int16 *yyss;
  1.1385 ++    yytype_int16 *yyssp;
  1.1386 ++
  1.1387 ++    /* The semantic value stack.  */
  1.1388 ++    YYSTYPE yyvsa[YYINITDEPTH];
  1.1389 ++    YYSTYPE *yyvs;
  1.1390 ++    YYSTYPE *yyvsp;
  1.1391 ++
  1.1392 ++    YYSIZE_T yystacksize;
  1.1393 ++
  1.1394 ++  int yyn;
  1.1395 ++  int yyresult;
  1.1396 ++  /* Lookahead token as an internal (translated) token number.  */
  1.1397 ++  int yytoken = 0;
  1.1398 ++  /* The variables used to return semantic value and location from the
  1.1399 ++     action routines.  */
  1.1400 ++  YYSTYPE yyval;
  1.1401 ++
  1.1402 ++#if YYERROR_VERBOSE
  1.1403 ++  /* Buffer for error messages, and its allocated size.  */
  1.1404 ++  char yymsgbuf[128];
  1.1405 ++  char *yymsg = yymsgbuf;
  1.1406 ++  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
  1.1407 ++#endif
  1.1408 ++
  1.1409 ++#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
  1.1410 ++
  1.1411 ++  /* The number of symbols on the RHS of the reduced rule.
  1.1412 ++     Keep to zero when no symbol should be popped.  */
  1.1413 ++  int yylen = 0;
  1.1414 ++
  1.1415 ++  yyssp = yyss = yyssa;
  1.1416 ++  yyvsp = yyvs = yyvsa;
  1.1417 ++  yystacksize = YYINITDEPTH;
  1.1418 ++
  1.1419 ++  YYDPRINTF ((stderr, "Starting parse\n"));
  1.1420 ++
  1.1421 ++  yystate = 0;
  1.1422 ++  yyerrstatus = 0;
  1.1423 ++  yynerrs = 0;
  1.1424 ++  yychar = YYEMPTY; /* Cause a token to be read.  */
  1.1425 ++  goto yysetstate;
  1.1426 ++
  1.1427 ++/*------------------------------------------------------------.
  1.1428 ++| yynewstate -- Push a new state, which is found in yystate.  |
  1.1429 ++`------------------------------------------------------------*/
  1.1430 ++ yynewstate:
  1.1431 ++  /* In all cases, when you get here, the value and location stacks
  1.1432 ++     have just been pushed.  So pushing a state here evens the stacks.  */
  1.1433 ++  yyssp++;
  1.1434 ++
  1.1435 ++ yysetstate:
  1.1436 ++  *yyssp = yystate;
  1.1437 ++
  1.1438 ++  if (yyss + yystacksize - 1 <= yyssp)
  1.1439 ++    {
  1.1440 ++      /* Get the current used size of the three stacks, in elements.  */
  1.1441 ++      YYSIZE_T yysize = yyssp - yyss + 1;
  1.1442 ++
  1.1443 ++#ifdef yyoverflow
  1.1444 ++      {
  1.1445 ++	/* Give user a chance to reallocate the stack.  Use copies of
  1.1446 ++	   these so that the &'s don't force the real ones into
  1.1447 ++	   memory.  */
  1.1448 ++	YYSTYPE *yyvs1 = yyvs;
  1.1449 ++	yytype_int16 *yyss1 = yyss;
  1.1450 ++
  1.1451 ++	/* Each stack pointer address is followed by the size of the
  1.1452 ++	   data in use in that stack, in bytes.  This used to be a
  1.1453 ++	   conditional around just the two extra args, but that might
  1.1454 ++	   be undefined if yyoverflow is a macro.  */
  1.1455 ++	yyoverflow (YY_("memory exhausted"),
  1.1456 ++		    &yyss1, yysize * sizeof (*yyssp),
  1.1457 ++		    &yyvs1, yysize * sizeof (*yyvsp),
  1.1458 ++		    &yystacksize);
  1.1459 ++
  1.1460 ++	yyss = yyss1;
  1.1461 ++	yyvs = yyvs1;
  1.1462 ++      }
  1.1463 ++#else /* no yyoverflow */
  1.1464 ++# ifndef YYSTACK_RELOCATE
  1.1465 ++      goto yyexhaustedlab;
  1.1466 ++# else
  1.1467 ++      /* Extend the stack our own way.  */
  1.1468 ++      if (YYMAXDEPTH <= yystacksize)
  1.1469 ++	goto yyexhaustedlab;
  1.1470 ++      yystacksize *= 2;
  1.1471 ++      if (YYMAXDEPTH < yystacksize)
  1.1472 ++	yystacksize = YYMAXDEPTH;
  1.1473 ++
  1.1474 ++      {
  1.1475 ++	yytype_int16 *yyss1 = yyss;
  1.1476 ++	union yyalloc *yyptr =
  1.1477 ++	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
  1.1478 ++	if (! yyptr)
  1.1479 ++	  goto yyexhaustedlab;
  1.1480 ++	YYSTACK_RELOCATE (yyss_alloc, yyss);
  1.1481 ++	YYSTACK_RELOCATE (yyvs_alloc, yyvs);
  1.1482 ++#  undef YYSTACK_RELOCATE
  1.1483 ++	if (yyss1 != yyssa)
  1.1484 ++	  YYSTACK_FREE (yyss1);
  1.1485 ++      }
  1.1486 ++# endif
  1.1487 ++#endif /* no yyoverflow */
  1.1488 ++
  1.1489 ++      yyssp = yyss + yysize - 1;
  1.1490 ++      yyvsp = yyvs + yysize - 1;
  1.1491 ++
  1.1492 ++      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
  1.1493 ++		  (unsigned long int) yystacksize));
  1.1494 ++
  1.1495 ++      if (yyss + yystacksize - 1 <= yyssp)
  1.1496 ++	YYABORT;
  1.1497 ++    }
  1.1498 ++
  1.1499 ++  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
  1.1500 ++
  1.1501 ++  if (yystate == YYFINAL)
  1.1502 ++    YYACCEPT;
  1.1503 ++
  1.1504 ++  goto yybackup;
  1.1505 ++
  1.1506 ++/*-----------.
  1.1507 ++| yybackup.  |
  1.1508 ++`-----------*/
  1.1509 ++yybackup:
  1.1510 ++
  1.1511 ++  /* Do appropriate processing given the current state.  Read a
  1.1512 ++     lookahead token if we need one and don't already have one.  */
  1.1513 ++
  1.1514 ++  /* First try to decide what to do without reference to lookahead token.  */
  1.1515 ++  yyn = yypact[yystate];
  1.1516 ++  if (yypact_value_is_default (yyn))
  1.1517 ++    goto yydefault;
  1.1518 ++
  1.1519 ++  /* Not known => get a lookahead token if don't already have one.  */
  1.1520 ++
  1.1521 ++  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
  1.1522 ++  if (yychar == YYEMPTY)
  1.1523 ++    {
  1.1524 ++      YYDPRINTF ((stderr, "Reading a token: "));
  1.1525 ++      yychar = YYLEX;
  1.1526 ++    }
  1.1527 ++
  1.1528 ++  if (yychar <= YYEOF)
  1.1529 ++    {
  1.1530 ++      yychar = yytoken = YYEOF;
  1.1531 ++      YYDPRINTF ((stderr, "Now at end of input.\n"));
  1.1532 ++    }
  1.1533 ++  else
  1.1534 ++    {
  1.1535 ++      yytoken = YYTRANSLATE (yychar);
  1.1536 ++      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
  1.1537 ++    }
  1.1538 ++
  1.1539 ++  /* If the proper action on seeing token YYTOKEN is to reduce or to
  1.1540 ++     detect an error, take that action.  */
  1.1541 ++  yyn += yytoken;
  1.1542 ++  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
  1.1543 ++    goto yydefault;
  1.1544 ++  yyn = yytable[yyn];
  1.1545 ++  if (yyn <= 0)
  1.1546 ++    {
  1.1547 ++      if (yytable_value_is_error (yyn))
  1.1548 ++        goto yyerrlab;
  1.1549 ++      yyn = -yyn;
  1.1550 ++      goto yyreduce;
  1.1551 ++    }
  1.1552 ++
  1.1553 ++  /* Count tokens shifted since error; after three, turn off error
  1.1554 ++     status.  */
  1.1555 ++  if (yyerrstatus)
  1.1556 ++    yyerrstatus--;
  1.1557 ++
  1.1558 ++  /* Shift the lookahead token.  */
  1.1559 ++  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
  1.1560 ++
  1.1561 ++  /* Discard the shifted token.  */
  1.1562 ++  yychar = YYEMPTY;
  1.1563 ++
  1.1564 ++  yystate = yyn;
  1.1565 ++  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  1.1566 ++  *++yyvsp = yylval;
  1.1567 ++  YY_IGNORE_MAYBE_UNINITIALIZED_END
  1.1568 ++
  1.1569 ++  goto yynewstate;
  1.1570 ++
  1.1571 ++
  1.1572 ++/*-----------------------------------------------------------.
  1.1573 ++| yydefault -- do the default action for the current state.  |
  1.1574 ++`-----------------------------------------------------------*/
  1.1575 ++yydefault:
  1.1576 ++  yyn = yydefact[yystate];
  1.1577 ++  if (yyn == 0)
  1.1578 ++    goto yyerrlab;
  1.1579 ++  goto yyreduce;
  1.1580 ++
  1.1581 ++
  1.1582 ++/*-----------------------------.
  1.1583 ++| yyreduce -- Do a reduction.  |
  1.1584 ++`-----------------------------*/
  1.1585 ++yyreduce:
  1.1586 ++  /* yyn is the number of a rule to reduce with.  */
  1.1587 ++  yylen = yyr2[yyn];
  1.1588 ++
  1.1589 ++  /* If YYLEN is nonzero, implement the default value of the action:
  1.1590 ++     `$$ = $1'.
  1.1591 ++
  1.1592 ++     Otherwise, the following line sets YYVAL to garbage.
  1.1593 ++     This behavior is undocumented and Bison
  1.1594 ++     users should not rely upon it.  Assigning to YYVAL
  1.1595 ++     unconditionally makes the parser a bit smaller, and it avoids a
  1.1596 ++     GCC warning that YYVAL may be used uninitialized.  */
  1.1597 ++  yyval = yyvsp[1-yylen];
  1.1598 ++
  1.1599 ++
  1.1600 ++  YY_REDUCE_PRINT (yyn);
  1.1601 ++  switch (yyn)
  1.1602 ++    {
  1.1603 ++        case 4:
  1.1604 ++/* Line 1787 of yacc.c  */
  1.1605 ++#line 157 "ptlib/common/getdate.y"
  1.1606 ++    {
  1.1607 ++	    VARIABLE->yyHaveTime++;
  1.1608 ++	}
  1.1609 ++    break;
  1.1610 ++
  1.1611 ++  case 5:
  1.1612 ++/* Line 1787 of yacc.c  */
  1.1613 ++#line 160 "ptlib/common/getdate.y"
  1.1614 ++    {
  1.1615 ++	    VARIABLE->yyHaveZone++;
  1.1616 ++	}
  1.1617 ++    break;
  1.1618 ++
  1.1619 ++  case 6:
  1.1620 ++/* Line 1787 of yacc.c  */
  1.1621 ++#line 163 "ptlib/common/getdate.y"
  1.1622 ++    {
  1.1623 ++	    VARIABLE->yyHaveDate++;
  1.1624 ++	}
  1.1625 ++    break;
  1.1626 ++
  1.1627 ++  case 7:
  1.1628 ++/* Line 1787 of yacc.c  */
  1.1629 ++#line 166 "ptlib/common/getdate.y"
  1.1630 ++    {
  1.1631 ++	    VARIABLE->yyHaveDay++;
  1.1632 ++	}
  1.1633 ++    break;
  1.1634 ++
  1.1635 ++  case 8:
  1.1636 ++/* Line 1787 of yacc.c  */
  1.1637 ++#line 169 "ptlib/common/getdate.y"
  1.1638 ++    {
  1.1639 ++	    VARIABLE->yyHaveRel++;
  1.1640 ++	}
  1.1641 ++    break;
  1.1642 ++
  1.1643 ++  case 10:
  1.1644 ++/* Line 1787 of yacc.c  */
  1.1645 ++#line 175 "ptlib/common/getdate.y"
  1.1646 ++    {
  1.1647 ++	    VARIABLE->yyHour = (yyvsp[(1) - (2)].Number);
  1.1648 ++	    VARIABLE->yyMinutes = 0;
  1.1649 ++	    VARIABLE->yySeconds = 0;
  1.1650 ++	    VARIABLE->yyMeridian = (yyvsp[(2) - (2)].Meridian);
  1.1651 ++	}
  1.1652 ++    break;
  1.1653 ++
  1.1654 ++  case 11:
  1.1655 ++/* Line 1787 of yacc.c  */
  1.1656 ++#line 181 "ptlib/common/getdate.y"
  1.1657 ++    {
  1.1658 ++	    VARIABLE->yyHour = (yyvsp[(1) - (2)].Number)/100;
  1.1659 ++	    VARIABLE->yyMinutes = (yyvsp[(1) - (2)].Number)%100;
  1.1660 ++	    VARIABLE->yySeconds = 0;
  1.1661 ++	    VARIABLE->yyMeridian = MER24;
  1.1662 ++	    VARIABLE->yyDSTmode = DSToff;
  1.1663 ++	    VARIABLE->yyTimezone = - ((yyvsp[(2) - (2)].Number) % 100 + ((yyvsp[(2) - (2)].Number) / 100) * 60);
  1.1664 ++        }
  1.1665 ++    break;
  1.1666 ++
  1.1667 ++  case 12:
  1.1668 ++/* Line 1787 of yacc.c  */
  1.1669 ++#line 189 "ptlib/common/getdate.y"
  1.1670 ++    {
  1.1671 ++	    VARIABLE->yyHour = (yyvsp[(1) - (2)].Number)/10000;
  1.1672 ++	    VARIABLE->yyMinutes = ((yyvsp[(1) - (2)].Number)/100)%100;
  1.1673 ++	    VARIABLE->yySeconds = (yyvsp[(1) - (2)].Number) % 100;
  1.1674 ++	    VARIABLE->yyMeridian = MER24;
  1.1675 ++	    VARIABLE->yyDSTmode = DSToff;
  1.1676 ++	    VARIABLE->yyTimezone = - ((yyvsp[(2) - (2)].Number) % 100 + ((yyvsp[(2) - (2)].Number) / 100) * 60);
  1.1677 ++        }
  1.1678 ++    break;
  1.1679 ++
  1.1680 ++  case 13:
  1.1681 ++/* Line 1787 of yacc.c  */
  1.1682 ++#line 197 "ptlib/common/getdate.y"
  1.1683 ++    {
  1.1684 ++	    VARIABLE->yyHour = (yyvsp[(1) - (4)].Number);
  1.1685 ++	    VARIABLE->yyMinutes = (yyvsp[(3) - (4)].Number);
  1.1686 ++	    VARIABLE->yySeconds = 0;
  1.1687 ++	    VARIABLE->yyMeridian = (yyvsp[(4) - (4)].Meridian);
  1.1688 ++	}
  1.1689 ++    break;
  1.1690 ++
  1.1691 ++  case 14:
  1.1692 ++/* Line 1787 of yacc.c  */
  1.1693 ++#line 203 "ptlib/common/getdate.y"
  1.1694 ++    {
  1.1695 ++	    VARIABLE->yyHour = (yyvsp[(1) - (4)].Number);
  1.1696 ++	    VARIABLE->yyMinutes = (yyvsp[(3) - (4)].Number);
  1.1697 ++	    VARIABLE->yyMeridian = MER24;
  1.1698 ++	    VARIABLE->yyDSTmode = DSToff;
  1.1699 ++	    VARIABLE->yyTimezone = - ((yyvsp[(4) - (4)].Number) % 100 + ((yyvsp[(4) - (4)].Number) / 100) * 60);
  1.1700 ++	}
  1.1701 ++    break;
  1.1702 ++
  1.1703 ++  case 15:
  1.1704 ++/* Line 1787 of yacc.c  */
  1.1705 ++#line 210 "ptlib/common/getdate.y"
  1.1706 ++    {
  1.1707 ++	    VARIABLE->yyHour = (yyvsp[(1) - (6)].Number);
  1.1708 ++	    VARIABLE->yyMinutes = (yyvsp[(3) - (6)].Number);
  1.1709 ++	    VARIABLE->yySeconds = (yyvsp[(5) - (6)].Number);
  1.1710 ++	    VARIABLE->yyMeridian = (yyvsp[(6) - (6)].Meridian);
  1.1711 ++	}
  1.1712 ++    break;
  1.1713 ++
  1.1714 ++  case 16:
  1.1715 ++/* Line 1787 of yacc.c  */
  1.1716 ++#line 216 "ptlib/common/getdate.y"
  1.1717 ++    {
  1.1718 ++	    VARIABLE->yyHour = (yyvsp[(1) - (6)].Number);
  1.1719 ++	    VARIABLE->yyMinutes = (yyvsp[(3) - (6)].Number);
  1.1720 ++	    VARIABLE->yySeconds = (yyvsp[(5) - (6)].Number);
  1.1721 ++	    VARIABLE->yyMeridian = MER24;
  1.1722 ++	    VARIABLE->yyDSTmode = DSToff;
  1.1723 ++	    VARIABLE->yyTimezone = - ((yyvsp[(6) - (6)].Number) % 100 + ((yyvsp[(6) - (6)].Number) / 100) * 60);
  1.1724 ++	}
  1.1725 ++    break;
  1.1726 ++
  1.1727 ++  case 17:
  1.1728 ++/* Line 1787 of yacc.c  */
  1.1729 ++#line 226 "ptlib/common/getdate.y"
  1.1730 ++    {
  1.1731 ++	    VARIABLE->yyTimezone = (yyvsp[(1) - (1)].Number);
  1.1732 ++	    VARIABLE->yyDSTmode = DSToff;
  1.1733 ++	}
  1.1734 ++    break;
  1.1735 ++
  1.1736 ++  case 18:
  1.1737 ++/* Line 1787 of yacc.c  */
  1.1738 ++#line 230 "ptlib/common/getdate.y"
  1.1739 ++    {
  1.1740 ++	    VARIABLE->yyTimezone = (yyvsp[(1) - (1)].Number);
  1.1741 ++	    VARIABLE->yyDSTmode = DSTon;
  1.1742 ++	}
  1.1743 ++    break;
  1.1744 ++
  1.1745 ++  case 19:
  1.1746 ++/* Line 1787 of yacc.c  */
  1.1747 ++#line 235 "ptlib/common/getdate.y"
  1.1748 ++    {
  1.1749 ++	    VARIABLE->yyTimezone = (yyvsp[(1) - (2)].Number);
  1.1750 ++	    VARIABLE->yyDSTmode = DSTon;
  1.1751 ++	}
  1.1752 ++    break;
  1.1753 ++
  1.1754 ++  case 20:
  1.1755 ++/* Line 1787 of yacc.c  */
  1.1756 ++#line 239 "ptlib/common/getdate.y"
  1.1757 ++    {
  1.1758 ++            if (VARIABLE->yyHaveTime > 0) {
  1.1759 ++	      VARIABLE->yyTimezone = (yyvsp[(1) - (1)].Number);
  1.1760 ++	      VARIABLE->yyDSTmode = DSToff;
  1.1761 ++            }
  1.1762 ++            else
  1.1763 ++              VARIABLE->yyHaveZone--;
  1.1764 ++        }
  1.1765 ++    break;
  1.1766 ++
  1.1767 ++  case 21:
  1.1768 ++/* Line 1787 of yacc.c  */
  1.1769 ++#line 249 "ptlib/common/getdate.y"
  1.1770 ++    {
  1.1771 ++	    VARIABLE->yyDayOrdinal = 1;
  1.1772 ++	    VARIABLE->yyDayNumber = (yyvsp[(1) - (1)].Number);
  1.1773 ++	}
  1.1774 ++    break;
  1.1775 ++
  1.1776 ++  case 22:
  1.1777 ++/* Line 1787 of yacc.c  */
  1.1778 ++#line 253 "ptlib/common/getdate.y"
  1.1779 ++    {
  1.1780 ++	    VARIABLE->yyDayOrdinal = 1;
  1.1781 ++	    VARIABLE->yyDayNumber = (yyvsp[(1) - (2)].Number);
  1.1782 ++	}
  1.1783 ++    break;
  1.1784 ++
  1.1785 ++  case 23:
  1.1786 ++/* Line 1787 of yacc.c  */
  1.1787 ++#line 257 "ptlib/common/getdate.y"
  1.1788 ++    {
  1.1789 ++	    VARIABLE->yyDayOrdinal = (yyvsp[(1) - (2)].Number);
  1.1790 ++	    VARIABLE->yyDayNumber = (yyvsp[(2) - (2)].Number);
  1.1791 ++	}
  1.1792 ++    break;
  1.1793 ++
  1.1794 ++  case 24:
  1.1795 ++/* Line 1787 of yacc.c  */
  1.1796 ++#line 263 "ptlib/common/getdate.y"
  1.1797 ++    {
  1.1798 ++	    SetPossibleDate(VARIABLE, (yyvsp[(1) - (3)].Number), (yyvsp[(3) - (3)].Number), VARIABLE->yyYear);
  1.1799 ++	}
  1.1800 ++    break;
  1.1801 ++
  1.1802 ++  case 25:
  1.1803 ++/* Line 1787 of yacc.c  */
  1.1804 ++#line 266 "ptlib/common/getdate.y"
  1.1805 ++    {
  1.1806 ++	    SetPossibleDate(VARIABLE, (yyvsp[(1) - (5)].Number), (yyvsp[(3) - (5)].Number), (yyvsp[(5) - (5)].Number));
  1.1807 ++	}
  1.1808 ++    break;
  1.1809 ++
  1.1810 ++  case 26:
  1.1811 ++/* Line 1787 of yacc.c  */
  1.1812 ++#line 269 "ptlib/common/getdate.y"
  1.1813 ++    {
  1.1814 ++	    /* ISO 8601 format.  yyyy-mm-dd.  */
  1.1815 ++	    SetPossibleDate(VARIABLE, (yyvsp[(1) - (4)].Number), -(yyvsp[(2) - (4)].Number), -(yyvsp[(3) - (4)].Number));
  1.1816 ++	}
  1.1817 ++    break;
  1.1818 ++
  1.1819 ++  case 27:
  1.1820 ++/* Line 1787 of yacc.c  */
  1.1821 ++#line 273 "ptlib/common/getdate.y"
  1.1822 ++    {
  1.1823 ++	    VARIABLE->yyDay= ((yyvsp[(1) - (1)].Number))%100;
  1.1824 ++	    VARIABLE->yyMonth= ((yyvsp[(1) - (1)].Number)/100)%100;
  1.1825 ++	    VARIABLE->yyYear = (yyvsp[(1) - (1)].Number)/10000;
  1.1826 ++	}
  1.1827 ++    break;
  1.1828 ++
  1.1829 ++  case 28:
  1.1830 ++/* Line 1787 of yacc.c  */
  1.1831 ++#line 278 "ptlib/common/getdate.y"
  1.1832 ++    {
  1.1833 ++	    /* e.g. 17-JUN-1992.  */
  1.1834 ++	    SetPossibleDate(VARIABLE, (yyvsp[(1) - (3)].Number), (yyvsp[(2) - (3)].Number), -(yyvsp[(3) - (3)].Number));
  1.1835 ++	}
  1.1836 ++    break;
  1.1837 ++
  1.1838 ++  case 29:
  1.1839 ++/* Line 1787 of yacc.c  */
  1.1840 ++#line 282 "ptlib/common/getdate.y"
  1.1841 ++    {
  1.1842 ++	    VARIABLE->yyMonth = (yyvsp[(1) - (2)].Number);
  1.1843 ++	    if ((yyvsp[(2) - (2)].Number) > 31)
  1.1844 ++	      VARIABLE->yyYear = (yyvsp[(2) - (2)].Number);
  1.1845 ++	    else
  1.1846 ++	      VARIABLE->yyDay = (yyvsp[(2) - (2)].Number);
  1.1847 ++	}
  1.1848 ++    break;
  1.1849 ++
  1.1850 ++  case 30:
  1.1851 ++/* Line 1787 of yacc.c  */
  1.1852 ++#line 289 "ptlib/common/getdate.y"
  1.1853 ++    {
  1.1854 ++	    VARIABLE->yyMonth = (yyvsp[(1) - (4)].Number);
  1.1855 ++	    VARIABLE->yyDay = (yyvsp[(2) - (4)].Number);
  1.1856 ++	    VARIABLE->yyYear = (yyvsp[(4) - (4)].Number);
  1.1857 ++	}
  1.1858 ++    break;
  1.1859 ++
  1.1860 ++  case 31:
  1.1861 ++/* Line 1787 of yacc.c  */
  1.1862 ++#line 294 "ptlib/common/getdate.y"
  1.1863 ++    {
  1.1864 ++	    if ((yyvsp[(1) - (2)].Number) > 31)
  1.1865 ++	      VARIABLE->yyYear = (yyvsp[(1) - (2)].Number);
  1.1866 ++	    else
  1.1867 ++	      VARIABLE->yyDay = (yyvsp[(1) - (2)].Number);
  1.1868 ++	    VARIABLE->yyMonth = (yyvsp[(2) - (2)].Number);
  1.1869 ++	}
  1.1870 ++    break;
  1.1871 ++
  1.1872 ++  case 32:
  1.1873 ++/* Line 1787 of yacc.c  */
  1.1874 ++#line 301 "ptlib/common/getdate.y"
  1.1875 ++    {
  1.1876 ++	    SetPossibleDate(VARIABLE, (yyvsp[(1) - (3)].Number), (yyvsp[(2) - (3)].Number), (yyvsp[(3) - (3)].Number));
  1.1877 ++	}
  1.1878 ++    break;
  1.1879 ++
  1.1880 ++  case 33:
  1.1881 ++/* Line 1787 of yacc.c  */
  1.1882 ++#line 306 "ptlib/common/getdate.y"
  1.1883 ++    {
  1.1884 ++	    VARIABLE->yyRelSeconds = -VARIABLE->yyRelSeconds;
  1.1885 ++	    VARIABLE->yyRelMonth = -VARIABLE->yyRelMonth;
  1.1886 ++	}
  1.1887 ++    break;
  1.1888 ++
  1.1889 ++  case 35:
  1.1890 ++/* Line 1787 of yacc.c  */
  1.1891 ++#line 313 "ptlib/common/getdate.y"
  1.1892 ++    {
  1.1893 ++	    VARIABLE->yyRelSeconds += (yyvsp[(1) - (2)].Number) * (yyvsp[(2) - (2)].Number) * 60L;
  1.1894 ++	}
  1.1895 ++    break;
  1.1896 ++
  1.1897 ++  case 36:
  1.1898 ++/* Line 1787 of yacc.c  */
  1.1899 ++#line 316 "ptlib/common/getdate.y"
  1.1900 ++    {
  1.1901 ++	    VARIABLE->yyRelSeconds += (yyvsp[(1) - (2)].Number) * (yyvsp[(2) - (2)].Number) * 60L;
  1.1902 ++	}
  1.1903 ++    break;
  1.1904 ++
  1.1905 ++  case 37:
  1.1906 ++/* Line 1787 of yacc.c  */
  1.1907 ++#line 319 "ptlib/common/getdate.y"
  1.1908 ++    {
  1.1909 ++	    VARIABLE->yyRelSeconds += (yyvsp[(1) - (1)].Number) * 60L;
  1.1910 ++	}
  1.1911 ++    break;
  1.1912 ++
  1.1913 ++  case 38:
  1.1914 ++/* Line 1787 of yacc.c  */
  1.1915 ++#line 322 "ptlib/common/getdate.y"
  1.1916 ++    {
  1.1917 ++	    VARIABLE->yyRelSeconds += (yyvsp[(1) - (2)].Number);
  1.1918 ++	}
  1.1919 ++    break;
  1.1920 ++
  1.1921 ++  case 39:
  1.1922 ++/* Line 1787 of yacc.c  */
  1.1923 ++#line 325 "ptlib/common/getdate.y"
  1.1924 ++    {
  1.1925 ++	    VARIABLE->yyRelSeconds += (yyvsp[(1) - (2)].Number);
  1.1926 ++	}
  1.1927 ++    break;
  1.1928 ++
  1.1929 ++  case 40:
  1.1930 ++/* Line 1787 of yacc.c  */
  1.1931 ++#line 328 "ptlib/common/getdate.y"
  1.1932 ++    {
  1.1933 ++	    VARIABLE->yyRelSeconds++;
  1.1934 ++	}
  1.1935 ++    break;
  1.1936 ++
  1.1937 ++  case 41:
  1.1938 ++/* Line 1787 of yacc.c  */
  1.1939 ++#line 331 "ptlib/common/getdate.y"
  1.1940 ++    {
  1.1941 ++	    VARIABLE->yyRelMonth += (yyvsp[(1) - (2)].Number) * (yyvsp[(2) - (2)].Number);
  1.1942 ++	}
  1.1943 ++    break;
  1.1944 ++
  1.1945 ++  case 42:
  1.1946 ++/* Line 1787 of yacc.c  */
  1.1947 ++#line 334 "ptlib/common/getdate.y"
  1.1948 ++    {
  1.1949 ++	    VARIABLE->yyRelMonth += (yyvsp[(1) - (2)].Number) * (yyvsp[(2) - (2)].Number);
  1.1950 ++	}
  1.1951 ++    break;
  1.1952 ++
  1.1953 ++  case 43:
  1.1954 ++/* Line 1787 of yacc.c  */
  1.1955 ++#line 337 "ptlib/common/getdate.y"
  1.1956 ++    {
  1.1957 ++	    VARIABLE->yyRelMonth += (yyvsp[(1) - (1)].Number);
  1.1958 ++	}
  1.1959 ++    break;
  1.1960 ++
  1.1961 ++  case 44:
  1.1962 ++/* Line 1787 of yacc.c  */
  1.1963 ++#line 342 "ptlib/common/getdate.y"
  1.1964 ++    {
  1.1965 ++	    (yyval.Number) = (yyvsp[(1) - (1)].Number);
  1.1966 ++	}
  1.1967 ++    break;
  1.1968 ++
  1.1969 ++  case 45:
  1.1970 ++/* Line 1787 of yacc.c  */
  1.1971 ++#line 345 "ptlib/common/getdate.y"
  1.1972 ++    {
  1.1973 ++	    (yyval.Number) = (yyvsp[(1) - (1)].Number);
  1.1974 ++	}
  1.1975 ++    break;
  1.1976 ++
  1.1977 ++  case 46:
  1.1978 ++/* Line 1787 of yacc.c  */
  1.1979 ++#line 348 "ptlib/common/getdate.y"
  1.1980 ++    {
  1.1981 ++	    (yyval.Number) = (yyvsp[(1) - (1)].Number);
  1.1982 ++	}
  1.1983 ++    break;
  1.1984 ++
  1.1985 ++  case 47:
  1.1986 ++/* Line 1787 of yacc.c  */
  1.1987 ++#line 353 "ptlib/common/getdate.y"
  1.1988 ++    {
  1.1989 ++	    if (VARIABLE->yyHaveTime && VARIABLE->yyHaveDate && !VARIABLE->yyHaveRel)
  1.1990 ++		VARIABLE->yyYear = (yyvsp[(1) - (1)].Number);
  1.1991 ++	    else {
  1.1992 ++		if((yyvsp[(1) - (1)].Number)>240000) {
  1.1993 ++		    VARIABLE->yyHaveDate++;
  1.1994 ++		    VARIABLE->yyDay= ((yyvsp[(1) - (1)].Number))%100;
  1.1995 ++		    VARIABLE->yyMonth= ((yyvsp[(1) - (1)].Number)/100)%100;
  1.1996 ++		    VARIABLE->yyYear = (yyvsp[(1) - (1)].Number)/10000;
  1.1997 ++		}
  1.1998 ++		else {
  1.1999 ++		    VARIABLE->yyHaveTime++;
  1.2000 ++		    if ((yyvsp[(1) - (1)].Number) < 10000) {
  1.2001 ++		    	VARIABLE->yyHour = (yyvsp[(1) - (1)].Number) / 100;
  1.2002 ++		    	VARIABLE->yyMinutes = (yyvsp[(1) - (1)].Number) % 100;
  1.2003 ++		        VARIABLE->yySeconds = 0;
  1.2004 ++		    }
  1.2005 ++		    else {
  1.2006 ++	                VARIABLE->yyHour = (yyvsp[(1) - (1)].Number)/10000;
  1.2007 ++	                VARIABLE->yyMinutes = ((yyvsp[(1) - (1)].Number)/100)%100;
  1.2008 ++	                VARIABLE->yySeconds = (yyvsp[(1) - (1)].Number) % 100;
  1.2009 ++                    }
  1.2010 ++		    VARIABLE->yyMeridian = MER24;
  1.2011 ++	        }
  1.2012 ++	    }
  1.2013 ++	}
  1.2014 ++    break;
  1.2015 ++
  1.2016 ++  case 48:
  1.2017 ++/* Line 1787 of yacc.c  */
  1.2018 ++#line 379 "ptlib/common/getdate.y"
  1.2019 ++    {
  1.2020 ++	    if (VARIABLE->yyHaveTime && VARIABLE->yyHaveDate && !VARIABLE->yyHaveRel)
  1.2021 ++		VARIABLE->yyYear = (yyvsp[(1) - (1)].Number);
  1.2022 ++	    else {
  1.2023 ++	        VARIABLE->yyHaveTime++;
  1.2024 ++	        VARIABLE->yyHour = (yyvsp[(1) - (1)].Number)/100;
  1.2025 ++	        VARIABLE->yyMinutes = (yyvsp[(1) - (1)].Number)%100;
  1.2026 ++	        VARIABLE->yySeconds = 0;
  1.2027 ++	        VARIABLE->yyMeridian = MER24;
  1.2028 ++            }
  1.2029 ++        }
  1.2030 ++    break;
  1.2031 ++
  1.2032 ++  case 49:
  1.2033 ++/* Line 1787 of yacc.c  */
  1.2034 ++#line 390 "ptlib/common/getdate.y"
  1.2035 ++    {
  1.2036 ++	    if (!VARIABLE->yyHaveDate && (yyvsp[(1) - (1)].Number)>240000) {
  1.2037 ++		VARIABLE->yyHaveDate++;
  1.2038 ++		VARIABLE->yyDay= ((yyvsp[(1) - (1)].Number))%100;
  1.2039 ++		VARIABLE->yyMonth= ((yyvsp[(1) - (1)].Number)/100)%100;
  1.2040 ++		VARIABLE->yyYear = (yyvsp[(1) - (1)].Number)/10000;
  1.2041 ++	    }
  1.2042 ++	    else if (!VARIABLE->yyHaveTime) {
  1.2043 ++	        VARIABLE->yyHaveTime++;
  1.2044 ++	        VARIABLE->yyHour = (yyvsp[(1) - (1)].Number)/10000;
  1.2045 ++	        VARIABLE->yyMinutes = ((yyvsp[(1) - (1)].Number)/100)%100;
  1.2046 ++	        VARIABLE->yySeconds = (yyvsp[(1) - (1)].Number) % 100;
  1.2047 ++	        VARIABLE->yyMeridian = MER24;
  1.2048 ++            }
  1.2049 ++        }
  1.2050 ++    break;
  1.2051 ++
  1.2052 ++  case 50:
  1.2053 ++/* Line 1787 of yacc.c  */
  1.2054 ++#line 407 "ptlib/common/getdate.y"
  1.2055 ++    {
  1.2056 ++	    (yyval.Meridian) = MER24;
  1.2057 ++	}
  1.2058 ++    break;
  1.2059 ++
  1.2060 ++  case 51:
  1.2061 ++/* Line 1787 of yacc.c  */
  1.2062 ++#line 410 "ptlib/common/getdate.y"
  1.2063 ++    {
  1.2064 ++	    (yyval.Meridian) = (yyvsp[(1) - (1)].Meridian);
  1.2065 ++	}
  1.2066 ++    break;
  1.2067 ++
  1.2068 ++
  1.2069 ++/* Line 1787 of yacc.c  */
  1.2070 ++#line 2031 "ptlib/common/getdate.tab.c"
  1.2071 ++      default: break;
  1.2072 ++    }
  1.2073 ++  /* User semantic actions sometimes alter yychar, and that requires
  1.2074 ++     that yytoken be updated with the new translation.  We take the
  1.2075 ++     approach of translating immediately before every use of yytoken.
  1.2076 ++     One alternative is translating here after every semantic action,
  1.2077 ++     but that translation would be missed if the semantic action invokes
  1.2078 ++     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
  1.2079 ++     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
  1.2080 ++     incorrect destructor might then be invoked immediately.  In the
  1.2081 ++     case of YYERROR or YYBACKUP, subsequent parser actions might lead
  1.2082 ++     to an incorrect destructor call or verbose syntax error message
  1.2083 ++     before the lookahead is translated.  */
  1.2084 ++  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
  1.2085 ++
  1.2086 ++  YYPOPSTACK (yylen);
  1.2087 ++  yylen = 0;
  1.2088 ++  YY_STACK_PRINT (yyss, yyssp);
  1.2089 ++
  1.2090 ++  *++yyvsp = yyval;
  1.2091 ++
  1.2092 ++  /* Now `shift' the result of the reduction.  Determine what state
  1.2093 ++     that goes to, based on the state we popped back to and the rule
  1.2094 ++     number reduced by.  */
  1.2095 ++
  1.2096 ++  yyn = yyr1[yyn];
  1.2097 ++
  1.2098 ++  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
  1.2099 ++  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  1.2100 ++    yystate = yytable[yystate];
  1.2101 ++  else
  1.2102 ++    yystate = yydefgoto[yyn - YYNTOKENS];
  1.2103 ++
  1.2104 ++  goto yynewstate;
  1.2105 ++
  1.2106 ++
  1.2107 ++/*------------------------------------.
  1.2108 ++| yyerrlab -- here on detecting error |
  1.2109 ++`------------------------------------*/
  1.2110 ++yyerrlab:
  1.2111 ++  /* Make sure we have latest lookahead translation.  See comments at
  1.2112 ++     user semantic actions for why this is necessary.  */
  1.2113 ++  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
  1.2114 ++
  1.2115 ++  /* If not already recovering from an error, report this error.  */
  1.2116 ++  if (!yyerrstatus)
  1.2117 ++    {
  1.2118 ++      ++yynerrs;
  1.2119 ++#if ! YYERROR_VERBOSE
  1.2120 ++      yyerror (YY_("syntax error"));
  1.2121 ++#else
  1.2122 ++# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
  1.2123 ++                                        yyssp, yytoken)
  1.2124 ++      {
  1.2125 ++        char const *yymsgp = YY_("syntax error");
  1.2126 ++        int yysyntax_error_status;
  1.2127 ++        yysyntax_error_status = YYSYNTAX_ERROR;
  1.2128 ++        if (yysyntax_error_status == 0)
  1.2129 ++          yymsgp = yymsg;
  1.2130 ++        else if (yysyntax_error_status == 1)
  1.2131 ++          {
  1.2132 ++            if (yymsg != yymsgbuf)
  1.2133 ++              YYSTACK_FREE (yymsg);
  1.2134 ++            yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
  1.2135 ++            if (!yymsg)
  1.2136 ++              {
  1.2137 ++                yymsg = yymsgbuf;
  1.2138 ++                yymsg_alloc = sizeof yymsgbuf;
  1.2139 ++                yysyntax_error_status = 2;
  1.2140 ++              }
  1.2141 ++            else
  1.2142 ++              {
  1.2143 ++                yysyntax_error_status = YYSYNTAX_ERROR;
  1.2144 ++                yymsgp = yymsg;
  1.2145 ++              }
  1.2146 ++          }
  1.2147 ++        yyerror (yymsgp);
  1.2148 ++        if (yysyntax_error_status == 2)
  1.2149 ++          goto yyexhaustedlab;
  1.2150 ++      }
  1.2151 ++# undef YYSYNTAX_ERROR
  1.2152 ++#endif
  1.2153 ++    }
  1.2154 ++
  1.2155 ++
  1.2156 ++
  1.2157 ++  if (yyerrstatus == 3)
  1.2158 ++    {
  1.2159 ++      /* If just tried and failed to reuse lookahead token after an
  1.2160 ++	 error, discard it.  */
  1.2161 ++
  1.2162 ++      if (yychar <= YYEOF)
  1.2163 ++	{
  1.2164 ++	  /* Return failure if at end of input.  */
  1.2165 ++	  if (yychar == YYEOF)
  1.2166 ++	    YYABORT;
  1.2167 ++	}
  1.2168 ++      else
  1.2169 ++	{
  1.2170 ++	  yydestruct ("Error: discarding",
  1.2171 ++		      yytoken, &yylval);
  1.2172 ++	  yychar = YYEMPTY;
  1.2173 ++	}
  1.2174 ++    }
  1.2175 ++
  1.2176 ++  /* Else will try to reuse lookahead token after shifting the error
  1.2177 ++     token.  */
  1.2178 ++  goto yyerrlab1;
  1.2179 ++
  1.2180 ++
  1.2181 ++/*---------------------------------------------------.
  1.2182 ++| yyerrorlab -- error raised explicitly by YYERROR.  |
  1.2183 ++`---------------------------------------------------*/
  1.2184 ++yyerrorlab:
  1.2185 ++
  1.2186 ++  /* Pacify compilers like GCC when the user code never invokes
  1.2187 ++     YYERROR and the label yyerrorlab therefore never appears in user
  1.2188 ++     code.  */
  1.2189 ++  if (/*CONSTCOND*/ 0)
  1.2190 ++     goto yyerrorlab;
  1.2191 ++
  1.2192 ++  /* Do not reclaim the symbols of the rule which action triggered
  1.2193 ++     this YYERROR.  */
  1.2194 ++  YYPOPSTACK (yylen);
  1.2195 ++  yylen = 0;
  1.2196 ++  YY_STACK_PRINT (yyss, yyssp);
  1.2197 ++  yystate = *yyssp;
  1.2198 ++  goto yyerrlab1;
  1.2199 ++
  1.2200 ++
  1.2201 ++/*-------------------------------------------------------------.
  1.2202 ++| yyerrlab1 -- common code for both syntax error and YYERROR.  |
  1.2203 ++`-------------------------------------------------------------*/
  1.2204 ++yyerrlab1:
  1.2205 ++  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
  1.2206 ++
  1.2207 ++  for (;;)
  1.2208 ++    {
  1.2209 ++      yyn = yypact[yystate];
  1.2210 ++      if (!yypact_value_is_default (yyn))
  1.2211 ++	{
  1.2212 ++	  yyn += YYTERROR;
  1.2213 ++	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
  1.2214 ++	    {
  1.2215 ++	      yyn = yytable[yyn];
  1.2216 ++	      if (0 < yyn)
  1.2217 ++		break;
  1.2218 ++	    }
  1.2219 ++	}
  1.2220 ++
  1.2221 ++      /* Pop the current state because it cannot handle the error token.  */
  1.2222 ++      if (yyssp == yyss)
  1.2223 ++	YYABORT;
  1.2224 ++
  1.2225 ++
  1.2226 ++      yydestruct ("Error: popping",
  1.2227 ++		  yystos[yystate], yyvsp);
  1.2228 ++      YYPOPSTACK (1);
  1.2229 ++      yystate = *yyssp;
  1.2230 ++      YY_STACK_PRINT (yyss, yyssp);
  1.2231 ++    }
  1.2232 ++
  1.2233 ++  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  1.2234 ++  *++yyvsp = yylval;
  1.2235 ++  YY_IGNORE_MAYBE_UNINITIALIZED_END
  1.2236 ++
  1.2237 ++
  1.2238 ++  /* Shift the error token.  */
  1.2239 ++  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
  1.2240 ++
  1.2241 ++  yystate = yyn;
  1.2242 ++  goto yynewstate;
  1.2243 ++
  1.2244 ++
  1.2245 ++/*-------------------------------------.
  1.2246 ++| yyacceptlab -- YYACCEPT comes here.  |
  1.2247 ++`-------------------------------------*/
  1.2248 ++yyacceptlab:
  1.2249 ++  yyresult = 0;
  1.2250 ++  goto yyreturn;
  1.2251 ++
  1.2252 ++/*-----------------------------------.
  1.2253 ++| yyabortlab -- YYABORT comes here.  |
  1.2254 ++`-----------------------------------*/
  1.2255 ++yyabortlab:
  1.2256 ++  yyresult = 1;
  1.2257 ++  goto yyreturn;
  1.2258 ++
  1.2259 ++#if !defined yyoverflow || YYERROR_VERBOSE
  1.2260 ++/*-------------------------------------------------.
  1.2261 ++| yyexhaustedlab -- memory exhaustion comes here.  |
  1.2262 ++`-------------------------------------------------*/
  1.2263 ++yyexhaustedlab:
  1.2264 ++  yyerror (YY_("memory exhausted"));
  1.2265 ++  yyresult = 2;
  1.2266 ++  /* Fall through.  */
  1.2267 ++#endif
  1.2268 ++
  1.2269 ++yyreturn:
  1.2270 ++  if (yychar != YYEMPTY)
  1.2271 ++    {
  1.2272 ++      /* Make sure we have latest lookahead translation.  See comments at
  1.2273 ++         user semantic actions for why this is necessary.  */
  1.2274 ++      yytoken = YYTRANSLATE (yychar);
  1.2275 ++      yydestruct ("Cleanup: discarding lookahead",
  1.2276 ++                  yytoken, &yylval);
  1.2277 ++    }
  1.2278 ++  /* Do not reclaim the symbols of the rule which action triggered
  1.2279 ++     this YYABORT or YYACCEPT.  */
  1.2280 ++  YYPOPSTACK (yylen);
  1.2281 ++  YY_STACK_PRINT (yyss, yyssp);
  1.2282 ++  while (yyssp != yyss)
  1.2283 ++    {
  1.2284 ++      yydestruct ("Cleanup: popping",
  1.2285 ++		  yystos[*yyssp], yyvsp);
  1.2286 ++      YYPOPSTACK (1);
  1.2287 ++    }
  1.2288 ++#ifndef yyoverflow
  1.2289 ++  if (yyss != yyssa)
  1.2290 ++    YYSTACK_FREE (yyss);
  1.2291 ++#endif
  1.2292 ++#if YYERROR_VERBOSE
  1.2293 ++  if (yymsg != yymsgbuf)
  1.2294 ++    YYSTACK_FREE (yymsg);
  1.2295 ++#endif
  1.2296 ++  /* Make sure YYID is used.  */
  1.2297 ++  return YYID (yyresult);
  1.2298 ++}
  1.2299 ++
  1.2300 ++
  1.2301 ++/* Line 2050 of yacc.c  */
  1.2302 ++#line 415 "ptlib/common/getdate.y"
  1.2303 ++
  1.2304 ++
  1.2305 ++/* Month and day table. */
  1.2306 ++static TABLE const MonthDayTable[] = {
  1.2307 ++    { "january",	tMONTH,  1 },
  1.2308 ++    { "february",	tMONTH,  2 },
  1.2309 ++    { "march",		tMONTH,  3 },
  1.2310 ++    { "april",		tMONTH,  4 },
  1.2311 ++    { "may",		tMONTH,  5 },
  1.2312 ++    { "june",		tMONTH,  6 },
  1.2313 ++    { "july",		tMONTH,  7 },
  1.2314 ++    { "august",		tMONTH,  8 },
  1.2315 ++    { "september",	tMONTH,  9 },
  1.2316 ++    { "sept",		tMONTH,  9 },
  1.2317 ++    { "october",	tMONTH, 10 },
  1.2318 ++    { "november",	tMONTH, 11 },
  1.2319 ++    { "december",	tMONTH, 12 },
  1.2320 ++    { "sunday",		tDAY, 0 },
  1.2321 ++    { "monday",		tDAY, 1 },
  1.2322 ++    { "tuesday",	tDAY, 2 },
  1.2323 ++    { "tues",		tDAY, 2 },
  1.2324 ++    { "wednesday",	tDAY, 3 },
  1.2325 ++    { "wednes",		tDAY, 3 },
  1.2326 ++    { "thursday",	tDAY, 4 },
  1.2327 ++    { "thur",		tDAY, 4 },
  1.2328 ++    { "thurs",		tDAY, 4 },
  1.2329 ++    { "friday",		tDAY, 5 },
  1.2330 ++    { "saturday",	tDAY, 6 },
  1.2331 ++    { NULL }
  1.2332 ++};
  1.2333 ++
  1.2334 ++/* Time units table. */
  1.2335 ++static TABLE const UnitsTable[] = {
  1.2336 ++    { "year",		tMONTH_UNIT,	12 },
  1.2337 ++    { "month",		tMONTH_UNIT,	1 },
  1.2338 ++    { "fortnight",	tMINUTE_UNIT,	14 * 24 * 60 },
  1.2339 ++    { "week",		tMINUTE_UNIT,	7 * 24 * 60 },
  1.2340 ++    { "day",		tMINUTE_UNIT,	1 * 24 * 60 },
  1.2341 ++    { "hour",		tMINUTE_UNIT,	60 },
  1.2342 ++    { "minute",		tMINUTE_UNIT,	1 },
  1.2343 ++    { "min",		tMINUTE_UNIT,	1 },
  1.2344 ++    { "second",		tSEC_UNIT,	1 },
  1.2345 ++    { "sec",		tSEC_UNIT,	1 },
  1.2346 ++    { NULL }
  1.2347 ++};
  1.2348 ++
  1.2349 ++/* Assorted relative-time words. */
  1.2350 ++static TABLE const OtherTable[] = {
  1.2351 ++    { "tomorrow",	tMINUTE_UNIT,	1 * 24 * 60 },
  1.2352 ++    { "yesterday",	tMINUTE_UNIT,	-1 * 24 * 60 },
  1.2353 ++    { "today",		tMINUTE_UNIT,	0 },
  1.2354 ++    { "now",		tMINUTE_UNIT,	0 },
  1.2355 ++    { "last",		tUNUMBER,	-1 },
  1.2356 ++    { "this",		tMINUTE_UNIT,	0 },
  1.2357 ++    { "next",		tUNUMBER,	2 },
  1.2358 ++    { "first",		tUNUMBER,	1 },
  1.2359 ++/*  { "second",		tUNUMBER,	2 }, */
  1.2360 ++    { "third",		tUNUMBER,	3 },
  1.2361 ++    { "fourth",		tUNUMBER,	4 },
  1.2362 ++    { "fifth",		tUNUMBER,	5 },
  1.2363 ++    { "sixth",		tUNUMBER,	6 },
  1.2364 ++    { "seventh",	tUNUMBER,	7 },
  1.2365 ++    { "eighth",		tUNUMBER,	8 },
  1.2366 ++    { "ninth",		tUNUMBER,	9 },
  1.2367 ++    { "tenth",		tUNUMBER,	10 },
  1.2368 ++    { "eleventh",	tUNUMBER,	11 },
  1.2369 ++    { "twelfth",	tUNUMBER,	12 },
  1.2370 ++    { "ago",		tAGO,	1 },
  1.2371 ++    { NULL }
  1.2372 ++};
  1.2373 ++
  1.2374 ++/* The timezone table. */
  1.2375 ++/* Some of these are commented out because a time_t can't store a float. */
  1.2376 ++static TABLE const TimezoneTable[] = {
  1.2377 ++    { "gmt",	tZONE,     HOUR( 0) },	/* Greenwich Mean */
  1.2378 ++    { "ut",	tZONE,     HOUR( 0) },	/* Universal (Coordinated) */
  1.2379 ++    { "utc",	tZONE,     HOUR( 0) },
  1.2380 ++    { "wet",	tZONE,     HOUR( 0) },	/* Western European */
  1.2381 ++    { "bst",	tDAYZONE,  HOUR( 0) },	/* British Summer */
  1.2382 ++    { "wat",	tZONE,     HOUR( 1) },	/* West Africa */
  1.2383 ++    { "at",	tZONE,     HOUR( 2) },	/* Azores */
  1.2384 ++#if	0
  1.2385 ++    /* For completeness.  BST is also British Summer, and GST is
  1.2386 ++     * also Guam Standard. */
  1.2387 ++    { "bst",	tZONE,     HOUR( 3) },	/* Brazil Standard */
  1.2388 ++    { "gst",	tZONE,     HOUR( 3) },	/* Greenland Standard */
  1.2389 ++#endif
  1.2390 ++#if 0
  1.2391 ++    { "nft",	tZONE,     HOUR(3.5) },	/* Newfoundland */
  1.2392 ++    { "nst",	tZONE,     HOUR(3.5) },	/* Newfoundland Standard */
  1.2393 ++    { "ndt",	tDAYZONE,  HOUR(3.5) },	/* Newfoundland Daylight */
  1.2394 ++#endif
  1.2395 ++    { "ast",	tZONE,     HOUR( 4) },	/* Atlantic Standard */
  1.2396 ++    { "adt",	tDAYZONE,  HOUR( 4) },	/* Atlantic Daylight */
  1.2397 ++    { "est",	tZONE,     HOUR( 5) },	/* Eastern Standard */
  1.2398 ++    { "edt",	tDAYZONE,  HOUR( 5) },	/* Eastern Daylight */
  1.2399 ++    { "cst",	tZONE,     HOUR( 6) },	/* Central Standard */
  1.2400 ++    { "cdt",	tDAYZONE,  HOUR( 6) },	/* Central Daylight */
  1.2401 ++    { "mst",	tZONE,     HOUR( 7) },	/* Mountain Standard */
  1.2402 ++    { "mdt",	tDAYZONE,  HOUR( 7) },	/* Mountain Daylight */
  1.2403 ++    { "pst",	tZONE,     HOUR( 8) },	/* Pacific Standard */
  1.2404 ++    { "pdt",	tDAYZONE,  HOUR( 8) },	/* Pacific Daylight */
  1.2405 ++    { "yst",	tZONE,     HOUR( 9) },	/* Yukon Standard */
  1.2406 ++    { "ydt",	tDAYZONE,  HOUR( 9) },	/* Yukon Daylight */
  1.2407 ++    { "hst",	tZONE,     HOUR(10) },	/* Hawaii Standard */
  1.2408 ++    { "hdt",	tDAYZONE,  HOUR(10) },	/* Hawaii Daylight */
  1.2409 ++    { "cat",	tZONE,     HOUR(10) },	/* Central Alaska */
  1.2410 ++    { "ahst",	tZONE,     HOUR(10) },	/* Alaska-Hawaii Standard */
  1.2411 ++    { "nt",	tZONE,     HOUR(11) },	/* Nome */
  1.2412 ++    { "idlw",	tZONE,     HOUR(12) },	/* International Date Line West */
  1.2413 ++    { "cet",	tZONE,     -HOUR(1) },	/* Central European */
  1.2414 ++    { "met",	tZONE,     -HOUR(1) },	/* Middle European */
  1.2415 ++    { "mewt",	tZONE,     -HOUR(1) },	/* Middle European Winter */
  1.2416 ++    { "mest",	tDAYZONE,  -HOUR(1) },	/* Middle European Summer */
  1.2417 ++    { "swt",	tZONE,     -HOUR(1) },	/* Swedish Winter */
  1.2418 ++    { "sst",	tDAYZONE,  -HOUR(1) },	/* Swedish Summer */
  1.2419 ++    { "fwt",	tZONE,     -HOUR(1) },	/* French Winter */
  1.2420 ++    { "fst",	tDAYZONE,  -HOUR(1) },	/* French Summer */
  1.2421 ++    { "eet",	tZONE,     -HOUR(2) },	/* Eastern Europe, USSR Zone 1 */
  1.2422 ++    { "bt",	tZONE,     -HOUR(3) },	/* Baghdad, USSR Zone 2 */
  1.2423 ++#if 0
  1.2424 ++    { "it",	tZONE,     -HOUR(3.5) },/* Iran */
  1.2425 ++#endif
  1.2426 ++    { "zp4",	tZONE,     -HOUR(4) },	/* USSR Zone 3 */
  1.2427 ++    { "zp5",	tZONE,     -HOUR(5) },	/* USSR Zone 4 */
  1.2428 ++#if 0
  1.2429 ++    { "ist",	tZONE,     -HOUR(5.5) },/* Indian Standard */
  1.2430 ++#endif
  1.2431 ++    { "zp6",	tZONE,     -HOUR(6) },	/* USSR Zone 5 */
  1.2432 ++#if	0
  1.2433 ++    /* For completeness.  NST is also Newfoundland Stanard, and SST is
  1.2434 ++     * also Swedish Summer. */
  1.2435 ++    { "nst",	tZONE,     -HOUR(6.5) },/* North Sumatra */
  1.2436 ++    { "sst",	tZONE,     -HOUR(7) },	/* South Sumatra, USSR Zone 6 */
  1.2437 ++#endif	/* 0 */
  1.2438 ++    { "wast",	tZONE,     -HOUR(7) },	/* West Australian Standard */
  1.2439 ++    { "wadt",	tDAYZONE,  -HOUR(7) },	/* West Australian Daylight */
  1.2440 ++#if 0
  1.2441 ++    { "jt",	tZONE,     -HOUR(7.5) },/* Java (3pm in Cronusland!) */
  1.2442 ++#endif
  1.2443 ++    { "cct",	tZONE,     -HOUR(8) },	/* China Coast, USSR Zone 7 */
  1.2444 ++    { "jst",	tZONE,     -HOUR(9) },	/* Japan Standard, USSR Zone 8 */
  1.2445 ++#if 0
  1.2446 ++    { "cast",	tZONE,     -HOUR(9.5) },/* Central Australian Standard */
  1.2447 ++    { "cadt",	tDAYZONE,  -HOUR(9.5) },/* Central Australian Daylight */
  1.2448 ++#endif
  1.2449 ++    { "east",	tZONE,     -HOUR(10) },	/* Eastern Australian Standard */
  1.2450 ++    { "eadt",	tDAYZONE,  -HOUR(10) },	/* Eastern Australian Daylight */
  1.2451 ++    { "gst",	tZONE,     -HOUR(10) },	/* Guam Standard, USSR Zone 9 */
  1.2452 ++    { "nzt",	tZONE,     -HOUR(12) },	/* New Zealand */
  1.2453 ++    { "nzst",	tZONE,     -HOUR(12) },	/* New Zealand Standard */
  1.2454 ++    { "nzdt",	tDAYZONE,  -HOUR(12) },	/* New Zealand Daylight */
  1.2455 ++    { "idle",	tZONE,     -HOUR(12) },	/* International Date Line East */
  1.2456 ++    {  NULL  }
  1.2457 ++};
  1.2458 ++
  1.2459 ++/* Military timezone table. */
  1.2460 ++static TABLE const MilitaryTable[] = {
  1.2461 ++    { "a",	tMILZONE,	HOUR(  1) },
  1.2462 ++    { "b",	tMILZONE,	HOUR(  2) },
  1.2463 ++    { "c",	tMILZONE,	HOUR(  3) },
  1.2464 ++    { "d",	tMILZONE,	HOUR(  4) },
  1.2465 ++    { "e",	tMILZONE,	HOUR(  5) },
  1.2466 ++    { "f",	tMILZONE,	HOUR(  6) },
  1.2467 ++    { "g",	tMILZONE,	HOUR(  7) },
  1.2468 ++    { "h",	tMILZONE,	HOUR(  8) },
  1.2469 ++    { "i",	tMILZONE,	HOUR(  9) },
  1.2470 ++    { "k",	tMILZONE,	HOUR( 10) },
  1.2471 ++    { "l",	tMILZONE,	HOUR( 11) },
  1.2472 ++    { "m",	tMILZONE,	HOUR( 12) },
  1.2473 ++    { "n",	tMILZONE,	HOUR(- 1) },
  1.2474 ++    { "o",	tMILZONE,	HOUR(- 2) },
  1.2475 ++    { "p",	tMILZONE,	HOUR(- 3) },
  1.2476 ++    { "q",	tMILZONE,	HOUR(- 4) },
  1.2477 ++    { "r",	tMILZONE,	HOUR(- 5) },
  1.2478 ++    { "s",	tMILZONE,	HOUR(- 6) },
  1.2479 ++    { "t",	tMILZONE,	HOUR(- 7) },
  1.2480 ++    { "u",	tMILZONE,	HOUR(- 8) },
  1.2481 ++    { "v",	tMILZONE,	HOUR(- 9) },
  1.2482 ++    { "w",	tMILZONE,	HOUR(-10) },
  1.2483 ++    { "x",	tMILZONE,	HOUR(-11) },
  1.2484 ++    { "y",	tMILZONE,	HOUR(-12) },
  1.2485 ++    { "z",	tZONE,		HOUR(  0) }, /* Deliberately tZONE */
  1.2486 ++    { NULL }
  1.2487 ++};
  1.2488 ++
  1.2489 ++static int LookupWord(char * buff, YYSTYPE * yylval, struct Variables * vars)
  1.2490 ++{
  1.2491 ++    register char	*p;
  1.2492 ++    register char	*q;
  1.2493 ++    register const TABLE	*tp;
  1.2494 ++    int			i;
  1.2495 ++    int			abbrev;
  1.2496 ++
  1.2497 ++    /* Make it lowercase. */
  1.2498 ++    for (p = buff; *p != '\0'; p++)
  1.2499 ++        *p = (char)tolower(*p);
  1.2500 ++
  1.2501 ++    if (strcmp(buff, "am") == 0 || strcmp(buff, "a.m.") == 0) {
  1.2502 ++	yylval->Meridian = MERam;
  1.2503 ++	return tMERIDIAN;
  1.2504 ++    }
  1.2505 ++    if (strcmp(buff, "pm") == 0 || strcmp(buff, "p.m.") == 0) {
  1.2506 ++	yylval->Meridian = MERpm;
  1.2507 ++	return tMERIDIAN;
  1.2508 ++    }
  1.2509 ++
  1.2510 ++    /* See if we have an abbreviation for a month. */
  1.2511 ++    if (strlen(buff) == 3)
  1.2512 ++	abbrev = 1;
  1.2513 ++    else if (strlen(buff) == 4 && buff[3] == '.') {
  1.2514 ++	abbrev = 1;
  1.2515 ++	buff[3] = '\0';
  1.2516 ++    }
  1.2517 ++    else
  1.2518 ++	abbrev = 0;
  1.2519 ++
  1.2520 ++    for (tp = MonthDayTable; tp->name; tp++) {
  1.2521 ++	if (abbrev) {
  1.2522 ++	    if (strncmp(buff, tp->name, 3) == 0) {
  1.2523 ++		yylval->Number = tp->value;
  1.2524 ++		return tp->type;
  1.2525 ++	    }
  1.2526 ++	}
  1.2527 ++	else if (strcmp(buff, tp->name) == 0) {
  1.2528 ++	    yylval->Number = tp->value;
  1.2529 ++	    return tp->type;
  1.2530 ++	}
  1.2531 ++    }
  1.2532 ++
  1.2533 ++    for (tp = TimezoneTable; tp->name; tp++)
  1.2534 ++	if (strcmp(buff, tp->name) == 0) {
  1.2535 ++	    yylval->Number = tp->value;
  1.2536 ++	    return tp->type;
  1.2537 ++	}
  1.2538 ++
  1.2539 ++    if (strcmp(buff, "dst") == 0) 
  1.2540 ++	return tDST;
  1.2541 ++
  1.2542 ++    for (tp = UnitsTable; tp->name; tp++)
  1.2543 ++	if (strcmp(buff, tp->name) == 0) {
  1.2544 ++	    yylval->Number = tp->value;
  1.2545 ++	    return tp->type;
  1.2546 ++	}
  1.2547 ++
  1.2548 ++    /* Strip off any plural and try the units table again. */
  1.2549 ++    i = strlen(buff) - 1;
  1.2550 ++    if (buff[i] == 's') {
  1.2551 ++	buff[i] = '\0';
  1.2552 ++	for (tp = UnitsTable; tp->name; tp++)
  1.2553 ++	    if (strcmp(buff, tp->name) == 0) {
  1.2554 ++		yylval->Number = tp->value;
  1.2555 ++		return tp->type;
  1.2556 ++	    }
  1.2557 ++	buff[i] = 's';		/* Put back for "this" in OtherTable. */
  1.2558 ++    }
  1.2559 ++
  1.2560 ++    for (tp = OtherTable; tp->name; tp++)
  1.2561 ++	if (strcmp(buff, tp->name) == 0) {
  1.2562 ++	    yylval->Number = tp->value;
  1.2563 ++	    return tp->type;
  1.2564 ++	}
  1.2565 ++
  1.2566 ++    /* Avoid confusion with 'T' in RFC3339 and 't' in Military timezones */
  1.2567 ++    if (!vars->yyHaveTime && strcmp(buff, "t") == 0)
  1.2568 ++	return tRFC3339;
  1.2569 ++ 
  1.2570 ++    /* Military timezones. */
  1.2571 ++   if (buff[1] == '\0' && isalpha(*buff)) {
  1.2572 ++	for (tp = MilitaryTable; tp->name; tp++)
  1.2573 ++	    if (strcmp(buff, tp->name) == 0) {
  1.2574 ++		yylval->Number = tp->value;
  1.2575 ++		return tp->type;
  1.2576 ++	    }
  1.2577 ++    }
  1.2578 ++
  1.2579 ++    /* Drop out any periods and try the timezone table again. */
  1.2580 ++    for (i = 0, p = q = buff; *q; q++)
  1.2581 ++	if (*q != '.')
  1.2582 ++	    *p++ = *q;
  1.2583 ++	else
  1.2584 ++	    i++;
  1.2585 ++    *p = '\0';
  1.2586 ++    if (i)
  1.2587 ++	for (tp = TimezoneTable; tp->name; tp++)
  1.2588 ++	    if (strcmp(buff, tp->name) == 0) {
  1.2589 ++		yylval->Number = tp->value;
  1.2590 ++		return tp->type;
  1.2591 ++	    }
  1.2592 ++
  1.2593 ++    for (i = 1; i <= 12; i++)
  1.2594 ++	for (abbrev = 0; abbrev < 2; abbrev++)
  1.2595 ++	    if (PTimeIsMonthName(buff, i, abbrev)) {
  1.2596 ++		yylval->Number = i;
  1.2597 ++		return tMONTH;
  1.2598 ++	    }
  1.2599 ++
  1.2600 ++    for (i = 1; i <= 7; i++)
  1.2601 ++	for (abbrev = 0; abbrev < 2; abbrev++)
  1.2602 ++	    if (PTimeIsDayName(buff, i, abbrev)) {
  1.2603 ++		yylval->Number = i;
  1.2604 ++		return tDAY;
  1.2605 ++	    }
  1.2606 ++
  1.2607 ++    return tID;
  1.2608 ++}
  1.2609 ++
  1.2610 ++
  1.2611 ++#ifdef _MSC_VER
  1.2612 ++#pragma warning(disable:4211)
  1.2613 ++#endif
  1.2614 ++
  1.2615 ++#ifndef __GNUC__
  1.2616 ++static
  1.2617 ++#endif
  1.2618 ++int yylex(YYSTYPE * yylval, struct Variables * vars)
  1.2619 ++{
  1.2620 ++    register char	*p;
  1.2621 ++    char		buff[20];
  1.2622 ++    int			Count;
  1.2623 ++    int			sign;
  1.2624 ++    register int	c = PTimeGetChar(vars->yyInput);
  1.2625 ++
  1.2626 ++    while (c != EOF && c != '\0' && c != '\n') {
  1.2627 ++	while (isspace(c))
  1.2628 ++	    c = PTimeGetChar(vars->yyInput);
  1.2629 ++
  1.2630 ++	if (isdigit(c) || c == '-' || c == '+') {
  1.2631 ++	    if (c == '-' || c == '+') {
  1.2632 ++		sign = c == '-' ? -1 : 1;
  1.2633 ++		if (!isdigit(c = PTimeGetChar(vars->yyInput)))
  1.2634 ++		    /* skip the '-' sign */
  1.2635 ++		    continue;
  1.2636 ++	    }
  1.2637 ++	    else
  1.2638 ++		sign = 0;
  1.2639 ++	    yylval->Number = 0;
  1.2640 ++            Count = 0; /* Count number of digits */
  1.2641 ++	    while (isdigit(c)) {
  1.2642 ++		yylval->Number = 10 * yylval->Number + c - '0';
  1.2643 ++		c = PTimeGetChar(vars->yyInput);
  1.2644 ++                Count++;
  1.2645 ++	    }
  1.2646 ++	    PTimeUngetChar(vars->yyInput, c);
  1.2647 ++	    if (sign < 0)
  1.2648 ++		yylval->Number = -yylval->Number;
  1.2649 ++            if (Count == 4)
  1.2650 ++              return sign ? tS4DIGITNUMBER : t4DIGITNUMBER;
  1.2651 ++	    if (sign)
  1.2652 ++              return tSNUMBER;
  1.2653 ++            if (Count == 6)
  1.2654 ++              return t6DIGITNUMBER;
  1.2655 ++            if (Count == 8)
  1.2656 ++              return t8DIGITNUMBER;
  1.2657 ++            return tUNUMBER;
  1.2658 ++	}
  1.2659 ++
  1.2660 ++	if (isalpha(c)) {
  1.2661 ++	    for (p = buff; isalpha(c) || c == '.'; c = PTimeGetChar(vars->yyInput)) {
  1.2662 ++		if (p < &buff[sizeof(buff)-1])
  1.2663 ++		    *p++ = (char)c;
  1.2664 ++	    }
  1.2665 ++	    *p = '\0';
  1.2666 ++	    PTimeUngetChar(vars->yyInput, c);
  1.2667 ++	    return LookupWord(buff, yylval, vars);
  1.2668 ++	}
  1.2669 ++
  1.2670 ++	if (c != '(')
  1.2671 ++	    return c;
  1.2672 ++
  1.2673 ++	Count = 0;
  1.2674 ++	do {
  1.2675 ++	    c = PTimeGetChar(vars->yyInput);
  1.2676 ++	    if (c == '\0' || c == EOF)
  1.2677 ++		return c;
  1.2678 ++	    if (c == '(')
  1.2679 ++		Count++;
  1.2680 ++	    else if (c == ')')
  1.2681 ++		Count--;
  1.2682 ++	} while (Count > 0);
  1.2683 ++    }
  1.2684 ++
  1.2685 ++    if (c == '\n')
  1.2686 ++        PTimeUngetChar(vars->yyInput, c);
  1.2687 ++
  1.2688 ++    return EOF;
  1.2689 ++}
  1.2690 ++
  1.2691 ++#ifdef _MSC_VER
  1.2692 ++#pragma warning(default:4211)
  1.2693 ++#endif
  1.2694 ++
  1.2695 ++
  1.2696 ++static time_t ToSeconds(time_t Hours, time_t Minutes, time_t Seconds,
  1.2697 ++			MERIDIAN Meridian)
  1.2698 ++{
  1.2699 ++    if (Minutes < 0 || Minutes > 59 || Seconds < 0 || Seconds > 59)
  1.2700 ++	return -1;
  1.2701 ++    switch (Meridian) {
  1.2702 ++    case MER24:
  1.2703 ++	if (Hours < 0 || Hours > 23)
  1.2704 ++	    return -1;
  1.2705 ++	return (Hours * 60L + Minutes) * 60L + Seconds;
  1.2706 ++    case MERam:
  1.2707 ++	if (Hours < 1 || Hours > 12)
  1.2708 ++	    return -1;
  1.2709 ++	if (Hours == 12)
  1.2710 ++	    Hours = 0;
  1.2711 ++	return (Hours * 60L + Minutes) * 60L + Seconds;
  1.2712 ++    case MERpm:
  1.2713 ++	if (Hours < 1 || Hours > 12)
  1.2714 ++	    return -1;
  1.2715 ++	if (Hours == 12)
  1.2716 ++	    Hours = 0;
  1.2717 ++	return ((Hours + 12) * 60L + Minutes) * 60L + Seconds;
  1.2718 ++    }
  1.2719 ++
  1.2720 ++    return -1;
  1.2721 ++}
  1.2722 ++
  1.2723 ++
  1.2724 ++static time_t Convert(time_t Month, time_t Day, time_t Year,
  1.2725 ++		      time_t Hours, time_t Minutes, time_t Seconds,
  1.2726 ++		      MERIDIAN Meridian, DSTMODE DSTmode, time_t yyTimezone)
  1.2727 ++{
  1.2728 ++    static int DaysInMonth[12] = {
  1.2729 ++	31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
  1.2730 ++    };
  1.2731 ++    time_t	tod;
  1.2732 ++    time_t	Julian;
  1.2733 ++    int		i;
  1.2734 ++
  1.2735 ++    if (Year < 0)
  1.2736 ++	Year = -Year;
  1.2737 ++    if (Year < 70)
  1.2738 ++	Year += 2000;
  1.2739 ++    else if (Year < 100)
  1.2740 ++	Year += 1900;
  1.2741 ++    DaysInMonth[1] = Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0)
  1.2742 ++		    ? 29 : 28;
  1.2743 ++    /* Checking for 2038 bogusly assumes that time_t is 32 bits.  But
  1.2744 ++       I'm too lazy to try to check for time_t overflow in another way.  */
  1.2745 ++    if (Year < EPOCH || Year > 2038
  1.2746 ++     || Month < 1 || Month > 12
  1.2747 ++     /* Lint fluff:  "conversion from long may lose accuracy" */
  1.2748 ++     || Day < 1 || Day > DaysInMonth[(int)--Month])
  1.2749 ++	return -1;
  1.2750 ++
  1.2751 ++    for (Julian = Day - 1, i = 0; i < Month; i++)
  1.2752 ++	Julian += DaysInMonth[i];
  1.2753 ++    for (i = EPOCH; i < Year; i++)
  1.2754 ++	Julian += 365 + (i % 4 == 0);
  1.2755 ++    Julian *= SECSPERDAY;
  1.2756 ++    Julian += yyTimezone * 60L;
  1.2757 ++    if ((tod = ToSeconds(Hours, Minutes, Seconds, Meridian)) < 0)
  1.2758 ++	return -1;
  1.2759 ++    Julian += tod;
  1.2760 ++    if (DSTmode == DSTon
  1.2761 ++     || (DSTmode == DSTmaybe && localtime(&Julian)->tm_isdst))
  1.2762 ++	Julian -= 60 * 60;
  1.2763 ++    return Julian;
  1.2764 ++}
  1.2765 ++
  1.2766 ++
  1.2767 ++static time_t DSTcorrect(time_t Start, time_t Future)
  1.2768 ++{
  1.2769 ++    time_t	StartDay;
  1.2770 ++    time_t	FutureDay;
  1.2771 ++
  1.2772 ++    StartDay = (localtime(&Start)->tm_hour + 1) % 24;
  1.2773 ++    FutureDay = (localtime(&Future)->tm_hour + 1) % 24;
  1.2774 ++    return (Future - Start) + (StartDay - FutureDay) * 60L * 60L;
  1.2775 ++}
  1.2776 ++
  1.2777 ++
  1.2778 ++static time_t RelativeDate(time_t Start, time_t DayOrdinal, time_t DayNumber)
  1.2779 ++{
  1.2780 ++    struct tm	*tm;
  1.2781 ++    time_t	now;
  1.2782 ++
  1.2783 ++    now = Start;
  1.2784 ++    tm = localtime(&now);
  1.2785 ++    now += SECSPERDAY * ((DayNumber - tm->tm_wday + 7) % 7);
  1.2786 ++    now += 7 * SECSPERDAY * (DayOrdinal <= 0 ? DayOrdinal : DayOrdinal - 1);
  1.2787 ++    return DSTcorrect(Start, now);
  1.2788 ++}
  1.2789 ++
  1.2790 ++
  1.2791 ++static time_t RelativeMonth(time_t Start, time_t RelMonth, time_t yyTimezone)
  1.2792 ++{
  1.2793 ++    struct tm	*tm;
  1.2794 ++    time_t	Month;
  1.2795 ++    time_t	Year;
  1.2796 ++
  1.2797 ++    if (RelMonth == 0)
  1.2798 ++	return 0;
  1.2799 ++    tm = localtime(&Start);
  1.2800 ++    Month = 12 * tm->tm_year + tm->tm_mon + RelMonth;
  1.2801 ++    Year = Month / 12 + 1900;
  1.2802 ++    Month = Month % 12 + 1;
  1.2803 ++    return DSTcorrect(Start,
  1.2804 ++	    Convert(Month, (time_t)tm->tm_mday, Year,
  1.2805 ++		(time_t)tm->tm_hour, (time_t)tm->tm_min, (time_t)tm->tm_sec,
  1.2806 ++		MER24, DSTmaybe, yyTimezone));
  1.2807 ++}
  1.2808 ++
  1.2809 ++
  1.2810 ++static void SetPossibleDate(struct Variables * var,
  1.2811 ++			      time_t possible_day,
  1.2812 ++			      time_t possible_month,
  1.2813 ++			      time_t possible_year)
  1.2814 ++{
  1.2815 ++    int date_order;
  1.2816 ++
  1.2817 ++    if (possible_day > 31) /* test for ymd */
  1.2818 ++	date_order = 2;
  1.2819 ++    else if (possible_day > 12) /* test for dmy */
  1.2820 ++	date_order = 1;
  1.2821 ++    else if (possible_month > 12) /* test for mdy */
  1.2822 ++	date_order = 0;
  1.2823 ++    else
  1.2824 ++	date_order = PTimeGetDateOrder();
  1.2825 ++
  1.2826 ++    switch (date_order) {
  1.2827 ++      case 0 :
  1.2828 ++	var->yyDay   = possible_month;
  1.2829 ++	var->yyMonth = possible_day;
  1.2830 ++	var->yyYear  = possible_year;
  1.2831 ++	break;
  1.2832 ++      case 1 :
  1.2833 ++	var->yyDay   = possible_day;
  1.2834 ++	var->yyMonth = possible_month;
  1.2835 ++	var->yyYear  = possible_year;
  1.2836 ++	break;
  1.2837 ++      default :
  1.2838 ++	var->yyDay   = possible_year;
  1.2839 ++	var->yyMonth = possible_month;
  1.2840 ++	var->yyYear  = possible_day;
  1.2841 ++    }
  1.2842 ++}
  1.2843 ++
  1.2844 ++
  1.2845 ++time_t STDAPICALLTYPE PTimeParse(void * inputStream, struct tm * now, int timezone)
  1.2846 ++{
  1.2847 ++    time_t		Start;
  1.2848 ++    struct Variables	var;
  1.2849 ++
  1.2850 ++
  1.2851 ++    var.yyInput = inputStream;
  1.2852 ++    var.yyYear = now->tm_year + 1900;
  1.2853 ++    var.yyMonth = now->tm_mon + 1;
  1.2854 ++    var.yyDay = now->tm_mday;
  1.2855 ++    var.yyTimezone = -timezone;
  1.2856 ++    var.yyDSTmode = DSTmaybe;
  1.2857 ++    var.yyHour = 0;
  1.2858 ++    var.yyMinutes = 0;
  1.2859 ++    var.yySeconds = 0;
  1.2860 ++    var.yyMeridian = MER24;
  1.2861 ++    var.yyRelSeconds = 0;
  1.2862 ++    var.yyRelMonth = 0;
  1.2863 ++    var.yyHaveDate = 0;
  1.2864 ++    var.yyHaveDay = 0;
  1.2865 ++    var.yyHaveRel = 0;
  1.2866 ++    var.yyHaveTime = 0;
  1.2867 ++    var.yyHaveZone = 0;
  1.2868 ++
  1.2869 ++    yyparse(&var);
  1.2870 ++
  1.2871 ++    if (var.yyHaveTime > 1 || var.yyHaveZone > 1 ||
  1.2872 ++	var.yyHaveDate > 1 || var.yyHaveDay > 1)
  1.2873 ++	return -1;
  1.2874 ++
  1.2875 ++    if (var.yyHaveTime == 0 && var.yyHaveZone == 0 &&
  1.2876 ++	var.yyHaveDate == 0 && var.yyHaveDay == 0 && var.yyHaveRel == 0)
  1.2877 ++	return -1;
  1.2878 ++
  1.2879 ++    if (var.yyHaveDate || var.yyHaveTime || var.yyHaveDay) {
  1.2880 ++	Start = Convert(var.yyMonth, var.yyDay, var.yyYear,
  1.2881 ++			var.yyHour, var.yyMinutes, var.yySeconds,
  1.2882 ++			var.yyMeridian, var.yyDSTmode, var.yyTimezone);
  1.2883 ++	if (Start < 0)
  1.2884 ++	    return -1;
  1.2885 ++    }
  1.2886 ++    else {
  1.2887 ++	time(&Start);
  1.2888 ++	if (!var.yyHaveRel)
  1.2889 ++	    Start -= ((now->tm_hour * 60L + now->tm_min) * 60L) + now->tm_sec;
  1.2890 ++    }
  1.2891 ++
  1.2892 ++    Start += var.yyRelSeconds;
  1.2893 ++    Start += RelativeMonth(Start, var.yyRelMonth, var.yyTimezone);
  1.2894 ++
  1.2895 ++    if (var.yyHaveDay && !var.yyHaveDate)
  1.2896 ++	Start += RelativeDate(Start, var.yyDayOrdinal, var.yyDayNumber);
  1.2897 ++
  1.2898 ++    /* Have to do *something* with a legitimate -1 so it's distinguishable
  1.2899 ++     * from the error return value.  (Alternately could set errno on error.) */
  1.2900 ++    return Start == -1 ? 0 : Start;
  1.2901 ++}
  1.2902 ++
  1.2903 ++
  1.2904 ++#ifdef _MSC_VER
  1.2905 ++#pragma warning(disable:4028 4100 4211)
  1.2906 ++#endif
  1.2907 ++
  1.2908 ++#ifdef __GNUC__
  1.2909 ++int yyerror(const char * s)
  1.2910 ++{
  1.2911 ++  return 0;
  1.2912 ++}
  1.2913 ++#else
  1.2914 ++static void yyerror(const char * s)
  1.2915 ++{
  1.2916 ++}
  1.2917 ++#endif
  1.2918 ++
  1.2919 ++#ifdef _MSC_VER
  1.2920 ++#pragma warning(default:4028 4100 4211)
  1.2921 ++#endif
  1.2922 ++
  1.2923 ++
  1.2924 ++/* End of file ***************************************************************/
  1.2925 +diff -Naur ptlib-2.10.11.orig/src/ptlib/unix/svcproc.cxx ptlib-2.10.11/src/ptlib/unix/svcproc.cxx
  1.2926 +--- ptlib-2.10.11.orig/src/ptlib/unix/svcproc.cxx	2013-08-14 18:20:26.000000000 -0500
  1.2927 ++++ ptlib-2.10.11/src/ptlib/unix/svcproc.cxx	2016-05-04 19:42:20.526529457 -0500
  1.2928 +@@ -217,7 +217,7 @@
  1.2929 +     pid_t pid;
  1.2930 + 
  1.2931 +     {
  1.2932 +-      ifstream pidfile(pidfilename);
  1.2933 ++      ifstream pidfile((std::string&)pidfilename);
  1.2934 +       if (!pidfile.is_open()) {
  1.2935 +         cout << "Could not open pid file: \"" << pidfilename << "\""
  1.2936 +                 " - " << strerror(errno) << endl;
  1.2937 +@@ -384,7 +384,7 @@
  1.2938 +   // Run as a daemon, ie fork
  1.2939 + 
  1.2940 +   if (!pidfilename) {
  1.2941 +-    ifstream pidfile(pidfilename);
  1.2942 ++    ifstream pidfile((std::string&)pidfilename);
  1.2943 +     if (pidfile.is_open()) {
  1.2944 +       pid_t pid;
  1.2945 +       pidfile >> pid;
  1.2946 +@@ -412,7 +412,7 @@
  1.2947 +       cout << "Daemon started with pid " << pid << endl;
  1.2948 +       if (!pidfilename) {
  1.2949 +         // Write out the child pid to magic file in /var/run (at least for linux)
  1.2950 +-        ofstream pidfile(pidfilename);
  1.2951 ++        ofstream pidfile((std::string&)pidfilename);
  1.2952 +         if (pidfile.is_open())
  1.2953 +           pidfile << pid;
  1.2954 +         else