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 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,
315 static const YYINT varsyntax_calc1_ctable[] = { -1,
316 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
317 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
318 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
319 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
320 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
321 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
322 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
323 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
324 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
325 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
326 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
327 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
328 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
329 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
330 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
331 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
332 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
333 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
334 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
335 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
336 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
337 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
345 #define YYMAXTOKEN 260
346 #define YYUNDFTOKEN 266
347 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
349 static const char *const varsyntax_calc1_name[] = {
351 "$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,
352 0,0,0,0,0,0,"'('","')'","'*'","'+'","','","'-'",0,"'/'",0,0,0,0,0,0,0,0,0,0,0,0,
353 0,"'='",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
354 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
355 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
356 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,
358 "error","DREG","VREG","CONST","UMINUS","$accept","line","dexp","vexp","lines",
361 static const char *const varsyntax_calc1_rule[] = {
364 "lines : lines line",
367 "line : DREG '=' dexp '\\n'",
368 "line : VREG '=' vexp '\\n'",
369 "line : error '\\n'",
372 "dexp : dexp '+' dexp",
373 "dexp : dexp '-' dexp",
374 "dexp : dexp '*' dexp",
375 "dexp : dexp '/' dexp",
377 "dexp : '(' dexp ')'",
379 "vexp : '(' dexp ',' dexp ')'",
381 "vexp : vexp '+' vexp",
382 "vexp : dexp '+' vexp",
383 "vexp : vexp '-' vexp",
384 "vexp : dexp '-' vexp",
385 "vexp : vexp '*' vexp",
386 "vexp : dexp '*' vexp",
387 "vexp : vexp '/' vexp",
388 "vexp : dexp '/' vexp",
390 "vexp : '(' vexp ')'",
402 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
403 YYLTYPE yyloc; /* position returned by actions */
404 YYLTYPE yylloc; /* position from the lexer */
407 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
408 #ifndef YYLLOC_DEFAULT
409 #define YYLLOC_DEFAULT(loc, rhs, n) \
414 (loc).first_line = ((rhs)[-1]).last_line; \
415 (loc).first_column = ((rhs)[-1]).last_column; \
416 (loc).last_line = ((rhs)[-1]).last_line; \
417 (loc).last_column = ((rhs)[-1]).last_column; \
421 (loc).first_line = ((rhs)[ 0 ]).first_line; \
422 (loc).first_column = ((rhs)[ 0 ]).first_column; \
423 (loc).last_line = ((rhs)[n-1]).last_line; \
424 (loc).last_column = ((rhs)[n-1]).last_column; \
427 #endif /* YYLLOC_DEFAULT */
428 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
431 #ifndef YYLVQUEUEGROWTH
432 #define YYLVQUEUEGROWTH 32
434 #endif /* YYBTYACC */
436 /* define the initial stack-sizes */
439 #define YYMAXDEPTH YYSTACKSIZE
442 #define YYSTACKSIZE YYMAXDEPTH
444 #define YYSTACKSIZE 10000
445 #define YYMAXDEPTH 10000
449 #ifndef YYINITSTACKSIZE
450 #define YYINITSTACKSIZE 200
460 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
467 struct YYParseState_s
469 struct YYParseState_s *save; /* Previously saved parser state */
470 YYSTACKDATA yystack; /* saved parser stack */
471 int state; /* saved parser state */
472 int errflag; /* saved error recovery status */
473 int lexeme; /* saved index of the conflict lexeme in the lexical queue */
474 YYINT ctry; /* saved index in yyctable[] for this conflict */
476 typedef struct YYParseState_s YYParseState;
477 #endif /* YYBTYACC */
478 /* variables for the parser stack */
479 static YYSTACKDATA yystack;
482 /* Current parser state */
483 static YYParseState *yyps = 0;
485 /* yypath != NULL: do the full parse, starting at *yypath parser state. */
486 static YYParseState *yypath = 0;
488 /* Base of the lexical value queue */
489 static YYSTYPE *yylvals = 0;
491 /* Current position at lexical value queue */
492 static YYSTYPE *yylvp = 0;
494 /* End position of lexical value queue */
495 static YYSTYPE *yylve = 0;
497 /* The last allocated position at the lexical value queue */
498 static YYSTYPE *yylvlim = 0;
500 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
501 /* Base of the lexical position queue */
502 static YYLTYPE *yylpsns = 0;
504 /* Current position at lexical position queue */
505 static YYLTYPE *yylpp = 0;
507 /* End position of lexical position queue */
508 static YYLTYPE *yylpe = 0;
510 /* The last allocated position at the lexical position queue */
511 static YYLTYPE *yylplim = 0;
514 /* Current position at lexical token queue */
515 static short *yylexp = 0;
517 static short *yylexemes = 0;
518 #endif /* YYBTYACC */
519 #line 178 "varsyntax_calc1.y"
520 /* beginning of subroutines section */
522 #define BSZ 50 /* buffer size for floating point numbers */
524 /* lexical analysis */
527 yyerror(const char *s)
529 fprintf(stderr, "%s\n", s);
537 while ((c = getchar()) == ' ')
538 { /* skip over blanks */
543 yylval.ival = c - 'A';
548 yylval.ival = c - 'a';
552 if (isdigit(c) || c == '.')
554 /* gobble up digits, points, exponents */
555 char buf[BSZ + 1], *cp = buf;
556 int dot = 0, expr = 0;
558 for (; (cp - buf) < BSZ; ++cp, c = getchar())
567 return ('.'); /* will cause syntax error */
574 return ('e'); /* will cause syntax error */
583 if ((cp - buf) >= BSZ)
584 printf("constant too long: truncated\n");
586 ungetc(c, stdin); /* push back last char read */
587 yylval.dval = atof(buf);
594 hilo(double a, double b, double c, double d)
596 /* returns the smallest interval containing a, b, c, and d */
597 /* used by *, / routines */
629 vmul(double a, double b, INTERVAL v)
631 return (hilo(a * v.hi, a * v.lo, b * v.hi, b * v.lo));
637 if (v.hi >= 0. && v.lo <= 0.)
639 printf("divisor interval contains 0.\n");
646 vdiv(double a, double b, INTERVAL v)
648 return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo));
650 #line 651 "varsyntax_calc1.tab.c"
652 /* For use in generated program */
653 #define yydepth (int)(yystack.s_mark - yystack.s_base)
655 #define yytrial (yyps->save)
656 #endif /* YYBTYACC */
659 #include <stdio.h> /* needed for printf */
662 #include <stdlib.h> /* needed for malloc, etc */
663 #include <string.h> /* needed for memset */
665 /* allocate initial stack or double stack size, up to YYMAXDEPTH */
666 static int yygrowstack(YYSTACKDATA *data)
672 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
676 if ((newsize = data->stacksize) == 0)
677 newsize = YYINITSTACKSIZE;
678 else if (newsize >= YYMAXDEPTH)
680 else if ((newsize *= 2) > YYMAXDEPTH)
681 newsize = YYMAXDEPTH;
683 i = (int) (data->s_mark - data->s_base);
684 newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
688 data->s_base = newss;
689 data->s_mark = newss + i;
691 newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
695 data->l_base = newvs;
696 data->l_mark = newvs + i;
698 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
699 newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps));
703 data->p_base = newps;
704 data->p_mark = newps + i;
707 data->stacksize = newsize;
708 data->s_last = data->s_base + newsize - 1;
712 fprintf(stderr, "%sdebug: stack size increased to %d\n", YYPREFIX, newsize);
717 #if YYPURE || defined(YY_NO_LEAKS)
718 static void yyfreestack(YYSTACKDATA *data)
722 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
725 memset(data, 0, sizeof(*data));
728 #define yyfreestack(data) /* nothing */
729 #endif /* YYPURE || defined(YY_NO_LEAKS) */
732 static YYParseState *
733 yyNewState(unsigned size)
735 YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState));
736 if (p == NULL) return NULL;
738 p->yystack.stacksize = size;
741 p->yystack.s_base = NULL;
742 p->yystack.l_base = NULL;
743 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
744 p->yystack.p_base = NULL;
748 p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
749 if (p->yystack.s_base == NULL) return NULL;
750 p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
751 if (p->yystack.l_base == NULL) return NULL;
752 memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE));
753 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
754 p->yystack.p_base = (YYLTYPE *) malloc(size * sizeof(YYLTYPE));
755 if (p->yystack.p_base == NULL) return NULL;
756 memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE));
763 yyFreeState(YYParseState *p)
765 yyfreestack(&p->yystack);
768 #endif /* YYBTYACC */
770 #define YYABORT goto yyabort
771 #define YYREJECT goto yyabort
772 #define YYACCEPT goto yyaccept
773 #define YYERROR goto yyerrlab
775 #define YYVALID do { if (yyps->save) goto yyvalid; } while(0)
776 #define YYVALID_NESTED do { if (yyps->save && \
777 yyps->save->save == 0) goto yyvalid; } while(0)
778 #endif /* YYBTYACC */
783 int yym, yyn, yystate, yyresult;
786 YYParseState *yyerrctx = NULL;
787 #endif /* YYBTYACC */
788 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
789 YYLTYPE yyerror_loc_range[2]; /* position of error start & end */
794 if ((yys = getenv("YYDEBUG")) != 0)
797 if (yyn >= '0' && yyn <= '9')
801 fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX);
805 yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
807 #endif /* YYBTYACC */
816 memset(&yystack, 0, sizeof(yystack));
819 if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
820 yystack.s_mark = yystack.s_base;
821 yystack.l_mark = yystack.l_base;
822 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
823 yystack.p_mark = yystack.p_base;
829 if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
836 /* we're currently re-reading tokens */
838 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
846 /* in trial mode; save scanner results for future parse attempts */
847 if (yylvp == yylvlim)
848 { /* Enlarge lexical value queue */
849 size_t p = (size_t) (yylvp - yylvals);
850 size_t s = (size_t) (yylvlim - yylvals);
852 s += YYLVQUEUEGROWTH;
853 if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem;
854 if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;
855 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
856 if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;
858 yylvp = yylve = yylvals + p;
859 yylvlim = yylvals + s;
860 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
861 yylpp = yylpe = yylpsns + p;
862 yylplim = yylpsns + s;
864 yylexp = yylexemes + p;
866 *yylexp = (short) YYLEX;
869 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
876 /* normal operation, no conflict encountered */
877 #endif /* YYBTYACC */
881 #endif /* YYBTYACC */
882 if (yychar < 0) yychar = YYEOF;
886 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
887 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
888 YYDEBUGSTR, yydepth, yystate, yychar, yys);
889 #ifdef YYSTYPE_TOSTRING
892 #endif /* YYBTYACC */
893 fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval));
901 /* Do we have a conflict? */
902 if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
903 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
912 fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n",
913 YYDEBUGSTR, yydepth, yystate);
915 /* Switch to the next conflict context */
920 if (save->state != yystate) YYABORT;
927 /* Unresolved conflict - start/continue trial parse */
932 fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate);
934 fputs("ALREADY in conflict, continuing trial parse.\n", stderr);
936 fputs("Starting trial parse.\n", stderr);
939 save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
940 if (save == NULL) goto yyenomem;
941 save->save = yyps->save;
942 save->state = yystate;
943 save->errflag = yyerrflag;
944 save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
945 memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
946 save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
947 memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
948 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
949 save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base);
950 memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
953 if (yyctable[ctry] == -1)
956 if (yydebug && yychar >= YYEOF)
957 fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth);
962 if (yyps->save == NULL)
964 /* If this is a first conflict in the stack, start saving lexemes */
967 yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short));
968 if (yylexemes == NULL) goto yyenomem;
969 yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE));
970 if (yylvals == NULL) goto yyenomem;
971 yylvlim = yylvals + YYLVQUEUEGROWTH;
972 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
973 yylpsns = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE));
974 if (yylpsns == NULL) goto yyenomem;
975 yylplim = yylpsns + YYLVQUEUEGROWTH;
980 yylvp = yylve = yylvals;
981 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
982 yylpp = yylpe = yylpsns;
988 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
991 *yylexp = (short) yychar;
999 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1005 save->lexeme = (int) (yylvp - yylvals);
1008 if (yytable[yyn] == ctry)
1012 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
1013 YYDEBUGSTR, yydepth, yystate, yyctable[ctry]);
1018 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1023 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
1025 yystate = yyctable[ctry];
1026 *++yystack.s_mark = (YYINT) yystate;
1027 *++yystack.l_mark = yylval;
1028 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1029 *++yystack.p_mark = yylloc;
1032 if (yyerrflag > 0) --yyerrflag;
1037 yyn = yyctable[ctry];
1040 } /* End of code dealing with conflicts */
1041 #endif /* YYBTYACC */
1042 if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1043 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1047 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
1048 YYDEBUGSTR, yydepth, yystate, yytable[yyn]);
1050 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1051 yystate = yytable[yyn];
1052 *++yystack.s_mark = yytable[yyn];
1053 *++yystack.l_mark = yylval;
1054 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1055 *++yystack.p_mark = yylloc;
1058 if (yyerrflag > 0) --yyerrflag;
1061 if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1062 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1067 if (yyerrflag != 0) goto yyinrecovery;
1072 goto yyerrlab; /* redundant goto avoids 'unused label' warning */
1075 /* explicit YYERROR from an action -- pop the rhs of the rule reduced
1076 * before looking for error recovery */
1077 yystack.s_mark -= yym;
1078 yystate = *yystack.s_mark;
1079 yystack.l_mark -= yym;
1080 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1081 yystack.p_mark -= yym;
1089 YYParseState *save = yyps->save;
1092 fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n",
1093 YYDEBUGSTR, yydepth, yystate, yyps->save->state,
1094 (int)(yylvp - yylvals - yyps->save->lexeme));
1096 /* Memorize most forward-looking error state in case it's really an error. */
1097 if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals)
1099 /* Free old saved error context state */
1100 if (yyerrctx) yyFreeState(yyerrctx);
1101 /* Create and fill out new saved error context state */
1102 yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
1103 if (yyerrctx == NULL) goto yyenomem;
1104 yyerrctx->save = yyps->save;
1105 yyerrctx->state = yystate;
1106 yyerrctx->errflag = yyerrflag;
1107 yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
1108 memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1109 yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
1110 memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1111 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1112 yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base);
1113 memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1115 yyerrctx->lexeme = (int) (yylvp - yylvals);
1117 yylvp = yylvals + save->lexeme;
1118 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1119 yylpp = yylpsns + save->lexeme;
1121 yylexp = yylexemes + save->lexeme;
1123 yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
1124 memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1125 yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
1126 memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1127 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1128 yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base);
1129 memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1131 ctry = ++save->ctry;
1132 yystate = save->state;
1133 /* We tried shift, try reduce now */
1134 if ((yyn = yyctable[ctry]) >= 0) goto yyreduce;
1135 yyps->save = save->save;
1139 /* Nothing left on the stack -- error */
1144 fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n",
1147 /* Restore state as it was in the most forward-advanced error */
1148 yylvp = yylvals + yyerrctx->lexeme;
1149 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1150 yylpp = yylpsns + yyerrctx->lexeme;
1152 yylexp = yylexemes + yyerrctx->lexeme;
1153 yychar = yylexp[-1];
1155 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1158 yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
1159 memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1160 yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
1161 memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1162 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1163 yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base);
1164 memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1166 yystate = yyerrctx->state;
1167 yyFreeState(yyerrctx);
1172 if (yynewerrflag == 0) goto yyinrecovery;
1173 #endif /* YYBTYACC */
1175 YYERROR_CALL("syntax error");
1176 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1177 yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */
1181 goto yyerrlab; /* redundant goto avoids 'unused label' warning */
1192 if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
1193 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
1197 fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n",
1198 YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]);
1200 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1201 yystate = yytable[yyn];
1202 *++yystack.s_mark = yytable[yyn];
1203 *++yystack.l_mark = yylval;
1204 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1205 /* lookahead position is error end position */
1206 yyerror_loc_range[1] = yylloc;
1207 YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */
1208 *++yystack.p_mark = yyloc;
1216 fprintf(stderr, "%s[%d]: error recovery discarding state %d\n",
1217 YYDEBUGSTR, yydepth, *yystack.s_mark);
1219 if (yystack.s_mark <= yystack.s_base) goto yyabort;
1220 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1221 /* the current TOS position is the error start position */
1222 yyerror_loc_range[0] = *yystack.p_mark;
1224 #if defined(YYDESTRUCT_CALL)
1227 #endif /* YYBTYACC */
1228 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1229 YYDESTRUCT_CALL("error: discarding state",
1230 yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark);
1232 YYDESTRUCT_CALL("error: discarding state",
1233 yystos[*yystack.s_mark], yystack.l_mark);
1234 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1235 #endif /* defined(YYDESTRUCT_CALL) */
1238 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1246 if (yychar == YYEOF) goto yyabort;
1250 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
1251 fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
1252 YYDEBUGSTR, yydepth, yystate, yychar, yys);
1255 #if defined(YYDESTRUCT_CALL)
1258 #endif /* YYBTYACC */
1259 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1260 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc);
1262 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval);
1263 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1264 #endif /* defined(YYDESTRUCT_CALL) */
1274 fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)",
1275 YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]);
1276 #ifdef YYSTYPE_TOSTRING
1279 #endif /* YYBTYACC */
1284 for (i = yym; i > 0; i--)
1286 if (i != yym) fputs(", ", stderr);
1287 fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]],
1288 yystack.l_mark[1-i]), stderr);
1293 fputc('\n', stderr);
1297 yyval = yystack.l_mark[1-yym];
1299 memset(&yyval, 0, sizeof yyval);
1300 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1302 /* Perform position reduction */
1303 memset(&yyloc, 0, sizeof(yyloc));
1306 #endif /* YYBTYACC */
1308 YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym);
1309 /* just in case YYERROR is invoked within the action, save
1310 the start of the rhs as the error start position */
1311 yyerror_loc_range[0] = yystack.p_mark[1-yym];
1318 #line 59 "varsyntax_calc1.y"
1320 (void) printf("%15.8f\n", yystack.l_mark[-1].dval);
1324 #line 63 "varsyntax_calc1.y"
1326 (void) printf("(%15.8f, %15.8f)\n", yystack.l_mark[-1].vval.lo, yystack.l_mark[-1].vval.hi);
1330 #line 67 "varsyntax_calc1.y"
1332 dreg[yystack.l_mark[-3].ival] = yystack.l_mark[-1].dval;
1336 #line 71 "varsyntax_calc1.y"
1338 vreg[yystack.l_mark[-3].ival] = yystack.l_mark[-1].vval;
1342 #line 75 "varsyntax_calc1.y"
1348 #line 82 "varsyntax_calc1.y"
1350 yyval.dval = dreg[yystack.l_mark[0].ival]; /* $$ & $1 are sufficient here*/
1354 #line 86 "varsyntax_calc1.y"
1356 yyval.dval = yystack.l_mark[-2].dval + yystack.l_mark[0].dval;
1360 #line 90 "varsyntax_calc1.y"
1362 yyval.dval = yystack.l_mark[-2].dval - yystack.l_mark[0].dval;
1366 #line 94 "varsyntax_calc1.y"
1368 yyval.dval = yystack.l_mark[-2].dval * yystack.l_mark[0].dval;
1372 #line 98 "varsyntax_calc1.y"
1374 yyval.dval = yystack.l_mark[-2].dval / yystack.l_mark[0].dval;
1378 #line 102 "varsyntax_calc1.y"
1380 yyval.dval = -yystack.l_mark[0].dval;
1384 #line 106 "varsyntax_calc1.y"
1386 yyval.dval = yystack.l_mark[-1].dval;
1390 #line 112 "varsyntax_calc1.y"
1392 yyval.vval.hi = yyval.vval.lo = yystack.l_mark[0].dval;
1396 #line 116 "varsyntax_calc1.y"
1398 yyval.vval.lo = yystack.l_mark[-3].dval;
1399 yyval.vval.hi = yystack.l_mark[-1].dval;
1400 if ( yyval.vval.lo > yyval.vval.hi )
1402 (void) printf("interval out of order\n");
1408 #line 126 "varsyntax_calc1.y"
1410 yyval.vval = vreg[yystack.l_mark[0].ival];
1414 #line 130 "varsyntax_calc1.y"
1416 yyval.vval.hi = yystack.l_mark[-2].vval.hi + yystack.l_mark[0].vval.hi;
1417 yyval.vval.lo = yystack.l_mark[-2].vval.lo + yystack.l_mark[0].vval.lo;
1421 #line 135 "varsyntax_calc1.y"
1423 yyval.vval.hi = yystack.l_mark[-2].dval + yystack.l_mark[0].vval.hi;
1424 yyval.vval.lo = yystack.l_mark[-2].dval + yystack.l_mark[0].vval.lo;
1428 #line 140 "varsyntax_calc1.y"
1430 yyval.vval.hi = yystack.l_mark[-2].vval.hi - yystack.l_mark[0].vval.lo;
1431 yyval.vval.lo = yystack.l_mark[-2].vval.lo - yystack.l_mark[0].vval.hi;
1435 #line 145 "varsyntax_calc1.y"
1437 yyval.vval.hi = yystack.l_mark[-2].dval - yystack.l_mark[0].vval.lo;
1438 yyval.vval.lo = yystack.l_mark[-2].dval - yystack.l_mark[0].vval.hi;
1442 #line 150 "varsyntax_calc1.y"
1444 yyval.vval = vmul( yystack.l_mark[-2].vval.lo, yystack.l_mark[-2].vval.hi, yystack.l_mark[0].vval );
1448 #line 154 "varsyntax_calc1.y"
1450 yyval.vval = vmul (yystack.l_mark[-2].dval, yystack.l_mark[-2].dval, yystack.l_mark[0].vval );
1454 #line 158 "varsyntax_calc1.y"
1456 if (dcheck(yystack.l_mark[0].vval)) YYERROR;
1457 yyval.vval = vdiv ( yystack.l_mark[-2].vval.lo, yystack.l_mark[-2].vval.hi, yystack.l_mark[0].vval );
1461 #line 163 "varsyntax_calc1.y"
1463 if (dcheck ( yystack.l_mark[0].vval )) YYERROR;
1464 yyval.vval = vdiv (yystack.l_mark[-2].dval, yystack.l_mark[-2].dval, yystack.l_mark[0].vval );
1468 #line 168 "varsyntax_calc1.y"
1470 yyval.vval.hi = -yystack.l_mark[0].vval.lo;
1471 yyval.vval.lo = -yystack.l_mark[0].vval.hi;
1475 #line 173 "varsyntax_calc1.y"
1477 yyval.vval = yystack.l_mark[-1].vval;
1480 #line 1481 "varsyntax_calc1.tab.c"
1484 yystack.s_mark -= yym;
1485 yystate = *yystack.s_mark;
1486 yystack.l_mark -= yym;
1487 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1488 yystack.p_mark -= yym;
1491 if (yystate == 0 && yym == 0)
1496 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
1497 #ifdef YYSTYPE_TOSTRING
1500 #endif /* YYBTYACC */
1501 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval));
1503 fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL);
1507 *++yystack.s_mark = YYFINAL;
1508 *++yystack.l_mark = yyval;
1509 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1510 *++yystack.p_mark = yyloc;
1518 /* we're currently re-reading tokens */
1520 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1528 /* in trial mode; save scanner results for future parse attempts */
1529 if (yylvp == yylvlim)
1530 { /* Enlarge lexical value queue */
1531 size_t p = (size_t) (yylvp - yylvals);
1532 size_t s = (size_t) (yylvlim - yylvals);
1534 s += YYLVQUEUEGROWTH;
1535 if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL)
1537 if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)
1539 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1540 if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)
1543 yylvp = yylve = yylvals + p;
1544 yylvlim = yylvals + s;
1545 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1546 yylpp = yylpe = yylpsns + p;
1547 yylplim = yylpsns + s;
1549 yylexp = yylexemes + p;
1551 *yylexp = (short) YYLEX;
1554 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1561 /* normal operation, no conflict encountered */
1562 #endif /* YYBTYACC */
1566 #endif /* YYBTYACC */
1567 if (yychar < 0) yychar = YYEOF;
1571 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
1572 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
1573 YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
1577 if (yychar == YYEOF) goto yyaccept;
1580 if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
1581 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
1582 yystate = yytable[yyn];
1584 yystate = yydgoto[yym];
1588 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
1589 #ifdef YYSTYPE_TOSTRING
1592 #endif /* YYBTYACC */
1593 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval));
1595 fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate);
1598 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1599 *++yystack.s_mark = (YYINT) yystate;
1600 *++yystack.l_mark = yyval;
1601 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1602 *++yystack.p_mark = yyloc;
1607 /* Reduction declares that this path is valid. Set yypath and do a full parse */
1609 if (yypath) YYABORT;
1612 YYParseState *save = yyps->save;
1613 yyps->save = save->save;
1614 save->save = yypath;
1619 fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n",
1620 YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme));
1624 yyFreeState(yyerrctx);
1627 yylvp = yylvals + yypath->lexeme;
1628 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1629 yylpp = yylpsns + yypath->lexeme;
1631 yylexp = yylexemes + yypath->lexeme;
1633 yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
1634 memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1635 yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
1636 memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1637 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1638 yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base);
1639 memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1641 yystate = yypath->state;
1643 #endif /* YYBTYACC */
1646 YYERROR_CALL("yacc stack overflow");
1650 YYERROR_CALL("memory exhausted");
1652 #endif /* YYBTYACC */
1662 if (yyps->save) goto yyvalid;
1663 #endif /* YYBTYACC */
1667 #if defined(YYDESTRUCT_CALL)
1668 if (yychar != YYEOF && yychar != YYEMPTY)
1669 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1670 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc);
1672 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval);
1673 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1677 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1680 for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp)
1681 YYDESTRUCT_CALL("cleanup: discarding state",
1682 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp);
1684 for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv)
1685 YYDESTRUCT_CALL("cleanup: discarding state",
1686 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv);
1687 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1689 #endif /* defined(YYDESTRUCT_CALL) */
1694 yyFreeState(yyerrctx);
1699 YYParseState *save = yyps;
1706 YYParseState *save = yypath;
1707 yypath = save->save;
1711 #endif /* YYBTYACC */
1712 yyfreestack(&yystack);