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