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