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