1 /* original parser id follows */ 2 /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */ 4 5 #define YYBYACC 1 6 #define YYMAJOR 1 7 #define YYMINOR 9 8 #define YYCHECK "yyyymmdd" 9 10 #define YYEMPTY (-1) 11 #define yyclearin (yychar = YYEMPTY) 12 #define yyerrok (yyerrflag = 0) 13 #define YYRECOVERING() (yyerrflag != 0) 14 #define YYENOMEM (-2) 15 #define YYEOF 0 16 #undef YYBTYACC 17 #define YYBTYACC 0 18 #define YYDEBUGSTR YYPREFIX "debug" 19 20 #ifndef yyparse 21 #define yyparse error_parse 22 #endif /* yyparse */ 23 24 #ifndef yylex 25 #define yylex error_lex 26 #endif /* yylex */ 27 28 #ifndef yyerror 29 #define yyerror error_error 30 #endif /* yyerror */ 31 32 #ifndef yychar 33 #define yychar error_char 34 #endif /* yychar */ 35 36 #ifndef yyval 37 #define yyval error_val 38 #endif /* yyval */ 39 40 #ifndef yylval 41 #define yylval error_lval 42 #endif /* yylval */ 43 44 #ifndef yydebug 45 #define yydebug error_debug 46 #endif /* yydebug */ 47 48 #ifndef yynerrs 49 #define yynerrs error_nerrs 50 #endif /* yynerrs */ 51 52 #ifndef yyerrflag 53 #define yyerrflag error_errflag 54 #endif /* yyerrflag */ 55 56 #ifndef yylhs 57 #define yylhs error_lhs 58 #endif /* yylhs */ 59 60 #ifndef yylen 61 #define yylen error_len 62 #endif /* yylen */ 63 64 #ifndef yydefred 65 #define yydefred error_defred 66 #endif /* yydefred */ 67 68 #ifndef yystos 69 #define yystos error_stos 70 #endif /* yystos */ 71 72 #ifndef yydgoto 73 #define yydgoto error_dgoto 74 #endif /* yydgoto */ 75 76 #ifndef yysindex 77 #define yysindex error_sindex 78 #endif /* yysindex */ 79 80 #ifndef yyrindex 81 #define yyrindex error_rindex 82 #endif /* yyrindex */ 83 84 #ifndef yygindex 85 #define yygindex error_gindex 86 #endif /* yygindex */ 87 88 #ifndef yytable 89 #define yytable error_table 90 #endif /* yytable */ 91 92 #ifndef yycheck 93 #define yycheck error_check 94 #endif /* yycheck */ 95 96 #ifndef yyname 97 #define yyname error_name 98 #endif /* yyname */ 99 100 #ifndef yyrule 101 #define yyrule error_rule 102 #endif /* yyrule */ 103 104 #if YYBTYACC 105 106 #ifndef yycindex 107 #define yycindex error_cindex 108 #endif /* yycindex */ 109 110 #ifndef yyctable 111 #define yyctable error_ctable 112 #endif /* yyctable */ 113 114 #endif /* YYBTYACC */ 115 116 #define YYPREFIX "error_" 117 118 #define YYPURE 0 119 120 #line 2 "error.y" 121 int yylex(void); 122 static void yyerror(const char *); 123 #line 124 "error.tab.c" 124 125 #if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED) 126 /* Default: YYSTYPE is the semantic value type. */ 127 typedef int YYSTYPE; 128 # define YYSTYPE_IS_DECLARED 1 129 #endif 130 131 /* compatibility with bison */ 132 #ifdef YYPARSE_PARAM 133 /* compatibility with FreeBSD */ 134 # ifdef YYPARSE_PARAM_TYPE 135 # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) 136 # else 137 # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) 138 # endif 139 #else 140 # define YYPARSE_DECL() yyparse(void) 141 #endif 142 143 /* Parameters sent to lex. */ 144 #ifdef YYLEX_PARAM 145 # define YYLEX_DECL() yylex(void *YYLEX_PARAM) 146 # define YYLEX yylex(YYLEX_PARAM) 147 #else 148 # define YYLEX_DECL() yylex(void) 149 # define YYLEX yylex() 150 #endif 151 152 /* Parameters sent to yyerror. */ 153 #ifndef YYERROR_DECL 154 #define YYERROR_DECL() yyerror(const char *s) 155 #endif 156 #ifndef YYERROR_CALL 157 #define YYERROR_CALL(msg) yyerror(msg) 158 #endif 159 160 extern int YYPARSE_DECL(); 161 162 #define YYERRCODE 256 163 typedef short YYINT; 164 static const YYINT error_lhs[] = { -1, 165 0, 166 }; 167 static const YYINT error_len[] = { 2, 168 1, 169 }; 170 static const YYINT error_defred[] = { 0, 171 1, 0, 172 }; 173 static const YYINT error_stos[] = { 0, 174 256, 258, 175 }; 176 static const YYINT error_dgoto[] = { 2, 177 }; 178 static const YYINT error_sindex[] = { -256, 179 0, 0, 180 }; 181 static const YYINT error_rindex[] = { 0, 182 0, 0, 183 }; 184 #if YYBTYACC 185 static const YYINT error_cindex[] = { 0, 186 0, 0, 187 }; 188 #endif 189 static const YYINT error_gindex[] = { 0, 190 }; 191 #define YYTABLESIZE 0 192 static const YYINT error_table[] = { 1, 193 }; 194 static const YYINT error_check[] = { 256, 195 }; 196 #if YYBTYACC 197 static const YYINT error_ctable[] = { -1, 198 }; 199 #endif 200 #define YYFINAL 2 201 #ifndef YYDEBUG 202 #define YYDEBUG 0 203 #endif 204 #define YYMAXTOKEN 256 205 #define YYUNDFTOKEN 259 206 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a)) 207 #if YYDEBUG 208 static const char *const error_name[] = { 209 210 "$end",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 211 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 212 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 213 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 214 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 215 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 216 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"error","$accept","S","illegal-symbol", 217 }; 218 static const char *const error_rule[] = { 219 "$accept : S", 220 "S : error", 221 222 }; 223 #endif 224 225 int yydebug; 226 int yynerrs; 227 228 int yyerrflag; 229 int yychar; 230 YYSTYPE yyval; 231 YYSTYPE yylval; 232 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 233 YYLTYPE yyloc; /* position returned by actions */ 234 YYLTYPE yylloc; /* position from the lexer */ 235 #endif 236 237 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 238 #ifndef YYLLOC_DEFAULT 239 #define YYLLOC_DEFAULT(loc, rhs, n) \ 240 do \ 241 { \ 242 if (n == 0) \ 243 { \ 244 (loc).first_line = ((rhs)[-1]).last_line; \ 245 (loc).first_column = ((rhs)[-1]).last_column; \ 246 (loc).last_line = ((rhs)[-1]).last_line; \ 247 (loc).last_column = ((rhs)[-1]).last_column; \ 248 } \ 249 else \ 250 { \ 251 (loc).first_line = ((rhs)[ 0 ]).first_line; \ 252 (loc).first_column = ((rhs)[ 0 ]).first_column; \ 253 (loc).last_line = ((rhs)[n-1]).last_line; \ 254 (loc).last_column = ((rhs)[n-1]).last_column; \ 255 } \ 256 } while (0) 257 #endif /* YYLLOC_DEFAULT */ 258 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 259 #if YYBTYACC 260 261 #ifndef YYLVQUEUEGROWTH 262 #define YYLVQUEUEGROWTH 32 263 #endif 264 #endif /* YYBTYACC */ 265 266 /* define the initial stack-sizes */ 267 #ifdef YYSTACKSIZE 268 #undef YYMAXDEPTH 269 #define YYMAXDEPTH YYSTACKSIZE 270 #else 271 #ifdef YYMAXDEPTH 272 #define YYSTACKSIZE YYMAXDEPTH 273 #else 274 #define YYSTACKSIZE 10000 275 #define YYMAXDEPTH 10000 276 #endif 277 #endif 278 279 #ifndef YYINITSTACKSIZE 280 #define YYINITSTACKSIZE 200 281 #endif 282 283 typedef struct { 284 unsigned stacksize; 285 short *s_base; 286 short *s_mark; 287 short *s_last; 288 YYSTYPE *l_base; 289 YYSTYPE *l_mark; 290 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 291 YYLTYPE *p_base; 292 YYLTYPE *p_mark; 293 #endif 294 } YYSTACKDATA; 295 #if YYBTYACC 296 297 struct YYParseState_s 298 { 299 struct YYParseState_s *save; /* Previously saved parser state */ 300 YYSTACKDATA yystack; /* saved parser stack */ 301 int state; /* saved parser state */ 302 int errflag; /* saved error recovery status */ 303 int lexeme; /* saved index of the conflict lexeme in the lexical queue */ 304 YYINT ctry; /* saved index in yyctable[] for this conflict */ 305 }; 306 typedef struct YYParseState_s YYParseState; 307 #endif /* YYBTYACC */ 308 /* variables for the parser stack */ 309 static YYSTACKDATA yystack; 310 #if YYBTYACC 311 312 /* Current parser state */ 313 static YYParseState *yyps = 0; 314 315 /* yypath != NULL: do the full parse, starting at *yypath parser state. */ 316 static YYParseState *yypath = 0; 317 318 /* Base of the lexical value queue */ 319 static YYSTYPE *yylvals = 0; 320 321 /* Current position at lexical value queue */ 322 static YYSTYPE *yylvp = 0; 323 324 /* End position of lexical value queue */ 325 static YYSTYPE *yylve = 0; 326 327 /* The last allocated position at the lexical value queue */ 328 static YYSTYPE *yylvlim = 0; 329 330 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 331 /* Base of the lexical position queue */ 332 static YYLTYPE *yylpsns = 0; 333 334 /* Current position at lexical position queue */ 335 static YYLTYPE *yylpp = 0; 336 337 /* End position of lexical position queue */ 338 static YYLTYPE *yylpe = 0; 339 340 /* The last allocated position at the lexical position queue */ 341 static YYLTYPE *yylplim = 0; 342 #endif 343 344 /* Current position at lexical token queue */ 345 static short *yylexp = 0; 346 347 static short *yylexemes = 0; 348 #endif /* YYBTYACC */ 349 #line 8 "error.y" 350 351 #include <stdio.h> 352 353 int 354 main(void) 355 { 356 printf("yyparse() = %d\n", yyparse()); 357 return 0; 358 } 359 360 int 361 yylex(void) 362 { 363 return -1; 364 } 365 366 static void 367 yyerror(const char* s) 368 { 369 printf("%s\n", s); 370 } 371 #line 372 "error.tab.c" 372 373 /* For use in generated program */ 374 #define yydepth (int)(yystack.s_mark - yystack.s_base) 375 #if YYBTYACC 376 #define yytrial (yyps->save) 377 #endif /* YYBTYACC */ 378 379 #if YYDEBUG 380 #include <stdio.h> /* needed for printf */ 381 #endif 382 383 #include <stdlib.h> /* needed for malloc, etc */ 384 #include <string.h> /* needed for memset */ 385 386 /* allocate initial stack or double stack size, up to YYMAXDEPTH */ 387 static int yygrowstack(YYSTACKDATA *data) 388 { 389 int i; 390 unsigned newsize; 391 short *newss; 392 YYSTYPE *newvs; 393 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 394 YYLTYPE *newps; 395 #endif 396 397 if ((newsize = data->stacksize) == 0) 398 newsize = YYINITSTACKSIZE; 399 else if (newsize >= YYMAXDEPTH) 400 return YYENOMEM; 401 else if ((newsize *= 2) > YYMAXDEPTH) 402 newsize = YYMAXDEPTH; 403 404 i = (int) (data->s_mark - data->s_base); 405 newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); 406 if (newss == 0) 407 return YYENOMEM; 408 409 data->s_base = newss; 410 data->s_mark = newss + i; 411 412 newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); 413 if (newvs == 0) 414 return YYENOMEM; 415 416 data->l_base = newvs; 417 data->l_mark = newvs + i; 418 419 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 420 newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); 421 if (newps == 0) 422 return YYENOMEM; 423 424 data->p_base = newps; 425 data->p_mark = newps + i; 426 #endif 427 428 data->stacksize = newsize; 429 data->s_last = data->s_base + newsize - 1; 430 431 #if YYDEBUG 432 if (yydebug) 433 fprintf(stderr, "%sdebug: stack size increased to %d\n", YYPREFIX, newsize); 434 #endif 435 return 0; 436 } 437 438 #if YYPURE || defined(YY_NO_LEAKS) 439 static void yyfreestack(YYSTACKDATA *data) 440 { 441 free(data->s_base); 442 free(data->l_base); 443 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 444 free(data->p_base); 445 #endif 446 memset(data, 0, sizeof(*data)); 447 } 448 #else 449 #define yyfreestack(data) /* nothing */ 450 #endif /* YYPURE || defined(YY_NO_LEAKS) */ 451 #if YYBTYACC 452 453 static YYParseState * 454 yyNewState(unsigned size) 455 { 456 YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState)); 457 if (p == NULL) return NULL; 458 459 p->yystack.stacksize = size; 460 if (size == 0) 461 { 462 p->yystack.s_base = NULL; 463 p->yystack.l_base = NULL; 464 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 465 p->yystack.p_base = NULL; 466 #endif 467 return p; 468 } 469 p->yystack.s_base = (short *) malloc(size * sizeof(short)); 470 if (p->yystack.s_base == NULL) return NULL; 471 p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE)); 472 if (p->yystack.l_base == NULL) return NULL; 473 memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE)); 474 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 475 p->yystack.p_base = (YYLTYPE *) malloc(size * sizeof(YYLTYPE)); 476 if (p->yystack.p_base == NULL) return NULL; 477 memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE)); 478 #endif 479 480 return p; 481 } 482 483 static void 484 yyFreeState(YYParseState *p) 485 { 486 yyfreestack(&p->yystack); 487 free(p); 488 } 489 #endif /* YYBTYACC */ 490 491 #define YYABORT goto yyabort 492 #define YYREJECT goto yyabort 493 #define YYACCEPT goto yyaccept 494 #define YYERROR goto yyerrlab 495 #if YYBTYACC 496 #define YYVALID do { if (yyps->save) goto yyvalid; } while(0) 497 #define YYVALID_NESTED do { if (yyps->save && \ 498 yyps->save->save == 0) goto yyvalid; } while(0) 499 #endif /* YYBTYACC */ 500 501 int 502 YYPARSE_DECL() 503 { 504 int yym, yyn, yystate, yyresult; 505 #if YYBTYACC 506 int yynewerrflag; 507 YYParseState *yyerrctx = NULL; 508 #endif /* YYBTYACC */ 509 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 510 YYLTYPE yyerror_loc_range[2]; /* position of error start & end */ 511 #endif 512 #if YYDEBUG 513 const char *yys; 514 515 if ((yys = getenv("YYDEBUG")) != 0) 516 { 517 yyn = *yys; 518 if (yyn >= '0' && yyn <= '9') 519 yydebug = yyn - '0'; 520 } 521 if (yydebug) 522 fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); 523 #endif 524 525 #if YYBTYACC 526 yyps = yyNewState(0); if (yyps == 0) goto yyenomem; 527 yyps->save = 0; 528 #endif /* YYBTYACC */ 529 yynerrs = 0; 530 yyerrflag = 0; 531 yychar = YYEMPTY; 532 yystate = 0; 533 534 #if YYPURE 535 memset(&yystack, 0, sizeof(yystack)); 536 #endif 537 538 if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 539 yystack.s_mark = yystack.s_base; 540 yystack.l_mark = yystack.l_base; 541 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 542 yystack.p_mark = yystack.p_base; 543 #endif 544 yystate = 0; 545 *yystack.s_mark = 0; 546 547 yyloop: 548 if ((yyn = yydefred[yystate]) != 0) goto yyreduce; 549 if (yychar < 0) 550 { 551 #if YYBTYACC 552 do { 553 if (yylvp < yylve) 554 { 555 /* we're currently re-reading tokens */ 556 yylval = *yylvp++; 557 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 558 yylloc = *yylpp++; 559 #endif 560 yychar = *yylexp++; 561 break; 562 } 563 if (yyps->save) 564 { 565 /* in trial mode; save scanner results for future parse attempts */ 566 if (yylvp == yylvlim) 567 { /* Enlarge lexical value queue */ 568 size_t p = (size_t) (yylvp - yylvals); 569 size_t s = (size_t) (yylvlim - yylvals); 570 571 s += YYLVQUEUEGROWTH; 572 if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; 573 if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; 574 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 575 if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; 576 #endif 577 yylvp = yylve = yylvals + p; 578 yylvlim = yylvals + s; 579 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 580 yylpp = yylpe = yylpsns + p; 581 yylplim = yylpsns + s; 582 #endif 583 yylexp = yylexemes + p; 584 } 585 *yylexp = (short) YYLEX; 586 *yylvp++ = yylval; 587 yylve++; 588 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 589 *yylpp++ = yylloc; 590 yylpe++; 591 #endif 592 yychar = *yylexp++; 593 break; 594 } 595 /* normal operation, no conflict encountered */ 596 #endif /* YYBTYACC */ 597 yychar = YYLEX; 598 #if YYBTYACC 599 } while (0); 600 #endif /* YYBTYACC */ 601 if (yychar < 0) yychar = YYEOF; 602 /* if ((yychar = YYLEX) < 0) yychar = YYEOF; */ 603 #if YYDEBUG 604 if (yydebug) 605 { 606 yys = yyname[YYTRANSLATE(yychar)]; 607 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)", 608 YYDEBUGSTR, yydepth, yystate, yychar, yys); 609 #ifdef YYSTYPE_TOSTRING 610 #if YYBTYACC 611 if (!yytrial) 612 #endif /* YYBTYACC */ 613 fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval)); 614 #endif 615 fputc('\n', stderr); 616 } 617 #endif 618 } 619 #if YYBTYACC 620 621 /* Do we have a conflict? */ 622 if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 && 623 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) 624 { 625 YYINT ctry; 626 627 if (yypath) 628 { 629 YYParseState *save; 630 #if YYDEBUG 631 if (yydebug) 632 fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n", 633 YYDEBUGSTR, yydepth, yystate); 634 #endif 635 /* Switch to the next conflict context */ 636 save = yypath; 637 yypath = save->save; 638 save->save = NULL; 639 ctry = save->ctry; 640 if (save->state != yystate) YYABORT; 641 yyFreeState(save); 642 643 } 644 else 645 { 646 647 /* Unresolved conflict - start/continue trial parse */ 648 YYParseState *save; 649 #if YYDEBUG 650 if (yydebug) 651 { 652 fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate); 653 if (yyps->save) 654 fputs("ALREADY in conflict, continuing trial parse.\n", stderr); 655 else 656 fputs("Starting trial parse.\n", stderr); 657 } 658 #endif 659 save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1)); 660 if (save == NULL) goto yyenomem; 661 save->save = yyps->save; 662 save->state = yystate; 663 save->errflag = yyerrflag; 664 save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base); 665 memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short)); 666 save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base); 667 memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 668 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 669 save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base); 670 memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 671 #endif 672 ctry = yytable[yyn]; 673 if (yyctable[ctry] == -1) 674 { 675 #if YYDEBUG 676 if (yydebug && yychar >= YYEOF) 677 fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth); 678 #endif 679 ctry++; 680 } 681 save->ctry = ctry; 682 if (yyps->save == NULL) 683 { 684 /* If this is a first conflict in the stack, start saving lexemes */ 685 if (!yylexemes) 686 { 687 yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); 688 if (yylexemes == NULL) goto yyenomem; 689 yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); 690 if (yylvals == NULL) goto yyenomem; 691 yylvlim = yylvals + YYLVQUEUEGROWTH; 692 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 693 yylpsns = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE)); 694 if (yylpsns == NULL) goto yyenomem; 695 yylplim = yylpsns + YYLVQUEUEGROWTH; 696 #endif 697 } 698 if (yylvp == yylve) 699 { 700 yylvp = yylve = yylvals; 701 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 702 yylpp = yylpe = yylpsns; 703 #endif 704 yylexp = yylexemes; 705 if (yychar >= YYEOF) 706 { 707 *yylve++ = yylval; 708 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 709 *yylpe++ = yylloc; 710 #endif 711 *yylexp = (short) yychar; 712 yychar = YYEMPTY; 713 } 714 } 715 } 716 if (yychar >= YYEOF) 717 { 718 yylvp--; 719 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 720 yylpp--; 721 #endif 722 yylexp--; 723 yychar = YYEMPTY; 724 } 725 save->lexeme = (int) (yylvp - yylvals); 726 yyps->save = save; 727 } 728 if (yytable[yyn] == ctry) 729 { 730 #if YYDEBUG 731 if (yydebug) 732 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n", 733 YYDEBUGSTR, yydepth, yystate, yyctable[ctry]); 734 #endif 735 if (yychar < 0) 736 { 737 yylvp++; 738 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 739 yylpp++; 740 #endif 741 yylexp++; 742 } 743 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) 744 goto yyoverflow; 745 yystate = yyctable[ctry]; 746 *++yystack.s_mark = (short) yystate; 747 *++yystack.l_mark = yylval; 748 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 749 *++yystack.p_mark = yylloc; 750 #endif 751 yychar = YYEMPTY; 752 if (yyerrflag > 0) --yyerrflag; 753 goto yyloop; 754 } 755 else 756 { 757 yyn = yyctable[ctry]; 758 goto yyreduce; 759 } 760 } /* End of code dealing with conflicts */ 761 #endif /* YYBTYACC */ 762 if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 && 763 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) 764 { 765 #if YYDEBUG 766 if (yydebug) 767 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n", 768 YYDEBUGSTR, yydepth, yystate, yytable[yyn]); 769 #endif 770 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 771 yystate = yytable[yyn]; 772 *++yystack.s_mark = yytable[yyn]; 773 *++yystack.l_mark = yylval; 774 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 775 *++yystack.p_mark = yylloc; 776 #endif 777 yychar = YYEMPTY; 778 if (yyerrflag > 0) --yyerrflag; 779 goto yyloop; 780 } 781 if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 && 782 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) 783 { 784 yyn = yytable[yyn]; 785 goto yyreduce; 786 } 787 if (yyerrflag != 0) goto yyinrecovery; 788 #if YYBTYACC 789 790 yynewerrflag = 1; 791 goto yyerrhandler; 792 goto yyerrlab; 793 794 yyerrlab: 795 yynewerrflag = 0; 796 yyerrhandler: 797 while (yyps->save) 798 { 799 int ctry; 800 YYParseState *save = yyps->save; 801 #if YYDEBUG 802 if (yydebug) 803 fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n", 804 YYDEBUGSTR, yydepth, yystate, yyps->save->state, 805 (int)(yylvp - yylvals - yyps->save->lexeme)); 806 #endif 807 /* Memorize most forward-looking error state in case it's really an error. */ 808 if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals) 809 { 810 /* Free old saved error context state */ 811 if (yyerrctx) yyFreeState(yyerrctx); 812 /* Create and fill out new saved error context state */ 813 yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1)); 814 if (yyerrctx == NULL) goto yyenomem; 815 yyerrctx->save = yyps->save; 816 yyerrctx->state = yystate; 817 yyerrctx->errflag = yyerrflag; 818 yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base); 819 memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short)); 820 yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base); 821 memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 822 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 823 yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base); 824 memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 825 #endif 826 yyerrctx->lexeme = (int) (yylvp - yylvals); 827 } 828 yylvp = yylvals + save->lexeme; 829 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 830 yylpp = yylpsns + save->lexeme; 831 #endif 832 yylexp = yylexemes + save->lexeme; 833 yychar = YYEMPTY; 834 yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base); 835 memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short)); 836 yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base); 837 memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 838 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 839 yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base); 840 memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 841 #endif 842 ctry = ++save->ctry; 843 yystate = save->state; 844 /* We tried shift, try reduce now */ 845 if ((yyn = yyctable[ctry]) >= 0) goto yyreduce; 846 yyps->save = save->save; 847 save->save = NULL; 848 yyFreeState(save); 849 850 /* Nothing left on the stack -- error */ 851 if (!yyps->save) 852 { 853 #if YYDEBUG 854 if (yydebug) 855 fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n", 856 YYPREFIX, yydepth); 857 #endif 858 /* Restore state as it was in the most forward-advanced error */ 859 yylvp = yylvals + yyerrctx->lexeme; 860 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 861 yylpp = yylpsns + yyerrctx->lexeme; 862 #endif 863 yylexp = yylexemes + yyerrctx->lexeme; 864 yychar = yylexp[-1]; 865 yylval = yylvp[-1]; 866 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 867 yylloc = yylpp[-1]; 868 #endif 869 yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base); 870 memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short)); 871 yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base); 872 memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 873 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 874 yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base); 875 memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 876 #endif 877 yystate = yyerrctx->state; 878 yyFreeState(yyerrctx); 879 yyerrctx = NULL; 880 } 881 yynewerrflag = 1; 882 } 883 if (yynewerrflag == 0) goto yyinrecovery; 884 #endif /* YYBTYACC */ 885 886 YYERROR_CALL("syntax error"); 887 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 888 yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */ 889 #endif 890 891 #if !YYBTYACC 892 goto yyerrlab; 893 yyerrlab: 894 #endif 895 ++yynerrs; 896 897 yyinrecovery: 898 if (yyerrflag < 3) 899 { 900 yyerrflag = 3; 901 for (;;) 902 { 903 if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 && 904 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE) 905 { 906 #if YYDEBUG 907 if (yydebug) 908 fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n", 909 YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]); 910 #endif 911 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 912 yystate = yytable[yyn]; 913 *++yystack.s_mark = yytable[yyn]; 914 *++yystack.l_mark = yylval; 915 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 916 /* lookahead position is error end position */ 917 yyerror_loc_range[1] = yylloc; 918 YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */ 919 *++yystack.p_mark = yyloc; 920 #endif 921 goto yyloop; 922 } 923 else 924 { 925 #if YYDEBUG 926 if (yydebug) 927 fprintf(stderr, "%s[%d]: error recovery discarding state %d\n", 928 YYDEBUGSTR, yydepth, *yystack.s_mark); 929 #endif 930 if (yystack.s_mark <= yystack.s_base) goto yyabort; 931 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 932 /* the current TOS position is the error start position */ 933 yyerror_loc_range[0] = *yystack.p_mark; 934 #endif 935 #if defined(YYDESTRUCT_CALL) 936 #if YYBTYACC 937 if (!yytrial) 938 #endif /* YYBTYACC */ 939 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 940 YYDESTRUCT_CALL("error: discarding state", 941 yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark); 942 #else 943 YYDESTRUCT_CALL("error: discarding state", 944 yystos[*yystack.s_mark], yystack.l_mark); 945 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 946 #endif /* defined(YYDESTRUCT_CALL) */ 947 --yystack.s_mark; 948 --yystack.l_mark; 949 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 950 --yystack.p_mark; 951 #endif 952 } 953 } 954 } 955 else 956 { 957 if (yychar == YYEOF) goto yyabort; 958 #if YYDEBUG 959 if (yydebug) 960 { 961 yys = yyname[YYTRANSLATE(yychar)]; 962 fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n", 963 YYDEBUGSTR, yydepth, yystate, yychar, yys); 964 } 965 #endif 966 #if defined(YYDESTRUCT_CALL) 967 #if YYBTYACC 968 if (!yytrial) 969 #endif /* YYBTYACC */ 970 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 971 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc); 972 #else 973 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval); 974 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 975 #endif /* defined(YYDESTRUCT_CALL) */ 976 yychar = YYEMPTY; 977 goto yyloop; 978 } 979 980 yyreduce: 981 yym = yylen[yyn]; 982 #if YYDEBUG 983 if (yydebug) 984 { 985 fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)", 986 YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]); 987 #ifdef YYSTYPE_TOSTRING 988 #if YYBTYACC 989 if (!yytrial) 990 #endif /* YYBTYACC */ 991 if (yym > 0) 992 { 993 int i; 994 fputc('<', stderr); 995 for (i = yym; i > 0; i--) 996 { 997 if (i != yym) fputs(", ", stderr); 998 fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]], 999 yystack.l_mark[1-i]), stderr); 1000 } 1001 fputc('>', stderr); 1002 } 1003 #endif 1004 fputc('\n', stderr); 1005 } 1006 #endif 1007 if (yym > 0) 1008 yyval = yystack.l_mark[1-yym]; 1009 else 1010 memset(&yyval, 0, sizeof yyval); 1011 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1012 1013 /* Perform position reduction */ 1014 memset(&yyloc, 0, sizeof(yyloc)); 1015 #if YYBTYACC 1016 if (!yytrial) 1017 #endif /* YYBTYACC */ 1018 { 1019 YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym); 1020 /* just in case YYERROR is invoked within the action, save 1021 the start of the rhs as the error start position */ 1022 yyerror_loc_range[0] = yystack.p_mark[1-yym]; 1023 } 1024 #endif 1025 1026 switch (yyn) 1027 { 1028 default: 1029 break; 1030 } 1031 yystack.s_mark -= yym; 1032 yystate = *yystack.s_mark; 1033 yystack.l_mark -= yym; 1034 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1035 yystack.p_mark -= yym; 1036 #endif 1037 yym = yylhs[yyn]; 1038 if (yystate == 0 && yym == 0) 1039 { 1040 #if YYDEBUG 1041 if (yydebug) 1042 { 1043 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth); 1044 #ifdef YYSTYPE_TOSTRING 1045 #if YYBTYACC 1046 if (!yytrial) 1047 #endif /* YYBTYACC */ 1048 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval)); 1049 #endif 1050 fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL); 1051 } 1052 #endif 1053 yystate = YYFINAL; 1054 *++yystack.s_mark = YYFINAL; 1055 *++yystack.l_mark = yyval; 1056 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1057 *++yystack.p_mark = yyloc; 1058 #endif 1059 if (yychar < 0) 1060 { 1061 #if YYBTYACC 1062 do { 1063 if (yylvp < yylve) 1064 { 1065 /* we're currently re-reading tokens */ 1066 yylval = *yylvp++; 1067 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1068 yylloc = *yylpp++; 1069 #endif 1070 yychar = *yylexp++; 1071 break; 1072 } 1073 if (yyps->save) 1074 { 1075 /* in trial mode; save scanner results for future parse attempts */ 1076 if (yylvp == yylvlim) 1077 { /* Enlarge lexical value queue */ 1078 size_t p = (size_t) (yylvp - yylvals); 1079 size_t s = (size_t) (yylvlim - yylvals); 1080 1081 s += YYLVQUEUEGROWTH; 1082 if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) 1083 goto yyenomem; 1084 if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) 1085 goto yyenomem; 1086 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1087 if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) 1088 goto yyenomem; 1089 #endif 1090 yylvp = yylve = yylvals + p; 1091 yylvlim = yylvals + s; 1092 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1093 yylpp = yylpe = yylpsns + p; 1094 yylplim = yylpsns + s; 1095 #endif 1096 yylexp = yylexemes + p; 1097 } 1098 *yylexp = (short) YYLEX; 1099 *yylvp++ = yylval; 1100 yylve++; 1101 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1102 *yylpp++ = yylloc; 1103 yylpe++; 1104 #endif 1105 yychar = *yylexp++; 1106 break; 1107 } 1108 /* normal operation, no conflict encountered */ 1109 #endif /* YYBTYACC */ 1110 yychar = YYLEX; 1111 #if YYBTYACC 1112 } while (0); 1113 #endif /* YYBTYACC */ 1114 if (yychar < 0) yychar = YYEOF; 1115 /* if ((yychar = YYLEX) < 0) yychar = YYEOF; */ 1116 #if YYDEBUG 1117 if (yydebug) 1118 { 1119 yys = yyname[YYTRANSLATE(yychar)]; 1120 fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n", 1121 YYDEBUGSTR, yydepth, YYFINAL, yychar, yys); 1122 } 1123 #endif 1124 } 1125 if (yychar == YYEOF) goto yyaccept; 1126 goto yyloop; 1127 } 1128 if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 && 1129 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate) 1130 yystate = yytable[yyn]; 1131 else 1132 yystate = yydgoto[yym]; 1133 #if YYDEBUG 1134 if (yydebug) 1135 { 1136 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth); 1137 #ifdef YYSTYPE_TOSTRING 1138 #if YYBTYACC 1139 if (!yytrial) 1140 #endif /* YYBTYACC */ 1141 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval)); 1142 #endif 1143 fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate); 1144 } 1145 #endif 1146 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 1147 *++yystack.s_mark = (short) yystate; 1148 *++yystack.l_mark = yyval; 1149 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1150 *++yystack.p_mark = yyloc; 1151 #endif 1152 goto yyloop; 1153 #if YYBTYACC 1154 1155 /* Reduction declares that this path is valid. Set yypath and do a full parse */ 1156 yyvalid: 1157 if (yypath) YYABORT; 1158 while (yyps->save) 1159 { 1160 YYParseState *save = yyps->save; 1161 yyps->save = save->save; 1162 save->save = yypath; 1163 yypath = save; 1164 } 1165 #if YYDEBUG 1166 if (yydebug) 1167 fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n", 1168 YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme)); 1169 #endif 1170 if (yyerrctx) 1171 { 1172 yyFreeState(yyerrctx); 1173 yyerrctx = NULL; 1174 } 1175 yylvp = yylvals + yypath->lexeme; 1176 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1177 yylpp = yylpsns + yypath->lexeme; 1178 #endif 1179 yylexp = yylexemes + yypath->lexeme; 1180 yychar = YYEMPTY; 1181 yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base); 1182 memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short)); 1183 yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base); 1184 memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 1185 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1186 yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base); 1187 memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 1188 #endif 1189 yystate = yypath->state; 1190 goto yyloop; 1191 #endif /* YYBTYACC */ 1192 1193 yyoverflow: 1194 YYERROR_CALL("yacc stack overflow"); 1195 #if YYBTYACC 1196 goto yyabort_nomem; 1197 yyenomem: 1198 YYERROR_CALL("memory exhausted"); 1199 yyabort_nomem: 1200 #endif /* YYBTYACC */ 1201 yyresult = 2; 1202 goto yyreturn; 1203 1204 yyabort: 1205 yyresult = 1; 1206 goto yyreturn; 1207 1208 yyaccept: 1209 #if YYBTYACC 1210 if (yyps->save) goto yyvalid; 1211 #endif /* YYBTYACC */ 1212 yyresult = 0; 1213 1214 yyreturn: 1215 #if defined(YYDESTRUCT_CALL) 1216 if (yychar != YYEOF && yychar != YYEMPTY) 1217 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1218 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc); 1219 #else 1220 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval); 1221 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 1222 1223 { 1224 YYSTYPE *pv; 1225 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1226 YYLTYPE *pp; 1227 1228 for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp) 1229 YYDESTRUCT_CALL("cleanup: discarding state", 1230 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp); 1231 #else 1232 for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv) 1233 YYDESTRUCT_CALL("cleanup: discarding state", 1234 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv); 1235 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 1236 } 1237 #endif /* defined(YYDESTRUCT_CALL) */ 1238 1239 #if YYBTYACC 1240 if (yyerrctx) 1241 { 1242 yyFreeState(yyerrctx); 1243 yyerrctx = NULL; 1244 } 1245 while (yyps) 1246 { 1247 YYParseState *save = yyps; 1248 yyps = save->save; 1249 save->save = NULL; 1250 yyFreeState(save); 1251 } 1252 while (yypath) 1253 { 1254 YYParseState *save = yypath; 1255 yypath = save->save; 1256 save->save = NULL; 1257 yyFreeState(save); 1258 } 1259 #endif /* YYBTYACC */ 1260 yyfreestack(&yystack); 1261 return (yyresult); 1262 } 1263