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