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