Imported Upstream version 20160606
[platform/upstream/byacc.git] / test / btyacc / btyacc_demo.tab.c
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    demo_parse
22 #endif /* yyparse */
23
24 #ifndef yylex
25 #define yylex      demo_lex
26 #endif /* yylex */
27
28 #ifndef yyerror
29 #define yyerror    demo_error
30 #endif /* yyerror */
31
32 #ifndef yychar
33 #define yychar     demo_char
34 #endif /* yychar */
35
36 #ifndef yyval
37 #define yyval      demo_val
38 #endif /* yyval */
39
40 #ifndef yylval
41 #define yylval     demo_lval
42 #endif /* yylval */
43
44 #ifndef yydebug
45 #define yydebug    demo_debug
46 #endif /* yydebug */
47
48 #ifndef yynerrs
49 #define yynerrs    demo_nerrs
50 #endif /* yynerrs */
51
52 #ifndef yyerrflag
53 #define yyerrflag  demo_errflag
54 #endif /* yyerrflag */
55
56 #ifndef yylhs
57 #define yylhs      demo_lhs
58 #endif /* yylhs */
59
60 #ifndef yylen
61 #define yylen      demo_len
62 #endif /* yylen */
63
64 #ifndef yydefred
65 #define yydefred   demo_defred
66 #endif /* yydefred */
67
68 #ifndef yystos
69 #define yystos     demo_stos
70 #endif /* yystos */
71
72 #ifndef yydgoto
73 #define yydgoto    demo_dgoto
74 #endif /* yydgoto */
75
76 #ifndef yysindex
77 #define yysindex   demo_sindex
78 #endif /* yysindex */
79
80 #ifndef yyrindex
81 #define yyrindex   demo_rindex
82 #endif /* yyrindex */
83
84 #ifndef yygindex
85 #define yygindex   demo_gindex
86 #endif /* yygindex */
87
88 #ifndef yytable
89 #define yytable    demo_table
90 #endif /* yytable */
91
92 #ifndef yycheck
93 #define yycheck    demo_check
94 #endif /* yycheck */
95
96 #ifndef yyname
97 #define yyname     demo_name
98 #endif /* yyname */
99
100 #ifndef yyrule
101 #define yyrule     demo_rule
102 #endif /* yyrule */
103
104 #ifndef yyloc
105 #define yyloc      demo_loc
106 #endif /* yyloc */
107
108 #ifndef yylloc
109 #define yylloc     demo_lloc
110 #endif /* yylloc */
111
112 #if YYBTYACC
113
114 #ifndef yycindex
115 #define yycindex   demo_cindex
116 #endif /* yycindex */
117
118 #ifndef yyctable
119 #define yyctable   demo_ctable
120 #endif /* yyctable */
121
122 #endif /* YYBTYACC */
123
124 #define YYPREFIX "demo_"
125
126 #define YYPURE 0
127
128 #line 15 "btyacc_demo.y"
129 /* dummy types just for compile check */
130 typedef int Code;
131 typedef int Decl_List;
132 typedef int Expr;
133 typedef int Expr_List;
134 typedef int Scope;
135 typedef int Type;
136 enum Operator { ADD, SUB, MUL, MOD, DIV, DEREF };
137
138 typedef unsigned char bool;
139 typedef struct Decl {
140     Scope *scope;
141     Type  *type;
142     bool (*istype)(void);
143 } Decl;
144
145 #include "btyacc_demo.tab.h"
146 #include <stdlib.h>
147 #include <stdio.h>
148 #ifdef YYSTYPE
149 #undef  YYSTYPE_IS_DECLARED
150 #define YYSTYPE_IS_DECLARED 1
151 #endif
152 #ifndef YYSTYPE_IS_DECLARED
153 #define YYSTYPE_IS_DECLARED 1
154 #line 36 "btyacc_demo.y"
155 typedef union {
156     Scope       *scope;
157     Expr        *expr;
158     Expr_List   *elist;
159     Type        *type;
160     Decl        *decl;
161     Decl_List   *dlist;
162     Code        *code;
163     char        *id;
164     } YYSTYPE;
165 #endif /* !YYSTYPE_IS_DECLARED */
166 #line 167 "btyacc_demo.tab.c"
167
168 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
169 /* Default: YYLTYPE is the text position type. */
170 typedef struct YYLTYPE
171 {
172     int first_line;
173     int first_column;
174     int last_line;
175     int last_column;
176 } YYLTYPE;
177 #define YYLTYPE_IS_DECLARED 1
178 #endif
179
180 /* compatibility with bison */
181 #ifdef YYPARSE_PARAM
182 /* compatibility with FreeBSD */
183 # ifdef YYPARSE_PARAM_TYPE
184 #  define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
185 # else
186 #  define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
187 # endif
188 #else
189 # define YYPARSE_DECL() yyparse(void)
190 #endif
191
192 /* Parameters sent to lex. */
193 #ifdef YYLEX_PARAM
194 # define YYLEX_DECL() yylex(void *YYLEX_PARAM)
195 # define YYLEX yylex(YYLEX_PARAM)
196 #else
197 # define YYLEX_DECL() yylex(void)
198 # define YYLEX yylex()
199 #endif
200
201 /* Parameters sent to yyerror. */
202 #ifndef YYERROR_DECL
203 #define YYERROR_DECL() yyerror(YYLTYPE loc, const char *s)
204 #endif
205 #ifndef YYERROR_CALL
206 #define YYERROR_CALL(msg) yyerror(yylloc, msg)
207 #endif
208
209 #ifndef YYDESTRUCT_DECL
210 #define YYDESTRUCT_DECL() yydestruct(const char *msg, int psymb, YYSTYPE *val, YYLTYPE *loc)
211 #endif
212 #ifndef YYDESTRUCT_CALL
213 #define YYDESTRUCT_CALL(msg, psymb, val, loc) yydestruct(msg, psymb, val, loc)
214 #endif
215
216 extern int YYPARSE_DECL();
217
218 #define PREFIX 257
219 #define POSTFIX 258
220 #define ID 259
221 #define CONSTANT 260
222 #define EXTERN 261
223 #define REGISTER 262
224 #define STATIC 263
225 #define CONST 264
226 #define VOLATILE 265
227 #define IF 266
228 #define THEN 267
229 #define ELSE 268
230 #define CLCL 269
231 #define YYERRCODE 256
232 typedef short YYINT;
233 static const YYINT demo_lhs[] = {                        -1,
234    15,   15,   15,   12,   18,    0,    4,   19,    4,    2,
235    20,    2,   10,   10,   13,   13,   11,   11,   11,   11,
236    11,   14,   14,   21,   22,    3,    3,    8,    8,   23,
237    24,    8,    8,    8,    8,   16,   16,   17,   17,    9,
238     1,    1,    1,    1,    1,    1,    1,    1,    5,    5,
239    25,   26,    5,    5,   27,    5,    6,    6,    7,
240 };
241 static const YYINT demo_len[] = {                         2,
242     0,    1,    3,    2,    0,    2,    0,    0,    3,    3,
243     0,    4,    1,    3,    0,    2,    1,    1,    1,    1,
244     1,    1,    1,    0,    0,    5,    1,    0,    1,    0,
245     0,    5,    5,    5,    6,    0,    1,    4,    1,    2,
246     4,    4,    4,    4,    4,    3,    1,    1,    1,    2,
247     0,    0,   11,    8,    0,    2,    0,    3,    4,
248 };
249 static const YYINT demo_defred[] = {                      5,
250     0,    7,    0,    0,   19,   20,   21,   22,   23,    2,
251     9,    0,   13,   18,   17,    0,   15,   30,   29,    0,
252     0,    0,    0,    0,   31,   10,   24,   24,   24,    0,
253    14,    3,   16,   25,    0,   25,    0,    0,    8,   12,
254     0,    0,    0,   39,    0,    0,    0,    8,   47,   48,
255     0,   57,    0,   32,    0,    0,   15,   30,    0,   30,
256    30,   30,   30,   30,   34,    0,    0,    0,   46,    0,
257     0,    0,    0,    0,   59,    0,   38,    0,    0,   43,
258    45,   44,    0,    0,   49,   58,    0,   30,   50,   56,
259     0,    0,    0,   51,    0,    0,   52,    0,   53,
260 };
261 static const YYINT demo_stos[] = {                        0,
262   271,  289,  275,  290,  261,  262,  263,  264,  265,  269,
263   273,  281,  282,  283,  285,  286,   42,   40,  259,  274,
264   279,  290,  259,  284,  294,   59,   44,   40,   91,  291,
265   282,  269,  285,  292,  295,  292,  292,  292,  123,  278,
266   293,  279,  293,  280,  281,  287,  288,   42,  259,  260,
267   272,  290,  279,   41,  279,  279,   41,   44,  290,   43,
268    45,   42,   47,   37,   93,  277,  284,  294,  272,  294,
269   294,  294,  294,  294,  125,  290,  280,  272,  272,  272,
270   272,  272,  266,  272,  273,  276,  298,   40,   59,  278,
271   294,  272,   41,  267,  296,  276,  268,  297,  276,
272 };
273 static const YYINT demo_dgoto[] = {                       1,
274    84,   85,   20,    3,   86,   66,   40,   21,   44,   12,
275    13,   14,   24,   15,   16,   46,   47,    2,   22,   30,
276    34,   41,   25,   35,   95,   98,   87,
277 };
278 static const YYINT demo_sindex[] = {                      0,
279     0,    0,    0, -103,    0,    0,    0,    0,    0,    0,
280     0,  -31,    0,    0,    0, -238,    0,    0,    0,    4,
281   -36, -103,    0, -133,    0,    0,    0,    0,    0,  -94,
282     0,    0,    0,    0,  -40,    0, -103,  -33,    0,    0,
283   -40,  -25,  -40,    0,  -31,    8,   15,    0,    0,    0,
284    -2,    0,  -36,    0,  -36,  -36,    0,    0,  -33,    0,
285     0,    0,    0,    0,    0,  -92, -133, -103,    0,  -33,
286   -33,  -33,  -33,  -33,    0,   -8,    0,   23,   23,    0,
287     0,    0,   11,   75,    0,    0,  -94,    0,    0,    0,
288   -33,   96, -194,    0,   -8,    0,    0,   -8,    0,
289 };
290 static const YYINT demo_rindex[] = {                      0,
291     0,    0,    1, -181,    0,    0,    0,    0,    0,    0,
292     0,   17,    0,    0,    0,    0,    0,    0,    0,    0,
293   -39, -181,   12,  -34,    0,    0,    0,    0,    0,    0,
294     0,    0,    0,    0,   -5,    0,  -11,    0,    0,    0,
295   -17,    0,   28,    0,  -41,    0,   47,    0,    0,    0,
296     0,    0,  -13,    0,   18,   70,    0,    0,    0,    0,
297     0,    0,    0,    0,    0,  -19,  -27, -181,    0,    0,
298     0,    0,    0,    0,    0,  -29,    0,   56,   64,    0,
299     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
300     0,    0,    0,    0,  -29,  -30,    0,  -29,    0,
301 };
302 #if YYBTYACC
303 static const YYINT demo_cindex[] = {                      0,
304     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
305     0,  -22,    0,    0,    0,    0,    0,    0,    0,    0,
306     0,    0, -179,    0,    0,    0,    0,    0,    0,    0,
307     0,    0,    0,    0,   52,    0,    0,    0,    0,    0,
308    58,    0,   62,    0,  -21,    0,    0,    0,    0,    0,
309     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
310     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
311     0,    0,    0,    0,    0, -146,    0,    0,    0,    0,
312     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
313     0,    0,    0,    0, -143, -147,    0, -134,    0,
314 };
315 #endif
316 static const YYINT demo_gindex[] = {                      0,
317     9,  143,    0,    0,   50,    0,   63,  101,   83,    7,
318   130,    0,   98,    2,    0,    0,    0,    0,   19,    0,
319    10,  117,   66,    0,    0,    0,    0,
320 };
321 #define YYTABLESIZE 286
322 static const YYINT demo_table[] = {                      28,
323     6,   17,   28,   28,   27,   24,   24,   24,   48,   24,
324    17,   54,   35,   35,   28,   54,   35,    0,    0,   27,
325    23,    4,    8,   28,   24,   33,   28,   33,   39,   36,
326    33,   35,   75,   48,   64,   28,   36,   37,   38,   62,
327    60,   28,   61,   45,   63,   33,   51,   27,   57,   28,
328    88,    4,    4,    4,   29,    4,   24,   52,   58,   64,
329    28,   26,   26,   35,   62,   29,   59,   69,   33,   63,
330     4,   28,   94,   28,   45,   28,   26,    1,   78,   79,
331    80,   81,   82,   11,   76,   28,   28,   37,   24,    6,
332    65,    0,   54,   55,   54,   35,   41,    0,   41,   92,
333    41,    0,    4,    8,   42,   28,   42,   28,   42,   33,
334    40,   64,    9,   40,   41,    9,   62,   60,   28,   61,
335    12,   63,   42,   68,    9,   70,   71,   72,   73,   74,
336     8,    9,   64,   89,    4,   42,   93,   62,   60,   28,
337    61,   53,   63,   55,   96,   56,   11,   99,   41,   90,
338    77,   31,   43,   91,   67,    0,   42,    5,    6,    7,
339     8,    9,    0,    0,    0,   10,    0,    0,    0,    0,
340     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
341     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
342     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
343     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
344     0,    0,    0,    0,    0,    0,    0,    0,   19,    8,
345     8,    8,    8,    8,   24,   49,   50,    8,   54,   54,
346    54,   54,   54,   54,   54,   54,    3,    3,   54,    8,
347     8,    8,    8,    8,    8,    8,    8,    1,    0,    8,
348     0,   50,    5,    6,    7,    8,    9,   83,    0,    8,
349    10,    8,    8,    8,    8,    8,    0,    0,    0,    8,
350     4,    0,    4,    4,    4,    4,    4,    8,    8,    8,
351     8,    8,    0,    0,    0,    8,
352 };
353 static const YYINT demo_check[] = {                      41,
354     0,   42,   44,   40,   44,   40,   41,   42,   42,   44,
355    42,   42,   40,   41,   40,   41,   44,   40,   40,   59,
356   259,    3,   42,   41,   59,   24,   44,   41,  123,   41,
357    44,   59,  125,   42,   37,   41,   27,   28,   29,   42,
358    43,   59,   45,   37,   47,   59,   38,   44,   41,   91,
359    40,   40,   41,   42,   91,   44,   91,   39,   44,   37,
360    44,   44,   59,   91,   42,   91,   48,   59,   67,   47,
361    59,   44,  267,   91,   68,   59,   59,  259,   70,   71,
362    72,   73,   74,  123,   66,   91,   59,   41,  123,  269,
363    93,   40,  123,  123,  125,  123,   41,   40,   43,   91,
364    45,   40,   91,  123,   41,  123,   43,   91,   45,  123,
365    41,   37,  259,   44,   59,  259,   42,   43,   91,   45,
366   268,   47,   59,   58,  259,   60,   61,   62,   63,   64,
367   264,  265,   37,   59,  123,   35,   41,   42,   43,  123,
368    45,   41,   47,   43,   95,   45,    4,   98,   93,   87,
369    68,   22,   36,   88,   57,   -1,   93,  261,  262,  263,
370   264,  265,   -1,   -1,   -1,  269,   -1,   -1,   -1,   -1,
371    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
372    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
373    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
374    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
375    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  259,  261,
376   262,  263,  264,  265,  259,  259,  260,  269,  259,  260,
377   261,  262,  263,  264,  265,  266,  259,  259,  269,  259,
378   260,  261,  262,  263,  264,  265,  266,  259,   -1,  269,
379    -1,  260,  261,  262,  263,  264,  265,  266,   -1,  259,
380   269,  261,  262,  263,  264,  265,   -1,   -1,   -1,  269,
381   259,   -1,  261,  262,  263,  264,  265,  261,  262,  263,
382   264,  265,   -1,   -1,   -1,  269,
383 };
384 #if YYBTYACC
385 static const YYINT demo_ctable[] = {                     18,
386    28,   -1,   19,    8,   -1,   32,    4,   -1,   49,    1,
387    -1,   97,   54,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
388    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
389    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
390    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
391    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
392    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
393    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
394    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
395    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
396    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
397    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
398    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
399    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
400    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
401    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
402    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
403    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
404    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
405    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
406    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
407    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
408    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
409    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
410    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
411    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
412    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
413    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
414    -1,   -1,   -1,   -1,   -1,
415 };
416 #endif
417 #define YYFINAL 1
418 #ifndef YYDEBUG
419 #define YYDEBUG 0
420 #endif
421 #define YYMAXTOKEN 269
422 #define YYUNDFTOKEN 299
423 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
424 #if YYDEBUG
425 static const char *const demo_name[] = {
426
427 "$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,
428 "'%'",0,0,"'('","')'","'*'","'+'","','","'-'","'.'","'/'",0,0,0,0,0,0,0,0,0,0,0,
429 "';'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'['",0,
430 "']'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'{'",0,"'}'",0,
431 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
432 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
433 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
434 0,0,0,0,0,0,0,0,0,"error","PREFIX","POSTFIX","ID","CONSTANT","EXTERN",
435 "REGISTER","STATIC","CONST","VOLATILE","IF","THEN","ELSE","CLCL","$accept",
436 "input","expr","decl","declarator_list","decl_list","statement",
437 "statement_list","block_statement","declarator","formal_arg","decl_specs",
438 "decl_spec","typename","cv_quals","cv_qual","opt_scope","formal_arg_list",
439 "nonempty_formal_arg_list","$$1","$$2","$$3","$$4","$$5","$$6","$$7","$$8",
440 "$$9","$$10","illegal-symbol",
441 };
442 static const char *const demo_rule[] = {
443 "$accept : input",
444 "opt_scope :",
445 "opt_scope : CLCL",
446 "opt_scope : opt_scope ID CLCL",
447 "typename : opt_scope ID",
448 "$$1 :",
449 "input : $$1 decl_list",
450 "decl_list :",
451 "$$2 :",
452 "decl_list : decl_list $$2 decl",
453 "decl : decl_specs declarator_list ';'",
454 "$$3 :",
455 "decl : decl_specs declarator $$3 block_statement",
456 "decl_specs : decl_spec",
457 "decl_specs : decl_specs $$2 decl_spec",
458 "cv_quals :",
459 "cv_quals : cv_quals cv_qual",
460 "decl_spec : cv_qual",
461 "decl_spec : typename",
462 "decl_spec : EXTERN",
463 "decl_spec : REGISTER",
464 "decl_spec : STATIC",
465 "cv_qual : CONST",
466 "cv_qual : VOLATILE",
467 "$$4 :",
468 "$$5 :",
469 "declarator_list : declarator_list ',' $$4 $$5 declarator",
470 "declarator_list : declarator",
471 "declarator :",
472 "declarator : ID",
473 "$$6 :",
474 "$$7 :",
475 "declarator : '(' $$6 $$7 declarator ')'",
476 "declarator : '*' cv_quals $$4 $$5 declarator",
477 "declarator : declarator '[' $$4 expr ']'",
478 "declarator : declarator '(' $$4 formal_arg_list ')' cv_quals",
479 "formal_arg_list :",
480 "formal_arg_list : nonempty_formal_arg_list",
481 "nonempty_formal_arg_list : nonempty_formal_arg_list ',' $$6 formal_arg",
482 "nonempty_formal_arg_list : formal_arg",
483 "formal_arg : decl_specs declarator",
484 "expr : expr '+' $$6 expr",
485 "expr : expr '-' $$6 expr",
486 "expr : expr '*' $$6 expr",
487 "expr : expr '%' $$6 expr",
488 "expr : expr '/' $$6 expr",
489 "expr : '*' $$2 expr",
490 "expr : ID",
491 "expr : CONSTANT",
492 "statement : decl",
493 "statement : expr ';'",
494 "$$8 :",
495 "$$9 :",
496 "statement : IF '(' $$6 expr ')' THEN $$8 statement ELSE $$9 statement",
497 "statement : IF '(' $$6 expr ')' THEN $$8 statement",
498 "$$10 :",
499 "statement : $$10 block_statement",
500 "statement_list :",
501 "statement_list : statement_list $$2 statement",
502 "block_statement : '{' $$2 statement_list '}'",
503
504 };
505 #endif
506
507 int      yydebug;
508 int      yynerrs;
509
510 int      yyerrflag;
511 int      yychar;
512 YYSTYPE  yyval;
513 YYSTYPE  yylval;
514 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
515 YYLTYPE  yyloc; /* position returned by actions */
516 YYLTYPE  yylloc; /* position from the lexer */
517 #endif
518
519 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
520 #ifndef YYLLOC_DEFAULT
521 #define YYLLOC_DEFAULT(loc, rhs, n) \
522 do \
523 { \
524     if (n == 0) \
525     { \
526         (loc).first_line   = ((rhs)[-1]).last_line; \
527         (loc).first_column = ((rhs)[-1]).last_column; \
528         (loc).last_line    = ((rhs)[-1]).last_line; \
529         (loc).last_column  = ((rhs)[-1]).last_column; \
530     } \
531     else \
532     { \
533         (loc).first_line   = ((rhs)[ 0 ]).first_line; \
534         (loc).first_column = ((rhs)[ 0 ]).first_column; \
535         (loc).last_line    = ((rhs)[n-1]).last_line; \
536         (loc).last_column  = ((rhs)[n-1]).last_column; \
537     } \
538 } while (0)
539 #endif /* YYLLOC_DEFAULT */
540 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
541 #if YYBTYACC
542
543 #ifndef YYLVQUEUEGROWTH
544 #define YYLVQUEUEGROWTH 32
545 #endif
546 #endif /* YYBTYACC */
547
548 /* define the initial stack-sizes */
549 #ifdef YYSTACKSIZE
550 #undef YYMAXDEPTH
551 #define YYMAXDEPTH  YYSTACKSIZE
552 #else
553 #ifdef YYMAXDEPTH
554 #define YYSTACKSIZE YYMAXDEPTH
555 #else
556 #define YYSTACKSIZE 10000
557 #define YYMAXDEPTH  10000
558 #endif
559 #endif
560
561 #ifndef YYINITSTACKSIZE
562 #define YYINITSTACKSIZE 200
563 #endif
564
565 typedef struct {
566     unsigned stacksize;
567     YYINT    *s_base;
568     YYINT    *s_mark;
569     YYINT    *s_last;
570     YYSTYPE  *l_base;
571     YYSTYPE  *l_mark;
572 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
573     YYLTYPE  *p_base;
574     YYLTYPE  *p_mark;
575 #endif
576 } YYSTACKDATA;
577 #if YYBTYACC
578
579 struct YYParseState_s
580 {
581     struct YYParseState_s *save;    /* Previously saved parser state */
582     YYSTACKDATA            yystack; /* saved parser stack */
583     int                    state;   /* saved parser state */
584     int                    errflag; /* saved error recovery status */
585     int                    lexeme;  /* saved index of the conflict lexeme in the lexical queue */
586     YYINT                  ctry;    /* saved index in yyctable[] for this conflict */
587 };
588 typedef struct YYParseState_s YYParseState;
589 #endif /* YYBTYACC */
590 /* variables for the parser stack */
591 static YYSTACKDATA yystack;
592 #if YYBTYACC
593
594 /* Current parser state */
595 static YYParseState *yyps = 0;
596
597 /* yypath != NULL: do the full parse, starting at *yypath parser state. */
598 static YYParseState *yypath = 0;
599
600 /* Base of the lexical value queue */
601 static YYSTYPE *yylvals = 0;
602
603 /* Current position at lexical value queue */
604 static YYSTYPE *yylvp = 0;
605
606 /* End position of lexical value queue */
607 static YYSTYPE *yylve = 0;
608
609 /* The last allocated position at the lexical value queue */
610 static YYSTYPE *yylvlim = 0;
611
612 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
613 /* Base of the lexical position queue */
614 static YYLTYPE *yylpsns = 0;
615
616 /* Current position at lexical position queue */
617 static YYLTYPE *yylpp = 0;
618
619 /* End position of lexical position queue */
620 static YYLTYPE *yylpe = 0;
621
622 /* The last allocated position at the lexical position queue */
623 static YYLTYPE *yylplim = 0;
624 #endif
625
626 /* Current position at lexical token queue */
627 static short  *yylexp = 0;
628
629 static short  *yylexemes = 0;
630 #endif /* YYBTYACC */
631 #line 200 "btyacc_demo.y"
632
633 extern int YYLEX_DECL();
634 extern void YYERROR_DECL();
635
636 extern Scope *global_scope;
637
638 extern Decl * lookup(Scope *scope, char *id);
639 extern Scope * new_scope(Scope *outer_scope);
640 extern Scope * start_fn_def(Scope *scope, Decl *fn_decl);
641 extern void finish_fn_def(Decl *fn_decl, Code *block);
642 extern Type * type_combine(Type *specs, Type *spec);
643 extern Type * bare_extern(void);
644 extern Type * bare_register(void);
645 extern Type * bare_static(void);
646 extern Type * bare_const(void);
647 extern Type * bare_volatile(void);
648 extern Decl * declare(Scope *scope, char *id, Type *type);
649 extern Decl * make_pointer(Decl *decl, Type *type);
650 extern Decl * make_array(Type *type, Expr *expr);
651 extern Decl * build_function(Decl *decl, Decl_List *dlist, Type *type);
652 extern Decl_List * append_dlist(Decl_List *dlist, Decl *decl);
653 extern Decl_List * build_dlist(Decl *decl);
654 extern Expr * build_expr(Expr *left, enum Operator op, Expr *right);
655 extern Expr * var_expr(Scope *scope, char *id);
656 extern Code * build_expr_code(Expr *expr);
657 extern Code * build_if(Expr *cond_expr, Code *then_stmt, Code *else_stmt);
658 extern Code * code_append(Code *stmt_list, Code *stmt);
659 #line 660 "btyacc_demo.tab.c"
660
661 /* Release memory associated with symbol. */
662 #if ! defined YYDESTRUCT_IS_DECLARED
663 static void
664 YYDESTRUCT_DECL()
665 {
666     switch (psymb)
667     {
668         case 43:
669 #line 83 "btyacc_demo.y"
670         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
671                          msg,
672                          (*loc).first_line, (*loc).first_column,
673                          (*loc).last_line, (*loc).last_column);
674                   /* in this example, we don't know what to do here */ }
675         break;
676 #line 677 "btyacc_demo.tab.c"
677         case 45:
678 #line 83 "btyacc_demo.y"
679         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
680                          msg,
681                          (*loc).first_line, (*loc).first_column,
682                          (*loc).last_line, (*loc).last_column);
683                   /* in this example, we don't know what to do here */ }
684         break;
685 #line 686 "btyacc_demo.tab.c"
686         case 42:
687 #line 83 "btyacc_demo.y"
688         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
689                          msg,
690                          (*loc).first_line, (*loc).first_column,
691                          (*loc).last_line, (*loc).last_column);
692                   /* in this example, we don't know what to do here */ }
693         break;
694 #line 695 "btyacc_demo.tab.c"
695         case 47:
696 #line 83 "btyacc_demo.y"
697         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
698                          msg,
699                          (*loc).first_line, (*loc).first_column,
700                          (*loc).last_line, (*loc).last_column);
701                   /* in this example, we don't know what to do here */ }
702         break;
703 #line 704 "btyacc_demo.tab.c"
704         case 37:
705 #line 83 "btyacc_demo.y"
706         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
707                          msg,
708                          (*loc).first_line, (*loc).first_column,
709                          (*loc).last_line, (*loc).last_column);
710                   /* in this example, we don't know what to do here */ }
711         break;
712 #line 713 "btyacc_demo.tab.c"
713         case 257:
714 #line 83 "btyacc_demo.y"
715         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
716                          msg,
717                          (*loc).first_line, (*loc).first_column,
718                          (*loc).last_line, (*loc).last_column);
719                   /* in this example, we don't know what to do here */ }
720         break;
721 #line 722 "btyacc_demo.tab.c"
722         case 258:
723 #line 83 "btyacc_demo.y"
724         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
725                          msg,
726                          (*loc).first_line, (*loc).first_column,
727                          (*loc).last_line, (*loc).last_column);
728                   /* in this example, we don't know what to do here */ }
729         break;
730 #line 731 "btyacc_demo.tab.c"
731         case 40:
732 #line 83 "btyacc_demo.y"
733         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
734                          msg,
735                          (*loc).first_line, (*loc).first_column,
736                          (*loc).last_line, (*loc).last_column);
737                   /* in this example, we don't know what to do here */ }
738         break;
739 #line 740 "btyacc_demo.tab.c"
740         case 91:
741 #line 83 "btyacc_demo.y"
742         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
743                          msg,
744                          (*loc).first_line, (*loc).first_column,
745                          (*loc).last_line, (*loc).last_column);
746                   /* in this example, we don't know what to do here */ }
747         break;
748 #line 749 "btyacc_demo.tab.c"
749         case 46:
750 #line 83 "btyacc_demo.y"
751         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
752                          msg,
753                          (*loc).first_line, (*loc).first_column,
754                          (*loc).last_line, (*loc).last_column);
755                   /* in this example, we don't know what to do here */ }
756         break;
757 #line 758 "btyacc_demo.tab.c"
758         case 259:
759 #line 78 "btyacc_demo.y"
760         { printf("%s accessed by symbol of any type other than <decl>  @ position[%d,%d..%d,%d]\n",
761                          msg,
762                          (*loc).first_line, (*loc).first_column,
763                          (*loc).last_line, (*loc).last_column);
764                   free((*val).id); }
765         break;
766 #line 767 "btyacc_demo.tab.c"
767         case 260:
768 #line 78 "btyacc_demo.y"
769         { printf("%s accessed by symbol of any type other than <decl>  @ position[%d,%d..%d,%d]\n",
770                          msg,
771                          (*loc).first_line, (*loc).first_column,
772                          (*loc).last_line, (*loc).last_column);
773                   free((*val).expr); }
774         break;
775 #line 776 "btyacc_demo.tab.c"
776         case 261:
777 #line 83 "btyacc_demo.y"
778         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
779                          msg,
780                          (*loc).first_line, (*loc).first_column,
781                          (*loc).last_line, (*loc).last_column);
782                   /* in this example, we don't know what to do here */ }
783         break;
784 #line 785 "btyacc_demo.tab.c"
785         case 262:
786 #line 83 "btyacc_demo.y"
787         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
788                          msg,
789                          (*loc).first_line, (*loc).first_column,
790                          (*loc).last_line, (*loc).last_column);
791                   /* in this example, we don't know what to do here */ }
792         break;
793 #line 794 "btyacc_demo.tab.c"
794         case 263:
795 #line 83 "btyacc_demo.y"
796         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
797                          msg,
798                          (*loc).first_line, (*loc).first_column,
799                          (*loc).last_line, (*loc).last_column);
800                   /* in this example, we don't know what to do here */ }
801         break;
802 #line 803 "btyacc_demo.tab.c"
803         case 264:
804 #line 83 "btyacc_demo.y"
805         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
806                          msg,
807                          (*loc).first_line, (*loc).first_column,
808                          (*loc).last_line, (*loc).last_column);
809                   /* in this example, we don't know what to do here */ }
810         break;
811 #line 812 "btyacc_demo.tab.c"
812         case 265:
813 #line 83 "btyacc_demo.y"
814         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
815                          msg,
816                          (*loc).first_line, (*loc).first_column,
817                          (*loc).last_line, (*loc).last_column);
818                   /* in this example, we don't know what to do here */ }
819         break;
820 #line 821 "btyacc_demo.tab.c"
821         case 266:
822 #line 83 "btyacc_demo.y"
823         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
824                          msg,
825                          (*loc).first_line, (*loc).first_column,
826                          (*loc).last_line, (*loc).last_column);
827                   /* in this example, we don't know what to do here */ }
828         break;
829 #line 830 "btyacc_demo.tab.c"
830         case 267:
831 #line 83 "btyacc_demo.y"
832         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
833                          msg,
834                          (*loc).first_line, (*loc).first_column,
835                          (*loc).last_line, (*loc).last_column);
836                   /* in this example, we don't know what to do here */ }
837         break;
838 #line 839 "btyacc_demo.tab.c"
839         case 268:
840 #line 83 "btyacc_demo.y"
841         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
842                          msg,
843                          (*loc).first_line, (*loc).first_column,
844                          (*loc).last_line, (*loc).last_column);
845                   /* in this example, we don't know what to do here */ }
846         break;
847 #line 848 "btyacc_demo.tab.c"
848         case 269:
849 #line 83 "btyacc_demo.y"
850         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
851                          msg,
852                          (*loc).first_line, (*loc).first_column,
853                          (*loc).last_line, (*loc).last_column);
854                   /* in this example, we don't know what to do here */ }
855         break;
856 #line 857 "btyacc_demo.tab.c"
857         case 59:
858 #line 83 "btyacc_demo.y"
859         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
860                          msg,
861                          (*loc).first_line, (*loc).first_column,
862                          (*loc).last_line, (*loc).last_column);
863                   /* in this example, we don't know what to do here */ }
864         break;
865 #line 866 "btyacc_demo.tab.c"
866         case 44:
867 #line 83 "btyacc_demo.y"
868         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
869                          msg,
870                          (*loc).first_line, (*loc).first_column,
871                          (*loc).last_line, (*loc).last_column);
872                   /* in this example, we don't know what to do here */ }
873         break;
874 #line 875 "btyacc_demo.tab.c"
875         case 41:
876 #line 83 "btyacc_demo.y"
877         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
878                          msg,
879                          (*loc).first_line, (*loc).first_column,
880                          (*loc).last_line, (*loc).last_column);
881                   /* in this example, we don't know what to do here */ }
882         break;
883 #line 884 "btyacc_demo.tab.c"
884         case 93:
885 #line 83 "btyacc_demo.y"
886         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
887                          msg,
888                          (*loc).first_line, (*loc).first_column,
889                          (*loc).last_line, (*loc).last_column);
890                   /* in this example, we don't know what to do here */ }
891         break;
892 #line 893 "btyacc_demo.tab.c"
893         case 123:
894 #line 83 "btyacc_demo.y"
895         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
896                          msg,
897                          (*loc).first_line, (*loc).first_column,
898                          (*loc).last_line, (*loc).last_column);
899                   /* in this example, we don't know what to do here */ }
900         break;
901 #line 902 "btyacc_demo.tab.c"
902         case 125:
903 #line 83 "btyacc_demo.y"
904         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
905                          msg,
906                          (*loc).first_line, (*loc).first_column,
907                          (*loc).last_line, (*loc).last_column);
908                   /* in this example, we don't know what to do here */ }
909         break;
910 #line 911 "btyacc_demo.tab.c"
911         case 270:
912 #line 83 "btyacc_demo.y"
913         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
914                          msg,
915                          (*loc).first_line, (*loc).first_column,
916                          (*loc).last_line, (*loc).last_column);
917                   /* in this example, we don't know what to do here */ }
918         break;
919 #line 920 "btyacc_demo.tab.c"
920         case 271:
921 #line 83 "btyacc_demo.y"
922         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
923                          msg,
924                          (*loc).first_line, (*loc).first_column,
925                          (*loc).last_line, (*loc).last_column);
926                   /* in this example, we don't know what to do here */ }
927         break;
928 #line 929 "btyacc_demo.tab.c"
929         case 272:
930 #line 78 "btyacc_demo.y"
931         { printf("%s accessed by symbol of any type other than <decl>  @ position[%d,%d..%d,%d]\n",
932                          msg,
933                          (*loc).first_line, (*loc).first_column,
934                          (*loc).last_line, (*loc).last_column);
935                   free((*val).expr); }
936         break;
937 #line 938 "btyacc_demo.tab.c"
938         case 273:
939 #line 67 "btyacc_demo.y"
940         { /* 'msg' is a 'char *' indicating the context of destructor invocation*/
941                   printf("%s accessed by symbol \"decl\" (case s.b. 273) @ position[%d,%d..%d,%d]\n",
942                          msg,
943                          (*loc).first_line, (*loc).first_column,
944                          (*loc).last_line, (*loc).last_column);
945                   free((*val).decl->scope); free((*val).decl->type); }
946         break;
947 #line 948 "btyacc_demo.tab.c"
948         case 274:
949 #line 83 "btyacc_demo.y"
950         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
951                          msg,
952                          (*loc).first_line, (*loc).first_column,
953                          (*loc).last_line, (*loc).last_column);
954                   /* in this example, we don't know what to do here */ }
955         break;
956 #line 957 "btyacc_demo.tab.c"
957         case 275:
958 #line 83 "btyacc_demo.y"
959         { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n",
960                          msg,
961                          (*loc).first_line, (*loc).first_column,
962                          (*loc).last_line, (*loc).last_column);
963                   /* in this example, we don't know what to do here */ }
964         break;
965 #line 966 "btyacc_demo.tab.c"
966         case 276:
967 #line 78 "btyacc_demo.y"
968         { printf("%s accessed by symbol of any type other than <decl>  @ position[%d,%d..%d,%d]\n",
969                          msg,
970                          (*loc).first_line, (*loc).first_column,
971                          (*loc).last_line, (*loc).last_column);
972                   free((*val).code); }
973         break;
974 #line 975 "btyacc_demo.tab.c"
975         case 277:
976 #line 78 "btyacc_demo.y"
977         { printf("%s accessed by symbol of any type other than <decl>  @ position[%d,%d..%d,%d]\n",
978                          msg,
979                          (*loc).first_line, (*loc).first_column,
980                          (*loc).last_line, (*loc).last_column);
981                   free((*val).code); }
982         break;
983 #line 984 "btyacc_demo.tab.c"
984         case 278:
985 #line 78 "btyacc_demo.y"
986         { printf("%s accessed by symbol of any type other than <decl>  @ position[%d,%d..%d,%d]\n",
987                          msg,
988                          (*loc).first_line, (*loc).first_column,
989                          (*loc).last_line, (*loc).last_column);
990                   free((*val).code); }
991         break;
992 #line 993 "btyacc_demo.tab.c"
993         case 279:
994 #line 73 "btyacc_demo.y"
995         { printf("%s accessed by symbol with type <decl> (case s.b. 279 & 280) @ position[%d,%d..%d,%d]\n",
996                          msg,
997                          (*loc).first_line, (*loc).first_column,
998                          (*loc).last_line, (*loc).last_column);
999                   free((*val).decl); }
1000         break;
1001 #line 1002 "btyacc_demo.tab.c"
1002         case 280:
1003 #line 73 "btyacc_demo.y"
1004         { printf("%s accessed by symbol with type <decl> (case s.b. 279 & 280) @ position[%d,%d..%d,%d]\n",
1005                          msg,
1006                          (*loc).first_line, (*loc).first_column,
1007                          (*loc).last_line, (*loc).last_column);
1008                   free((*val).decl); }
1009         break;
1010 #line 1011 "btyacc_demo.tab.c"
1011         case 281:
1012 #line 78 "btyacc_demo.y"
1013         { printf("%s accessed by symbol of any type other than <decl>  @ position[%d,%d..%d,%d]\n",
1014                          msg,
1015                          (*loc).first_line, (*loc).first_column,
1016                          (*loc).last_line, (*loc).last_column);
1017                   free((*val).type); }
1018         break;
1019 #line 1020 "btyacc_demo.tab.c"
1020         case 282:
1021 #line 78 "btyacc_demo.y"
1022         { printf("%s accessed by symbol of any type other than <decl>  @ position[%d,%d..%d,%d]\n",
1023                          msg,
1024                          (*loc).first_line, (*loc).first_column,
1025                          (*loc).last_line, (*loc).last_column);
1026                   free((*val).type); }
1027         break;
1028 #line 1029 "btyacc_demo.tab.c"
1029         case 283:
1030 #line 78 "btyacc_demo.y"
1031         { printf("%s accessed by symbol of any type other than <decl>  @ position[%d,%d..%d,%d]\n",
1032                          msg,
1033                          (*loc).first_line, (*loc).first_column,
1034                          (*loc).last_line, (*loc).last_column);
1035                   free((*val).type); }
1036         break;
1037 #line 1038 "btyacc_demo.tab.c"
1038         case 284:
1039 #line 78 "btyacc_demo.y"
1040         { printf("%s accessed by symbol of any type other than <decl>  @ position[%d,%d..%d,%d]\n",
1041                          msg,
1042                          (*loc).first_line, (*loc).first_column,
1043                          (*loc).last_line, (*loc).last_column);
1044                   free((*val).type); }
1045         break;
1046 #line 1047 "btyacc_demo.tab.c"
1047         case 285:
1048 #line 78 "btyacc_demo.y"
1049         { printf("%s accessed by symbol of any type other than <decl>  @ position[%d,%d..%d,%d]\n",
1050                          msg,
1051                          (*loc).first_line, (*loc).first_column,
1052                          (*loc).last_line, (*loc).last_column);
1053                   free((*val).type); }
1054         break;
1055 #line 1056 "btyacc_demo.tab.c"
1056         case 286:
1057 #line 78 "btyacc_demo.y"
1058         { printf("%s accessed by symbol of any type other than <decl>  @ position[%d,%d..%d,%d]\n",
1059                          msg,
1060                          (*loc).first_line, (*loc).first_column,
1061                          (*loc).last_line, (*loc).last_column);
1062                   free((*val).scope); }
1063         break;
1064 #line 1065 "btyacc_demo.tab.c"
1065         case 287:
1066 #line 78 "btyacc_demo.y"
1067         { printf("%s accessed by symbol of any type other than <decl>  @ position[%d,%d..%d,%d]\n",
1068                          msg,
1069                          (*loc).first_line, (*loc).first_column,
1070                          (*loc).last_line, (*loc).last_column);
1071                   free((*val).dlist); }
1072         break;
1073 #line 1074 "btyacc_demo.tab.c"
1074         case 288:
1075 #line 78 "btyacc_demo.y"
1076         { printf("%s accessed by symbol of any type other than <decl>  @ position[%d,%d..%d,%d]\n",
1077                          msg,
1078                          (*loc).first_line, (*loc).first_column,
1079                          (*loc).last_line, (*loc).last_column);
1080                   free((*val).dlist); }
1081         break;
1082 #line 1083 "btyacc_demo.tab.c"
1083         case 289:
1084 #line 78 "btyacc_demo.y"
1085         { printf("%s accessed by symbol of any type other than <decl>  @ position[%d,%d..%d,%d]\n",
1086                          msg,
1087                          (*loc).first_line, (*loc).first_column,
1088                          (*loc).last_line, (*loc).last_column);
1089                   free((*val).scope); }
1090         break;
1091 #line 1092 "btyacc_demo.tab.c"
1092         case 290:
1093 #line 78 "btyacc_demo.y"
1094         { printf("%s accessed by symbol of any type other than <decl>  @ position[%d,%d..%d,%d]\n",
1095                          msg,
1096                          (*loc).first_line, (*loc).first_column,
1097                          (*loc).last_line, (*loc).last_column);
1098                   free((*val).scope); }
1099         break;
1100 #line 1101 "btyacc_demo.tab.c"
1101         case 291:
1102 #line 78 "btyacc_demo.y"
1103         { printf("%s accessed by symbol of any type other than <decl>  @ position[%d,%d..%d,%d]\n",
1104                          msg,
1105                          (*loc).first_line, (*loc).first_column,
1106                          (*loc).last_line, (*loc).last_column);
1107                   free((*val).scope); }
1108         break;
1109 #line 1110 "btyacc_demo.tab.c"
1110         case 292:
1111 #line 78 "btyacc_demo.y"
1112         { printf("%s accessed by symbol of any type other than <decl>  @ position[%d,%d..%d,%d]\n",
1113                          msg,
1114                          (*loc).first_line, (*loc).first_column,
1115                          (*loc).last_line, (*loc).last_column);
1116                   free((*val).scope); }
1117         break;
1118 #line 1119 "btyacc_demo.tab.c"
1119         case 293:
1120 #line 78 "btyacc_demo.y"
1121         { printf("%s accessed by symbol of any type other than <decl>  @ position[%d,%d..%d,%d]\n",
1122                          msg,
1123                          (*loc).first_line, (*loc).first_column,
1124                          (*loc).last_line, (*loc).last_column);
1125                   free((*val).type); }
1126         break;
1127 #line 1128 "btyacc_demo.tab.c"
1128         case 294:
1129 #line 78 "btyacc_demo.y"
1130         { printf("%s accessed by symbol of any type other than <decl>  @ position[%d,%d..%d,%d]\n",
1131                          msg,
1132                          (*loc).first_line, (*loc).first_column,
1133                          (*loc).last_line, (*loc).last_column);
1134                   free((*val).scope); }
1135         break;
1136 #line 1137 "btyacc_demo.tab.c"
1137         case 295:
1138 #line 78 "btyacc_demo.y"
1139         { printf("%s accessed by symbol of any type other than <decl>  @ position[%d,%d..%d,%d]\n",
1140                          msg,
1141                          (*loc).first_line, (*loc).first_column,
1142                          (*loc).last_line, (*loc).last_column);
1143                   free((*val).type); }
1144         break;
1145 #line 1146 "btyacc_demo.tab.c"
1146         case 296:
1147 #line 78 "btyacc_demo.y"
1148         { printf("%s accessed by symbol of any type other than <decl>  @ position[%d,%d..%d,%d]\n",
1149                          msg,
1150                          (*loc).first_line, (*loc).first_column,
1151                          (*loc).last_line, (*loc).last_column);
1152                   free((*val).scope); }
1153         break;
1154 #line 1155 "btyacc_demo.tab.c"
1155         case 297:
1156 #line 78 "btyacc_demo.y"
1157         { printf("%s accessed by symbol of any type other than <decl>  @ position[%d,%d..%d,%d]\n",
1158                          msg,
1159                          (*loc).first_line, (*loc).first_column,
1160                          (*loc).last_line, (*loc).last_column);
1161                   free((*val).scope); }
1162         break;
1163 #line 1164 "btyacc_demo.tab.c"
1164         case 298:
1165 #line 78 "btyacc_demo.y"
1166         { printf("%s accessed by symbol of any type other than <decl>  @ position[%d,%d..%d,%d]\n",
1167                          msg,
1168                          (*loc).first_line, (*loc).first_column,
1169                          (*loc).last_line, (*loc).last_column);
1170                   free((*val).scope); }
1171         break;
1172 #line 1173 "btyacc_demo.tab.c"
1173     }
1174 }
1175 #define YYDESTRUCT_IS_DECLARED 1
1176 #endif
1177
1178 /* For use in generated program */
1179 #define yydepth (int)(yystack.s_mark - yystack.s_base)
1180 #if YYBTYACC
1181 #define yytrial (yyps->save)
1182 #endif /* YYBTYACC */
1183
1184 #if YYDEBUG
1185 #include <stdio.h>      /* needed for printf */
1186 #endif
1187
1188 #include <stdlib.h>     /* needed for malloc, etc */
1189 #include <string.h>     /* needed for memset */
1190
1191 /* allocate initial stack or double stack size, up to YYMAXDEPTH */
1192 static int yygrowstack(YYSTACKDATA *data)
1193 {
1194     int i;
1195     unsigned newsize;
1196     YYINT *newss;
1197     YYSTYPE *newvs;
1198 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1199     YYLTYPE *newps;
1200 #endif
1201
1202     if ((newsize = data->stacksize) == 0)
1203         newsize = YYINITSTACKSIZE;
1204     else if (newsize >= YYMAXDEPTH)
1205         return YYENOMEM;
1206     else if ((newsize *= 2) > YYMAXDEPTH)
1207         newsize = YYMAXDEPTH;
1208
1209     i = (int) (data->s_mark - data->s_base);
1210     newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
1211     if (newss == 0)
1212         return YYENOMEM;
1213
1214     data->s_base = newss;
1215     data->s_mark = newss + i;
1216
1217     newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
1218     if (newvs == 0)
1219         return YYENOMEM;
1220
1221     data->l_base = newvs;
1222     data->l_mark = newvs + i;
1223
1224 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1225     newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps));
1226     if (newps == 0)
1227         return YYENOMEM;
1228
1229     data->p_base = newps;
1230     data->p_mark = newps + i;
1231 #endif
1232
1233     data->stacksize = newsize;
1234     data->s_last = data->s_base + newsize - 1;
1235
1236 #if YYDEBUG
1237     if (yydebug)
1238         fprintf(stderr, "%sdebug: stack size increased to %d\n", YYPREFIX, newsize);
1239 #endif
1240     return 0;
1241 }
1242
1243 #if YYPURE || defined(YY_NO_LEAKS)
1244 static void yyfreestack(YYSTACKDATA *data)
1245 {
1246     free(data->s_base);
1247     free(data->l_base);
1248 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1249     free(data->p_base);
1250 #endif
1251     memset(data, 0, sizeof(*data));
1252 }
1253 #else
1254 #define yyfreestack(data) /* nothing */
1255 #endif /* YYPURE || defined(YY_NO_LEAKS) */
1256 #if YYBTYACC
1257
1258 static YYParseState *
1259 yyNewState(unsigned size)
1260 {
1261     YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState));
1262     if (p == NULL) return NULL;
1263
1264     p->yystack.stacksize = size;
1265     if (size == 0)
1266     {
1267         p->yystack.s_base = NULL;
1268         p->yystack.l_base = NULL;
1269 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1270         p->yystack.p_base = NULL;
1271 #endif
1272         return p;
1273     }
1274     p->yystack.s_base    = (YYINT *) malloc(size * sizeof(YYINT));
1275     if (p->yystack.s_base == NULL) return NULL;
1276     p->yystack.l_base    = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
1277     if (p->yystack.l_base == NULL) return NULL;
1278     memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE));
1279 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1280     p->yystack.p_base    = (YYLTYPE *) malloc(size * sizeof(YYLTYPE));
1281     if (p->yystack.p_base == NULL) return NULL;
1282     memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE));
1283 #endif
1284
1285     return p;
1286 }
1287
1288 static void
1289 yyFreeState(YYParseState *p)
1290 {
1291     yyfreestack(&p->yystack);
1292     free(p);
1293 }
1294 #endif /* YYBTYACC */
1295
1296 #define YYABORT  goto yyabort
1297 #define YYREJECT goto yyabort
1298 #define YYACCEPT goto yyaccept
1299 #define YYERROR  goto yyerrlab
1300 #if YYBTYACC
1301 #define YYVALID        do { if (yyps->save)            goto yyvalid; } while(0)
1302 #define YYVALID_NESTED do { if (yyps->save && \
1303                                 yyps->save->save == 0) goto yyvalid; } while(0)
1304 #endif /* YYBTYACC */
1305
1306 int
1307 YYPARSE_DECL()
1308 {
1309     int yym, yyn, yystate, yyresult;
1310 #if YYBTYACC
1311     int yynewerrflag;
1312     YYParseState *yyerrctx = NULL;
1313 #endif /* YYBTYACC */
1314 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1315     YYLTYPE  yyerror_loc_range[2]; /* position of error start & end */
1316 #endif
1317 #if YYDEBUG
1318     const char *yys;
1319
1320     if ((yys = getenv("YYDEBUG")) != 0)
1321     {
1322         yyn = *yys;
1323         if (yyn >= '0' && yyn <= '9')
1324             yydebug = yyn - '0';
1325     }
1326     if (yydebug)
1327         fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX);
1328 #endif
1329
1330 #if YYBTYACC
1331     yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
1332     yyps->save = 0;
1333 #endif /* YYBTYACC */
1334     yym = 0;
1335     yyn = 0;
1336     yynerrs = 0;
1337     yyerrflag = 0;
1338     yychar = YYEMPTY;
1339     yystate = 0;
1340
1341 #if YYPURE
1342     memset(&yystack, 0, sizeof(yystack));
1343 #endif
1344
1345     if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1346     yystack.s_mark = yystack.s_base;
1347     yystack.l_mark = yystack.l_base;
1348 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1349     yystack.p_mark = yystack.p_base;
1350 #endif
1351     yystate = 0;
1352     *yystack.s_mark = 0;
1353
1354 yyloop:
1355     if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
1356     if (yychar < 0)
1357     {
1358 #if YYBTYACC
1359         do {
1360         if (yylvp < yylve)
1361         {
1362             /* we're currently re-reading tokens */
1363             yylval = *yylvp++;
1364 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1365             yylloc = *yylpp++;
1366 #endif
1367             yychar = *yylexp++;
1368             break;
1369         }
1370         if (yyps->save)
1371         {
1372             /* in trial mode; save scanner results for future parse attempts */
1373             if (yylvp == yylvlim)
1374             {   /* Enlarge lexical value queue */
1375                 size_t p = (size_t) (yylvp - yylvals);
1376                 size_t s = (size_t) (yylvlim - yylvals);
1377
1378                 s += YYLVQUEUEGROWTH;
1379                 if ((yylexemes = (short *)   realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem;
1380                 if ((yylvals   = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;
1381 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1382                 if ((yylpsns   = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;
1383 #endif
1384                 yylvp   = yylve = yylvals + p;
1385                 yylvlim = yylvals + s;
1386 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1387                 yylpp   = yylpe = yylpsns + p;
1388                 yylplim = yylpsns + s;
1389 #endif
1390                 yylexp  = yylexemes + p;
1391             }
1392             *yylexp = (short) YYLEX;
1393             *yylvp++ = yylval;
1394             yylve++;
1395 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1396             *yylpp++ = yylloc;
1397             yylpe++;
1398 #endif
1399             yychar = *yylexp++;
1400             break;
1401         }
1402         /* normal operation, no conflict encountered */
1403 #endif /* YYBTYACC */
1404         yychar = YYLEX;
1405 #if YYBTYACC
1406         } while (0);
1407 #endif /* YYBTYACC */
1408         if (yychar < 0) yychar = YYEOF;
1409 #if YYDEBUG
1410         if (yydebug)
1411         {
1412             if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
1413             fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
1414                             YYDEBUGSTR, yydepth, yystate, yychar, yys);
1415 #ifdef YYSTYPE_TOSTRING
1416 #if YYBTYACC
1417             if (!yytrial)
1418 #endif /* YYBTYACC */
1419                 fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval));
1420 #endif
1421             fputc('\n', stderr);
1422         }
1423 #endif
1424     }
1425 #if YYBTYACC
1426
1427     /* Do we have a conflict? */
1428     if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1429         yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1430     {
1431         YYINT ctry;
1432
1433         if (yypath)
1434         {
1435             YYParseState *save;
1436 #if YYDEBUG
1437             if (yydebug)
1438                 fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n",
1439                                 YYDEBUGSTR, yydepth, yystate);
1440 #endif
1441             /* Switch to the next conflict context */
1442             save = yypath;
1443             yypath = save->save;
1444             save->save = NULL;
1445             ctry = save->ctry;
1446             if (save->state != yystate) YYABORT;
1447             yyFreeState(save);
1448
1449         }
1450         else
1451         {
1452
1453             /* Unresolved conflict - start/continue trial parse */
1454             YYParseState *save;
1455 #if YYDEBUG
1456             if (yydebug)
1457             {
1458                 fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate);
1459                 if (yyps->save)
1460                     fputs("ALREADY in conflict, continuing trial parse.\n", stderr);
1461                 else
1462                     fputs("Starting trial parse.\n", stderr);
1463             }
1464 #endif
1465             save                  = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
1466             if (save == NULL) goto yyenomem;
1467             save->save            = yyps->save;
1468             save->state           = yystate;
1469             save->errflag         = yyerrflag;
1470             save->yystack.s_mark  = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
1471             memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1472             save->yystack.l_mark  = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
1473             memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1474 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1475             save->yystack.p_mark  = save->yystack.p_base + (yystack.p_mark - yystack.p_base);
1476             memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1477 #endif
1478             ctry                  = yytable[yyn];
1479             if (yyctable[ctry] == -1)
1480             {
1481 #if YYDEBUG
1482                 if (yydebug && yychar >= YYEOF)
1483                     fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth);
1484 #endif
1485                 ctry++;
1486             }
1487             save->ctry = ctry;
1488             if (yyps->save == NULL)
1489             {
1490                 /* If this is a first conflict in the stack, start saving lexemes */
1491                 if (!yylexemes)
1492                 {
1493                     yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short));
1494                     if (yylexemes == NULL) goto yyenomem;
1495                     yylvals   = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE));
1496                     if (yylvals == NULL) goto yyenomem;
1497                     yylvlim   = yylvals + YYLVQUEUEGROWTH;
1498 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1499                     yylpsns   = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE));
1500                     if (yylpsns == NULL) goto yyenomem;
1501                     yylplim   = yylpsns + YYLVQUEUEGROWTH;
1502 #endif
1503                 }
1504                 if (yylvp == yylve)
1505                 {
1506                     yylvp  = yylve = yylvals;
1507 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1508                     yylpp  = yylpe = yylpsns;
1509 #endif
1510                     yylexp = yylexemes;
1511                     if (yychar >= YYEOF)
1512                     {
1513                         *yylve++ = yylval;
1514 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1515                         *yylpe++ = yylloc;
1516 #endif
1517                         *yylexp  = (short) yychar;
1518                         yychar   = YYEMPTY;
1519                     }
1520                 }
1521             }
1522             if (yychar >= YYEOF)
1523             {
1524                 yylvp--;
1525 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1526                 yylpp--;
1527 #endif
1528                 yylexp--;
1529                 yychar = YYEMPTY;
1530             }
1531             save->lexeme = (int) (yylvp - yylvals);
1532             yyps->save   = save;
1533         }
1534         if (yytable[yyn] == ctry)
1535         {
1536 #if YYDEBUG
1537             if (yydebug)
1538                 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
1539                                 YYDEBUGSTR, yydepth, yystate, yyctable[ctry]);
1540 #endif
1541             if (yychar < 0)
1542             {
1543                 yylvp++;
1544 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1545                 yylpp++;
1546 #endif
1547                 yylexp++;
1548             }
1549             if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
1550                 goto yyoverflow;
1551             yystate = yyctable[ctry];
1552             *++yystack.s_mark = (YYINT) yystate;
1553             *++yystack.l_mark = yylval;
1554 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1555             *++yystack.p_mark = yylloc;
1556 #endif
1557             yychar  = YYEMPTY;
1558             if (yyerrflag > 0) --yyerrflag;
1559             goto yyloop;
1560         }
1561         else
1562         {
1563             yyn = yyctable[ctry];
1564             goto yyreduce;
1565         }
1566     } /* End of code dealing with conflicts */
1567 #endif /* YYBTYACC */
1568     if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1569             yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1570     {
1571 #if YYDEBUG
1572         if (yydebug)
1573             fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
1574                             YYDEBUGSTR, yydepth, yystate, yytable[yyn]);
1575 #endif
1576         if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1577         yystate = yytable[yyn];
1578         *++yystack.s_mark = yytable[yyn];
1579         *++yystack.l_mark = yylval;
1580 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1581         *++yystack.p_mark = yylloc;
1582 #endif
1583         yychar = YYEMPTY;
1584         if (yyerrflag > 0)  --yyerrflag;
1585         goto yyloop;
1586     }
1587     if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1588             yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1589     {
1590         yyn = yytable[yyn];
1591         goto yyreduce;
1592     }
1593     if (yyerrflag != 0) goto yyinrecovery;
1594 #if YYBTYACC
1595
1596     yynewerrflag = 1;
1597     goto yyerrhandler;
1598     goto yyerrlab; /* redundant goto avoids 'unused label' warning */
1599
1600 yyerrlab:
1601     /* explicit YYERROR from an action -- pop the rhs of the rule reduced
1602      * before looking for error recovery */
1603     yystack.s_mark -= yym;
1604     yystate = *yystack.s_mark;
1605     yystack.l_mark -= yym;
1606 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1607     yystack.p_mark -= yym;
1608 #endif
1609
1610     yynewerrflag = 0;
1611 yyerrhandler:
1612     while (yyps->save)
1613     {
1614         int ctry;
1615         YYParseState *save = yyps->save;
1616 #if YYDEBUG
1617         if (yydebug)
1618             fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n",
1619                             YYDEBUGSTR, yydepth, yystate, yyps->save->state,
1620                     (int)(yylvp - yylvals - yyps->save->lexeme));
1621 #endif
1622         /* Memorize most forward-looking error state in case it's really an error. */
1623         if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals)
1624         {
1625             /* Free old saved error context state */
1626             if (yyerrctx) yyFreeState(yyerrctx);
1627             /* Create and fill out new saved error context state */
1628             yyerrctx                 = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
1629             if (yyerrctx == NULL) goto yyenomem;
1630             yyerrctx->save           = yyps->save;
1631             yyerrctx->state          = yystate;
1632             yyerrctx->errflag        = yyerrflag;
1633             yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
1634             memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1635             yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
1636             memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1637 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1638             yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base);
1639             memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1640 #endif
1641             yyerrctx->lexeme         = (int) (yylvp - yylvals);
1642         }
1643         yylvp          = yylvals   + save->lexeme;
1644 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1645         yylpp          = yylpsns   + save->lexeme;
1646 #endif
1647         yylexp         = yylexemes + save->lexeme;
1648         yychar         = YYEMPTY;
1649         yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
1650         memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1651         yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
1652         memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1653 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1654         yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base);
1655         memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1656 #endif
1657         ctry           = ++save->ctry;
1658         yystate        = save->state;
1659         /* We tried shift, try reduce now */
1660         if ((yyn = yyctable[ctry]) >= 0) goto yyreduce;
1661         yyps->save     = save->save;
1662         save->save     = NULL;
1663         yyFreeState(save);
1664
1665         /* Nothing left on the stack -- error */
1666         if (!yyps->save)
1667         {
1668 #if YYDEBUG
1669             if (yydebug)
1670                 fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n",
1671                                 YYPREFIX, yydepth);
1672 #endif
1673             /* Restore state as it was in the most forward-advanced error */
1674             yylvp          = yylvals   + yyerrctx->lexeme;
1675 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1676             yylpp          = yylpsns   + yyerrctx->lexeme;
1677 #endif
1678             yylexp         = yylexemes + yyerrctx->lexeme;
1679             yychar         = yylexp[-1];
1680             yylval         = yylvp[-1];
1681 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1682             yylloc         = yylpp[-1];
1683 #endif
1684             yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
1685             memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
1686             yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
1687             memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1688 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1689             yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base);
1690             memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1691 #endif
1692             yystate        = yyerrctx->state;
1693             yyFreeState(yyerrctx);
1694             yyerrctx       = NULL;
1695         }
1696         yynewerrflag = 1;
1697     }
1698     if (yynewerrflag == 0) goto yyinrecovery;
1699 #endif /* YYBTYACC */
1700
1701     YYERROR_CALL("syntax error");
1702 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1703     yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */
1704 #endif
1705
1706 #if !YYBTYACC
1707     goto yyerrlab; /* redundant goto avoids 'unused label' warning */
1708 yyerrlab:
1709 #endif
1710     ++yynerrs;
1711
1712 yyinrecovery:
1713     if (yyerrflag < 3)
1714     {
1715         yyerrflag = 3;
1716         for (;;)
1717         {
1718             if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
1719                     yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
1720             {
1721 #if YYDEBUG
1722                 if (yydebug)
1723                     fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n",
1724                                     YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]);
1725 #endif
1726                 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1727                 yystate = yytable[yyn];
1728                 *++yystack.s_mark = yytable[yyn];
1729                 *++yystack.l_mark = yylval;
1730 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1731                 /* lookahead position is error end position */
1732                 yyerror_loc_range[1] = yylloc;
1733                 YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */
1734                 *++yystack.p_mark = yyloc;
1735 #endif
1736                 goto yyloop;
1737             }
1738             else
1739             {
1740 #if YYDEBUG
1741                 if (yydebug)
1742                     fprintf(stderr, "%s[%d]: error recovery discarding state %d\n",
1743                                     YYDEBUGSTR, yydepth, *yystack.s_mark);
1744 #endif
1745                 if (yystack.s_mark <= yystack.s_base) goto yyabort;
1746 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1747                 /* the current TOS position is the error start position */
1748                 yyerror_loc_range[0] = *yystack.p_mark;
1749 #endif
1750 #if defined(YYDESTRUCT_CALL)
1751 #if YYBTYACC
1752                 if (!yytrial)
1753 #endif /* YYBTYACC */
1754 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1755                     YYDESTRUCT_CALL("error: discarding state",
1756                                     yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark);
1757 #else
1758                     YYDESTRUCT_CALL("error: discarding state",
1759                                     yystos[*yystack.s_mark], yystack.l_mark);
1760 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1761 #endif /* defined(YYDESTRUCT_CALL) */
1762                 --yystack.s_mark;
1763                 --yystack.l_mark;
1764 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1765                 --yystack.p_mark;
1766 #endif
1767             }
1768         }
1769     }
1770     else
1771     {
1772         if (yychar == YYEOF) goto yyabort;
1773 #if YYDEBUG
1774         if (yydebug)
1775         {
1776             if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
1777             fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
1778                             YYDEBUGSTR, yydepth, yystate, yychar, yys);
1779         }
1780 #endif
1781 #if defined(YYDESTRUCT_CALL)
1782 #if YYBTYACC
1783         if (!yytrial)
1784 #endif /* YYBTYACC */
1785 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1786             YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc);
1787 #else
1788             YYDESTRUCT_CALL("error: discarding token", yychar, &yylval);
1789 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1790 #endif /* defined(YYDESTRUCT_CALL) */
1791         yychar = YYEMPTY;
1792         goto yyloop;
1793     }
1794
1795 yyreduce:
1796     yym = yylen[yyn];
1797 #if YYDEBUG
1798     if (yydebug)
1799     {
1800         fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)",
1801                         YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]);
1802 #ifdef YYSTYPE_TOSTRING
1803 #if YYBTYACC
1804         if (!yytrial)
1805 #endif /* YYBTYACC */
1806             if (yym > 0)
1807             {
1808                 int i;
1809                 fputc('<', stderr);
1810                 for (i = yym; i > 0; i--)
1811                 {
1812                     if (i != yym) fputs(", ", stderr);
1813                     fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]],
1814                                            yystack.l_mark[1-i]), stderr);
1815                 }
1816                 fputc('>', stderr);
1817             }
1818 #endif
1819         fputc('\n', stderr);
1820     }
1821 #endif
1822     if (yym > 0)
1823         yyval = yystack.l_mark[1-yym];
1824     else
1825         memset(&yyval, 0, sizeof yyval);
1826 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1827
1828     /* Perform position reduction */
1829     memset(&yyloc, 0, sizeof(yyloc));
1830 #if YYBTYACC
1831     if (!yytrial)
1832 #endif /* YYBTYACC */
1833     {
1834         YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym);
1835         /* just in case YYERROR is invoked within the action, save
1836            the start of the rhs as the error start position */
1837         yyerror_loc_range[0] = yystack.p_mark[1-yym];
1838     }
1839 #endif
1840
1841     switch (yyn)
1842     {
1843 case 1:
1844 #line 93 "btyacc_demo.y"
1845 { yyval.scope = yystack.l_mark[0].scope; }
1846 break;
1847 case 2:
1848 #line 94 "btyacc_demo.y"
1849 { yyval.scope = global_scope; }
1850 break;
1851 case 3:
1852 #line 95 "btyacc_demo.y"
1853 { Decl *d = lookup(yystack.l_mark[-2].scope, yystack.l_mark[-1].id);
1854                           if (!d || !d->scope) YYERROR;
1855                           yyval.scope = d->scope; }
1856 break;
1857 case 4:
1858 #line 101 "btyacc_demo.y"
1859 { Decl *d = lookup(yystack.l_mark[-1].scope, yystack.l_mark[0].id);
1860         if (d == NULL || d->istype() == 0) YYERROR;
1861         yyval.type = d->type; }
1862 break;
1863 case 5:
1864 #line 106 "btyacc_demo.y"
1865 yyval.scope = global_scope = new_scope(0);
1866 break;
1867 case 8:
1868 #line 107 "btyacc_demo.y"
1869 yyval.scope = yystack.l_mark[-1].scope;
1870 break;
1871 case 10:
1872 #line 109 "btyacc_demo.y"
1873 {YYVALID;}
1874 break;
1875 case 11:
1876 #line 110 "btyacc_demo.y"
1877 yyval.scope = start_fn_def(yystack.l_mark[-2].scope, yystack.l_mark[0].decl);
1878 break;
1879 case 12:
1880   if (!yytrial)
1881 #line 111 "btyacc_demo.y"
1882         { /* demonstrate use of @$ & @N, although this is just the
1883            default computation and so is not necessary */
1884         yyloc.first_line   = yystack.p_mark[-3].first_line;
1885         yyloc.first_column = yystack.p_mark[-3].first_column;
1886         yyloc.last_line    = yystack.p_mark[0].last_line;
1887         yyloc.last_column  = yystack.p_mark[0].last_column;
1888         finish_fn_def(yystack.l_mark[-2].decl, yystack.l_mark[0].code); }
1889 break;
1890 case 13:
1891 #line 121 "btyacc_demo.y"
1892 { yyval.type = yystack.l_mark[0].type; }
1893 break;
1894 case 14:
1895 #line 122 "btyacc_demo.y"
1896 { yyval.type = type_combine(yystack.l_mark[-2].type, yystack.l_mark[0].type); }
1897 break;
1898 case 15:
1899 #line 125 "btyacc_demo.y"
1900 { yyval.type = 0; }
1901 break;
1902 case 16:
1903 #line 126 "btyacc_demo.y"
1904 { yyval.type = type_combine(yystack.l_mark[-1].type, yystack.l_mark[0].type); }
1905 break;
1906 case 17:
1907 #line 130 "btyacc_demo.y"
1908 { yyval.type = yystack.l_mark[0].type; }
1909 break;
1910 case 18:
1911 #line 131 "btyacc_demo.y"
1912 { yyval.type = yystack.l_mark[0].type; }
1913 break;
1914 case 19:
1915 #line 132 "btyacc_demo.y"
1916 { yyval.type = bare_extern(); }
1917 break;
1918 case 20:
1919 #line 133 "btyacc_demo.y"
1920 { yyval.type = bare_register(); }
1921 break;
1922 case 21:
1923 #line 134 "btyacc_demo.y"
1924 { yyval.type = bare_static(); }
1925 break;
1926 case 22:
1927 #line 138 "btyacc_demo.y"
1928 { yyval.type = bare_const(); }
1929 break;
1930 case 23:
1931 #line 139 "btyacc_demo.y"
1932 { yyval.type = bare_volatile(); }
1933 break;
1934 case 24:
1935 #line 143 "btyacc_demo.y"
1936 yyval.scope = yystack.l_mark[-3].scope;
1937 break;
1938 case 25:
1939 #line 143 "btyacc_demo.y"
1940 yyval.type =  yystack.l_mark[-3].type;
1941 break;
1942 case 28:
1943 #line 148 "btyacc_demo.y"
1944 { if (!yystack.l_mark[0].type) YYERROR; }  if (!yytrial)
1945 #line 149 "btyacc_demo.y"
1946 { yyval.decl = declare(yystack.l_mark[-1].scope, 0, yystack.l_mark[0].type); }
1947 break;
1948 case 29:
1949   if (!yytrial)
1950 #line 150 "btyacc_demo.y"
1951         { yyval.decl = declare(yystack.l_mark[-2].scope, yystack.l_mark[0].id, yystack.l_mark[-1].type); }
1952 break;
1953 case 30:
1954 #line 151 "btyacc_demo.y"
1955 yyval.scope = yystack.l_mark[-2].scope;
1956 break;
1957 case 31:
1958 #line 151 "btyacc_demo.y"
1959 yyval.type =  yystack.l_mark[-2].type;
1960 break;
1961 case 32:
1962   if (!yytrial)
1963 #line 151 "btyacc_demo.y"
1964         { yyval.decl = yystack.l_mark[-1].decl; }
1965 break;
1966 case 33:
1967   if (!yytrial)
1968 #line 153 "btyacc_demo.y"
1969         { yyval.decl = make_pointer(yystack.l_mark[0].decl, yystack.l_mark[-3].type); }
1970 break;
1971 case 34:
1972   if (!yytrial)
1973 #line 155 "btyacc_demo.y"
1974         { yyval.decl = make_array(yystack.l_mark[-4].decl->type, yystack.l_mark[-1].expr); }
1975 break;
1976 case 35:
1977   if (!yytrial)
1978 #line 157 "btyacc_demo.y"
1979         { yyval.decl = build_function(yystack.l_mark[-5].decl, yystack.l_mark[-2].dlist, yystack.l_mark[0].type); }
1980 break;
1981 case 36:
1982   if (!yytrial)
1983 #line 160 "btyacc_demo.y"
1984         { yyval.dlist = 0; }
1985 break;
1986 case 37:
1987   if (!yytrial)
1988 #line 161 "btyacc_demo.y"
1989         { yyval.dlist = yystack.l_mark[0].dlist; }
1990 break;
1991 case 38:
1992   if (!yytrial)
1993 #line 164 "btyacc_demo.y"
1994         { yyval.dlist = append_dlist(yystack.l_mark[-3].dlist, yystack.l_mark[0].decl); }
1995 break;
1996 case 39:
1997   if (!yytrial)
1998 #line 165 "btyacc_demo.y"
1999         { yyval.dlist = build_dlist(yystack.l_mark[0].decl); }
2000 break;
2001 case 40:
2002   if (!yytrial)
2003 #line 168 "btyacc_demo.y"
2004         { yyval.decl = yystack.l_mark[0].decl; }
2005 break;
2006 case 41:
2007   if (!yytrial)
2008 #line 172 "btyacc_demo.y"
2009         { yyval.expr = build_expr(yystack.l_mark[-3].expr, ADD, yystack.l_mark[0].expr); }
2010 break;
2011 case 42:
2012   if (!yytrial)
2013 #line 173 "btyacc_demo.y"
2014         { yyval.expr = build_expr(yystack.l_mark[-3].expr, SUB, yystack.l_mark[0].expr); }
2015 break;
2016 case 43:
2017   if (!yytrial)
2018 #line 174 "btyacc_demo.y"
2019         { yyval.expr = build_expr(yystack.l_mark[-3].expr, MUL, yystack.l_mark[0].expr); }
2020 break;
2021 case 44:
2022   if (!yytrial)
2023 #line 175 "btyacc_demo.y"
2024         { yyval.expr = build_expr(yystack.l_mark[-3].expr, MOD, yystack.l_mark[0].expr); }
2025 break;
2026 case 45:
2027   if (!yytrial)
2028 #line 176 "btyacc_demo.y"
2029         { yyval.expr = build_expr(yystack.l_mark[-3].expr, DIV, yystack.l_mark[0].expr); }
2030 break;
2031 case 46:
2032   if (!yytrial)
2033 #line 177 "btyacc_demo.y"
2034         { yyval.expr = build_expr(0, DEREF, yystack.l_mark[0].expr); }
2035 break;
2036 case 47:
2037   if (!yytrial)
2038 #line 178 "btyacc_demo.y"
2039         { yyval.expr = var_expr(yystack.l_mark[-1].scope, yystack.l_mark[0].id); }
2040 break;
2041 case 48:
2042   if (!yytrial)
2043 #line 179 "btyacc_demo.y"
2044         { yyval.expr = yystack.l_mark[0].expr; }
2045 break;
2046 case 49:
2047   if (!yytrial)
2048 #line 183 "btyacc_demo.y"
2049         { yyval.code = 0; }
2050 break;
2051 case 50:
2052 #line 184 "btyacc_demo.y"
2053 {YYVALID;}  if (!yytrial)
2054 #line 184 "btyacc_demo.y"
2055 { yyval.code = build_expr_code(yystack.l_mark[-1].expr); }
2056 break;
2057 case 51:
2058 #line 185 "btyacc_demo.y"
2059 yyval.scope = yystack.l_mark[-6].scope;
2060 break;
2061 case 52:
2062 #line 185 "btyacc_demo.y"
2063 yyval.scope = yystack.l_mark[-9].scope;
2064 break;
2065 case 53:
2066 #line 185 "btyacc_demo.y"
2067 {YYVALID;}  if (!yytrial)
2068 #line 186 "btyacc_demo.y"
2069 { yyval.code = build_if(yystack.l_mark[-7].expr, yystack.l_mark[-3].code, yystack.l_mark[0].code); }
2070 break;
2071 case 54:
2072 #line 187 "btyacc_demo.y"
2073 {YYVALID;}  if (!yytrial)
2074 #line 188 "btyacc_demo.y"
2075 { yyval.code = build_if(yystack.l_mark[-4].expr, yystack.l_mark[0].code, 0); }
2076 break;
2077 case 55:
2078 #line 189 "btyacc_demo.y"
2079 yyval.scope = new_scope(yystack.l_mark[0].scope);
2080 break;
2081 case 56:
2082 #line 189 "btyacc_demo.y"
2083 {YYVALID;}  if (!yytrial)
2084 #line 189 "btyacc_demo.y"
2085 { yyval.code = yystack.l_mark[0].code; }
2086 break;
2087 case 57:
2088   if (!yytrial)
2089 #line 192 "btyacc_demo.y"
2090         { yyval.code = 0; }
2091 break;
2092 case 58:
2093   if (!yytrial)
2094 #line 193 "btyacc_demo.y"
2095         { yyval.code = code_append(yystack.l_mark[-2].code, yystack.l_mark[0].code); }
2096 break;
2097 case 59:
2098   if (!yytrial)
2099 #line 197 "btyacc_demo.y"
2100         { yyval.code = yystack.l_mark[-1].code; }
2101 break;
2102 #line 2103 "btyacc_demo.tab.c"
2103     default:
2104         break;
2105     }
2106     yystack.s_mark -= yym;
2107     yystate = *yystack.s_mark;
2108     yystack.l_mark -= yym;
2109 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2110     yystack.p_mark -= yym;
2111 #endif
2112     yym = yylhs[yyn];
2113     if (yystate == 0 && yym == 0)
2114     {
2115 #if YYDEBUG
2116         if (yydebug)
2117         {
2118             fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
2119 #ifdef YYSTYPE_TOSTRING
2120 #if YYBTYACC
2121             if (!yytrial)
2122 #endif /* YYBTYACC */
2123                 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval));
2124 #endif
2125             fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL);
2126         }
2127 #endif
2128         yystate = YYFINAL;
2129         *++yystack.s_mark = YYFINAL;
2130         *++yystack.l_mark = yyval;
2131 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2132         *++yystack.p_mark = yyloc;
2133 #endif
2134         if (yychar < 0)
2135         {
2136 #if YYBTYACC
2137             do {
2138             if (yylvp < yylve)
2139             {
2140                 /* we're currently re-reading tokens */
2141                 yylval = *yylvp++;
2142 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2143                 yylloc = *yylpp++;
2144 #endif
2145                 yychar = *yylexp++;
2146                 break;
2147             }
2148             if (yyps->save)
2149             {
2150                 /* in trial mode; save scanner results for future parse attempts */
2151                 if (yylvp == yylvlim)
2152                 {   /* Enlarge lexical value queue */
2153                     size_t p = (size_t) (yylvp - yylvals);
2154                     size_t s = (size_t) (yylvlim - yylvals);
2155
2156                     s += YYLVQUEUEGROWTH;
2157                     if ((yylexemes = (short *)   realloc(yylexemes, s * sizeof(short))) == NULL)
2158                         goto yyenomem;
2159                     if ((yylvals   = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)
2160                         goto yyenomem;
2161 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2162                     if ((yylpsns   = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)
2163                         goto yyenomem;
2164 #endif
2165                     yylvp   = yylve = yylvals + p;
2166                     yylvlim = yylvals + s;
2167 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2168                     yylpp   = yylpe = yylpsns + p;
2169                     yylplim = yylpsns + s;
2170 #endif
2171                     yylexp  = yylexemes + p;
2172                 }
2173                 *yylexp = (short) YYLEX;
2174                 *yylvp++ = yylval;
2175                 yylve++;
2176 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2177                 *yylpp++ = yylloc;
2178                 yylpe++;
2179 #endif
2180                 yychar = *yylexp++;
2181                 break;
2182             }
2183             /* normal operation, no conflict encountered */
2184 #endif /* YYBTYACC */
2185             yychar = YYLEX;
2186 #if YYBTYACC
2187             } while (0);
2188 #endif /* YYBTYACC */
2189             if (yychar < 0) yychar = YYEOF;
2190 #if YYDEBUG
2191             if (yydebug)
2192             {
2193                 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
2194                 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
2195                                 YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
2196             }
2197 #endif
2198         }
2199         if (yychar == YYEOF) goto yyaccept;
2200         goto yyloop;
2201     }
2202     if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
2203             yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
2204         yystate = yytable[yyn];
2205     else
2206         yystate = yydgoto[yym];
2207 #if YYDEBUG
2208     if (yydebug)
2209     {
2210         fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
2211 #ifdef YYSTYPE_TOSTRING
2212 #if YYBTYACC
2213         if (!yytrial)
2214 #endif /* YYBTYACC */
2215             fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval));
2216 #endif
2217         fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate);
2218     }
2219 #endif
2220     if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
2221     *++yystack.s_mark = (YYINT) yystate;
2222     *++yystack.l_mark = yyval;
2223 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2224     *++yystack.p_mark = yyloc;
2225 #endif
2226     goto yyloop;
2227 #if YYBTYACC
2228
2229     /* Reduction declares that this path is valid. Set yypath and do a full parse */
2230 yyvalid:
2231     if (yypath) YYABORT;
2232     while (yyps->save)
2233     {
2234         YYParseState *save = yyps->save;
2235         yyps->save = save->save;
2236         save->save = yypath;
2237         yypath = save;
2238     }
2239 #if YYDEBUG
2240     if (yydebug)
2241         fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n",
2242                         YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme));
2243 #endif
2244     if (yyerrctx)
2245     {
2246         yyFreeState(yyerrctx);
2247         yyerrctx = NULL;
2248     }
2249     yylvp          = yylvals + yypath->lexeme;
2250 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2251     yylpp          = yylpsns + yypath->lexeme;
2252 #endif
2253     yylexp         = yylexemes + yypath->lexeme;
2254     yychar         = YYEMPTY;
2255     yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
2256     memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
2257     yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
2258     memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
2259 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2260     yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base);
2261     memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
2262 #endif
2263     yystate        = yypath->state;
2264     goto yyloop;
2265 #endif /* YYBTYACC */
2266
2267 yyoverflow:
2268     YYERROR_CALL("yacc stack overflow");
2269 #if YYBTYACC
2270     goto yyabort_nomem;
2271 yyenomem:
2272     YYERROR_CALL("memory exhausted");
2273 yyabort_nomem:
2274 #endif /* YYBTYACC */
2275     yyresult = 2;
2276     goto yyreturn;
2277
2278 yyabort:
2279     yyresult = 1;
2280     goto yyreturn;
2281
2282 yyaccept:
2283 #if YYBTYACC
2284     if (yyps->save) goto yyvalid;
2285 #endif /* YYBTYACC */
2286     yyresult = 0;
2287
2288 yyreturn:
2289 #if defined(YYDESTRUCT_CALL)
2290     if (yychar != YYEOF && yychar != YYEMPTY)
2291 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2292         YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc);
2293 #else
2294         YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval);
2295 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
2296
2297     {
2298         YYSTYPE *pv;
2299 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2300         YYLTYPE *pp;
2301
2302         for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp)
2303              YYDESTRUCT_CALL("cleanup: discarding state",
2304                              yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp);
2305 #else
2306         for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv)
2307              YYDESTRUCT_CALL("cleanup: discarding state",
2308                              yystos[*(yystack.s_base + (pv - yystack.l_base))], pv);
2309 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
2310     }
2311 #endif /* defined(YYDESTRUCT_CALL) */
2312
2313 #if YYBTYACC
2314     if (yyerrctx)
2315     {
2316         yyFreeState(yyerrctx);
2317         yyerrctx = NULL;
2318     }
2319     while (yyps)
2320     {
2321         YYParseState *save = yyps;
2322         yyps = save->save;
2323         save->save = NULL;
2324         yyFreeState(save);
2325     }
2326     while (yypath)
2327     {
2328         YYParseState *save = yypath;
2329         yypath = save->save;
2330         save->save = NULL;
2331         yyFreeState(save);
2332     }
2333 #endif /* YYBTYACC */
2334     yyfreestack(&yystack);
2335     return (yyresult);
2336 }