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