1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861
|
/*
** This file generated automatically from
*/
#include "defs.h"
/* The banner used here should be replaced with an #ident directive */
/* if the target C compiler supports #ident directives. */
/* */
/* If the skeleton is changed, the banner should be changed so that */
/* the altered version can easily be distinguished from the original. */
char *banner[] =
{
"#line 8 \"btyaccpa.ske\"",
"",
"//",
"// @(#)btyaccpar, based on byacc 1.8 (Berkeley)",
"//",
"#define YYBTYACC 1",
"",
"#include <stdio.h>",
"#include <stdlib.h>",
"#include <string.h>",
"",
"typedef int Yshort;",
"",
0
};
char *tables[] =
{
"#line 21 \"btyaccpa.ske\"",
"",
"#define _C_ \"C\"",
"",
"extern _C_ Yshort yylhs[];",
"extern _C_ Yshort yylen[];",
"extern _C_ Yshort yydefred[];",
"extern _C_ Yshort yydgoto[];",
"extern _C_ Yshort yysindex[];",
"extern _C_ Yshort yyrindex[];",
"extern _C_ Yshort yycindex[];",
"extern _C_ Yshort yygindex[];",
"extern _C_ Yshort yytable[];",
"extern _C_ Yshort yycheck[];",
"extern _C_ Yshort yyctable[];",
"",
"#if YYDEBUG",
"extern _C_ char *yyname[];",
"extern _C_ char *yyrule[];",
"#endif",
"",
0
};
char *header[] =
{
"#line 42 \"btyaccpa.ske\"",
"",
"//",
"// YYPOSN is user-defined text position type.",
"//",
"#ifndef YYPOSN",
"#define YYPOSN int",
"#endif",
"",
"#ifdef YYREDUCEPOSNFUNC",
"#define YYCALLREDUCEPOSN(e) \\",
"\tif(reduce_posn) { \\",
"\t YYREDUCEPOSNFUNC(yyps->pos, &(yyps->psp)[1-yym], &(yyps->vsp)[1-yym], \\",
"\t\t\t yym, yyps->psp - yyps->ps, yychar, yyposn, e); \\",
"\t reduce_posn = 0; \\",
"\t}",
"",
"#ifndef YYCALLREDUCEPOSNARG",
"#define YYCALLREDUCEPOSNARG yyps->val",
"#endif",
"",
"",
"#define YYPOSNARG(n) ((yyps->psp)[1-yym+(n)-1])",
"#define YYPOSNOUT (yyps->pos)",
"#endif",
"",
"// If delete function is not defined by the user, do not deletions.",
"#ifndef YYDELETEVAL",
"#define YYDELETEVAL(v) ",
"#endif",
"",
"// If delete function is not defined by the user, do not deletions.",
"#ifndef YYDELETEPOSN",
"#define YYDELETEPOSN(v) ",
"#endif",
"",
"#define yyclearin (yychar=(-1))",
"",
"#define yyerrok (yyps->errflag=0)",
"",
"#ifndef YYSTACKGROWTH",
"#define YYSTACKGROWTH 16",
"#endif",
"",
"#ifndef YYDEFSTACKSIZE",
"#define YYDEFSTACKSIZE 12",
"#endif",
"",
"#ifdef YYDEBUG",
"int yydebug;",
"#endif",
"",
"int yynerrs;",
"",
"/* These value/posn are taken from the lexer */",
"YYSTYPE yylval;",
"YYPOSN yyposn;",
"",
"/* These value/posn of the root non-terminal are returned to the caller */",
"YYSTYPE yyretlval;",
"YYPOSN yyretposn;",
"",
"#define YYABORT goto yyabort",
"#define YYACCEPT goto yyaccept",
"#define YYERROR goto yyerrlab",
"#define YYVALID do { if (yyps->save) goto yyvalid; } while(0)",
"#define YYVALID_NESTED do { if (yyps->save && \\",
" yyps->save->save==0) goto yyvalid; } while(0)",
"",
"struct yyparsestate {",
" yyparsestate *save; // Previously saved parser state",
" int state;",
" int errflag;",
" Yshort *ssp; // state stack pointer",
" YYSTYPE *vsp; // value stack pointer",
" YYPOSN *psp; // position stack pointer",
" YYSTYPE val; // value as returned by actions",
" YYPOSN pos; // position as returned by universal action",
" Yshort *ss; // state stack base",
" YYSTYPE *vs; // values stack base",
" YYPOSN *ps; // position stack base",
" int lexeme; // index of the conflict lexeme in the lexical queue",
" unsigned int stacksize; // current maximum stack size",
" Yshort ctry; // index in yyctable[] for this conflict",
"};",
"",
"// Current parser state",
"static yyparsestate *yyps=0;",
"",
"// yypath!=NULL: do the full parse, starting at *yypath parser state.",
"static yyparsestate *yypath=0;",
"",
"// Base of the lexical value queue",
"static YYSTYPE *yylvals=0;",
"",
"// Current posistion at lexical value queue",
"static YYSTYPE *yylvp=0;",
"",
"// End position of lexical value queue",
"static YYSTYPE *yylve=0;",
"",
"// The last allocated position at the lexical value queue",
"static YYSTYPE *yylvlim=0;",
"",
"// Base of the lexical position queue",
"static YYPOSN *yylpsns=0;",
"",
"// Current posistion at lexical position queue",
"static YYPOSN *yylpp=0;",
"",
"// End position of lexical position queue",
"static YYPOSN *yylpe=0;",
"",
"// The last allocated position at the lexical position queue",
"static YYPOSN *yylplim=0;",
"",
"// Current position at lexical token queue",
"static Yshort *yylexp=0;",
"",
"static Yshort *yylexemes=0;",
"",
"//",
"// For use in generated program",
"//",
"#define yytrial (yyps->save)",
"#define yyvsp (yyps->vsp)",
"#define yyval (yyps->val)",
"#define yydepth (yyps->ssp - yyps->ss)",
"",
"",
"//",
"// Local prototypes.",
"//",
"int yyparse(void);",
"",
"int YYLex1();",
"int yyexpand();",
"void YYSCopy(YYSTYPE *to, YYSTYPE *from, int size);",
"void YYPCopy(YYPOSN *to, YYPOSN *from, int size);",
"void YYMoreStack(yyparsestate *yyps);",
"yyparsestate *YYNewState(int size);",
"void YYFreeState(yyparsestate *p);",
"",
"",
0
};
char *body[] =
{
"#line 186 \"btyaccpa.ske\"",
"",
"",
"//",
"// Parser function",
"//",
"int yyparse() {",
" int yym, yyn, yystate, yychar, yynewerrflag;",
" yyparsestate *yyerrctx = NULL;",
" int reduce_posn;",
"",
"#if YYDEBUG",
" char *yys;",
" ",
" if ((yys = getenv(\"YYDEBUG\"))) {",
" yyn = *yys;",
" if (yyn >= '0' && yyn <= '9')",
" yydebug = yyn - '0'; ",
" }",
"#endif",
" ",
" yyps = YYNewState(YYDEFSTACKSIZE);",
" yyps->save = 0;",
" yynerrs = 0;",
" yyps->errflag = 0;",
" yychar = (-1);",
" ",
" yyps->ssp = yyps->ss;",
" yyps->vsp = yyps->vs;",
" yyps->psp = yyps->ps;",
" *(yyps->ssp) = yystate = 0;",
" ",
"",
" //",
" // Main parsing loop",
" //",
" yyloop:",
" if ((yyn = yydefred[yystate])) {",
" goto yyreduce;",
" }",
"",
" //",
" // Read one token",
" //",
" if (yychar < 0) {",
" if ((yychar = YYLex1()) < 0) yychar = 0;",
"#if YYDEBUG",
" if (yydebug) {",
" yys = 0;",
" if (yychar <= YYMAXTOKEN) yys = yyname[yychar];",
" if (!yys) yys = \"illegal-symbol\";",
" printf(\"yydebug[%d,%d]: state %d, reading %d (%s)\", ",
"\t yydepth, (int)yytrial, yystate, yychar, yys);",
"#ifdef YYDBPR",
" printf(\"<\");",
" YYDBPR(yylval);",
" printf(\">\");",
"#endif",
" printf(\"\\n\"); ",
" }",
"#endif",
" }",
"",
" //",
" // Do we have a conflict?",
" //",
" if ((yyn = yycindex[yystate]) &&",
" (yyn += yychar) >= 0 &&",
" yyn <= YYTABLESIZE &&",
" yycheck[yyn] == yychar) {",
" int ctry;",
"",
" if (yypath) {",
"#if YYDEBUG",
" if (yydebug) {",
" printf(\"yydebug[%d,%d]: CONFLICT in state %d: following successful trial parse\\n\", ",
"\t yydepth, (int)yytrial, yystate);",
" }",
"#endif",
" // Switch to the next conflict context",
" yyparsestate *save = yypath;",
" yypath = save->save;",
" ctry = save->ctry;",
" if (save->state != yystate) ",
" goto yyabort;",
" YYFreeState(save); ",
"",
" } else {",
"",
"#if YYDEBUG",
" if (yydebug) {",
" printf(\"yydebug[%d,%d]: CONFLICT in state %d. \", ",
"\t yydepth, (int)yytrial, yystate);",
" if(yyps->save) {",
" printf(\"ALREADY in conflict. Continue trial parse.\");",
" } else {",
" printf(\"Start trial parse.\");",
" }",
" printf(\"\\n\");",
" }",
"#endif",
" yyparsestate *save = YYNewState(yyps->ssp - yyps->ss);",
" save->save = yyps->save;",
" save->state = yystate;",
" save->errflag = yyps->errflag;",
" save->ssp = save->ss + (yyps->ssp - yyps->ss);",
" save->vsp = save->vs + (yyps->vsp - yyps->vs);",
" save->psp = save->ps + (yyps->psp - yyps->ps);",
" memcpy (save->ss, yyps->ss, (yyps->ssp - yyps->ss + 1)*sizeof(Yshort));",
" YYSCopy(save->vs, yyps->vs, (yyps->ssp - yyps->ss + 1));",
" YYPCopy(save->ps, yyps->ps, (yyps->ssp - yyps->ss + 1));",
" ctry = yytable[yyn];",
" if (yyctable[ctry] == -1) {",
"#if YYDEBUG",
" if (yydebug && yychar >= 0)",
" printf(\"yydebug[%d]: backtracking 1 token\\n\", ",
"\t\t (int)yytrial);",
"#endif",
" ctry++; ",
" }",
" save->ctry = ctry;",
" if (!yyps->save) {",
" // If this is a first conflict in the stack, start saving lexemes",
" if (!yylexemes) {",
" yylexemes = new Yshort[YYSTACKGROWTH];",
" yylvals = new YYSTYPE[YYSTACKGROWTH];",
" yylvlim = yylvals + YYSTACKGROWTH; ",
" yylpsns = new YYPOSN[YYSTACKGROWTH];",
" yylplim = yylpsns + YYSTACKGROWTH; ",
" }",
" if (yylvp == yylve) {",
" yylvp = yylve = yylvals;",
"\t yylpp = yylpe = yylpsns;",
" yylexp = yylexemes;",
" if (yychar >= 0) {",
" *yylve++ = yylval;",
" *yylpe++ = yyposn;",
" *yylexp = yychar;",
" yychar = -1; ",
" } ",
" } ",
" }",
" if (yychar >= 0) {",
" yylvp--, yylpp--, yylexp--;",
" yychar = -1; ",
" }",
" save->lexeme = yylvp - yylvals;",
" yyps->save = save; ",
" }",
" if (yytable[yyn] == ctry) {",
"#if YYDEBUG",
" if (yydebug)",
" printf(\"yydebug[%d,%d]: state %d, shifting to state %d\\n\",",
" yydepth, (int)yytrial, yystate, yyctable[ctry]);",
"#endif",
" if (yychar < 0)",
" yylvp++, yylpp++, yylexp++;",
" yychar = -1;",
" if (yyps->errflag > 0) --yyps->errflag;",
" yystate = yyctable[ctry];",
" goto yyshift; ",
" } else {",
" yyn = yyctable[ctry];",
" goto yyreduce; ",
" } ",
" }",
"",
" //",
" // Is action a shift?",
" //",
" if ((yyn = yysindex[yystate]) &&",
" (yyn += yychar) >= 0 &&",
" yyn <= YYTABLESIZE &&",
" yycheck[yyn] == yychar) {",
"#if YYDEBUG",
" if (yydebug)",
" printf(\"yydebug[%d,%d]: state %d, shifting to state %d\\n\",",
" yydepth, (int)yytrial, yystate, yytable[yyn]);",
"#endif",
" yychar = (-1);",
" if (yyps->errflag > 0) --yyps->errflag;",
" yystate = yytable[yyn];",
" yyshift:",
" if (yyps->ssp >= yyps->ss + yyps->stacksize - 1) {",
" YYMoreStack(yyps);",
" }",
" *++(yyps->ssp) = yystate;",
" *++(yyps->vsp) = yylval;",
" *++(yyps->psp) = yyposn;",
" goto yyloop;",
" }",
" if ((yyn = yyrindex[yystate]) &&",
" (yyn += yychar) >= 0 &&",
" yyn <= YYTABLESIZE &&",
" yycheck[yyn] == yychar) {",
" yyn = yytable[yyn];",
" goto yyreduce;",
" }",
"",
" //",
" // Action: error",
" //",
" if (yyps->errflag) goto yyinrecovery;",
" yynewerrflag = 1;",
" goto yyerrhandler;",
"yyerrlab:",
" yynewerrflag = 0;",
"yyerrhandler:",
" while (yyps->save) { ",
" int ctry; ",
" yyparsestate *save = yyps->save;",
"#if YYDEBUG",
" if (yydebug)",
" printf(\"yydebug[%d,%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\\n\",",
" yydepth, (int)yytrial, yystate, yyps->save->state, yylvp - yylvals - yyps->save->lexeme);",
"#endif",
" // Memorize most forward-looking error state in case",
" // it's really an error.",
" if(yyerrctx==NULL || yyerrctx->lexeme<yylvp-yylvals) {",
" // Free old saved error context state",
" if(yyerrctx) YYFreeState(yyerrctx);",
" // Create and fill out new saved error context state",
" yyerrctx = YYNewState(yyps->ssp - yyps->ss);",
" yyerrctx->save = yyps->save;",
" yyerrctx->state = yystate;",
" yyerrctx->errflag = yyps->errflag;",
" yyerrctx->ssp = yyerrctx->ss + (yyps->ssp - yyps->ss);",
" yyerrctx->vsp = yyerrctx->vs + (yyps->vsp - yyps->vs);",
" yyerrctx->psp = yyerrctx->ps + (yyps->psp - yyps->ps);",
" memcpy (yyerrctx->ss, yyps->ss, (yyps->ssp - yyps->ss + 1)*sizeof(Yshort));",
" YYSCopy(yyerrctx->vs, yyps->vs, (yyps->ssp - yyps->ss + 1));",
" YYPCopy(yyerrctx->ps, yyps->ps, (yyps->ssp - yyps->ss + 1));",
" yyerrctx->lexeme = yylvp - yylvals;",
" }",
" yylvp = yylvals + save->lexeme;",
" yylpp = yylpsns + save->lexeme;",
" yylexp = yylexemes + save->lexeme;",
" yychar = -1;",
" yyps->ssp = yyps->ss + (save->ssp - save->ss);",
" yyps->vsp = yyps->vs + (save->vsp - save->vs);",
" yyps->psp = yyps->ps + (save->psp - save->ps);",
" memcpy (yyps->ss, save->ss, (yyps->ssp - yyps->ss + 1) * sizeof(Yshort));",
" YYSCopy(yyps->vs, save->vs, yyps->vsp - yyps->vs + 1);",
" YYPCopy(yyps->ps, save->ps, yyps->psp - yyps->ps + 1);",
" ctry = ++save->ctry;",
" yystate = save->state;",
" // We tried shift, try reduce now",
" if ((yyn = yyctable[ctry]) >= 0) {",
" goto yyreduce;",
" }",
" yyps->save = save->save;",
" YYFreeState(save);",
" //",
" // Nothing left on the stack -- error",
" //",
" if (!yyps->save) {",
"#if YYDEBUG",
" if (yydebug) {",
" printf(\"yydebug[%d]: trial parse FAILED, entering ERROR mode\\n\", ",
"\t (int)yytrial);",
" }",
"#endif",
" // Restore state as it was in the most forward-advanced error",
" yylvp = yylvals + yyerrctx->lexeme;",
" yylpp = yylpsns + yyerrctx->lexeme;",
" yylexp = yylexemes + yyerrctx->lexeme;",
" yychar = yylexp[-1];",
" yylval = yylvp[-1];",
" yyposn = yylpp[-1];",
" yyps->ssp = yyps->ss + (yyerrctx->ssp - yyerrctx->ss);",
" yyps->vsp = yyps->vs + (yyerrctx->vsp - yyerrctx->vs);",
" yyps->psp = yyps->ps + (yyerrctx->psp - yyerrctx->ps);",
" memcpy (yyps->ss, yyerrctx->ss, (yyps->ssp - yyps->ss + 1) * sizeof(Yshort));",
" YYSCopy(yyps->vs, yyerrctx->vs, yyps->vsp - yyps->vs + 1);",
" YYPCopy(yyps->ps, yyerrctx->ps, yyps->psp - yyps->ps + 1);",
" yystate = yyerrctx->state;",
" YYFreeState(yyerrctx);",
" yyerrctx = NULL;",
" }",
" yynewerrflag = 1; ",
" }",
" if (yynewerrflag) {",
"#ifdef YYERROR_DETAILED",
" yyerror_detailed(\"syntax error\", yychar, yylval, yyposn);",
"#else",
" yyerror(\"syntax error\");",
"#endif",
" }",
" ++yynerrs;",
" yyinrecovery:",
" if (yyps->errflag < 3) {",
" yyps->errflag = 3;",
" for (;;) {",
" if ((yyn = yysindex[*(yyps->ssp)]) && ",
"\t (yyn += YYERRCODE) >= 0 &&",
" yyn <= YYTABLESIZE && ",
"\t yycheck[yyn] == YYERRCODE) {",
"#if YYDEBUG",
" if (yydebug)",
" printf(\"yydebug[%d,%d]: state %d, ERROR recovery shifts to state %d\\n\",",
" yydepth, (int)yytrial, *(yyps->ssp), yytable[yyn]);",
"#endif",
" /* Use label yyerrlab, so that compiler does not warn */",
" if(yyps->errflag != yyps->errflag) goto yyerrlab;",
" yystate = yytable[yyn];",
" goto yyshift; ",
" } else {",
"#if YYDEBUG",
" if (yydebug)",
" printf(\"yydebug[%d,%d]: ERROR recovery discards state %d\\n\",",
" yydepth, (int)yytrial, *(yyps->ssp));",
"#endif",
" if (yyps->ssp <= yyps->ss) {",
"\t goto yyabort;",
"\t}",
"\tif(!yytrial) {",
"\t YYDELETEVAL(yyps->vsp[0],1);",
"\t YYDELETEPOSN(yyps->psp[0],1);",
"\t}",
" --(yyps->ssp);",
" --(yyps->vsp);",
" --(yyps->psp);",
" }",
" }",
" } else {",
" if (yychar == 0) goto yyabort;",
"#if YYDEBUG",
" if (yydebug) {",
" yys = 0;",
" if (yychar <= YYMAXTOKEN) yys = yyname[yychar];",
" if (!yys) yys = \"illegal-symbol\";",
" printf(\"yydebug[%d,%d]: state %d, ERROR recovery discards token %d (%s)\\n\",",
" yydepth, (int)yytrial, yystate, yychar, yys); ",
" }",
"#endif",
" if(!yytrial) {",
" YYDELETEVAL(yylval,0);",
" YYDELETEPOSN(yyposn,0);",
" }",
" yychar = (-1);",
" goto yyloop;",
" }",
"",
" //",
" // Reduce the rule",
" //",
"yyreduce:",
" yym = yylen[yyn];",
"#if YYDEBUG",
" if (yydebug) {",
" printf(\"yydebug[%d,%d]: state %d, reducing by rule %d (%s)\",",
" yydepth, (int)yytrial, yystate, yyn, yyrule[yyn]);",
"#ifdef YYDBPR",
" if (yym) {",
" int i;",
" printf(\"<\");",
" for (i=yym; i>0; i--) {",
" if (i!=yym) printf(\", \");",
" YYDBPR((yyps->vsp)[1-i]);",
" }",
" printf(\">\");",
" }",
"#endif",
" printf(\"\\n\");",
" }",
"#endif",
" if (yyps->ssp + 1 - yym >= yyps->ss + yyps->stacksize) {",
" YYMoreStack(yyps);",
" }",
"",
" /* \"$$ = NULL\" default action */",
" memset(&yyps->val, 0, sizeof(yyps->val));",
"",
" /* default reduced position is NULL -- no position at all.",
" no position will be assigned at trial time and if no position handling is present */",
" memset(&yyps->pos, 0, sizeof(yyps->pos));",
"",
" reduce_posn = TRUE;",
"",
" switch (yyn) {",
"",
0
};
char *trailer[] =
{
"#line 567 \"btyaccpa.ske\"",
"",
" default:",
" break;",
" }",
"",
"#if YYDEBUG && defined(YYDBPR)",
" if (yydebug) {",
" printf(\"yydebug[%d]: after reduction, result is \", yytrial);",
" YYDBPR(yyps->val);",
" printf(\"\\n\");",
" }",
"#endif",
"",
" // Perform user-defined position reduction",
"#ifdef YYREDUCEPOSNFUNC",
" if(!yytrial) {",
" YYCALLREDUCEPOSN(YYREDUCEPOSNFUNCARG);",
" }",
"#endif",
"",
" yyps->ssp -= yym;",
" yystate = *(yyps->ssp);",
" yyps->vsp -= yym;",
" yyps->psp -= yym;",
"",
" yym = yylhs[yyn];",
" if (yystate == 0 && yym == 0) {",
"#if YYDEBUG",
" if (yydebug) {",
" printf(\"yydebug[%d,%d]: after reduction, shifting from state 0 to state %d\\n\", ",
"\t yydepth, (int)yytrial, YYFINAL);",
" }",
"#endif",
" yystate = YYFINAL;",
" *++(yyps->ssp) = YYFINAL;",
" *++(yyps->vsp) = yyps->val;",
" yyretlval = yyps->val;\t// return value of root non-terminal to yylval",
" *++(yyps->psp) = yyps->pos;",
" yyretposn = yyps->pos;\t// return value of root position to yyposn",
" if (yychar < 0) {",
" if ((yychar = YYLex1()) < 0) {",
" yychar = 0;",
" }",
"#if YYDEBUG",
" if (yydebug) {",
" yys = 0;",
" if (yychar <= YYMAXTOKEN) yys = yyname[yychar];",
" if (!yys) yys = \"illegal-symbol\";",
" printf(\"yydebug[%d,%d]: state %d, reading %d (%s)\\n\", ",
"\t yydepth, (int)yytrial, YYFINAL, yychar, yys); ",
" }",
"#endif",
" }",
" if (yychar == 0) goto yyaccept;",
" goto yyloop;",
" }",
"",
" if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&",
" yyn <= YYTABLESIZE && yycheck[yyn] == yystate) {",
" yystate = yytable[yyn];",
" } else {",
" yystate = yydgoto[yym];",
" }",
"#if YYDEBUG",
" if (yydebug)",
" printf(\"yydebug[%d,%d]: after reduction, shifting from state %d to state %d\\n\",",
" yydepth, (int)yytrial, *(yyps->ssp), yystate);",
"#endif",
" if (yyps->ssp >= yyps->ss + yyps->stacksize - 1) {",
" YYMoreStack(yyps);",
" }",
" *++(yyps->ssp) = yystate;",
" *++(yyps->vsp) = yyps->val;",
" *++(yyps->psp) = yyps->pos;",
" goto yyloop;",
"",
"",
" //",
" // Reduction declares that this path is valid.",
" // Set yypath and do a full parse",
" //",
"yyvalid:",
" if (yypath) {",
" goto yyabort;",
" }",
" while (yyps->save) {",
" yyparsestate *save = yyps->save;",
" yyps->save = save->save;",
" save->save = yypath;",
" yypath = save;",
" }",
"#if YYDEBUG",
" if (yydebug)",
" printf(\"yydebug[%d,%d]: CONFLICT trial successful, backtracking to state %d, %d tokens\\n\",",
" yydepth, (int)yytrial, yypath->state, yylvp - yylvals - yypath->lexeme);",
"#endif",
" if(yyerrctx) {",
" YYFreeState(yyerrctx); yyerrctx = NULL;",
" }",
" yychar = -1;",
" yyps->ssp = yyps->ss + (yypath->ssp - yypath->ss);",
" yyps->vsp = yyps->vs + (yypath->vsp - yypath->vs);",
" yyps->psp = yyps->ps + (yypath->psp - yypath->ps);",
" memcpy (yyps->ss, yypath->ss, (yyps->ssp - yyps->ss + 1) * sizeof(Yshort));",
" YYSCopy(yyps->vs, yypath->vs, yyps->vsp - yyps->vs + 1);",
" YYPCopy(yyps->ps, yypath->ps, yyps->psp - yyps->ps + 1);",
" yylvp = yylvals + yypath->lexeme;",
" yylpp = yylpsns + yypath->lexeme;",
" yylexp = yylexemes + yypath->lexeme;",
" yystate = yypath->state;",
" goto yyloop;",
"",
"",
"yyabort:",
" if(yyerrctx) {",
" YYFreeState(yyerrctx); yyerrctx = NULL;",
" }",
"",
" YYSTYPE *pv;",
" for(pv=yyps->vs; pv<yyps->vsp; pv++) {",
" YYDELETEVAL(*pv,2);",
" }",
"",
" YYPOSN *pp;",
" for(pp=yyps->ps; pp<yyps->psp; pp++) {",
" YYDELETEPOSN(*pp,2);",
" }",
"",
" while (yyps) {",
" yyparsestate *save = yyps;",
" yyps = save->save;",
" YYFreeState(save);",
" }",
" while (yypath) {",
" yyparsestate *save = yypath;",
" yypath = save->save;",
" YYFreeState(save); ",
" }",
" return (1);",
"",
"",
"yyaccept:",
" if (yyps->save) goto yyvalid;",
" if(yyerrctx) {",
" YYFreeState(yyerrctx); yyerrctx = NULL;",
" }",
" while (yyps) {",
" yyparsestate *save = yyps;",
" yyps = save->save;",
" YYFreeState(save);",
" }",
" while (yypath) {",
" yyparsestate *save = yypath;",
" yypath = save->save;",
" YYFreeState(save); ",
" }",
" return (0);",
"}",
"",
"",
"int YYLex1() {",
" if(yylvp<yylve) {",
" yylval = *yylvp++;",
" yyposn = *yylpp++;",
" return *yylexp++;",
" } else {",
" if(yyps->save) {",
" if(yylvp==yylvlim) {",
"\tyyexpand();",
" }",
" *yylexp = yylex();",
" *yylvp++ = yylval;",
" yylve++;",
" *yylpp++ = yyposn;",
" yylpe++;",
" return *yylexp++;",
" } else {",
" return yylex();",
" }",
" }",
"}",
"",
"int yyexpand() {",
" int p = yylvp-yylvals;",
" int s = yylvlim-yylvals;",
" s += YYSTACKGROWTH;",
" { Yshort *tl = yylexemes; ",
" YYSTYPE *tv = yylvals;",
" YYPOSN *tp = yylpsns;",
" yylvals = new YYSTYPE[s];",
" yylpsns = new YYPOSN[s];",
" yylexemes = new Yshort[s];",
" memcpy(yylexemes, tl, (s-YYSTACKGROWTH)*sizeof(Yshort));",
" YYSCopy(yylvals, tv, s-YYSTACKGROWTH);",
" YYPCopy(yylpsns, tp, s-YYSTACKGROWTH);",
" delete[] tl;",
" delete[] tv;",
" delete[] tp;",
" }",
" yylvp = yylve = yylvals + p;",
" yylvlim = yylvals + s;",
" yylpp = yylpe = yylpsns + p;",
" yylplim = yylpsns + s;",
" yylexp = yylexemes + p;",
" return 0;",
"}",
"",
"void YYSCopy(YYSTYPE *to, YYSTYPE *from, int size) {",
" int i; ",
" for (i = size-1; i >= 0; i--) {",
" to[i] = from[i];",
" }",
"}",
"",
"void YYPCopy(YYPOSN *to, YYPOSN *from, int size) {",
" int i; ",
" for (i = size-1; i >= 0; i--) {",
" to[i] = from[i];",
" }",
"}",
"",
"void YYMoreStack(yyparsestate *yyps) {",
" int p = yyps->ssp - yyps->ss; ",
" Yshort *tss = yyps->ss;",
" YYSTYPE *tvs = yyps->vs;",
" YYPOSN *tps = yyps->ps;",
" yyps->ss = new Yshort [yyps->stacksize + YYSTACKGROWTH]; ",
" yyps->vs = new YYSTYPE[yyps->stacksize + YYSTACKGROWTH]; ",
" yyps->ps = new YYPOSN [yyps->stacksize + YYSTACKGROWTH]; ",
" memcpy(yyps->ss, tss, yyps->stacksize * sizeof(Yshort)); ",
" YYSCopy(yyps->vs, tvs, yyps->stacksize); ",
" YYPCopy(yyps->ps, tps, yyps->stacksize); ",
" yyps->stacksize += YYSTACKGROWTH; ",
" delete[] tss;",
" delete[] tvs;",
" delete[] tps;",
" yyps->ssp = yyps->ss + p; ",
" yyps->vsp = yyps->vs + p; ",
" yyps->psp = yyps->ps + p; ",
"}",
"",
"yyparsestate *YYNewState(int size) {",
" yyparsestate *p = new yyparsestate;",
" p->stacksize = size+4;",
" p->ss = new Yshort [size + 4];",
" p->vs = new YYSTYPE[size + 4];",
" p->ps = new YYPOSN [size + 4];",
" memset(&p->vs[0], 0, (size+4)*sizeof(YYSTYPE));",
" memset(&p->ps[0], 0, (size+4)*sizeof(YYPOSN));",
" return p;",
"}",
"",
"void YYFreeState(yyparsestate *p) {",
" delete[] p->ss;",
" delete[] p->vs;",
" delete[] p->ps;",
" delete p;",
"}",
0
};
struct section section_list[] = {
{ "banner", &banner[0] },
{ "tables", &tables[0] },
{ "header", &header[0] },
{ "body", &body[0] },
{ "trailer", &trailer[0] },
{ 0, 0 } };
|