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