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);
148 #undef YYSTYPE_IS_DECLARED
149 #define YYSTYPE_IS_DECLARED 1
151 #ifndef YYSTYPE_IS_DECLARED
152 #define YYSTYPE_IS_DECLARED 1
153 #line 32 "varsyntax_calc1.y"
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 #if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING)
220 static const YYINT varsyntax_calc1_stos[] = { 0,
221 256, 257, 258, 259, 45, 40, 262, 263, 264, 10,
222 61, 61, 257, 258, 263, 264, 263, 264, 43, 45,
223 42, 47, 10, 43, 45, 42, 47, 10, 45, 40,
224 263, 263, 264, 41, 44, 41, 263, 264, 263, 264,
225 263, 264, 263, 264, 264, 264, 264, 264, 263, 263,
226 43, 45, 42, 47, 10, 10, 263, 263, 263, 263,
229 #endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */
230 static const YYINT varsyntax_calc1_dgoto[] = { 7,
233 static const YYINT varsyntax_calc1_sindex[] = { -40,
234 -8, -48, -47, 0, -37, -37, 0, 2, 17, 0,
235 -34, -37, 0, 0, 0, 0, -25, 90, -37, -37,
236 -37, -37, 0, -37, -37, -37, -37, 0, -34, -34,
237 25, 125, 31, 0, -34, 0, -11, 37, -11, 37,
238 0, 0, 0, 0, 37, 37, 0, 0, 0, 111,
239 -34, -34, -34, -34, 0, 0, 118, 69, 69, 0,
242 static const YYINT varsyntax_calc1_rindex[] = { 0,
243 0, 38, 44, 0, 0, 0, 0, 0, 0, 0,
244 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
245 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
246 0, -9, 0, 0, 0, 0, 51, -3, 56, 61,
247 0, 0, 0, 0, 67, 72, 0, 0, 0, 0,
248 0, 0, 0, 0, 0, 0, 0, 78, 83, 0,
252 static const YYINT varsyntax_calc1_cindex[] = { 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,
257 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
258 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
262 static const YYINT varsyntax_calc1_gindex[] = { 0,
265 #define YYTABLESIZE 225
266 static const YYINT varsyntax_calc1_table[] = { 6,
267 16, 10, 6, 8, 5, 30, 20, 5, 15, 17,
268 29, 23, 11, 12, 31, 34, 21, 19, 35, 20,
269 0, 22, 37, 39, 41, 43, 28, 0, 0, 0,
270 21, 16, 49, 50, 55, 22, 0, 20, 57, 20,
271 56, 20, 0, 21, 19, 0, 20, 9, 22, 0,
272 0, 0, 0, 18, 58, 59, 60, 61, 26, 24,
273 10, 25, 0, 27, 0, 11, 53, 51, 0, 52,
274 22, 54, 26, 24, 0, 25, 19, 27, 26, 9,
275 9, 21, 9, 27, 9, 18, 18, 10, 18, 0,
276 18, 10, 11, 10, 10, 10, 11, 0, 11, 11,
277 11, 22, 0, 22, 0, 22, 0, 19, 0, 19,
278 53, 19, 21, 0, 21, 54, 21, 0, 10, 0,
279 10, 0, 10, 11, 0, 11, 0, 11, 16, 18,
280 36, 26, 24, 0, 25, 33, 27, 0, 0, 0,
281 0, 0, 38, 40, 42, 44, 0, 45, 46, 47,
282 48, 34, 53, 51, 0, 52, 0, 54, 62, 53,
283 51, 0, 52, 0, 54, 0, 21, 19, 0, 20,
284 0, 22, 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, 0, 0, 0, 0, 0,
287 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
288 0, 0, 0, 0, 0, 1, 2, 3, 4, 13,
291 static const YYINT varsyntax_calc1_check[] = { 40,
292 10, 10, 40, 0, 45, 40, 10, 45, 5, 6,
293 45, 10, 61, 61, 11, 41, 42, 43, 44, 45,
294 -1, 47, 19, 20, 21, 22, 10, -1, -1, -1,
295 42, 41, 29, 30, 10, 47, -1, 41, 35, 43,
296 10, 45, -1, 42, 43, -1, 45, 10, 47, -1,
297 -1, -1, -1, 10, 51, 52, 53, 54, 42, 43,
298 10, 45, -1, 47, -1, 10, 42, 43, -1, 45,
299 10, 47, 42, 43, -1, 45, 10, 47, 42, 42,
300 43, 10, 45, 47, 47, 42, 43, 10, 45, -1,
301 47, 41, 10, 43, 44, 45, 41, -1, 43, 44,
302 45, 41, -1, 43, -1, 45, -1, 41, -1, 43,
303 42, 45, 41, -1, 43, 47, 45, -1, 41, -1,
304 43, -1, 45, 41, -1, 43, -1, 45, 5, 6,
305 41, 42, 43, -1, 45, 12, 47, -1, -1, -1,
306 -1, -1, 19, 20, 21, 22, -1, 24, 25, 26,
307 27, 41, 42, 43, -1, 45, -1, 47, 41, 42,
308 43, -1, 45, -1, 47, -1, 42, 43, -1, 45,
309 -1, 47, -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, -1, -1, -1, -1, -1,
312 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
313 -1, -1, -1, -1, -1, 256, 257, 258, 259, 257,
314 258, 259, 257, -1, 259,
317 static const YYINT varsyntax_calc1_ctable[] = { -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,
337 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
338 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
339 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
347 #define YYMAXTOKEN 260
348 #define YYUNDFTOKEN 266
349 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
351 static const char *const varsyntax_calc1_name[] = {
353 "$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,
354 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,
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,0,0,
357 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,
358 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,
359 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,
360 "error","DREG","VREG","CONST","UMINUS","$accept","line","dexp","vexp","lines",
363 static const char *const varsyntax_calc1_rule[] = {
366 "lines : lines line",
369 "line : DREG '=' dexp '\\n'",
370 "line : VREG '=' vexp '\\n'",
371 "line : error '\\n'",
374 "dexp : dexp '+' dexp",
375 "dexp : dexp '-' dexp",
376 "dexp : dexp '*' dexp",
377 "dexp : dexp '/' dexp",
379 "dexp : '(' dexp ')'",
381 "vexp : '(' dexp ',' dexp ')'",
383 "vexp : vexp '+' vexp",
384 "vexp : dexp '+' vexp",
385 "vexp : vexp '-' vexp",
386 "vexp : dexp '-' vexp",
387 "vexp : vexp '*' vexp",
388 "vexp : dexp '*' vexp",
389 "vexp : vexp '/' vexp",
390 "vexp : dexp '/' vexp",
392 "vexp : '(' vexp ')'",
404 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
405 YYLTYPE yyloc; /* position returned by actions */
406 YYLTYPE yylloc; /* position from the lexer */
409 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
410 #ifndef YYLLOC_DEFAULT
411 #define YYLLOC_DEFAULT(loc, rhs, n) \
416 (loc).first_line = ((rhs)[-1]).last_line; \
417 (loc).first_column = ((rhs)[-1]).last_column; \
418 (loc).last_line = ((rhs)[-1]).last_line; \
419 (loc).last_column = ((rhs)[-1]).last_column; \
423 (loc).first_line = ((rhs)[ 0 ]).first_line; \
424 (loc).first_column = ((rhs)[ 0 ]).first_column; \
425 (loc).last_line = ((rhs)[n-1]).last_line; \
426 (loc).last_column = ((rhs)[n-1]).last_column; \
429 #endif /* YYLLOC_DEFAULT */
430 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
433 #ifndef YYLVQUEUEGROWTH
434 #define YYLVQUEUEGROWTH 32
436 #endif /* YYBTYACC */
438 /* define the initial stack-sizes */
441 #define YYMAXDEPTH YYSTACKSIZE
444 #define YYSTACKSIZE YYMAXDEPTH
446 #define YYSTACKSIZE 10000
447 #define YYMAXDEPTH 10000
451 #ifndef YYINITSTACKSIZE
452 #define YYINITSTACKSIZE 200
462 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
469 struct YYParseState_s
471 struct YYParseState_s *save; /* Previously saved parser state */
472 YYSTACKDATA yystack; /* saved parser stack */
473 int state; /* saved parser state */
474 int errflag; /* saved error recovery status */
475 int lexeme; /* saved index of the conflict lexeme in the lexical queue */
476 YYINT ctry; /* saved index in yyctable[] for this conflict */
478 typedef struct YYParseState_s YYParseState;
479 #endif /* YYBTYACC */
480 /* variables for the parser stack */
481 static YYSTACKDATA yystack;
484 /* Current parser state */
485 static YYParseState *yyps = 0;
487 /* yypath != NULL: do the full parse, starting at *yypath parser state. */
488 static YYParseState *yypath = 0;
490 /* Base of the lexical value queue */
491 static YYSTYPE *yylvals = 0;
493 /* Current position at lexical value queue */
494 static YYSTYPE *yylvp = 0;
496 /* End position of lexical value queue */
497 static YYSTYPE *yylve = 0;
499 /* The last allocated position at the lexical value queue */
500 static YYSTYPE *yylvlim = 0;
502 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
503 /* Base of the lexical position queue */
504 static YYLTYPE *yylpsns = 0;
506 /* Current position at lexical position queue */
507 static YYLTYPE *yylpp = 0;
509 /* End position of lexical position queue */
510 static YYLTYPE *yylpe = 0;
512 /* The last allocated position at the lexical position queue */
513 static YYLTYPE *yylplim = 0;
516 /* Current position at lexical token queue */
517 static YYINT *yylexp = 0;
519 static YYINT *yylexemes = 0;
520 #endif /* YYBTYACC */
521 #line 178 "varsyntax_calc1.y"
522 /* beginning of subroutines section */
524 #define BSZ 50 /* buffer size for floating point numbers */
526 /* lexical analysis */
529 yyerror(const char *s)
531 fprintf(stderr, "%s\n", s);
539 while ((c = getchar()) == ' ')
540 { /* skip over blanks */
545 yylval.ival = c - 'A';
550 yylval.ival = c - 'a';
554 if (isdigit(c) || c == '.')
556 /* gobble up digits, points, exponents */
557 char buf[BSZ + 1], *cp = buf;
558 int dot = 0, expr = 0;
560 for (; (cp - buf) < BSZ; ++cp, c = getchar())
569 return ('.'); /* will cause syntax error */
576 return ('e'); /* will cause syntax error */
585 if ((cp - buf) >= BSZ)
586 printf("constant too long: truncated\n");
588 ungetc(c, stdin); /* push back last char read */
589 yylval.dval = atof(buf);
596 hilo(double a, double b, double c, double d)
598 /* returns the smallest interval containing a, b, c, and d */
599 /* used by *, / routines */
631 vmul(double a, double b, INTERVAL v)
633 return (hilo(a * v.hi, a * v.lo, b * v.hi, b * v.lo));
639 if (v.hi >= 0. && v.lo <= 0.)
641 printf("divisor interval contains 0.\n");
648 vdiv(double a, double b, INTERVAL v)
650 return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo));
652 #line 653 "varsyntax_calc1.tab.c"
654 /* For use in generated program */
655 #define yydepth (int)(yystack.s_mark - yystack.s_base)
657 #define yytrial (yyps->save)
658 #endif /* YYBTYACC */
661 #include <stdio.h> /* needed for printf */
664 #include <stdlib.h> /* needed for malloc, etc */
665 #include <string.h> /* needed for memset */
667 /* allocate initial stack or double stack size, up to YYMAXDEPTH */
668 static int yygrowstack(YYSTACKDATA *data)
674 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
678 if ((newsize = data->stacksize) == 0)
679 newsize = YYINITSTACKSIZE;
680 else if (newsize >= YYMAXDEPTH)
682 else if ((newsize *= 2) > YYMAXDEPTH)
683 newsize = YYMAXDEPTH;
685 i = (int) (data->s_mark - data->s_base);
686 newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
690 data->s_base = newss;
691 data->s_mark = newss + i;
693 newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
697 data->l_base = newvs;
698 data->l_mark = newvs + i;
700 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
701 newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps));
705 data->p_base = newps;
706 data->p_mark = newps + i;
709 data->stacksize = newsize;
710 data->s_last = data->s_base + newsize - 1;
714 fprintf(stderr, "%sdebug: stack size increased to %d\n", YYPREFIX, newsize);
719 #if YYPURE || defined(YY_NO_LEAKS)
720 static void yyfreestack(YYSTACKDATA *data)
724 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
727 memset(data, 0, sizeof(*data));
730 #define yyfreestack(data) /* nothing */
731 #endif /* YYPURE || defined(YY_NO_LEAKS) */
734 static YYParseState *
735 yyNewState(unsigned size)
737 YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState));
738 if (p == NULL) return NULL;
740 p->yystack.stacksize = size;
743 p->yystack.s_base = NULL;
744 p->yystack.l_base = NULL;
745 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
746 p->yystack.p_base = NULL;
750 p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
751 if (p->yystack.s_base == NULL) return NULL;
752 p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
753 if (p->yystack.l_base == NULL) return NULL;
754 memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE));
755 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
756 p->yystack.p_base = (YYLTYPE *) malloc(size * sizeof(YYLTYPE));
757 if (p->yystack.p_base == NULL) return NULL;
758 memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE));
765 yyFreeState(YYParseState *p)
767 yyfreestack(&p->yystack);
770 #endif /* YYBTYACC */
772 #define YYABORT goto yyabort
773 #define YYREJECT goto yyabort
774 #define YYACCEPT goto yyaccept
775 #define YYERROR goto yyerrlab
777 #define YYVALID do { if (yyps->save) goto yyvalid; } while(0)
778 #define YYVALID_NESTED do { if (yyps->save && \
779 yyps->save->save == 0) goto yyvalid; } while(0)
780 #endif /* YYBTYACC */
785 int yym, yyn, yystate, yyresult;
788 YYParseState *yyerrctx = NULL;
789 #endif /* YYBTYACC */
790 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
791 YYLTYPE yyerror_loc_range[2]; /* position of error start & end */
796 if ((yys = getenv("YYDEBUG")) != 0)
799 if (yyn >= '0' && yyn <= '9')
803 fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX);
805 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
806 memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range));
810 yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
812 #endif /* YYBTYACC */
821 memset(&yystack, 0, sizeof(yystack));
824 if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
825 yystack.s_mark = yystack.s_base;
826 yystack.l_mark = yystack.l_base;
827 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
828 yystack.p_mark = yystack.p_base;
834 if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
841 /* we're currently re-reading tokens */
843 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
851 /* in trial mode; save scanner results for future parse attempts */
852 if (yylvp == yylvlim)
853 { /* Enlarge lexical value queue */
854 size_t p = (size_t) (yylvp - yylvals);
855 size_t s = (size_t) (yylvlim - yylvals);
857 s += YYLVQUEUEGROWTH;
858 if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem;
859 if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;
860 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
861 if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;
863 yylvp = yylve = yylvals + p;
864 yylvlim = yylvals + s;
865 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
866 yylpp = yylpe = yylpsns + p;
867 yylplim = yylpsns + s;
869 yylexp = yylexemes + p;
871 *yylexp = (YYINT) YYLEX;
874 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
881 /* normal operation, no conflict encountered */
882 #endif /* YYBTYACC */
886 #endif /* YYBTYACC */
887 if (yychar < 0) yychar = YYEOF;
891 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
892 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
893 YYDEBUGSTR, yydepth, yystate, yychar, yys);
894 #ifdef YYSTYPE_TOSTRING
897 #endif /* YYBTYACC */
898 fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval));
906 /* Do we have a conflict? */
907 if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
908 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
917 fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n",
918 YYDEBUGSTR, yydepth, yystate);
920 /* Switch to the next conflict context */
925 if (save->state != yystate) YYABORT;
932 /* Unresolved conflict - start/continue trial parse */
937 fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate);
939 fputs("ALREADY in conflict, continuing trial parse.\n", stderr);
941 fputs("Starting trial parse.\n", stderr);
944 save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
945 if (save == NULL) goto yyenomem;
946 save->save = yyps->save;
947 save->state = yystate;
948 save->errflag = yyerrflag;
949 save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
950 memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
951 save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
952 memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
953 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
954 save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base);
955 memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
958 if (yyctable[ctry] == -1)
961 if (yydebug && yychar >= YYEOF)
962 fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth);
967 if (yyps->save == NULL)
969 /* If this is a first conflict in the stack, start saving lexemes */
972 yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT));
973 if (yylexemes == NULL) goto yyenomem;
974 yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE));
975 if (yylvals == NULL) goto yyenomem;
976 yylvlim = yylvals + YYLVQUEUEGROWTH;
977 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
978 yylpsns = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE));
979 if (yylpsns == NULL) goto yyenomem;
980 yylplim = yylpsns + YYLVQUEUEGROWTH;
985 yylvp = yylve = yylvals;
986 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
987 yylpp = yylpe = yylpsns;
993 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
996 *yylexp = (YYINT) yychar;
1001 if (yychar >= YYEOF)
1004 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1010 save->lexeme = (int) (yylvp - yylvals);
1013 if (yytable[yyn] == ctry)
1017 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
1018 YYDEBUGSTR, yydepth, yystate, yyctable[ctry]);
1023 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1028 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
1030 yystate = yyctable[ctry];
1031 *++yystack.s_mark = (YYINT) yystate;
1032 *++yystack.l_mark = yylval;
1033 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1034 *++yystack.p_mark = yylloc;
1037 if (yyerrflag > 0) --yyerrflag;
1042 yyn = yyctable[ctry];
1045 } /* End of code dealing with conflicts */
1046 #endif /* YYBTYACC */
1047 if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1048 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1052 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
1053 YYDEBUGSTR, yydepth, yystate, yytable[yyn]);
1055 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1056 yystate = yytable[yyn];
1057 *++yystack.s_mark = yytable[yyn];
1058 *++yystack.l_mark = yylval;
1059 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1060 *++yystack.p_mark = yylloc;
1063 if (yyerrflag > 0) --yyerrflag;
1066 if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1067 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1072 if (yyerrflag != 0) goto yyinrecovery;
1077 goto yyerrlab; /* redundant goto avoids 'unused label' warning */
1080 /* explicit YYERROR from an action -- pop the rhs of the rule reduced
1081 * before looking for error recovery */
1082 yystack.s_mark -= yym;
1083 yystate = *yystack.s_mark;
1084 yystack.l_mark -= yym;
1085 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1086 yystack.p_mark -= yym;
1094 YYParseState *save = yyps->save;
1097 fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n",
1098 YYDEBUGSTR, yydepth, yystate, yyps->save->state,
1099 (int)(yylvp - yylvals - yyps->save->lexeme));
1101 /* Memorize most forward-looking error state in case it's really an error. */
1102 if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals)
1104 /* Free old saved error context state */
1105 if (yyerrctx) yyFreeState(yyerrctx);
1106 /* Create and fill out new saved error context state */
1107 yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
1108 if (yyerrctx == NULL) goto yyenomem;
1109 yyerrctx->save = yyps->save;
1110 yyerrctx->state = yystate;
1111 yyerrctx->errflag = yyerrflag;
1112 yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
1113 memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1114 yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
1115 memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1116 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1117 yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base);
1118 memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1120 yyerrctx->lexeme = (int) (yylvp - yylvals);
1122 yylvp = yylvals + save->lexeme;
1123 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1124 yylpp = yylpsns + save->lexeme;
1126 yylexp = yylexemes + save->lexeme;
1128 yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
1129 memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1130 yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
1131 memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1132 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1133 yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base);
1134 memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1136 ctry = ++save->ctry;
1137 yystate = save->state;
1138 /* We tried shift, try reduce now */
1139 if ((yyn = yyctable[ctry]) >= 0) goto yyreduce;
1140 yyps->save = save->save;
1144 /* Nothing left on the stack -- error */
1149 fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n",
1152 /* Restore state as it was in the most forward-advanced error */
1153 yylvp = yylvals + yyerrctx->lexeme;
1154 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1155 yylpp = yylpsns + yyerrctx->lexeme;
1157 yylexp = yylexemes + yyerrctx->lexeme;
1158 yychar = yylexp[-1];
1160 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1163 yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
1164 memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1165 yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
1166 memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1167 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1168 yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base);
1169 memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1171 yystate = yyerrctx->state;
1172 yyFreeState(yyerrctx);
1177 if (yynewerrflag == 0) goto yyinrecovery;
1178 #endif /* YYBTYACC */
1180 YYERROR_CALL("syntax error");
1181 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1182 yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */
1186 goto yyerrlab; /* redundant goto avoids 'unused label' warning */
1197 if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
1198 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
1202 fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n",
1203 YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]);
1205 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1206 yystate = yytable[yyn];
1207 *++yystack.s_mark = yytable[yyn];
1208 *++yystack.l_mark = yylval;
1209 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1210 /* lookahead position is error end position */
1211 yyerror_loc_range[1] = yylloc;
1212 YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */
1213 *++yystack.p_mark = yyloc;
1221 fprintf(stderr, "%s[%d]: error recovery discarding state %d\n",
1222 YYDEBUGSTR, yydepth, *yystack.s_mark);
1224 if (yystack.s_mark <= yystack.s_base) goto yyabort;
1225 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1226 /* the current TOS position is the error start position */
1227 yyerror_loc_range[0] = *yystack.p_mark;
1229 #if defined(YYDESTRUCT_CALL)
1232 #endif /* YYBTYACC */
1233 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1234 YYDESTRUCT_CALL("error: discarding state",
1235 yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark);
1237 YYDESTRUCT_CALL("error: discarding state",
1238 yystos[*yystack.s_mark], yystack.l_mark);
1239 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1240 #endif /* defined(YYDESTRUCT_CALL) */
1243 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1251 if (yychar == YYEOF) goto yyabort;
1255 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
1256 fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
1257 YYDEBUGSTR, yydepth, yystate, yychar, yys);
1260 #if defined(YYDESTRUCT_CALL)
1263 #endif /* YYBTYACC */
1264 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1265 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc);
1267 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval);
1268 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1269 #endif /* defined(YYDESTRUCT_CALL) */
1279 fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)",
1280 YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]);
1281 #ifdef YYSTYPE_TOSTRING
1284 #endif /* YYBTYACC */
1289 for (i = yym; i > 0; i--)
1291 if (i != yym) fputs(", ", stderr);
1292 fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]],
1293 yystack.l_mark[1-i]), stderr);
1298 fputc('\n', stderr);
1302 yyval = yystack.l_mark[1-yym];
1304 memset(&yyval, 0, sizeof yyval);
1305 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1307 /* Perform position reduction */
1308 memset(&yyloc, 0, sizeof(yyloc));
1311 #endif /* YYBTYACC */
1313 YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym);
1314 /* just in case YYERROR is invoked within the action, save
1315 the start of the rhs as the error start position */
1316 yyerror_loc_range[0] = yystack.p_mark[1-yym];
1323 #line 59 "varsyntax_calc1.y"
1325 (void) printf("%15.8f\n", yystack.l_mark[-1].dval);
1329 #line 63 "varsyntax_calc1.y"
1331 (void) printf("(%15.8f, %15.8f)\n", yystack.l_mark[-1].vval.lo, yystack.l_mark[-1].vval.hi);
1335 #line 67 "varsyntax_calc1.y"
1337 dreg[yystack.l_mark[-3].ival] = yystack.l_mark[-1].dval;
1341 #line 71 "varsyntax_calc1.y"
1343 vreg[yystack.l_mark[-3].ival] = yystack.l_mark[-1].vval;
1347 #line 75 "varsyntax_calc1.y"
1353 #line 82 "varsyntax_calc1.y"
1355 yyval.dval = dreg[yystack.l_mark[0].ival]; /* $$ & $1 are sufficient here*/
1359 #line 86 "varsyntax_calc1.y"
1361 yyval.dval = yystack.l_mark[-2].dval + yystack.l_mark[0].dval;
1365 #line 90 "varsyntax_calc1.y"
1367 yyval.dval = yystack.l_mark[-2].dval - yystack.l_mark[0].dval;
1371 #line 94 "varsyntax_calc1.y"
1373 yyval.dval = yystack.l_mark[-2].dval * yystack.l_mark[0].dval;
1377 #line 98 "varsyntax_calc1.y"
1379 yyval.dval = yystack.l_mark[-2].dval / yystack.l_mark[0].dval;
1383 #line 102 "varsyntax_calc1.y"
1385 yyval.dval = -yystack.l_mark[0].dval;
1389 #line 106 "varsyntax_calc1.y"
1391 yyval.dval = yystack.l_mark[-1].dval;
1395 #line 112 "varsyntax_calc1.y"
1397 yyval.vval.hi = yyval.vval.lo = yystack.l_mark[0].dval;
1401 #line 116 "varsyntax_calc1.y"
1403 yyval.vval.lo = yystack.l_mark[-3].dval;
1404 yyval.vval.hi = yystack.l_mark[-1].dval;
1405 if ( yyval.vval.lo > yyval.vval.hi )
1407 (void) printf("interval out of order\n");
1413 #line 126 "varsyntax_calc1.y"
1415 yyval.vval = vreg[yystack.l_mark[0].ival];
1419 #line 130 "varsyntax_calc1.y"
1421 yyval.vval.hi = yystack.l_mark[-2].vval.hi + yystack.l_mark[0].vval.hi;
1422 yyval.vval.lo = yystack.l_mark[-2].vval.lo + yystack.l_mark[0].vval.lo;
1426 #line 135 "varsyntax_calc1.y"
1428 yyval.vval.hi = yystack.l_mark[-2].dval + yystack.l_mark[0].vval.hi;
1429 yyval.vval.lo = yystack.l_mark[-2].dval + yystack.l_mark[0].vval.lo;
1433 #line 140 "varsyntax_calc1.y"
1435 yyval.vval.hi = yystack.l_mark[-2].vval.hi - yystack.l_mark[0].vval.lo;
1436 yyval.vval.lo = yystack.l_mark[-2].vval.lo - yystack.l_mark[0].vval.hi;
1440 #line 145 "varsyntax_calc1.y"
1442 yyval.vval.hi = yystack.l_mark[-2].dval - yystack.l_mark[0].vval.lo;
1443 yyval.vval.lo = yystack.l_mark[-2].dval - yystack.l_mark[0].vval.hi;
1447 #line 150 "varsyntax_calc1.y"
1449 yyval.vval = vmul( yystack.l_mark[-2].vval.lo, yystack.l_mark[-2].vval.hi, yystack.l_mark[0].vval );
1453 #line 154 "varsyntax_calc1.y"
1455 yyval.vval = vmul (yystack.l_mark[-2].dval, yystack.l_mark[-2].dval, yystack.l_mark[0].vval );
1459 #line 158 "varsyntax_calc1.y"
1461 if (dcheck(yystack.l_mark[0].vval)) YYERROR;
1462 yyval.vval = vdiv ( yystack.l_mark[-2].vval.lo, yystack.l_mark[-2].vval.hi, yystack.l_mark[0].vval );
1466 #line 163 "varsyntax_calc1.y"
1468 if (dcheck ( yystack.l_mark[0].vval )) YYERROR;
1469 yyval.vval = vdiv (yystack.l_mark[-2].dval, yystack.l_mark[-2].dval, yystack.l_mark[0].vval );
1473 #line 168 "varsyntax_calc1.y"
1475 yyval.vval.hi = -yystack.l_mark[0].vval.lo;
1476 yyval.vval.lo = -yystack.l_mark[0].vval.hi;
1480 #line 173 "varsyntax_calc1.y"
1482 yyval.vval = yystack.l_mark[-1].vval;
1485 #line 1486 "varsyntax_calc1.tab.c"
1489 yystack.s_mark -= yym;
1490 yystate = *yystack.s_mark;
1491 yystack.l_mark -= yym;
1492 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1493 yystack.p_mark -= yym;
1496 if (yystate == 0 && yym == 0)
1501 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
1502 #ifdef YYSTYPE_TOSTRING
1505 #endif /* YYBTYACC */
1506 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval));
1508 fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL);
1512 *++yystack.s_mark = YYFINAL;
1513 *++yystack.l_mark = yyval;
1514 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1515 *++yystack.p_mark = yyloc;
1523 /* we're currently re-reading tokens */
1525 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1533 /* in trial mode; save scanner results for future parse attempts */
1534 if (yylvp == yylvlim)
1535 { /* Enlarge lexical value queue */
1536 size_t p = (size_t) (yylvp - yylvals);
1537 size_t s = (size_t) (yylvlim - yylvals);
1539 s += YYLVQUEUEGROWTH;
1540 if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL)
1542 if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)
1544 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1545 if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)
1548 yylvp = yylve = yylvals + p;
1549 yylvlim = yylvals + s;
1550 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1551 yylpp = yylpe = yylpsns + p;
1552 yylplim = yylpsns + s;
1554 yylexp = yylexemes + p;
1556 *yylexp = (YYINT) YYLEX;
1559 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1566 /* normal operation, no conflict encountered */
1567 #endif /* YYBTYACC */
1571 #endif /* YYBTYACC */
1572 if (yychar < 0) yychar = YYEOF;
1576 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
1577 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
1578 YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
1582 if (yychar == YYEOF) goto yyaccept;
1585 if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
1586 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
1587 yystate = yytable[yyn];
1589 yystate = yydgoto[yym];
1593 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
1594 #ifdef YYSTYPE_TOSTRING
1597 #endif /* YYBTYACC */
1598 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval));
1600 fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate);
1603 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1604 *++yystack.s_mark = (YYINT) yystate;
1605 *++yystack.l_mark = yyval;
1606 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1607 *++yystack.p_mark = yyloc;
1612 /* Reduction declares that this path is valid. Set yypath and do a full parse */
1614 if (yypath) YYABORT;
1617 YYParseState *save = yyps->save;
1618 yyps->save = save->save;
1619 save->save = yypath;
1624 fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n",
1625 YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme));
1629 yyFreeState(yyerrctx);
1632 yylvp = yylvals + yypath->lexeme;
1633 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1634 yylpp = yylpsns + yypath->lexeme;
1636 yylexp = yylexemes + yypath->lexeme;
1638 yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
1639 memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1640 yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
1641 memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1642 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1643 yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base);
1644 memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1646 yystate = yypath->state;
1648 #endif /* YYBTYACC */
1651 YYERROR_CALL("yacc stack overflow");
1655 YYERROR_CALL("memory exhausted");
1657 #endif /* YYBTYACC */
1667 if (yyps->save) goto yyvalid;
1668 #endif /* YYBTYACC */
1672 #if defined(YYDESTRUCT_CALL)
1673 if (yychar != YYEOF && yychar != YYEMPTY)
1674 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1675 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc);
1677 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval);
1678 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1682 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1685 for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp)
1686 YYDESTRUCT_CALL("cleanup: discarding state",
1687 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp);
1689 for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv)
1690 YYDESTRUCT_CALL("cleanup: discarding state",
1691 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv);
1692 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1694 #endif /* defined(YYDESTRUCT_CALL) */
1699 yyFreeState(yyerrctx);
1704 YYParseState *save = yyps;
1711 YYParseState *save = yypath;
1712 yypath = save->save;
1716 #endif /* YYBTYACC */
1717 yyfreestack(&yystack);