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