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 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 YYINT *s_base; 286 YYINT *s_mark; 287 YYINT *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 YYINT *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 = (YYINT *)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 = (YYINT *) malloc(size * sizeof(YYINT)); 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 yym = 0; 530 yyn = 0; 531 yynerrs = 0; 532 yyerrflag = 0; 533 yychar = YYEMPTY; 534 yystate = 0; 535 536 #if YYPURE 537 memset(&yystack, 0, sizeof(yystack)); 538 #endif 539 540 if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 541 yystack.s_mark = yystack.s_base; 542 yystack.l_mark = yystack.l_base; 543 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 544 yystack.p_mark = yystack.p_base; 545 #endif 546 yystate = 0; 547 *yystack.s_mark = 0; 548 549 yyloop: 550 if ((yyn = yydefred[yystate]) != 0) goto yyreduce; 551 if (yychar < 0) 552 { 553 #if YYBTYACC 554 do { 555 if (yylvp < yylve) 556 { 557 /* we're currently re-reading tokens */ 558 yylval = *yylvp++; 559 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 560 yylloc = *yylpp++; 561 #endif 562 yychar = *yylexp++; 563 break; 564 } 565 if (yyps->save) 566 { 567 /* in trial mode; save scanner results for future parse attempts */ 568 if (yylvp == yylvlim) 569 { /* Enlarge lexical value queue */ 570 size_t p = (size_t) (yylvp - yylvals); 571 size_t s = (size_t) (yylvlim - yylvals); 572 573 s += YYLVQUEUEGROWTH; 574 if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; 575 if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; 576 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 577 if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; 578 #endif 579 yylvp = yylve = yylvals + p; 580 yylvlim = yylvals + s; 581 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 582 yylpp = yylpe = yylpsns + p; 583 yylplim = yylpsns + s; 584 #endif 585 yylexp = yylexemes + p; 586 } 587 *yylexp = (short) YYLEX; 588 *yylvp++ = yylval; 589 yylve++; 590 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 591 *yylpp++ = yylloc; 592 yylpe++; 593 #endif 594 yychar = *yylexp++; 595 break; 596 } 597 /* normal operation, no conflict encountered */ 598 #endif /* YYBTYACC */ 599 yychar = YYLEX; 600 #if YYBTYACC 601 } while (0); 602 #endif /* YYBTYACC */ 603 if (yychar < 0) yychar = YYEOF; 604 #if YYDEBUG 605 if (yydebug) 606 { 607 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; 608 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)", 609 YYDEBUGSTR, yydepth, yystate, yychar, yys); 610 #ifdef YYSTYPE_TOSTRING 611 #if YYBTYACC 612 if (!yytrial) 613 #endif /* YYBTYACC */ 614 fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval)); 615 #endif 616 fputc('\n', stderr); 617 } 618 #endif 619 } 620 #if YYBTYACC 621 622 /* Do we have a conflict? */ 623 if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 && 624 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) 625 { 626 YYINT ctry; 627 628 if (yypath) 629 { 630 YYParseState *save; 631 #if YYDEBUG 632 if (yydebug) 633 fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n", 634 YYDEBUGSTR, yydepth, yystate); 635 #endif 636 /* Switch to the next conflict context */ 637 save = yypath; 638 yypath = save->save; 639 save->save = NULL; 640 ctry = save->ctry; 641 if (save->state != yystate) YYABORT; 642 yyFreeState(save); 643 644 } 645 else 646 { 647 648 /* Unresolved conflict - start/continue trial parse */ 649 YYParseState *save; 650 #if YYDEBUG 651 if (yydebug) 652 { 653 fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate); 654 if (yyps->save) 655 fputs("ALREADY in conflict, continuing trial parse.\n", stderr); 656 else 657 fputs("Starting trial parse.\n", stderr); 658 } 659 #endif 660 save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1)); 661 if (save == NULL) goto yyenomem; 662 save->save = yyps->save; 663 save->state = yystate; 664 save->errflag = yyerrflag; 665 save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base); 666 memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); 667 save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base); 668 memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 669 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 670 save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base); 671 memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 672 #endif 673 ctry = yytable[yyn]; 674 if (yyctable[ctry] == -1) 675 { 676 #if YYDEBUG 677 if (yydebug && yychar >= YYEOF) 678 fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth); 679 #endif 680 ctry++; 681 } 682 save->ctry = ctry; 683 if (yyps->save == NULL) 684 { 685 /* If this is a first conflict in the stack, start saving lexemes */ 686 if (!yylexemes) 687 { 688 yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); 689 if (yylexemes == NULL) goto yyenomem; 690 yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); 691 if (yylvals == NULL) goto yyenomem; 692 yylvlim = yylvals + YYLVQUEUEGROWTH; 693 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 694 yylpsns = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE)); 695 if (yylpsns == NULL) goto yyenomem; 696 yylplim = yylpsns + YYLVQUEUEGROWTH; 697 #endif 698 } 699 if (yylvp == yylve) 700 { 701 yylvp = yylve = yylvals; 702 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 703 yylpp = yylpe = yylpsns; 704 #endif 705 yylexp = yylexemes; 706 if (yychar >= YYEOF) 707 { 708 *yylve++ = yylval; 709 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 710 *yylpe++ = yylloc; 711 #endif 712 *yylexp = (short) yychar; 713 yychar = YYEMPTY; 714 } 715 } 716 } 717 if (yychar >= YYEOF) 718 { 719 yylvp--; 720 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 721 yylpp--; 722 #endif 723 yylexp--; 724 yychar = YYEMPTY; 725 } 726 save->lexeme = (int) (yylvp - yylvals); 727 yyps->save = save; 728 } 729 if (yytable[yyn] == ctry) 730 { 731 #if YYDEBUG 732 if (yydebug) 733 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n", 734 YYDEBUGSTR, yydepth, yystate, yyctable[ctry]); 735 #endif 736 if (yychar < 0) 737 { 738 yylvp++; 739 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 740 yylpp++; 741 #endif 742 yylexp++; 743 } 744 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) 745 goto yyoverflow; 746 yystate = yyctable[ctry]; 747 *++yystack.s_mark = (YYINT) yystate; 748 *++yystack.l_mark = yylval; 749 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 750 *++yystack.p_mark = yylloc; 751 #endif 752 yychar = YYEMPTY; 753 if (yyerrflag > 0) --yyerrflag; 754 goto yyloop; 755 } 756 else 757 { 758 yyn = yyctable[ctry]; 759 goto yyreduce; 760 } 761 } /* End of code dealing with conflicts */ 762 #endif /* YYBTYACC */ 763 if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 && 764 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) 765 { 766 #if YYDEBUG 767 if (yydebug) 768 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n", 769 YYDEBUGSTR, yydepth, yystate, yytable[yyn]); 770 #endif 771 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 772 yystate = yytable[yyn]; 773 *++yystack.s_mark = yytable[yyn]; 774 *++yystack.l_mark = yylval; 775 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 776 *++yystack.p_mark = yylloc; 777 #endif 778 yychar = YYEMPTY; 779 if (yyerrflag > 0) --yyerrflag; 780 goto yyloop; 781 } 782 if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 && 783 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) 784 { 785 yyn = yytable[yyn]; 786 goto yyreduce; 787 } 788 if (yyerrflag != 0) goto yyinrecovery; 789 #if YYBTYACC 790 791 yynewerrflag = 1; 792 goto yyerrhandler; 793 goto yyerrlab; /* redundant goto avoids 'unused label' warning */ 794 795 yyerrlab: 796 /* explicit YYERROR from an action -- pop the rhs of the rule reduced 797 * before looking for error recovery */ 798 yystack.s_mark -= yym; 799 yystate = *yystack.s_mark; 800 yystack.l_mark -= yym; 801 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 802 yystack.p_mark -= yym; 803 #endif 804 805 yynewerrflag = 0; 806 yyerrhandler: 807 while (yyps->save) 808 { 809 int ctry; 810 YYParseState *save = yyps->save; 811 #if YYDEBUG 812 if (yydebug) 813 fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n", 814 YYDEBUGSTR, yydepth, yystate, yyps->save->state, 815 (int)(yylvp - yylvals - yyps->save->lexeme)); 816 #endif 817 /* Memorize most forward-looking error state in case it's really an error. */ 818 if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals) 819 { 820 /* Free old saved error context state */ 821 if (yyerrctx) yyFreeState(yyerrctx); 822 /* Create and fill out new saved error context state */ 823 yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1)); 824 if (yyerrctx == NULL) goto yyenomem; 825 yyerrctx->save = yyps->save; 826 yyerrctx->state = yystate; 827 yyerrctx->errflag = yyerrflag; 828 yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base); 829 memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); 830 yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base); 831 memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 832 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 833 yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base); 834 memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 835 #endif 836 yyerrctx->lexeme = (int) (yylvp - yylvals); 837 } 838 yylvp = yylvals + save->lexeme; 839 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 840 yylpp = yylpsns + save->lexeme; 841 #endif 842 yylexp = yylexemes + save->lexeme; 843 yychar = YYEMPTY; 844 yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base); 845 memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); 846 yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base); 847 memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 848 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 849 yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base); 850 memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 851 #endif 852 ctry = ++save->ctry; 853 yystate = save->state; 854 /* We tried shift, try reduce now */ 855 if ((yyn = yyctable[ctry]) >= 0) goto yyreduce; 856 yyps->save = save->save; 857 save->save = NULL; 858 yyFreeState(save); 859 860 /* Nothing left on the stack -- error */ 861 if (!yyps->save) 862 { 863 #if YYDEBUG 864 if (yydebug) 865 fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n", 866 YYPREFIX, yydepth); 867 #endif 868 /* Restore state as it was in the most forward-advanced error */ 869 yylvp = yylvals + yyerrctx->lexeme; 870 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 871 yylpp = yylpsns + yyerrctx->lexeme; 872 #endif 873 yylexp = yylexemes + yyerrctx->lexeme; 874 yychar = yylexp[-1]; 875 yylval = yylvp[-1]; 876 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 877 yylloc = yylpp[-1]; 878 #endif 879 yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base); 880 memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); 881 yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base); 882 memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 883 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 884 yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base); 885 memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 886 #endif 887 yystate = yyerrctx->state; 888 yyFreeState(yyerrctx); 889 yyerrctx = NULL; 890 } 891 yynewerrflag = 1; 892 } 893 if (yynewerrflag == 0) goto yyinrecovery; 894 #endif /* YYBTYACC */ 895 896 YYERROR_CALL("syntax error"); 897 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 898 yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */ 899 #endif 900 901 #if !YYBTYACC 902 goto yyerrlab; /* redundant goto avoids 'unused label' warning */ 903 yyerrlab: 904 #endif 905 ++yynerrs; 906 907 yyinrecovery: 908 if (yyerrflag < 3) 909 { 910 yyerrflag = 3; 911 for (;;) 912 { 913 if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 && 914 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE) 915 { 916 #if YYDEBUG 917 if (yydebug) 918 fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n", 919 YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]); 920 #endif 921 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 922 yystate = yytable[yyn]; 923 *++yystack.s_mark = yytable[yyn]; 924 *++yystack.l_mark = yylval; 925 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 926 /* lookahead position is error end position */ 927 yyerror_loc_range[1] = yylloc; 928 YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */ 929 *++yystack.p_mark = yyloc; 930 #endif 931 goto yyloop; 932 } 933 else 934 { 935 #if YYDEBUG 936 if (yydebug) 937 fprintf(stderr, "%s[%d]: error recovery discarding state %d\n", 938 YYDEBUGSTR, yydepth, *yystack.s_mark); 939 #endif 940 if (yystack.s_mark <= yystack.s_base) goto yyabort; 941 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 942 /* the current TOS position is the error start position */ 943 yyerror_loc_range[0] = *yystack.p_mark; 944 #endif 945 #if defined(YYDESTRUCT_CALL) 946 #if YYBTYACC 947 if (!yytrial) 948 #endif /* YYBTYACC */ 949 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 950 YYDESTRUCT_CALL("error: discarding state", 951 yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark); 952 #else 953 YYDESTRUCT_CALL("error: discarding state", 954 yystos[*yystack.s_mark], yystack.l_mark); 955 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 956 #endif /* defined(YYDESTRUCT_CALL) */ 957 --yystack.s_mark; 958 --yystack.l_mark; 959 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 960 --yystack.p_mark; 961 #endif 962 } 963 } 964 } 965 else 966 { 967 if (yychar == YYEOF) goto yyabort; 968 #if YYDEBUG 969 if (yydebug) 970 { 971 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; 972 fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n", 973 YYDEBUGSTR, yydepth, yystate, yychar, yys); 974 } 975 #endif 976 #if defined(YYDESTRUCT_CALL) 977 #if YYBTYACC 978 if (!yytrial) 979 #endif /* YYBTYACC */ 980 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 981 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc); 982 #else 983 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval); 984 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 985 #endif /* defined(YYDESTRUCT_CALL) */ 986 yychar = YYEMPTY; 987 goto yyloop; 988 } 989 990 yyreduce: 991 yym = yylen[yyn]; 992 #if YYDEBUG 993 if (yydebug) 994 { 995 fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)", 996 YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]); 997 #ifdef YYSTYPE_TOSTRING 998 #if YYBTYACC 999 if (!yytrial) 1000 #endif /* YYBTYACC */ 1001 if (yym > 0) 1002 { 1003 int i; 1004 fputc('<', stderr); 1005 for (i = yym; i > 0; i--) 1006 { 1007 if (i != yym) fputs(", ", stderr); 1008 fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]], 1009 yystack.l_mark[1-i]), stderr); 1010 } 1011 fputc('>', stderr); 1012 } 1013 #endif 1014 fputc('\n', stderr); 1015 } 1016 #endif 1017 if (yym > 0) 1018 yyval = yystack.l_mark[1-yym]; 1019 else 1020 memset(&yyval, 0, sizeof yyval); 1021 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1022 1023 /* Perform position reduction */ 1024 memset(&yyloc, 0, sizeof(yyloc)); 1025 #if YYBTYACC 1026 if (!yytrial) 1027 #endif /* YYBTYACC */ 1028 { 1029 YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym); 1030 /* just in case YYERROR is invoked within the action, save 1031 the start of the rhs as the error start position */ 1032 yyerror_loc_range[0] = yystack.p_mark[1-yym]; 1033 } 1034 #endif 1035 1036 switch (yyn) 1037 { 1038 default: 1039 break; 1040 } 1041 yystack.s_mark -= yym; 1042 yystate = *yystack.s_mark; 1043 yystack.l_mark -= yym; 1044 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1045 yystack.p_mark -= yym; 1046 #endif 1047 yym = yylhs[yyn]; 1048 if (yystate == 0 && yym == 0) 1049 { 1050 #if YYDEBUG 1051 if (yydebug) 1052 { 1053 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth); 1054 #ifdef YYSTYPE_TOSTRING 1055 #if YYBTYACC 1056 if (!yytrial) 1057 #endif /* YYBTYACC */ 1058 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval)); 1059 #endif 1060 fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL); 1061 } 1062 #endif 1063 yystate = YYFINAL; 1064 *++yystack.s_mark = YYFINAL; 1065 *++yystack.l_mark = yyval; 1066 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1067 *++yystack.p_mark = yyloc; 1068 #endif 1069 if (yychar < 0) 1070 { 1071 #if YYBTYACC 1072 do { 1073 if (yylvp < yylve) 1074 { 1075 /* we're currently re-reading tokens */ 1076 yylval = *yylvp++; 1077 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1078 yylloc = *yylpp++; 1079 #endif 1080 yychar = *yylexp++; 1081 break; 1082 } 1083 if (yyps->save) 1084 { 1085 /* in trial mode; save scanner results for future parse attempts */ 1086 if (yylvp == yylvlim) 1087 { /* Enlarge lexical value queue */ 1088 size_t p = (size_t) (yylvp - yylvals); 1089 size_t s = (size_t) (yylvlim - yylvals); 1090 1091 s += YYLVQUEUEGROWTH; 1092 if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) 1093 goto yyenomem; 1094 if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) 1095 goto yyenomem; 1096 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1097 if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) 1098 goto yyenomem; 1099 #endif 1100 yylvp = yylve = yylvals + p; 1101 yylvlim = yylvals + s; 1102 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1103 yylpp = yylpe = yylpsns + p; 1104 yylplim = yylpsns + s; 1105 #endif 1106 yylexp = yylexemes + p; 1107 } 1108 *yylexp = (short) YYLEX; 1109 *yylvp++ = yylval; 1110 yylve++; 1111 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1112 *yylpp++ = yylloc; 1113 yylpe++; 1114 #endif 1115 yychar = *yylexp++; 1116 break; 1117 } 1118 /* normal operation, no conflict encountered */ 1119 #endif /* YYBTYACC */ 1120 yychar = YYLEX; 1121 #if YYBTYACC 1122 } while (0); 1123 #endif /* YYBTYACC */ 1124 if (yychar < 0) yychar = YYEOF; 1125 #if YYDEBUG 1126 if (yydebug) 1127 { 1128 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; 1129 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n", 1130 YYDEBUGSTR, yydepth, YYFINAL, yychar, yys); 1131 } 1132 #endif 1133 } 1134 if (yychar == YYEOF) goto yyaccept; 1135 goto yyloop; 1136 } 1137 if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 && 1138 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate) 1139 yystate = yytable[yyn]; 1140 else 1141 yystate = yydgoto[yym]; 1142 #if YYDEBUG 1143 if (yydebug) 1144 { 1145 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth); 1146 #ifdef YYSTYPE_TOSTRING 1147 #if YYBTYACC 1148 if (!yytrial) 1149 #endif /* YYBTYACC */ 1150 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval)); 1151 #endif 1152 fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate); 1153 } 1154 #endif 1155 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 1156 *++yystack.s_mark = (YYINT) yystate; 1157 *++yystack.l_mark = yyval; 1158 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1159 *++yystack.p_mark = yyloc; 1160 #endif 1161 goto yyloop; 1162 #if YYBTYACC 1163 1164 /* Reduction declares that this path is valid. Set yypath and do a full parse */ 1165 yyvalid: 1166 if (yypath) YYABORT; 1167 while (yyps->save) 1168 { 1169 YYParseState *save = yyps->save; 1170 yyps->save = save->save; 1171 save->save = yypath; 1172 yypath = save; 1173 } 1174 #if YYDEBUG 1175 if (yydebug) 1176 fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n", 1177 YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme)); 1178 #endif 1179 if (yyerrctx) 1180 { 1181 yyFreeState(yyerrctx); 1182 yyerrctx = NULL; 1183 } 1184 yylvp = yylvals + yypath->lexeme; 1185 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1186 yylpp = yylpsns + yypath->lexeme; 1187 #endif 1188 yylexp = yylexemes + yypath->lexeme; 1189 yychar = YYEMPTY; 1190 yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base); 1191 memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); 1192 yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base); 1193 memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 1194 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1195 yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base); 1196 memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 1197 #endif 1198 yystate = yypath->state; 1199 goto yyloop; 1200 #endif /* YYBTYACC */ 1201 1202 yyoverflow: 1203 YYERROR_CALL("yacc stack overflow"); 1204 #if YYBTYACC 1205 goto yyabort_nomem; 1206 yyenomem: 1207 YYERROR_CALL("memory exhausted"); 1208 yyabort_nomem: 1209 #endif /* YYBTYACC */ 1210 yyresult = 2; 1211 goto yyreturn; 1212 1213 yyabort: 1214 yyresult = 1; 1215 goto yyreturn; 1216 1217 yyaccept: 1218 #if YYBTYACC 1219 if (yyps->save) goto yyvalid; 1220 #endif /* YYBTYACC */ 1221 yyresult = 0; 1222 1223 yyreturn: 1224 #if defined(YYDESTRUCT_CALL) 1225 if (yychar != YYEOF && yychar != YYEMPTY) 1226 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1227 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc); 1228 #else 1229 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval); 1230 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 1231 1232 { 1233 YYSTYPE *pv; 1234 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1235 YYLTYPE *pp; 1236 1237 for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp) 1238 YYDESTRUCT_CALL("cleanup: discarding state", 1239 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp); 1240 #else 1241 for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv) 1242 YYDESTRUCT_CALL("cleanup: discarding state", 1243 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv); 1244 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 1245 } 1246 #endif /* defined(YYDESTRUCT_CALL) */ 1247 1248 #if YYBTYACC 1249 if (yyerrctx) 1250 { 1251 yyFreeState(yyerrctx); 1252 yyerrctx = NULL; 1253 } 1254 while (yyps) 1255 { 1256 YYParseState *save = yyps; 1257 yyps = save->save; 1258 save->save = NULL; 1259 yyFreeState(save); 1260 } 1261 while (yypath) 1262 { 1263 YYParseState *save = yypath; 1264 yypath = save->save; 1265 save->save = NULL; 1266 yyFreeState(save); 1267 } 1268 #endif /* YYBTYACC */ 1269 yyfreestack(&yystack); 1270 return (yyresult); 1271 } 1272