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