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