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