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