1 /* original parser id follows */
2 /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
3 /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
8 #define YYCHECK "yyyymmdd"
11 #define yyclearin (yychar = YYEMPTY)
12 #define yyerrok (yyerrflag = 0)
13 #define YYRECOVERING() (yyerrflag != 0)
18 #define YYDEBUGSTR YYPREFIX "debug"
21 #define yyparse calc1_parse
25 #define yylex calc1_lex
29 #define yyerror calc1_error
33 #define yychar calc1_char
37 #define yyval calc1_val
41 #define yylval calc1_lval
45 #define yydebug calc1_debug
49 #define yynerrs calc1_nerrs
53 #define yyerrflag calc1_errflag
54 #endif /* yyerrflag */
57 #define yylhs calc1_lhs
61 #define yylen calc1_len
65 #define yydefred calc1_defred
69 #define yystos calc1_stos
73 #define yydgoto calc1_dgoto
77 #define yysindex calc1_sindex
81 #define yyrindex calc1_rindex
85 #define yygindex calc1_gindex
89 #define yytable calc1_table
93 #define yycheck calc1_check
97 #define yyname calc1_name
101 #define yyrule calc1_rule
107 #define yycindex calc1_cindex
108 #endif /* yycindex */
111 #define yyctable calc1_ctable
112 #endif /* yyctable */
114 #endif /* YYBTYACC */
116 #define YYPREFIX "calc1_"
122 /* http://dinosaur.compilertools.net/yacc/index.html */
129 typedef struct interval
135 INTERVAL vmul(double, double, INTERVAL);
136 INTERVAL vdiv(double, double, INTERVAL);
138 extern int yylex(void);
139 static void yyerror(const char *s);
141 int dcheck(INTERVAL);
148 #undef YYSTYPE_IS_DECLARED
149 #define YYSTYPE_IS_DECLARED 1
151 #ifndef YYSTYPE_IS_DECLARED
152 #define YYSTYPE_IS_DECLARED 1
159 #endif /* !YYSTYPE_IS_DECLARED */
160 #line 161 "calc1.tab.c"
162 /* compatibility with bison */
164 /* compatibility with FreeBSD */
165 # ifdef YYPARSE_PARAM_TYPE
166 # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
168 # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
171 # define YYPARSE_DECL() yyparse(void)
174 /* Parameters sent to lex. */
176 # define YYLEX_DECL() yylex(void *YYLEX_PARAM)
177 # define YYLEX yylex(YYLEX_PARAM)
179 # define YYLEX_DECL() yylex(void)
180 # define YYLEX yylex()
183 /* Parameters sent to yyerror. */
185 #define YYERROR_DECL() yyerror(const char *s)
188 #define YYERROR_CALL(msg) yyerror(msg)
191 extern int YYPARSE_DECL();
197 #define YYERRCODE 256
199 static const YYINT calc1_lhs[] = { -1,
200 3, 3, 0, 0, 0, 0, 0, 1, 1, 1,
201 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
202 2, 2, 2, 2, 2, 2, 2, 2,
204 static const YYINT calc1_len[] = { 2,
205 0, 2, 2, 2, 4, 4, 2, 1, 1, 3,
206 3, 3, 3, 2, 3, 1, 5, 1, 3, 3,
207 3, 3, 3, 3, 3, 3, 2, 3,
209 static const YYINT calc1_defred[] = { 0,
210 0, 0, 0, 8, 0, 0, 0, 0, 0, 7,
211 0, 0, 9, 18, 14, 27, 0, 0, 0, 0,
212 0, 0, 3, 0, 0, 0, 0, 4, 0, 0,
213 0, 0, 0, 15, 0, 28, 0, 0, 0, 0,
214 12, 24, 13, 26, 0, 0, 23, 25, 14, 0,
215 0, 0, 0, 0, 5, 6, 0, 0, 0, 12,
218 static const YYINT calc1_stos[] = { 0,
219 256, 257, 258, 259, 45, 40, 262, 263, 264, 10,
220 61, 61, 257, 258, 263, 264, 263, 264, 43, 45,
221 42, 47, 10, 43, 45, 42, 47, 10, 45, 40,
222 263, 263, 264, 41, 44, 41, 263, 264, 263, 264,
223 263, 264, 263, 264, 264, 264, 264, 264, 263, 263,
224 43, 45, 42, 47, 10, 10, 263, 263, 263, 263,
227 static const YYINT calc1_dgoto[] = { 7,
230 static const YYINT calc1_sindex[] = { -40,
231 -8, -48, -47, 0, -37, -37, 0, 2, 17, 0,
232 -34, -37, 0, 0, 0, 0, -25, 90, -37, -37,
233 -37, -37, 0, -37, -37, -37, -37, 0, -34, -34,
234 25, 125, 31, 0, -34, 0, -11, 37, -11, 37,
235 0, 0, 0, 0, 37, 37, 0, 0, 0, 111,
236 -34, -34, -34, -34, 0, 0, 118, 69, 69, 0,
239 static const YYINT calc1_rindex[] = { 0,
240 0, 38, 44, 0, 0, 0, 0, 0, 0, 0,
241 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
242 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
243 0, -9, 0, 0, 0, 0, 51, -3, 56, 61,
244 0, 0, 0, 0, 67, 72, 0, 0, 0, 0,
245 0, 0, 0, 0, 0, 0, 0, 78, 83, 0,
249 static const YYINT calc1_cindex[] = { 0,
250 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
251 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
252 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
253 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
254 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
255 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
259 static const YYINT calc1_gindex[] = { 0,
262 #define YYTABLESIZE 225
263 static const YYINT calc1_table[] = { 6,
264 16, 10, 6, 8, 5, 30, 20, 5, 15, 17,
265 29, 23, 11, 12, 31, 34, 21, 19, 35, 20,
266 0, 22, 37, 39, 41, 43, 28, 0, 0, 0,
267 21, 16, 49, 50, 55, 22, 0, 20, 57, 20,
268 56, 20, 0, 21, 19, 0, 20, 9, 22, 0,
269 0, 0, 0, 18, 58, 59, 60, 61, 26, 24,
270 10, 25, 0, 27, 0, 11, 53, 51, 0, 52,
271 22, 54, 26, 24, 0, 25, 19, 27, 26, 9,
272 9, 21, 9, 27, 9, 18, 18, 10, 18, 0,
273 18, 10, 11, 10, 10, 10, 11, 0, 11, 11,
274 11, 22, 0, 22, 0, 22, 0, 19, 0, 19,
275 53, 19, 21, 0, 21, 54, 21, 0, 10, 0,
276 10, 0, 10, 11, 0, 11, 0, 11, 16, 18,
277 36, 26, 24, 0, 25, 33, 27, 0, 0, 0,
278 0, 0, 38, 40, 42, 44, 0, 45, 46, 47,
279 48, 34, 53, 51, 0, 52, 0, 54, 62, 53,
280 51, 0, 52, 0, 54, 0, 21, 19, 0, 20,
281 0, 22, 0, 0, 0, 0, 0, 0, 0, 0,
282 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
283 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
284 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
285 0, 0, 0, 0, 0, 1, 2, 3, 4, 13,
288 static const YYINT calc1_check[] = { 40,
289 10, 10, 40, 0, 45, 40, 10, 45, 5, 6,
290 45, 10, 61, 61, 11, 41, 42, 43, 44, 45,
291 -1, 47, 19, 20, 21, 22, 10, -1, -1, -1,
292 42, 41, 29, 30, 10, 47, -1, 41, 35, 43,
293 10, 45, -1, 42, 43, -1, 45, 10, 47, -1,
294 -1, -1, -1, 10, 51, 52, 53, 54, 42, 43,
295 10, 45, -1, 47, -1, 10, 42, 43, -1, 45,
296 10, 47, 42, 43, -1, 45, 10, 47, 42, 42,
297 43, 10, 45, 47, 47, 42, 43, 10, 45, -1,
298 47, 41, 10, 43, 44, 45, 41, -1, 43, 44,
299 45, 41, -1, 43, -1, 45, -1, 41, -1, 43,
300 42, 45, 41, -1, 43, 47, 45, -1, 41, -1,
301 43, -1, 45, 41, -1, 43, -1, 45, 5, 6,
302 41, 42, 43, -1, 45, 12, 47, -1, -1, -1,
303 -1, -1, 19, 20, 21, 22, -1, 24, 25, 26,
304 27, 41, 42, 43, -1, 45, -1, 47, 41, 42,
305 43, -1, 45, -1, 47, -1, 42, 43, -1, 45,
306 -1, 47, -1, -1, -1, -1, -1, -1, -1, -1,
307 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
308 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
309 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
310 -1, -1, -1, -1, -1, 256, 257, 258, 259, 257,
311 258, 259, 257, -1, 259,
314 static const YYINT calc1_ctable[] = { -1,
315 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
316 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
317 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
318 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
319 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
320 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
321 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
322 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
323 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
324 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
325 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
326 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
327 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
328 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
329 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
330 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
331 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
332 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
333 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
334 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
335 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
336 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
344 #define YYMAXTOKEN 260
345 #define YYUNDFTOKEN 266
346 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
348 static const char *const calc1_name[] = {
350 "$end",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
351 0,0,0,0,0,0,"'('","')'","'*'","'+'","','","'-'",0,"'/'",0,0,0,0,0,0,0,0,0,0,0,0,
352 0,"'='",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
353 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
354 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
355 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
356 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
357 "error","DREG","VREG","CONST","UMINUS","$accept","line","dexp","vexp","lines",
360 static const char *const calc1_rule[] = {
363 "lines : lines line",
366 "line : DREG '=' dexp '\\n'",
367 "line : VREG '=' vexp '\\n'",
368 "line : error '\\n'",
371 "dexp : dexp '+' dexp",
372 "dexp : dexp '-' dexp",
373 "dexp : dexp '*' dexp",
374 "dexp : dexp '/' dexp",
376 "dexp : '(' dexp ')'",
378 "vexp : '(' dexp ',' dexp ')'",
380 "vexp : vexp '+' vexp",
381 "vexp : dexp '+' vexp",
382 "vexp : vexp '-' vexp",
383 "vexp : dexp '-' vexp",
384 "vexp : vexp '*' vexp",
385 "vexp : dexp '*' vexp",
386 "vexp : vexp '/' vexp",
387 "vexp : dexp '/' vexp",
389 "vexp : '(' vexp ')'",
401 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
402 YYLTYPE yyloc; /* position returned by actions */
403 YYLTYPE yylloc; /* position from the lexer */
406 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
407 #ifndef YYLLOC_DEFAULT
408 #define YYLLOC_DEFAULT(loc, rhs, n) \
413 (loc).first_line = ((rhs)[-1]).last_line; \
414 (loc).first_column = ((rhs)[-1]).last_column; \
415 (loc).last_line = ((rhs)[-1]).last_line; \
416 (loc).last_column = ((rhs)[-1]).last_column; \
420 (loc).first_line = ((rhs)[ 0 ]).first_line; \
421 (loc).first_column = ((rhs)[ 0 ]).first_column; \
422 (loc).last_line = ((rhs)[n-1]).last_line; \
423 (loc).last_column = ((rhs)[n-1]).last_column; \
426 #endif /* YYLLOC_DEFAULT */
427 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
430 #ifndef YYLVQUEUEGROWTH
431 #define YYLVQUEUEGROWTH 32
433 #endif /* YYBTYACC */
435 /* define the initial stack-sizes */
438 #define YYMAXDEPTH YYSTACKSIZE
441 #define YYSTACKSIZE YYMAXDEPTH
443 #define YYSTACKSIZE 10000
444 #define YYMAXDEPTH 10000
448 #ifndef YYINITSTACKSIZE
449 #define YYINITSTACKSIZE 200
459 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
466 struct YYParseState_s
468 struct YYParseState_s *save; /* Previously saved parser state */
469 YYSTACKDATA yystack; /* saved parser stack */
470 int state; /* saved parser state */
471 int errflag; /* saved error recovery status */
472 int lexeme; /* saved index of the conflict lexeme in the lexical queue */
473 YYINT ctry; /* saved index in yyctable[] for this conflict */
475 typedef struct YYParseState_s YYParseState;
476 #endif /* YYBTYACC */
477 /* variables for the parser stack */
478 static YYSTACKDATA yystack;
481 /* Current parser state */
482 static YYParseState *yyps = 0;
484 /* yypath != NULL: do the full parse, starting at *yypath parser state. */
485 static YYParseState *yypath = 0;
487 /* Base of the lexical value queue */
488 static YYSTYPE *yylvals = 0;
490 /* Current position at lexical value queue */
491 static YYSTYPE *yylvp = 0;
493 /* End position of lexical value queue */
494 static YYSTYPE *yylve = 0;
496 /* The last allocated position at the lexical value queue */
497 static YYSTYPE *yylvlim = 0;
499 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
500 /* Base of the lexical position queue */
501 static YYLTYPE *yylpsns = 0;
503 /* Current position at lexical position queue */
504 static YYLTYPE *yylpp = 0;
506 /* End position of lexical position queue */
507 static YYLTYPE *yylpe = 0;
509 /* The last allocated position at the lexical position queue */
510 static YYLTYPE *yylplim = 0;
513 /* Current position at lexical token queue */
514 static short *yylexp = 0;
516 static short *yylexemes = 0;
517 #endif /* YYBTYACC */
519 /* beginning of subroutines section */
521 #define BSZ 50 /* buffer size for floating point numbers */
523 /* lexical analysis */
526 yyerror(const char *s)
528 fprintf(stderr, "%s\n", s);
536 while ((c = getchar()) == ' ')
537 { /* skip over blanks */
542 yylval.ival = c - 'A';
547 yylval.ival = c - 'a';
551 if (isdigit(c) || c == '.')
553 /* gobble up digits, points, exponents */
554 char buf[BSZ + 1], *cp = buf;
555 int dot = 0, expr = 0;
557 for (; (cp - buf) < BSZ; ++cp, c = getchar())
566 return ('.'); /* will cause syntax error */
573 return ('e'); /* will cause syntax error */
582 if ((cp - buf) >= BSZ)
583 printf("constant too long: truncated\n");
585 ungetc(c, stdin); /* push back last char read */
586 yylval.dval = atof(buf);
593 hilo(double a, double b, double c, double d)
595 /* returns the smallest interval containing a, b, c, and d */
596 /* used by *, / routines */
628 vmul(double a, double b, INTERVAL v)
630 return (hilo(a * v.hi, a * v.lo, b * v.hi, b * v.lo));
636 if (v.hi >= 0. && v.lo <= 0.)
638 printf("divisor interval contains 0.\n");
645 vdiv(double a, double b, INTERVAL v)
647 return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo));
649 #line 650 "calc1.tab.c"
651 /* For use in generated program */
652 #define yydepth (int)(yystack.s_mark - yystack.s_base)
654 #define yytrial (yyps->save)
655 #endif /* YYBTYACC */
658 #include <stdio.h> /* needed for printf */
661 #include <stdlib.h> /* needed for malloc, etc */
662 #include <string.h> /* needed for memset */
664 /* allocate initial stack or double stack size, up to YYMAXDEPTH */
665 static int yygrowstack(YYSTACKDATA *data)
671 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
675 if ((newsize = data->stacksize) == 0)
676 newsize = YYINITSTACKSIZE;
677 else if (newsize >= YYMAXDEPTH)
679 else if ((newsize *= 2) > YYMAXDEPTH)
680 newsize = YYMAXDEPTH;
682 i = (int) (data->s_mark - data->s_base);
683 newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
687 data->s_base = newss;
688 data->s_mark = newss + i;
690 newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
694 data->l_base = newvs;
695 data->l_mark = newvs + i;
697 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
698 newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps));
702 data->p_base = newps;
703 data->p_mark = newps + i;
706 data->stacksize = newsize;
707 data->s_last = data->s_base + newsize - 1;
711 fprintf(stderr, "%sdebug: stack size increased to %d\n", YYPREFIX, newsize);
716 #if YYPURE || defined(YY_NO_LEAKS)
717 static void yyfreestack(YYSTACKDATA *data)
721 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
724 memset(data, 0, sizeof(*data));
727 #define yyfreestack(data) /* nothing */
728 #endif /* YYPURE || defined(YY_NO_LEAKS) */
731 static YYParseState *
732 yyNewState(unsigned size)
734 YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState));
735 if (p == NULL) return NULL;
737 p->yystack.stacksize = size;
740 p->yystack.s_base = NULL;
741 p->yystack.l_base = NULL;
742 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
743 p->yystack.p_base = NULL;
747 p->yystack.s_base = (short *) malloc(size * sizeof(short));
748 if (p->yystack.s_base == NULL) return NULL;
749 p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
750 if (p->yystack.l_base == NULL) return NULL;
751 memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE));
752 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
753 p->yystack.p_base = (YYLTYPE *) malloc(size * sizeof(YYLTYPE));
754 if (p->yystack.p_base == NULL) return NULL;
755 memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE));
762 yyFreeState(YYParseState *p)
764 yyfreestack(&p->yystack);
767 #endif /* YYBTYACC */
769 #define YYABORT goto yyabort
770 #define YYREJECT goto yyabort
771 #define YYACCEPT goto yyaccept
772 #define YYERROR goto yyerrlab
774 #define YYVALID do { if (yyps->save) goto yyvalid; } while(0)
775 #define YYVALID_NESTED do { if (yyps->save && \
776 yyps->save->save == 0) goto yyvalid; } while(0)
777 #endif /* YYBTYACC */
782 int yym, yyn, yystate, yyresult;
785 YYParseState *yyerrctx = NULL;
786 #endif /* YYBTYACC */
787 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
788 YYLTYPE yyerror_loc_range[2]; /* position of error start & end */
793 if ((yys = getenv("YYDEBUG")) != 0)
796 if (yyn >= '0' && yyn <= '9')
800 fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX);
804 yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
806 #endif /* YYBTYACC */
813 memset(&yystack, 0, sizeof(yystack));
816 if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
817 yystack.s_mark = yystack.s_base;
818 yystack.l_mark = yystack.l_base;
819 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
820 yystack.p_mark = yystack.p_base;
826 if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
833 /* we're currently re-reading tokens */
835 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
843 /* in trial mode; save scanner results for future parse attempts */
844 if (yylvp == yylvlim)
845 { /* Enlarge lexical value queue */
846 size_t p = (size_t) (yylvp - yylvals);
847 size_t s = (size_t) (yylvlim - yylvals);
849 s += YYLVQUEUEGROWTH;
850 if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem;
851 if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;
852 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
853 if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;
855 yylvp = yylve = yylvals + p;
856 yylvlim = yylvals + s;
857 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
858 yylpp = yylpe = yylpsns + p;
859 yylplim = yylpsns + s;
861 yylexp = yylexemes + p;
863 *yylexp = (short) YYLEX;
866 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
873 /* normal operation, no conflict encountered */
874 #endif /* YYBTYACC */
878 #endif /* YYBTYACC */
879 if (yychar < 0) yychar = YYEOF;
880 /* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
884 yys = yyname[YYTRANSLATE(yychar)];
885 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
886 YYDEBUGSTR, yydepth, yystate, yychar, yys);
887 #ifdef YYSTYPE_TOSTRING
890 #endif /* YYBTYACC */
891 fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval));
899 /* Do we have a conflict? */
900 if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
901 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
910 fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n",
911 YYDEBUGSTR, yydepth, yystate);
913 /* Switch to the next conflict context */
918 if (save->state != yystate) YYABORT;
925 /* Unresolved conflict - start/continue trial parse */
930 fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate);
932 fputs("ALREADY in conflict, continuing trial parse.\n", stderr);
934 fputs("Starting trial parse.\n", stderr);
937 save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
938 if (save == NULL) goto yyenomem;
939 save->save = yyps->save;
940 save->state = yystate;
941 save->errflag = yyerrflag;
942 save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
943 memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
944 save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
945 memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
946 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
947 save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base);
948 memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
951 if (yyctable[ctry] == -1)
954 if (yydebug && yychar >= YYEOF)
955 fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth);
960 if (yyps->save == NULL)
962 /* If this is a first conflict in the stack, start saving lexemes */
965 yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short));
966 if (yylexemes == NULL) goto yyenomem;
967 yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE));
968 if (yylvals == NULL) goto yyenomem;
969 yylvlim = yylvals + YYLVQUEUEGROWTH;
970 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
971 yylpsns = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE));
972 if (yylpsns == NULL) goto yyenomem;
973 yylplim = yylpsns + YYLVQUEUEGROWTH;
978 yylvp = yylve = yylvals;
979 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
980 yylpp = yylpe = yylpsns;
986 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
989 *yylexp = (short) yychar;
997 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1003 save->lexeme = (int) (yylvp - yylvals);
1006 if (yytable[yyn] == ctry)
1010 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
1011 YYDEBUGSTR, yydepth, yystate, yyctable[ctry]);
1016 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1021 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
1023 yystate = yyctable[ctry];
1024 *++yystack.s_mark = (short) yystate;
1025 *++yystack.l_mark = yylval;
1026 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1027 *++yystack.p_mark = yylloc;
1030 if (yyerrflag > 0) --yyerrflag;
1035 yyn = yyctable[ctry];
1038 } /* End of code dealing with conflicts */
1039 #endif /* YYBTYACC */
1040 if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1041 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1045 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
1046 YYDEBUGSTR, yydepth, yystate, yytable[yyn]);
1048 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1049 yystate = yytable[yyn];
1050 *++yystack.s_mark = yytable[yyn];
1051 *++yystack.l_mark = yylval;
1052 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1053 *++yystack.p_mark = yylloc;
1056 if (yyerrflag > 0) --yyerrflag;
1059 if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1060 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1065 if (yyerrflag != 0) goto yyinrecovery;
1078 YYParseState *save = yyps->save;
1081 fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n",
1082 YYDEBUGSTR, yydepth, yystate, yyps->save->state,
1083 (int)(yylvp - yylvals - yyps->save->lexeme));
1085 /* Memorize most forward-looking error state in case it's really an error. */
1086 if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals)
1088 /* Free old saved error context state */
1089 if (yyerrctx) yyFreeState(yyerrctx);
1090 /* Create and fill out new saved error context state */
1091 yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
1092 if (yyerrctx == NULL) goto yyenomem;
1093 yyerrctx->save = yyps->save;
1094 yyerrctx->state = yystate;
1095 yyerrctx->errflag = yyerrflag;
1096 yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
1097 memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
1098 yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
1099 memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1100 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1101 yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base);
1102 memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1104 yyerrctx->lexeme = (int) (yylvp - yylvals);
1106 yylvp = yylvals + save->lexeme;
1107 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1108 yylpp = yylpsns + save->lexeme;
1110 yylexp = yylexemes + save->lexeme;
1112 yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
1113 memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
1114 yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
1115 memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1116 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1117 yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base);
1118 memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1120 ctry = ++save->ctry;
1121 yystate = save->state;
1122 /* We tried shift, try reduce now */
1123 if ((yyn = yyctable[ctry]) >= 0) goto yyreduce;
1124 yyps->save = save->save;
1128 /* Nothing left on the stack -- error */
1133 fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n",
1136 /* Restore state as it was in the most forward-advanced error */
1137 yylvp = yylvals + yyerrctx->lexeme;
1138 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1139 yylpp = yylpsns + yyerrctx->lexeme;
1141 yylexp = yylexemes + yyerrctx->lexeme;
1142 yychar = yylexp[-1];
1144 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1147 yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
1148 memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
1149 yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
1150 memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1151 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1152 yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base);
1153 memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1155 yystate = yyerrctx->state;
1156 yyFreeState(yyerrctx);
1161 if (yynewerrflag == 0) goto yyinrecovery;
1162 #endif /* YYBTYACC */
1164 YYERROR_CALL("syntax error");
1165 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1166 yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */
1181 if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
1182 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
1186 fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n",
1187 YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]);
1189 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1190 yystate = yytable[yyn];
1191 *++yystack.s_mark = yytable[yyn];
1192 *++yystack.l_mark = yylval;
1193 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1194 /* lookahead position is error end position */
1195 yyerror_loc_range[1] = yylloc;
1196 YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */
1197 *++yystack.p_mark = yyloc;
1205 fprintf(stderr, "%s[%d]: error recovery discarding state %d\n",
1206 YYDEBUGSTR, yydepth, *yystack.s_mark);
1208 if (yystack.s_mark <= yystack.s_base) goto yyabort;
1209 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1210 /* the current TOS position is the error start position */
1211 yyerror_loc_range[0] = *yystack.p_mark;
1213 #if defined(YYDESTRUCT_CALL)
1216 #endif /* YYBTYACC */
1217 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1218 YYDESTRUCT_CALL("error: discarding state",
1219 yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark);
1221 YYDESTRUCT_CALL("error: discarding state",
1222 yystos[*yystack.s_mark], yystack.l_mark);
1223 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1224 #endif /* defined(YYDESTRUCT_CALL) */
1227 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1235 if (yychar == YYEOF) goto yyabort;
1239 yys = yyname[YYTRANSLATE(yychar)];
1240 fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
1241 YYDEBUGSTR, yydepth, yystate, yychar, yys);
1244 #if defined(YYDESTRUCT_CALL)
1247 #endif /* YYBTYACC */
1248 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1249 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc);
1251 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval);
1252 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1253 #endif /* defined(YYDESTRUCT_CALL) */
1263 fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)",
1264 YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]);
1265 #ifdef YYSTYPE_TOSTRING
1268 #endif /* YYBTYACC */
1273 for (i = yym; i > 0; i--)
1275 if (i != yym) fputs(", ", stderr);
1276 fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]],
1277 yystack.l_mark[1-i]), stderr);
1282 fputc('\n', stderr);
1286 yyval = yystack.l_mark[1-yym];
1288 memset(&yyval, 0, sizeof yyval);
1289 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1291 /* Perform position reduction */
1292 memset(&yyloc, 0, sizeof(yyloc));
1295 #endif /* YYBTYACC */
1297 YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym);
1298 /* just in case YYERROR is invoked within the action, save
1299 the start of the rhs as the error start position */
1300 yyerror_loc_range[0] = yystack.p_mark[1-yym];
1309 (void) printf("%15.8f\n", yystack.l_mark[-1].dval);
1315 (void) printf("(%15.8f, %15.8f)\n", yystack.l_mark[-1].vval.lo, yystack.l_mark[-1].vval.hi);
1321 dreg[yystack.l_mark[-3].ival] = yystack.l_mark[-1].dval;
1327 vreg[yystack.l_mark[-3].ival] = yystack.l_mark[-1].vval;
1339 yyval.dval = dreg[yystack.l_mark[0].ival];
1345 yyval.dval = yystack.l_mark[-2].dval + yystack.l_mark[0].dval;
1351 yyval.dval = yystack.l_mark[-2].dval - yystack.l_mark[0].dval;
1357 yyval.dval = yystack.l_mark[-2].dval * yystack.l_mark[0].dval;
1363 yyval.dval = yystack.l_mark[-2].dval / yystack.l_mark[0].dval;
1369 yyval.dval = -yystack.l_mark[0].dval;
1375 yyval.dval = yystack.l_mark[-1].dval;
1381 yyval.vval.hi = yyval.vval.lo = yystack.l_mark[0].dval;
1387 yyval.vval.lo = yystack.l_mark[-3].dval;
1388 yyval.vval.hi = yystack.l_mark[-1].dval;
1389 if ( yyval.vval.lo > yyval.vval.hi )
1391 (void) printf("interval out of order\n");
1399 yyval.vval = vreg[yystack.l_mark[0].ival];
1405 yyval.vval.hi = yystack.l_mark[-2].vval.hi + yystack.l_mark[0].vval.hi;
1406 yyval.vval.lo = yystack.l_mark[-2].vval.lo + yystack.l_mark[0].vval.lo;
1412 yyval.vval.hi = yystack.l_mark[-2].dval + yystack.l_mark[0].vval.hi;
1413 yyval.vval.lo = yystack.l_mark[-2].dval + yystack.l_mark[0].vval.lo;
1419 yyval.vval.hi = yystack.l_mark[-2].vval.hi - yystack.l_mark[0].vval.lo;
1420 yyval.vval.lo = yystack.l_mark[-2].vval.lo - yystack.l_mark[0].vval.hi;
1426 yyval.vval.hi = yystack.l_mark[-2].dval - yystack.l_mark[0].vval.lo;
1427 yyval.vval.lo = yystack.l_mark[-2].dval - yystack.l_mark[0].vval.hi;
1433 yyval.vval = vmul( yystack.l_mark[-2].vval.lo, yystack.l_mark[-2].vval.hi, yystack.l_mark[0].vval );
1439 yyval.vval = vmul (yystack.l_mark[-2].dval, yystack.l_mark[-2].dval, yystack.l_mark[0].vval );
1445 if (dcheck(yystack.l_mark[0].vval)) YYERROR;
1446 yyval.vval = vdiv ( yystack.l_mark[-2].vval.lo, yystack.l_mark[-2].vval.hi, yystack.l_mark[0].vval );
1452 if (dcheck ( yystack.l_mark[0].vval )) YYERROR;
1453 yyval.vval = vdiv (yystack.l_mark[-2].dval, yystack.l_mark[-2].dval, yystack.l_mark[0].vval );
1459 yyval.vval.hi = -yystack.l_mark[0].vval.lo;
1460 yyval.vval.lo = -yystack.l_mark[0].vval.hi;
1466 yyval.vval = yystack.l_mark[-1].vval;
1469 #line 1470 "calc1.tab.c"
1473 yystack.s_mark -= yym;
1474 yystate = *yystack.s_mark;
1475 yystack.l_mark -= yym;
1476 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1477 yystack.p_mark -= yym;
1480 if (yystate == 0 && yym == 0)
1485 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
1486 #ifdef YYSTYPE_TOSTRING
1489 #endif /* YYBTYACC */
1490 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval));
1492 fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL);
1496 *++yystack.s_mark = YYFINAL;
1497 *++yystack.l_mark = yyval;
1498 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1499 *++yystack.p_mark = yyloc;
1507 /* we're currently re-reading tokens */
1509 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1517 /* in trial mode; save scanner results for future parse attempts */
1518 if (yylvp == yylvlim)
1519 { /* Enlarge lexical value queue */
1520 size_t p = (size_t) (yylvp - yylvals);
1521 size_t s = (size_t) (yylvlim - yylvals);
1523 s += YYLVQUEUEGROWTH;
1524 if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL)
1526 if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)
1528 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1529 if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)
1532 yylvp = yylve = yylvals + p;
1533 yylvlim = yylvals + s;
1534 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1535 yylpp = yylpe = yylpsns + p;
1536 yylplim = yylpsns + s;
1538 yylexp = yylexemes + p;
1540 *yylexp = (short) YYLEX;
1543 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1550 /* normal operation, no conflict encountered */
1551 #endif /* YYBTYACC */
1555 #endif /* YYBTYACC */
1556 if (yychar < 0) yychar = YYEOF;
1557 /* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
1561 yys = yyname[YYTRANSLATE(yychar)];
1562 fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
1563 YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
1567 if (yychar == YYEOF) goto yyaccept;
1570 if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
1571 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
1572 yystate = yytable[yyn];
1574 yystate = yydgoto[yym];
1578 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
1579 #ifdef YYSTYPE_TOSTRING
1582 #endif /* YYBTYACC */
1583 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval));
1585 fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate);
1588 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1589 *++yystack.s_mark = (short) yystate;
1590 *++yystack.l_mark = yyval;
1591 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1592 *++yystack.p_mark = yyloc;
1597 /* Reduction declares that this path is valid. Set yypath and do a full parse */
1599 if (yypath) YYABORT;
1602 YYParseState *save = yyps->save;
1603 yyps->save = save->save;
1604 save->save = yypath;
1609 fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n",
1610 YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme));
1614 yyFreeState(yyerrctx);
1617 yylvp = yylvals + yypath->lexeme;
1618 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1619 yylpp = yylpsns + yypath->lexeme;
1621 yylexp = yylexemes + yypath->lexeme;
1623 yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
1624 memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
1625 yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
1626 memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1627 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1628 yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base);
1629 memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1631 yystate = yypath->state;
1633 #endif /* YYBTYACC */
1636 YYERROR_CALL("yacc stack overflow");
1640 YYERROR_CALL("memory exhausted");
1642 #endif /* YYBTYACC */
1652 if (yyps->save) goto yyvalid;
1653 #endif /* YYBTYACC */
1657 #if defined(YYDESTRUCT_CALL)
1658 if (yychar != YYEOF && yychar != YYEMPTY)
1659 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1660 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc);
1662 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval);
1663 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1667 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1670 for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp)
1671 YYDESTRUCT_CALL("cleanup: discarding state",
1672 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp);
1674 for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv)
1675 YYDESTRUCT_CALL("cleanup: discarding state",
1676 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv);
1677 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1679 #endif /* defined(YYDESTRUCT_CALL) */
1684 yyFreeState(yyerrctx);
1689 YYParseState *save = yyps;
1696 YYParseState *save = yypath;
1697 yypath = save->save;
1701 #endif /* YYBTYACC */
1702 yyfreestack(&yystack);