1 /* original parser id follows */
2 /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
3 /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
8 #define YYCHECK "yyyymmdd"
11 #define yyclearin (yychar = YYEMPTY)
12 #define yyerrok (yyerrflag = 0)
13 #define YYRECOVERING() (yyerrflag != 0)
16 #ident "check variant syntax features"
19 #define YYDEBUGSTR YYPREFIX "debug"
22 #define yyparse varsyntax_calc1_parse
26 #define yylex varsyntax_calc1_lex
30 #define yyerror varsyntax_calc1_error
34 #define yychar varsyntax_calc1_char
38 #define yyval varsyntax_calc1_val
42 #define yylval varsyntax_calc1_lval
46 #define yydebug varsyntax_calc1_debug
50 #define yynerrs varsyntax_calc1_nerrs
54 #define yyerrflag varsyntax_calc1_errflag
55 #endif /* yyerrflag */
58 #define yylhs varsyntax_calc1_lhs
62 #define yylen varsyntax_calc1_len
66 #define yydefred varsyntax_calc1_defred
70 #define yystos varsyntax_calc1_stos
74 #define yydgoto varsyntax_calc1_dgoto
78 #define yysindex varsyntax_calc1_sindex
82 #define yyrindex varsyntax_calc1_rindex
86 #define yygindex varsyntax_calc1_gindex
90 #define yytable varsyntax_calc1_table
94 #define yycheck varsyntax_calc1_check
98 #define yyname varsyntax_calc1_name
102 #define yyrule varsyntax_calc1_rule
108 #define yycindex varsyntax_calc1_cindex
109 #endif /* yycindex */
112 #define yyctable varsyntax_calc1_ctable
113 #endif /* yyctable */
115 #endif /* YYBTYACC */
117 #define YYPREFIX "varsyntax_calc1_"
121 #line 3 "varsyntax_calc1.y"
123 /* http://dinosaur.compilertools.net/yacc/index.html * /*/
130 typedef struct interval
136 INTERVAL vmul(double, double, INTERVAL);
137 INTERVAL vdiv(double, double, INTERVAL);
139 extern int yylex(void);
140 static void yyerror(const char *s);
142 int dcheck(INTERVAL);
147 #line 32 "varsyntax_calc1.y"
149 #undef YYSTYPE_IS_DECLARED
150 #define YYSTYPE_IS_DECLARED 1
152 #ifndef YYSTYPE_IS_DECLARED
153 #define YYSTYPE_IS_DECLARED 1
156 int ival; /* dreg & vreg array index values*/
157 double dval; /* floating point values*/
158 INTERVAL vval; /* interval values*/
160 #endif /* !YYSTYPE_IS_DECLARED */
161 #line 162 "varsyntax_calc1.tab.c"
163 /* compatibility with bison */
165 /* compatibility with FreeBSD */
166 # ifdef YYPARSE_PARAM_TYPE
167 # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
169 # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
172 # define YYPARSE_DECL() yyparse(void)
175 /* Parameters sent to lex. */
177 # define YYLEX_DECL() yylex(void *YYLEX_PARAM)
178 # define YYLEX yylex(YYLEX_PARAM)
180 # define YYLEX_DECL() yylex(void)
181 # define YYLEX yylex()
184 /* Parameters sent to yyerror. */
186 #define YYERROR_DECL() yyerror(const char *s)
189 #define YYERROR_CALL(msg) yyerror(msg)
192 extern int YYPARSE_DECL();
198 #define YYERRCODE 256
200 static const YYINT varsyntax_calc1_lhs[] = { -1,
201 3, 3, 0, 0, 0, 0, 0, 1, 1, 1,
202 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
203 2, 2, 2, 2, 2, 2, 2, 2,
205 static const YYINT varsyntax_calc1_len[] = { 2,
206 0, 2, 2, 2, 4, 4, 2, 1, 1, 3,
207 3, 3, 3, 2, 3, 1, 5, 1, 3, 3,
208 3, 3, 3, 3, 3, 3, 2, 3,
210 static const YYINT varsyntax_calc1_defred[] = { 0,
211 0, 0, 0, 8, 0, 0, 0, 0, 0, 7,
212 0, 0, 9, 18, 14, 27, 0, 0, 0, 0,
213 0, 0, 3, 0, 0, 0, 0, 4, 0, 0,
214 0, 0, 0, 15, 0, 28, 0, 0, 0, 0,
215 12, 24, 13, 26, 0, 0, 23, 25, 14, 0,
216 0, 0, 0, 0, 5, 6, 0, 0, 0, 12,
219 static const YYINT varsyntax_calc1_stos[] = { 0,
220 256, 257, 258, 259, 45, 40, 262, 263, 264, 10,
221 61, 61, 257, 258, 263, 264, 263, 264, 43, 45,
222 42, 47, 10, 43, 45, 42, 47, 10, 45, 40,
223 263, 263, 264, 41, 44, 41, 263, 264, 263, 264,
224 263, 264, 263, 264, 264, 264, 264, 264, 263, 263,
225 43, 45, 42, 47, 10, 10, 263, 263, 263, 263,
228 static const YYINT varsyntax_calc1_dgoto[] = { 7,
231 static const YYINT varsyntax_calc1_sindex[] = { -40,
232 -8, -48, -47, 0, -37, -37, 0, 2, 17, 0,
233 -34, -37, 0, 0, 0, 0, -25, 90, -37, -37,
234 -37, -37, 0, -37, -37, -37, -37, 0, -34, -34,
235 25, 125, 31, 0, -34, 0, -11, 37, -11, 37,
236 0, 0, 0, 0, 37, 37, 0, 0, 0, 111,
237 -34, -34, -34, -34, 0, 0, 118, 69, 69, 0,
240 static const YYINT varsyntax_calc1_rindex[] = { 0,
241 0, 38, 44, 0, 0, 0, 0, 0, 0, 0,
242 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
243 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
244 0, -9, 0, 0, 0, 0, 51, -3, 56, 61,
245 0, 0, 0, 0, 67, 72, 0, 0, 0, 0,
246 0, 0, 0, 0, 0, 0, 0, 78, 83, 0,
250 static const YYINT varsyntax_calc1_cindex[] = { 0,
251 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
252 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
253 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
254 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
255 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
256 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
260 static const YYINT varsyntax_calc1_gindex[] = { 0,
263 #define YYTABLESIZE 225
264 static const YYINT varsyntax_calc1_table[] = { 6,
265 16, 10, 6, 8, 5, 30, 20, 5, 15, 17,
266 29, 23, 11, 12, 31, 34, 21, 19, 35, 20,
267 0, 22, 37, 39, 41, 43, 28, 0, 0, 0,
268 21, 16, 49, 50, 55, 22, 0, 20, 57, 20,
269 56, 20, 0, 21, 19, 0, 20, 9, 22, 0,
270 0, 0, 0, 18, 58, 59, 60, 61, 26, 24,
271 10, 25, 0, 27, 0, 11, 53, 51, 0, 52,
272 22, 54, 26, 24, 0, 25, 19, 27, 26, 9,
273 9, 21, 9, 27, 9, 18, 18, 10, 18, 0,
274 18, 10, 11, 10, 10, 10, 11, 0, 11, 11,
275 11, 22, 0, 22, 0, 22, 0, 19, 0, 19,
276 53, 19, 21, 0, 21, 54, 21, 0, 10, 0,
277 10, 0, 10, 11, 0, 11, 0, 11, 16, 18,
278 36, 26, 24, 0, 25, 33, 27, 0, 0, 0,
279 0, 0, 38, 40, 42, 44, 0, 45, 46, 47,
280 48, 34, 53, 51, 0, 52, 0, 54, 62, 53,
281 51, 0, 52, 0, 54, 0, 21, 19, 0, 20,
282 0, 22, 0, 0, 0, 0, 0, 0, 0, 0,
283 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
284 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
285 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
286 0, 0, 0, 0, 0, 1, 2, 3, 4, 13,
289 static const YYINT varsyntax_calc1_check[] = { 40,
290 10, 10, 40, 0, 45, 40, 10, 45, 5, 6,
291 45, 10, 61, 61, 11, 41, 42, 43, 44, 45,
292 -1, 47, 19, 20, 21, 22, 10, -1, -1, -1,
293 42, 41, 29, 30, 10, 47, -1, 41, 35, 43,
294 10, 45, -1, 42, 43, -1, 45, 10, 47, -1,
295 -1, -1, -1, 10, 51, 52, 53, 54, 42, 43,
296 10, 45, -1, 47, -1, 10, 42, 43, -1, 45,
297 10, 47, 42, 43, -1, 45, 10, 47, 42, 42,
298 43, 10, 45, 47, 47, 42, 43, 10, 45, -1,
299 47, 41, 10, 43, 44, 45, 41, -1, 43, 44,
300 45, 41, -1, 43, -1, 45, -1, 41, -1, 43,
301 42, 45, 41, -1, 43, 47, 45, -1, 41, -1,
302 43, -1, 45, 41, -1, 43, -1, 45, 5, 6,
303 41, 42, 43, -1, 45, 12, 47, -1, -1, -1,
304 -1, -1, 19, 20, 21, 22, -1, 24, 25, 26,
305 27, 41, 42, 43, -1, 45, -1, 47, 41, 42,
306 43, -1, 45, -1, 47, -1, 42, 43, -1, 45,
307 -1, 47, -1, -1, -1, -1, -1, -1, -1, -1,
308 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
309 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
310 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
311 -1, -1, -1, -1, -1, 256, 257, 258, 259, 257,
312 258, 259, 257, -1, 259,
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 = (short *)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 = (short *) malloc(size * sizeof(short));
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 */
814 memset(&yystack, 0, sizeof(yystack));
817 if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
818 yystack.s_mark = yystack.s_base;
819 yystack.l_mark = yystack.l_base;
820 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
821 yystack.p_mark = yystack.p_base;
827 if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
834 /* we're currently re-reading tokens */
836 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
844 /* in trial mode; save scanner results for future parse attempts */
845 if (yylvp == yylvlim)
846 { /* Enlarge lexical value queue */
847 size_t p = (size_t) (yylvp - yylvals);
848 size_t s = (size_t) (yylvlim - yylvals);
850 s += YYLVQUEUEGROWTH;
851 if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem;
852 if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;
853 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
854 if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;
856 yylvp = yylve = yylvals + p;
857 yylvlim = yylvals + s;
858 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
859 yylpp = yylpe = yylpsns + p;
860 yylplim = yylpsns + s;
862 yylexp = yylexemes + p;
864 *yylexp = (short) YYLEX;
867 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
874 /* normal operation, no conflict encountered */
875 #endif /* YYBTYACC */
879 #endif /* YYBTYACC */
880 if (yychar < 0) yychar = YYEOF;
881 /* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
885 yys = yyname[YYTRANSLATE(yychar)];
886 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
887 YYDEBUGSTR, yydepth, yystate, yychar, yys);
888 #ifdef YYSTYPE_TOSTRING
891 #endif /* YYBTYACC */
892 fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval));
900 /* Do we have a conflict? */
901 if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
902 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
911 fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n",
912 YYDEBUGSTR, yydepth, yystate);
914 /* Switch to the next conflict context */
919 if (save->state != yystate) YYABORT;
926 /* Unresolved conflict - start/continue trial parse */
931 fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate);
933 fputs("ALREADY in conflict, continuing trial parse.\n", stderr);
935 fputs("Starting trial parse.\n", stderr);
938 save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
939 if (save == NULL) goto yyenomem;
940 save->save = yyps->save;
941 save->state = yystate;
942 save->errflag = yyerrflag;
943 save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
944 memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
945 save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
946 memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
947 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
948 save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base);
949 memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
952 if (yyctable[ctry] == -1)
955 if (yydebug && yychar >= YYEOF)
956 fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth);
961 if (yyps->save == NULL)
963 /* If this is a first conflict in the stack, start saving lexemes */
966 yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short));
967 if (yylexemes == NULL) goto yyenomem;
968 yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE));
969 if (yylvals == NULL) goto yyenomem;
970 yylvlim = yylvals + YYLVQUEUEGROWTH;
971 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
972 yylpsns = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE));
973 if (yylpsns == NULL) goto yyenomem;
974 yylplim = yylpsns + YYLVQUEUEGROWTH;
979 yylvp = yylve = yylvals;
980 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
981 yylpp = yylpe = yylpsns;
987 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
990 *yylexp = (short) yychar;
998 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1004 save->lexeme = (int) (yylvp - yylvals);
1007 if (yytable[yyn] == ctry)
1011 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
1012 YYDEBUGSTR, yydepth, yystate, yyctable[ctry]);
1017 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1022 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
1024 yystate = yyctable[ctry];
1025 *++yystack.s_mark = (short) yystate;
1026 *++yystack.l_mark = yylval;
1027 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1028 *++yystack.p_mark = yylloc;
1031 if (yyerrflag > 0) --yyerrflag;
1036 yyn = yyctable[ctry];
1039 } /* End of code dealing with conflicts */
1040 #endif /* YYBTYACC */
1041 if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1042 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1046 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
1047 YYDEBUGSTR, yydepth, yystate, yytable[yyn]);
1049 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1050 yystate = yytable[yyn];
1051 *++yystack.s_mark = yytable[yyn];
1052 *++yystack.l_mark = yylval;
1053 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1054 *++yystack.p_mark = yylloc;
1057 if (yyerrflag > 0) --yyerrflag;
1060 if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1061 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1066 if (yyerrflag != 0) goto yyinrecovery;
1079 YYParseState *save = yyps->save;
1082 fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n",
1083 YYDEBUGSTR, yydepth, yystate, yyps->save->state,
1084 (int)(yylvp - yylvals - yyps->save->lexeme));
1086 /* Memorize most forward-looking error state in case it's really an error. */
1087 if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals)
1089 /* Free old saved error context state */
1090 if (yyerrctx) yyFreeState(yyerrctx);
1091 /* Create and fill out new saved error context state */
1092 yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
1093 if (yyerrctx == NULL) goto yyenomem;
1094 yyerrctx->save = yyps->save;
1095 yyerrctx->state = yystate;
1096 yyerrctx->errflag = yyerrflag;
1097 yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
1098 memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
1099 yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
1100 memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1101 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1102 yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base);
1103 memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1105 yyerrctx->lexeme = (int) (yylvp - yylvals);
1107 yylvp = yylvals + save->lexeme;
1108 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1109 yylpp = yylpsns + save->lexeme;
1111 yylexp = yylexemes + save->lexeme;
1113 yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
1114 memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
1115 yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
1116 memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1117 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1118 yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base);
1119 memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1121 ctry = ++save->ctry;
1122 yystate = save->state;
1123 /* We tried shift, try reduce now */
1124 if ((yyn = yyctable[ctry]) >= 0) goto yyreduce;
1125 yyps->save = save->save;
1129 /* Nothing left on the stack -- error */
1134 fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n",
1137 /* Restore state as it was in the most forward-advanced error */
1138 yylvp = yylvals + yyerrctx->lexeme;
1139 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1140 yylpp = yylpsns + yyerrctx->lexeme;
1142 yylexp = yylexemes + yyerrctx->lexeme;
1143 yychar = yylexp[-1];
1145 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1148 yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
1149 memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
1150 yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
1151 memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1152 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1153 yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base);
1154 memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1156 yystate = yyerrctx->state;
1157 yyFreeState(yyerrctx);
1162 if (yynewerrflag == 0) goto yyinrecovery;
1163 #endif /* YYBTYACC */
1165 YYERROR_CALL("syntax error");
1166 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1167 yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */
1182 if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
1183 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
1187 fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n",
1188 YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]);
1190 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1191 yystate = yytable[yyn];
1192 *++yystack.s_mark = yytable[yyn];
1193 *++yystack.l_mark = yylval;
1194 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1195 /* lookahead position is error end position */
1196 yyerror_loc_range[1] = yylloc;
1197 YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */
1198 *++yystack.p_mark = yyloc;
1206 fprintf(stderr, "%s[%d]: error recovery discarding state %d\n",
1207 YYDEBUGSTR, yydepth, *yystack.s_mark);
1209 if (yystack.s_mark <= yystack.s_base) goto yyabort;
1210 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1211 /* the current TOS position is the error start position */
1212 yyerror_loc_range[0] = *yystack.p_mark;
1214 #if defined(YYDESTRUCT_CALL)
1217 #endif /* YYBTYACC */
1218 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1219 YYDESTRUCT_CALL("error: discarding state",
1220 yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark);
1222 YYDESTRUCT_CALL("error: discarding state",
1223 yystos[*yystack.s_mark], yystack.l_mark);
1224 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1225 #endif /* defined(YYDESTRUCT_CALL) */
1228 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1236 if (yychar == YYEOF) goto yyabort;
1240 yys = yyname[YYTRANSLATE(yychar)];
1241 fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
1242 YYDEBUGSTR, yydepth, yystate, yychar, yys);
1245 #if defined(YYDESTRUCT_CALL)
1248 #endif /* YYBTYACC */
1249 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1250 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc);
1252 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval);
1253 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1254 #endif /* defined(YYDESTRUCT_CALL) */
1264 fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)",
1265 YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]);
1266 #ifdef YYSTYPE_TOSTRING
1269 #endif /* YYBTYACC */
1274 for (i = yym; i > 0; i--)
1276 if (i != yym) fputs(", ", stderr);
1277 fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]],
1278 yystack.l_mark[1-i]), stderr);
1283 fputc('\n', stderr);
1287 yyval = yystack.l_mark[1-yym];
1289 memset(&yyval, 0, sizeof yyval);
1290 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1292 /* Perform position reduction */
1293 memset(&yyloc, 0, sizeof(yyloc));
1296 #endif /* YYBTYACC */
1298 YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym);
1299 /* just in case YYERROR is invoked within the action, save
1300 the start of the rhs as the error start position */
1301 yyerror_loc_range[0] = yystack.p_mark[1-yym];
1308 #line 59 "varsyntax_calc1.y"
1310 (void) printf("%15.8f\n", yystack.l_mark[-1].dval);
1314 #line 63 "varsyntax_calc1.y"
1316 (void) printf("(%15.8f, %15.8f)\n", yystack.l_mark[-1].vval.lo, yystack.l_mark[-1].vval.hi);
1320 #line 67 "varsyntax_calc1.y"
1322 dreg[yystack.l_mark[-3].ival] = yystack.l_mark[-1].dval;
1326 #line 71 "varsyntax_calc1.y"
1328 vreg[yystack.l_mark[-3].ival] = yystack.l_mark[-1].vval;
1332 #line 75 "varsyntax_calc1.y"
1338 #line 82 "varsyntax_calc1.y"
1340 yyval.dval = dreg[yystack.l_mark[0].ival]; /* $$ & $1 are sufficient here*/
1344 #line 86 "varsyntax_calc1.y"
1346 yyval.dval = yystack.l_mark[-2].dval + yystack.l_mark[0].dval;
1350 #line 90 "varsyntax_calc1.y"
1352 yyval.dval = yystack.l_mark[-2].dval - yystack.l_mark[0].dval;
1356 #line 94 "varsyntax_calc1.y"
1358 yyval.dval = yystack.l_mark[-2].dval * yystack.l_mark[0].dval;
1362 #line 98 "varsyntax_calc1.y"
1364 yyval.dval = yystack.l_mark[-2].dval / yystack.l_mark[0].dval;
1368 #line 102 "varsyntax_calc1.y"
1370 yyval.dval = -yystack.l_mark[0].dval;
1374 #line 106 "varsyntax_calc1.y"
1376 yyval.dval = yystack.l_mark[-1].dval;
1380 #line 112 "varsyntax_calc1.y"
1382 yyval.vval.hi = yyval.vval.lo = yystack.l_mark[0].dval;
1386 #line 116 "varsyntax_calc1.y"
1388 yyval.vval.lo = yystack.l_mark[-3].dval;
1389 yyval.vval.hi = yystack.l_mark[-1].dval;
1390 if ( yyval.vval.lo > yyval.vval.hi )
1392 (void) printf("interval out of order\n");
1398 #line 126 "varsyntax_calc1.y"
1400 yyval.vval = vreg[yystack.l_mark[0].ival];
1404 #line 130 "varsyntax_calc1.y"
1406 yyval.vval.hi = yystack.l_mark[-2].vval.hi + yystack.l_mark[0].vval.hi;
1407 yyval.vval.lo = yystack.l_mark[-2].vval.lo + yystack.l_mark[0].vval.lo;
1411 #line 135 "varsyntax_calc1.y"
1413 yyval.vval.hi = yystack.l_mark[-2].dval + yystack.l_mark[0].vval.hi;
1414 yyval.vval.lo = yystack.l_mark[-2].dval + yystack.l_mark[0].vval.lo;
1418 #line 140 "varsyntax_calc1.y"
1420 yyval.vval.hi = yystack.l_mark[-2].vval.hi - yystack.l_mark[0].vval.lo;
1421 yyval.vval.lo = yystack.l_mark[-2].vval.lo - yystack.l_mark[0].vval.hi;
1425 #line 145 "varsyntax_calc1.y"
1427 yyval.vval.hi = yystack.l_mark[-2].dval - yystack.l_mark[0].vval.lo;
1428 yyval.vval.lo = yystack.l_mark[-2].dval - yystack.l_mark[0].vval.hi;
1432 #line 150 "varsyntax_calc1.y"
1434 yyval.vval = vmul( yystack.l_mark[-2].vval.lo, yystack.l_mark[-2].vval.hi, yystack.l_mark[0].vval );
1438 #line 154 "varsyntax_calc1.y"
1440 yyval.vval = vmul (yystack.l_mark[-2].dval, yystack.l_mark[-2].dval, yystack.l_mark[0].vval );
1444 #line 158 "varsyntax_calc1.y"
1446 if (dcheck(yystack.l_mark[0].vval)) YYERROR;
1447 yyval.vval = vdiv ( yystack.l_mark[-2].vval.lo, yystack.l_mark[-2].vval.hi, yystack.l_mark[0].vval );
1451 #line 163 "varsyntax_calc1.y"
1453 if (dcheck ( yystack.l_mark[0].vval )) YYERROR;
1454 yyval.vval = vdiv (yystack.l_mark[-2].dval, yystack.l_mark[-2].dval, yystack.l_mark[0].vval );
1458 #line 168 "varsyntax_calc1.y"
1460 yyval.vval.hi = -yystack.l_mark[0].vval.lo;
1461 yyval.vval.lo = -yystack.l_mark[0].vval.hi;
1465 #line 173 "varsyntax_calc1.y"
1467 yyval.vval = yystack.l_mark[-1].vval;
1470 #line 1471 "varsyntax_calc1.tab.c"
1474 yystack.s_mark -= yym;
1475 yystate = *yystack.s_mark;
1476 yystack.l_mark -= yym;
1477 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1478 yystack.p_mark -= yym;
1481 if (yystate == 0 && yym == 0)
1486 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
1487 #ifdef YYSTYPE_TOSTRING
1490 #endif /* YYBTYACC */
1491 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval));
1493 fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL);
1497 *++yystack.s_mark = YYFINAL;
1498 *++yystack.l_mark = yyval;
1499 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1500 *++yystack.p_mark = yyloc;
1508 /* we're currently re-reading tokens */
1510 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1518 /* in trial mode; save scanner results for future parse attempts */
1519 if (yylvp == yylvlim)
1520 { /* Enlarge lexical value queue */
1521 size_t p = (size_t) (yylvp - yylvals);
1522 size_t s = (size_t) (yylvlim - yylvals);
1524 s += YYLVQUEUEGROWTH;
1525 if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL)
1527 if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)
1529 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1530 if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)
1533 yylvp = yylve = yylvals + p;
1534 yylvlim = yylvals + s;
1535 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1536 yylpp = yylpe = yylpsns + p;
1537 yylplim = yylpsns + s;
1539 yylexp = yylexemes + p;
1541 *yylexp = (short) YYLEX;
1544 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1551 /* normal operation, no conflict encountered */
1552 #endif /* YYBTYACC */
1556 #endif /* YYBTYACC */
1557 if (yychar < 0) yychar = YYEOF;
1558 /* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
1562 yys = yyname[YYTRANSLATE(yychar)];
1563 fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
1564 YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
1568 if (yychar == YYEOF) goto yyaccept;
1571 if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
1572 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
1573 yystate = yytable[yyn];
1575 yystate = yydgoto[yym];
1579 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
1580 #ifdef YYSTYPE_TOSTRING
1583 #endif /* YYBTYACC */
1584 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval));
1586 fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate);
1589 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1590 *++yystack.s_mark = (short) yystate;
1591 *++yystack.l_mark = yyval;
1592 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1593 *++yystack.p_mark = yyloc;
1598 /* Reduction declares that this path is valid. Set yypath and do a full parse */
1600 if (yypath) YYABORT;
1603 YYParseState *save = yyps->save;
1604 yyps->save = save->save;
1605 save->save = yypath;
1610 fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n",
1611 YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme));
1615 yyFreeState(yyerrctx);
1618 yylvp = yylvals + yypath->lexeme;
1619 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1620 yylpp = yylpsns + yypath->lexeme;
1622 yylexp = yylexemes + yypath->lexeme;
1624 yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
1625 memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
1626 yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
1627 memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1628 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1629 yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base);
1630 memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1632 yystate = yypath->state;
1634 #endif /* YYBTYACC */
1637 YYERROR_CALL("yacc stack overflow");
1641 YYERROR_CALL("memory exhausted");
1643 #endif /* YYBTYACC */
1653 if (yyps->save) goto yyvalid;
1654 #endif /* YYBTYACC */
1658 #if defined(YYDESTRUCT_CALL)
1659 if (yychar != YYEOF && yychar != YYEMPTY)
1660 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1661 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc);
1663 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval);
1664 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1668 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1671 for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp)
1672 YYDESTRUCT_CALL("cleanup: discarding state",
1673 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp);
1675 for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv)
1676 YYDESTRUCT_CALL("cleanup: discarding state",
1677 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv);
1678 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1680 #endif /* defined(YYDESTRUCT_CALL) */
1685 yyFreeState(yyerrctx);
1690 YYParseState *save = yyps;
1697 YYParseState *save = yypath;
1698 yypath = save->save;
1702 #endif /* YYBTYACC */
1703 yyfreestack(&yystack);