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"
154 typedef union YYSTYPE
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 ')'",
407 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
408 YYLTYPE yyloc; /* position returned by actions */
409 YYLTYPE yylloc; /* position from the lexer */
412 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
413 #ifndef YYLLOC_DEFAULT
414 #define YYLLOC_DEFAULT(loc, rhs, n) \
419 (loc).first_line = YYRHSLOC(rhs, 0).last_line; \
420 (loc).first_column = YYRHSLOC(rhs, 0).last_column; \
421 (loc).last_line = YYRHSLOC(rhs, 0).last_line; \
422 (loc).last_column = YYRHSLOC(rhs, 0).last_column; \
426 (loc).first_line = YYRHSLOC(rhs, 1).first_line; \
427 (loc).first_column = YYRHSLOC(rhs, 1).first_column; \
428 (loc).last_line = YYRHSLOC(rhs, n).last_line; \
429 (loc).last_column = YYRHSLOC(rhs, n).last_column; \
432 #endif /* YYLLOC_DEFAULT */
433 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
436 #ifndef YYLVQUEUEGROWTH
437 #define YYLVQUEUEGROWTH 32
439 #endif /* YYBTYACC */
441 /* define the initial stack-sizes */
444 #define YYMAXDEPTH YYSTACKSIZE
447 #define YYSTACKSIZE YYMAXDEPTH
449 #define YYSTACKSIZE 10000
450 #define YYMAXDEPTH 10000
454 #ifndef YYINITSTACKSIZE
455 #define YYINITSTACKSIZE 200
465 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
472 struct YYParseState_s
474 struct YYParseState_s *save; /* Previously saved parser state */
475 YYSTACKDATA yystack; /* saved parser stack */
476 int state; /* saved parser state */
477 int errflag; /* saved error recovery status */
478 int lexeme; /* saved index of the conflict lexeme in the lexical queue */
479 YYINT ctry; /* saved index in yyctable[] for this conflict */
481 typedef struct YYParseState_s YYParseState;
482 #endif /* YYBTYACC */
483 /* variables for the parser stack */
484 static YYSTACKDATA yystack;
487 /* Current parser state */
488 static YYParseState *yyps = 0;
490 /* yypath != NULL: do the full parse, starting at *yypath parser state. */
491 static YYParseState *yypath = 0;
493 /* Base of the lexical value queue */
494 static YYSTYPE *yylvals = 0;
496 /* Current position at lexical value queue */
497 static YYSTYPE *yylvp = 0;
499 /* End position of lexical value queue */
500 static YYSTYPE *yylve = 0;
502 /* The last allocated position at the lexical value queue */
503 static YYSTYPE *yylvlim = 0;
505 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
506 /* Base of the lexical position queue */
507 static YYLTYPE *yylpsns = 0;
509 /* Current position at lexical position queue */
510 static YYLTYPE *yylpp = 0;
512 /* End position of lexical position queue */
513 static YYLTYPE *yylpe = 0;
515 /* The last allocated position at the lexical position queue */
516 static YYLTYPE *yylplim = 0;
519 /* Current position at lexical token queue */
520 static YYINT *yylexp = 0;
522 static YYINT *yylexemes = 0;
523 #endif /* YYBTYACC */
524 #line 178 "varsyntax_calc1.y"
525 /* beginning of subroutines section */
527 #define BSZ 50 /* buffer size for floating point numbers */
529 /* lexical analysis */
532 yyerror(const char *s)
534 fprintf(stderr, "%s\n", s);
542 while ((c = getchar()) == ' ')
543 { /* skip over blanks */
548 yylval.ival = c - 'A';
553 yylval.ival = c - 'a';
557 if (isdigit(c) || c == '.')
559 /* gobble up digits, points, exponents */
560 char buf[BSZ + 1], *cp = buf;
561 int dot = 0, expr = 0;
563 for (; (cp - buf) < BSZ; ++cp, c = getchar())
572 return ('.'); /* will cause syntax error */
579 return ('e'); /* will cause syntax error */
588 if ((cp - buf) >= BSZ)
589 printf("constant too long: truncated\n");
591 ungetc(c, stdin); /* push back last char read */
592 yylval.dval = atof(buf);
599 hilo(double a, double b, double c, double d)
601 /* returns the smallest interval containing a, b, c, and d */
602 /* used by *, / routines */
634 vmul(double a, double b, INTERVAL v)
636 return (hilo(a * v.hi, a * v.lo, b * v.hi, b * v.lo));
642 if (v.hi >= 0. && v.lo <= 0.)
644 printf("divisor interval contains 0.\n");
651 vdiv(double a, double b, INTERVAL v)
653 return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo));
655 #line 656 "varsyntax_calc1.tab.c"
657 /* For use in generated program */
658 #define yydepth (int)(yystack.s_mark - yystack.s_base)
660 #define yytrial (yyps->save)
661 #endif /* YYBTYACC */
664 #include <stdio.h> /* needed for printf */
667 #include <stdlib.h> /* needed for malloc, etc */
668 #include <string.h> /* needed for memset */
670 /* allocate initial stack or double stack size, up to YYMAXDEPTH */
671 static int yygrowstack(YYSTACKDATA *data)
677 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
681 if ((newsize = data->stacksize) == 0)
682 newsize = YYINITSTACKSIZE;
683 else if (newsize >= YYMAXDEPTH)
685 else if ((newsize *= 2) > YYMAXDEPTH)
686 newsize = YYMAXDEPTH;
688 i = (int) (data->s_mark - data->s_base);
689 newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
693 data->s_base = newss;
694 data->s_mark = newss + i;
696 newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
700 data->l_base = newvs;
701 data->l_mark = newvs + i;
703 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
704 newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps));
708 data->p_base = newps;
709 data->p_mark = newps + i;
712 data->stacksize = newsize;
713 data->s_last = data->s_base + newsize - 1;
717 fprintf(stderr, "%sdebug: stack size increased to %d\n", YYPREFIX, newsize);
722 #if YYPURE || defined(YY_NO_LEAKS)
723 static void yyfreestack(YYSTACKDATA *data)
727 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
730 memset(data, 0, sizeof(*data));
733 #define yyfreestack(data) /* nothing */
734 #endif /* YYPURE || defined(YY_NO_LEAKS) */
737 static YYParseState *
738 yyNewState(unsigned size)
740 YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState));
741 if (p == NULL) return NULL;
743 p->yystack.stacksize = size;
746 p->yystack.s_base = NULL;
747 p->yystack.l_base = NULL;
748 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
749 p->yystack.p_base = NULL;
753 p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
754 if (p->yystack.s_base == NULL) return NULL;
755 p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
756 if (p->yystack.l_base == NULL) return NULL;
757 memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE));
758 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
759 p->yystack.p_base = (YYLTYPE *) malloc(size * sizeof(YYLTYPE));
760 if (p->yystack.p_base == NULL) return NULL;
761 memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE));
768 yyFreeState(YYParseState *p)
770 yyfreestack(&p->yystack);
773 #endif /* YYBTYACC */
775 #define YYABORT goto yyabort
776 #define YYREJECT goto yyabort
777 #define YYACCEPT goto yyaccept
778 #define YYERROR goto yyerrlab
780 #define YYVALID do { if (yyps->save) goto yyvalid; } while(0)
781 #define YYVALID_NESTED do { if (yyps->save && \
782 yyps->save->save == 0) goto yyvalid; } while(0)
783 #endif /* YYBTYACC */
788 int yym, yyn, yystate, yyresult;
791 YYParseState *yyerrctx = NULL;
792 #endif /* YYBTYACC */
793 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
794 YYLTYPE yyerror_loc_range[3]; /* position of error start/end (0 unused) */
799 if ((yys = getenv("YYDEBUG")) != 0)
802 if (yyn >= '0' && yyn <= '9')
806 fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX);
808 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
809 memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range));
813 yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
815 #endif /* YYBTYACC */
817 /* yyn is set below */
821 /* yystate is set below */
824 memset(&yystack, 0, sizeof(yystack));
827 if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
828 yystack.s_mark = yystack.s_base;
829 yystack.l_mark = yystack.l_base;
830 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
831 yystack.p_mark = yystack.p_base;
837 if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
844 /* we're currently re-reading tokens */
846 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
854 /* in trial mode; save scanner results for future parse attempts */
855 if (yylvp == yylvlim)
856 { /* Enlarge lexical value queue */
857 size_t p = (size_t) (yylvp - yylvals);
858 size_t s = (size_t) (yylvlim - yylvals);
860 s += YYLVQUEUEGROWTH;
861 if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem;
862 if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;
863 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
864 if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;
866 yylvp = yylve = yylvals + p;
867 yylvlim = yylvals + s;
868 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
869 yylpp = yylpe = yylpsns + p;
870 yylplim = yylpsns + s;
872 yylexp = yylexemes + p;
874 *yylexp = (YYINT) YYLEX;
877 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
884 /* normal operation, no conflict encountered */
885 #endif /* YYBTYACC */
889 #endif /* YYBTYACC */
890 if (yychar < 0) yychar = YYEOF;
894 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
895 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
896 YYDEBUGSTR, yydepth, yystate, yychar, yys);
897 #ifdef YYSTYPE_TOSTRING
900 #endif /* YYBTYACC */
901 fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval));
909 /* Do we have a conflict? */
910 if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
911 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
920 fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n",
921 YYDEBUGSTR, yydepth, yystate);
923 /* Switch to the next conflict context */
928 if (save->state != yystate) YYABORT;
935 /* Unresolved conflict - start/continue trial parse */
940 fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate);
942 fputs("ALREADY in conflict, continuing trial parse.\n", stderr);
944 fputs("Starting trial parse.\n", stderr);
947 save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
948 if (save == NULL) goto yyenomem;
949 save->save = yyps->save;
950 save->state = yystate;
951 save->errflag = yyerrflag;
952 save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
953 memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
954 save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
955 memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
956 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
957 save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base);
958 memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
961 if (yyctable[ctry] == -1)
964 if (yydebug && yychar >= YYEOF)
965 fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth);
970 if (yyps->save == NULL)
972 /* If this is a first conflict in the stack, start saving lexemes */
975 yylexemes = (YYINT *) malloc((YYLVQUEUEGROWTH) * sizeof(YYINT));
976 if (yylexemes == NULL) goto yyenomem;
977 yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE));
978 if (yylvals == NULL) goto yyenomem;
979 yylvlim = yylvals + YYLVQUEUEGROWTH;
980 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
981 yylpsns = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE));
982 if (yylpsns == NULL) goto yyenomem;
983 yylplim = yylpsns + YYLVQUEUEGROWTH;
988 yylvp = yylve = yylvals;
989 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
990 yylpp = yylpe = yylpsns;
996 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
999 *yylexp = (YYINT) yychar;
1004 if (yychar >= YYEOF)
1007 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1013 save->lexeme = (int) (yylvp - yylvals);
1016 if (yytable[yyn] == ctry)
1020 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
1021 YYDEBUGSTR, yydepth, yystate, yyctable[ctry]);
1026 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1031 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
1033 yystate = yyctable[ctry];
1034 *++yystack.s_mark = (YYINT) yystate;
1035 *++yystack.l_mark = yylval;
1036 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1037 *++yystack.p_mark = yylloc;
1040 if (yyerrflag > 0) --yyerrflag;
1045 yyn = yyctable[ctry];
1048 } /* End of code dealing with conflicts */
1049 #endif /* YYBTYACC */
1050 if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1051 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1055 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
1056 YYDEBUGSTR, yydepth, yystate, yytable[yyn]);
1058 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1059 yystate = yytable[yyn];
1060 *++yystack.s_mark = yytable[yyn];
1061 *++yystack.l_mark = yylval;
1062 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1063 *++yystack.p_mark = yylloc;
1066 if (yyerrflag > 0) --yyerrflag;
1069 if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1070 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1075 if (yyerrflag != 0) goto yyinrecovery;
1080 goto yyerrlab; /* redundant goto avoids 'unused label' warning */
1083 /* explicit YYERROR from an action -- pop the rhs of the rule reduced
1084 * before looking for error recovery */
1085 yystack.s_mark -= yym;
1086 yystate = *yystack.s_mark;
1087 yystack.l_mark -= yym;
1088 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1089 yystack.p_mark -= yym;
1097 YYParseState *save = yyps->save;
1100 fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n",
1101 YYDEBUGSTR, yydepth, yystate, yyps->save->state,
1102 (int)(yylvp - yylvals - yyps->save->lexeme));
1104 /* Memorize most forward-looking error state in case it's really an error. */
1105 if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals)
1107 /* Free old saved error context state */
1108 if (yyerrctx) yyFreeState(yyerrctx);
1109 /* Create and fill out new saved error context state */
1110 yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
1111 if (yyerrctx == NULL) goto yyenomem;
1112 yyerrctx->save = yyps->save;
1113 yyerrctx->state = yystate;
1114 yyerrctx->errflag = yyerrflag;
1115 yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
1116 memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1117 yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
1118 memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1119 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1120 yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base);
1121 memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1123 yyerrctx->lexeme = (int) (yylvp - yylvals);
1125 yylvp = yylvals + save->lexeme;
1126 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1127 yylpp = yylpsns + save->lexeme;
1129 yylexp = yylexemes + save->lexeme;
1131 yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
1132 memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1133 yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
1134 memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1135 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1136 yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base);
1137 memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1139 ctry = ++save->ctry;
1140 yystate = save->state;
1141 /* We tried shift, try reduce now */
1142 if ((yyn = yyctable[ctry]) >= 0) goto yyreduce;
1143 yyps->save = save->save;
1147 /* Nothing left on the stack -- error */
1152 fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n",
1155 /* Restore state as it was in the most forward-advanced error */
1156 yylvp = yylvals + yyerrctx->lexeme;
1157 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1158 yylpp = yylpsns + yyerrctx->lexeme;
1160 yylexp = yylexemes + yyerrctx->lexeme;
1161 yychar = yylexp[-1];
1163 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1166 yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
1167 memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1168 yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
1169 memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1170 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1171 yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base);
1172 memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1174 yystate = yyerrctx->state;
1175 yyFreeState(yyerrctx);
1180 if (yynewerrflag == 0) goto yyinrecovery;
1181 #endif /* YYBTYACC */
1183 YYERROR_CALL("syntax error");
1184 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1185 yyerror_loc_range[1] = yylloc; /* lookahead position is error start position */
1189 goto yyerrlab; /* redundant goto avoids 'unused label' warning */
1200 if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
1201 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
1205 fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n",
1206 YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]);
1208 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1209 yystate = yytable[yyn];
1210 *++yystack.s_mark = yytable[yyn];
1211 *++yystack.l_mark = yylval;
1212 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1213 /* lookahead position is error end position */
1214 yyerror_loc_range[2] = yylloc;
1215 YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */
1216 *++yystack.p_mark = yyloc;
1224 fprintf(stderr, "%s[%d]: error recovery discarding state %d\n",
1225 YYDEBUGSTR, yydepth, *yystack.s_mark);
1227 if (yystack.s_mark <= yystack.s_base) goto yyabort;
1228 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1229 /* the current TOS position is the error start position */
1230 yyerror_loc_range[1] = *yystack.p_mark;
1232 #if defined(YYDESTRUCT_CALL)
1235 #endif /* YYBTYACC */
1236 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1237 YYDESTRUCT_CALL("error: discarding state",
1238 yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark);
1240 YYDESTRUCT_CALL("error: discarding state",
1241 yystos[*yystack.s_mark], yystack.l_mark);
1242 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1243 #endif /* defined(YYDESTRUCT_CALL) */
1246 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1254 if (yychar == YYEOF) goto yyabort;
1258 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
1259 fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
1260 YYDEBUGSTR, yydepth, yystate, yychar, yys);
1263 #if defined(YYDESTRUCT_CALL)
1266 #endif /* YYBTYACC */
1267 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1268 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc);
1270 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval);
1271 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1272 #endif /* defined(YYDESTRUCT_CALL) */
1282 fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)",
1283 YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]);
1284 #ifdef YYSTYPE_TOSTRING
1287 #endif /* YYBTYACC */
1292 for (i = yym; i > 0; i--)
1294 if (i != yym) fputs(", ", stderr);
1295 fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]],
1296 yystack.l_mark[1-i]), stderr);
1301 fputc('\n', stderr);
1305 yyval = yystack.l_mark[1-yym];
1307 memset(&yyval, 0, sizeof yyval);
1308 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1310 /* Perform position reduction */
1311 memset(&yyloc, 0, sizeof(yyloc));
1314 #endif /* YYBTYACC */
1316 YYLLOC_DEFAULT(yyloc, &yystack.p_mark[-yym], yym);
1317 /* just in case YYERROR is invoked within the action, save
1318 the start of the rhs as the error start position */
1319 yyerror_loc_range[1] = yystack.p_mark[1-yym];
1326 #line 59 "varsyntax_calc1.y"
1328 (void) printf("%15.8f\n", yystack.l_mark[-1].dval);
1332 #line 63 "varsyntax_calc1.y"
1334 (void) printf("(%15.8f, %15.8f)\n", yystack.l_mark[-1].vval.lo, yystack.l_mark[-1].vval.hi);
1338 #line 67 "varsyntax_calc1.y"
1340 dreg[yystack.l_mark[-3].ival] = yystack.l_mark[-1].dval;
1344 #line 71 "varsyntax_calc1.y"
1346 vreg[yystack.l_mark[-3].ival] = yystack.l_mark[-1].vval;
1350 #line 75 "varsyntax_calc1.y"
1356 #line 82 "varsyntax_calc1.y"
1358 yyval.dval = dreg[yystack.l_mark[0].ival]; /* $$ & $1 are sufficient here*/
1362 #line 86 "varsyntax_calc1.y"
1364 yyval.dval = yystack.l_mark[-2].dval + yystack.l_mark[0].dval;
1368 #line 90 "varsyntax_calc1.y"
1370 yyval.dval = yystack.l_mark[-2].dval - yystack.l_mark[0].dval;
1374 #line 94 "varsyntax_calc1.y"
1376 yyval.dval = yystack.l_mark[-2].dval * yystack.l_mark[0].dval;
1380 #line 98 "varsyntax_calc1.y"
1382 yyval.dval = yystack.l_mark[-2].dval / yystack.l_mark[0].dval;
1386 #line 102 "varsyntax_calc1.y"
1388 yyval.dval = -yystack.l_mark[0].dval;
1392 #line 106 "varsyntax_calc1.y"
1394 yyval.dval = yystack.l_mark[-1].dval;
1398 #line 112 "varsyntax_calc1.y"
1400 yyval.vval.hi = yyval.vval.lo = yystack.l_mark[0].dval;
1404 #line 116 "varsyntax_calc1.y"
1406 yyval.vval.lo = yystack.l_mark[-3].dval;
1407 yyval.vval.hi = yystack.l_mark[-1].dval;
1408 if ( yyval.vval.lo > yyval.vval.hi )
1410 (void) printf("interval out of order\n");
1416 #line 126 "varsyntax_calc1.y"
1418 yyval.vval = vreg[yystack.l_mark[0].ival];
1422 #line 130 "varsyntax_calc1.y"
1424 yyval.vval.hi = yystack.l_mark[-2].vval.hi + yystack.l_mark[0].vval.hi;
1425 yyval.vval.lo = yystack.l_mark[-2].vval.lo + yystack.l_mark[0].vval.lo;
1429 #line 135 "varsyntax_calc1.y"
1431 yyval.vval.hi = yystack.l_mark[-2].dval + yystack.l_mark[0].vval.hi;
1432 yyval.vval.lo = yystack.l_mark[-2].dval + yystack.l_mark[0].vval.lo;
1436 #line 140 "varsyntax_calc1.y"
1438 yyval.vval.hi = yystack.l_mark[-2].vval.hi - yystack.l_mark[0].vval.lo;
1439 yyval.vval.lo = yystack.l_mark[-2].vval.lo - yystack.l_mark[0].vval.hi;
1443 #line 145 "varsyntax_calc1.y"
1445 yyval.vval.hi = yystack.l_mark[-2].dval - yystack.l_mark[0].vval.lo;
1446 yyval.vval.lo = yystack.l_mark[-2].dval - yystack.l_mark[0].vval.hi;
1450 #line 150 "varsyntax_calc1.y"
1452 yyval.vval = vmul( yystack.l_mark[-2].vval.lo, yystack.l_mark[-2].vval.hi, yystack.l_mark[0].vval );
1456 #line 154 "varsyntax_calc1.y"
1458 yyval.vval = vmul (yystack.l_mark[-2].dval, yystack.l_mark[-2].dval, yystack.l_mark[0].vval );
1462 #line 158 "varsyntax_calc1.y"
1464 if (dcheck(yystack.l_mark[0].vval)) YYERROR;
1465 yyval.vval = vdiv ( yystack.l_mark[-2].vval.lo, yystack.l_mark[-2].vval.hi, yystack.l_mark[0].vval );
1469 #line 163 "varsyntax_calc1.y"
1471 if (dcheck ( yystack.l_mark[0].vval )) YYERROR;
1472 yyval.vval = vdiv (yystack.l_mark[-2].dval, yystack.l_mark[-2].dval, yystack.l_mark[0].vval );
1476 #line 168 "varsyntax_calc1.y"
1478 yyval.vval.hi = -yystack.l_mark[0].vval.lo;
1479 yyval.vval.lo = -yystack.l_mark[0].vval.hi;
1483 #line 173 "varsyntax_calc1.y"
1485 yyval.vval = yystack.l_mark[-1].vval;
1488 #line 1489 "varsyntax_calc1.tab.c"
1492 yystack.s_mark -= yym;
1493 yystate = *yystack.s_mark;
1494 yystack.l_mark -= yym;
1495 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1496 yystack.p_mark -= yym;
1499 if (yystate == 0 && yym == 0)
1504 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
1505 #ifdef YYSTYPE_TOSTRING
1508 #endif /* YYBTYACC */
1509 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval));
1511 fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL);
1515 *++yystack.s_mark = YYFINAL;
1516 *++yystack.l_mark = yyval;
1517 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1518 *++yystack.p_mark = yyloc;
1526 /* we're currently re-reading tokens */
1528 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1536 /* in trial mode; save scanner results for future parse attempts */
1537 if (yylvp == yylvlim)
1538 { /* Enlarge lexical value queue */
1539 size_t p = (size_t) (yylvp - yylvals);
1540 size_t s = (size_t) (yylvlim - yylvals);
1542 s += YYLVQUEUEGROWTH;
1543 if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL)
1545 if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)
1547 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1548 if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)
1551 yylvp = yylve = yylvals + p;
1552 yylvlim = yylvals + s;
1553 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1554 yylpp = yylpe = yylpsns + p;
1555 yylplim = yylpsns + s;
1557 yylexp = yylexemes + p;
1559 *yylexp = (YYINT) YYLEX;
1562 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1569 /* normal operation, no conflict encountered */
1570 #endif /* YYBTYACC */
1574 #endif /* YYBTYACC */
1575 if (yychar < 0) yychar = YYEOF;
1579 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
1580 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
1581 YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
1585 if (yychar == YYEOF) goto yyaccept;
1588 if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
1589 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
1590 yystate = yytable[yyn];
1592 yystate = yydgoto[yym];
1596 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
1597 #ifdef YYSTYPE_TOSTRING
1600 #endif /* YYBTYACC */
1601 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval));
1603 fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate);
1606 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1607 *++yystack.s_mark = (YYINT) yystate;
1608 *++yystack.l_mark = yyval;
1609 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1610 *++yystack.p_mark = yyloc;
1615 /* Reduction declares that this path is valid. Set yypath and do a full parse */
1617 if (yypath) YYABORT;
1620 YYParseState *save = yyps->save;
1621 yyps->save = save->save;
1622 save->save = yypath;
1627 fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n",
1628 YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme));
1632 yyFreeState(yyerrctx);
1635 yylvp = yylvals + yypath->lexeme;
1636 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1637 yylpp = yylpsns + yypath->lexeme;
1639 yylexp = yylexemes + yypath->lexeme;
1641 yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
1642 memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1643 yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
1644 memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1645 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1646 yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base);
1647 memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1649 yystate = yypath->state;
1651 #endif /* YYBTYACC */
1654 YYERROR_CALL("yacc stack overflow");
1658 YYERROR_CALL("memory exhausted");
1660 #endif /* YYBTYACC */
1670 if (yyps->save) goto yyvalid;
1671 #endif /* YYBTYACC */
1675 #if defined(YYDESTRUCT_CALL)
1676 if (yychar != YYEOF && yychar != YYEMPTY)
1677 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1678 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc);
1680 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval);
1681 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1685 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1688 for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp)
1689 YYDESTRUCT_CALL("cleanup: discarding state",
1690 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp);
1692 for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv)
1693 YYDESTRUCT_CALL("cleanup: discarding state",
1694 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv);
1695 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1697 #endif /* defined(YYDESTRUCT_CALL) */
1702 yyFreeState(yyerrctx);
1707 YYParseState *save = yyps;
1714 YYParseState *save = yypath;
1715 yypath = save->save;
1719 #endif /* YYBTYACC */
1720 yyfreestack(&yystack);