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