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