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);
807 yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
809 #endif /* YYBTYACC */
818 memset(&yystack, 0, sizeof(yystack));
821 if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
822 yystack.s_mark = yystack.s_base;
823 yystack.l_mark = yystack.l_base;
824 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
825 yystack.p_mark = yystack.p_base;
831 if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
838 /* we're currently re-reading tokens */
840 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
848 /* in trial mode; save scanner results for future parse attempts */
849 if (yylvp == yylvlim)
850 { /* Enlarge lexical value queue */
851 size_t p = (size_t) (yylvp - yylvals);
852 size_t s = (size_t) (yylvlim - yylvals);
854 s += YYLVQUEUEGROWTH;
855 if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem;
856 if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;
857 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
858 if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;
860 yylvp = yylve = yylvals + p;
861 yylvlim = yylvals + s;
862 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
863 yylpp = yylpe = yylpsns + p;
864 yylplim = yylpsns + s;
866 yylexp = yylexemes + p;
868 *yylexp = (YYINT) YYLEX;
871 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
878 /* normal operation, no conflict encountered */
879 #endif /* YYBTYACC */
883 #endif /* YYBTYACC */
884 if (yychar < 0) yychar = YYEOF;
888 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
889 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
890 YYDEBUGSTR, yydepth, yystate, yychar, yys);
891 #ifdef YYSTYPE_TOSTRING
894 #endif /* YYBTYACC */
895 fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval));
903 /* Do we have a conflict? */
904 if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
905 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
914 fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n",
915 YYDEBUGSTR, yydepth, yystate);
917 /* Switch to the next conflict context */
922 if (save->state != yystate) YYABORT;
929 /* Unresolved conflict - start/continue trial parse */
934 fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate);
936 fputs("ALREADY in conflict, continuing trial parse.\n", stderr);
938 fputs("Starting trial parse.\n", stderr);
941 save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
942 if (save == NULL) goto yyenomem;
943 save->save = yyps->save;
944 save->state = yystate;
945 save->errflag = yyerrflag;
946 save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
947 memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
948 save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
949 memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
950 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
951 save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base);
952 memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
955 if (yyctable[ctry] == -1)
958 if (yydebug && yychar >= YYEOF)
959 fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth);
964 if (yyps->save == NULL)
966 /* If this is a first conflict in the stack, start saving lexemes */
969 yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT));
970 if (yylexemes == NULL) goto yyenomem;
971 yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE));
972 if (yylvals == NULL) goto yyenomem;
973 yylvlim = yylvals + YYLVQUEUEGROWTH;
974 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
975 yylpsns = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE));
976 if (yylpsns == NULL) goto yyenomem;
977 yylplim = yylpsns + YYLVQUEUEGROWTH;
982 yylvp = yylve = yylvals;
983 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
984 yylpp = yylpe = yylpsns;
990 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
993 *yylexp = (YYINT) yychar;
1001 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1007 save->lexeme = (int) (yylvp - yylvals);
1010 if (yytable[yyn] == ctry)
1014 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
1015 YYDEBUGSTR, yydepth, yystate, yyctable[ctry]);
1020 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1025 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
1027 yystate = yyctable[ctry];
1028 *++yystack.s_mark = (YYINT) yystate;
1029 *++yystack.l_mark = yylval;
1030 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1031 *++yystack.p_mark = yylloc;
1034 if (yyerrflag > 0) --yyerrflag;
1039 yyn = yyctable[ctry];
1042 } /* End of code dealing with conflicts */
1043 #endif /* YYBTYACC */
1044 if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1045 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1049 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
1050 YYDEBUGSTR, yydepth, yystate, yytable[yyn]);
1052 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1053 yystate = yytable[yyn];
1054 *++yystack.s_mark = yytable[yyn];
1055 *++yystack.l_mark = yylval;
1056 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1057 *++yystack.p_mark = yylloc;
1060 if (yyerrflag > 0) --yyerrflag;
1063 if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1064 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1069 if (yyerrflag != 0) goto yyinrecovery;
1074 goto yyerrlab; /* redundant goto avoids 'unused label' warning */
1077 /* explicit YYERROR from an action -- pop the rhs of the rule reduced
1078 * before looking for error recovery */
1079 yystack.s_mark -= yym;
1080 yystate = *yystack.s_mark;
1081 yystack.l_mark -= yym;
1082 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1083 yystack.p_mark -= yym;
1091 YYParseState *save = yyps->save;
1094 fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n",
1095 YYDEBUGSTR, yydepth, yystate, yyps->save->state,
1096 (int)(yylvp - yylvals - yyps->save->lexeme));
1098 /* Memorize most forward-looking error state in case it's really an error. */
1099 if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals)
1101 /* Free old saved error context state */
1102 if (yyerrctx) yyFreeState(yyerrctx);
1103 /* Create and fill out new saved error context state */
1104 yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
1105 if (yyerrctx == NULL) goto yyenomem;
1106 yyerrctx->save = yyps->save;
1107 yyerrctx->state = yystate;
1108 yyerrctx->errflag = yyerrflag;
1109 yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
1110 memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1111 yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
1112 memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1113 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1114 yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base);
1115 memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1117 yyerrctx->lexeme = (int) (yylvp - yylvals);
1119 yylvp = yylvals + save->lexeme;
1120 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1121 yylpp = yylpsns + save->lexeme;
1123 yylexp = yylexemes + save->lexeme;
1125 yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
1126 memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1127 yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
1128 memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1129 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1130 yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base);
1131 memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1133 ctry = ++save->ctry;
1134 yystate = save->state;
1135 /* We tried shift, try reduce now */
1136 if ((yyn = yyctable[ctry]) >= 0) goto yyreduce;
1137 yyps->save = save->save;
1141 /* Nothing left on the stack -- error */
1146 fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n",
1149 /* Restore state as it was in the most forward-advanced error */
1150 yylvp = yylvals + yyerrctx->lexeme;
1151 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1152 yylpp = yylpsns + yyerrctx->lexeme;
1154 yylexp = yylexemes + yyerrctx->lexeme;
1155 yychar = yylexp[-1];
1157 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1160 yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
1161 memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1162 yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
1163 memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1164 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1165 yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base);
1166 memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1168 yystate = yyerrctx->state;
1169 yyFreeState(yyerrctx);
1174 if (yynewerrflag == 0) goto yyinrecovery;
1175 #endif /* YYBTYACC */
1177 YYERROR_CALL("syntax error");
1178 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1179 yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */
1183 goto yyerrlab; /* redundant goto avoids 'unused label' warning */
1194 if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
1195 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
1199 fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n",
1200 YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]);
1202 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1203 yystate = yytable[yyn];
1204 *++yystack.s_mark = yytable[yyn];
1205 *++yystack.l_mark = yylval;
1206 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1207 /* lookahead position is error end position */
1208 yyerror_loc_range[1] = yylloc;
1209 YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */
1210 *++yystack.p_mark = yyloc;
1218 fprintf(stderr, "%s[%d]: error recovery discarding state %d\n",
1219 YYDEBUGSTR, yydepth, *yystack.s_mark);
1221 if (yystack.s_mark <= yystack.s_base) goto yyabort;
1222 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1223 /* the current TOS position is the error start position */
1224 yyerror_loc_range[0] = *yystack.p_mark;
1226 #if defined(YYDESTRUCT_CALL)
1229 #endif /* YYBTYACC */
1230 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1231 YYDESTRUCT_CALL("error: discarding state",
1232 yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark);
1234 YYDESTRUCT_CALL("error: discarding state",
1235 yystos[*yystack.s_mark], yystack.l_mark);
1236 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1237 #endif /* defined(YYDESTRUCT_CALL) */
1240 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1248 if (yychar == YYEOF) goto yyabort;
1252 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
1253 fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
1254 YYDEBUGSTR, yydepth, yystate, yychar, yys);
1257 #if defined(YYDESTRUCT_CALL)
1260 #endif /* YYBTYACC */
1261 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1262 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc);
1264 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval);
1265 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1266 #endif /* defined(YYDESTRUCT_CALL) */
1276 fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)",
1277 YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]);
1278 #ifdef YYSTYPE_TOSTRING
1281 #endif /* YYBTYACC */
1286 for (i = yym; i > 0; i--)
1288 if (i != yym) fputs(", ", stderr);
1289 fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]],
1290 yystack.l_mark[1-i]), stderr);
1295 fputc('\n', stderr);
1299 yyval = yystack.l_mark[1-yym];
1301 memset(&yyval, 0, sizeof yyval);
1302 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1304 /* Perform position reduction */
1305 memset(&yyloc, 0, sizeof(yyloc));
1308 #endif /* YYBTYACC */
1310 YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym);
1311 /* just in case YYERROR is invoked within the action, save
1312 the start of the rhs as the error start position */
1313 yyerror_loc_range[0] = yystack.p_mark[1-yym];
1320 #line 59 "varsyntax_calc1.y"
1322 (void) printf("%15.8f\n", yystack.l_mark[-1].dval);
1326 #line 63 "varsyntax_calc1.y"
1328 (void) printf("(%15.8f, %15.8f)\n", yystack.l_mark[-1].vval.lo, yystack.l_mark[-1].vval.hi);
1332 #line 67 "varsyntax_calc1.y"
1334 dreg[yystack.l_mark[-3].ival] = yystack.l_mark[-1].dval;
1338 #line 71 "varsyntax_calc1.y"
1340 vreg[yystack.l_mark[-3].ival] = yystack.l_mark[-1].vval;
1344 #line 75 "varsyntax_calc1.y"
1350 #line 82 "varsyntax_calc1.y"
1352 yyval.dval = dreg[yystack.l_mark[0].ival]; /* $$ & $1 are sufficient here*/
1356 #line 86 "varsyntax_calc1.y"
1358 yyval.dval = yystack.l_mark[-2].dval + yystack.l_mark[0].dval;
1362 #line 90 "varsyntax_calc1.y"
1364 yyval.dval = yystack.l_mark[-2].dval - yystack.l_mark[0].dval;
1368 #line 94 "varsyntax_calc1.y"
1370 yyval.dval = yystack.l_mark[-2].dval * yystack.l_mark[0].dval;
1374 #line 98 "varsyntax_calc1.y"
1376 yyval.dval = yystack.l_mark[-2].dval / yystack.l_mark[0].dval;
1380 #line 102 "varsyntax_calc1.y"
1382 yyval.dval = -yystack.l_mark[0].dval;
1386 #line 106 "varsyntax_calc1.y"
1388 yyval.dval = yystack.l_mark[-1].dval;
1392 #line 112 "varsyntax_calc1.y"
1394 yyval.vval.hi = yyval.vval.lo = yystack.l_mark[0].dval;
1398 #line 116 "varsyntax_calc1.y"
1400 yyval.vval.lo = yystack.l_mark[-3].dval;
1401 yyval.vval.hi = yystack.l_mark[-1].dval;
1402 if ( yyval.vval.lo > yyval.vval.hi )
1404 (void) printf("interval out of order\n");
1410 #line 126 "varsyntax_calc1.y"
1412 yyval.vval = vreg[yystack.l_mark[0].ival];
1416 #line 130 "varsyntax_calc1.y"
1418 yyval.vval.hi = yystack.l_mark[-2].vval.hi + yystack.l_mark[0].vval.hi;
1419 yyval.vval.lo = yystack.l_mark[-2].vval.lo + yystack.l_mark[0].vval.lo;
1423 #line 135 "varsyntax_calc1.y"
1425 yyval.vval.hi = yystack.l_mark[-2].dval + yystack.l_mark[0].vval.hi;
1426 yyval.vval.lo = yystack.l_mark[-2].dval + yystack.l_mark[0].vval.lo;
1430 #line 140 "varsyntax_calc1.y"
1432 yyval.vval.hi = yystack.l_mark[-2].vval.hi - yystack.l_mark[0].vval.lo;
1433 yyval.vval.lo = yystack.l_mark[-2].vval.lo - yystack.l_mark[0].vval.hi;
1437 #line 145 "varsyntax_calc1.y"
1439 yyval.vval.hi = yystack.l_mark[-2].dval - yystack.l_mark[0].vval.lo;
1440 yyval.vval.lo = yystack.l_mark[-2].dval - yystack.l_mark[0].vval.hi;
1444 #line 150 "varsyntax_calc1.y"
1446 yyval.vval = vmul( yystack.l_mark[-2].vval.lo, yystack.l_mark[-2].vval.hi, yystack.l_mark[0].vval );
1450 #line 154 "varsyntax_calc1.y"
1452 yyval.vval = vmul (yystack.l_mark[-2].dval, yystack.l_mark[-2].dval, yystack.l_mark[0].vval );
1456 #line 158 "varsyntax_calc1.y"
1458 if (dcheck(yystack.l_mark[0].vval)) YYERROR;
1459 yyval.vval = vdiv ( yystack.l_mark[-2].vval.lo, yystack.l_mark[-2].vval.hi, yystack.l_mark[0].vval );
1463 #line 163 "varsyntax_calc1.y"
1465 if (dcheck ( yystack.l_mark[0].vval )) YYERROR;
1466 yyval.vval = vdiv (yystack.l_mark[-2].dval, yystack.l_mark[-2].dval, yystack.l_mark[0].vval );
1470 #line 168 "varsyntax_calc1.y"
1472 yyval.vval.hi = -yystack.l_mark[0].vval.lo;
1473 yyval.vval.lo = -yystack.l_mark[0].vval.hi;
1477 #line 173 "varsyntax_calc1.y"
1479 yyval.vval = yystack.l_mark[-1].vval;
1482 #line 1483 "varsyntax_calc1.tab.c"
1486 yystack.s_mark -= yym;
1487 yystate = *yystack.s_mark;
1488 yystack.l_mark -= yym;
1489 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1490 yystack.p_mark -= yym;
1493 if (yystate == 0 && yym == 0)
1498 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
1499 #ifdef YYSTYPE_TOSTRING
1502 #endif /* YYBTYACC */
1503 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval));
1505 fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL);
1509 *++yystack.s_mark = YYFINAL;
1510 *++yystack.l_mark = yyval;
1511 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1512 *++yystack.p_mark = yyloc;
1520 /* we're currently re-reading tokens */
1522 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1530 /* in trial mode; save scanner results for future parse attempts */
1531 if (yylvp == yylvlim)
1532 { /* Enlarge lexical value queue */
1533 size_t p = (size_t) (yylvp - yylvals);
1534 size_t s = (size_t) (yylvlim - yylvals);
1536 s += YYLVQUEUEGROWTH;
1537 if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL)
1539 if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)
1541 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1542 if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)
1545 yylvp = yylve = yylvals + p;
1546 yylvlim = yylvals + s;
1547 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1548 yylpp = yylpe = yylpsns + p;
1549 yylplim = yylpsns + s;
1551 yylexp = yylexemes + p;
1553 *yylexp = (YYINT) YYLEX;
1556 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1563 /* normal operation, no conflict encountered */
1564 #endif /* YYBTYACC */
1568 #endif /* YYBTYACC */
1569 if (yychar < 0) yychar = YYEOF;
1573 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
1574 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
1575 YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
1579 if (yychar == YYEOF) goto yyaccept;
1582 if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
1583 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
1584 yystate = yytable[yyn];
1586 yystate = yydgoto[yym];
1590 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
1591 #ifdef YYSTYPE_TOSTRING
1594 #endif /* YYBTYACC */
1595 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval));
1597 fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate);
1600 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1601 *++yystack.s_mark = (YYINT) yystate;
1602 *++yystack.l_mark = yyval;
1603 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1604 *++yystack.p_mark = yyloc;
1609 /* Reduction declares that this path is valid. Set yypath and do a full parse */
1611 if (yypath) YYABORT;
1614 YYParseState *save = yyps->save;
1615 yyps->save = save->save;
1616 save->save = yypath;
1621 fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n",
1622 YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme));
1626 yyFreeState(yyerrctx);
1629 yylvp = yylvals + yypath->lexeme;
1630 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1631 yylpp = yylpsns + yypath->lexeme;
1633 yylexp = yylexemes + yypath->lexeme;
1635 yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
1636 memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1637 yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
1638 memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1639 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1640 yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base);
1641 memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1643 yystate = yypath->state;
1645 #endif /* YYBTYACC */
1648 YYERROR_CALL("yacc stack overflow");
1652 YYERROR_CALL("memory exhausted");
1654 #endif /* YYBTYACC */
1664 if (yyps->save) goto yyvalid;
1665 #endif /* YYBTYACC */
1669 #if defined(YYDESTRUCT_CALL)
1670 if (yychar != YYEOF && yychar != YYEMPTY)
1671 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1672 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc);
1674 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval);
1675 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1679 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1682 for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp)
1683 YYDESTRUCT_CALL("cleanup: discarding state",
1684 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp);
1686 for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv)
1687 YYDESTRUCT_CALL("cleanup: discarding state",
1688 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv);
1689 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1691 #endif /* defined(YYDESTRUCT_CALL) */
1696 yyFreeState(yyerrctx);
1701 YYParseState *save = yyps;
1708 YYParseState *save = yypath;
1709 yypath = save->save;
1713 #endif /* YYBTYACC */
1714 yyfreestack(&yystack);