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