1505d05c7Sgtb /*  A Bison parser, made from ./x-deltat.y
2505d05c7Sgtb     by GNU Bison version 1.28  */
37c478bd9Sstevel@tonic-gate 
47c478bd9Sstevel@tonic-gate #define YYBISON 1  /* Identify Bison output.  */
57c478bd9Sstevel@tonic-gate 
67c478bd9Sstevel@tonic-gate #define	NUM	257
77c478bd9Sstevel@tonic-gate #define	LONGNUM	258
8505d05c7Sgtb #define	OVERFLOW	259
9505d05c7Sgtb #define	WS	260
107c478bd9Sstevel@tonic-gate 
11505d05c7Sgtb #line 38 "./x-deltat.y"
127c478bd9Sstevel@tonic-gate 
137c478bd9Sstevel@tonic-gate 
147c478bd9Sstevel@tonic-gate #include <ctype.h>
157c478bd9Sstevel@tonic-gate #include <errno.h>
167c478bd9Sstevel@tonic-gate #include <k5-int.h>
177c478bd9Sstevel@tonic-gate 
187c478bd9Sstevel@tonic-gate struct param {
19505d05c7Sgtb     krb5_int32 delta;
207c478bd9Sstevel@tonic-gate     char *p;
217c478bd9Sstevel@tonic-gate };
227c478bd9Sstevel@tonic-gate 
237c478bd9Sstevel@tonic-gate #define YYPARSE_PARAM tmv
247c478bd9Sstevel@tonic-gate 
25505d05c7Sgtb #define MAX_TIME KRB5_INT32_MAX
26505d05c7Sgtb #define MIN_TIME KRB5_INT32_MIN
27505d05c7Sgtb 
28505d05c7Sgtb #define DAY (24 * 3600)
29505d05c7Sgtb #define HOUR 3600
30505d05c7Sgtb 
31505d05c7Sgtb #define MAX_DAY (MAX_TIME / DAY)
32505d05c7Sgtb #define MIN_DAY (MIN_TIME / DAY)
33505d05c7Sgtb #define MAX_HOUR (MAX_TIME / HOUR)
34505d05c7Sgtb #define MIN_HOUR (MIN_TIME / HOUR)
35505d05c7Sgtb #define MAX_MIN (MAX_TIME / 60)
36505d05c7Sgtb #define MIN_MIN (MIN_TIME / 60)
37505d05c7Sgtb 
38*1da57d55SToomas Soome /* An explanation of the tests being performed.
39*1da57d55SToomas Soome    We do not want to overflow a 32 bit integer with out manipulations,
40505d05c7Sgtb    even for testing for overflow. Therefore we rely on the following:
41505d05c7Sgtb 
42505d05c7Sgtb    The lex parser will not return a number > MAX_TIME (which is out 32
43505d05c7Sgtb    bit limit).
44505d05c7Sgtb 
45*1da57d55SToomas Soome    Therefore, seconds (s) will require
46505d05c7Sgtb        MIN_TIME < s < MAX_TIME
47505d05c7Sgtb 
48505d05c7Sgtb    For subsequent tests, the logic is as follows:
49505d05c7Sgtb 
50505d05c7Sgtb       If A < MAX_TIME and  B < MAX_TIME
51505d05c7Sgtb 
52505d05c7Sgtb       If we want to test if A+B < MAX_TIME, there are two cases
53*1da57d55SToomas Soome         if (A > 0)
54505d05c7Sgtb          then A + B < MAX_TIME if B < MAX_TIME - A
55505d05c7Sgtb 	else A + B < MAX_TIME  always.
56505d05c7Sgtb 
57505d05c7Sgtb       if we want to test if MIN_TIME < A + B
58505d05c7Sgtb           if A > 0 - then nothing to test
59505d05c7Sgtb           otherwise, we test if MIN_TIME - A < B.
60505d05c7Sgtb 
61505d05c7Sgtb    We of course are testing for:
62505d05c7Sgtb           MIN_TIME < A + B < MAX_TIME
63505d05c7Sgtb */
64505d05c7Sgtb 
65505d05c7Sgtb 
66505d05c7Sgtb #define DAY_NOT_OK(d) (d) > MAX_DAY || (d) < MIN_DAY
67505d05c7Sgtb #define HOUR_NOT_OK(h) (h) > MAX_HOUR || (h) < MIN_HOUR
68505d05c7Sgtb #define MIN_NOT_OK(m) (m) > MAX_MIN || (m) < MIN_MIN
69505d05c7Sgtb #define SUM_OK(a, b) (((a) > 0) ? ( (b) <= MAX_TIME - (a)) : (MIN_TIME - (a) <= (b)))
70505d05c7Sgtb #define DO_SUM(res, a, b) if (!SUM_OK((a), (b))) YYERROR; \
71505d05c7Sgtb                           res = (a) + (b)
72505d05c7Sgtb 
73505d05c7Sgtb 
74*1da57d55SToomas Soome #define OUT_D ((struct param *)tmv)->delta
757c478bd9Sstevel@tonic-gate #define DO(D,H,M,S) \
767c478bd9Sstevel@tonic-gate  { \
77505d05c7Sgtb      /* Overflow testing - this does not handle negative values well.. */ \
78505d05c7Sgtb      if (DAY_NOT_OK(D) || HOUR_NOT_OK(H) || MIN_NOT_OK(M)) YYERROR; \
79505d05c7Sgtb      OUT_D = D * DAY; \
80505d05c7Sgtb      DO_SUM(OUT_D, OUT_D, H * HOUR); \
81505d05c7Sgtb      DO_SUM(OUT_D, OUT_D, M * 60); \
82505d05c7Sgtb      DO_SUM(OUT_D, OUT_D, S); \
837c478bd9Sstevel@tonic-gate  }
847c478bd9Sstevel@tonic-gate 
857c478bd9Sstevel@tonic-gate static int mylex (int *, char **);
867c478bd9Sstevel@tonic-gate #define YYLEX_PARAM (&((struct param *)tmv)->p)
877c478bd9Sstevel@tonic-gate #undef yylex
887c478bd9Sstevel@tonic-gate #define yylex(U, P)    mylex (&(U)->val, (P))
897c478bd9Sstevel@tonic-gate 
907c478bd9Sstevel@tonic-gate #undef yyerror
917c478bd9Sstevel@tonic-gate #define yyerror(MSG)
927c478bd9Sstevel@tonic-gate 
937c478bd9Sstevel@tonic-gate static int yyparse (void *);
947c478bd9Sstevel@tonic-gate 
957c478bd9Sstevel@tonic-gate 
96505d05c7Sgtb #line 125 "./x-deltat.y"
977c478bd9Sstevel@tonic-gate typedef union { int val; } YYSTYPE;
987c478bd9Sstevel@tonic-gate #include <stdio.h>
997c478bd9Sstevel@tonic-gate 
1007c478bd9Sstevel@tonic-gate #ifndef __cplusplus
1017c478bd9Sstevel@tonic-gate #ifndef __STDC__
1027c478bd9Sstevel@tonic-gate #define const
1037c478bd9Sstevel@tonic-gate #endif
1047c478bd9Sstevel@tonic-gate #endif
1057c478bd9Sstevel@tonic-gate 
1067c478bd9Sstevel@tonic-gate 
1077c478bd9Sstevel@tonic-gate 
108505d05c7Sgtb #define	YYFINAL		42
1097c478bd9Sstevel@tonic-gate #define	YYFLAG		-32768
110505d05c7Sgtb #define	YYNTBASE	13
1117c478bd9Sstevel@tonic-gate 
112505d05c7Sgtb #define YYTRANSLATE(x) ((unsigned)(x) <= 260 ? yytranslate[x] : 22)
1137c478bd9Sstevel@tonic-gate 
1147c478bd9Sstevel@tonic-gate static const char yytranslate[] = {     0,
1157c478bd9Sstevel@tonic-gate      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1167c478bd9Sstevel@tonic-gate      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1177c478bd9Sstevel@tonic-gate      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1187c478bd9Sstevel@tonic-gate      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
119505d05c7Sgtb      2,     2,     2,     2,     6,     2,     2,     2,     2,     2,
120505d05c7Sgtb      2,     2,     2,     2,     2,     2,     2,     7,     2,     2,
1217c478bd9Sstevel@tonic-gate      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1227c478bd9Sstevel@tonic-gate      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1237c478bd9Sstevel@tonic-gate      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
124505d05c7Sgtb      2,     2,     2,     2,     2,     2,     2,     2,     2,     8,
125505d05c7Sgtb      2,     2,     2,     9,     2,     2,     2,     2,    10,     2,
126505d05c7Sgtb      2,     2,     2,     2,    11,     2,     2,     2,     2,     2,
1277c478bd9Sstevel@tonic-gate      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1287c478bd9Sstevel@tonic-gate      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1297c478bd9Sstevel@tonic-gate      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1307c478bd9Sstevel@tonic-gate      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1317c478bd9Sstevel@tonic-gate      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1327c478bd9Sstevel@tonic-gate      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1337c478bd9Sstevel@tonic-gate      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1347c478bd9Sstevel@tonic-gate      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1357c478bd9Sstevel@tonic-gate      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1367c478bd9Sstevel@tonic-gate      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1377c478bd9Sstevel@tonic-gate      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1387c478bd9Sstevel@tonic-gate      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1397c478bd9Sstevel@tonic-gate      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
140505d05c7Sgtb      2,     2,     2,     2,     2,     1,     3,     4,     5,    12
1417c478bd9Sstevel@tonic-gate };
1427c478bd9Sstevel@tonic-gate 
1437c478bd9Sstevel@tonic-gate #if YYDEBUG != 0
1447c478bd9Sstevel@tonic-gate static const short yyprhs[] = {     0,
145505d05c7Sgtb      0,     2,     4,     6,     8,    11,    12,    14,    17,    20,
146505d05c7Sgtb     24,    28,    32,    35,    43,    49,    53,    55,    57,    61,
147505d05c7Sgtb     63,    67,    69
1487c478bd9Sstevel@tonic-gate };
1497c478bd9Sstevel@tonic-gate 
150505d05c7Sgtb static const short yyrhs[] = {    18,
151505d05c7Sgtb      0,     3,     0,     4,     0,    14,     0,     6,    14,     0,
152505d05c7Sgtb      0,    12,     0,    16,    15,     0,    16,     5,     0,    17,
153505d05c7Sgtb      8,    19,     0,    17,     9,    20,     0,    17,    10,    21,
154505d05c7Sgtb      0,    17,    11,     0,    17,     6,     3,     7,     3,     7,
155505d05c7Sgtb      3,     0,    17,     7,     3,     7,     3,     0,    17,     7,
156505d05c7Sgtb      3,     0,    17,     0,    20,     0,    17,     9,    20,     0,
157505d05c7Sgtb     21,     0,    17,    10,    21,     0,    16,     0,    17,    11,
158505d05c7Sgtb      0
1597c478bd9Sstevel@tonic-gate };
1607c478bd9Sstevel@tonic-gate 
1617c478bd9Sstevel@tonic-gate #endif
1627c478bd9Sstevel@tonic-gate 
1637c478bd9Sstevel@tonic-gate #if YYDEBUG != 0
1647c478bd9Sstevel@tonic-gate static const short yyrline[] = { 0,
165505d05c7Sgtb    136,   137,   137,   138,   138,   139,   139,   140,   141,   142,
166505d05c7Sgtb    144,   145,   146,   147,   148,   149,   150,   153,   155,   157,
167505d05c7Sgtb    159,   161,   163
1687c478bd9Sstevel@tonic-gate };
1697c478bd9Sstevel@tonic-gate #endif
1707c478bd9Sstevel@tonic-gate 
1717c478bd9Sstevel@tonic-gate 
1727c478bd9Sstevel@tonic-gate #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
1737c478bd9Sstevel@tonic-gate 
1747c478bd9Sstevel@tonic-gate static const char * const yytname[] = {   "$","error","$undefined.","NUM","LONGNUM",
175505d05c7Sgtb "OVERFLOW","'-'","':'","'d'","'h'","'m'","'s'","WS","start","posnum","num","ws",
176505d05c7Sgtb "wsnum","deltat","opt_hms","opt_ms","opt_s", NULL
1777c478bd9Sstevel@tonic-gate };
1787c478bd9Sstevel@tonic-gate #endif
1797c478bd9Sstevel@tonic-gate 
1807c478bd9Sstevel@tonic-gate static const short yyr1[] = {     0,
181505d05c7Sgtb     13,    14,    14,    15,    15,    16,    16,    17,    17,    18,
182505d05c7Sgtb     18,    18,    18,    18,    18,    18,    18,    19,    19,    20,
183505d05c7Sgtb     20,    21,    21
1847c478bd9Sstevel@tonic-gate };
1857c478bd9Sstevel@tonic-gate 
1867c478bd9Sstevel@tonic-gate static const short yyr2[] = {     0,
187505d05c7Sgtb      1,     1,     1,     1,     2,     0,     1,     2,     2,     3,
188505d05c7Sgtb      3,     3,     2,     7,     5,     3,     1,     1,     3,     1,
189505d05c7Sgtb      3,     1,     2
1907c478bd9Sstevel@tonic-gate };
1917c478bd9Sstevel@tonic-gate 
1927c478bd9Sstevel@tonic-gate static const short yydefact[] = {     6,
193505d05c7Sgtb      7,     0,    17,     1,     2,     3,     9,     0,     4,     8,
194505d05c7Sgtb      0,     0,     6,     6,     6,    13,     5,     0,    16,    22,
195505d05c7Sgtb      0,    10,    18,    20,     0,    11,     0,    12,     0,     0,
196505d05c7Sgtb      6,     6,    23,     0,    15,    19,    21,     0,    14,     0,
197505d05c7Sgtb      0,     0
1987c478bd9Sstevel@tonic-gate };
1997c478bd9Sstevel@tonic-gate 
200505d05c7Sgtb static const short yydefgoto[] = {    40,
201505d05c7Sgtb      9,    10,    20,    25,     4,    22,    23,    24
2027c478bd9Sstevel@tonic-gate };
2037c478bd9Sstevel@tonic-gate 
204505d05c7Sgtb static const short yypact[] = {   -10,
205505d05c7Sgtb -32768,    18,    -2,-32768,-32768,-32768,-32768,    13,-32768,-32768,
206505d05c7Sgtb     11,    16,   -10,   -10,   -10,-32768,-32768,    20,    21,    18,
207505d05c7Sgtb      1,-32768,-32768,-32768,    15,-32768,    19,-32768,    26,    28,
208505d05c7Sgtb    -10,   -10,-32768,    27,-32768,-32768,-32768,    30,-32768,    35,
209505d05c7Sgtb     36,-32768
2107c478bd9Sstevel@tonic-gate };
2117c478bd9Sstevel@tonic-gate 
2127c478bd9Sstevel@tonic-gate static const short yypgoto[] = {-32768,
213505d05c7Sgtb     29,-32768,    38,     0,-32768,-32768,   -13,   -12
2147c478bd9Sstevel@tonic-gate };
2157c478bd9Sstevel@tonic-gate 
2167c478bd9Sstevel@tonic-gate 
217505d05c7Sgtb #define	YYLAST		38
2187c478bd9Sstevel@tonic-gate 
2197c478bd9Sstevel@tonic-gate 
2207c478bd9Sstevel@tonic-gate static const short yytable[] = {     3,
221505d05c7Sgtb     26,     1,    28,    11,    12,    13,    14,    15,    16,    31,
222505d05c7Sgtb     32,    33,    21,    18,    27,     5,     6,    36,    19,    37,
223505d05c7Sgtb      5,     6,     7,     8,    32,    33,    29,    30,    34,    33,
224505d05c7Sgtb     35,    27,    39,    38,    41,    42,    17,     2
2257c478bd9Sstevel@tonic-gate };
2267c478bd9Sstevel@tonic-gate 
2277c478bd9Sstevel@tonic-gate static const short yycheck[] = {     0,
228505d05c7Sgtb     14,    12,    15,     6,     7,     8,     9,    10,    11,     9,
229505d05c7Sgtb     10,    11,    13,     3,    15,     3,     4,    31,     3,    32,
230505d05c7Sgtb      3,     4,     5,     6,    10,    11,     7,     7,     3,    11,
231505d05c7Sgtb      3,    32,     3,     7,     0,     0,     8,     0
2327c478bd9Sstevel@tonic-gate };
2337c478bd9Sstevel@tonic-gate #define YYPURE 1
2347c478bd9Sstevel@tonic-gate 
2357c478bd9Sstevel@tonic-gate /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
236505d05c7Sgtb #line 3 "/usr/share/bison.simple"
237505d05c7Sgtb /* This file comes from bison-1.28.  */
2387c478bd9Sstevel@tonic-gate 
2397c478bd9Sstevel@tonic-gate /* Skeleton output parser for bison,
2407c478bd9Sstevel@tonic-gate    Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
2417c478bd9Sstevel@tonic-gate 
2427c478bd9Sstevel@tonic-gate    This program is free software; you can redistribute it and/or modify
2437c478bd9Sstevel@tonic-gate    it under the terms of the GNU General Public License as published by
2447c478bd9Sstevel@tonic-gate    the Free Software Foundation; either version 2, or (at your option)
2457c478bd9Sstevel@tonic-gate    any later version.
2467c478bd9Sstevel@tonic-gate 
2477c478bd9Sstevel@tonic-gate    This program is distributed in the hope that it will be useful,
2487c478bd9Sstevel@tonic-gate    but WITHOUT ANY WARRANTY; without even the implied warranty of
2497c478bd9Sstevel@tonic-gate    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2507c478bd9Sstevel@tonic-gate    GNU General Public License for more details.
2517c478bd9Sstevel@tonic-gate 
2527c478bd9Sstevel@tonic-gate    You should have received a copy of the GNU General Public License
2537c478bd9Sstevel@tonic-gate    along with this program; if not, write to the Free Software
2547c478bd9Sstevel@tonic-gate    Foundation, Inc., 59 Temple Place - Suite 330,
2557c478bd9Sstevel@tonic-gate    Boston, MA 02111-1307, USA.  */
2567c478bd9Sstevel@tonic-gate 
2577c478bd9Sstevel@tonic-gate /* As a special exception, when this file is copied by Bison into a
2587c478bd9Sstevel@tonic-gate    Bison output file, you may use that output file without restriction.
2597c478bd9Sstevel@tonic-gate    This special exception was added by the Free Software Foundation
2607c478bd9Sstevel@tonic-gate    in version 1.24 of Bison.  */
2617c478bd9Sstevel@tonic-gate 
2627c478bd9Sstevel@tonic-gate /* This is the parser code that is written into each bison parser
2637c478bd9Sstevel@tonic-gate   when the %semantic_parser declaration is not specified in the grammar.
2647c478bd9Sstevel@tonic-gate   It was written by Richard Stallman by simplifying the hairy parser
2657c478bd9Sstevel@tonic-gate   used when %semantic_parser is specified.  */
2667c478bd9Sstevel@tonic-gate 
2677c478bd9Sstevel@tonic-gate #ifndef YYSTACK_USE_ALLOCA
2687c478bd9Sstevel@tonic-gate #ifdef alloca
2697c478bd9Sstevel@tonic-gate #define YYSTACK_USE_ALLOCA
2707c478bd9Sstevel@tonic-gate #else /* alloca not defined */
2717c478bd9Sstevel@tonic-gate #ifdef __GNUC__
2727c478bd9Sstevel@tonic-gate #define YYSTACK_USE_ALLOCA
2737c478bd9Sstevel@tonic-gate #define alloca __builtin_alloca
2747c478bd9Sstevel@tonic-gate #else /* not GNU C.  */
2757c478bd9Sstevel@tonic-gate #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
2767c478bd9Sstevel@tonic-gate #define YYSTACK_USE_ALLOCA
2777c478bd9Sstevel@tonic-gate #include <alloca.h>
2787c478bd9Sstevel@tonic-gate #else /* not sparc */
2797c478bd9Sstevel@tonic-gate /* We think this test detects Watcom and Microsoft C.  */
2807c478bd9Sstevel@tonic-gate /* This used to test MSDOS, but that is a bad idea
2817c478bd9Sstevel@tonic-gate    since that symbol is in the user namespace.  */
2827c478bd9Sstevel@tonic-gate #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
2837c478bd9Sstevel@tonic-gate #if 0 /* No need for malloc.h, which pollutes the namespace;
2847c478bd9Sstevel@tonic-gate 	 instead, just don't use alloca.  */
2857c478bd9Sstevel@tonic-gate #include <malloc.h>
2867c478bd9Sstevel@tonic-gate #endif
2877c478bd9Sstevel@tonic-gate #else /* not MSDOS, or __TURBOC__ */
2887c478bd9Sstevel@tonic-gate #if defined(_AIX)
2897c478bd9Sstevel@tonic-gate /* I don't know what this was needed for, but it pollutes the namespace.
2907c478bd9Sstevel@tonic-gate    So I turned it off.   rms, 2 May 1997.  */
2917c478bd9Sstevel@tonic-gate /* #include <malloc.h>  */
2927c478bd9Sstevel@tonic-gate  #pragma alloca
2937c478bd9Sstevel@tonic-gate #define YYSTACK_USE_ALLOCA
2947c478bd9Sstevel@tonic-gate #else /* not MSDOS, or __TURBOC__, or _AIX */
2957c478bd9Sstevel@tonic-gate #if 0
2967c478bd9Sstevel@tonic-gate #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
2977c478bd9Sstevel@tonic-gate 		 and on HPUX 10.  Eventually we can turn this on.  */
2987c478bd9Sstevel@tonic-gate #define YYSTACK_USE_ALLOCA
2997c478bd9Sstevel@tonic-gate #define alloca __builtin_alloca
3007c478bd9Sstevel@tonic-gate #endif /* __hpux */
3017c478bd9Sstevel@tonic-gate #endif
3027c478bd9Sstevel@tonic-gate #endif /* not _AIX */
3037c478bd9Sstevel@tonic-gate #endif /* not MSDOS, or __TURBOC__ */
3047c478bd9Sstevel@tonic-gate #endif /* not sparc */
3057c478bd9Sstevel@tonic-gate #endif /* not GNU C */
3067c478bd9Sstevel@tonic-gate #endif /* alloca not defined */
3077c478bd9Sstevel@tonic-gate #endif /* YYSTACK_USE_ALLOCA not defined */
3087c478bd9Sstevel@tonic-gate 
3097c478bd9Sstevel@tonic-gate #ifdef YYSTACK_USE_ALLOCA
3107c478bd9Sstevel@tonic-gate #define YYSTACK_ALLOC alloca
3117c478bd9Sstevel@tonic-gate #else
3127c478bd9Sstevel@tonic-gate #define YYSTACK_ALLOC malloc
3137c478bd9Sstevel@tonic-gate #endif
3147c478bd9Sstevel@tonic-gate 
3157c478bd9Sstevel@tonic-gate /* Note: there must be only one dollar sign in this file.
3167c478bd9Sstevel@tonic-gate    It is replaced by the list of actions, each action
3177c478bd9Sstevel@tonic-gate    as one case of the switch.  */
3187c478bd9Sstevel@tonic-gate 
3197c478bd9Sstevel@tonic-gate #define yyerrok		(yyerrstatus = 0)
3207c478bd9Sstevel@tonic-gate #define yyclearin	(yychar = YYEMPTY)
3217c478bd9Sstevel@tonic-gate #define YYEMPTY		-2
3227c478bd9Sstevel@tonic-gate #define YYEOF		0
3237c478bd9Sstevel@tonic-gate #define YYACCEPT	goto yyacceptlab
3247c478bd9Sstevel@tonic-gate #define YYABORT 	goto yyabortlab
3257c478bd9Sstevel@tonic-gate #define YYERROR		goto yyerrlab1
3267c478bd9Sstevel@tonic-gate /* Like YYERROR except do call yyerror.
3277c478bd9Sstevel@tonic-gate    This remains here temporarily to ease the
3287c478bd9Sstevel@tonic-gate    transition to the new meaning of YYERROR, for GCC.
3297c478bd9Sstevel@tonic-gate    Once GCC version 2 has supplanted version 1, this can go.  */
3307c478bd9Sstevel@tonic-gate #define YYFAIL		goto yyerrlab
3317c478bd9Sstevel@tonic-gate #define YYRECOVERING()  (!!yyerrstatus)
3327c478bd9Sstevel@tonic-gate #define YYBACKUP(token, value) \
3337c478bd9Sstevel@tonic-gate do								\
3347c478bd9Sstevel@tonic-gate   if (yychar == YYEMPTY && yylen == 1)				\
3357c478bd9Sstevel@tonic-gate     { yychar = (token), yylval = (value);			\
3367c478bd9Sstevel@tonic-gate       yychar1 = YYTRANSLATE (yychar);				\
3377c478bd9Sstevel@tonic-gate       YYPOPSTACK;						\
3387c478bd9Sstevel@tonic-gate       goto yybackup;						\
3397c478bd9Sstevel@tonic-gate     }								\
3407c478bd9Sstevel@tonic-gate   else								\
3417c478bd9Sstevel@tonic-gate     { yyerror ("syntax error: cannot back up"); YYERROR; }	\
3427c478bd9Sstevel@tonic-gate while (0)
3437c478bd9Sstevel@tonic-gate 
3447c478bd9Sstevel@tonic-gate #define YYTERROR	1
3457c478bd9Sstevel@tonic-gate #define YYERRCODE	256
3467c478bd9Sstevel@tonic-gate 
3477c478bd9Sstevel@tonic-gate #ifndef YYPURE
3487c478bd9Sstevel@tonic-gate #define YYLEX		yylex()
3497c478bd9Sstevel@tonic-gate #endif
3507c478bd9Sstevel@tonic-gate 
3517c478bd9Sstevel@tonic-gate #ifdef YYPURE
3527c478bd9Sstevel@tonic-gate #ifdef YYLSP_NEEDED
3537c478bd9Sstevel@tonic-gate #ifdef YYLEX_PARAM
3547c478bd9Sstevel@tonic-gate #define YYLEX		yylex(&yylval, &yylloc, YYLEX_PARAM)
3557c478bd9Sstevel@tonic-gate #else
3567c478bd9Sstevel@tonic-gate #define YYLEX		yylex(&yylval, &yylloc)
3577c478bd9Sstevel@tonic-gate #endif
3587c478bd9Sstevel@tonic-gate #else /* not YYLSP_NEEDED */
3597c478bd9Sstevel@tonic-gate #ifdef YYLEX_PARAM
3607c478bd9Sstevel@tonic-gate #define YYLEX		yylex(&yylval, YYLEX_PARAM)
3617c478bd9Sstevel@tonic-gate #else
3627c478bd9Sstevel@tonic-gate #define YYLEX		yylex(&yylval)
3637c478bd9Sstevel@tonic-gate #endif
3647c478bd9Sstevel@tonic-gate #endif /* not YYLSP_NEEDED */
3657c478bd9Sstevel@tonic-gate #endif
3667c478bd9Sstevel@tonic-gate 
3677c478bd9Sstevel@tonic-gate /* If nonreentrant, generate the variables here */
3687c478bd9Sstevel@tonic-gate 
3697c478bd9Sstevel@tonic-gate #ifndef YYPURE
3707c478bd9Sstevel@tonic-gate 
3717c478bd9Sstevel@tonic-gate int	yychar;			/*  the lookahead symbol		*/
3727c478bd9Sstevel@tonic-gate YYSTYPE	yylval;			/*  the semantic value of the		*/
3737c478bd9Sstevel@tonic-gate 				/*  lookahead symbol			*/
3747c478bd9Sstevel@tonic-gate 
3757c478bd9Sstevel@tonic-gate #ifdef YYLSP_NEEDED
3767c478bd9Sstevel@tonic-gate YYLTYPE yylloc;			/*  location data for the lookahead	*/
3777c478bd9Sstevel@tonic-gate 				/*  symbol				*/
3787c478bd9Sstevel@tonic-gate #endif
3797c478bd9Sstevel@tonic-gate 
3807c478bd9Sstevel@tonic-gate int yynerrs;			/*  number of parse errors so far       */
3817c478bd9Sstevel@tonic-gate #endif  /* not YYPURE */
3827c478bd9Sstevel@tonic-gate 
3837c478bd9Sstevel@tonic-gate #if YYDEBUG != 0
3847c478bd9Sstevel@tonic-gate int yydebug;			/*  nonzero means print parse trace	*/
3857c478bd9Sstevel@tonic-gate /* Since this is uninitialized, it does not stop multiple parsers
3867c478bd9Sstevel@tonic-gate    from coexisting.  */
3877c478bd9Sstevel@tonic-gate #endif
3887c478bd9Sstevel@tonic-gate 
3897c478bd9Sstevel@tonic-gate /*  YYINITDEPTH indicates the initial size of the parser's stacks	*/
3907c478bd9Sstevel@tonic-gate 
3917c478bd9Sstevel@tonic-gate #ifndef	YYINITDEPTH
3927c478bd9Sstevel@tonic-gate #define YYINITDEPTH 200
3937c478bd9Sstevel@tonic-gate #endif
3947c478bd9Sstevel@tonic-gate 
3957c478bd9Sstevel@tonic-gate /*  YYMAXDEPTH is the maximum size the stacks can grow to
3967c478bd9Sstevel@tonic-gate     (effective only if the built-in stack extension method is used).  */
3977c478bd9Sstevel@tonic-gate 
3987c478bd9Sstevel@tonic-gate #if YYMAXDEPTH == 0
3997c478bd9Sstevel@tonic-gate #undef YYMAXDEPTH
4007c478bd9Sstevel@tonic-gate #endif
4017c478bd9Sstevel@tonic-gate 
4027c478bd9Sstevel@tonic-gate #ifndef YYMAXDEPTH
4037c478bd9Sstevel@tonic-gate #define YYMAXDEPTH 10000
4047c478bd9Sstevel@tonic-gate #endif
4057c478bd9Sstevel@tonic-gate 
4067c478bd9Sstevel@tonic-gate /* Define __yy_memcpy.  Note that the size argument
4077c478bd9Sstevel@tonic-gate    should be passed with type unsigned int, because that is what the non-GCC
4087c478bd9Sstevel@tonic-gate    definitions require.  With GCC, __builtin_memcpy takes an arg
4097c478bd9Sstevel@tonic-gate    of type size_t, but it can handle unsigned int.  */
4107c478bd9Sstevel@tonic-gate 
4117c478bd9Sstevel@tonic-gate #if __GNUC__ > 1		/* GNU C and GNU C++ define this.  */
4127c478bd9Sstevel@tonic-gate #define __yy_memcpy(TO,FROM,COUNT)	__builtin_memcpy(TO,FROM,COUNT)
4137c478bd9Sstevel@tonic-gate #else				/* not GNU C or C++ */
4147c478bd9Sstevel@tonic-gate #ifndef __cplusplus
4157c478bd9Sstevel@tonic-gate 
4167c478bd9Sstevel@tonic-gate /* This is the most reliable way to avoid incompatibilities
4177c478bd9Sstevel@tonic-gate    in available built-in functions on various systems.  */
4187c478bd9Sstevel@tonic-gate static void
__yy_memcpy(to,from,count)4197c478bd9Sstevel@tonic-gate __yy_memcpy (to, from, count)
4207c478bd9Sstevel@tonic-gate      char *to;
4217c478bd9Sstevel@tonic-gate      char *from;
4227c478bd9Sstevel@tonic-gate      unsigned int count;
4237c478bd9Sstevel@tonic-gate {
4247c478bd9Sstevel@tonic-gate   register char *f = from;
4257c478bd9Sstevel@tonic-gate   register char *t = to;
4267c478bd9Sstevel@tonic-gate   register int i = count;
4277c478bd9Sstevel@tonic-gate 
4287c478bd9Sstevel@tonic-gate   while (i-- > 0)
4297c478bd9Sstevel@tonic-gate     *t++ = *f++;
4307c478bd9Sstevel@tonic-gate }
4317c478bd9Sstevel@tonic-gate 
4327c478bd9Sstevel@tonic-gate #else /* __cplusplus */
4337c478bd9Sstevel@tonic-gate 
4347c478bd9Sstevel@tonic-gate /* This is the most reliable way to avoid incompatibilities
4357c478bd9Sstevel@tonic-gate    in available built-in functions on various systems.  */
4367c478bd9Sstevel@tonic-gate static void
__yy_memcpy(char * to,char * from,unsigned int count)4377c478bd9Sstevel@tonic-gate __yy_memcpy (char *to, char *from, unsigned int count)
4387c478bd9Sstevel@tonic-gate {
4397c478bd9Sstevel@tonic-gate   register char *t = to;
4407c478bd9Sstevel@tonic-gate   register char *f = from;
4417c478bd9Sstevel@tonic-gate   register int i = count;
4427c478bd9Sstevel@tonic-gate 
4437c478bd9Sstevel@tonic-gate   while (i-- > 0)
4447c478bd9Sstevel@tonic-gate     *t++ = *f++;
4457c478bd9Sstevel@tonic-gate }
4467c478bd9Sstevel@tonic-gate 
4477c478bd9Sstevel@tonic-gate #endif
4487c478bd9Sstevel@tonic-gate #endif
4497c478bd9Sstevel@tonic-gate 
450505d05c7Sgtb #line 217 "/usr/share/bison.simple"
4517c478bd9Sstevel@tonic-gate 
4527c478bd9Sstevel@tonic-gate /* The user can define YYPARSE_PARAM as the name of an argument to be passed
4537c478bd9Sstevel@tonic-gate    into yyparse.  The argument should have type void *.
4547c478bd9Sstevel@tonic-gate    It should actually point to an object.
4557c478bd9Sstevel@tonic-gate    Grammar actions can access the variable by casting it
4567c478bd9Sstevel@tonic-gate    to the proper pointer type.  */
4577c478bd9Sstevel@tonic-gate 
4587c478bd9Sstevel@tonic-gate #ifdef YYPARSE_PARAM
4597c478bd9Sstevel@tonic-gate #ifdef __cplusplus
4607c478bd9Sstevel@tonic-gate #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
4617c478bd9Sstevel@tonic-gate #define YYPARSE_PARAM_DECL
4627c478bd9Sstevel@tonic-gate #else /* not __cplusplus */
4637c478bd9Sstevel@tonic-gate #define YYPARSE_PARAM_ARG YYPARSE_PARAM
4647c478bd9Sstevel@tonic-gate #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
4657c478bd9Sstevel@tonic-gate #endif /* not __cplusplus */
4667c478bd9Sstevel@tonic-gate #else /* not YYPARSE_PARAM */
4677c478bd9Sstevel@tonic-gate #define YYPARSE_PARAM_ARG
4687c478bd9Sstevel@tonic-gate #define YYPARSE_PARAM_DECL
4697c478bd9Sstevel@tonic-gate #endif /* not YYPARSE_PARAM */
4707c478bd9Sstevel@tonic-gate 
4717c478bd9Sstevel@tonic-gate /* Prevent warning if -Wstrict-prototypes.  */
4727c478bd9Sstevel@tonic-gate #ifdef __GNUC__
4737c478bd9Sstevel@tonic-gate #ifdef YYPARSE_PARAM
4747c478bd9Sstevel@tonic-gate int yyparse (void *);
4757c478bd9Sstevel@tonic-gate #else
4767c478bd9Sstevel@tonic-gate int yyparse (void);
4777c478bd9Sstevel@tonic-gate #endif
4787c478bd9Sstevel@tonic-gate #endif
4797c478bd9Sstevel@tonic-gate 
4807c478bd9Sstevel@tonic-gate int
yyparse(YYPARSE_PARAM_ARG)4817c478bd9Sstevel@tonic-gate yyparse(YYPARSE_PARAM_ARG)
4827c478bd9Sstevel@tonic-gate      YYPARSE_PARAM_DECL
4837c478bd9Sstevel@tonic-gate {
4847c478bd9Sstevel@tonic-gate   register int yystate;
4857c478bd9Sstevel@tonic-gate   register int yyn;
4867c478bd9Sstevel@tonic-gate   register short *yyssp;
4877c478bd9Sstevel@tonic-gate   register YYSTYPE *yyvsp;
4887c478bd9Sstevel@tonic-gate   int yyerrstatus;	/*  number of tokens to shift before error messages enabled */
4897c478bd9Sstevel@tonic-gate   int yychar1 = 0;		/*  lookahead token as an internal (translated) token number */
4907c478bd9Sstevel@tonic-gate 
4917c478bd9Sstevel@tonic-gate   short	yyssa[YYINITDEPTH];	/*  the state stack			*/
4927c478bd9Sstevel@tonic-gate   YYSTYPE yyvsa[YYINITDEPTH];	/*  the semantic value stack		*/
4937c478bd9Sstevel@tonic-gate 
4947c478bd9Sstevel@tonic-gate   short *yyss = yyssa;		/*  refer to the stacks thru separate pointers */
4957c478bd9Sstevel@tonic-gate   YYSTYPE *yyvs = yyvsa;	/*  to allow yyoverflow to reallocate them elsewhere */
4967c478bd9Sstevel@tonic-gate 
4977c478bd9Sstevel@tonic-gate #ifdef YYLSP_NEEDED
4987c478bd9Sstevel@tonic-gate   YYLTYPE yylsa[YYINITDEPTH];	/*  the location stack			*/
4997c478bd9Sstevel@tonic-gate   YYLTYPE *yyls = yylsa;
5007c478bd9Sstevel@tonic-gate   YYLTYPE *yylsp;
5017c478bd9Sstevel@tonic-gate 
5027c478bd9Sstevel@tonic-gate #define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
5037c478bd9Sstevel@tonic-gate #else
5047c478bd9Sstevel@tonic-gate #define YYPOPSTACK   (yyvsp--, yyssp--)
5057c478bd9Sstevel@tonic-gate #endif
5067c478bd9Sstevel@tonic-gate 
5077c478bd9Sstevel@tonic-gate   int yystacksize = YYINITDEPTH;
5087c478bd9Sstevel@tonic-gate   int yyfree_stacks = 0;
5097c478bd9Sstevel@tonic-gate 
5107c478bd9Sstevel@tonic-gate #ifdef YYPURE
5117c478bd9Sstevel@tonic-gate   int yychar;
5127c478bd9Sstevel@tonic-gate   YYSTYPE yylval;
5137c478bd9Sstevel@tonic-gate   int yynerrs;
5147c478bd9Sstevel@tonic-gate #ifdef YYLSP_NEEDED
5157c478bd9Sstevel@tonic-gate   YYLTYPE yylloc;
5167c478bd9Sstevel@tonic-gate #endif
5177c478bd9Sstevel@tonic-gate #endif
5187c478bd9Sstevel@tonic-gate 
5197c478bd9Sstevel@tonic-gate   YYSTYPE yyval;		/*  the variable used to return		*/
5207c478bd9Sstevel@tonic-gate 				/*  semantic values from the action	*/
5217c478bd9Sstevel@tonic-gate 				/*  routines				*/
5227c478bd9Sstevel@tonic-gate 
5237c478bd9Sstevel@tonic-gate   int yylen;
5247c478bd9Sstevel@tonic-gate 
5257c478bd9Sstevel@tonic-gate #if YYDEBUG != 0
5267c478bd9Sstevel@tonic-gate   if (yydebug)
5277c478bd9Sstevel@tonic-gate     fprintf(stderr, "Starting parse\n");
5287c478bd9Sstevel@tonic-gate #endif
5297c478bd9Sstevel@tonic-gate 
5307c478bd9Sstevel@tonic-gate   yystate = 0;
5317c478bd9Sstevel@tonic-gate   yyerrstatus = 0;
5327c478bd9Sstevel@tonic-gate   yynerrs = 0;
5337c478bd9Sstevel@tonic-gate   yychar = YYEMPTY;		/* Cause a token to be read.  */
5347c478bd9Sstevel@tonic-gate 
5357c478bd9Sstevel@tonic-gate   /* Initialize stack pointers.
5367c478bd9Sstevel@tonic-gate      Waste one element of value and location stack
5377c478bd9Sstevel@tonic-gate      so that they stay on the same level as the state stack.
5387c478bd9Sstevel@tonic-gate      The wasted elements are never initialized.  */
5397c478bd9Sstevel@tonic-gate 
5407c478bd9Sstevel@tonic-gate   yyssp = yyss - 1;
5417c478bd9Sstevel@tonic-gate   yyvsp = yyvs;
5427c478bd9Sstevel@tonic-gate #ifdef YYLSP_NEEDED
5437c478bd9Sstevel@tonic-gate   yylsp = yyls;
5447c478bd9Sstevel@tonic-gate #endif
5457c478bd9Sstevel@tonic-gate 
5467c478bd9Sstevel@tonic-gate /* Push a new state, which is found in  yystate  .  */
5477c478bd9Sstevel@tonic-gate /* In all cases, when you get here, the value and location stacks
5487c478bd9Sstevel@tonic-gate    have just been pushed. so pushing a state here evens the stacks.  */
5497c478bd9Sstevel@tonic-gate yynewstate:
5507c478bd9Sstevel@tonic-gate 
5517c478bd9Sstevel@tonic-gate   *++yyssp = yystate;
5527c478bd9Sstevel@tonic-gate 
5537c478bd9Sstevel@tonic-gate   if (yyssp >= yyss + yystacksize - 1)
5547c478bd9Sstevel@tonic-gate     {
5557c478bd9Sstevel@tonic-gate       /* Give user a chance to reallocate the stack */
5567c478bd9Sstevel@tonic-gate       /* Use copies of these so that the &'s don't force the real ones into memory. */
5577c478bd9Sstevel@tonic-gate       YYSTYPE *yyvs1 = yyvs;
5587c478bd9Sstevel@tonic-gate       short *yyss1 = yyss;
5597c478bd9Sstevel@tonic-gate #ifdef YYLSP_NEEDED
5607c478bd9Sstevel@tonic-gate       YYLTYPE *yyls1 = yyls;
5617c478bd9Sstevel@tonic-gate #endif
5627c478bd9Sstevel@tonic-gate 
5637c478bd9Sstevel@tonic-gate       /* Get the current used size of the three stacks, in elements.  */
5647c478bd9Sstevel@tonic-gate       int size = yyssp - yyss + 1;
5657c478bd9Sstevel@tonic-gate 
5667c478bd9Sstevel@tonic-gate #ifdef yyoverflow
5677c478bd9Sstevel@tonic-gate       /* Each stack pointer address is followed by the size of
5687c478bd9Sstevel@tonic-gate 	 the data in use in that stack, in bytes.  */
5697c478bd9Sstevel@tonic-gate #ifdef YYLSP_NEEDED
5707c478bd9Sstevel@tonic-gate       /* This used to be a conditional around just the two extra args,
5717c478bd9Sstevel@tonic-gate 	 but that might be undefined if yyoverflow is a macro.  */
5727c478bd9Sstevel@tonic-gate       yyoverflow("parser stack overflow",
5737c478bd9Sstevel@tonic-gate 		 &yyss1, size * sizeof (*yyssp),
5747c478bd9Sstevel@tonic-gate 		 &yyvs1, size * sizeof (*yyvsp),
5757c478bd9Sstevel@tonic-gate 		 &yyls1, size * sizeof (*yylsp),
5767c478bd9Sstevel@tonic-gate 		 &yystacksize);
5777c478bd9Sstevel@tonic-gate #else
5787c478bd9Sstevel@tonic-gate       yyoverflow("parser stack overflow",
5797c478bd9Sstevel@tonic-gate 		 &yyss1, size * sizeof (*yyssp),
5807c478bd9Sstevel@tonic-gate 		 &yyvs1, size * sizeof (*yyvsp),
5817c478bd9Sstevel@tonic-gate 		 &yystacksize);
5827c478bd9Sstevel@tonic-gate #endif
5837c478bd9Sstevel@tonic-gate 
5847c478bd9Sstevel@tonic-gate       yyss = yyss1; yyvs = yyvs1;
5857c478bd9Sstevel@tonic-gate #ifdef YYLSP_NEEDED
5867c478bd9Sstevel@tonic-gate       yyls = yyls1;
5877c478bd9Sstevel@tonic-gate #endif
5887c478bd9Sstevel@tonic-gate #else /* no yyoverflow */
5897c478bd9Sstevel@tonic-gate       /* Extend the stack our own way.  */
5907c478bd9Sstevel@tonic-gate       if (yystacksize >= YYMAXDEPTH)
5917c478bd9Sstevel@tonic-gate 	{
5927c478bd9Sstevel@tonic-gate 	  yyerror("parser stack overflow");
5937c478bd9Sstevel@tonic-gate 	  if (yyfree_stacks)
5947c478bd9Sstevel@tonic-gate 	    {
5957c478bd9Sstevel@tonic-gate 	      free (yyss);
5967c478bd9Sstevel@tonic-gate 	      free (yyvs);
5977c478bd9Sstevel@tonic-gate #ifdef YYLSP_NEEDED
5987c478bd9Sstevel@tonic-gate 	      free (yyls);
5997c478bd9Sstevel@tonic-gate #endif
6007c478bd9Sstevel@tonic-gate 	    }
6017c478bd9Sstevel@tonic-gate 	  return 2;
6027c478bd9Sstevel@tonic-gate 	}
6037c478bd9Sstevel@tonic-gate       yystacksize *= 2;
6047c478bd9Sstevel@tonic-gate       if (yystacksize > YYMAXDEPTH)
6057c478bd9Sstevel@tonic-gate 	yystacksize = YYMAXDEPTH;
6067c478bd9Sstevel@tonic-gate #ifndef YYSTACK_USE_ALLOCA
6077c478bd9Sstevel@tonic-gate       yyfree_stacks = 1;
6087c478bd9Sstevel@tonic-gate #endif
6097c478bd9Sstevel@tonic-gate       yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
6107c478bd9Sstevel@tonic-gate       __yy_memcpy ((char *)yyss, (char *)yyss1,
6117c478bd9Sstevel@tonic-gate 		   size * (unsigned int) sizeof (*yyssp));
6127c478bd9Sstevel@tonic-gate       yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
6137c478bd9Sstevel@tonic-gate       __yy_memcpy ((char *)yyvs, (char *)yyvs1,
6147c478bd9Sstevel@tonic-gate 		   size * (unsigned int) sizeof (*yyvsp));
6157c478bd9Sstevel@tonic-gate #ifdef YYLSP_NEEDED
6167c478bd9Sstevel@tonic-gate       yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
6177c478bd9Sstevel@tonic-gate       __yy_memcpy ((char *)yyls, (char *)yyls1,
6187c478bd9Sstevel@tonic-gate 		   size * (unsigned int) sizeof (*yylsp));
6197c478bd9Sstevel@tonic-gate #endif
6207c478bd9Sstevel@tonic-gate #endif /* no yyoverflow */
6217c478bd9Sstevel@tonic-gate 
6227c478bd9Sstevel@tonic-gate       yyssp = yyss + size - 1;
6237c478bd9Sstevel@tonic-gate       yyvsp = yyvs + size - 1;
6247c478bd9Sstevel@tonic-gate #ifdef YYLSP_NEEDED
6257c478bd9Sstevel@tonic-gate       yylsp = yyls + size - 1;
6267c478bd9Sstevel@tonic-gate #endif
6277c478bd9Sstevel@tonic-gate 
6287c478bd9Sstevel@tonic-gate #if YYDEBUG != 0
6297c478bd9Sstevel@tonic-gate       if (yydebug)
6307c478bd9Sstevel@tonic-gate 	fprintf(stderr, "Stack size increased to %d\n", yystacksize);
6317c478bd9Sstevel@tonic-gate #endif
6327c478bd9Sstevel@tonic-gate 
6337c478bd9Sstevel@tonic-gate       if (yyssp >= yyss + yystacksize - 1)
6347c478bd9Sstevel@tonic-gate 	YYABORT;
6357c478bd9Sstevel@tonic-gate     }
6367c478bd9Sstevel@tonic-gate 
6377c478bd9Sstevel@tonic-gate #if YYDEBUG != 0
6387c478bd9Sstevel@tonic-gate   if (yydebug)
6397c478bd9Sstevel@tonic-gate     fprintf(stderr, "Entering state %d\n", yystate);
6407c478bd9Sstevel@tonic-gate #endif
6417c478bd9Sstevel@tonic-gate 
6427c478bd9Sstevel@tonic-gate   goto yybackup;
6437c478bd9Sstevel@tonic-gate  yybackup:
6447c478bd9Sstevel@tonic-gate 
6457c478bd9Sstevel@tonic-gate /* Do appropriate processing given the current state.  */
6467c478bd9Sstevel@tonic-gate /* Read a lookahead token if we need one and don't already have one.  */
6477c478bd9Sstevel@tonic-gate /* yyresume: */
6487c478bd9Sstevel@tonic-gate 
6497c478bd9Sstevel@tonic-gate   /* First try to decide what to do without reference to lookahead token.  */
6507c478bd9Sstevel@tonic-gate 
6517c478bd9Sstevel@tonic-gate   yyn = yypact[yystate];
6527c478bd9Sstevel@tonic-gate   if (yyn == YYFLAG)
6537c478bd9Sstevel@tonic-gate     goto yydefault;
6547c478bd9Sstevel@tonic-gate 
6557c478bd9Sstevel@tonic-gate   /* Not known => get a lookahead token if don't already have one.  */
6567c478bd9Sstevel@tonic-gate 
6577c478bd9Sstevel@tonic-gate   /* yychar is either YYEMPTY or YYEOF
6587c478bd9Sstevel@tonic-gate      or a valid token in external form.  */
6597c478bd9Sstevel@tonic-gate 
6607c478bd9Sstevel@tonic-gate   if (yychar == YYEMPTY)
6617c478bd9Sstevel@tonic-gate     {
6627c478bd9Sstevel@tonic-gate #if YYDEBUG != 0
6637c478bd9Sstevel@tonic-gate       if (yydebug)
6647c478bd9Sstevel@tonic-gate 	fprintf(stderr, "Reading a token: ");
6657c478bd9Sstevel@tonic-gate #endif
6667c478bd9Sstevel@tonic-gate       yychar = YYLEX;
6677c478bd9Sstevel@tonic-gate     }
6687c478bd9Sstevel@tonic-gate 
6697c478bd9Sstevel@tonic-gate   /* Convert token to internal form (in yychar1) for indexing tables with */
6707c478bd9Sstevel@tonic-gate 
6717c478bd9Sstevel@tonic-gate   if (yychar <= 0)		/* This means end of input. */
6727c478bd9Sstevel@tonic-gate     {
6737c478bd9Sstevel@tonic-gate       yychar1 = 0;
6747c478bd9Sstevel@tonic-gate       yychar = YYEOF;		/* Don't call YYLEX any more */
6757c478bd9Sstevel@tonic-gate 
6767c478bd9Sstevel@tonic-gate #if YYDEBUG != 0
6777c478bd9Sstevel@tonic-gate       if (yydebug)
6787c478bd9Sstevel@tonic-gate 	fprintf(stderr, "Now at end of input.\n");
6797c478bd9Sstevel@tonic-gate #endif
6807c478bd9Sstevel@tonic-gate     }
6817c478bd9Sstevel@tonic-gate   else
6827c478bd9Sstevel@tonic-gate     {
6837c478bd9Sstevel@tonic-gate       yychar1 = YYTRANSLATE(yychar);
6847c478bd9Sstevel@tonic-gate 
6857c478bd9Sstevel@tonic-gate #if YYDEBUG != 0
6867c478bd9Sstevel@tonic-gate       if (yydebug)
6877c478bd9Sstevel@tonic-gate 	{
6887c478bd9Sstevel@tonic-gate 	  fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
6897c478bd9Sstevel@tonic-gate 	  /* Give the individual parser a way to print the precise meaning
6907c478bd9Sstevel@tonic-gate 	     of a token, for further debugging info.  */
6917c478bd9Sstevel@tonic-gate #ifdef YYPRINT
6927c478bd9Sstevel@tonic-gate 	  YYPRINT (stderr, yychar, yylval);
6937c478bd9Sstevel@tonic-gate #endif
6947c478bd9Sstevel@tonic-gate 	  fprintf (stderr, ")\n");
6957c478bd9Sstevel@tonic-gate 	}
6967c478bd9Sstevel@tonic-gate #endif
6977c478bd9Sstevel@tonic-gate     }
6987c478bd9Sstevel@tonic-gate 
6997c478bd9Sstevel@tonic-gate   yyn += yychar1;
7007c478bd9Sstevel@tonic-gate   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
7017c478bd9Sstevel@tonic-gate     goto yydefault;
7027c478bd9Sstevel@tonic-gate 
7037c478bd9Sstevel@tonic-gate   yyn = yytable[yyn];
7047c478bd9Sstevel@tonic-gate 
7057c478bd9Sstevel@tonic-gate   /* yyn is what to do for this token type in this state.
7067c478bd9Sstevel@tonic-gate      Negative => reduce, -yyn is rule number.
7077c478bd9Sstevel@tonic-gate      Positive => shift, yyn is new state.
7087c478bd9Sstevel@tonic-gate        New state is final state => don't bother to shift,
7097c478bd9Sstevel@tonic-gate        just return success.
7107c478bd9Sstevel@tonic-gate      0, or most negative number => error.  */
7117c478bd9Sstevel@tonic-gate 
7127c478bd9Sstevel@tonic-gate   if (yyn < 0)
7137c478bd9Sstevel@tonic-gate     {
7147c478bd9Sstevel@tonic-gate       if (yyn == YYFLAG)
7157c478bd9Sstevel@tonic-gate 	goto yyerrlab;
7167c478bd9Sstevel@tonic-gate       yyn = -yyn;
7177c478bd9Sstevel@tonic-gate       goto yyreduce;
7187c478bd9Sstevel@tonic-gate     }
7197c478bd9Sstevel@tonic-gate   else if (yyn == 0)
7207c478bd9Sstevel@tonic-gate     goto yyerrlab;
7217c478bd9Sstevel@tonic-gate 
7227c478bd9Sstevel@tonic-gate   if (yyn == YYFINAL)
7237c478bd9Sstevel@tonic-gate     YYACCEPT;
7247c478bd9Sstevel@tonic-gate 
7257c478bd9Sstevel@tonic-gate   /* Shift the lookahead token.  */
7267c478bd9Sstevel@tonic-gate 
7277c478bd9Sstevel@tonic-gate #if YYDEBUG != 0
7287c478bd9Sstevel@tonic-gate   if (yydebug)
7297c478bd9Sstevel@tonic-gate     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
7307c478bd9Sstevel@tonic-gate #endif
7317c478bd9Sstevel@tonic-gate 
7327c478bd9Sstevel@tonic-gate   /* Discard the token being shifted unless it is eof.  */
7337c478bd9Sstevel@tonic-gate   if (yychar != YYEOF)
7347c478bd9Sstevel@tonic-gate     yychar = YYEMPTY;
7357c478bd9Sstevel@tonic-gate 
7367c478bd9Sstevel@tonic-gate   *++yyvsp = yylval;
7377c478bd9Sstevel@tonic-gate #ifdef YYLSP_NEEDED
7387c478bd9Sstevel@tonic-gate   *++yylsp = yylloc;
7397c478bd9Sstevel@tonic-gate #endif
7407c478bd9Sstevel@tonic-gate 
7417c478bd9Sstevel@tonic-gate   /* count tokens shifted since error; after three, turn off error status.  */
7427c478bd9Sstevel@tonic-gate   if (yyerrstatus) yyerrstatus--;
7437c478bd9Sstevel@tonic-gate 
7447c478bd9Sstevel@tonic-gate   yystate = yyn;
7457c478bd9Sstevel@tonic-gate   goto yynewstate;
7467c478bd9Sstevel@tonic-gate 
7477c478bd9Sstevel@tonic-gate /* Do the default action for the current state.  */
7487c478bd9Sstevel@tonic-gate yydefault:
7497c478bd9Sstevel@tonic-gate 
7507c478bd9Sstevel@tonic-gate   yyn = yydefact[yystate];
7517c478bd9Sstevel@tonic-gate   if (yyn == 0)
7527c478bd9Sstevel@tonic-gate     goto yyerrlab;
7537c478bd9Sstevel@tonic-gate 
7547c478bd9Sstevel@tonic-gate /* Do a reduction.  yyn is the number of a rule to reduce with.  */
7557c478bd9Sstevel@tonic-gate yyreduce:
7567c478bd9Sstevel@tonic-gate   yylen = yyr2[yyn];
7577c478bd9Sstevel@tonic-gate   if (yylen > 0)
7587c478bd9Sstevel@tonic-gate     yyval = yyvsp[1-yylen]; /* implement default value of the action */
7597c478bd9Sstevel@tonic-gate 
7607c478bd9Sstevel@tonic-gate #if YYDEBUG != 0
7617c478bd9Sstevel@tonic-gate   if (yydebug)
7627c478bd9Sstevel@tonic-gate     {
7637c478bd9Sstevel@tonic-gate       int i;
7647c478bd9Sstevel@tonic-gate 
7657c478bd9Sstevel@tonic-gate       fprintf (stderr, "Reducing via rule %d (line %d), ",
7667c478bd9Sstevel@tonic-gate 	       yyn, yyrline[yyn]);
7677c478bd9Sstevel@tonic-gate 
7687c478bd9Sstevel@tonic-gate       /* Print the symbols being reduced, and their result.  */
7697c478bd9Sstevel@tonic-gate       for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
7707c478bd9Sstevel@tonic-gate 	fprintf (stderr, "%s ", yytname[yyrhs[i]]);
7717c478bd9Sstevel@tonic-gate       fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
7727c478bd9Sstevel@tonic-gate     }
7737c478bd9Sstevel@tonic-gate #endif
7747c478bd9Sstevel@tonic-gate 
7757c478bd9Sstevel@tonic-gate 
7767c478bd9Sstevel@tonic-gate   switch (yyn) {
7777c478bd9Sstevel@tonic-gate 
7787c478bd9Sstevel@tonic-gate case 5:
779505d05c7Sgtb #line 138 "./x-deltat.y"
7807c478bd9Sstevel@tonic-gate { yyval.val = - yyvsp[0].val; ;
7817c478bd9Sstevel@tonic-gate     break;}
7827c478bd9Sstevel@tonic-gate case 8:
783505d05c7Sgtb #line 140 "./x-deltat.y"
7847c478bd9Sstevel@tonic-gate { yyval.val = yyvsp[0].val; ;
7857c478bd9Sstevel@tonic-gate     break;}
7867c478bd9Sstevel@tonic-gate case 9:
787505d05c7Sgtb #line 141 "./x-deltat.y"
788505d05c7Sgtb { YYERROR ;
7897c478bd9Sstevel@tonic-gate     break;}
7907c478bd9Sstevel@tonic-gate case 10:
791505d05c7Sgtb #line 143 "./x-deltat.y"
792505d05c7Sgtb { DO (yyvsp[-2].val,  0,  0, yyvsp[0].val); ;
7937c478bd9Sstevel@tonic-gate     break;}
7947c478bd9Sstevel@tonic-gate case 11:
795505d05c7Sgtb #line 144 "./x-deltat.y"
796505d05c7Sgtb { DO ( 0, yyvsp[-2].val,  0, yyvsp[0].val); ;
7977c478bd9Sstevel@tonic-gate     break;}
7987c478bd9Sstevel@tonic-gate case 12:
799505d05c7Sgtb #line 145 "./x-deltat.y"
800505d05c7Sgtb { DO ( 0,  0, yyvsp[-2].val, yyvsp[0].val); ;
8017c478bd9Sstevel@tonic-gate     break;}
8027c478bd9Sstevel@tonic-gate case 13:
803505d05c7Sgtb #line 146 "./x-deltat.y"
804505d05c7Sgtb { DO ( 0,  0,  0, yyvsp[-1].val); ;
8057c478bd9Sstevel@tonic-gate     break;}
8067c478bd9Sstevel@tonic-gate case 14:
807505d05c7Sgtb #line 147 "./x-deltat.y"
808505d05c7Sgtb { DO (yyvsp[-6].val, yyvsp[-4].val, yyvsp[-2].val, yyvsp[0].val); ;
8097c478bd9Sstevel@tonic-gate     break;}
8107c478bd9Sstevel@tonic-gate case 15:
811505d05c7Sgtb #line 148 "./x-deltat.y"
812505d05c7Sgtb { DO ( 0, yyvsp[-4].val, yyvsp[-2].val, yyvsp[0].val); ;
813505d05c7Sgtb     break;}
814505d05c7Sgtb case 16:
815505d05c7Sgtb #line 149 "./x-deltat.y"
8167c478bd9Sstevel@tonic-gate { DO ( 0, yyvsp[-2].val, yyvsp[0].val,  0); ;
8177c478bd9Sstevel@tonic-gate     break;}
8187c478bd9Sstevel@tonic-gate case 17:
819505d05c7Sgtb #line 150 "./x-deltat.y"
820505d05c7Sgtb { DO ( 0,  0,  0, yyvsp[0].val); ;
8217c478bd9Sstevel@tonic-gate     break;}
8227c478bd9Sstevel@tonic-gate case 19:
823505d05c7Sgtb #line 155 "./x-deltat.y"
824505d05c7Sgtb { if (HOUR_NOT_OK(yyvsp[-2].val)) YYERROR;
825505d05c7Sgtb 	                                  DO_SUM(yyval.val, yyvsp[-2].val * 3600, yyvsp[0].val); ;
826505d05c7Sgtb     break;}
827505d05c7Sgtb case 21:
828505d05c7Sgtb #line 159 "./x-deltat.y"
829505d05c7Sgtb { if (MIN_NOT_OK(yyvsp[-2].val)) YYERROR;
830505d05c7Sgtb 	                                  DO_SUM(yyval.val, yyvsp[-2].val * 60, yyvsp[0].val); ;
8317c478bd9Sstevel@tonic-gate     break;}
832505d05c7Sgtb case 22:
833505d05c7Sgtb #line 162 "./x-deltat.y"
8347c478bd9Sstevel@tonic-gate { yyval.val = 0; ;
8357c478bd9Sstevel@tonic-gate     break;}
8367c478bd9Sstevel@tonic-gate }
8377c478bd9Sstevel@tonic-gate    /* the action file gets copied in in place of this dollarsign */
838505d05c7Sgtb #line 543 "/usr/share/bison.simple"
8397c478bd9Sstevel@tonic-gate 
8407c478bd9Sstevel@tonic-gate   yyvsp -= yylen;
8417c478bd9Sstevel@tonic-gate   yyssp -= yylen;
8427c478bd9Sstevel@tonic-gate #ifdef YYLSP_NEEDED
8437c478bd9Sstevel@tonic-gate   yylsp -= yylen;
8447c478bd9Sstevel@tonic-gate #endif
8457c478bd9Sstevel@tonic-gate 
8467c478bd9Sstevel@tonic-gate #if YYDEBUG != 0
8477c478bd9Sstevel@tonic-gate   if (yydebug)
8487c478bd9Sstevel@tonic-gate     {
8497c478bd9Sstevel@tonic-gate       short *ssp1 = yyss - 1;
8507c478bd9Sstevel@tonic-gate       fprintf (stderr, "state stack now");
8517c478bd9Sstevel@tonic-gate       while (ssp1 != yyssp)
8527c478bd9Sstevel@tonic-gate 	fprintf (stderr, " %d", *++ssp1);
8537c478bd9Sstevel@tonic-gate       fprintf (stderr, "\n");
8547c478bd9Sstevel@tonic-gate     }
8557c478bd9Sstevel@tonic-gate #endif
8567c478bd9Sstevel@tonic-gate 
8577c478bd9Sstevel@tonic-gate   *++yyvsp = yyval;
8587c478bd9Sstevel@tonic-gate 
8597c478bd9Sstevel@tonic-gate #ifdef YYLSP_NEEDED
8607c478bd9Sstevel@tonic-gate   yylsp++;
8617c478bd9Sstevel@tonic-gate   if (yylen == 0)
8627c478bd9Sstevel@tonic-gate     {
8637c478bd9Sstevel@tonic-gate       yylsp->first_line = yylloc.first_line;
8647c478bd9Sstevel@tonic-gate       yylsp->first_column = yylloc.first_column;
8657c478bd9Sstevel@tonic-gate       yylsp->last_line = (yylsp-1)->last_line;
8667c478bd9Sstevel@tonic-gate       yylsp->last_column = (yylsp-1)->last_column;
8677c478bd9Sstevel@tonic-gate       yylsp->text = 0;
8687c478bd9Sstevel@tonic-gate     }
8697c478bd9Sstevel@tonic-gate   else
8707c478bd9Sstevel@tonic-gate     {
8717c478bd9Sstevel@tonic-gate       yylsp->last_line = (yylsp+yylen-1)->last_line;
8727c478bd9Sstevel@tonic-gate       yylsp->last_column = (yylsp+yylen-1)->last_column;
8737c478bd9Sstevel@tonic-gate     }
8747c478bd9Sstevel@tonic-gate #endif
8757c478bd9Sstevel@tonic-gate 
8767c478bd9Sstevel@tonic-gate   /* Now "shift" the result of the reduction.
8777c478bd9Sstevel@tonic-gate      Determine what state that goes to,
8787c478bd9Sstevel@tonic-gate      based on the state we popped back to
8797c478bd9Sstevel@tonic-gate      and the rule number reduced by.  */
8807c478bd9Sstevel@tonic-gate 
8817c478bd9Sstevel@tonic-gate   yyn = yyr1[yyn];
8827c478bd9Sstevel@tonic-gate 
8837c478bd9Sstevel@tonic-gate   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
8847c478bd9Sstevel@tonic-gate   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
8857c478bd9Sstevel@tonic-gate     yystate = yytable[yystate];
8867c478bd9Sstevel@tonic-gate   else
8877c478bd9Sstevel@tonic-gate     yystate = yydefgoto[yyn - YYNTBASE];
8887c478bd9Sstevel@tonic-gate 
8897c478bd9Sstevel@tonic-gate   goto yynewstate;
8907c478bd9Sstevel@tonic-gate 
8917c478bd9Sstevel@tonic-gate yyerrlab:   /* here on detecting error */
8927c478bd9Sstevel@tonic-gate 
8937c478bd9Sstevel@tonic-gate   if (! yyerrstatus)
8947c478bd9Sstevel@tonic-gate     /* If not already recovering from an error, report this error.  */
8957c478bd9Sstevel@tonic-gate     {
8967c478bd9Sstevel@tonic-gate       ++yynerrs;
8977c478bd9Sstevel@tonic-gate 
8987c478bd9Sstevel@tonic-gate #ifdef YYERROR_VERBOSE
8997c478bd9Sstevel@tonic-gate       yyn = yypact[yystate];
9007c478bd9Sstevel@tonic-gate 
9017c478bd9Sstevel@tonic-gate       if (yyn > YYFLAG && yyn < YYLAST)
9027c478bd9Sstevel@tonic-gate 	{
9037c478bd9Sstevel@tonic-gate 	  int size = 0;
9047c478bd9Sstevel@tonic-gate 	  char *msg;
9057c478bd9Sstevel@tonic-gate 	  int x, count;
9067c478bd9Sstevel@tonic-gate 
9077c478bd9Sstevel@tonic-gate 	  count = 0;
9087c478bd9Sstevel@tonic-gate 	  /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
9097c478bd9Sstevel@tonic-gate 	  for (x = (yyn < 0 ? -yyn : 0);
9107c478bd9Sstevel@tonic-gate 	       x < (sizeof(yytname) / sizeof(char *)); x++)
9117c478bd9Sstevel@tonic-gate 	    if (yycheck[x + yyn] == x)
9127c478bd9Sstevel@tonic-gate 	      size += strlen(yytname[x]) + 15, count++;
9137c478bd9Sstevel@tonic-gate 	  msg = (char *) malloc(size + 15);
9147c478bd9Sstevel@tonic-gate 	  if (msg != 0)
9157c478bd9Sstevel@tonic-gate 	    {
9167c478bd9Sstevel@tonic-gate 	      strcpy(msg, "parse error");
9177c478bd9Sstevel@tonic-gate 
9187c478bd9Sstevel@tonic-gate 	      if (count < 5)
9197c478bd9Sstevel@tonic-gate 		{
9207c478bd9Sstevel@tonic-gate 		  count = 0;
9217c478bd9Sstevel@tonic-gate 		  for (x = (yyn < 0 ? -yyn : 0);
9227c478bd9Sstevel@tonic-gate 		       x < (sizeof(yytname) / sizeof(char *)); x++)
9237c478bd9Sstevel@tonic-gate 		    if (yycheck[x + yyn] == x)
9247c478bd9Sstevel@tonic-gate 		      {
9257c478bd9Sstevel@tonic-gate 			strcat(msg, count == 0 ? ", expecting `" : " or `");
9267c478bd9Sstevel@tonic-gate 			strcat(msg, yytname[x]);
9277c478bd9Sstevel@tonic-gate 			strcat(msg, "'");
9287c478bd9Sstevel@tonic-gate 			count++;
9297c478bd9Sstevel@tonic-gate 		      }
9307c478bd9Sstevel@tonic-gate 		}
9317c478bd9Sstevel@tonic-gate 	      yyerror(msg);
9327c478bd9Sstevel@tonic-gate 	      free(msg);
9337c478bd9Sstevel@tonic-gate 	    }
9347c478bd9Sstevel@tonic-gate 	  else
9357c478bd9Sstevel@tonic-gate 	    yyerror ("parse error; also virtual memory exceeded");
9367c478bd9Sstevel@tonic-gate 	}
9377c478bd9Sstevel@tonic-gate       else
9387c478bd9Sstevel@tonic-gate #endif /* YYERROR_VERBOSE */
9397c478bd9Sstevel@tonic-gate 	yyerror("parse error");
9407c478bd9Sstevel@tonic-gate     }
9417c478bd9Sstevel@tonic-gate 
9427c478bd9Sstevel@tonic-gate   goto yyerrlab1;
9437c478bd9Sstevel@tonic-gate yyerrlab1:   /* here on error raised explicitly by an action */
9447c478bd9Sstevel@tonic-gate 
9457c478bd9Sstevel@tonic-gate   if (yyerrstatus == 3)
9467c478bd9Sstevel@tonic-gate     {
9477c478bd9Sstevel@tonic-gate       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
9487c478bd9Sstevel@tonic-gate 
9497c478bd9Sstevel@tonic-gate       /* return failure if at end of input */
9507c478bd9Sstevel@tonic-gate       if (yychar == YYEOF)
9517c478bd9Sstevel@tonic-gate 	YYABORT;
9527c478bd9Sstevel@tonic-gate 
9537c478bd9Sstevel@tonic-gate #if YYDEBUG != 0
9547c478bd9Sstevel@tonic-gate       if (yydebug)
9557c478bd9Sstevel@tonic-gate 	fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
9567c478bd9Sstevel@tonic-gate #endif
9577c478bd9Sstevel@tonic-gate 
9587c478bd9Sstevel@tonic-gate       yychar = YYEMPTY;
9597c478bd9Sstevel@tonic-gate     }
9607c478bd9Sstevel@tonic-gate 
9617c478bd9Sstevel@tonic-gate   /* Else will try to reuse lookahead token
9627c478bd9Sstevel@tonic-gate      after shifting the error token.  */
9637c478bd9Sstevel@tonic-gate 
9647c478bd9Sstevel@tonic-gate   yyerrstatus = 3;		/* Each real token shifted decrements this */
9657c478bd9Sstevel@tonic-gate 
9667c478bd9Sstevel@tonic-gate   goto yyerrhandle;
9677c478bd9Sstevel@tonic-gate 
9687c478bd9Sstevel@tonic-gate yyerrdefault:  /* current state does not do anything special for the error token. */
9697c478bd9Sstevel@tonic-gate 
9707c478bd9Sstevel@tonic-gate #if 0
9717c478bd9Sstevel@tonic-gate   /* This is wrong; only states that explicitly want error tokens
9727c478bd9Sstevel@tonic-gate      should shift them.  */
9737c478bd9Sstevel@tonic-gate   yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
9747c478bd9Sstevel@tonic-gate   if (yyn) goto yydefault;
9757c478bd9Sstevel@tonic-gate #endif
9767c478bd9Sstevel@tonic-gate 
9777c478bd9Sstevel@tonic-gate yyerrpop:   /* pop the current state because it cannot handle the error token */
9787c478bd9Sstevel@tonic-gate 
9797c478bd9Sstevel@tonic-gate   if (yyssp == yyss) YYABORT;
9807c478bd9Sstevel@tonic-gate   yyvsp--;
9817c478bd9Sstevel@tonic-gate   yystate = *--yyssp;
9827c478bd9Sstevel@tonic-gate #ifdef YYLSP_NEEDED
9837c478bd9Sstevel@tonic-gate   yylsp--;
9847c478bd9Sstevel@tonic-gate #endif
9857c478bd9Sstevel@tonic-gate 
9867c478bd9Sstevel@tonic-gate #if YYDEBUG != 0
9877c478bd9Sstevel@tonic-gate   if (yydebug)
9887c478bd9Sstevel@tonic-gate     {
9897c478bd9Sstevel@tonic-gate       short *ssp1 = yyss - 1;
9907c478bd9Sstevel@tonic-gate       fprintf (stderr, "Error: state stack now");
9917c478bd9Sstevel@tonic-gate       while (ssp1 != yyssp)
9927c478bd9Sstevel@tonic-gate 	fprintf (stderr, " %d", *++ssp1);
9937c478bd9Sstevel@tonic-gate       fprintf (stderr, "\n");
9947c478bd9Sstevel@tonic-gate     }
9957c478bd9Sstevel@tonic-gate #endif
9967c478bd9Sstevel@tonic-gate 
9977c478bd9Sstevel@tonic-gate yyerrhandle:
9987c478bd9Sstevel@tonic-gate 
9997c478bd9Sstevel@tonic-gate   yyn = yypact[yystate];
10007c478bd9Sstevel@tonic-gate   if (yyn == YYFLAG)
10017c478bd9Sstevel@tonic-gate     goto yyerrdefault;
10027c478bd9Sstevel@tonic-gate 
10037c478bd9Sstevel@tonic-gate   yyn += YYTERROR;
10047c478bd9Sstevel@tonic-gate   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
10057c478bd9Sstevel@tonic-gate     goto yyerrdefault;
10067c478bd9Sstevel@tonic-gate 
10077c478bd9Sstevel@tonic-gate   yyn = yytable[yyn];
10087c478bd9Sstevel@tonic-gate   if (yyn < 0)
10097c478bd9Sstevel@tonic-gate     {
10107c478bd9Sstevel@tonic-gate       if (yyn == YYFLAG)
10117c478bd9Sstevel@tonic-gate 	goto yyerrpop;
10127c478bd9Sstevel@tonic-gate       yyn = -yyn;
10137c478bd9Sstevel@tonic-gate       goto yyreduce;
10147c478bd9Sstevel@tonic-gate     }
10157c478bd9Sstevel@tonic-gate   else if (yyn == 0)
10167c478bd9Sstevel@tonic-gate     goto yyerrpop;
10177c478bd9Sstevel@tonic-gate 
10187c478bd9Sstevel@tonic-gate   if (yyn == YYFINAL)
10197c478bd9Sstevel@tonic-gate     YYACCEPT;
10207c478bd9Sstevel@tonic-gate 
10217c478bd9Sstevel@tonic-gate #if YYDEBUG != 0
10227c478bd9Sstevel@tonic-gate   if (yydebug)
10237c478bd9Sstevel@tonic-gate     fprintf(stderr, "Shifting error token, ");
10247c478bd9Sstevel@tonic-gate #endif
10257c478bd9Sstevel@tonic-gate 
10267c478bd9Sstevel@tonic-gate   *++yyvsp = yylval;
10277c478bd9Sstevel@tonic-gate #ifdef YYLSP_NEEDED
10287c478bd9Sstevel@tonic-gate   *++yylsp = yylloc;
10297c478bd9Sstevel@tonic-gate #endif
10307c478bd9Sstevel@tonic-gate 
10317c478bd9Sstevel@tonic-gate   yystate = yyn;
10327c478bd9Sstevel@tonic-gate   goto yynewstate;
10337c478bd9Sstevel@tonic-gate 
10347c478bd9Sstevel@tonic-gate  yyacceptlab:
10357c478bd9Sstevel@tonic-gate   /* YYACCEPT comes here.  */
10367c478bd9Sstevel@tonic-gate   if (yyfree_stacks)
10377c478bd9Sstevel@tonic-gate     {
10387c478bd9Sstevel@tonic-gate       free (yyss);
10397c478bd9Sstevel@tonic-gate       free (yyvs);
10407c478bd9Sstevel@tonic-gate #ifdef YYLSP_NEEDED
10417c478bd9Sstevel@tonic-gate       free (yyls);
10427c478bd9Sstevel@tonic-gate #endif
10437c478bd9Sstevel@tonic-gate     }
10447c478bd9Sstevel@tonic-gate   return 0;
10457c478bd9Sstevel@tonic-gate 
10467c478bd9Sstevel@tonic-gate  yyabortlab:
10477c478bd9Sstevel@tonic-gate   /* YYABORT comes here.  */
10487c478bd9Sstevel@tonic-gate   if (yyfree_stacks)
10497c478bd9Sstevel@tonic-gate     {
10507c478bd9Sstevel@tonic-gate       free (yyss);
10517c478bd9Sstevel@tonic-gate       free (yyvs);
10527c478bd9Sstevel@tonic-gate #ifdef YYLSP_NEEDED
10537c478bd9Sstevel@tonic-gate       free (yyls);
10547c478bd9Sstevel@tonic-gate #endif
10557c478bd9Sstevel@tonic-gate     }
10567c478bd9Sstevel@tonic-gate   return 1;
10577c478bd9Sstevel@tonic-gate }
1058505d05c7Sgtb #line 165 "./x-deltat.y"
10597c478bd9Sstevel@tonic-gate 
10607c478bd9Sstevel@tonic-gate 
10617c478bd9Sstevel@tonic-gate static int
mylex(krb5_int32 * intp,char ** pp)1062505d05c7Sgtb mylex (krb5_int32 *intp, char **pp)
10637c478bd9Sstevel@tonic-gate {
10647c478bd9Sstevel@tonic-gate     int num, c;
10657c478bd9Sstevel@tonic-gate #define P (*pp)
10667c478bd9Sstevel@tonic-gate     char *orig_p = P;
10677c478bd9Sstevel@tonic-gate 
10687c478bd9Sstevel@tonic-gate #ifdef isascii
10697c478bd9Sstevel@tonic-gate     if (!isascii (*P))
10707c478bd9Sstevel@tonic-gate 	return 0;
10717c478bd9Sstevel@tonic-gate #endif
10727c478bd9Sstevel@tonic-gate     switch (c = *P++) {
10737c478bd9Sstevel@tonic-gate     case '-':
10747c478bd9Sstevel@tonic-gate     case ':':
10757c478bd9Sstevel@tonic-gate     case 'd':
10767c478bd9Sstevel@tonic-gate     case 'h':
10777c478bd9Sstevel@tonic-gate     case 'm':
10787c478bd9Sstevel@tonic-gate     case 's':
10797c478bd9Sstevel@tonic-gate 	return c;
10807c478bd9Sstevel@tonic-gate     case '0':
10817c478bd9Sstevel@tonic-gate     case '1':
10827c478bd9Sstevel@tonic-gate     case '2':
10837c478bd9Sstevel@tonic-gate     case '3':
10847c478bd9Sstevel@tonic-gate     case '4':
10857c478bd9Sstevel@tonic-gate     case '5':
10867c478bd9Sstevel@tonic-gate     case '6':
10877c478bd9Sstevel@tonic-gate     case '7':
10887c478bd9Sstevel@tonic-gate     case '8':
10897c478bd9Sstevel@tonic-gate     case '9':
10907c478bd9Sstevel@tonic-gate 	/* XXX assumes ASCII */
10917c478bd9Sstevel@tonic-gate 	num = c - '0';
1092505d05c7Sgtb 	while (isdigit ((int) *P)) {
1093*1da57d55SToomas Soome 	  if (num > MAX_TIME / 10)
1094505d05c7Sgtb 	    return OVERFLOW;
10957c478bd9Sstevel@tonic-gate 	    num *= 10;
1096*1da57d55SToomas Soome 	    if (num > MAX_TIME - (*P - '0'))
1097505d05c7Sgtb 	      return OVERFLOW;
10987c478bd9Sstevel@tonic-gate 	    num += *P++ - '0';
10997c478bd9Sstevel@tonic-gate 	}
11007c478bd9Sstevel@tonic-gate 	*intp = num;
11017c478bd9Sstevel@tonic-gate 	return (P - orig_p > 2) ? LONGNUM : NUM;
11027c478bd9Sstevel@tonic-gate     case ' ':
11037c478bd9Sstevel@tonic-gate     case '\t':
11047c478bd9Sstevel@tonic-gate     case '\n':
1105505d05c7Sgtb 	while (isspace ((int) *P))
11067c478bd9Sstevel@tonic-gate 	    P++;
11077c478bd9Sstevel@tonic-gate 	return WS;
11087c478bd9Sstevel@tonic-gate     default:
11097c478bd9Sstevel@tonic-gate 	return YYEOF;
11107c478bd9Sstevel@tonic-gate     }
11117c478bd9Sstevel@tonic-gate }
11127c478bd9Sstevel@tonic-gate 
1113505d05c7Sgtb krb5_error_code KRB5_CALLCONV
krb5_string_to_deltat(char * string,krb5_deltat * deltatp)1114505d05c7Sgtb krb5_string_to_deltat(char *string, krb5_deltat *deltatp)
11157c478bd9Sstevel@tonic-gate {
11167c478bd9Sstevel@tonic-gate     struct param p;
11177c478bd9Sstevel@tonic-gate     p.delta = 0;
11187c478bd9Sstevel@tonic-gate     p.p = string;
11197c478bd9Sstevel@tonic-gate     if (yyparse (&p))
1120505d05c7Sgtb 	return KRB5_DELTAT_BADFORMAT;
11217c478bd9Sstevel@tonic-gate     *deltatp = p.delta;
11227c478bd9Sstevel@tonic-gate     return 0;
11237c478bd9Sstevel@tonic-gate }
1124