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_syntax20_parse 22 #endif /* yyparse */ 23 24 #ifndef yylex 25 #define yylex err_syntax20_lex 26 #endif /* yylex */ 27 28 #ifndef yyerror 29 #define yyerror err_syntax20_error 30 #endif /* yyerror */ 31 32 #ifndef yychar 33 #define yychar err_syntax20_char 34 #endif /* yychar */ 35 36 #ifndef yyval 37 #define yyval err_syntax20_val 38 #endif /* yyval */ 39 40 #ifndef yylval 41 #define yylval err_syntax20_lval 42 #endif /* yylval */ 43 44 #ifndef yydebug 45 #define yydebug err_syntax20_debug 46 #endif /* yydebug */ 47 48 #ifndef yynerrs 49 #define yynerrs err_syntax20_nerrs 50 #endif /* yynerrs */ 51 52 #ifndef yyerrflag 53 #define yyerrflag err_syntax20_errflag 54 #endif /* yyerrflag */ 55 56 #ifndef yylhs 57 #define yylhs err_syntax20_lhs 58 #endif /* yylhs */ 59 60 #ifndef yylen 61 #define yylen err_syntax20_len 62 #endif /* yylen */ 63 64 #ifndef yydefred 65 #define yydefred err_syntax20_defred 66 #endif /* yydefred */ 67 68 #ifndef yystos 69 #define yystos err_syntax20_stos 70 #endif /* yystos */ 71 72 #ifndef yydgoto 73 #define yydgoto err_syntax20_dgoto 74 #endif /* yydgoto */ 75 76 #ifndef yysindex 77 #define yysindex err_syntax20_sindex 78 #endif /* yysindex */ 79 80 #ifndef yyrindex 81 #define yyrindex err_syntax20_rindex 82 #endif /* yyrindex */ 83 84 #ifndef yygindex 85 #define yygindex err_syntax20_gindex 86 #endif /* yygindex */ 87 88 #ifndef yytable 89 #define yytable err_syntax20_table 90 #endif /* yytable */ 91 92 #ifndef yycheck 93 #define yycheck err_syntax20_check 94 #endif /* yycheck */ 95 96 #ifndef yyname 97 #define yyname err_syntax20_name 98 #endif /* yyname */ 99 100 #ifndef yyrule 101 #define yyrule err_syntax20_rule 102 #endif /* yyrule */ 103 104 #if YYBTYACC 105 106 #ifndef yycindex 107 #define yycindex err_syntax20_cindex 108 #endif /* yycindex */ 109 110 #ifndef yyctable 111 #define yyctable err_syntax20_ctable 112 #endif /* yyctable */ 113 114 #endif /* YYBTYACC */ 115 116 #define YYPREFIX "err_syntax20_" 117 118 #define YYPURE 0 119 120 #line 2 "err_syntax20.y" 121 int yylex(void); 122 static void yyerror(const char *); 123 #line 124 "err_syntax20.tab.c" 124 125 /* compatibility with bison */ 126 #ifdef YYPARSE_PARAM 127 /* compatibility with FreeBSD */ 128 # ifdef YYPARSE_PARAM_TYPE 129 # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) 130 # else 131 # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) 132 # endif 133 #else 134 # define YYPARSE_DECL() yyparse(void) 135 #endif 136 137 /* Parameters sent to lex. */ 138 #ifdef YYLEX_PARAM 139 # define YYLEX_DECL() yylex(void *YYLEX_PARAM) 140 # define YYLEX yylex(YYLEX_PARAM) 141 #else 142 # define YYLEX_DECL() yylex(void) 143 # define YYLEX yylex() 144 #endif 145 146 /* Parameters sent to yyerror. */ 147 #ifndef YYERROR_DECL 148 #define YYERROR_DECL() yyerror(const char *s) 149 #endif 150 #ifndef YYERROR_CALL 151 #define YYERROR_CALL(msg) yyerror(msg) 152 #endif 153 154 extern int YYPARSE_DECL(); 155 156 #define recur 257 157 #define YYERRCODE 256 158 typedef short YYINT; 159 static const YYINT err_syntax20_lhs[] = { -1, 160 0, 161 }; 162 static const YYINT err_syntax20_len[] = { 2, 163 3, 164 }; 165 static const YYINT err_syntax20_defred[] = { 0, 166 0, 0, 0, 1, 167 }; 168 #if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) 169 static const YYINT err_syntax20_stos[] = { 0, 170 40, 259, 257, 41, 171 }; 172 #endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ 173 static const YYINT err_syntax20_dgoto[] = { 2, 174 }; 175 static const YYINT err_syntax20_sindex[] = { -40, 176 -256, 0, -39, 0, 177 }; 178 static const YYINT err_syntax20_rindex[] = { 0, 179 0, 0, 0, 0, 180 }; 181 #if YYBTYACC 182 static const YYINT err_syntax20_cindex[] = { 0, 183 0, 0, 0, 0, 184 }; 185 #endif 186 static const YYINT err_syntax20_gindex[] = { 0, 187 }; 188 #define YYTABLESIZE 2 189 static const YYINT err_syntax20_table[] = { 1, 190 3, 4, 191 }; 192 static const YYINT err_syntax20_check[] = { 40, 193 257, 41, 194 }; 195 #if YYBTYACC 196 static const YYINT err_syntax20_ctable[] = { -1, 197 -1, 198 }; 199 #endif 200 #define YYFINAL 2 201 #ifndef YYDEBUG 202 #define YYDEBUG 0 203 #endif 204 #define YYMAXTOKEN 257 205 #define YYUNDFTOKEN 260 206 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a)) 207 #if YYDEBUG 208 static const char *const err_syntax20_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, 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,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,0,0,"error","recur","$accept","expr", 217 "illegal-symbol", 218 }; 219 static const char *const err_syntax20_rule[] = { 220 "$accept : expr", 221 "expr : '(' recur ')'", 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 YYINT *yylexp = 0; 347 348 static YYINT *yylexemes = 0; 349 #endif /* YYBTYACC */ 350 #line 16 "err_syntax20.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_syntax20.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 = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; 576 if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; 577 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 578 if ((yylpsns = 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 = (YYINT) 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 = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); 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 = (YYINT) 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 case 1: 1040 #line 12 "err_syntax20.y" 1041 { yystack.l_mark[-1].rechk = 3; } 1042 break; 1043 #line 1044 "err_syntax20.tab.c" 1044 default: 1045 break; 1046 } 1047 yystack.s_mark -= yym; 1048 yystate = *yystack.s_mark; 1049 yystack.l_mark -= yym; 1050 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1051 yystack.p_mark -= yym; 1052 #endif 1053 yym = yylhs[yyn]; 1054 if (yystate == 0 && yym == 0) 1055 { 1056 #if YYDEBUG 1057 if (yydebug) 1058 { 1059 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth); 1060 #ifdef YYSTYPE_TOSTRING 1061 #if YYBTYACC 1062 if (!yytrial) 1063 #endif /* YYBTYACC */ 1064 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval)); 1065 #endif 1066 fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL); 1067 } 1068 #endif 1069 yystate = YYFINAL; 1070 *++yystack.s_mark = YYFINAL; 1071 *++yystack.l_mark = yyval; 1072 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1073 *++yystack.p_mark = yyloc; 1074 #endif 1075 if (yychar < 0) 1076 { 1077 #if YYBTYACC 1078 do { 1079 if (yylvp < yylve) 1080 { 1081 /* we're currently re-reading tokens */ 1082 yylval = *yylvp++; 1083 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1084 yylloc = *yylpp++; 1085 #endif 1086 yychar = *yylexp++; 1087 break; 1088 } 1089 if (yyps->save) 1090 { 1091 /* in trial mode; save scanner results for future parse attempts */ 1092 if (yylvp == yylvlim) 1093 { /* Enlarge lexical value queue */ 1094 size_t p = (size_t) (yylvp - yylvals); 1095 size_t s = (size_t) (yylvlim - yylvals); 1096 1097 s += YYLVQUEUEGROWTH; 1098 if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) 1099 goto yyenomem; 1100 if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) 1101 goto yyenomem; 1102 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1103 if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) 1104 goto yyenomem; 1105 #endif 1106 yylvp = yylve = yylvals + p; 1107 yylvlim = yylvals + s; 1108 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1109 yylpp = yylpe = yylpsns + p; 1110 yylplim = yylpsns + s; 1111 #endif 1112 yylexp = yylexemes + p; 1113 } 1114 *yylexp = (YYINT) YYLEX; 1115 *yylvp++ = yylval; 1116 yylve++; 1117 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1118 *yylpp++ = yylloc; 1119 yylpe++; 1120 #endif 1121 yychar = *yylexp++; 1122 break; 1123 } 1124 /* normal operation, no conflict encountered */ 1125 #endif /* YYBTYACC */ 1126 yychar = YYLEX; 1127 #if YYBTYACC 1128 } while (0); 1129 #endif /* YYBTYACC */ 1130 if (yychar < 0) yychar = YYEOF; 1131 #if YYDEBUG 1132 if (yydebug) 1133 { 1134 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; 1135 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n", 1136 YYDEBUGSTR, yydepth, YYFINAL, yychar, yys); 1137 } 1138 #endif 1139 } 1140 if (yychar == YYEOF) goto yyaccept; 1141 goto yyloop; 1142 } 1143 if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 && 1144 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate) 1145 yystate = yytable[yyn]; 1146 else 1147 yystate = yydgoto[yym]; 1148 #if YYDEBUG 1149 if (yydebug) 1150 { 1151 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth); 1152 #ifdef YYSTYPE_TOSTRING 1153 #if YYBTYACC 1154 if (!yytrial) 1155 #endif /* YYBTYACC */ 1156 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval)); 1157 #endif 1158 fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate); 1159 } 1160 #endif 1161 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 1162 *++yystack.s_mark = (YYINT) yystate; 1163 *++yystack.l_mark = yyval; 1164 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1165 *++yystack.p_mark = yyloc; 1166 #endif 1167 goto yyloop; 1168 #if YYBTYACC 1169 1170 /* Reduction declares that this path is valid. Set yypath and do a full parse */ 1171 yyvalid: 1172 if (yypath) YYABORT; 1173 while (yyps->save) 1174 { 1175 YYParseState *save = yyps->save; 1176 yyps->save = save->save; 1177 save->save = yypath; 1178 yypath = save; 1179 } 1180 #if YYDEBUG 1181 if (yydebug) 1182 fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n", 1183 YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme)); 1184 #endif 1185 if (yyerrctx) 1186 { 1187 yyFreeState(yyerrctx); 1188 yyerrctx = NULL; 1189 } 1190 yylvp = yylvals + yypath->lexeme; 1191 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1192 yylpp = yylpsns + yypath->lexeme; 1193 #endif 1194 yylexp = yylexemes + yypath->lexeme; 1195 yychar = YYEMPTY; 1196 yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base); 1197 memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); 1198 yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base); 1199 memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 1200 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1201 yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base); 1202 memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 1203 #endif 1204 yystate = yypath->state; 1205 goto yyloop; 1206 #endif /* YYBTYACC */ 1207 1208 yyoverflow: 1209 YYERROR_CALL("yacc stack overflow"); 1210 #if YYBTYACC 1211 goto yyabort_nomem; 1212 yyenomem: 1213 YYERROR_CALL("memory exhausted"); 1214 yyabort_nomem: 1215 #endif /* YYBTYACC */ 1216 yyresult = 2; 1217 goto yyreturn; 1218 1219 yyabort: 1220 yyresult = 1; 1221 goto yyreturn; 1222 1223 yyaccept: 1224 #if YYBTYACC 1225 if (yyps->save) goto yyvalid; 1226 #endif /* YYBTYACC */ 1227 yyresult = 0; 1228 1229 yyreturn: 1230 #if defined(YYDESTRUCT_CALL) 1231 if (yychar != YYEOF && yychar != YYEMPTY) 1232 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1233 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc); 1234 #else 1235 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval); 1236 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 1237 1238 { 1239 YYSTYPE *pv; 1240 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1241 YYLTYPE *pp; 1242 1243 for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp) 1244 YYDESTRUCT_CALL("cleanup: discarding state", 1245 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp); 1246 #else 1247 for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv) 1248 YYDESTRUCT_CALL("cleanup: discarding state", 1249 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv); 1250 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 1251 } 1252 #endif /* defined(YYDESTRUCT_CALL) */ 1253 1254 #if YYBTYACC 1255 if (yyerrctx) 1256 { 1257 yyFreeState(yyerrctx); 1258 yyerrctx = NULL; 1259 } 1260 while (yyps) 1261 { 1262 YYParseState *save = yyps; 1263 yyps = save->save; 1264 save->save = NULL; 1265 yyFreeState(save); 1266 } 1267 while (yypath) 1268 { 1269 YYParseState *save = yypath; 1270 yypath = save->save; 1271 save->save = NULL; 1272 yyFreeState(save); 1273 } 1274 #endif /* YYBTYACC */ 1275 yyfreestack(&yystack); 1276 return (yyresult); 1277 } 1278