1 /* original parser id follows */
2 /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
3 /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
8 #define YYCHECK "yyyymmdd"
11 #define yyclearin (yychar = YYEMPTY)
12 #define yyerrok (yyerrflag = 0)
13 #define YYRECOVERING() (yyerrflag != 0)
16 #ident "check variant syntax features"
19 #define YYDEBUGSTR YYPREFIX "debug"
22 #define yyparse varsyntax_calc1_parse
26 #define yylex varsyntax_calc1_lex
30 #define yyerror varsyntax_calc1_error
34 #define yychar varsyntax_calc1_char
38 #define yyval varsyntax_calc1_val
42 #define yylval varsyntax_calc1_lval
46 #define yydebug varsyntax_calc1_debug
50 #define yynerrs varsyntax_calc1_nerrs
54 #define yyerrflag varsyntax_calc1_errflag
55 #endif /* yyerrflag */
58 #define yylhs varsyntax_calc1_lhs
62 #define yylen varsyntax_calc1_len
66 #define yydefred varsyntax_calc1_defred
70 #define yystos varsyntax_calc1_stos
74 #define yydgoto varsyntax_calc1_dgoto
78 #define yysindex varsyntax_calc1_sindex
82 #define yyrindex varsyntax_calc1_rindex
86 #define yygindex varsyntax_calc1_gindex
90 #define yytable varsyntax_calc1_table
94 #define yycheck varsyntax_calc1_check
98 #define yyname varsyntax_calc1_name
102 #define yyrule varsyntax_calc1_rule
108 #define yycindex varsyntax_calc1_cindex
109 #endif /* yycindex */
112 #define yyctable varsyntax_calc1_ctable
113 #endif /* yyctable */
115 #endif /* YYBTYACC */
117 #define YYPREFIX "varsyntax_calc1_"
121 #line 3 "varsyntax_calc1.y"
123 /* http://dinosaur.compilertools.net/yacc/index.html * /*/
130 typedef struct interval
136 INTERVAL vmul(double, double, INTERVAL);
137 INTERVAL vdiv(double, double, INTERVAL);
139 extern int yylex(void);
140 static void yyerror(const char *s);
142 int dcheck(INTERVAL);
147 #line 32 "varsyntax_calc1.y"
149 #undef YYSTYPE_IS_DECLARED
150 #define YYSTYPE_IS_DECLARED 1
152 #ifndef YYSTYPE_IS_DECLARED
153 #define YYSTYPE_IS_DECLARED 1
156 int ival; /* dreg & vreg array index values*/
157 double dval; /* floating point values*/
158 INTERVAL vval; /* interval values*/
160 #endif /* !YYSTYPE_IS_DECLARED */
161 #line 162 "varsyntax_calc1.tab.c"
163 /* compatibility with bison */
165 /* compatibility with FreeBSD */
166 # ifdef YYPARSE_PARAM_TYPE
167 # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
169 # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
172 # define YYPARSE_DECL() yyparse(void)
175 /* Parameters sent to lex. */
177 # define YYLEX_DECL() yylex(void *YYLEX_PARAM)
178 # define YYLEX yylex(YYLEX_PARAM)
180 # define YYLEX_DECL() yylex(void)
181 # define YYLEX yylex()
184 /* Parameters sent to yyerror. */
186 #define YYERROR_DECL() yyerror(const char *s)
189 #define YYERROR_CALL(msg) yyerror(msg)
192 extern int YYPARSE_DECL();
198 #define YYERRCODE 256
200 static const YYINT varsyntax_calc1_lhs[] = { -1,
201 3, 3, 0, 0, 0, 0, 0, 1, 1, 1,
202 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
203 2, 2, 2, 2, 2, 2, 2, 2,
205 static const YYINT varsyntax_calc1_len[] = { 2,
206 0, 2, 2, 2, 4, 4, 2, 1, 1, 3,
207 3, 3, 3, 2, 3, 1, 5, 1, 3, 3,
208 3, 3, 3, 3, 3, 3, 2, 3,
210 static const YYINT varsyntax_calc1_defred[] = { 0,
211 0, 0, 0, 8, 0, 0, 0, 0, 0, 7,
212 0, 0, 9, 18, 14, 27, 0, 0, 0, 0,
213 0, 0, 3, 0, 0, 0, 0, 4, 0, 0,
214 0, 0, 0, 15, 0, 28, 0, 0, 0, 0,
215 12, 24, 13, 26, 0, 0, 23, 25, 14, 0,
216 0, 0, 0, 0, 5, 6, 0, 0, 0, 12,
219 static const YYINT varsyntax_calc1_stos[] = { 0,
220 256, 257, 258, 259, 45, 40, 262, 263, 264, 10,
221 61, 61, 257, 258, 263, 264, 263, 264, 43, 45,
222 42, 47, 10, 43, 45, 42, 47, 10, 45, 40,
223 263, 263, 264, 41, 44, 41, 263, 264, 263, 264,
224 263, 264, 263, 264, 264, 264, 264, 264, 263, 263,
225 43, 45, 42, 47, 10, 10, 263, 263, 263, 263,
228 static const YYINT varsyntax_calc1_dgoto[] = { 7,
231 static const YYINT varsyntax_calc1_sindex[] = { -40,
232 -8, -48, -47, 0, -37, -37, 0, 2, 17, 0,
233 -34, -37, 0, 0, 0, 0, -25, 90, -37, -37,
234 -37, -37, 0, -37, -37, -37, -37, 0, -34, -34,
235 25, 125, 31, 0, -34, 0, -11, 37, -11, 37,
236 0, 0, 0, 0, 37, 37, 0, 0, 0, 111,
237 -34, -34, -34, -34, 0, 0, 118, 69, 69, 0,
240 static const YYINT varsyntax_calc1_rindex[] = { 0,
241 0, 38, 44, 0, 0, 0, 0, 0, 0, 0,
242 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
243 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
244 0, -9, 0, 0, 0, 0, 51, -3, 56, 61,
245 0, 0, 0, 0, 67, 72, 0, 0, 0, 0,
246 0, 0, 0, 0, 0, 0, 0, 78, 83, 0,
250 static const YYINT varsyntax_calc1_cindex[] = { 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,
256 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
260 static const YYINT varsyntax_calc1_gindex[] = { 0,
263 #define YYTABLESIZE 225
264 static const YYINT varsyntax_calc1_table[] = { 6,
265 16, 10, 6, 8, 5, 30, 20, 5, 15, 17,
266 29, 23, 11, 12, 31, 34, 21, 19, 35, 20,
267 0, 22, 37, 39, 41, 43, 28, 0, 0, 0,
268 21, 16, 49, 50, 55, 22, 0, 20, 57, 20,
269 56, 20, 0, 21, 19, 0, 20, 9, 22, 0,
270 0, 0, 0, 18, 58, 59, 60, 61, 26, 24,
271 10, 25, 0, 27, 0, 11, 53, 51, 0, 52,
272 22, 54, 26, 24, 0, 25, 19, 27, 26, 9,
273 9, 21, 9, 27, 9, 18, 18, 10, 18, 0,
274 18, 10, 11, 10, 10, 10, 11, 0, 11, 11,
275 11, 22, 0, 22, 0, 22, 0, 19, 0, 19,
276 53, 19, 21, 0, 21, 54, 21, 0, 10, 0,
277 10, 0, 10, 11, 0, 11, 0, 11, 16, 18,
278 36, 26, 24, 0, 25, 33, 27, 0, 0, 0,
279 0, 0, 38, 40, 42, 44, 0, 45, 46, 47,
280 48, 34, 53, 51, 0, 52, 0, 54, 62, 53,
281 51, 0, 52, 0, 54, 0, 21, 19, 0, 20,
282 0, 22, 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, 0, 0, 0, 0, 0,
286 0, 0, 0, 0, 0, 1, 2, 3, 4, 13,
289 static const YYINT varsyntax_calc1_check[] = { 40,
290 10, 10, 40, 0, 45, 40, 10, 45, 5, 6,
291 45, 10, 61, 61, 11, 41, 42, 43, 44, 45,
292 -1, 47, 19, 20, 21, 22, 10, -1, -1, -1,
293 42, 41, 29, 30, 10, 47, -1, 41, 35, 43,
294 10, 45, -1, 42, 43, -1, 45, 10, 47, -1,
295 -1, -1, -1, 10, 51, 52, 53, 54, 42, 43,
296 10, 45, -1, 47, -1, 10, 42, 43, -1, 45,
297 10, 47, 42, 43, -1, 45, 10, 47, 42, 42,
298 43, 10, 45, 47, 47, 42, 43, 10, 45, -1,
299 47, 41, 10, 43, 44, 45, 41, -1, 43, 44,
300 45, 41, -1, 43, -1, 45, -1, 41, -1, 43,
301 42, 45, 41, -1, 43, 47, 45, -1, 41, -1,
302 43, -1, 45, 41, -1, 43, -1, 45, 5, 6,
303 41, 42, 43, -1, 45, 12, 47, -1, -1, -1,
304 -1, -1, 19, 20, 21, 22, -1, 24, 25, 26,
305 27, 41, 42, 43, -1, 45, -1, 47, 41, 42,
306 43, -1, 45, -1, 47, -1, 42, 43, -1, 45,
307 -1, 47, -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, -1, -1, -1, -1, -1,
311 -1, -1, -1, -1, -1, 256, 257, 258, 259, 257,
312 258, 259, 257, -1, 259,
318 #define YYMAXTOKEN 260
319 #define YYUNDFTOKEN 266
320 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
322 static const char *const varsyntax_calc1_name[] = {
324 "$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,
325 0,0,0,0,0,0,"'('","')'","'*'","'+'","','","'-'",0,"'/'",0,0,0,0,0,0,0,0,0,0,0,0,
326 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,
327 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,
328 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,
329 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,
330 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,
331 "error","DREG","VREG","CONST","UMINUS","$accept","line","dexp","vexp","lines",
334 static const char *const varsyntax_calc1_rule[] = {
337 "lines : lines line",
340 "line : DREG '=' dexp '\\n'",
341 "line : VREG '=' vexp '\\n'",
342 "line : error '\\n'",
345 "dexp : dexp '+' dexp",
346 "dexp : dexp '-' dexp",
347 "dexp : dexp '*' dexp",
348 "dexp : dexp '/' dexp",
350 "dexp : '(' dexp ')'",
352 "vexp : '(' dexp ',' dexp ')'",
354 "vexp : vexp '+' vexp",
355 "vexp : dexp '+' vexp",
356 "vexp : vexp '-' vexp",
357 "vexp : dexp '-' vexp",
358 "vexp : vexp '*' vexp",
359 "vexp : dexp '*' vexp",
360 "vexp : vexp '/' vexp",
361 "vexp : dexp '/' vexp",
363 "vexp : '(' vexp ')'",
375 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
376 YYLTYPE yyloc; /* position returned by actions */
377 YYLTYPE yylloc; /* position from the lexer */
380 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
381 #ifndef YYLLOC_DEFAULT
382 #define YYLLOC_DEFAULT(loc, rhs, n) \
387 (loc).first_line = ((rhs)[-1]).last_line; \
388 (loc).first_column = ((rhs)[-1]).last_column; \
389 (loc).last_line = ((rhs)[-1]).last_line; \
390 (loc).last_column = ((rhs)[-1]).last_column; \
394 (loc).first_line = ((rhs)[ 0 ]).first_line; \
395 (loc).first_column = ((rhs)[ 0 ]).first_column; \
396 (loc).last_line = ((rhs)[n-1]).last_line; \
397 (loc).last_column = ((rhs)[n-1]).last_column; \
400 #endif /* YYLLOC_DEFAULT */
401 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
404 #ifndef YYLVQUEUEGROWTH
405 #define YYLVQUEUEGROWTH 32
407 #endif /* YYBTYACC */
409 /* define the initial stack-sizes */
412 #define YYMAXDEPTH YYSTACKSIZE
415 #define YYSTACKSIZE YYMAXDEPTH
417 #define YYSTACKSIZE 10000
418 #define YYMAXDEPTH 10000
422 #ifndef YYINITSTACKSIZE
423 #define YYINITSTACKSIZE 200
433 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
440 struct YYParseState_s
442 struct YYParseState_s *save; /* Previously saved parser state */
443 YYSTACKDATA yystack; /* saved parser stack */
444 int state; /* saved parser state */
445 int errflag; /* saved error recovery status */
446 int lexeme; /* saved index of the conflict lexeme in the lexical queue */
447 YYINT ctry; /* saved index in yyctable[] for this conflict */
449 typedef struct YYParseState_s YYParseState;
450 #endif /* YYBTYACC */
451 /* variables for the parser stack */
452 static YYSTACKDATA yystack;
455 /* Current parser state */
456 static YYParseState *yyps = 0;
458 /* yypath != NULL: do the full parse, starting at *yypath parser state. */
459 static YYParseState *yypath = 0;
461 /* Base of the lexical value queue */
462 static YYSTYPE *yylvals = 0;
464 /* Current position at lexical value queue */
465 static YYSTYPE *yylvp = 0;
467 /* End position of lexical value queue */
468 static YYSTYPE *yylve = 0;
470 /* The last allocated position at the lexical value queue */
471 static YYSTYPE *yylvlim = 0;
473 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
474 /* Base of the lexical position queue */
475 static YYLTYPE *yylpsns = 0;
477 /* Current position at lexical position queue */
478 static YYLTYPE *yylpp = 0;
480 /* End position of lexical position queue */
481 static YYLTYPE *yylpe = 0;
483 /* The last allocated position at the lexical position queue */
484 static YYLTYPE *yylplim = 0;
487 /* Current position at lexical token queue */
488 static short *yylexp = 0;
490 static short *yylexemes = 0;
491 #endif /* YYBTYACC */
492 #line 178 "varsyntax_calc1.y"
493 /* beginning of subroutines section */
495 #define BSZ 50 /* buffer size for floating point numbers */
497 /* lexical analysis */
500 yyerror(const char *s)
502 fprintf(stderr, "%s\n", s);
510 while ((c = getchar()) == ' ')
511 { /* skip over blanks */
516 yylval.ival = c - 'A';
521 yylval.ival = c - 'a';
525 if (isdigit(c) || c == '.')
527 /* gobble up digits, points, exponents */
528 char buf[BSZ + 1], *cp = buf;
529 int dot = 0, expr = 0;
531 for (; (cp - buf) < BSZ; ++cp, c = getchar())
540 return ('.'); /* will cause syntax error */
547 return ('e'); /* will cause syntax error */
556 if ((cp - buf) >= BSZ)
557 printf("constant too long: truncated\n");
559 ungetc(c, stdin); /* push back last char read */
560 yylval.dval = atof(buf);
567 hilo(double a, double b, double c, double d)
569 /* returns the smallest interval containing a, b, c, and d */
570 /* used by *, / routines */
602 vmul(double a, double b, INTERVAL v)
604 return (hilo(a * v.hi, a * v.lo, b * v.hi, b * v.lo));
610 if (v.hi >= 0. && v.lo <= 0.)
612 printf("divisor interval contains 0.\n");
619 vdiv(double a, double b, INTERVAL v)
621 return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo));
623 #line 624 "varsyntax_calc1.tab.c"
625 /* For use in generated program */
626 #define yydepth (int)(yystack.s_mark - yystack.s_base)
628 #define yytrial (yyps->save)
629 #endif /* YYBTYACC */
632 #include <stdio.h> /* needed for printf */
635 #include <stdlib.h> /* needed for malloc, etc */
636 #include <string.h> /* needed for memset */
638 /* allocate initial stack or double stack size, up to YYMAXDEPTH */
639 static int yygrowstack(YYSTACKDATA *data)
645 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
649 if ((newsize = data->stacksize) == 0)
650 newsize = YYINITSTACKSIZE;
651 else if (newsize >= YYMAXDEPTH)
653 else if ((newsize *= 2) > YYMAXDEPTH)
654 newsize = YYMAXDEPTH;
656 i = (int) (data->s_mark - data->s_base);
657 newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
661 data->s_base = newss;
662 data->s_mark = newss + i;
664 newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
668 data->l_base = newvs;
669 data->l_mark = newvs + i;
671 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
672 newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps));
676 data->p_base = newps;
677 data->p_mark = newps + i;
680 data->stacksize = newsize;
681 data->s_last = data->s_base + newsize - 1;
685 fprintf(stderr, "%sdebug: stack size increased to %d\n", YYPREFIX, newsize);
690 #if YYPURE || defined(YY_NO_LEAKS)
691 static void yyfreestack(YYSTACKDATA *data)
695 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
698 memset(data, 0, sizeof(*data));
701 #define yyfreestack(data) /* nothing */
702 #endif /* YYPURE || defined(YY_NO_LEAKS) */
705 static YYParseState *
706 yyNewState(unsigned size)
708 YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState));
709 if (p == NULL) return NULL;
711 p->yystack.stacksize = size;
714 p->yystack.s_base = NULL;
715 p->yystack.l_base = NULL;
716 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
717 p->yystack.p_base = NULL;
721 p->yystack.s_base = (short *) malloc(size * sizeof(short));
722 if (p->yystack.s_base == NULL) return NULL;
723 p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
724 if (p->yystack.l_base == NULL) return NULL;
725 memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE));
726 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
727 p->yystack.p_base = (YYLTYPE *) malloc(size * sizeof(YYLTYPE));
728 if (p->yystack.p_base == NULL) return NULL;
729 memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE));
736 yyFreeState(YYParseState *p)
738 yyfreestack(&p->yystack);
741 #endif /* YYBTYACC */
743 #define YYABORT goto yyabort
744 #define YYREJECT goto yyabort
745 #define YYACCEPT goto yyaccept
746 #define YYERROR goto yyerrlab
748 #define YYVALID do { if (yyps->save) goto yyvalid; } while(0)
749 #define YYVALID_NESTED do { if (yyps->save && \
750 yyps->save->save == 0) goto yyvalid; } while(0)
751 #endif /* YYBTYACC */
756 int yym, yyn, yystate, yyresult;
759 YYParseState *yyerrctx = NULL;
760 #endif /* YYBTYACC */
761 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
762 YYLTYPE yyerror_loc_range[2]; /* position of error start & end */
767 if ((yys = getenv("YYDEBUG")) != 0)
770 if (yyn >= '0' && yyn <= '9')
774 fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX);
778 yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
780 #endif /* YYBTYACC */
787 memset(&yystack, 0, sizeof(yystack));
790 if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
791 yystack.s_mark = yystack.s_base;
792 yystack.l_mark = yystack.l_base;
793 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
794 yystack.p_mark = yystack.p_base;
800 if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
807 /* we're currently re-reading tokens */
809 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
817 /* in trial mode; save scanner results for future parse attempts */
818 if (yylvp == yylvlim)
819 { /* Enlarge lexical value queue */
820 int p = yylvp - yylvals;
821 int s = yylvlim - yylvals;
823 s += YYLVQUEUEGROWTH;
824 if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem;
825 if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;
826 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
827 if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;
829 yylvp = yylve = yylvals + p;
830 yylvlim = yylvals + s;
831 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
832 yylpp = yylpe = yylpsns + p;
833 yylplim = yylpsns + s;
835 yylexp = yylexemes + p;
837 *yylexp = (short) YYLEX;
840 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
847 /* normal operation, no conflict encountered */
848 #endif /* YYBTYACC */
852 #endif /* YYBTYACC */
853 if (yychar < 0) yychar = YYEOF;
854 /* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
858 yys = yyname[YYTRANSLATE(yychar)];
859 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
860 YYDEBUGSTR, yydepth, yystate, yychar, yys);
861 #ifdef YYSTYPE_TOSTRING
864 #endif /* YYBTYACC */
865 fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval));
873 /* Do we have a conflict? */
874 if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
875 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
884 fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n",
885 YYDEBUGSTR, yydepth, yystate);
887 /* Switch to the next conflict context */
892 if (save->state != yystate) YYABORT;
899 /* Unresolved conflict - start/continue trial parse */
904 fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate);
906 fputs("ALREADY in conflict, continuing trial parse.\n", stderr);
908 fputs("Starting trial parse.\n", stderr);
911 save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
912 if (save == NULL) goto yyenomem;
913 save->save = yyps->save;
914 save->state = yystate;
915 save->errflag = yyerrflag;
916 save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
917 memcpy (save->yystack.s_base, yystack.s_base, (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
918 save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
919 memcpy (save->yystack.l_base, yystack.l_base, (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
920 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
921 save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base);
922 memcpy (save->yystack.p_base, yystack.p_base, (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
925 if (yyctable[ctry] == -1)
928 if (yydebug && yychar >= YYEOF)
929 fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth);
934 if (yyps->save == NULL)
936 /* If this is a first conflict in the stack, start saving lexemes */
939 yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short));
940 if (yylexemes == NULL) goto yyenomem;
941 yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE));
942 if (yylvals == NULL) goto yyenomem;
943 yylvlim = yylvals + YYLVQUEUEGROWTH;
944 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
945 yylpsns = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE));
946 if (yylpsns == NULL) goto yyenomem;
947 yylplim = yylpsns + YYLVQUEUEGROWTH;
952 yylvp = yylve = yylvals;
953 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
954 yylpp = yylpe = yylpsns;
960 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
963 *yylexp = (short) yychar;
971 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
977 save->lexeme = yylvp - yylvals;
980 if (yytable[yyn] == ctry)
984 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
985 YYDEBUGSTR, yydepth, yystate, yyctable[ctry]);
990 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
995 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
997 yystate = yyctable[ctry];
998 *++yystack.s_mark = (short) yystate;
999 *++yystack.l_mark = yylval;
1000 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1001 *++yystack.p_mark = yylloc;
1004 if (yyerrflag > 0) --yyerrflag;
1009 yyn = yyctable[ctry];
1012 } /* End of code dealing with conflicts */
1013 #endif /* YYBTYACC */
1014 if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1015 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1019 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
1020 YYDEBUGSTR, yydepth, yystate, yytable[yyn]);
1022 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1023 yystate = yytable[yyn];
1024 *++yystack.s_mark = yytable[yyn];
1025 *++yystack.l_mark = yylval;
1026 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1027 *++yystack.p_mark = yylloc;
1030 if (yyerrflag > 0) --yyerrflag;
1033 if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1034 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1039 if (yyerrflag != 0) goto yyinrecovery;
1052 YYParseState *save = yyps->save;
1055 fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n",
1056 YYDEBUGSTR, yydepth, yystate, yyps->save->state,
1057 (int)(yylvp - yylvals - yyps->save->lexeme));
1059 /* Memorize most forward-looking error state in case it's really an error. */
1060 if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals)
1062 /* Free old saved error context state */
1063 if (yyerrctx) yyFreeState(yyerrctx);
1064 /* Create and fill out new saved error context state */
1065 yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
1066 if (yyerrctx == NULL) goto yyenomem;
1067 yyerrctx->save = yyps->save;
1068 yyerrctx->state = yystate;
1069 yyerrctx->errflag = yyerrflag;
1070 yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
1071 memcpy (yyerrctx->yystack.s_base, yystack.s_base, (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
1072 yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
1073 memcpy (yyerrctx->yystack.l_base, yystack.l_base, (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1074 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1075 yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base);
1076 memcpy (yyerrctx->yystack.p_base, yystack.p_base, (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1078 yyerrctx->lexeme = yylvp - yylvals;
1080 yylvp = yylvals + save->lexeme;
1081 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1082 yylpp = yylpsns + save->lexeme;
1084 yylexp = yylexemes + save->lexeme;
1086 yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
1087 memcpy (yystack.s_base, save->yystack.s_base, (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
1088 yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
1089 memcpy (yystack.l_base, save->yystack.l_base, (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1090 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1091 yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base);
1092 memcpy (yystack.p_base, save->yystack.p_base, (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1094 ctry = ++save->ctry;
1095 yystate = save->state;
1096 /* We tried shift, try reduce now */
1097 if ((yyn = yyctable[ctry]) >= 0) goto yyreduce;
1098 yyps->save = save->save;
1102 /* Nothing left on the stack -- error */
1107 fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n",
1110 /* Restore state as it was in the most forward-advanced error */
1111 yylvp = yylvals + yyerrctx->lexeme;
1112 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1113 yylpp = yylpsns + yyerrctx->lexeme;
1115 yylexp = yylexemes + yyerrctx->lexeme;
1116 yychar = yylexp[-1];
1118 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1121 yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
1122 memcpy (yystack.s_base, yyerrctx->yystack.s_base, (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
1123 yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
1124 memcpy (yystack.l_base, yyerrctx->yystack.l_base, (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1125 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1126 yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base);
1127 memcpy (yystack.p_base, yyerrctx->yystack.p_base, (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1129 yystate = yyerrctx->state;
1130 yyFreeState(yyerrctx);
1135 if (yynewerrflag == 0) goto yyinrecovery;
1136 #endif /* YYBTYACC */
1138 YYERROR_CALL("syntax error");
1139 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1140 yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */
1155 if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
1156 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
1160 fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n",
1161 YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]);
1163 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1164 yystate = yytable[yyn];
1165 *++yystack.s_mark = yytable[yyn];
1166 *++yystack.l_mark = yylval;
1167 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1168 /* lookahead position is error end position */
1169 yyerror_loc_range[1] = yylloc;
1170 YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */
1171 *++yystack.p_mark = yyloc;
1179 fprintf(stderr, "%s[%d]: error recovery discarding state %d\n",
1180 YYDEBUGSTR, yydepth, *yystack.s_mark);
1182 if (yystack.s_mark <= yystack.s_base) goto yyabort;
1183 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1184 /* the current TOS position is the error start position */
1185 yyerror_loc_range[0] = *yystack.p_mark;
1187 #if defined(YYDESTRUCT_CALL)
1190 #endif /* YYBTYACC */
1191 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1192 YYDESTRUCT_CALL("error: discarding state",
1193 yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark);
1195 YYDESTRUCT_CALL("error: discarding state",
1196 yystos[*yystack.s_mark], yystack.l_mark);
1197 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1198 #endif /* defined(YYDESTRUCT_CALL) */
1201 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1209 if (yychar == YYEOF) goto yyabort;
1213 yys = yyname[YYTRANSLATE(yychar)];
1214 fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
1215 YYDEBUGSTR, yydepth, yystate, yychar, yys);
1218 #if defined(YYDESTRUCT_CALL)
1221 #endif /* YYBTYACC */
1222 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1223 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc);
1225 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval);
1226 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1227 #endif /* defined(YYDESTRUCT_CALL) */
1237 fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)",
1238 YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]);
1239 #ifdef YYSTYPE_TOSTRING
1242 #endif /* YYBTYACC */
1247 for (i = yym; i > 0; i--)
1249 if (i != yym) fputs(", ", stderr);
1250 fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]],
1251 yystack.l_mark[1-i]), stderr);
1256 fputc('\n', stderr);
1260 yyval = yystack.l_mark[1-yym];
1262 memset(&yyval, 0, sizeof yyval);
1263 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1265 /* Perform position reduction */
1266 memset(&yyloc, 0, sizeof(yyloc));
1269 #endif /* YYBTYACC */
1271 YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym);
1272 /* just in case YYERROR is invoked within the action, save
1273 the start of the rhs as the error start position */
1274 yyerror_loc_range[0] = yystack.p_mark[1-yym];
1281 #line 59 "varsyntax_calc1.y"
1283 (void) printf("%15.8f\n", yystack.l_mark[-1].dval);
1287 #line 63 "varsyntax_calc1.y"
1289 (void) printf("(%15.8f, %15.8f)\n", yystack.l_mark[-1].vval.lo, yystack.l_mark[-1].vval.hi);
1293 #line 67 "varsyntax_calc1.y"
1295 dreg[yystack.l_mark[-3].ival] = yystack.l_mark[-1].dval;
1299 #line 71 "varsyntax_calc1.y"
1301 vreg[yystack.l_mark[-3].ival] = yystack.l_mark[-1].vval;
1305 #line 75 "varsyntax_calc1.y"
1311 #line 82 "varsyntax_calc1.y"
1313 yyval.dval = dreg[yystack.l_mark[0].ival]; /* $$ & $1 are sufficient here*/
1317 #line 86 "varsyntax_calc1.y"
1319 yyval.dval = yystack.l_mark[-2].dval + yystack.l_mark[0].dval;
1323 #line 90 "varsyntax_calc1.y"
1325 yyval.dval = yystack.l_mark[-2].dval - yystack.l_mark[0].dval;
1329 #line 94 "varsyntax_calc1.y"
1331 yyval.dval = yystack.l_mark[-2].dval * yystack.l_mark[0].dval;
1335 #line 98 "varsyntax_calc1.y"
1337 yyval.dval = yystack.l_mark[-2].dval / yystack.l_mark[0].dval;
1341 #line 102 "varsyntax_calc1.y"
1343 yyval.dval = -yystack.l_mark[0].dval;
1347 #line 106 "varsyntax_calc1.y"
1349 yyval.dval = yystack.l_mark[-1].dval;
1353 #line 112 "varsyntax_calc1.y"
1355 yyval.vval.hi = yyval.vval.lo = yystack.l_mark[0].dval;
1359 #line 116 "varsyntax_calc1.y"
1361 yyval.vval.lo = yystack.l_mark[-3].dval;
1362 yyval.vval.hi = yystack.l_mark[-1].dval;
1363 if ( yyval.vval.lo > yyval.vval.hi )
1365 (void) printf("interval out of order\n");
1371 #line 126 "varsyntax_calc1.y"
1373 yyval.vval = vreg[yystack.l_mark[0].ival];
1377 #line 130 "varsyntax_calc1.y"
1379 yyval.vval.hi = yystack.l_mark[-2].vval.hi + yystack.l_mark[0].vval.hi;
1380 yyval.vval.lo = yystack.l_mark[-2].vval.lo + yystack.l_mark[0].vval.lo;
1384 #line 135 "varsyntax_calc1.y"
1386 yyval.vval.hi = yystack.l_mark[-2].dval + yystack.l_mark[0].vval.hi;
1387 yyval.vval.lo = yystack.l_mark[-2].dval + yystack.l_mark[0].vval.lo;
1391 #line 140 "varsyntax_calc1.y"
1393 yyval.vval.hi = yystack.l_mark[-2].vval.hi - yystack.l_mark[0].vval.lo;
1394 yyval.vval.lo = yystack.l_mark[-2].vval.lo - yystack.l_mark[0].vval.hi;
1398 #line 145 "varsyntax_calc1.y"
1400 yyval.vval.hi = yystack.l_mark[-2].dval - yystack.l_mark[0].vval.lo;
1401 yyval.vval.lo = yystack.l_mark[-2].dval - yystack.l_mark[0].vval.hi;
1405 #line 150 "varsyntax_calc1.y"
1407 yyval.vval = vmul( yystack.l_mark[-2].vval.lo, yystack.l_mark[-2].vval.hi, yystack.l_mark[0].vval );
1411 #line 154 "varsyntax_calc1.y"
1413 yyval.vval = vmul (yystack.l_mark[-2].dval, yystack.l_mark[-2].dval, yystack.l_mark[0].vval );
1417 #line 158 "varsyntax_calc1.y"
1419 if (dcheck(yystack.l_mark[0].vval)) YYERROR;
1420 yyval.vval = vdiv ( yystack.l_mark[-2].vval.lo, yystack.l_mark[-2].vval.hi, yystack.l_mark[0].vval );
1424 #line 163 "varsyntax_calc1.y"
1426 if (dcheck ( yystack.l_mark[0].vval )) YYERROR;
1427 yyval.vval = vdiv (yystack.l_mark[-2].dval, yystack.l_mark[-2].dval, yystack.l_mark[0].vval );
1431 #line 168 "varsyntax_calc1.y"
1433 yyval.vval.hi = -yystack.l_mark[0].vval.lo;
1434 yyval.vval.lo = -yystack.l_mark[0].vval.hi;
1438 #line 173 "varsyntax_calc1.y"
1440 yyval.vval = yystack.l_mark[-1].vval;
1443 #line 1444 "varsyntax_calc1.tab.c"
1447 yystack.s_mark -= yym;
1448 yystate = *yystack.s_mark;
1449 yystack.l_mark -= yym;
1450 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1451 yystack.p_mark -= yym;
1454 if (yystate == 0 && yym == 0)
1459 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
1460 #ifdef YYSTYPE_TOSTRING
1463 #endif /* YYBTYACC */
1464 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval));
1466 fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL);
1470 *++yystack.s_mark = YYFINAL;
1471 *++yystack.l_mark = yyval;
1472 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1473 *++yystack.p_mark = yyloc;
1481 /* we're currently re-reading tokens */
1483 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1491 /* in trial mode; save scanner results for future parse attempts */
1492 if (yylvp == yylvlim)
1493 { /* Enlarge lexical value queue */
1494 int p = yylvp - yylvals;
1495 int s = yylvlim - yylvals;
1497 s += YYLVQUEUEGROWTH;
1498 if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL)
1500 if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)
1502 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1503 if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)
1506 yylvp = yylve = yylvals + p;
1507 yylvlim = yylvals + s;
1508 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1509 yylpp = yylpe = yylpsns + p;
1510 yylplim = yylpsns + s;
1512 yylexp = yylexemes + p;
1514 *yylexp = (short) YYLEX;
1517 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1524 /* normal operation, no conflict encountered */
1525 #endif /* YYBTYACC */
1529 #endif /* YYBTYACC */
1530 if (yychar < 0) yychar = YYEOF;
1531 /* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
1535 yys = yyname[YYTRANSLATE(yychar)];
1536 fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
1537 YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
1541 if (yychar == YYEOF) goto yyaccept;
1544 if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
1545 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
1546 yystate = yytable[yyn];
1548 yystate = yydgoto[yym];
1552 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
1553 #ifdef YYSTYPE_TOSTRING
1556 #endif /* YYBTYACC */
1557 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval));
1559 fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate);
1562 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1563 *++yystack.s_mark = (short) yystate;
1564 *++yystack.l_mark = yyval;
1565 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1566 *++yystack.p_mark = yyloc;
1571 /* Reduction declares that this path is valid. Set yypath and do a full parse */
1573 if (yypath) YYABORT;
1576 YYParseState *save = yyps->save;
1577 yyps->save = save->save;
1578 save->save = yypath;
1583 fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n",
1584 YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme));
1588 yyFreeState(yyerrctx);
1591 yylvp = yylvals + yypath->lexeme;
1592 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1593 yylpp = yylpsns + yypath->lexeme;
1595 yylexp = yylexemes + yypath->lexeme;
1597 yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
1598 memcpy (yystack.s_base, yypath->yystack.s_base, (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
1599 yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
1600 memcpy (yystack.l_base, yypath->yystack.l_base, (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1601 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1602 yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base);
1603 memcpy (yystack.p_base, yypath->yystack.p_base, (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1605 yystate = yypath->state;
1607 #endif /* YYBTYACC */
1610 YYERROR_CALL("yacc stack overflow");
1614 YYERROR_CALL("memory exhausted");
1616 #endif /* YYBTYACC */
1626 if (yyps->save) goto yyvalid;
1627 #endif /* YYBTYACC */
1631 #if defined(YYDESTRUCT_CALL)
1632 if (yychar != YYEOF && yychar != YYEMPTY)
1633 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1634 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc);
1636 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval);
1637 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1641 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1644 for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp)
1645 YYDESTRUCT_CALL("cleanup: discarding state",
1646 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp);
1648 for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv)
1649 YYDESTRUCT_CALL("cleanup: discarding state",
1650 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv);
1651 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1653 #endif /* defined(YYDESTRUCT_CALL) */
1658 yyFreeState(yyerrctx);
1663 YYParseState *save = yyps;
1670 YYParseState *save = yypath;
1671 yypath = save->save;
1675 #endif /* YYBTYACC */
1676 yyfreestack(&yystack);