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