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