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