1 #pragma ident "%Z%%M% %I% %E% SMI"
3 /* A Bison parser, made from ./x-deltat.y
4 by GNU Bison version 1.28 */
6 #define YYBISON 1 /* Identify Bison output. */
13 #line 38 "./x-deltat.y"
25 #define YYPARSE_PARAM tmv
27 #define MAX_TIME KRB5_INT32_MAX
28 #define MIN_TIME KRB5_INT32_MIN
30 #define DAY (24 * 3600)
33 #define MAX_DAY (MAX_TIME / DAY)
34 #define MIN_DAY (MIN_TIME / DAY)
35 #define MAX_HOUR (MAX_TIME / HOUR)
36 #define MIN_HOUR (MIN_TIME / HOUR)
37 #define MAX_MIN (MAX_TIME / 60)
38 #define MIN_MIN (MIN_TIME / 60)
40 /* An explanation of the tests being performed.
41 We do not want to overflow a 32 bit integer with out manipulations,
42 even for testing for overflow. Therefore we rely on the following:
44 The lex parser will not return a number > MAX_TIME (which is out 32
47 Therefore, seconds (s) will require
48 MIN_TIME < s < MAX_TIME
50 For subsequent tests, the logic is as follows:
52 If A < MAX_TIME and B < MAX_TIME
54 If we want to test if A+B < MAX_TIME, there are two cases
56 then A + B < MAX_TIME if B < MAX_TIME - A
57 else A + B < MAX_TIME always.
59 if we want to test if MIN_TIME < A + B
60 if A > 0 - then nothing to test
61 otherwise, we test if MIN_TIME - A < B.
63 We of course are testing for:
64 MIN_TIME < A + B < MAX_TIME
68 #define DAY_NOT_OK(d) (d) > MAX_DAY || (d) < MIN_DAY
69 #define HOUR_NOT_OK(h) (h) > MAX_HOUR || (h) < MIN_HOUR
70 #define MIN_NOT_OK(m) (m) > MAX_MIN || (m) < MIN_MIN
71 #define SUM_OK(a, b) (((a) > 0) ? ( (b) <= MAX_TIME - (a)) : (MIN_TIME - (a) <= (b)))
72 #define DO_SUM(res, a, b) if (!SUM_OK((a), (b))) YYERROR; \
76 #define OUT_D ((struct param *)tmv)->delta
79 /* Overflow testing - this does not handle negative values well.. */ \
80 if (DAY_NOT_OK(D) || HOUR_NOT_OK(H) || MIN_NOT_OK(M)) YYERROR; \
82 DO_SUM(OUT_D, OUT_D, H * HOUR); \
83 DO_SUM(OUT_D, OUT_D, M * 60); \
84 DO_SUM(OUT_D, OUT_D, S); \
87 static int mylex (int *, char **);
88 #define YYLEX_PARAM (&((struct param *)tmv)->p)
90 #define yylex(U, P) mylex (&(U)->val, (P))
95 static int yyparse (void *);
98 #line 125 "./x-deltat.y"
99 typedef union { int val
; } YYSTYPE
;
111 #define YYFLAG -32768
114 #define YYTRANSLATE(x) ((unsigned)(x) <= 260 ? yytranslate[x] : 22)
116 static const char yytranslate
[] = { 0,
117 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
118 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
119 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
120 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
121 2, 2, 2, 2, 6, 2, 2, 2, 2, 2,
122 2, 2, 2, 2, 2, 2, 2, 7, 2, 2,
123 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
124 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
125 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
126 2, 2, 2, 2, 2, 2, 2, 2, 2, 8,
127 2, 2, 2, 9, 2, 2, 2, 2, 10, 2,
128 2, 2, 2, 2, 11, 2, 2, 2, 2, 2,
129 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
130 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
131 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
132 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
133 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
134 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
135 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
136 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
137 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
138 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
139 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
140 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
141 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
142 2, 2, 2, 2, 2, 1, 3, 4, 5, 12
146 static const short yyprhs
[] = { 0,
147 0, 2, 4, 6, 8, 11, 12, 14, 17, 20,
148 24, 28, 32, 35, 43, 49, 53, 55, 57, 61,
152 static const short yyrhs
[] = { 18,
153 0, 3, 0, 4, 0, 14, 0, 6, 14, 0,
154 0, 12, 0, 16, 15, 0, 16, 5, 0, 17,
155 8, 19, 0, 17, 9, 20, 0, 17, 10, 21,
156 0, 17, 11, 0, 17, 6, 3, 7, 3, 7,
157 3, 0, 17, 7, 3, 7, 3, 0, 17, 7,
158 3, 0, 17, 0, 20, 0, 17, 9, 20, 0,
159 21, 0, 17, 10, 21, 0, 16, 0, 17, 11,
166 static const short yyrline
[] = { 0,
167 136, 137, 137, 138, 138, 139, 139, 140, 141, 142,
168 144, 145, 146, 147, 148, 149, 150, 153, 155, 157,
174 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
176 static const char * const yytname
[] = { "$","error","$undefined.","NUM","LONGNUM",
177 "OVERFLOW","'-'","':'","'d'","'h'","'m'","'s'","WS","start","posnum","num","ws",
178 "wsnum","deltat","opt_hms","opt_ms","opt_s", NULL
182 static const short yyr1
[] = { 0,
183 13, 14, 14, 15, 15, 16, 16, 17, 17, 18,
184 18, 18, 18, 18, 18, 18, 18, 19, 19, 20,
188 static const short yyr2
[] = { 0,
189 1, 1, 1, 1, 2, 0, 1, 2, 2, 3,
190 3, 3, 2, 7, 5, 3, 1, 1, 3, 1,
194 static const short yydefact
[] = { 6,
195 7, 0, 17, 1, 2, 3, 9, 0, 4, 8,
196 0, 0, 6, 6, 6, 13, 5, 0, 16, 22,
197 0, 10, 18, 20, 0, 11, 0, 12, 0, 0,
198 6, 6, 23, 0, 15, 19, 21, 0, 14, 0,
202 static const short yydefgoto
[] = { 40,
203 9, 10, 20, 25, 4, 22, 23, 24
206 static const short yypact
[] = { -10,
207 -32768, 18, -2,-32768,-32768,-32768,-32768, 13,-32768,-32768,
208 11, 16, -10, -10, -10,-32768,-32768, 20, 21, 18,
209 1,-32768,-32768,-32768, 15,-32768, 19,-32768, 26, 28,
210 -10, -10,-32768, 27,-32768,-32768,-32768, 30,-32768, 35,
214 static const short yypgoto
[] = {-32768,
215 29,-32768, 38, 0,-32768,-32768, -13, -12
222 static const short yytable
[] = { 3,
223 26, 1, 28, 11, 12, 13, 14, 15, 16, 31,
224 32, 33, 21, 18, 27, 5, 6, 36, 19, 37,
225 5, 6, 7, 8, 32, 33, 29, 30, 34, 33,
226 35, 27, 39, 38, 41, 42, 17, 2
229 static const short yycheck
[] = { 0,
230 14, 12, 15, 6, 7, 8, 9, 10, 11, 9,
231 10, 11, 13, 3, 15, 3, 4, 31, 3, 32,
232 3, 4, 5, 6, 10, 11, 7, 7, 3, 11,
233 3, 32, 3, 7, 0, 0, 8, 0
237 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
238 #line 3 "/usr/share/bison.simple"
239 /* This file comes from bison-1.28. */
241 /* Skeleton output parser for bison,
242 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
244 This program is free software; you can redistribute it and/or modify
245 it under the terms of the GNU General Public License as published by
246 the Free Software Foundation; either version 2, or (at your option)
249 This program is distributed in the hope that it will be useful,
250 but WITHOUT ANY WARRANTY; without even the implied warranty of
251 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
252 GNU General Public License for more details.
254 You should have received a copy of the GNU General Public License
255 along with this program; if not, write to the Free Software
256 Foundation, Inc., 59 Temple Place - Suite 330,
257 Boston, MA 02111-1307, USA. */
259 /* As a special exception, when this file is copied by Bison into a
260 Bison output file, you may use that output file without restriction.
261 This special exception was added by the Free Software Foundation
262 in version 1.24 of Bison. */
264 /* This is the parser code that is written into each bison parser
265 when the %semantic_parser declaration is not specified in the grammar.
266 It was written by Richard Stallman by simplifying the hairy parser
267 used when %semantic_parser is specified. */
269 #ifndef YYSTACK_USE_ALLOCA
271 #define YYSTACK_USE_ALLOCA
272 #else /* alloca not defined */
274 #define YYSTACK_USE_ALLOCA
275 #define alloca __builtin_alloca
276 #else /* not GNU C. */
277 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
278 #define YYSTACK_USE_ALLOCA
280 #else /* not sparc */
281 /* We think this test detects Watcom and Microsoft C. */
282 /* This used to test MSDOS, but that is a bad idea
283 since that symbol is in the user namespace. */
284 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
285 #if 0 /* No need for malloc.h, which pollutes the namespace;
286 instead, just don't use alloca. */
289 #else /* not MSDOS, or __TURBOC__ */
291 /* I don't know what this was needed for, but it pollutes the namespace.
292 So I turned it off. rms, 2 May 1997. */
293 /* #include <malloc.h> */
295 #define YYSTACK_USE_ALLOCA
296 #else /* not MSDOS, or __TURBOC__, or _AIX */
298 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
299 and on HPUX 10. Eventually we can turn this on. */
300 #define YYSTACK_USE_ALLOCA
301 #define alloca __builtin_alloca
304 #endif /* not _AIX */
305 #endif /* not MSDOS, or __TURBOC__ */
306 #endif /* not sparc */
307 #endif /* not GNU C */
308 #endif /* alloca not defined */
309 #endif /* YYSTACK_USE_ALLOCA not defined */
311 #ifdef YYSTACK_USE_ALLOCA
312 #define YYSTACK_ALLOC alloca
314 #define YYSTACK_ALLOC malloc
317 /* Note: there must be only one dollar sign in this file.
318 It is replaced by the list of actions, each action
319 as one case of the switch. */
321 #define yyerrok (yyerrstatus = 0)
322 #define yyclearin (yychar = YYEMPTY)
325 #define YYACCEPT goto yyacceptlab
326 #define YYABORT goto yyabortlab
327 #define YYERROR goto yyerrlab1
328 /* Like YYERROR except do call yyerror.
329 This remains here temporarily to ease the
330 transition to the new meaning of YYERROR, for GCC.
331 Once GCC version 2 has supplanted version 1, this can go. */
332 #define YYFAIL goto yyerrlab
333 #define YYRECOVERING() (!!yyerrstatus)
334 #define YYBACKUP(token, value) \
336 if (yychar == YYEMPTY && yylen == 1) \
337 { yychar = (token), yylval = (value); \
338 yychar1 = YYTRANSLATE (yychar); \
343 { yyerror ("syntax error: cannot back up"); YYERROR; } \
347 #define YYERRCODE 256
350 #define YYLEX yylex()
356 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
358 #define YYLEX yylex(&yylval, &yylloc)
360 #else /* not YYLSP_NEEDED */
362 #define YYLEX yylex(&yylval, YYLEX_PARAM)
364 #define YYLEX yylex(&yylval)
366 #endif /* not YYLSP_NEEDED */
369 /* If nonreentrant, generate the variables here */
373 int yychar
; /* the lookahead symbol */
374 YYSTYPE yylval
; /* the semantic value of the */
375 /* lookahead symbol */
378 YYLTYPE yylloc
; /* location data for the lookahead */
382 int yynerrs
; /* number of parse errors so far */
383 #endif /* not YYPURE */
386 int yydebug
; /* nonzero means print parse trace */
387 /* Since this is uninitialized, it does not stop multiple parsers
391 /* YYINITDEPTH indicates the initial size of the parser's stacks */
394 #define YYINITDEPTH 200
397 /* YYMAXDEPTH is the maximum size the stacks can grow to
398 (effective only if the built-in stack extension method is used). */
405 #define YYMAXDEPTH 10000
408 /* Define __yy_memcpy. Note that the size argument
409 should be passed with type unsigned int, because that is what the non-GCC
410 definitions require. With GCC, __builtin_memcpy takes an arg
411 of type size_t, but it can handle unsigned int. */
413 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
414 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
415 #else /* not GNU C or C++ */
418 /* This is the most reliable way to avoid incompatibilities
419 in available built-in functions on various systems. */
421 __yy_memcpy (to
, from
, count
)
426 register char *f
= from
;
427 register char *t
= to
;
428 register int i
= count
;
434 #else /* __cplusplus */
436 /* This is the most reliable way to avoid incompatibilities
437 in available built-in functions on various systems. */
439 __yy_memcpy (char *to
, char *from
, unsigned int count
)
441 register char *t
= to
;
442 register char *f
= from
;
443 register int i
= count
;
452 #line 217 "/usr/share/bison.simple"
454 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
455 into yyparse. The argument should have type void *.
456 It should actually point to an object.
457 Grammar actions can access the variable by casting it
458 to the proper pointer type. */
462 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
463 #define YYPARSE_PARAM_DECL
464 #else /* not __cplusplus */
465 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
466 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
467 #endif /* not __cplusplus */
468 #else /* not YYPARSE_PARAM */
469 #define YYPARSE_PARAM_ARG
470 #define YYPARSE_PARAM_DECL
471 #endif /* not YYPARSE_PARAM */
473 /* Prevent warning if -Wstrict-prototypes. */
476 int yyparse (void *);
483 yyparse(YYPARSE_PARAM_ARG
)
486 register int yystate
;
488 register short *yyssp
;
489 register YYSTYPE
*yyvsp
;
490 int yyerrstatus
; /* number of tokens to shift before error messages enabled */
491 int yychar1
= 0; /* lookahead token as an internal (translated) token number */
493 short yyssa
[YYINITDEPTH
]; /* the state stack */
494 YYSTYPE yyvsa
[YYINITDEPTH
]; /* the semantic value stack */
496 short *yyss
= yyssa
; /* refer to the stacks thru separate pointers */
497 YYSTYPE
*yyvs
= yyvsa
; /* to allow yyoverflow to reallocate them elsewhere */
500 YYLTYPE yylsa
[YYINITDEPTH
]; /* the location stack */
501 YYLTYPE
*yyls
= yylsa
;
504 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
506 #define YYPOPSTACK (yyvsp--, yyssp--)
509 int yystacksize
= YYINITDEPTH
;
510 int yyfree_stacks
= 0;
521 YYSTYPE yyval
; /* the variable used to return */
522 /* semantic values from the action */
529 fprintf(stderr
, "Starting parse\n");
535 yychar
= YYEMPTY
; /* Cause a token to be read. */
537 /* Initialize stack pointers.
538 Waste one element of value and location stack
539 so that they stay on the same level as the state stack.
540 The wasted elements are never initialized. */
548 /* Push a new state, which is found in yystate . */
549 /* In all cases, when you get here, the value and location stacks
550 have just been pushed. so pushing a state here evens the stacks. */
555 if (yyssp
>= yyss
+ yystacksize
- 1)
557 /* Give user a chance to reallocate the stack */
558 /* Use copies of these so that the &'s don't force the real ones into memory. */
559 YYSTYPE
*yyvs1
= yyvs
;
562 YYLTYPE
*yyls1
= yyls
;
565 /* Get the current used size of the three stacks, in elements. */
566 int size
= yyssp
- yyss
+ 1;
569 /* Each stack pointer address is followed by the size of
570 the data in use in that stack, in bytes. */
572 /* This used to be a conditional around just the two extra args,
573 but that might be undefined if yyoverflow is a macro. */
574 yyoverflow("parser stack overflow",
575 &yyss1
, size
* sizeof (*yyssp
),
576 &yyvs1
, size
* sizeof (*yyvsp
),
577 &yyls1
, size
* sizeof (*yylsp
),
580 yyoverflow("parser stack overflow",
581 &yyss1
, size
* sizeof (*yyssp
),
582 &yyvs1
, size
* sizeof (*yyvsp
),
586 yyss
= yyss1
; yyvs
= yyvs1
;
590 #else /* no yyoverflow */
591 /* Extend the stack our own way. */
592 if (yystacksize
>= YYMAXDEPTH
)
594 yyerror("parser stack overflow");
606 if (yystacksize
> YYMAXDEPTH
)
607 yystacksize
= YYMAXDEPTH
;
608 #ifndef YYSTACK_USE_ALLOCA
611 yyss
= (short *) YYSTACK_ALLOC (yystacksize
* sizeof (*yyssp
));
612 __yy_memcpy ((char *)yyss
, (char *)yyss1
,
613 size
* (unsigned int) sizeof (*yyssp
));
614 yyvs
= (YYSTYPE
*) YYSTACK_ALLOC (yystacksize
* sizeof (*yyvsp
));
615 __yy_memcpy ((char *)yyvs
, (char *)yyvs1
,
616 size
* (unsigned int) sizeof (*yyvsp
));
618 yyls
= (YYLTYPE
*) YYSTACK_ALLOC (yystacksize
* sizeof (*yylsp
));
619 __yy_memcpy ((char *)yyls
, (char *)yyls1
,
620 size
* (unsigned int) sizeof (*yylsp
));
622 #endif /* no yyoverflow */
624 yyssp
= yyss
+ size
- 1;
625 yyvsp
= yyvs
+ size
- 1;
627 yylsp
= yyls
+ size
- 1;
632 fprintf(stderr
, "Stack size increased to %d\n", yystacksize
);
635 if (yyssp
>= yyss
+ yystacksize
- 1)
641 fprintf(stderr
, "Entering state %d\n", yystate
);
647 /* Do appropriate processing given the current state. */
648 /* Read a lookahead token if we need one and don't already have one. */
651 /* First try to decide what to do without reference to lookahead token. */
653 yyn
= yypact
[yystate
];
657 /* Not known => get a lookahead token if don't already have one. */
659 /* yychar is either YYEMPTY or YYEOF
660 or a valid token in external form. */
662 if (yychar
== YYEMPTY
)
666 fprintf(stderr
, "Reading a token: ");
671 /* Convert token to internal form (in yychar1) for indexing tables with */
673 if (yychar
<= 0) /* This means end of input. */
676 yychar
= YYEOF
; /* Don't call YYLEX any more */
680 fprintf(stderr
, "Now at end of input.\n");
685 yychar1
= YYTRANSLATE(yychar
);
690 fprintf (stderr
, "Next token is %d (%s", yychar
, yytname
[yychar1
]);
691 /* Give the individual parser a way to print the precise meaning
692 of a token, for further debugging info. */
694 YYPRINT (stderr
, yychar
, yylval
);
696 fprintf (stderr
, ")\n");
702 if (yyn
< 0 || yyn
> YYLAST
|| yycheck
[yyn
] != yychar1
)
707 /* yyn is what to do for this token type in this state.
708 Negative => reduce, -yyn is rule number.
709 Positive => shift, yyn is new state.
710 New state is final state => don't bother to shift,
712 0, or most negative number => error. */
727 /* Shift the lookahead token. */
731 fprintf(stderr
, "Shifting token %d (%s), ", yychar
, yytname
[yychar1
]);
734 /* Discard the token being shifted unless it is eof. */
743 /* count tokens shifted since error; after three, turn off error status. */
744 if (yyerrstatus
) yyerrstatus
--;
749 /* Do the default action for the current state. */
752 yyn
= yydefact
[yystate
];
756 /* Do a reduction. yyn is the number of a rule to reduce with. */
760 yyval
= yyvsp
[1-yylen
]; /* implement default value of the action */
767 fprintf (stderr
, "Reducing via rule %d (line %d), ",
770 /* Print the symbols being reduced, and their result. */
771 for (i
= yyprhs
[yyn
]; yyrhs
[i
] > 0; i
++)
772 fprintf (stderr
, "%s ", yytname
[yyrhs
[i
]]);
773 fprintf (stderr
, " -> %s\n", yytname
[yyr1
[yyn
]]);
781 #line 138 "./x-deltat.y"
782 { yyval
.val
= - yyvsp
[0].val
; ;
785 #line 140 "./x-deltat.y"
786 { yyval
.val
= yyvsp
[0].val
; ;
789 #line 141 "./x-deltat.y"
793 #line 143 "./x-deltat.y"
794 { DO (yyvsp
[-2].val
, 0, 0, yyvsp
[0].val
); ;
797 #line 144 "./x-deltat.y"
798 { DO ( 0, yyvsp
[-2].val
, 0, yyvsp
[0].val
); ;
801 #line 145 "./x-deltat.y"
802 { DO ( 0, 0, yyvsp
[-2].val
, yyvsp
[0].val
); ;
805 #line 146 "./x-deltat.y"
806 { DO ( 0, 0, 0, yyvsp
[-1].val
); ;
809 #line 147 "./x-deltat.y"
810 { DO (yyvsp
[-6].val
, yyvsp
[-4].val
, yyvsp
[-2].val
, yyvsp
[0].val
); ;
813 #line 148 "./x-deltat.y"
814 { DO ( 0, yyvsp
[-4].val
, yyvsp
[-2].val
, yyvsp
[0].val
); ;
817 #line 149 "./x-deltat.y"
818 { DO ( 0, yyvsp
[-2].val
, yyvsp
[0].val
, 0); ;
821 #line 150 "./x-deltat.y"
822 { DO ( 0, 0, 0, yyvsp
[0].val
); ;
825 #line 155 "./x-deltat.y"
826 { if (HOUR_NOT_OK(yyvsp
[-2].val
)) YYERROR
;
827 DO_SUM(yyval
.val
, yyvsp
[-2].val
* 3600, yyvsp
[0].val
); ;
830 #line 159 "./x-deltat.y"
831 { if (MIN_NOT_OK(yyvsp
[-2].val
)) YYERROR
;
832 DO_SUM(yyval
.val
, yyvsp
[-2].val
* 60, yyvsp
[0].val
); ;
835 #line 162 "./x-deltat.y"
839 /* the action file gets copied in in place of this dollarsign */
840 #line 543 "/usr/share/bison.simple"
851 short *ssp1
= yyss
- 1;
852 fprintf (stderr
, "state stack now");
853 while (ssp1
!= yyssp
)
854 fprintf (stderr
, " %d", *++ssp1
);
855 fprintf (stderr
, "\n");
865 yylsp
->first_line
= yylloc
.first_line
;
866 yylsp
->first_column
= yylloc
.first_column
;
867 yylsp
->last_line
= (yylsp
-1)->last_line
;
868 yylsp
->last_column
= (yylsp
-1)->last_column
;
873 yylsp
->last_line
= (yylsp
+yylen
-1)->last_line
;
874 yylsp
->last_column
= (yylsp
+yylen
-1)->last_column
;
878 /* Now "shift" the result of the reduction.
879 Determine what state that goes to,
880 based on the state we popped back to
881 and the rule number reduced by. */
885 yystate
= yypgoto
[yyn
- YYNTBASE
] + *yyssp
;
886 if (yystate
>= 0 && yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
887 yystate
= yytable
[yystate
];
889 yystate
= yydefgoto
[yyn
- YYNTBASE
];
893 yyerrlab
: /* here on detecting error */
896 /* If not already recovering from an error, report this error. */
900 #ifdef YYERROR_VERBOSE
901 yyn
= yypact
[yystate
];
903 if (yyn
> YYFLAG
&& yyn
< YYLAST
)
910 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
911 for (x
= (yyn
< 0 ? -yyn
: 0);
912 x
< (sizeof(yytname
) / sizeof(char *)); x
++)
913 if (yycheck
[x
+ yyn
] == x
)
914 size
+= strlen(yytname
[x
]) + 15, count
++;
915 msg
= (char *) malloc(size
+ 15);
918 strcpy(msg
, "parse error");
923 for (x
= (yyn
< 0 ? -yyn
: 0);
924 x
< (sizeof(yytname
) / sizeof(char *)); x
++)
925 if (yycheck
[x
+ yyn
] == x
)
927 strcat(msg
, count
== 0 ? ", expecting `" : " or `");
928 strcat(msg
, yytname
[x
]);
937 yyerror ("parse error; also virtual memory exceeded");
940 #endif /* YYERROR_VERBOSE */
941 yyerror("parse error");
945 yyerrlab1
: /* here on error raised explicitly by an action */
947 if (yyerrstatus
== 3)
949 /* if just tried and failed to reuse lookahead token after an error, discard it. */
951 /* return failure if at end of input */
957 fprintf(stderr
, "Discarding token %d (%s).\n", yychar
, yytname
[yychar1
]);
963 /* Else will try to reuse lookahead token
964 after shifting the error token. */
966 yyerrstatus
= 3; /* Each real token shifted decrements this */
970 yyerrdefault
: /* current state does not do anything special for the error token. */
973 /* This is wrong; only states that explicitly want error tokens
974 should shift them. */
975 yyn
= yydefact
[yystate
]; /* If its default is to accept any token, ok. Otherwise pop it.*/
976 if (yyn
) goto yydefault
;
979 yyerrpop
: /* pop the current state because it cannot handle the error token */
981 if (yyssp
== yyss
) YYABORT
;
991 short *ssp1
= yyss
- 1;
992 fprintf (stderr
, "Error: state stack now");
993 while (ssp1
!= yyssp
)
994 fprintf (stderr
, " %d", *++ssp1
);
995 fprintf (stderr
, "\n");
1001 yyn
= yypact
[yystate
];
1006 if (yyn
< 0 || yyn
> YYLAST
|| yycheck
[yyn
] != YYTERROR
)
1025 fprintf(stderr
, "Shifting error token, ");
1037 /* YYACCEPT comes here. */
1049 /* YYABORT comes here. */
1060 #line 165 "./x-deltat.y"
1064 mylex (krb5_int32
*intp
, char **pp
)
1092 /* XXX assumes ASCII */
1094 while (isdigit ((int) *P
)) {
1095 if (num
> MAX_TIME
/ 10)
1098 if (num
> MAX_TIME
- (*P
- '0'))
1103 return (P
- orig_p
> 2) ? LONGNUM
: NUM
;
1107 while (isspace ((int) *P
))
1115 krb5_error_code KRB5_CALLCONV
1116 krb5_string_to_deltat(char *string
, krb5_deltat
*deltatp
)
1122 return KRB5_DELTAT_BADFORMAT
;