ddc9c07f6eed32a34d962d28ab6a29f7c65d2277
[AXE.git] / src / dateyacc.c
1 /* A Bison parser, made from dateyacc.y
2    by GNU bison 1.35.  */
3
4 #define YYBISON 1  /* Identify Bison output.  */
5
6 # define        DAY_NAME        257
7 # define        MONTH_NAME      258
8 # define        NUM9    259
9 # define        NUM23   260
10 # define        NUM59   261
11 # define        NUM99   262
12 # define        NUM2359 263
13 # define        NUM9999 264
14 # define        NUM235959       265
15 # define        NUM991231       266
16 # define        NUM99991231     267
17 # define        AMPM    268
18 # define        STD_ZONE        269
19 # define        DST_ZONE        270
20 # define        DST_SUFFIX      271
21
22 #line 37 "dateyacc.y"
23
24 #ifdef RCSIDENT
25 static char rcsident[] = "$Header: /cvsroot/lib/AXE/src/Attic/dateyacc.c,v 1.1 2002-07-25 08:01:26 arjen Exp $";
26 #endif RCSIDENT
27
28 #include <stdio.h>
29 #include "parsedate.h"
30 struct parseddate yyans;
31
32 /* No error routine is needed here. */
33 #define yyerror(s)
34
35 #line 50 "dateyacc.y"
36 #ifndef YYSTYPE
37 typedef union {
38     int IntVal;
39 } yystype;
40 # define YYSTYPE yystype
41 # define YYSTYPE_IS_TRIVIAL 1
42 #endif
43 #ifndef YYDEBUG
44 # define YYDEBUG 0
45 #endif
46
47
48
49 #define YYFINAL         189
50 #define YYFLAG          -32768
51 #define YYNTBASE        23
52
53 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
54 #define YYTRANSLATE(x) ((unsigned)(x) <= 271 ? yytranslate[x] : 42)
55
56 /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
57 static const char yytranslate[] =
58 {
59        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
60        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
61        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
62        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
63        2,     2,     2,    22,     2,    19,    18,    20,     2,     2,
64        2,     2,     2,     2,     2,     2,     2,     2,    21,     2,
65        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
66        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
67        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
68        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
69        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
70        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
71        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
72        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
73        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
74        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
75        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
76        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
77        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
78        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
79        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
80        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
81        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
82        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
83        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
84        2,     2,     2,     2,     2,     2,     1,     3,     4,     5,
85        6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
86       16,    17
87 };
88
89 #if YYDEBUG
90 static const short yyprhs[] =
91 {
92        0,     0,     2,     4,     6,     8,    10,    13,    17,    22,
93       26,    31,    34,    38,    43,    47,    52,    54,    57,    61,
94       64,    68,    71,    75,    80,    83,    87,    91,    95,    99,
95      102,   106,   111,   113,   116,   120,   125,   128,   132,   136,
96      140,   144,   147,   151,   156,   158,   161,   165,   168,   172,
97      176,   181,   186,   190,   195,   200,   202,   204,   208,   212,
98      217,   219,   221,   224,   227,   231,   237,   241,   244,   248,
99      254,   258,   260,   262,   264,   267,   270,   273,   277,   281,
100      285,   289,   293,   295,   297,   299,   301,   303,   305,   308,
101      310,   313,   316,   320,   322,   324,   328,   332,   338,   344,
102      348,   352,   358,   364,   368,   372,   374,   376,   378,   381,
103      384,   388,   390,   393,   396,   400,   403,   407,   409,   413,
104      417,   419,   423,   427,   429
105 };
106 static const short yyrhs[] =
107 {
108        6,     0,     7,     0,     5,     0,    23,     0,    30,     0,
109       30,    26,     0,    30,    26,    35,     0,    30,    26,    35,
110       33,     0,    30,    26,    33,     0,    30,    26,    33,    35,
111        0,    30,    35,     0,    30,    35,    26,     0,    30,    35,
112       26,    33,     0,    30,    35,    33,     0,    30,    35,    33,
113       26,     0,    27,     0,    27,    26,     0,    27,    26,    35,
114        0,    27,    35,     0,    27,    35,    26,     0,    26,    30,
115        0,    26,    30,    35,     0,    26,    30,    35,    33,     0,
116       26,    27,     0,    26,    27,    35,     0,    26,    35,    30,
117        0,    26,    35,    27,     0,    26,    35,    28,     0,    26,
118       28,     0,    26,    28,    35,     0,    26,    33,    35,    30,
119        0,    35,     0,    35,    30,     0,    35,    30,    26,     0,
120       35,    30,    26,    33,     0,    35,    27,     0,    35,    27,
121       26,     0,    35,    26,    30,     0,    35,    26,    27,     0,
122       35,    26,    28,     0,    35,    28,     0,    35,    28,    26,
123        0,    35,    33,    26,    30,     0,    28,     0,    28,    26,
124        0,    28,    26,    35,     0,    28,    35,     0,    28,    35,
125       26,     0,    33,    26,    30,     0,    33,    26,    30,    35,
126        0,    33,    26,    35,    30,     0,    33,    35,    30,     0,
127       33,    35,    30,    26,     0,    33,    35,    26,    30,     0,
128        9,     0,    26,     0,    29,    18,    41,     0,    29,    18,
129       35,     0,    29,    18,    35,    26,     0,     1,     0,     3,
130        0,     3,    18,     0,    30,    33,     0,    31,    19,    33,
131        0,    24,    19,    24,    19,    33,     0,    32,    20,    33,
132        0,    33,    30,     0,    33,    19,    31,     0,    33,    19,
133       24,    19,    24,     0,    33,    20,    32,     0,    29,     0,
134       12,     0,    13,     0,    24,    34,     0,    34,    24,     0,
135       24,    24,     0,    24,    19,    34,     0,    34,    19,    24,
136        0,    24,    20,    34,     0,    34,    20,    24,     0,    24,
137       20,    24,     0,     7,     0,     6,     0,     8,     0,     9,
138        0,    10,     0,     4,     0,     4,    18,     0,    37,     0,
139       36,    38,     0,    36,    39,     0,    36,    38,    39,     0,
140        9,     0,    37,     0,     5,    21,    23,     0,     5,    18,
141       23,     0,     5,    21,    23,    21,    23,     0,     5,    18,
142       23,    18,    23,     0,     6,    21,    23,     0,     6,    18,
143       23,     0,     6,    21,    23,    21,    23,     0,     6,    18,
144       23,    18,    23,     0,     9,    21,    23,     0,     9,    18,
145       23,     0,    11,     0,    14,     0,    15,     0,    15,    17,
146        0,    19,    15,     0,    19,    15,    17,     0,    16,     0,
147       19,    16,     0,    22,    40,     0,    19,    22,    40,     0,
148       19,    40,     0,    19,    19,    40,     0,     5,     0,     5,
149       21,    23,     0,     5,    18,    23,     0,     6,     0,     6,
150       21,    23,     0,     6,    18,    23,     0,     9,     0,     9,
151        0
152 };
153
154 #endif
155
156 #if YYDEBUG
157 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
158 static const short yyrline[] =
159 {
160        0,    72,    74,    77,    79,    82,    84,    85,    86,    87,
161       88,    89,    90,    91,    92,    93,    94,    95,    96,    97,
162       98,    99,   100,   101,   102,   103,   104,   105,   106,   107,
163      108,   109,   110,   111,   112,   113,   114,   115,   116,   117,
164      118,   119,   120,   121,   122,   123,   124,   125,   126,   127,
165      128,   129,   130,   131,   132,   133,   138,   139,   140,   141,
166      142,   148,   151,   155,   157,   158,   160,   163,   165,   166,
167      168,   169,   172,   179,   186,   189,   191,   195,   198,   202,
168      205,   207,   211,   214,   216,   218,   220,   224,   227,   231,
169      233,   234,   235,   238,   244,   247,   253,   258,   263,   268,
170      273,   278,   283,   288,   293,   298,   305,   315,   318,   320,
171      322,   324,   326,   328,   330,   332,   334,   338,   341,   343,
172      345,   347,   349,   351,   355
173 };
174 #endif
175
176
177 #if (YYDEBUG) || defined YYERROR_VERBOSE
178
179 /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
180 static const char *const yytname[] =
181 {
182   "$", "error", "$undefined.", "DAY_NAME", "MONTH_NAME", "NUM9", "NUM23", 
183   "NUM59", "NUM99", "NUM2359", "NUM9999", "NUM235959", "NUM991231", 
184   "NUM99991231", "AMPM", "STD_ZONE", "DST_ZONE", "DST_SUFFIX", "'.'", 
185   "'-'", "'/'", "':'", "'+'", "num59", "num", "goal", "dayname", 
186   "date.year", "year.date", "yymmdd", "date", "hyphen.date", "slash.date", 
187   "year", "month.name", "time", "hour", "hour.alone", "am.pm", "zone", 
188   "zone.offset", "time2359", 0
189 };
190 #endif
191
192 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
193 static const short yyr1[] =
194 {
195        0,    23,    23,    24,    24,    25,    25,    25,    25,    25,
196       25,    25,    25,    25,    25,    25,    25,    25,    25,    25,
197       25,    25,    25,    25,    25,    25,    25,    25,    25,    25,
198       25,    25,    25,    25,    25,    25,    25,    25,    25,    25,
199       25,    25,    25,    25,    25,    25,    25,    25,    25,    25,
200       25,    25,    25,    25,    25,    25,    25,    25,    25,    25,
201       25,    26,    26,    27,    27,    27,    27,    28,    28,    28,
202       28,    28,    29,    29,    30,    30,    30,    31,    31,    32,
203       32,    32,    33,    33,    33,    33,    33,    34,    34,    35,
204       35,    35,    35,    36,    36,    37,    37,    37,    37,    37,
205       37,    37,    37,    37,    37,    37,    38,    39,    39,    39,
206       39,    39,    39,    39,    39,    39,    39,    40,    40,    40,
207       40,    40,    40,    40,    41
208 };
209
210 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
211 static const short yyr2[] =
212 {
213        0,     1,     1,     1,     1,     1,     2,     3,     4,     3,
214        4,     2,     3,     4,     3,     4,     1,     2,     3,     2,
215        3,     2,     3,     4,     2,     3,     3,     3,     3,     2,
216        3,     4,     1,     2,     3,     4,     2,     3,     3,     3,
217        3,     2,     3,     4,     1,     2,     3,     2,     3,     3,
218        4,     4,     3,     4,     4,     1,     1,     3,     3,     4,
219        1,     1,     2,     2,     3,     5,     3,     2,     3,     5,
220        3,     1,     1,     1,     2,     2,     2,     3,     3,     3,
221        3,     3,     1,     1,     1,     1,     1,     1,     2,     1,
222        2,     2,     3,     1,     1,     3,     3,     5,     5,     3,
223        3,     5,     5,     3,     3,     1,     1,     1,     2,     2,
224        3,     1,     2,     2,     3,     2,     3,     1,     3,     3,
225        1,     3,     3,     1,     1
226 };
227
228 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
229    doesn't specify something else to do.  Zero means the default is an
230    error. */
231 static const short yydefact[] =
232 {
233        0,    60,    61,    87,     3,     1,     2,    84,    85,    86,
234      105,    72,    73,     4,     0,    56,    16,    44,    71,     5,
235        0,     0,     0,     0,    32,     0,    89,    62,    88,     0,
236        0,     0,     0,     0,     0,     3,     1,     2,     0,     0,
237       76,    74,    85,    24,    29,    71,    21,     0,     0,     0,
238        0,    93,    17,    19,    45,    47,     0,    83,    82,     6,
239       63,    11,     0,     0,     1,     0,     0,     0,     0,    67,
240        0,     0,     0,     0,    75,     1,    85,     0,    36,    41,
241       33,     0,   106,   107,   111,     0,     0,    90,    91,    96,
242       95,   100,    99,   104,   103,     0,    77,    81,    79,    25,
243       30,    22,     0,    27,    28,    26,     0,    18,    20,    46,
244       48,    93,    58,    57,     9,     7,    83,    12,    14,    64,
245       66,     0,    68,     0,     0,    70,     0,    49,     0,     0,
246       52,    78,    80,    39,    40,    38,    37,    42,    34,     0,
247      108,   117,   120,   123,   109,   112,     0,     0,   115,   113,
248       92,     0,     0,     0,     0,     0,    23,    31,    59,    10,
249        8,    13,    15,     0,    50,    51,    54,    53,    35,    43,
250        0,     0,     0,     0,   110,   116,   114,    98,    97,   102,
251      101,    65,    69,   119,   118,   122,   121,     0,     0,     0
252 };
253
254 static const short yydefgoto[] =
255 {
256       13,    67,   187,    15,    16,    17,    45,    69,    20,    21,
257       60,    70,    24,    25,    26,    87,    88,   148,   113
258 };
259
260 static const short yypact[] =
261 {
262      255,-32768,    -6,    16,    14,    22,    46,-32768,    84,-32768,
263   -32768,-32768,-32768,-32768,   231,   276,   307,   307,    18,   298,
264       -3,    36,   148,    -2,   266,   305,   314,-32768,-32768,    40,
265       40,    40,    40,    40,    40,-32768,-32768,-32768,   370,   370,
266   -32768,-32768,   102,   238,   238,-32768,   345,   207,   287,    14,
267       24,    83,   238,    55,   238,    55,   352,    24,-32768,   345,
268   -32768,   331,   358,   358,    24,   370,   370,   370,   338,-32768,
269      218,   366,   218,   218,-32768,    57,-32768,   287,    55,    55,
270      331,    90,-32768,    47,-32768,   183,   156,    92,-32768,    51,
271       50,    58,    54,-32768,-32768,    62,-32768,-32768,-32768,-32768,
272   -32768,   358,   370,-32768,-32768,   358,   235,-32768,-32768,-32768,
273   -32768,     1,    55,-32768,   238,   358,-32768,   358,    55,-32768,
274   -32768,    67,-32768,    72,    93,-32768,   105,   238,   370,   370,
275       55,-32768,-32768,-32768,-32768,   358,-32768,-32768,   358,   370,
276   -32768,   101,   118,-32768,   109,-32768,   156,   156,-32768,-32768,
277   -32768,    40,    40,    40,    40,   358,-32768,-32768,-32768,-32768,
278   -32768,-32768,-32768,   370,-32768,-32768,-32768,-32768,-32768,-32768,
279       40,    40,    40,    40,-32768,-32768,-32768,-32768,-32768,-32768,
280   -32768,-32768,-32768,-32768,-32768,-32768,-32768,   134,   137,-32768
281 };
282
283 static const short yypgoto[] =
284 {
285      -23,     0,-32768,   116,     5,     6,   142,    44,    79,    94,
286       26,    13,   163,-32768,-32768,-32768,    69,   -84,-32768
287 };
288
289
290 #define YYLAST          377
291
292
293 static const short yytable[] =
294 {
295       14,  -124,   149,    35,    36,    37,    89,    90,    91,    92,
296       93,    94,    27,    23,    40,    14,    62,    72,    73,    33,
297       43,    44,    34,    74,    14,   -83,    22,    41,    23,    78,
298       79,   -83,    29,   -83,    28,    30,    56,    23,    95,    97,
299       31,    47,    31,    32,    19,    32,    36,    37,    14,   -82,
300       81,    96,    98,   103,   104,   -82,    63,   -82,     2,    46,
301      -83,    23,   175,   176,   140,   121,   124,    40,    80,   151,
302       74,   152,   131,   132,   106,   154,   153,    14,   123,   126,
303       41,   155,   133,   134,   -55,   114,   163,   118,   119,   120,
304       23,    72,   105,     2,     3,    35,    36,    37,   -93,   -93,
305      -93,    33,    33,   106,    34,    34,   -93,    83,    84,    65,
306       66,    85,   127,    39,    86,   130,   -93,   -93,   -93,   170,
307       33,   135,   171,    34,   -93,    73,   174,   156,   177,   178,
308      179,   180,    52,    54,   188,    59,   172,   189,    68,   173,
309       77,   160,    18,   161,   122,     0,   157,   183,   184,   185,
310      186,     2,     3,     4,    64,    37,   150,    51,     0,    10,
311      125,   141,   142,   182,   168,   143,     0,    65,    66,   108,
312        0,   110,   165,   166,     0,     0,    96,   117,    48,    53,
313       55,   181,    61,   169,     0,    71,     0,   129,   141,   142,
314        0,     0,   143,     0,   136,   137,   138,   139,   144,   145,
315        0,     0,   146,     0,     0,   147,    99,   100,     0,   101,
316      102,     3,     4,    64,    37,   107,    51,   109,    10,   112,
317        0,     0,   115,    35,    36,    37,    65,    66,   158,     0,
318        0,   128,     0,     0,   162,     3,    35,    36,    37,     3,
319       35,    36,    37,    49,    50,     0,   167,    51,     0,    10,
320       38,    39,     0,     0,    65,    66,     1,     0,     2,     3,
321        4,     5,     6,     7,     8,     9,    10,    11,    12,     2,
322        3,    35,    75,     6,     7,    76,     9,   159,    11,    12,
323        3,     4,     5,     6,     7,    42,     9,    10,    11,    12,
324      164,     3,    35,    75,     6,     7,    76,     9,     0,    11,
325       12,     2,     0,    49,    57,    58,     7,    42,     9,    10,
326        2,     0,    49,    50,     0,     0,    51,     0,    10,    82,
327       83,    84,     0,     0,    85,     0,     0,    86,   -94,   -94,
328      -94,     0,     0,   -94,     2,     0,   -94,   116,    58,     7,
329       76,     9,     3,     4,    64,    37,     0,    51,     0,    10,
330       49,    57,    58,     7,    42,     9,    10,    49,    50,     0,
331        0,   111,     0,    10,   116,    58,     7,    76,     9,     2,
332        3,    35,    36,    37,     3,    35,    36,    37
333 };
334
335 static const short yycheck[] =
336 {
337        0,     0,    86,     5,     6,     7,    29,    30,    31,    32,
338       33,    34,    18,     0,    14,    15,    19,    19,    20,    18,
339       15,    15,    21,    23,    24,     3,     0,    14,    15,    24,
340       24,     9,    18,    11,    18,    21,    18,    24,    38,    39,
341       18,    15,    18,    21,     0,    21,     6,     7,    48,     3,
342       24,    38,    39,    48,    48,     9,    20,    11,     3,    15,
343        3,    48,   146,   147,    17,    65,    66,    67,    24,    18,
344       70,    21,    72,    73,    48,    21,    18,    77,    65,    66,
345       67,    19,    77,    77,     0,    59,    19,    61,    62,    63,
346       77,    19,    48,     3,     4,     5,     6,     7,    14,    15,
347       16,    18,    18,    77,    21,    21,    22,    15,    16,    19,
348       20,    19,    68,    20,    22,    71,    14,    15,    16,    18,
349       18,    77,    21,    21,    22,    20,    17,   101,   151,   152,
350      153,   154,    16,    17,     0,    19,    18,     0,    22,    21,
351       24,   115,     0,   117,    65,    -1,   102,   170,   171,   172,
352      173,     3,     4,     5,     6,     7,    87,     9,    -1,    11,
353       66,     5,     6,   163,   138,     9,    -1,    19,    20,    53,
354       -1,    55,   128,   129,    -1,    -1,   163,    61,    15,    16,
355       17,   155,    19,   139,    -1,    22,    -1,    71,     5,     6,
356       -1,    -1,     9,    -1,    78,    79,    80,    81,    15,    16,
357       -1,    -1,    19,    -1,    -1,    22,    43,    44,    -1,    46,
358       47,     4,     5,     6,     7,    52,     9,    54,    11,    56,
359       -1,    -1,    59,     5,     6,     7,    19,    20,   112,    -1,
360       -1,    68,    -1,    -1,   118,     4,     5,     6,     7,     4,
361        5,     6,     7,     5,     6,    -1,   130,     9,    -1,    11,
362       19,    20,    -1,    -1,    19,    20,     1,    -1,     3,     4,
363        5,     6,     7,     8,     9,    10,    11,    12,    13,     3,
364        4,     5,     6,     7,     8,     9,    10,   114,    12,    13,
365        4,     5,     6,     7,     8,     9,    10,    11,    12,    13,
366      127,     4,     5,     6,     7,     8,     9,    10,    -1,    12,
367       13,     3,    -1,     5,     6,     7,     8,     9,    10,    11,
368        3,    -1,     5,     6,    -1,    -1,     9,    -1,    11,    14,
369       15,    16,    -1,    -1,    19,    -1,    -1,    22,    14,    15,
370       16,    -1,    -1,    19,     3,    -1,    22,     6,     7,     8,
371        9,    10,     4,     5,     6,     7,    -1,     9,    -1,    11,
372        5,     6,     7,     8,     9,    10,    11,     5,     6,    -1,
373       -1,     9,    -1,    11,     6,     7,     8,     9,    10,     3,
374        4,     5,     6,     7,     4,     5,     6,     7
375 };
376 /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
377 #line 3 "/usr/share/bison/bison.simple"
378
379 /* Skeleton output parser for bison,
380
381    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
382    Foundation, Inc.
383
384    This program is free software; you can redistribute it and/or modify
385    it under the terms of the GNU General Public License as published by
386    the Free Software Foundation; either version 2, or (at your option)
387    any later version.
388
389    This program is distributed in the hope that it will be useful,
390    but WITHOUT ANY WARRANTY; without even the implied warranty of
391    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
392    GNU General Public License for more details.
393
394    You should have received a copy of the GNU General Public License
395    along with this program; if not, write to the Free Software
396    Foundation, Inc., 59 Temple Place - Suite 330,
397    Boston, MA 02111-1307, USA.  */
398
399 /* As a special exception, when this file is copied by Bison into a
400    Bison output file, you may use that output file without restriction.
401    This special exception was added by the Free Software Foundation
402    in version 1.24 of Bison.  */
403
404 /* This is the parser code that is written into each bison parser when
405    the %semantic_parser declaration is not specified in the grammar.
406    It was written by Richard Stallman by simplifying the hairy parser
407    used when %semantic_parser is specified.  */
408
409 /* All symbols defined below should begin with yy or YY, to avoid
410    infringing on user name space.  This should be done even for local
411    variables, as they might otherwise be expanded by user macros.
412    There are some unavoidable exceptions within include files to
413    define necessary library symbols; they are noted "INFRINGES ON
414    USER NAME SPACE" below.  */
415
416 #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
417
418 /* The parser invokes alloca or malloc; define the necessary symbols.  */
419
420 # if YYSTACK_USE_ALLOCA
421 #  define YYSTACK_ALLOC alloca
422 # else
423 #  ifndef YYSTACK_USE_ALLOCA
424 #   if defined (alloca) || defined (_ALLOCA_H)
425 #    define YYSTACK_ALLOC alloca
426 #   else
427 #    ifdef __GNUC__
428 #     define YYSTACK_ALLOC __builtin_alloca
429 #    endif
430 #   endif
431 #  endif
432 # endif
433
434 # ifdef YYSTACK_ALLOC
435    /* Pacify GCC's `empty if-body' warning. */
436 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
437 # else
438 #  if defined (__STDC__) || defined (__cplusplus)
439 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
440 #   define YYSIZE_T size_t
441 #  endif
442 #  define YYSTACK_ALLOC malloc
443 #  define YYSTACK_FREE free
444 # endif
445 #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
446
447
448 #if (! defined (yyoverflow) \
449      && (! defined (__cplusplus) \
450          || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
451
452 /* A type that is properly aligned for any stack member.  */
453 union yyalloc
454 {
455   short yyss;
456   YYSTYPE yyvs;
457 # if YYLSP_NEEDED
458   YYLTYPE yyls;
459 # endif
460 };
461
462 /* The size of the maximum gap between one aligned stack and the next.  */
463 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
464
465 /* The size of an array large to enough to hold all stacks, each with
466    N elements.  */
467 # if YYLSP_NEEDED
468 #  define YYSTACK_BYTES(N) \
469      ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE))      \
470       + 2 * YYSTACK_GAP_MAX)
471 # else
472 #  define YYSTACK_BYTES(N) \
473      ((N) * (sizeof (short) + sizeof (YYSTYPE))                         \
474       + YYSTACK_GAP_MAX)
475 # endif
476
477 /* Copy COUNT objects from FROM to TO.  The source and destination do
478    not overlap.  */
479 # ifndef YYCOPY
480 #  if 1 < __GNUC__
481 #   define YYCOPY(To, From, Count) \
482       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
483 #  else
484 #   define YYCOPY(To, From, Count)              \
485       do                                        \
486         {                                       \
487           register YYSIZE_T yyi;                \
488           for (yyi = 0; yyi < (Count); yyi++)   \
489             (To)[yyi] = (From)[yyi];            \
490         }                                       \
491       while (0)
492 #  endif
493 # endif
494
495 /* Relocate STACK from its old location to the new one.  The
496    local variables YYSIZE and YYSTACKSIZE give the old and new number of
497    elements in the stack, and YYPTR gives the new location of the
498    stack.  Advance YYPTR to a properly aligned location for the next
499    stack.  */
500 # define YYSTACK_RELOCATE(Stack)                                        \
501     do                                                                  \
502       {                                                                 \
503         YYSIZE_T yynewbytes;                                            \
504         YYCOPY (&yyptr->Stack, Stack, yysize);                          \
505         Stack = &yyptr->Stack;                                          \
506         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX;   \
507         yyptr += yynewbytes / sizeof (*yyptr);                          \
508       }                                                                 \
509     while (0)
510
511 #endif
512
513
514 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
515 # define YYSIZE_T __SIZE_TYPE__
516 #endif
517 #if ! defined (YYSIZE_T) && defined (size_t)
518 # define YYSIZE_T size_t
519 #endif
520 #if ! defined (YYSIZE_T)
521 # if defined (__STDC__) || defined (__cplusplus)
522 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
523 #  define YYSIZE_T size_t
524 # endif
525 #endif
526 #if ! defined (YYSIZE_T)
527 # define YYSIZE_T unsigned int
528 #endif
529
530 #define yyerrok         (yyerrstatus = 0)
531 #define yyclearin       (yychar = YYEMPTY)
532 #define YYEMPTY         -2
533 #define YYEOF           0
534 #define YYACCEPT        goto yyacceptlab
535 #define YYABORT         goto yyabortlab
536 #define YYERROR         goto yyerrlab1
537 /* Like YYERROR except do call yyerror.  This remains here temporarily
538    to ease the transition to the new meaning of YYERROR, for GCC.
539    Once GCC version 2 has supplanted version 1, this can go.  */
540 #define YYFAIL          goto yyerrlab
541 #define YYRECOVERING()  (!!yyerrstatus)
542 #define YYBACKUP(Token, Value)                                  \
543 do                                                              \
544   if (yychar == YYEMPTY && yylen == 1)                          \
545     {                                                           \
546       yychar = (Token);                                         \
547       yylval = (Value);                                         \
548       yychar1 = YYTRANSLATE (yychar);                           \
549       YYPOPSTACK;                                               \
550       goto yybackup;                                            \
551     }                                                           \
552   else                                                          \
553     {                                                           \
554       yyerror ("syntax error: cannot back up");                 \
555       YYERROR;                                                  \
556     }                                                           \
557 while (0)
558
559 #define YYTERROR        1
560 #define YYERRCODE       256
561
562
563 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
564    are run).
565
566    When YYLLOC_DEFAULT is run, CURRENT is set the location of the
567    first token.  By default, to implement support for ranges, extend
568    its range to the last symbol.  */
569
570 #ifndef YYLLOC_DEFAULT
571 # define YYLLOC_DEFAULT(Current, Rhs, N)        \
572    Current.last_line   = Rhs[N].last_line;      \
573    Current.last_column = Rhs[N].last_column;
574 #endif
575
576
577 /* YYLEX -- calling `yylex' with the right arguments.  */
578
579 #if YYPURE
580 # if YYLSP_NEEDED
581 #  ifdef YYLEX_PARAM
582 #   define YYLEX                yylex (&yylval, &yylloc, YYLEX_PARAM)
583 #  else
584 #   define YYLEX                yylex (&yylval, &yylloc)
585 #  endif
586 # else /* !YYLSP_NEEDED */
587 #  ifdef YYLEX_PARAM
588 #   define YYLEX                yylex (&yylval, YYLEX_PARAM)
589 #  else
590 #   define YYLEX                yylex (&yylval)
591 #  endif
592 # endif /* !YYLSP_NEEDED */
593 #else /* !YYPURE */
594 # define YYLEX                  yylex ()
595 #endif /* !YYPURE */
596
597
598 /* Enable debugging if requested.  */
599 #if YYDEBUG
600
601 # ifndef YYFPRINTF
602 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
603 #  define YYFPRINTF fprintf
604 # endif
605
606 # define YYDPRINTF(Args)                        \
607 do {                                            \
608   if (yydebug)                                  \
609     YYFPRINTF Args;                             \
610 } while (0)
611 /* Nonzero means print parse trace.  It is left uninitialized so that
612    multiple parsers can coexist.  */
613 int yydebug;
614 #else /* !YYDEBUG */
615 # define YYDPRINTF(Args)
616 #endif /* !YYDEBUG */
617
618 /* YYINITDEPTH -- initial size of the parser's stacks.  */
619 #ifndef YYINITDEPTH
620 # define YYINITDEPTH 200
621 #endif
622
623 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
624    if the built-in stack extension method is used).
625
626    Do not make this value too large; the results are undefined if
627    SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
628    evaluated with infinite-precision integer arithmetic.  */
629
630 #if YYMAXDEPTH == 0
631 # undef YYMAXDEPTH
632 #endif
633
634 #ifndef YYMAXDEPTH
635 # define YYMAXDEPTH 10000
636 #endif
637 \f
638 #ifdef YYERROR_VERBOSE
639
640 # ifndef yystrlen
641 #  if defined (__GLIBC__) && defined (_STRING_H)
642 #   define yystrlen strlen
643 #  else
644 /* Return the length of YYSTR.  */
645 static YYSIZE_T
646 #   if defined (__STDC__) || defined (__cplusplus)
647 yystrlen (const char *yystr)
648 #   else
649 yystrlen (yystr)
650      const char *yystr;
651 #   endif
652 {
653   register const char *yys = yystr;
654
655   while (*yys++ != '\0')
656     continue;
657
658   return yys - yystr - 1;
659 }
660 #  endif
661 # endif
662
663 # ifndef yystpcpy
664 #  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
665 #   define yystpcpy stpcpy
666 #  else
667 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
668    YYDEST.  */
669 static char *
670 #   if defined (__STDC__) || defined (__cplusplus)
671 yystpcpy (char *yydest, const char *yysrc)
672 #   else
673 yystpcpy (yydest, yysrc)
674      char *yydest;
675      const char *yysrc;
676 #   endif
677 {
678   register char *yyd = yydest;
679   register const char *yys = yysrc;
680
681   while ((*yyd++ = *yys++) != '\0')
682     continue;
683
684   return yyd - 1;
685 }
686 #  endif
687 # endif
688 #endif
689 \f
690 #line 315 "/usr/share/bison/bison.simple"
691
692
693 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
694    into yyparse.  The argument should have type void *.
695    It should actually point to an object.
696    Grammar actions can access the variable by casting it
697    to the proper pointer type.  */
698
699 #ifdef YYPARSE_PARAM
700 # if defined (__STDC__) || defined (__cplusplus)
701 #  define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
702 #  define YYPARSE_PARAM_DECL
703 # else
704 #  define YYPARSE_PARAM_ARG YYPARSE_PARAM
705 #  define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
706 # endif
707 #else /* !YYPARSE_PARAM */
708 # define YYPARSE_PARAM_ARG
709 # define YYPARSE_PARAM_DECL
710 #endif /* !YYPARSE_PARAM */
711
712 /* Prevent warning if -Wstrict-prototypes.  */
713 #ifdef __GNUC__
714 # ifdef YYPARSE_PARAM
715 int yyparse (void *);
716 # else
717 int yyparse (void);
718 # endif
719 #endif
720
721 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
722    variables are global, or local to YYPARSE.  */
723
724 #define YY_DECL_NON_LSP_VARIABLES                       \
725 /* The lookahead symbol.  */                            \
726 int yychar;                                             \
727                                                         \
728 /* The semantic value of the lookahead symbol. */       \
729 YYSTYPE yylval;                                         \
730                                                         \
731 /* Number of parse errors so far.  */                   \
732 int yynerrs;
733
734 #if YYLSP_NEEDED
735 # define YY_DECL_VARIABLES                      \
736 YY_DECL_NON_LSP_VARIABLES                       \
737                                                 \
738 /* Location data for the lookahead symbol.  */  \
739 YYLTYPE yylloc;
740 #else
741 # define YY_DECL_VARIABLES                      \
742 YY_DECL_NON_LSP_VARIABLES
743 #endif
744
745
746 /* If nonreentrant, generate the variables here. */
747
748 #if !YYPURE
749 YY_DECL_VARIABLES
750 #endif  /* !YYPURE */
751
752 int
753 yyparse (YYPARSE_PARAM_ARG)
754      YYPARSE_PARAM_DECL
755 {
756   /* If reentrant, generate the variables here. */
757 #if YYPURE
758   YY_DECL_VARIABLES
759 #endif  /* !YYPURE */
760
761   register int yystate;
762   register int yyn;
763   int yyresult;
764   /* Number of tokens to shift before error messages enabled.  */
765   int yyerrstatus;
766   /* Lookahead token as an internal (translated) token number.  */
767   int yychar1 = 0;
768
769   /* Three stacks and their tools:
770      `yyss': related to states,
771      `yyvs': related to semantic values,
772      `yyls': related to locations.
773
774      Refer to the stacks thru separate pointers, to allow yyoverflow
775      to reallocate them elsewhere.  */
776
777   /* The state stack. */
778   short yyssa[YYINITDEPTH];
779   short *yyss = yyssa;
780   register short *yyssp;
781
782   /* The semantic value stack.  */
783   YYSTYPE yyvsa[YYINITDEPTH];
784   YYSTYPE *yyvs = yyvsa;
785   register YYSTYPE *yyvsp;
786
787 #if YYLSP_NEEDED
788   /* The location stack.  */
789   YYLTYPE yylsa[YYINITDEPTH];
790   YYLTYPE *yyls = yylsa;
791   YYLTYPE *yylsp;
792 #endif
793
794 #if YYLSP_NEEDED
795 # define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
796 #else
797 # define YYPOPSTACK   (yyvsp--, yyssp--)
798 #endif
799
800   YYSIZE_T yystacksize = YYINITDEPTH;
801
802
803   /* The variables used to return semantic value and location from the
804      action routines.  */
805   YYSTYPE yyval;
806 #if YYLSP_NEEDED
807   YYLTYPE yyloc;
808 #endif
809
810   /* When reducing, the number of symbols on the RHS of the reduced
811      rule. */
812   int yylen;
813
814   YYDPRINTF ((stderr, "Starting parse\n"));
815
816   yystate = 0;
817   yyerrstatus = 0;
818   yynerrs = 0;
819   yychar = YYEMPTY;             /* Cause a token to be read.  */
820
821   /* Initialize stack pointers.
822      Waste one element of value and location stack
823      so that they stay on the same level as the state stack.
824      The wasted elements are never initialized.  */
825
826   yyssp = yyss;
827   yyvsp = yyvs;
828 #if YYLSP_NEEDED
829   yylsp = yyls;
830 #endif
831   goto yysetstate;
832
833 /*------------------------------------------------------------.
834 | yynewstate -- Push a new state, which is found in yystate.  |
835 `------------------------------------------------------------*/
836  yynewstate:
837   /* In all cases, when you get here, the value and location stacks
838      have just been pushed. so pushing a state here evens the stacks.
839      */
840   yyssp++;
841
842  yysetstate:
843   *yyssp = yystate;
844
845   if (yyssp >= yyss + yystacksize - 1)
846     {
847       /* Get the current used size of the three stacks, in elements.  */
848       YYSIZE_T yysize = yyssp - yyss + 1;
849
850 #ifdef yyoverflow
851       {
852         /* Give user a chance to reallocate the stack. Use copies of
853            these so that the &'s don't force the real ones into
854            memory.  */
855         YYSTYPE *yyvs1 = yyvs;
856         short *yyss1 = yyss;
857
858         /* Each stack pointer address is followed by the size of the
859            data in use in that stack, in bytes.  */
860 # if YYLSP_NEEDED
861         YYLTYPE *yyls1 = yyls;
862         /* This used to be a conditional around just the two extra args,
863            but that might be undefined if yyoverflow is a macro.  */
864         yyoverflow ("parser stack overflow",
865                     &yyss1, yysize * sizeof (*yyssp),
866                     &yyvs1, yysize * sizeof (*yyvsp),
867                     &yyls1, yysize * sizeof (*yylsp),
868                     &yystacksize);
869         yyls = yyls1;
870 # else
871         yyoverflow ("parser stack overflow",
872                     &yyss1, yysize * sizeof (*yyssp),
873                     &yyvs1, yysize * sizeof (*yyvsp),
874                     &yystacksize);
875 # endif
876         yyss = yyss1;
877         yyvs = yyvs1;
878       }
879 #else /* no yyoverflow */
880 # ifndef YYSTACK_RELOCATE
881       goto yyoverflowlab;
882 # else
883       /* Extend the stack our own way.  */
884       if (yystacksize >= YYMAXDEPTH)
885         goto yyoverflowlab;
886       yystacksize *= 2;
887       if (yystacksize > YYMAXDEPTH)
888         yystacksize = YYMAXDEPTH;
889
890       {
891         short *yyss1 = yyss;
892         union yyalloc *yyptr =
893           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
894         if (! yyptr)
895           goto yyoverflowlab;
896         YYSTACK_RELOCATE (yyss);
897         YYSTACK_RELOCATE (yyvs);
898 # if YYLSP_NEEDED
899         YYSTACK_RELOCATE (yyls);
900 # endif
901 # undef YYSTACK_RELOCATE
902         if (yyss1 != yyssa)
903           YYSTACK_FREE (yyss1);
904       }
905 # endif
906 #endif /* no yyoverflow */
907
908       yyssp = yyss + yysize - 1;
909       yyvsp = yyvs + yysize - 1;
910 #if YYLSP_NEEDED
911       yylsp = yyls + yysize - 1;
912 #endif
913
914       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
915                   (unsigned long int) yystacksize));
916
917       if (yyssp >= yyss + yystacksize - 1)
918         YYABORT;
919     }
920
921   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
922
923   goto yybackup;
924
925
926 /*-----------.
927 | yybackup.  |
928 `-----------*/
929 yybackup:
930
931 /* Do appropriate processing given the current state.  */
932 /* Read a lookahead token if we need one and don't already have one.  */
933 /* yyresume: */
934
935   /* First try to decide what to do without reference to lookahead token.  */
936
937   yyn = yypact[yystate];
938   if (yyn == YYFLAG)
939     goto yydefault;
940
941   /* Not known => get a lookahead token if don't already have one.  */
942
943   /* yychar is either YYEMPTY or YYEOF
944      or a valid token in external form.  */
945
946   if (yychar == YYEMPTY)
947     {
948       YYDPRINTF ((stderr, "Reading a token: "));
949       yychar = YYLEX;
950     }
951
952   /* Convert token to internal form (in yychar1) for indexing tables with */
953
954   if (yychar <= 0)              /* This means end of input. */
955     {
956       yychar1 = 0;
957       yychar = YYEOF;           /* Don't call YYLEX any more */
958
959       YYDPRINTF ((stderr, "Now at end of input.\n"));
960     }
961   else
962     {
963       yychar1 = YYTRANSLATE (yychar);
964
965 #if YYDEBUG
966      /* We have to keep this `#if YYDEBUG', since we use variables
967         which are defined only if `YYDEBUG' is set.  */
968       if (yydebug)
969         {
970           YYFPRINTF (stderr, "Next token is %d (%s",
971                      yychar, yytname[yychar1]);
972           /* Give the individual parser a way to print the precise
973              meaning of a token, for further debugging info.  */
974 # ifdef YYPRINT
975           YYPRINT (stderr, yychar, yylval);
976 # endif
977           YYFPRINTF (stderr, ")\n");
978         }
979 #endif
980     }
981
982   yyn += yychar1;
983   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
984     goto yydefault;
985
986   yyn = yytable[yyn];
987
988   /* yyn is what to do for this token type in this state.
989      Negative => reduce, -yyn is rule number.
990      Positive => shift, yyn is new state.
991        New state is final state => don't bother to shift,
992        just return success.
993      0, or most negative number => error.  */
994
995   if (yyn < 0)
996     {
997       if (yyn == YYFLAG)
998         goto yyerrlab;
999       yyn = -yyn;
1000       goto yyreduce;
1001     }
1002   else if (yyn == 0)
1003     goto yyerrlab;
1004
1005   if (yyn == YYFINAL)
1006     YYACCEPT;
1007
1008   /* Shift the lookahead token.  */
1009   YYDPRINTF ((stderr, "Shifting token %d (%s), ",
1010               yychar, yytname[yychar1]));
1011
1012   /* Discard the token being shifted unless it is eof.  */
1013   if (yychar != YYEOF)
1014     yychar = YYEMPTY;
1015
1016   *++yyvsp = yylval;
1017 #if YYLSP_NEEDED
1018   *++yylsp = yylloc;
1019 #endif
1020
1021   /* Count tokens shifted since error; after three, turn off error
1022      status.  */
1023   if (yyerrstatus)
1024     yyerrstatus--;
1025
1026   yystate = yyn;
1027   goto yynewstate;
1028
1029
1030 /*-----------------------------------------------------------.
1031 | yydefault -- do the default action for the current state.  |
1032 `-----------------------------------------------------------*/
1033 yydefault:
1034   yyn = yydefact[yystate];
1035   if (yyn == 0)
1036     goto yyerrlab;
1037   goto yyreduce;
1038
1039
1040 /*-----------------------------.
1041 | yyreduce -- Do a reduction.  |
1042 `-----------------------------*/
1043 yyreduce:
1044   /* yyn is the number of a rule to reduce with.  */
1045   yylen = yyr2[yyn];
1046
1047   /* If YYLEN is nonzero, implement the default value of the action:
1048      `$$ = $1'.
1049
1050      Otherwise, the following line sets YYVAL to the semantic value of
1051      the lookahead token.  This behavior is undocumented and Bison
1052      users should not rely upon it.  Assigning to YYVAL
1053      unconditionally makes the parser a bit smaller, and it avoids a
1054      GCC warning that YYVAL may be used uninitialized.  */
1055   yyval = yyvsp[1-yylen];
1056
1057 #if YYLSP_NEEDED
1058   /* Similarly for the default location.  Let the user run additional
1059      commands if for instance locations are ranges.  */
1060   yyloc = yylsp[1-yylen];
1061   YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1062 #endif
1063
1064 #if YYDEBUG
1065   /* We have to keep this `#if YYDEBUG', since we use variables which
1066      are defined only if `YYDEBUG' is set.  */
1067   if (yydebug)
1068     {
1069       int yyi;
1070
1071       YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
1072                  yyn, yyrline[yyn]);
1073
1074       /* Print the symbols being reduced, and their result.  */
1075       for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
1076         YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
1077       YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1078     }
1079 #endif
1080
1081   switch (yyn) {
1082
1083 case 55:
1084 #line 134 "dateyacc.y"
1085 { yyans.hour   = yyvsp[0].IntVal / 100;
1086           yyans.minute = yyvsp[0].IntVal % 100;
1087           yyans.second = -1;            /* unspecified */
1088         ;
1089     break;}
1090 case 60:
1091 #line 143 "dateyacc.y"
1092 { extern char *yyinbuf;
1093           if (yyans.error == NULL) yyans.error = yyinbuf;
1094         ;
1095     break;}
1096 case 61:
1097 #line 150 "dateyacc.y"
1098 { yyans.c_weekday = yyvsp[0].IntVal; ;
1099     break;}
1100 case 62:
1101 #line 152 "dateyacc.y"
1102 { yyans.c_weekday = yyvsp[-1].IntVal; ;
1103     break;}
1104 case 65:
1105 #line 159 "dateyacc.y"
1106 { yyans.day = yyvsp[-4].IntVal; yyans.month = yyvsp[-2].IntVal; ;
1107     break;}
1108 case 69:
1109 #line 167 "dateyacc.y"
1110 { yyans.day = yyvsp[0].IntVal; yyans.month = yyvsp[-2].IntVal; ;
1111     break;}
1112 case 72:
1113 #line 174 "dateyacc.y"
1114 { yyans.year  = (yyvsp[0].IntVal / 10000) + 1900;       /* ajs */
1115           yyans.month = (yyvsp[0].IntVal % 10000) / 100;        /* ajs */
1116           yyans.day   = (yyvsp[0].IntVal % 100);                /* ajs */
1117         ;
1118     break;}
1119 case 73:
1120 #line 180 "dateyacc.y"
1121 { yyans.year  = (yyvsp[0].IntVal / 10000);              /* ajs */
1122           yyans.month = (yyvsp[0].IntVal % 10000) / 100;        /* ajs */
1123           yyans.day   = (yyvsp[0].IntVal % 100);                /* ajs */
1124         ;
1125     break;}
1126 case 74:
1127 #line 188 "dateyacc.y"
1128 { yyans.day = yyvsp[-1].IntVal; ;
1129     break;}
1130 case 75:
1131 #line 190 "dateyacc.y"
1132 { yyans.day = yyvsp[0].IntVal; ;
1133     break;}
1134 case 76:
1135 #line 192 "dateyacc.y"
1136 { yyans.month = yyvsp[-1].IntVal; yyans.day = yyvsp[0].IntVal; ;
1137     break;}
1138 case 77:
1139 #line 197 "dateyacc.y"
1140 { yyans.day = yyvsp[-2].IntVal; ;
1141     break;}
1142 case 78:
1143 #line 199 "dateyacc.y"
1144 { yyans.day = yyvsp[0].IntVal; ;
1145     break;}
1146 case 79:
1147 #line 204 "dateyacc.y"
1148 { yyans.day = yyvsp[-2].IntVal; ;
1149     break;}
1150 case 80:
1151 #line 206 "dateyacc.y"
1152 { yyans.day = yyvsp[0].IntVal; ;
1153     break;}
1154 case 81:
1155 #line 208 "dateyacc.y"
1156 { yyans.month = yyvsp[-2].IntVal; yyans.day = yyvsp[0].IntVal; ;
1157     break;}
1158 case 82:
1159 #line 213 "dateyacc.y"
1160 { yyans.year = 2000 + yyvsp[0].IntVal; ;
1161     break;}
1162 case 83:
1163 #line 215 "dateyacc.y"
1164 { yyans.year = 2000 + yyvsp[0].IntVal; ;
1165     break;}
1166 case 84:
1167 #line 217 "dateyacc.y"
1168 { yyans.year = 1900 + yyvsp[0].IntVal; ;
1169     break;}
1170 case 85:
1171 #line 219 "dateyacc.y"
1172 { yyans.year = yyvsp[0].IntVal; ;
1173     break;}
1174 case 86:
1175 #line 221 "dateyacc.y"
1176 { yyans.year = yyvsp[0].IntVal; ;
1177     break;}
1178 case 87:
1179 #line 226 "dateyacc.y"
1180 { yyans.month = yyvsp[0].IntVal; ;
1181     break;}
1182 case 88:
1183 #line 228 "dateyacc.y"
1184 { yyans.month = yyvsp[-1].IntVal; ;
1185     break;}
1186 case 93:
1187 #line 240 "dateyacc.y"
1188 { yyans.hour   = yyvsp[0].IntVal / 100;
1189           yyans.minute = yyvsp[0].IntVal % 100;
1190           yyans.second = -1;            /* unspecified */
1191         ;
1192     break;}
1193 case 95:
1194 #line 249 "dateyacc.y"
1195 { yyans.hour   = yyvsp[-2].IntVal;
1196           yyans.minute = yyvsp[0].IntVal;
1197           yyans.second = -1;            /* unspecified */
1198         ;
1199     break;}
1200 case 96:
1201 #line 254 "dateyacc.y"
1202 { yyans.hour   = yyvsp[-2].IntVal;
1203           yyans.minute = yyvsp[0].IntVal;
1204           yyans.second = -1;            /* unspecified */
1205         ;
1206     break;}
1207 case 97:
1208 #line 259 "dateyacc.y"
1209 { yyans.hour   = yyvsp[-4].IntVal;
1210           yyans.minute = yyvsp[-2].IntVal;
1211           yyans.second = yyvsp[0].IntVal;
1212         ;
1213     break;}
1214 case 98:
1215 #line 264 "dateyacc.y"
1216 { yyans.hour   = yyvsp[-4].IntVal;
1217           yyans.minute = yyvsp[-2].IntVal;
1218           yyans.second = yyvsp[0].IntVal;
1219         ;
1220     break;}
1221 case 99:
1222 #line 269 "dateyacc.y"
1223 { yyans.hour   = yyvsp[-2].IntVal;
1224           yyans.minute = yyvsp[0].IntVal;
1225           yyans.second = -1;            /* unspecified */
1226         ;
1227     break;}
1228 case 100:
1229 #line 274 "dateyacc.y"
1230 { yyans.hour   = yyvsp[-2].IntVal;
1231           yyans.minute = yyvsp[0].IntVal;
1232           yyans.second = -1;            /* unspecified */
1233         ;
1234     break;}
1235 case 101:
1236 #line 279 "dateyacc.y"
1237 { yyans.hour   = yyvsp[-4].IntVal;
1238           yyans.minute = yyvsp[-2].IntVal;
1239           yyans.second = yyvsp[0].IntVal;
1240         ;
1241     break;}
1242 case 102:
1243 #line 284 "dateyacc.y"
1244 { yyans.hour   = yyvsp[-4].IntVal;
1245           yyans.minute = yyvsp[-2].IntVal;
1246           yyans.second = yyvsp[0].IntVal;
1247         ;
1248     break;}
1249 case 103:
1250 #line 289 "dateyacc.y"
1251 { yyans.hour   = yyvsp[-2].IntVal / 100;
1252           yyans.minute = yyvsp[-2].IntVal % 100;
1253           yyans.second = yyvsp[0].IntVal;
1254         ;
1255     break;}
1256 case 104:
1257 #line 294 "dateyacc.y"
1258 { yyans.hour   = yyvsp[-2].IntVal / 100;
1259           yyans.minute = yyvsp[-2].IntVal % 100;
1260           yyans.second = yyvsp[0].IntVal;
1261         ;
1262     break;}
1263 case 105:
1264 #line 299 "dateyacc.y"
1265 { yyans.hour   = yyvsp[0].IntVal / 10000;
1266           yyans.minute = (yyvsp[0].IntVal % 10000) / 100;
1267           yyans.second = yyvsp[0].IntVal % 100;
1268         ;
1269     break;}
1270 case 106:
1271 #line 307 "dateyacc.y"
1272 { if (yyans.hour < 1 || yyans.hour > 12)
1273             yyans.hour = -1;            /* invalid */
1274           else
1275           { if (yyans.hour == 12) yyans.hour = 0;
1276             yyans.hour += yyvsp[0].IntVal;              /* 0 for AM, 12 for PM */
1277         } ;
1278     break;}
1279 case 107:
1280 #line 317 "dateyacc.y"
1281 { yyans.zone = yyvsp[0].IntVal; yyans.dst = 0; ;
1282     break;}
1283 case 108:
1284 #line 319 "dateyacc.y"
1285 { yyans.zone = yyvsp[-1].IntVal + 60; yyans.dst = 1; ;
1286     break;}
1287 case 109:
1288 #line 321 "dateyacc.y"
1289 { yyans.zone = yyvsp[0].IntVal; yyans.dst = 0; ;
1290     break;}
1291 case 110:
1292 #line 323 "dateyacc.y"
1293 { yyans.zone = yyvsp[-1].IntVal + 60; yyans.dst = 1; ;
1294     break;}
1295 case 111:
1296 #line 325 "dateyacc.y"
1297 { yyans.zone = yyvsp[0].IntVal; yyans.dst = 1; ;
1298     break;}
1299 case 112:
1300 #line 327 "dateyacc.y"
1301 { yyans.zone = yyvsp[0].IntVal; yyans.dst = 1; ;
1302     break;}
1303 case 113:
1304 #line 329 "dateyacc.y"
1305 { yyans.zone = yyvsp[0].IntVal; yyans.dst = 0; ;
1306     break;}
1307 case 114:
1308 #line 331 "dateyacc.y"
1309 { yyans.zone = yyvsp[0].IntVal; yyans.dst = 0; ;
1310     break;}
1311 case 115:
1312 #line 333 "dateyacc.y"
1313 { yyans.zone = - yyvsp[0].IntVal; yyans.dst = 0; ;
1314     break;}
1315 case 116:
1316 #line 335 "dateyacc.y"
1317 { yyans.zone = - yyvsp[0].IntVal; yyans.dst = 0; ;
1318     break;}
1319 case 117:
1320 #line 340 "dateyacc.y"
1321 { yyval.IntVal = 60 * yyvsp[0].IntVal; ;
1322     break;}
1323 case 118:
1324 #line 342 "dateyacc.y"
1325 { yyval.IntVal = 60 * yyvsp[-2].IntVal + yyvsp[0].IntVal; ;
1326     break;}
1327 case 119:
1328 #line 344 "dateyacc.y"
1329 { yyval.IntVal = 60 * yyvsp[-2].IntVal + yyvsp[0].IntVal; ;
1330     break;}
1331 case 120:
1332 #line 346 "dateyacc.y"
1333 { yyval.IntVal = 60 * yyvsp[0].IntVal; ;
1334     break;}
1335 case 121:
1336 #line 348 "dateyacc.y"
1337 { yyval.IntVal = 60 * yyvsp[-2].IntVal + yyvsp[0].IntVal; ;
1338     break;}
1339 case 122:
1340 #line 350 "dateyacc.y"
1341 { yyval.IntVal = 60 * yyvsp[-2].IntVal + yyvsp[0].IntVal; ;
1342     break;}
1343 case 123:
1344 #line 352 "dateyacc.y"
1345 { yyval.IntVal = 60 * (yyvsp[0].IntVal / 100) | (yyvsp[0].IntVal % 100); ;
1346     break;}
1347 case 124:
1348 #line 357 "dateyacc.y"
1349 { yyans.hour   = yyvsp[0].IntVal / 100; /* ajs */
1350           yyans.minute = yyvsp[0].IntVal % 100; /* ajs */
1351           yyans.second = -1;            /* ajs */
1352         ;
1353     break;}
1354 }
1355
1356 #line 705 "/usr/share/bison/bison.simple"
1357
1358 \f
1359   yyvsp -= yylen;
1360   yyssp -= yylen;
1361 #if YYLSP_NEEDED
1362   yylsp -= yylen;
1363 #endif
1364
1365 #if YYDEBUG
1366   if (yydebug)
1367     {
1368       short *yyssp1 = yyss - 1;
1369       YYFPRINTF (stderr, "state stack now");
1370       while (yyssp1 != yyssp)
1371         YYFPRINTF (stderr, " %d", *++yyssp1);
1372       YYFPRINTF (stderr, "\n");
1373     }
1374 #endif
1375
1376   *++yyvsp = yyval;
1377 #if YYLSP_NEEDED
1378   *++yylsp = yyloc;
1379 #endif
1380
1381   /* Now `shift' the result of the reduction.  Determine what state
1382      that goes to, based on the state we popped back to and the rule
1383      number reduced by.  */
1384
1385   yyn = yyr1[yyn];
1386
1387   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1388   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1389     yystate = yytable[yystate];
1390   else
1391     yystate = yydefgoto[yyn - YYNTBASE];
1392
1393   goto yynewstate;
1394
1395
1396 /*------------------------------------.
1397 | yyerrlab -- here on detecting error |
1398 `------------------------------------*/
1399 yyerrlab:
1400   /* If not already recovering from an error, report this error.  */
1401   if (!yyerrstatus)
1402     {
1403       ++yynerrs;
1404
1405 #ifdef YYERROR_VERBOSE
1406       yyn = yypact[yystate];
1407
1408       if (yyn > YYFLAG && yyn < YYLAST)
1409         {
1410           YYSIZE_T yysize = 0;
1411           char *yymsg;
1412           int yyx, yycount;
1413
1414           yycount = 0;
1415           /* Start YYX at -YYN if negative to avoid negative indexes in
1416              YYCHECK.  */
1417           for (yyx = yyn < 0 ? -yyn : 0;
1418                yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1419             if (yycheck[yyx + yyn] == yyx)
1420               yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1421           yysize += yystrlen ("parse error, unexpected ") + 1;
1422           yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
1423           yymsg = (char *) YYSTACK_ALLOC (yysize);
1424           if (yymsg != 0)
1425             {
1426               char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1427               yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
1428
1429               if (yycount < 5)
1430                 {
1431                   yycount = 0;
1432                   for (yyx = yyn < 0 ? -yyn : 0;
1433                        yyx < (int) (sizeof (yytname) / sizeof (char *));
1434                        yyx++)
1435                     if (yycheck[yyx + yyn] == yyx)
1436                       {
1437                         const char *yyq = ! yycount ? ", expecting " : " or ";
1438                         yyp = yystpcpy (yyp, yyq);
1439                         yyp = yystpcpy (yyp, yytname[yyx]);
1440                         yycount++;
1441                       }
1442                 }
1443               yyerror (yymsg);
1444               YYSTACK_FREE (yymsg);
1445             }
1446           else
1447             yyerror ("parse error; also virtual memory exhausted");
1448         }
1449       else
1450 #endif /* defined (YYERROR_VERBOSE) */
1451         yyerror ("parse error");
1452     }
1453   goto yyerrlab1;
1454
1455
1456 /*--------------------------------------------------.
1457 | yyerrlab1 -- error raised explicitly by an action |
1458 `--------------------------------------------------*/
1459 yyerrlab1:
1460   if (yyerrstatus == 3)
1461     {
1462       /* If just tried and failed to reuse lookahead token after an
1463          error, discard it.  */
1464
1465       /* return failure if at end of input */
1466       if (yychar == YYEOF)
1467         YYABORT;
1468       YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1469                   yychar, yytname[yychar1]));
1470       yychar = YYEMPTY;
1471     }
1472
1473   /* Else will try to reuse lookahead token after shifting the error
1474      token.  */
1475
1476   yyerrstatus = 3;              /* Each real token shifted decrements this */
1477
1478   goto yyerrhandle;
1479
1480
1481 /*-------------------------------------------------------------------.
1482 | yyerrdefault -- current state does not do anything special for the |
1483 | error token.                                                       |
1484 `-------------------------------------------------------------------*/
1485 yyerrdefault:
1486 #if 0
1487   /* This is wrong; only states that explicitly want error tokens
1488      should shift them.  */
1489
1490   /* If its default is to accept any token, ok.  Otherwise pop it.  */
1491   yyn = yydefact[yystate];
1492   if (yyn)
1493     goto yydefault;
1494 #endif
1495
1496
1497 /*---------------------------------------------------------------.
1498 | yyerrpop -- pop the current state because it cannot handle the |
1499 | error token                                                    |
1500 `---------------------------------------------------------------*/
1501 yyerrpop:
1502   if (yyssp == yyss)
1503     YYABORT;
1504   yyvsp--;
1505   yystate = *--yyssp;
1506 #if YYLSP_NEEDED
1507   yylsp--;
1508 #endif
1509
1510 #if YYDEBUG
1511   if (yydebug)
1512     {
1513       short *yyssp1 = yyss - 1;
1514       YYFPRINTF (stderr, "Error: state stack now");
1515       while (yyssp1 != yyssp)
1516         YYFPRINTF (stderr, " %d", *++yyssp1);
1517       YYFPRINTF (stderr, "\n");
1518     }
1519 #endif
1520
1521 /*--------------.
1522 | yyerrhandle.  |
1523 `--------------*/
1524 yyerrhandle:
1525   yyn = yypact[yystate];
1526   if (yyn == YYFLAG)
1527     goto yyerrdefault;
1528
1529   yyn += YYTERROR;
1530   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1531     goto yyerrdefault;
1532
1533   yyn = yytable[yyn];
1534   if (yyn < 0)
1535     {
1536       if (yyn == YYFLAG)
1537         goto yyerrpop;
1538       yyn = -yyn;
1539       goto yyreduce;
1540     }
1541   else if (yyn == 0)
1542     goto yyerrpop;
1543
1544   if (yyn == YYFINAL)
1545     YYACCEPT;
1546
1547   YYDPRINTF ((stderr, "Shifting error token, "));
1548
1549   *++yyvsp = yylval;
1550 #if YYLSP_NEEDED
1551   *++yylsp = yylloc;
1552 #endif
1553
1554   yystate = yyn;
1555   goto yynewstate;
1556
1557
1558 /*-------------------------------------.
1559 | yyacceptlab -- YYACCEPT comes here.  |
1560 `-------------------------------------*/
1561 yyacceptlab:
1562   yyresult = 0;
1563   goto yyreturn;
1564
1565 /*-----------------------------------.
1566 | yyabortlab -- YYABORT comes here.  |
1567 `-----------------------------------*/
1568 yyabortlab:
1569   yyresult = 1;
1570   goto yyreturn;
1571
1572 /*---------------------------------------------.
1573 | yyoverflowab -- parser overflow comes here.  |
1574 `---------------------------------------------*/
1575 yyoverflowlab:
1576   yyerror ("parser stack overflow");
1577   yyresult = 2;
1578   /* Fall through.  */
1579
1580 yyreturn:
1581 #ifndef yyoverflow
1582   if (yyss != yyssa)
1583     YYSTACK_FREE (yyss);
1584 #endif
1585   return yyresult;
1586 }
1587 #line 363 "dateyacc.y"
1588