grammar.tab.c revision 1.1.1.2 1 1.1 christos /* original parser id follows */
2 1.1 christos /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
3 1.1 christos /* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
4 1.1 christos
5 1.1 christos #define YYBYACC 1
6 1.1 christos #define YYMAJOR 1
7 1.1 christos #define YYMINOR 9
8 1.1 christos #define YYCHECK "yyyymmdd"
9 1.1 christos
10 1.1 christos #define YYEMPTY (-1)
11 1.1 christos #define yyclearin (yychar = YYEMPTY)
12 1.1 christos #define yyerrok (yyerrflag = 0)
13 1.1 christos #define YYRECOVERING() (yyerrflag != 0)
14 1.1 christos #define YYENOMEM (-2)
15 1.1 christos #define YYEOF 0
16 1.1 christos #undef YYBTYACC
17 1.1 christos #define YYBTYACC 0
18 1.1 christos #define YYDEBUGSTR YYPREFIX "debug"
19 1.1 christos
20 1.1 christos #ifndef yyparse
21 1.1 christos #define yyparse grammar_parse
22 1.1 christos #endif /* yyparse */
23 1.1 christos
24 1.1 christos #ifndef yylex
25 1.1 christos #define yylex grammar_lex
26 1.1 christos #endif /* yylex */
27 1.1 christos
28 1.1 christos #ifndef yyerror
29 1.1 christos #define yyerror grammar_error
30 1.1 christos #endif /* yyerror */
31 1.1 christos
32 1.1 christos #ifndef yychar
33 1.1 christos #define yychar grammar_char
34 1.1 christos #endif /* yychar */
35 1.1 christos
36 1.1 christos #ifndef yyval
37 1.1 christos #define yyval grammar_val
38 1.1 christos #endif /* yyval */
39 1.1 christos
40 1.1 christos #ifndef yylval
41 1.1 christos #define yylval grammar_lval
42 1.1 christos #endif /* yylval */
43 1.1 christos
44 1.1 christos #ifndef yydebug
45 1.1 christos #define yydebug grammar_debug
46 1.1 christos #endif /* yydebug */
47 1.1 christos
48 1.1 christos #ifndef yynerrs
49 1.1 christos #define yynerrs grammar_nerrs
50 1.1 christos #endif /* yynerrs */
51 1.1 christos
52 1.1 christos #ifndef yyerrflag
53 1.1 christos #define yyerrflag grammar_errflag
54 1.1 christos #endif /* yyerrflag */
55 1.1 christos
56 1.1 christos #ifndef yylhs
57 1.1 christos #define yylhs grammar_lhs
58 1.1 christos #endif /* yylhs */
59 1.1 christos
60 1.1 christos #ifndef yylen
61 1.1 christos #define yylen grammar_len
62 1.1 christos #endif /* yylen */
63 1.1 christos
64 1.1 christos #ifndef yydefred
65 1.1 christos #define yydefred grammar_defred
66 1.1 christos #endif /* yydefred */
67 1.1 christos
68 1.1 christos #ifndef yystos
69 1.1 christos #define yystos grammar_stos
70 1.1 christos #endif /* yystos */
71 1.1 christos
72 1.1 christos #ifndef yydgoto
73 1.1 christos #define yydgoto grammar_dgoto
74 1.1 christos #endif /* yydgoto */
75 1.1 christos
76 1.1 christos #ifndef yysindex
77 1.1 christos #define yysindex grammar_sindex
78 1.1 christos #endif /* yysindex */
79 1.1 christos
80 1.1 christos #ifndef yyrindex
81 1.1 christos #define yyrindex grammar_rindex
82 1.1 christos #endif /* yyrindex */
83 1.1 christos
84 1.1 christos #ifndef yygindex
85 1.1 christos #define yygindex grammar_gindex
86 1.1 christos #endif /* yygindex */
87 1.1 christos
88 1.1 christos #ifndef yytable
89 1.1 christos #define yytable grammar_table
90 1.1 christos #endif /* yytable */
91 1.1 christos
92 1.1 christos #ifndef yycheck
93 1.1 christos #define yycheck grammar_check
94 1.1 christos #endif /* yycheck */
95 1.1 christos
96 1.1 christos #ifndef yyname
97 1.1 christos #define yyname grammar_name
98 1.1 christos #endif /* yyname */
99 1.1 christos
100 1.1 christos #ifndef yyrule
101 1.1 christos #define yyrule grammar_rule
102 1.1 christos #endif /* yyrule */
103 1.1 christos
104 1.1 christos #if YYBTYACC
105 1.1 christos
106 1.1 christos #ifndef yycindex
107 1.1 christos #define yycindex grammar_cindex
108 1.1 christos #endif /* yycindex */
109 1.1 christos
110 1.1 christos #ifndef yyctable
111 1.1 christos #define yyctable grammar_ctable
112 1.1 christos #endif /* yyctable */
113 1.1 christos
114 1.1 christos #endif /* YYBTYACC */
115 1.1 christos
116 1.1 christos #define YYPREFIX "grammar_"
117 1.1 christos
118 1.1 christos #define YYPURE 0
119 1.1 christos
120 1.1 christos #line 9 "grammar.y"
121 1.1 christos #ifdef YYBISON
122 1.1 christos #include <stdlib.h>
123 1.1 christos #define YYSTYPE_IS_DECLARED
124 1.1 christos #define yyerror yaccError
125 1.1 christos #endif
126 1.1 christos
127 1.1 christos #if defined(YYBISON) || !defined(YYBYACC)
128 1.1 christos static void yyerror(const char *s);
129 1.1 christos #endif
130 1.1 christos #line 81 "grammar.y"
131 1.1 christos #include <stdio.h>
132 1.1 christos #include <ctype.h>
133 1.1 christos #include <string.h>
134 1.1 christos
135 1.1 christos #define OPT_LINTLIBRARY 1
136 1.1 christos
137 1.1 christos #ifndef TRUE
138 1.1 christos #define TRUE (1)
139 1.1 christos #endif
140 1.1 christos
141 1.1 christos #ifndef FALSE
142 1.1 christos #define FALSE (0)
143 1.1 christos #endif
144 1.1 christos
145 1.1 christos /* #include "cproto.h" */
146 1.1 christos #define MAX_TEXT_SIZE 1024
147 1.1 christos
148 1.1 christos /* Prototype styles */
149 1.1 christos #if OPT_LINTLIBRARY
150 1.1 christos #define PROTO_ANSI_LLIB -2 /* form ANSI lint-library source */
151 1.1 christos #define PROTO_LINTLIBRARY -1 /* form lint-library source */
152 1.1 christos #endif
153 1.1 christos #define PROTO_NONE 0 /* do not output any prototypes */
154 1.1 christos #define PROTO_TRADITIONAL 1 /* comment out parameters */
155 1.1 christos #define PROTO_ABSTRACT 2 /* comment out parameter names */
156 1.1 christos #define PROTO_ANSI 3 /* ANSI C prototype */
157 1.1 christos
158 1.1 christos typedef int PrototypeStyle;
159 1.1 christos
160 1.1 christos typedef char boolean;
161 1.1 christos
162 1.1 christos extern boolean types_out;
163 1.1 christos extern PrototypeStyle proto_style;
164 1.1 christos
165 1.1 christos #define ansiLintLibrary() (proto_style == PROTO_ANSI_LLIB)
166 1.1 christos #define knrLintLibrary() (proto_style == PROTO_LINTLIBRARY)
167 1.1 christos #define lintLibrary() (knrLintLibrary() || ansiLintLibrary())
168 1.1 christos
169 1.1 christos #if OPT_LINTLIBRARY
170 1.1 christos #define FUNC_UNKNOWN -1 /* unspecified */
171 1.1 christos #else
172 1.1 christos #define FUNC_UNKNOWN 0 /* unspecified (same as FUNC_NONE) */
173 1.1 christos #endif
174 1.1 christos #define FUNC_NONE 0 /* not a function definition */
175 1.1 christos #define FUNC_TRADITIONAL 1 /* traditional style */
176 1.1 christos #define FUNC_ANSI 2 /* ANSI style */
177 1.1 christos #define FUNC_BOTH 3 /* both styles */
178 1.1 christos
179 1.1 christos typedef int FuncDefStyle;
180 1.1 christos
181 1.1 christos /* Source file text */
182 1.1 christos typedef struct text {
183 1.1 christos char text[MAX_TEXT_SIZE]; /* source text */
184 1.1 christos long begin; /* offset in temporary file */
185 1.1 christos } Text;
186 1.1 christos
187 1.1 christos /* Declaration specifier flags */
188 1.1 christos #define DS_NONE 0 /* default */
189 1.1 christos #define DS_EXTERN 1 /* contains "extern" specifier */
190 1.1 christos #define DS_STATIC 2 /* contains "static" specifier */
191 1.1 christos #define DS_CHAR 4 /* contains "char" type specifier */
192 1.1 christos #define DS_SHORT 8 /* contains "short" type specifier */
193 1.1 christos #define DS_FLOAT 16 /* contains "float" type specifier */
194 1.1 christos #define DS_INLINE 32 /* contains "inline" specifier */
195 1.1 christos #define DS_JUNK 64 /* we're not interested in this declaration */
196 1.1 christos
197 1.1 christos /* This structure stores information about a declaration specifier. */
198 1.1 christos typedef struct decl_spec {
199 1.1 christos unsigned short flags; /* flags defined above */
200 1.1 christos char *text; /* source text */
201 1.1 christos long begin; /* offset in temporary file */
202 1.1 christos } DeclSpec;
203 1.1 christos
204 1.1 christos /* This is a list of function parameters. */
205 1.1 christos typedef struct _ParameterList {
206 1.1 christos struct parameter *first; /* pointer to first parameter in list */
207 1.1 christos struct parameter *last; /* pointer to last parameter in list */
208 1.1 christos long begin_comment; /* begin offset of comment */
209 1.1 christos long end_comment; /* end offset of comment */
210 1.1 christos char *comment; /* comment at start of parameter list */
211 1.1 christos } ParameterList;
212 1.1 christos
213 1.1 christos /* This structure stores information about a declarator. */
214 1.1 christos typedef struct _Declarator {
215 1.1 christos char *name; /* name of variable or function */
216 1.1 christos char *text; /* source text */
217 1.1 christos long begin; /* offset in temporary file */
218 1.1 christos long begin_comment; /* begin offset of comment */
219 1.1 christos long end_comment; /* end offset of comment */
220 1.1 christos FuncDefStyle func_def; /* style of function definition */
221 1.1 christos ParameterList params; /* function parameters */
222 1.1 christos boolean pointer; /* TRUE if it declares a pointer */
223 1.1 christos struct _Declarator *head; /* head function declarator */
224 1.1 christos struct _Declarator *func_stack; /* stack of function declarators */
225 1.1 christos struct _Declarator *next; /* next declarator in list */
226 1.1 christos } Declarator;
227 1.1 christos
228 1.1 christos /* This structure stores information about a function parameter. */
229 1.1 christos typedef struct parameter {
230 1.1 christos struct parameter *next; /* next parameter in list */
231 1.1 christos DeclSpec decl_spec;
232 1.1 christos Declarator *declarator;
233 1.1 christos char *comment; /* comment following the parameter */
234 1.1 christos } Parameter;
235 1.1 christos
236 1.1 christos /* This is a list of declarators. */
237 1.1 christos typedef struct declarator_list {
238 1.1 christos Declarator *first; /* pointer to first declarator in list */
239 1.1 christos Declarator *last; /* pointer to last declarator in list */
240 1.1 christos } DeclaratorList;
241 1.1 christos
242 1.1 christos /* #include "symbol.h" */
243 1.1 christos typedef struct symbol {
244 1.1 christos struct symbol *next; /* next symbol in list */
245 1.1 christos char *name; /* name of symbol */
246 1.1 christos char *value; /* value of symbol (for defines) */
247 1.1 christos short flags; /* symbol attributes */
248 1.1 christos } Symbol;
249 1.1 christos
250 1.1 christos /* parser stack entry type */
251 1.1 christos typedef union {
252 1.1 christos Text text;
253 1.1 christos DeclSpec decl_spec;
254 1.1 christos Parameter *parameter;
255 1.1 christos ParameterList param_list;
256 1.1 christos Declarator *declarator;
257 1.1 christos DeclaratorList decl_list;
258 1.1 christos } YYSTYPE;
259 1.1 christos
260 1.1 christos /* The hash table length should be a prime number. */
261 1.1 christos #define SYM_MAX_HASH 251
262 1.1 christos
263 1.1 christos typedef struct symbol_table {
264 1.1 christos Symbol *bucket[SYM_MAX_HASH]; /* hash buckets */
265 1.1 christos } SymbolTable;
266 1.1 christos
267 1.1 christos extern SymbolTable *new_symbol_table /* Create symbol table */
268 1.1 christos (void);
269 1.1 christos extern void free_symbol_table /* Destroy symbol table */
270 1.1 christos (SymbolTable *s);
271 1.1 christos extern Symbol *find_symbol /* Lookup symbol name */
272 1.1 christos (SymbolTable *s, const char *n);
273 1.1 christos extern Symbol *new_symbol /* Define new symbol */
274 1.1 christos (SymbolTable *s, const char *n, const char *v, int f);
275 1.1 christos
276 1.1 christos /* #include "semantic.h" */
277 1.1 christos extern void new_decl_spec (DeclSpec *, const char *, long, int);
278 1.1 christos extern void free_decl_spec (DeclSpec *);
279 1.1 christos extern void join_decl_specs (DeclSpec *, DeclSpec *, DeclSpec *);
280 1.1 christos extern void check_untagged (DeclSpec *);
281 1.1 christos extern Declarator *new_declarator (const char *, const char *, long);
282 1.1 christos extern void free_declarator (Declarator *);
283 1.1 christos extern void new_decl_list (DeclaratorList *, Declarator *);
284 1.1 christos extern void free_decl_list (DeclaratorList *);
285 1.1 christos extern void add_decl_list (DeclaratorList *, DeclaratorList *, Declarator *);
286 1.1 christos extern Parameter *new_parameter (DeclSpec *, Declarator *);
287 1.1 christos extern void free_parameter (Parameter *);
288 1.1 christos extern void new_param_list (ParameterList *, Parameter *);
289 1.1 christos extern void free_param_list (ParameterList *);
290 1.1 christos extern void add_param_list (ParameterList *, ParameterList *, Parameter *);
291 1.1 christos extern void new_ident_list (ParameterList *);
292 1.1 christos extern void add_ident_list (ParameterList *, ParameterList *, const char *);
293 1.1 christos extern void set_param_types (ParameterList *, DeclSpec *, DeclaratorList *);
294 1.1 christos extern void gen_declarations (DeclSpec *, DeclaratorList *);
295 1.1 christos extern void gen_prototype (DeclSpec *, Declarator *);
296 1.1 christos extern void gen_func_declarator (Declarator *);
297 1.1 christos extern void gen_func_definition (DeclSpec *, Declarator *);
298 1.1 christos
299 1.1 christos extern void init_parser (void);
300 1.1 christos extern void process_file (FILE *infile, char *name);
301 1.1 christos extern char *cur_text (void);
302 1.1 christos extern char *cur_file_name (void);
303 1.1 christos extern char *implied_typedef (void);
304 1.1 christos extern void include_file (char *name, int convert);
305 1.1 christos extern char *supply_parm (int count);
306 1.1 christos extern char *xstrdup (const char *);
307 1.1 christos extern int already_declared (char *name);
308 1.1 christos extern int is_actual_func (Declarator *d);
309 1.1 christos extern int lint_ellipsis (Parameter *p);
310 1.1 christos extern int want_typedef (void);
311 1.1 christos extern void begin_tracking (void);
312 1.1 christos extern void begin_typedef (void);
313 1.1 christos extern void copy_typedef (char *s);
314 1.1 christos extern void ellipsis_varargs (Declarator *d);
315 1.1 christos extern void end_typedef (void);
316 1.1 christos extern void flush_varargs (void);
317 1.1 christos extern void fmt_library (int code);
318 1.1 christos extern void imply_typedef (const char *s);
319 1.1 christos extern void indent (FILE *outf);
320 1.1 christos extern void put_blankline (FILE *outf);
321 1.1 christos extern void put_body (FILE *outf, DeclSpec *decl_spec, Declarator *declarator);
322 1.1 christos extern void put_char (FILE *outf, int c);
323 1.1 christos extern void put_error (void);
324 1.1 christos extern void put_newline (FILE *outf);
325 1.1 christos extern void put_padded (FILE *outf, const char *s);
326 1.1 christos extern void put_string (FILE *outf, const char *s);
327 1.1 christos extern void track_in (void);
328 1.1 christos
329 1.1 christos extern boolean file_comments;
330 1.1 christos extern FuncDefStyle func_style;
331 1.1 christos extern char base_file[];
332 1.1 christos
333 1.1 christos extern int yylex (void);
334 1.1 christos
335 1.1 christos /* declaration specifier attributes for the typedef statement currently being
336 1.1 christos * scanned
337 1.1 christos */
338 1.1 christos static int cur_decl_spec_flags;
339 1.1 christos
340 1.1 christos /* pointer to parameter list for the current function definition */
341 1.1 christos static ParameterList *func_params;
342 1.1 christos
343 1.1 christos /* A parser semantic action sets this pointer to the current declarator in
344 1.1 christos * a function parameter declaration in order to catch any comments following
345 1.1 christos * the parameter declaration on the same line. If the lexer scans a comment
346 1.1 christos * and <cur_declarator> is not NULL, then the comment is attached to the
347 1.1 christos * declarator. To ignore subsequent comments, the lexer sets this to NULL
348 1.1 christos * after scanning a comment or end of line.
349 1.1 christos */
350 1.1 christos static Declarator *cur_declarator;
351 1.1 christos
352 1.1 christos /* temporary string buffer */
353 1.1 christos static char buf[MAX_TEXT_SIZE];
354 1.1 christos
355 1.1 christos /* table of typedef names */
356 1.1 christos static SymbolTable *typedef_names;
357 1.1 christos
358 1.1 christos /* table of define names */
359 1.1 christos static SymbolTable *define_names;
360 1.1 christos
361 1.1 christos /* table of type qualifiers */
362 1.1 christos static SymbolTable *type_qualifiers;
363 1.1 christos
364 1.1 christos /* information about the current input file */
365 1.1 christos typedef struct {
366 1.1 christos char *base_name; /* base input file name */
367 1.1 christos char *file_name; /* current file name */
368 1.1 christos FILE *file; /* input file */
369 1.1 christos unsigned line_num; /* current line number in input file */
370 1.1 christos FILE *tmp_file; /* temporary file */
371 1.1 christos long begin_comment; /* tmp file offset after last written ) or ; */
372 1.1 christos long end_comment; /* tmp file offset after last comment */
373 1.1 christos boolean convert; /* if TRUE, convert function definitions */
374 1.1 christos boolean changed; /* TRUE if conversion done in this file */
375 1.1 christos } IncludeStack;
376 1.1 christos
377 1.1 christos static IncludeStack *cur_file; /* current input file */
378 1.1 christos
379 1.1 christos /* #include "yyerror.c" */
380 1.1 christos
381 1.1 christos static int haveAnsiParam (void);
382 1.1 christos
383 1.1 christos
384 1.1 christos /* Flags to enable us to find if a procedure returns a value.
385 1.1 christos */
386 1.1 christos static int return_val; /* nonzero on BRACES iff return-expression found */
387 1.1 christos
388 1.1 christos static const char *
389 1.1 christos dft_decl_spec (void)
390 1.1 christos {
391 1.1 christos return (lintLibrary() && !return_val) ? "void" : "int";
392 1.1 christos }
393 1.1 christos
394 1.1 christos static int
395 1.1 christos haveAnsiParam (void)
396 1.1 christos {
397 1.1 christos Parameter *p;
398 1.1 christos if (func_params != 0) {
399 1.1 christos for (p = func_params->first; p != 0; p = p->next) {
400 1.1 christos if (p->declarator->func_def == FUNC_ANSI) {
401 1.1 christos return TRUE;
402 1.1 christos }
403 1.1 christos }
404 1.1 christos }
405 1.1 christos return FALSE;
406 1.1 christos }
407 1.1 christos #line 408 "grammar.tab.c"
408 1.1 christos
409 1.1 christos /* compatibility with bison */
410 1.1 christos #ifdef YYPARSE_PARAM
411 1.1 christos /* compatibility with FreeBSD */
412 1.1 christos # ifdef YYPARSE_PARAM_TYPE
413 1.1 christos # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
414 1.1 christos # else
415 1.1 christos # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
416 1.1 christos # endif
417 1.1 christos #else
418 1.1 christos # define YYPARSE_DECL() yyparse(void)
419 1.1 christos #endif
420 1.1 christos
421 1.1 christos /* Parameters sent to lex. */
422 1.1 christos #ifdef YYLEX_PARAM
423 1.1 christos # define YYLEX_DECL() yylex(void *YYLEX_PARAM)
424 1.1 christos # define YYLEX yylex(YYLEX_PARAM)
425 1.1 christos #else
426 1.1 christos # define YYLEX_DECL() yylex(void)
427 1.1 christos # define YYLEX yylex()
428 1.1 christos #endif
429 1.1 christos
430 1.1 christos /* Parameters sent to yyerror. */
431 1.1 christos #ifndef YYERROR_DECL
432 1.1 christos #define YYERROR_DECL() yyerror(const char *s)
433 1.1 christos #endif
434 1.1 christos #ifndef YYERROR_CALL
435 1.1 christos #define YYERROR_CALL(msg) yyerror(msg)
436 1.1 christos #endif
437 1.1 christos
438 1.1 christos extern int YYPARSE_DECL();
439 1.1 christos
440 1.1 christos #define T_IDENTIFIER 257
441 1.1 christos #define T_TYPEDEF_NAME 258
442 1.1 christos #define T_DEFINE_NAME 259
443 1.1 christos #define T_AUTO 260
444 1.1 christos #define T_EXTERN 261
445 1.1 christos #define T_REGISTER 262
446 1.1 christos #define T_STATIC 263
447 1.1 christos #define T_TYPEDEF 264
448 1.1 christos #define T_INLINE 265
449 1.1 christos #define T_EXTENSION 266
450 1.1 christos #define T_CHAR 267
451 1.1 christos #define T_DOUBLE 268
452 1.1 christos #define T_FLOAT 269
453 1.1 christos #define T_INT 270
454 1.1 christos #define T_VOID 271
455 1.1 christos #define T_LONG 272
456 1.1 christos #define T_SHORT 273
457 1.1 christos #define T_SIGNED 274
458 1.1 christos #define T_UNSIGNED 275
459 1.1 christos #define T_ENUM 276
460 1.1 christos #define T_STRUCT 277
461 1.1 christos #define T_UNION 278
462 1.1 christos #define T_Bool 279
463 1.1 christos #define T_Complex 280
464 1.1 christos #define T_Imaginary 281
465 1.1 christos #define T_TYPE_QUALIFIER 282
466 1.1 christos #define T_BRACKETS 283
467 1.1 christos #define T_LBRACE 284
468 1.1 christos #define T_MATCHRBRACE 285
469 1.1 christos #define T_ELLIPSIS 286
470 1.1 christos #define T_INITIALIZER 287
471 1.1 christos #define T_STRING_LITERAL 288
472 1.1 christos #define T_ASM 289
473 1.1 christos #define T_ASMARG 290
474 1.1 christos #define T_VA_DCL 291
475 1.1 christos #define YYERRCODE 256
476 1.1 christos typedef short YYINT;
477 1.1 christos static const YYINT grammar_lhs[] = { -1,
478 1.1 christos 0, 0, 26, 26, 27, 27, 27, 27, 27, 27,
479 1.1 christos 27, 31, 30, 30, 28, 28, 34, 28, 32, 32,
480 1.1 christos 33, 33, 35, 35, 37, 38, 29, 39, 29, 36,
481 1.1 christos 36, 36, 40, 40, 1, 1, 2, 2, 2, 3,
482 1.1 christos 3, 3, 3, 3, 3, 4, 4, 4, 4, 4,
483 1.1 christos 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
484 1.1 christos 5, 5, 6, 6, 6, 19, 19, 8, 8, 9,
485 1.1 christos 41, 9, 7, 7, 7, 25, 23, 23, 10, 10,
486 1.1 christos 11, 11, 11, 11, 11, 20, 20, 21, 21, 22,
487 1.1 christos 22, 14, 14, 15, 15, 16, 16, 16, 17, 17,
488 1.1 christos 18, 18, 24, 24, 12, 12, 12, 13, 13, 13,
489 1.1 christos 13, 13, 13, 13,
490 1.1 christos };
491 1.1 christos static const YYINT grammar_len[] = { 2,
492 1.1 christos 0, 1, 1, 2, 1, 1, 1, 1, 3, 2,
493 1.1 christos 2, 2, 3, 3, 2, 3, 0, 5, 2, 1,
494 1.1 christos 0, 1, 1, 3, 0, 0, 7, 0, 5, 0,
495 1.1 christos 1, 1, 1, 2, 1, 2, 1, 1, 1, 1,
496 1.1 christos 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
497 1.1 christos 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
498 1.1 christos 1, 1, 3, 2, 2, 1, 1, 1, 3, 1,
499 1.1 christos 0, 4, 3, 2, 2, 1, 1, 1, 2, 1,
500 1.1 christos 1, 3, 2, 4, 4, 2, 3, 0, 1, 1,
501 1.1 christos 2, 1, 3, 1, 3, 2, 2, 1, 0, 1,
502 1.1 christos 1, 3, 1, 2, 1, 2, 1, 3, 2, 1,
503 1.1 christos 4, 3, 3, 2,
504 1.1 christos };
505 1.1 christos static const YYINT grammar_defred[] = { 0,
506 1.1 christos 0, 0, 0, 0, 77, 0, 62, 40, 0, 42,
507 1.1 christos 43, 20, 44, 0, 46, 47, 48, 49, 54, 50,
508 1.1 christos 51, 52, 53, 76, 66, 67, 55, 56, 57, 61,
509 1.1 christos 0, 7, 0, 0, 35, 37, 38, 39, 59, 60,
510 1.1 christos 28, 0, 0, 0, 103, 81, 0, 0, 3, 5,
511 1.1 christos 6, 8, 0, 10, 11, 78, 0, 90, 0, 0,
512 1.1 christos 104, 0, 19, 0, 41, 45, 15, 36, 0, 68,
513 1.1 christos 0, 0, 0, 83, 0, 0, 64, 0, 0, 74,
514 1.1 christos 4, 58, 0, 82, 87, 91, 0, 14, 13, 9,
515 1.1 christos 16, 0, 71, 0, 31, 33, 0, 0, 0, 0,
516 1.1 christos 0, 94, 0, 0, 101, 12, 63, 73, 0, 0,
517 1.1 christos 69, 0, 0, 0, 34, 0, 110, 96, 97, 0,
518 1.1 christos 0, 84, 0, 85, 0, 23, 0, 0, 72, 26,
519 1.1 christos 29, 114, 0, 0, 0, 109, 0, 93, 95, 102,
520 1.1 christos 18, 0, 0, 108, 113, 112, 0, 24, 27, 111,
521 1.1 christos };
522 1.1 christos static const YYINT grammar_stos[] = { 0,
523 1.1 christos 256, 40, 42, 38, 257, 258, 259, 260, 261, 262,
524 1.1 christos 263, 264, 265, 266, 267, 268, 269, 270, 271, 272,
525 1.1 christos 273, 274, 275, 276, 277, 278, 279, 280, 281, 282,
526 1.1 christos 289, 59, 293, 294, 295, 296, 297, 298, 299, 300,
527 1.1 christos 303, 304, 312, 313, 316, 317, 318, 319, 320, 321,
528 1.1 christos 322, 323, 325, 285, 59, 258, 303, 298, 314, 315,
529 1.1 christos 316, 288, 264, 290, 261, 266, 59, 295, 301, 302,
530 1.1 christos 303, 332, 40, 283, 284, 316, 324, 304, 316, 324,
531 1.1 christos 320, 258, 294, 41, 313, 298, 294, 321, 324, 59,
532 1.1 christos 59, 44, 61, 330, 291, 321, 329, 333, 294, 307,
533 1.1 christos 308, 309, 310, 311, 316, 285, 324, 324, 327, 303,
534 1.1 christos 302, 334, 329, 284, 321, 40, 283, 303, 305, 306,
535 1.1 christos 313, 41, 44, 41, 44, 303, 326, 328, 287, 284,
536 1.1 christos 285, 41, 305, 307, 40, 283, 306, 286, 309, 316,
537 1.1 christos 59, 44, 331, 41, 41, 41, 307, 303, 285, 41,
538 1.1 christos };
539 1.1 christos static const YYINT grammar_dgoto[] = { 33,
540 1.1 christos 87, 35, 36, 37, 38, 39, 40, 69, 70, 41,
541 1.1 christos 42, 119, 120, 100, 101, 102, 103, 104, 43, 44,
542 1.1 christos 59, 60, 45, 46, 47, 48, 49, 50, 51, 52,
543 1.1 christos 77, 53, 127, 109, 128, 97, 94, 143, 72, 98,
544 1.1 christos 112,
545 1.1 christos };
546 1.1 christos static const YYINT grammar_sindex[] = { -2,
547 1.1 christos -3, 27, -239, -177, 0, 0, 0, 0, -274, 0,
548 1.1 christos 0, 0, 0, -246, 0, 0, 0, 0, 0, 0,
549 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
550 1.1 christos -266, 0, 0, 455, 0, 0, 0, 0, 0, 0,
551 1.1 christos 0, -35, -245, 128, 0, 0, -245, -2, 0, 0,
552 1.1 christos 0, 0, 642, 0, 0, 0, -15, 0, -12, -239,
553 1.1 christos 0, 590, 0, -27, 0, 0, 0, 0, -10, 0,
554 1.1 christos -11, 534, -72, 0, -237, -232, 0, -35, -232, 0,
555 1.1 christos 0, 0, 642, 0, 0, 0, 455, 0, 0, 0,
556 1.1 christos 0, 27, 0, 534, 0, 0, -222, 617, 209, 34,
557 1.1 christos 39, 0, 44, 42, 0, 0, 0, 0, 27, -11,
558 1.1 christos 0, -200, -196, -195, 0, 174, 0, 0, 0, -33,
559 1.1 christos 243, 0, 561, 0, -177, 0, 33, 49, 0, 0,
560 1.1 christos 0, 0, 53, 55, 417, 0, -33, 0, 0, 0,
561 1.1 christos 0, 27, -188, 0, 0, 0, 57, 0, 0, 0,
562 1.1 christos };
563 1.1 christos static const YYINT grammar_rindex[] = { 99,
564 1.1 christos 0, 0, 275, 0, 0, -38, 0, 0, 481, 0,
565 1.1 christos 0, 0, 0, 509, 0, 0, 0, 0, 0, 0,
566 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
567 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
568 1.1 christos 0, 30, 0, 0, 0, 0, 0, 101, 0, 0,
569 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 343, 309,
570 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
571 1.1 christos 98, -182, 62, 0, 0, 133, 0, 64, 379, 0,
572 1.1 christos 0, 0, -5, 0, 0, 0, 0, 0, 0, 0,
573 1.1 christos 0, 0, 0, -182, 0, 0, 0, -180, -19, 0,
574 1.1 christos 65, 0, 0, 68, 0, 0, 0, 0, 51, 9,
575 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, -13,
576 1.1 christos 19, 0, 0, 0, 0, 0, 0, 52, 0, 0,
577 1.1 christos 0, 0, 0, 0, 0, 0, 35, 0, 0, 0,
578 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
579 1.1 christos };
580 1.1 christos #if YYBTYACC
581 1.1 christos static const YYINT grammar_cindex[] = { 0,
582 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
583 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
584 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
585 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
586 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
587 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
588 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
589 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
590 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
591 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
592 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
593 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
594 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
595 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
596 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
597 1.1 christos };
598 1.1 christos #endif
599 1.1 christos static const YYINT grammar_gindex[] = { 0,
600 1.1 christos 11, -17, 0, 0, 13, 0, 0, 0, 20, 8,
601 1.1 christos -43, -1, -8, -89, 0, -9, 0, 0, 0, -44,
602 1.1 christos 0, 0, 4, 0, 0, 0, 70, -53, 0, 0,
603 1.1 christos -18, 0, 0, 0, 0, 22, 0, 0, 0, 0,
604 1.1 christos 0,
605 1.1 christos };
606 1.1 christos #define YYTABLESIZE 924
607 1.1 christos static const YYINT grammar_table[] = { 58,
608 1.1 christos 78, 58, 58, 58, 73, 58, 135, 61, 88, 57,
609 1.1 christos 34, 5, 56, 62, 85, 58, 68, 63, 96, 7,
610 1.1 christos 58, 98, 78, 64, 98, 84, 134, 107, 80, 3,
611 1.1 christos 107, 90, 17, 92, 17, 4, 17, 2, 75, 3,
612 1.1 christos 96, 71, 30, 89, 115, 147, 76, 106, 91, 93,
613 1.1 christos 79, 75, 70, 17, 121, 55, 32, 107, 34, 105,
614 1.1 christos 108, 114, 105, 83, 4, 68, 2, 70, 3, 68,
615 1.1 christos 80, 121, 86, 80, 122, 106, 105, 78, 106, 5,
616 1.1 christos 56, 68, 123, 99, 124, 125, 129, 130, 80, 131,
617 1.1 christos 80, 141, 142, 144, 110, 145, 149, 150, 1, 110,
618 1.1 christos 2, 30, 99, 32, 79, 92, 118, 79, 100, 21,
619 1.1 christos 22, 111, 137, 139, 133, 113, 126, 81, 0, 0,
620 1.1 christos 0, 0, 79, 57, 79, 0, 99, 0, 140, 0,
621 1.1 christos 0, 0, 0, 99, 0, 0, 0, 0, 0, 0,
622 1.1 christos 0, 70, 0, 0, 0, 99, 0, 0, 0, 148,
623 1.1 christos 0, 0, 0, 0, 0, 0, 70, 0, 0, 0,
624 1.1 christos 0, 0, 0, 0, 0, 4, 0, 2, 0, 0,
625 1.1 christos 65, 0, 65, 65, 65, 0, 65, 0, 0, 0,
626 1.1 christos 0, 0, 0, 0, 5, 6, 7, 8, 65, 10,
627 1.1 christos 11, 65, 13, 66, 15, 16, 17, 18, 19, 20,
628 1.1 christos 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
629 1.1 christos 0, 4, 0, 116, 132, 3, 0, 0, 58, 58,
630 1.1 christos 58, 58, 58, 58, 58, 78, 58, 58, 58, 58,
631 1.1 christos 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
632 1.1 christos 58, 58, 58, 58, 58, 78, 4, 74, 116, 136,
633 1.1 christos 3, 17, 78, 1, 5, 6, 7, 8, 9, 10,
634 1.1 christos 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
635 1.1 christos 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
636 1.1 christos 4, 54, 116, 5, 56, 0, 31, 80, 80, 80,
637 1.1 christos 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
638 1.1 christos 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
639 1.1 christos 80, 80, 88, 80, 88, 88, 88, 0, 88, 0,
640 1.1 christos 80, 79, 79, 79, 79, 79, 79, 79, 79, 79,
641 1.1 christos 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
642 1.1 christos 79, 79, 79, 79, 79, 79, 89, 79, 89, 89,
643 1.1 christos 89, 0, 89, 0, 79, 25, 25, 25, 25, 25,
644 1.1 christos 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
645 1.1 christos 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
646 1.1 christos 86, 25, 86, 86, 5, 56, 86, 0, 25, 65,
647 1.1 christos 65, 65, 65, 65, 65, 65, 0, 65, 65, 65,
648 1.1 christos 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
649 1.1 christos 65, 65, 65, 65, 65, 65, 75, 0, 75, 75,
650 1.1 christos 75, 0, 75, 0, 0, 0, 0, 0, 0, 0,
651 1.1 christos 5, 6, 7, 8, 65, 10, 11, 75, 13, 66,
652 1.1 christos 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
653 1.1 christos 25, 26, 27, 28, 29, 30, 117, 146, 0, 0,
654 1.1 christos 0, 0, 0, 0, 0, 5, 6, 7, 8, 65,
655 1.1 christos 10, 11, 0, 13, 66, 15, 16, 17, 18, 19,
656 1.1 christos 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
657 1.1 christos 30, 117, 4, 0, 2, 0, 3, 0, 0, 5,
658 1.1 christos 56, 0, 0, 0, 0, 0, 0, 0, 0, 0,
659 1.1 christos 0, 0, 0, 67, 0, 0, 0, 0, 41, 0,
660 1.1 christos 41, 0, 41, 0, 0, 117, 0, 0, 0, 0,
661 1.1 christos 0, 88, 88, 0, 0, 0, 0, 0, 0, 41,
662 1.1 christos 0, 0, 0, 0, 0, 0, 45, 0, 45, 0,
663 1.1 christos 45, 0, 0, 0, 0, 0, 0, 88, 0, 0,
664 1.1 christos 0, 0, 0, 0, 0, 89, 89, 45, 0, 0,
665 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
666 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
667 1.1 christos 0, 89, 0, 0, 0, 0, 0, 0, 0, 86,
668 1.1 christos 86, 0, 0, 0, 0, 0, 0, 0, 0, 0,
669 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
670 1.1 christos 0, 0, 0, 0, 0, 86, 0, 0, 0, 0,
671 1.1 christos 0, 0, 0, 0, 0, 75, 75, 75, 75, 75,
672 1.1 christos 75, 75, 0, 75, 75, 75, 75, 75, 75, 75,
673 1.1 christos 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
674 1.1 christos 75, 75, 0, 0, 0, 0, 0, 0, 0, 0,
675 1.1 christos 0, 0, 0, 0, 82, 7, 8, 65, 10, 11,
676 1.1 christos 0, 13, 66, 15, 16, 17, 18, 19, 20, 21,
677 1.1 christos 22, 23, 24, 25, 26, 27, 28, 29, 30, 0,
678 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
679 1.1 christos 0, 5, 6, 7, 8, 65, 10, 11, 0, 13,
680 1.1 christos 66, 15, 16, 17, 18, 19, 20, 21, 22, 23,
681 1.1 christos 24, 25, 26, 27, 28, 29, 30, 41, 41, 41,
682 1.1 christos 41, 41, 41, 41, 0, 41, 41, 41, 41, 41,
683 1.1 christos 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
684 1.1 christos 41, 41, 41, 0, 0, 45, 45, 45, 45, 45,
685 1.1 christos 45, 45, 0, 45, 45, 45, 45, 45, 45, 45,
686 1.1 christos 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
687 1.1 christos 45, 82, 7, 8, 65, 10, 11, 12, 13, 14,
688 1.1 christos 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
689 1.1 christos 25, 26, 27, 28, 29, 30, 0, 0, 82, 7,
690 1.1 christos 8, 65, 10, 11, 95, 13, 66, 15, 16, 17,
691 1.1 christos 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
692 1.1 christos 28, 29, 30, 0, 0, 0, 138, 82, 7, 8,
693 1.1 christos 65, 10, 11, 12, 13, 14, 15, 16, 17, 18,
694 1.1 christos 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
695 1.1 christos 29, 30, 0, 75, 82, 7, 8, 65, 10, 11,
696 1.1 christos 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
697 1.1 christos 22, 23, 24, 25, 26, 27, 28, 29, 30, 82,
698 1.1 christos 7, 8, 65, 10, 11, 0, 13, 66, 15, 16,
699 1.1 christos 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
700 1.1 christos 27, 28, 29, 30,
701 1.1 christos };
702 1.1 christos static const YYINT grammar_check[] = { 38,
703 1.1 christos 44, 40, 41, 42, 40, 44, 40, 4, 62, 2,
704 1.1 christos 0, 257, 258, 288, 59, 3, 34, 264, 72, 259,
705 1.1 christos 59, 41, 61, 290, 44, 41, 116, 41, 47, 42,
706 1.1 christos 44, 59, 38, 44, 40, 38, 42, 40, 284, 42,
707 1.1 christos 94, 34, 282, 62, 98, 135, 43, 285, 59, 61,
708 1.1 christos 47, 284, 44, 59, 99, 59, 59, 76, 48, 41,
709 1.1 christos 79, 284, 44, 53, 38, 83, 40, 59, 42, 87,
710 1.1 christos 41, 116, 60, 44, 41, 41, 73, 121, 44, 257,
711 1.1 christos 258, 99, 44, 73, 41, 44, 287, 284, 59, 285,
712 1.1 christos 61, 59, 44, 41, 87, 41, 285, 41, 0, 92,
713 1.1 christos 0, 284, 41, 284, 41, 41, 99, 44, 41, 59,
714 1.1 christos 59, 92, 121, 123, 116, 94, 109, 48, -1, -1,
715 1.1 christos -1, -1, 59, 116, 61, -1, 116, -1, 125, -1,
716 1.1 christos -1, -1, -1, 123, -1, -1, -1, -1, -1, -1,
717 1.1 christos -1, 44, -1, -1, -1, 135, -1, -1, -1, 142,
718 1.1 christos -1, -1, -1, -1, -1, -1, 59, -1, -1, -1,
719 1.1 christos -1, -1, -1, -1, -1, 38, -1, 40, -1, -1,
720 1.1 christos 38, -1, 40, 41, 42, -1, 44, -1, -1, -1,
721 1.1 christos -1, -1, -1, -1, 257, 258, 259, 260, 261, 262,
722 1.1 christos 263, 59, 265, 266, 267, 268, 269, 270, 271, 272,
723 1.1 christos 273, 274, 275, 276, 277, 278, 279, 280, 281, 282,
724 1.1 christos -1, 38, -1, 40, 41, 42, -1, -1, 257, 258,
725 1.1 christos 259, 260, 261, 262, 263, 264, 265, 266, 267, 268,
726 1.1 christos 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
727 1.1 christos 279, 280, 281, 282, 283, 284, 38, 283, 40, 283,
728 1.1 christos 42, 257, 291, 256, 257, 258, 259, 260, 261, 262,
729 1.1 christos 263, 264, 265, 266, 267, 268, 269, 270, 271, 272,
730 1.1 christos 273, 274, 275, 276, 277, 278, 279, 280, 281, 282,
731 1.1 christos 38, 285, 40, 257, 258, -1, 289, 258, 259, 260,
732 1.1 christos 261, 262, 263, 264, 265, 266, 267, 268, 269, 270,
733 1.1 christos 271, 272, 273, 274, 275, 276, 277, 278, 279, 280,
734 1.1 christos 281, 282, 38, 284, 40, 41, 42, -1, 44, -1,
735 1.1 christos 291, 258, 259, 260, 261, 262, 263, 264, 265, 266,
736 1.1 christos 267, 268, 269, 270, 271, 272, 273, 274, 275, 276,
737 1.1 christos 277, 278, 279, 280, 281, 282, 38, 284, 40, 41,
738 1.1 christos 42, -1, 44, -1, 291, 258, 259, 260, 261, 262,
739 1.1 christos 263, 264, 265, 266, 267, 268, 269, 270, 271, 272,
740 1.1 christos 273, 274, 275, 276, 277, 278, 279, 280, 281, 282,
741 1.1 christos 38, 284, 40, 41, 257, 258, 44, -1, 291, 257,
742 1.1 christos 258, 259, 260, 261, 262, 263, -1, 265, 266, 267,
743 1.1 christos 268, 269, 270, 271, 272, 273, 274, 275, 276, 277,
744 1.1 christos 278, 279, 280, 281, 282, 283, 38, -1, 40, 41,
745 1.1 christos 42, -1, 44, -1, -1, -1, -1, -1, -1, -1,
746 1.1 christos 257, 258, 259, 260, 261, 262, 263, 59, 265, 266,
747 1.1 christos 267, 268, 269, 270, 271, 272, 273, 274, 275, 276,
748 1.1 christos 277, 278, 279, 280, 281, 282, 283, 41, -1, -1,
749 1.1 christos -1, -1, -1, -1, -1, 257, 258, 259, 260, 261,
750 1.1 christos 262, 263, -1, 265, 266, 267, 268, 269, 270, 271,
751 1.1 christos 272, 273, 274, 275, 276, 277, 278, 279, 280, 281,
752 1.1 christos 282, 283, 38, -1, 40, -1, 42, -1, -1, 257,
753 1.1 christos 258, -1, -1, -1, -1, -1, -1, -1, -1, -1,
754 1.1 christos -1, -1, -1, 59, -1, -1, -1, -1, 38, -1,
755 1.1 christos 40, -1, 42, -1, -1, 283, -1, -1, -1, -1,
756 1.1 christos -1, 257, 258, -1, -1, -1, -1, -1, -1, 59,
757 1.1 christos -1, -1, -1, -1, -1, -1, 38, -1, 40, -1,
758 1.1 christos 42, -1, -1, -1, -1, -1, -1, 283, -1, -1,
759 1.1 christos -1, -1, -1, -1, -1, 257, 258, 59, -1, -1,
760 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
761 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
762 1.1 christos -1, 283, -1, -1, -1, -1, -1, -1, -1, 257,
763 1.1 christos 258, -1, -1, -1, -1, -1, -1, -1, -1, -1,
764 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
765 1.1 christos -1, -1, -1, -1, -1, 283, -1, -1, -1, -1,
766 1.1 christos -1, -1, -1, -1, -1, 257, 258, 259, 260, 261,
767 1.1 christos 262, 263, -1, 265, 266, 267, 268, 269, 270, 271,
768 1.1 christos 272, 273, 274, 275, 276, 277, 278, 279, 280, 281,
769 1.1 christos 282, 283, -1, -1, -1, -1, -1, -1, -1, -1,
770 1.1 christos -1, -1, -1, -1, 258, 259, 260, 261, 262, 263,
771 1.1 christos -1, 265, 266, 267, 268, 269, 270, 271, 272, 273,
772 1.1 christos 274, 275, 276, 277, 278, 279, 280, 281, 282, -1,
773 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
774 1.1 christos -1, 257, 258, 259, 260, 261, 262, 263, -1, 265,
775 1.1 christos 266, 267, 268, 269, 270, 271, 272, 273, 274, 275,
776 1.1 christos 276, 277, 278, 279, 280, 281, 282, 257, 258, 259,
777 1.1 christos 260, 261, 262, 263, -1, 265, 266, 267, 268, 269,
778 1.1 christos 270, 271, 272, 273, 274, 275, 276, 277, 278, 279,
779 1.1 christos 280, 281, 282, -1, -1, 257, 258, 259, 260, 261,
780 1.1 christos 262, 263, -1, 265, 266, 267, 268, 269, 270, 271,
781 1.1 christos 272, 273, 274, 275, 276, 277, 278, 279, 280, 281,
782 1.1 christos 282, 258, 259, 260, 261, 262, 263, 264, 265, 266,
783 1.1 christos 267, 268, 269, 270, 271, 272, 273, 274, 275, 276,
784 1.1 christos 277, 278, 279, 280, 281, 282, -1, -1, 258, 259,
785 1.1 christos 260, 261, 262, 263, 291, 265, 266, 267, 268, 269,
786 1.1 christos 270, 271, 272, 273, 274, 275, 276, 277, 278, 279,
787 1.1 christos 280, 281, 282, -1, -1, -1, 286, 258, 259, 260,
788 1.1 christos 261, 262, 263, 264, 265, 266, 267, 268, 269, 270,
789 1.1 christos 271, 272, 273, 274, 275, 276, 277, 278, 279, 280,
790 1.1 christos 281, 282, -1, 284, 258, 259, 260, 261, 262, 263,
791 1.1 christos 264, 265, 266, 267, 268, 269, 270, 271, 272, 273,
792 1.1 christos 274, 275, 276, 277, 278, 279, 280, 281, 282, 258,
793 1.1 christos 259, 260, 261, 262, 263, -1, 265, 266, 267, 268,
794 1.1 christos 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
795 1.1 christos 279, 280, 281, 282,
796 1.1 christos };
797 1.1 christos #if YYBTYACC
798 1.1 christos static const YYINT grammar_ctable[] = { -1,
799 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
800 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
801 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
802 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
803 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
804 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
805 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
806 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
807 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
808 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
809 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
810 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
811 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
812 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
813 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
814 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
815 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
816 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
817 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
818 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
819 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
820 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
821 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
822 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
823 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
824 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
825 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
826 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
827 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
828 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
829 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
830 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
831 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
832 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
833 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
834 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
835 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
836 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
837 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
838 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
839 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
840 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
841 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
842 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
843 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
844 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
845 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
846 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
847 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
848 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
849 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
850 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
851 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
852 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
853 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
854 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
855 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
856 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
857 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
858 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
859 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
860 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
861 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
862 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
863 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
864 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
865 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
866 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
867 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
868 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
869 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
870 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
871 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
872 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
873 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
874 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
875 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
876 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
877 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
878 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
879 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
880 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
881 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
882 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
883 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
884 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
885 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
886 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
887 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
888 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
889 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
890 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
891 1.1 christos -1, -1, -1,
892 1.1 christos };
893 1.1 christos #endif
894 1.1 christos #define YYFINAL 33
895 1.1 christos #ifndef YYDEBUG
896 1.1 christos #define YYDEBUG 0
897 1.1 christos #endif
898 1.1 christos #define YYMAXTOKEN 291
899 1.1 christos #define YYUNDFTOKEN 335
900 1.1 christos #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
901 1.1 christos #if YYDEBUG
902 1.1 christos static const char *const grammar_name[] = {
903 1.1 christos
904 1.1 christos "$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,
905 1.1 christos 0,"'&'",0,"'('","')'","'*'",0,"','",0,0,0,0,0,0,0,0,0,0,0,0,0,0,"';'",0,"'='",0,
906 1.1 christos 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
907 1.1 christos 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
908 1.1 christos 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
909 1.1 christos 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
910 1.1 christos 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"error",
911 1.1 christos "T_IDENTIFIER","T_TYPEDEF_NAME","T_DEFINE_NAME","T_AUTO","T_EXTERN",
912 1.1 christos "T_REGISTER","T_STATIC","T_TYPEDEF","T_INLINE","T_EXTENSION","T_CHAR",
913 1.1 christos "T_DOUBLE","T_FLOAT","T_INT","T_VOID","T_LONG","T_SHORT","T_SIGNED",
914 1.1 christos "T_UNSIGNED","T_ENUM","T_STRUCT","T_UNION","T_Bool","T_Complex","T_Imaginary",
915 1.1 christos "T_TYPE_QUALIFIER","T_BRACKETS","T_LBRACE","T_MATCHRBRACE","T_ELLIPSIS",
916 1.1 christos "T_INITIALIZER","T_STRING_LITERAL","T_ASM","T_ASMARG","T_VA_DCL","$accept",
917 1.1 christos "program","decl_specifiers","decl_specifier","storage_class","type_specifier",
918 1.1 christos "type_qualifier","struct_or_union_specifier","enum_specifier",
919 1.1 christos "init_declarator_list","init_declarator","declarator","direct_declarator",
920 1.1 christos "abs_declarator","direct_abs_declarator","parameter_type_list","parameter_list",
921 1.1 christos "parameter_declaration","opt_identifier_list","identifier_list",
922 1.1 christos "struct_or_union","pointer","opt_type_qualifiers","type_qualifier_list",
923 1.1 christos "any_id","identifier_or_ref","enumeration","translation_unit",
924 1.1 christos "external_declaration","declaration","function_definition",
925 1.1 christos "linkage_specification","braces","any_typedef","opt_declarator_list","$$1",
926 1.1 christos "declarator_list","opt_declaration_list","$$2","$$3","$$4","declaration_list",
927 1.1 christos "$$5","illegal-symbol",
928 1.1 christos };
929 1.1 christos static const char *const grammar_rule[] = {
930 1.1 christos "$accept : program",
931 1.1 christos "program :",
932 1.1 christos "program : translation_unit",
933 1.1 christos "translation_unit : external_declaration",
934 1.1 christos "translation_unit : translation_unit external_declaration",
935 1.1 christos "external_declaration : declaration",
936 1.1 christos "external_declaration : function_definition",
937 1.1 christos "external_declaration : ';'",
938 1.1 christos "external_declaration : linkage_specification",
939 1.1 christos "external_declaration : T_ASM T_ASMARG ';'",
940 1.1 christos "external_declaration : error T_MATCHRBRACE",
941 1.1 christos "external_declaration : error ';'",
942 1.1 christos "braces : T_LBRACE T_MATCHRBRACE",
943 1.1 christos "linkage_specification : T_EXTERN T_STRING_LITERAL braces",
944 1.1 christos "linkage_specification : T_EXTERN T_STRING_LITERAL declaration",
945 1.1 christos "declaration : decl_specifiers ';'",
946 1.1 christos "declaration : decl_specifiers init_declarator_list ';'",
947 1.1 christos "$$1 :",
948 1.1 christos "declaration : any_typedef decl_specifiers $$1 opt_declarator_list ';'",
949 1.1 christos "any_typedef : T_EXTENSION T_TYPEDEF",
950 1.1 christos "any_typedef : T_TYPEDEF",
951 1.1 christos "opt_declarator_list :",
952 1.1 christos "opt_declarator_list : declarator_list",
953 1.1 christos "declarator_list : declarator",
954 1.1 christos "declarator_list : declarator_list ',' declarator",
955 1.1 christos "$$2 :",
956 1.1 christos "$$3 :",
957 1.1 christos "function_definition : decl_specifiers declarator $$2 opt_declaration_list T_LBRACE $$3 T_MATCHRBRACE",
958 1.1 christos "$$4 :",
959 1.1 christos "function_definition : declarator $$4 opt_declaration_list T_LBRACE T_MATCHRBRACE",
960 1.1 christos "opt_declaration_list :",
961 1.1 christos "opt_declaration_list : T_VA_DCL",
962 1.1 christos "opt_declaration_list : declaration_list",
963 1.1 christos "declaration_list : declaration",
964 1.1 christos "declaration_list : declaration_list declaration",
965 1.1 christos "decl_specifiers : decl_specifier",
966 1.1 christos "decl_specifiers : decl_specifiers decl_specifier",
967 1.1 christos "decl_specifier : storage_class",
968 1.1 christos "decl_specifier : type_specifier",
969 1.1 christos "decl_specifier : type_qualifier",
970 1.1 christos "storage_class : T_AUTO",
971 1.1 christos "storage_class : T_EXTERN",
972 1.1 christos "storage_class : T_REGISTER",
973 1.1 christos "storage_class : T_STATIC",
974 1.1 christos "storage_class : T_INLINE",
975 1.1 christos "storage_class : T_EXTENSION",
976 1.1 christos "type_specifier : T_CHAR",
977 1.1 christos "type_specifier : T_DOUBLE",
978 1.1 christos "type_specifier : T_FLOAT",
979 1.1 christos "type_specifier : T_INT",
980 1.1 christos "type_specifier : T_LONG",
981 1.1 christos "type_specifier : T_SHORT",
982 1.1 christos "type_specifier : T_SIGNED",
983 1.1 christos "type_specifier : T_UNSIGNED",
984 1.1 christos "type_specifier : T_VOID",
985 1.1 christos "type_specifier : T_Bool",
986 1.1 christos "type_specifier : T_Complex",
987 1.1 christos "type_specifier : T_Imaginary",
988 1.1 christos "type_specifier : T_TYPEDEF_NAME",
989 1.1 christos "type_specifier : struct_or_union_specifier",
990 1.1 christos "type_specifier : enum_specifier",
991 1.1 christos "type_qualifier : T_TYPE_QUALIFIER",
992 1.1 christos "type_qualifier : T_DEFINE_NAME",
993 1.1 christos "struct_or_union_specifier : struct_or_union any_id braces",
994 1.1 christos "struct_or_union_specifier : struct_or_union braces",
995 1.1 christos "struct_or_union_specifier : struct_or_union any_id",
996 1.1 christos "struct_or_union : T_STRUCT",
997 1.1 christos "struct_or_union : T_UNION",
998 1.1 christos "init_declarator_list : init_declarator",
999 1.1 christos "init_declarator_list : init_declarator_list ',' init_declarator",
1000 1.1 christos "init_declarator : declarator",
1001 1.1 christos "$$5 :",
1002 1.1 christos "init_declarator : declarator '=' $$5 T_INITIALIZER",
1003 1.1 christos "enum_specifier : enumeration any_id braces",
1004 1.1 christos "enum_specifier : enumeration braces",
1005 1.1 christos "enum_specifier : enumeration any_id",
1006 1.1 christos "enumeration : T_ENUM",
1007 1.1 christos "any_id : T_IDENTIFIER",
1008 1.1 christos "any_id : T_TYPEDEF_NAME",
1009 1.1 christos "declarator : pointer direct_declarator",
1010 1.1 christos "declarator : direct_declarator",
1011 1.1 christos "direct_declarator : identifier_or_ref",
1012 1.1 christos "direct_declarator : '(' declarator ')'",
1013 1.1 christos "direct_declarator : direct_declarator T_BRACKETS",
1014 1.1 christos "direct_declarator : direct_declarator '(' parameter_type_list ')'",
1015 1.1 christos "direct_declarator : direct_declarator '(' opt_identifier_list ')'",
1016 1.1 christos "pointer : '*' opt_type_qualifiers",
1017 1.1 christos "pointer : '*' opt_type_qualifiers pointer",
1018 1.1 christos "opt_type_qualifiers :",
1019 1.1 christos "opt_type_qualifiers : type_qualifier_list",
1020 1.1 christos "type_qualifier_list : type_qualifier",
1021 1.1 christos "type_qualifier_list : type_qualifier_list type_qualifier",
1022 1.1 christos "parameter_type_list : parameter_list",
1023 1.1 christos "parameter_type_list : parameter_list ',' T_ELLIPSIS",
1024 1.1 christos "parameter_list : parameter_declaration",
1025 1.1 christos "parameter_list : parameter_list ',' parameter_declaration",
1026 1.1 christos "parameter_declaration : decl_specifiers declarator",
1027 1.1 christos "parameter_declaration : decl_specifiers abs_declarator",
1028 1.1 christos "parameter_declaration : decl_specifiers",
1029 1.1 christos "opt_identifier_list :",
1030 1.1 christos "opt_identifier_list : identifier_list",
1031 1.1 christos "identifier_list : any_id",
1032 1.1 christos "identifier_list : identifier_list ',' any_id",
1033 1.1 christos "identifier_or_ref : any_id",
1034 1.1 christos "identifier_or_ref : '&' any_id",
1035 1.1 christos "abs_declarator : pointer",
1036 1.1 christos "abs_declarator : pointer direct_abs_declarator",
1037 1.1 christos "abs_declarator : direct_abs_declarator",
1038 1.1 christos "direct_abs_declarator : '(' abs_declarator ')'",
1039 1.1 christos "direct_abs_declarator : direct_abs_declarator T_BRACKETS",
1040 1.1 christos "direct_abs_declarator : T_BRACKETS",
1041 1.1 christos "direct_abs_declarator : direct_abs_declarator '(' parameter_type_list ')'",
1042 1.1 christos "direct_abs_declarator : direct_abs_declarator '(' ')'",
1043 1.1 christos "direct_abs_declarator : '(' parameter_type_list ')'",
1044 1.1 christos "direct_abs_declarator : '(' ')'",
1045 1.1 christos
1046 1.1 christos };
1047 1.1 christos #endif
1048 1.1 christos
1049 1.1 christos int yydebug;
1050 1.1 christos int yynerrs;
1051 1.1 christos
1052 1.1 christos int yyerrflag;
1053 1.1 christos int yychar;
1054 1.1 christos YYSTYPE yyval;
1055 1.1 christos YYSTYPE yylval;
1056 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1057 1.1 christos YYLTYPE yyloc; /* position returned by actions */
1058 1.1 christos YYLTYPE yylloc; /* position from the lexer */
1059 1.1 christos #endif
1060 1.1 christos
1061 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1062 1.1 christos #ifndef YYLLOC_DEFAULT
1063 1.1 christos #define YYLLOC_DEFAULT(loc, rhs, n) \
1064 1.1 christos do \
1065 1.1 christos { \
1066 1.1 christos if (n == 0) \
1067 1.1 christos { \
1068 1.1 christos (loc).first_line = ((rhs)[-1]).last_line; \
1069 1.1 christos (loc).first_column = ((rhs)[-1]).last_column; \
1070 1.1 christos (loc).last_line = ((rhs)[-1]).last_line; \
1071 1.1 christos (loc).last_column = ((rhs)[-1]).last_column; \
1072 1.1 christos } \
1073 1.1 christos else \
1074 1.1 christos { \
1075 1.1 christos (loc).first_line = ((rhs)[ 0 ]).first_line; \
1076 1.1 christos (loc).first_column = ((rhs)[ 0 ]).first_column; \
1077 1.1 christos (loc).last_line = ((rhs)[n-1]).last_line; \
1078 1.1 christos (loc).last_column = ((rhs)[n-1]).last_column; \
1079 1.1 christos } \
1080 1.1 christos } while (0)
1081 1.1 christos #endif /* YYLLOC_DEFAULT */
1082 1.1 christos #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1083 1.1 christos #if YYBTYACC
1084 1.1 christos
1085 1.1 christos #ifndef YYLVQUEUEGROWTH
1086 1.1 christos #define YYLVQUEUEGROWTH 32
1087 1.1 christos #endif
1088 1.1 christos #endif /* YYBTYACC */
1089 1.1 christos
1090 1.1 christos /* define the initial stack-sizes */
1091 1.1 christos #ifdef YYSTACKSIZE
1092 1.1 christos #undef YYMAXDEPTH
1093 1.1 christos #define YYMAXDEPTH YYSTACKSIZE
1094 1.1 christos #else
1095 1.1 christos #ifdef YYMAXDEPTH
1096 1.1 christos #define YYSTACKSIZE YYMAXDEPTH
1097 1.1 christos #else
1098 1.1 christos #define YYSTACKSIZE 10000
1099 1.1 christos #define YYMAXDEPTH 10000
1100 1.1 christos #endif
1101 1.1 christos #endif
1102 1.1 christos
1103 1.1 christos #ifndef YYINITSTACKSIZE
1104 1.1 christos #define YYINITSTACKSIZE 200
1105 1.1 christos #endif
1106 1.1 christos
1107 1.1 christos typedef struct {
1108 1.1 christos unsigned stacksize;
1109 1.1 christos short *s_base;
1110 1.1 christos short *s_mark;
1111 1.1 christos short *s_last;
1112 1.1 christos YYSTYPE *l_base;
1113 1.1 christos YYSTYPE *l_mark;
1114 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1115 1.1 christos YYLTYPE *p_base;
1116 1.1 christos YYLTYPE *p_mark;
1117 1.1 christos #endif
1118 1.1 christos } YYSTACKDATA;
1119 1.1 christos #if YYBTYACC
1120 1.1 christos
1121 1.1 christos struct YYParseState_s
1122 1.1 christos {
1123 1.1 christos struct YYParseState_s *save; /* Previously saved parser state */
1124 1.1 christos YYSTACKDATA yystack; /* saved parser stack */
1125 1.1 christos int state; /* saved parser state */
1126 1.1 christos int errflag; /* saved error recovery status */
1127 1.1 christos int lexeme; /* saved index of the conflict lexeme in the lexical queue */
1128 1.1 christos YYINT ctry; /* saved index in yyctable[] for this conflict */
1129 1.1 christos };
1130 1.1 christos typedef struct YYParseState_s YYParseState;
1131 1.1 christos #endif /* YYBTYACC */
1132 1.1 christos /* variables for the parser stack */
1133 1.1 christos static YYSTACKDATA yystack;
1134 1.1 christos #if YYBTYACC
1135 1.1 christos
1136 1.1 christos /* Current parser state */
1137 1.1 christos static YYParseState *yyps = 0;
1138 1.1 christos
1139 1.1 christos /* yypath != NULL: do the full parse, starting at *yypath parser state. */
1140 1.1 christos static YYParseState *yypath = 0;
1141 1.1 christos
1142 1.1 christos /* Base of the lexical value queue */
1143 1.1 christos static YYSTYPE *yylvals = 0;
1144 1.1 christos
1145 1.1 christos /* Current position at lexical value queue */
1146 1.1 christos static YYSTYPE *yylvp = 0;
1147 1.1 christos
1148 1.1 christos /* End position of lexical value queue */
1149 1.1 christos static YYSTYPE *yylve = 0;
1150 1.1 christos
1151 1.1 christos /* The last allocated position at the lexical value queue */
1152 1.1 christos static YYSTYPE *yylvlim = 0;
1153 1.1 christos
1154 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1155 1.1 christos /* Base of the lexical position queue */
1156 1.1 christos static YYLTYPE *yylpsns = 0;
1157 1.1 christos
1158 1.1 christos /* Current position at lexical position queue */
1159 1.1 christos static YYLTYPE *yylpp = 0;
1160 1.1 christos
1161 1.1 christos /* End position of lexical position queue */
1162 1.1 christos static YYLTYPE *yylpe = 0;
1163 1.1 christos
1164 1.1 christos /* The last allocated position at the lexical position queue */
1165 1.1 christos static YYLTYPE *yylplim = 0;
1166 1.1 christos #endif
1167 1.1 christos
1168 1.1 christos /* Current position at lexical token queue */
1169 1.1 christos static short *yylexp = 0;
1170 1.1 christos
1171 1.1 christos static short *yylexemes = 0;
1172 1.1 christos #endif /* YYBTYACC */
1173 1.1 christos #line 1014 "grammar.y"
1174 1.1 christos
1175 1.1 christos /* lex.yy.c */
1176 1.1 christos #define BEGIN yy_start = 1 + 2 *
1177 1.1 christos
1178 1.1 christos #define CPP1 1
1179 1.1 christos #define INIT1 2
1180 1.1 christos #define INIT2 3
1181 1.1 christos #define CURLY 4
1182 1.1 christos #define LEXYACC 5
1183 1.1 christos #define ASM 6
1184 1.1 christos #define CPP_INLINE 7
1185 1.1 christos
1186 1.1 christos extern char *yytext;
1187 1.1 christos extern FILE *yyin, *yyout;
1188 1.1 christos
1189 1.1 christos static int curly; /* number of curly brace nesting levels */
1190 1.1 christos static int ly_count; /* number of occurances of %% */
1191 1.1 christos static int inc_depth; /* include nesting level */
1192 1.1 christos static SymbolTable *included_files; /* files already included */
1193 1.1 christos static int yy_start = 0; /* start state number */
1194 1.1 christos
1195 1.1 christos #define grammar_error(s) yaccError(s)
1196 1.1 christos
1197 1.1 christos static void
1198 1.1 christos yaccError (const char *msg)
1199 1.1 christos {
1200 1.1 christos func_params = NULL;
1201 1.1 christos put_error(); /* tell what line we're on, and what file */
1202 1.1 christos fprintf(stderr, "%s at token '%s'\n", msg, yytext);
1203 1.1 christos }
1204 1.1 christos
1205 1.1 christos /* Initialize the table of type qualifier keywords recognized by the lexical
1206 1.1 christos * analyzer.
1207 1.1 christos */
1208 1.1 christos void
1209 1.1 christos init_parser (void)
1210 1.1 christos {
1211 1.1 christos static const char *keywords[] = {
1212 1.1 christos "const",
1213 1.1 christos "restrict",
1214 1.1 christos "volatile",
1215 1.1 christos "interrupt",
1216 1.1 christos #ifdef vms
1217 1.1 christos "noshare",
1218 1.1 christos "readonly",
1219 1.1 christos #endif
1220 1.1 christos #if defined(MSDOS) || defined(OS2)
1221 1.1 christos "__cdecl",
1222 1.1 christos "__export",
1223 1.1 christos "__far",
1224 1.1 christos "__fastcall",
1225 1.1 christos "__fortran",
1226 1.1 christos "__huge",
1227 1.1 christos "__inline",
1228 1.1 christos "__interrupt",
1229 1.1 christos "__loadds",
1230 1.1 christos "__near",
1231 1.1 christos "__pascal",
1232 1.1 christos "__saveregs",
1233 1.1 christos "__segment",
1234 1.1 christos "__stdcall",
1235 1.1 christos "__syscall",
1236 1.1 christos "_cdecl",
1237 1.1 christos "_cs",
1238 1.1 christos "_ds",
1239 1.1 christos "_es",
1240 1.1 christos "_export",
1241 1.1 christos "_far",
1242 1.1 christos "_fastcall",
1243 1.1 christos "_fortran",
1244 1.1 christos "_huge",
1245 1.1 christos "_interrupt",
1246 1.1 christos "_loadds",
1247 1.1 christos "_near",
1248 1.1 christos "_pascal",
1249 1.1 christos "_saveregs",
1250 1.1 christos "_seg",
1251 1.1 christos "_segment",
1252 1.1 christos "_ss",
1253 1.1 christos "cdecl",
1254 1.1 christos "far",
1255 1.1 christos "huge",
1256 1.1 christos "near",
1257 1.1 christos "pascal",
1258 1.1 christos #ifdef OS2
1259 1.1 christos "__far16",
1260 1.1 christos #endif
1261 1.1 christos #endif
1262 1.1 christos #ifdef __GNUC__
1263 1.1 christos /* gcc aliases */
1264 1.1 christos "__builtin_va_arg",
1265 1.1 christos "__builtin_va_list",
1266 1.1 christos "__const",
1267 1.1 christos "__const__",
1268 1.1 christos "__inline",
1269 1.1 christos "__inline__",
1270 1.1 christos "__restrict",
1271 1.1 christos "__restrict__",
1272 1.1 christos "__volatile",
1273 1.1 christos "__volatile__",
1274 1.1 christos #endif
1275 1.1 christos };
1276 1.1 christos unsigned i;
1277 1.1 christos
1278 1.1 christos /* Initialize type qualifier table. */
1279 1.1 christos type_qualifiers = new_symbol_table();
1280 1.1 christos for (i = 0; i < sizeof(keywords)/sizeof(keywords[0]); ++i) {
1281 1.1 christos new_symbol(type_qualifiers, keywords[i], NULL, DS_NONE);
1282 1.1 christos }
1283 1.1 christos }
1284 1.1 christos
1285 1.1 christos /* Process the C source file. Write function prototypes to the standard
1286 1.1 christos * output. Convert function definitions and write the converted source
1287 1.1 christos * code to a temporary file.
1288 1.1 christos */
1289 1.1 christos void
1290 1.1 christos process_file (FILE *infile, char *name)
1291 1.1 christos {
1292 1.1 christos char *s;
1293 1.1 christos
1294 1.1 christos if (strlen(name) > 2) {
1295 1.1 christos s = name + strlen(name) - 2;
1296 1.1 christos if (*s == '.') {
1297 1.1 christos ++s;
1298 1.1 christos if (*s == 'l' || *s == 'y')
1299 1.1 christos BEGIN LEXYACC;
1300 1.1 christos #if defined(MSDOS) || defined(OS2)
1301 1.1 christos if (*s == 'L' || *s == 'Y')
1302 1.1 christos BEGIN LEXYACC;
1303 1.1 christos #endif
1304 1.1 christos }
1305 1.1 christos }
1306 1.1 christos
1307 1.1 christos included_files = new_symbol_table();
1308 1.1 christos typedef_names = new_symbol_table();
1309 1.1 christos define_names = new_symbol_table();
1310 1.1 christos inc_depth = -1;
1311 1.1 christos curly = 0;
1312 1.1 christos ly_count = 0;
1313 1.1 christos func_params = NULL;
1314 1.1 christos yyin = infile;
1315 1.1 christos include_file(strcpy(base_file, name), func_style != FUNC_NONE);
1316 1.1 christos if (file_comments) {
1317 1.1 christos #if OPT_LINTLIBRARY
1318 1.1 christos if (lintLibrary()) {
1319 1.1 christos put_blankline(stdout);
1320 1.1 christos begin_tracking();
1321 1.1 christos }
1322 1.1 christos #endif
1323 1.1 christos put_string(stdout, "/* ");
1324 1.1 christos put_string(stdout, cur_file_name());
1325 1.1 christos put_string(stdout, " */\n");
1326 1.1 christos }
1327 1.1 christos yyparse();
1328 1.1 christos free_symbol_table(define_names);
1329 1.1 christos free_symbol_table(typedef_names);
1330 1.1 christos free_symbol_table(included_files);
1331 1.1 christos }
1332 1.1 christos
1333 1.1 christos #ifdef NO_LEAKS
1334 1.1 christos void
1335 1.1 christos free_parser(void)
1336 1.1 christos {
1337 1.1 christos free_symbol_table (type_qualifiers);
1338 1.1 christos #ifdef FLEX_SCANNER
1339 1.1 christos if (yy_current_buffer != 0)
1340 1.1 christos yy_delete_buffer(yy_current_buffer);
1341 1.1 christos #endif
1342 1.1 christos }
1343 1.1 christos #endif
1344 1.1 christos #line 1345 "grammar.tab.c"
1345 1.1 christos
1346 1.1 christos /* For use in generated program */
1347 1.1 christos #define yydepth (int)(yystack.s_mark - yystack.s_base)
1348 1.1 christos #if YYBTYACC
1349 1.1 christos #define yytrial (yyps->save)
1350 1.1 christos #endif /* YYBTYACC */
1351 1.1 christos
1352 1.1 christos #if YYDEBUG
1353 1.1 christos #include <stdio.h> /* needed for printf */
1354 1.1 christos #endif
1355 1.1 christos
1356 1.1 christos #include <stdlib.h> /* needed for malloc, etc */
1357 1.1 christos #include <string.h> /* needed for memset */
1358 1.1 christos
1359 1.1 christos /* allocate initial stack or double stack size, up to YYMAXDEPTH */
1360 1.1 christos static int yygrowstack(YYSTACKDATA *data)
1361 1.1 christos {
1362 1.1 christos int i;
1363 1.1 christos unsigned newsize;
1364 1.1 christos short *newss;
1365 1.1 christos YYSTYPE *newvs;
1366 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1367 1.1 christos YYLTYPE *newps;
1368 1.1 christos #endif
1369 1.1 christos
1370 1.1 christos if ((newsize = data->stacksize) == 0)
1371 1.1 christos newsize = YYINITSTACKSIZE;
1372 1.1 christos else if (newsize >= YYMAXDEPTH)
1373 1.1 christos return YYENOMEM;
1374 1.1 christos else if ((newsize *= 2) > YYMAXDEPTH)
1375 1.1 christos newsize = YYMAXDEPTH;
1376 1.1 christos
1377 1.1 christos i = (int) (data->s_mark - data->s_base);
1378 1.1 christos newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
1379 1.1 christos if (newss == 0)
1380 1.1 christos return YYENOMEM;
1381 1.1 christos
1382 1.1 christos data->s_base = newss;
1383 1.1 christos data->s_mark = newss + i;
1384 1.1 christos
1385 1.1 christos newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
1386 1.1 christos if (newvs == 0)
1387 1.1 christos return YYENOMEM;
1388 1.1 christos
1389 1.1 christos data->l_base = newvs;
1390 1.1 christos data->l_mark = newvs + i;
1391 1.1 christos
1392 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1393 1.1 christos newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps));
1394 1.1 christos if (newps == 0)
1395 1.1 christos return YYENOMEM;
1396 1.1 christos
1397 1.1 christos data->p_base = newps;
1398 1.1 christos data->p_mark = newps + i;
1399 1.1 christos #endif
1400 1.1 christos
1401 1.1 christos data->stacksize = newsize;
1402 1.1 christos data->s_last = data->s_base + newsize - 1;
1403 1.1 christos
1404 1.1 christos #if YYDEBUG
1405 1.1 christos if (yydebug)
1406 1.1 christos fprintf(stderr, "%sdebug: stack size increased to %d\n", YYPREFIX, newsize);
1407 1.1 christos #endif
1408 1.1 christos return 0;
1409 1.1 christos }
1410 1.1 christos
1411 1.1 christos #if YYPURE || defined(YY_NO_LEAKS)
1412 1.1 christos static void yyfreestack(YYSTACKDATA *data)
1413 1.1 christos {
1414 1.1 christos free(data->s_base);
1415 1.1 christos free(data->l_base);
1416 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1417 1.1 christos free(data->p_base);
1418 1.1 christos #endif
1419 1.1 christos memset(data, 0, sizeof(*data));
1420 1.1 christos }
1421 1.1 christos #else
1422 1.1 christos #define yyfreestack(data) /* nothing */
1423 1.1 christos #endif /* YYPURE || defined(YY_NO_LEAKS) */
1424 1.1 christos #if YYBTYACC
1425 1.1 christos
1426 1.1 christos static YYParseState *
1427 1.1 christos yyNewState(unsigned size)
1428 1.1 christos {
1429 1.1 christos YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState));
1430 1.1 christos if (p == NULL) return NULL;
1431 1.1 christos
1432 1.1 christos p->yystack.stacksize = size;
1433 1.1 christos if (size == 0)
1434 1.1 christos {
1435 1.1 christos p->yystack.s_base = NULL;
1436 1.1 christos p->yystack.l_base = NULL;
1437 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1438 1.1 christos p->yystack.p_base = NULL;
1439 1.1 christos #endif
1440 1.1 christos return p;
1441 1.1 christos }
1442 1.1 christos p->yystack.s_base = (short *) malloc(size * sizeof(short));
1443 1.1 christos if (p->yystack.s_base == NULL) return NULL;
1444 1.1 christos p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
1445 1.1 christos if (p->yystack.l_base == NULL) return NULL;
1446 1.1 christos memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE));
1447 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1448 1.1 christos p->yystack.p_base = (YYLTYPE *) malloc(size * sizeof(YYLTYPE));
1449 1.1 christos if (p->yystack.p_base == NULL) return NULL;
1450 1.1 christos memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE));
1451 1.1 christos #endif
1452 1.1 christos
1453 1.1 christos return p;
1454 1.1 christos }
1455 1.1 christos
1456 1.1 christos static void
1457 1.1 christos yyFreeState(YYParseState *p)
1458 1.1 christos {
1459 1.1 christos yyfreestack(&p->yystack);
1460 1.1 christos free(p);
1461 1.1 christos }
1462 1.1 christos #endif /* YYBTYACC */
1463 1.1 christos
1464 1.1 christos #define YYABORT goto yyabort
1465 1.1 christos #define YYREJECT goto yyabort
1466 1.1 christos #define YYACCEPT goto yyaccept
1467 1.1 christos #define YYERROR goto yyerrlab
1468 1.1 christos #if YYBTYACC
1469 1.1 christos #define YYVALID do { if (yyps->save) goto yyvalid; } while(0)
1470 1.1 christos #define YYVALID_NESTED do { if (yyps->save && \
1471 1.1 christos yyps->save->save == 0) goto yyvalid; } while(0)
1472 1.1 christos #endif /* YYBTYACC */
1473 1.1 christos
1474 1.1 christos int
1475 1.1 christos YYPARSE_DECL()
1476 1.1 christos {
1477 1.1 christos int yym, yyn, yystate, yyresult;
1478 1.1 christos #if YYBTYACC
1479 1.1 christos int yynewerrflag;
1480 1.1 christos YYParseState *yyerrctx = NULL;
1481 1.1 christos #endif /* YYBTYACC */
1482 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1483 1.1 christos YYLTYPE yyerror_loc_range[2]; /* position of error start & end */
1484 1.1 christos #endif
1485 1.1 christos #if YYDEBUG
1486 1.1 christos const char *yys;
1487 1.1 christos
1488 1.1 christos if ((yys = getenv("YYDEBUG")) != 0)
1489 1.1 christos {
1490 1.1 christos yyn = *yys;
1491 1.1 christos if (yyn >= '0' && yyn <= '9')
1492 1.1 christos yydebug = yyn - '0';
1493 1.1 christos }
1494 1.1 christos if (yydebug)
1495 1.1 christos fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX);
1496 1.1 christos #endif
1497 1.1 christos
1498 1.1 christos #if YYBTYACC
1499 1.1 christos yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
1500 1.1 christos yyps->save = 0;
1501 1.1 christos #endif /* YYBTYACC */
1502 1.1 christos yynerrs = 0;
1503 1.1 christos yyerrflag = 0;
1504 1.1 christos yychar = YYEMPTY;
1505 1.1 christos yystate = 0;
1506 1.1 christos
1507 1.1 christos #if YYPURE
1508 1.1 christos memset(&yystack, 0, sizeof(yystack));
1509 1.1 christos #endif
1510 1.1 christos
1511 1.1 christos if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1512 1.1 christos yystack.s_mark = yystack.s_base;
1513 1.1 christos yystack.l_mark = yystack.l_base;
1514 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1515 1.1 christos yystack.p_mark = yystack.p_base;
1516 1.1 christos #endif
1517 1.1 christos yystate = 0;
1518 1.1 christos *yystack.s_mark = 0;
1519 1.1 christos
1520 1.1 christos yyloop:
1521 1.1 christos if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
1522 1.1 christos if (yychar < 0)
1523 1.1 christos {
1524 1.1 christos #if YYBTYACC
1525 1.1 christos do {
1526 1.1 christos if (yylvp < yylve)
1527 1.1 christos {
1528 1.1 christos /* we're currently re-reading tokens */
1529 1.1 christos yylval = *yylvp++;
1530 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1531 1.1 christos yylloc = *yylpp++;
1532 1.1 christos #endif
1533 1.1 christos yychar = *yylexp++;
1534 1.1 christos break;
1535 1.1 christos }
1536 1.1 christos if (yyps->save)
1537 1.1 christos {
1538 1.1 christos /* in trial mode; save scanner results for future parse attempts */
1539 1.1 christos if (yylvp == yylvlim)
1540 1.1 christos { /* Enlarge lexical value queue */
1541 1.1 christos size_t p = (size_t) (yylvp - yylvals);
1542 1.1 christos size_t s = (size_t) (yylvlim - yylvals);
1543 1.1 christos
1544 1.1 christos s += YYLVQUEUEGROWTH;
1545 1.1 christos if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem;
1546 1.1 christos if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;
1547 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1548 1.1 christos if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;
1549 1.1 christos #endif
1550 1.1 christos yylvp = yylve = yylvals + p;
1551 1.1 christos yylvlim = yylvals + s;
1552 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1553 1.1 christos yylpp = yylpe = yylpsns + p;
1554 1.1 christos yylplim = yylpsns + s;
1555 1.1 christos #endif
1556 1.1 christos yylexp = yylexemes + p;
1557 1.1 christos }
1558 1.1 christos *yylexp = (short) YYLEX;
1559 1.1 christos *yylvp++ = yylval;
1560 1.1 christos yylve++;
1561 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1562 1.1 christos *yylpp++ = yylloc;
1563 1.1 christos yylpe++;
1564 1.1 christos #endif
1565 1.1 christos yychar = *yylexp++;
1566 1.1 christos break;
1567 1.1 christos }
1568 1.1 christos /* normal operation, no conflict encountered */
1569 1.1 christos #endif /* YYBTYACC */
1570 1.1 christos yychar = YYLEX;
1571 1.1 christos #if YYBTYACC
1572 1.1 christos } while (0);
1573 1.1 christos #endif /* YYBTYACC */
1574 1.1 christos if (yychar < 0) yychar = YYEOF;
1575 1.1 christos /* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
1576 1.1 christos #if YYDEBUG
1577 1.1 christos if (yydebug)
1578 1.1 christos {
1579 1.1 christos yys = yyname[YYTRANSLATE(yychar)];
1580 1.1 christos fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
1581 1.1 christos YYDEBUGSTR, yydepth, yystate, yychar, yys);
1582 1.1 christos #ifdef YYSTYPE_TOSTRING
1583 1.1 christos #if YYBTYACC
1584 1.1 christos if (!yytrial)
1585 1.1 christos #endif /* YYBTYACC */
1586 1.1 christos fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval));
1587 1.1 christos #endif
1588 1.1 christos fputc('\n', stderr);
1589 1.1 christos }
1590 1.1 christos #endif
1591 1.1 christos }
1592 1.1 christos #if YYBTYACC
1593 1.1 christos
1594 1.1 christos /* Do we have a conflict? */
1595 1.1 christos if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1596 1.1 christos yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1597 1.1 christos {
1598 1.1 christos YYINT ctry;
1599 1.1 christos
1600 1.1 christos if (yypath)
1601 1.1 christos {
1602 1.1 christos YYParseState *save;
1603 1.1 christos #if YYDEBUG
1604 1.1 christos if (yydebug)
1605 1.1 christos fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n",
1606 1.1 christos YYDEBUGSTR, yydepth, yystate);
1607 1.1 christos #endif
1608 1.1 christos /* Switch to the next conflict context */
1609 1.1 christos save = yypath;
1610 1.1 christos yypath = save->save;
1611 1.1 christos save->save = NULL;
1612 1.1 christos ctry = save->ctry;
1613 1.1 christos if (save->state != yystate) YYABORT;
1614 1.1 christos yyFreeState(save);
1615 1.1 christos
1616 1.1 christos }
1617 1.1 christos else
1618 1.1 christos {
1619 1.1 christos
1620 1.1 christos /* Unresolved conflict - start/continue trial parse */
1621 1.1 christos YYParseState *save;
1622 1.1 christos #if YYDEBUG
1623 1.1 christos if (yydebug)
1624 1.1 christos {
1625 1.1 christos fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate);
1626 1.1 christos if (yyps->save)
1627 1.1 christos fputs("ALREADY in conflict, continuing trial parse.\n", stderr);
1628 1.1 christos else
1629 1.1 christos fputs("Starting trial parse.\n", stderr);
1630 1.1 christos }
1631 1.1 christos #endif
1632 1.1 christos save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
1633 1.1 christos if (save == NULL) goto yyenomem;
1634 1.1 christos save->save = yyps->save;
1635 1.1 christos save->state = yystate;
1636 1.1 christos save->errflag = yyerrflag;
1637 1.1 christos save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
1638 1.1 christos memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
1639 1.1 christos save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
1640 1.1 christos memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1641 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1642 1.1 christos save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base);
1643 1.1 christos memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1644 1.1 christos #endif
1645 1.1 christos ctry = yytable[yyn];
1646 1.1 christos if (yyctable[ctry] == -1)
1647 1.1 christos {
1648 1.1 christos #if YYDEBUG
1649 1.1 christos if (yydebug && yychar >= YYEOF)
1650 1.1 christos fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth);
1651 1.1 christos #endif
1652 1.1 christos ctry++;
1653 1.1 christos }
1654 1.1 christos save->ctry = ctry;
1655 1.1 christos if (yyps->save == NULL)
1656 1.1 christos {
1657 1.1 christos /* If this is a first conflict in the stack, start saving lexemes */
1658 1.1 christos if (!yylexemes)
1659 1.1 christos {
1660 1.1 christos yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short));
1661 1.1 christos if (yylexemes == NULL) goto yyenomem;
1662 1.1 christos yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE));
1663 1.1 christos if (yylvals == NULL) goto yyenomem;
1664 1.1 christos yylvlim = yylvals + YYLVQUEUEGROWTH;
1665 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1666 1.1 christos yylpsns = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE));
1667 1.1 christos if (yylpsns == NULL) goto yyenomem;
1668 1.1 christos yylplim = yylpsns + YYLVQUEUEGROWTH;
1669 1.1 christos #endif
1670 1.1 christos }
1671 1.1 christos if (yylvp == yylve)
1672 1.1 christos {
1673 1.1 christos yylvp = yylve = yylvals;
1674 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1675 1.1 christos yylpp = yylpe = yylpsns;
1676 1.1 christos #endif
1677 1.1 christos yylexp = yylexemes;
1678 1.1 christos if (yychar >= YYEOF)
1679 1.1 christos {
1680 1.1 christos *yylve++ = yylval;
1681 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1682 1.1 christos *yylpe++ = yylloc;
1683 1.1 christos #endif
1684 1.1 christos *yylexp = (short) yychar;
1685 1.1 christos yychar = YYEMPTY;
1686 1.1 christos }
1687 1.1 christos }
1688 1.1 christos }
1689 1.1 christos if (yychar >= YYEOF)
1690 1.1 christos {
1691 1.1 christos yylvp--;
1692 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1693 1.1 christos yylpp--;
1694 1.1 christos #endif
1695 1.1 christos yylexp--;
1696 1.1 christos yychar = YYEMPTY;
1697 1.1 christos }
1698 1.1 christos save->lexeme = (int) (yylvp - yylvals);
1699 1.1 christos yyps->save = save;
1700 1.1 christos }
1701 1.1 christos if (yytable[yyn] == ctry)
1702 1.1 christos {
1703 1.1 christos #if YYDEBUG
1704 1.1 christos if (yydebug)
1705 1.1 christos fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
1706 1.1 christos YYDEBUGSTR, yydepth, yystate, yyctable[ctry]);
1707 1.1 christos #endif
1708 1.1 christos if (yychar < 0)
1709 1.1 christos {
1710 1.1 christos yylvp++;
1711 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1712 1.1 christos yylpp++;
1713 1.1 christos #endif
1714 1.1 christos yylexp++;
1715 1.1 christos }
1716 1.1 christos if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
1717 1.1 christos goto yyoverflow;
1718 1.1 christos yystate = yyctable[ctry];
1719 1.1 christos *++yystack.s_mark = (short) yystate;
1720 1.1 christos *++yystack.l_mark = yylval;
1721 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1722 1.1 christos *++yystack.p_mark = yylloc;
1723 1.1 christos #endif
1724 1.1 christos yychar = YYEMPTY;
1725 1.1 christos if (yyerrflag > 0) --yyerrflag;
1726 1.1 christos goto yyloop;
1727 1.1 christos }
1728 1.1 christos else
1729 1.1 christos {
1730 1.1 christos yyn = yyctable[ctry];
1731 1.1 christos goto yyreduce;
1732 1.1 christos }
1733 1.1 christos } /* End of code dealing with conflicts */
1734 1.1 christos #endif /* YYBTYACC */
1735 1.1 christos if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1736 1.1 christos yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1737 1.1 christos {
1738 1.1 christos #if YYDEBUG
1739 1.1 christos if (yydebug)
1740 1.1 christos fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
1741 1.1 christos YYDEBUGSTR, yydepth, yystate, yytable[yyn]);
1742 1.1 christos #endif
1743 1.1 christos if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1744 1.1 christos yystate = yytable[yyn];
1745 1.1 christos *++yystack.s_mark = yytable[yyn];
1746 1.1 christos *++yystack.l_mark = yylval;
1747 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1748 1.1 christos *++yystack.p_mark = yylloc;
1749 1.1 christos #endif
1750 1.1 christos yychar = YYEMPTY;
1751 1.1 christos if (yyerrflag > 0) --yyerrflag;
1752 1.1 christos goto yyloop;
1753 1.1 christos }
1754 1.1 christos if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1755 1.1 christos yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1756 1.1 christos {
1757 1.1 christos yyn = yytable[yyn];
1758 1.1 christos goto yyreduce;
1759 1.1 christos }
1760 1.1 christos if (yyerrflag != 0) goto yyinrecovery;
1761 1.1 christos #if YYBTYACC
1762 1.1 christos
1763 1.1 christos yynewerrflag = 1;
1764 1.1 christos goto yyerrhandler;
1765 1.1 christos goto yyerrlab;
1766 1.1 christos
1767 1.1 christos yyerrlab:
1768 1.1 christos yynewerrflag = 0;
1769 1.1 christos yyerrhandler:
1770 1.1 christos while (yyps->save)
1771 1.1 christos {
1772 1.1 christos int ctry;
1773 1.1 christos YYParseState *save = yyps->save;
1774 1.1 christos #if YYDEBUG
1775 1.1 christos if (yydebug)
1776 1.1 christos fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n",
1777 1.1 christos YYDEBUGSTR, yydepth, yystate, yyps->save->state,
1778 1.1 christos (int)(yylvp - yylvals - yyps->save->lexeme));
1779 1.1 christos #endif
1780 1.1 christos /* Memorize most forward-looking error state in case it's really an error. */
1781 1.1 christos if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals)
1782 1.1 christos {
1783 1.1 christos /* Free old saved error context state */
1784 1.1 christos if (yyerrctx) yyFreeState(yyerrctx);
1785 1.1 christos /* Create and fill out new saved error context state */
1786 1.1 christos yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
1787 1.1 christos if (yyerrctx == NULL) goto yyenomem;
1788 1.1 christos yyerrctx->save = yyps->save;
1789 1.1 christos yyerrctx->state = yystate;
1790 1.1 christos yyerrctx->errflag = yyerrflag;
1791 1.1 christos yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
1792 1.1 christos memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
1793 1.1 christos yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
1794 1.1 christos memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1795 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1796 1.1 christos yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base);
1797 1.1 christos memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1798 1.1 christos #endif
1799 1.1 christos yyerrctx->lexeme = (int) (yylvp - yylvals);
1800 1.1 christos }
1801 1.1 christos yylvp = yylvals + save->lexeme;
1802 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1803 1.1 christos yylpp = yylpsns + save->lexeme;
1804 1.1 christos #endif
1805 1.1 christos yylexp = yylexemes + save->lexeme;
1806 1.1 christos yychar = YYEMPTY;
1807 1.1 christos yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
1808 1.1 christos memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
1809 1.1 christos yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
1810 1.1 christos memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1811 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1812 1.1 christos yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base);
1813 1.1 christos memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1814 1.1 christos #endif
1815 1.1 christos ctry = ++save->ctry;
1816 1.1 christos yystate = save->state;
1817 1.1 christos /* We tried shift, try reduce now */
1818 1.1 christos if ((yyn = yyctable[ctry]) >= 0) goto yyreduce;
1819 1.1 christos yyps->save = save->save;
1820 1.1 christos save->save = NULL;
1821 1.1 christos yyFreeState(save);
1822 1.1 christos
1823 1.1 christos /* Nothing left on the stack -- error */
1824 1.1 christos if (!yyps->save)
1825 1.1 christos {
1826 1.1 christos #if YYDEBUG
1827 1.1 christos if (yydebug)
1828 1.1 christos fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n",
1829 1.1 christos YYPREFIX, yydepth);
1830 1.1 christos #endif
1831 1.1 christos /* Restore state as it was in the most forward-advanced error */
1832 1.1 christos yylvp = yylvals + yyerrctx->lexeme;
1833 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1834 1.1 christos yylpp = yylpsns + yyerrctx->lexeme;
1835 1.1 christos #endif
1836 1.1 christos yylexp = yylexemes + yyerrctx->lexeme;
1837 1.1 christos yychar = yylexp[-1];
1838 1.1 christos yylval = yylvp[-1];
1839 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1840 1.1 christos yylloc = yylpp[-1];
1841 1.1 christos #endif
1842 1.1 christos yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
1843 1.1 christos memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
1844 1.1 christos yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
1845 1.1 christos memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
1846 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1847 1.1 christos yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base);
1848 1.1 christos memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
1849 1.1 christos #endif
1850 1.1 christos yystate = yyerrctx->state;
1851 1.1 christos yyFreeState(yyerrctx);
1852 1.1 christos yyerrctx = NULL;
1853 1.1 christos }
1854 1.1 christos yynewerrflag = 1;
1855 1.1 christos }
1856 1.1 christos if (yynewerrflag == 0) goto yyinrecovery;
1857 1.1 christos #endif /* YYBTYACC */
1858 1.1 christos
1859 1.1 christos YYERROR_CALL("syntax error");
1860 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1861 1.1 christos yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */
1862 1.1 christos #endif
1863 1.1 christos
1864 1.1 christos #if !YYBTYACC
1865 1.1 christos goto yyerrlab;
1866 1.1 christos yyerrlab:
1867 1.1 christos #endif
1868 1.1 christos ++yynerrs;
1869 1.1 christos
1870 1.1 christos yyinrecovery:
1871 1.1 christos if (yyerrflag < 3)
1872 1.1 christos {
1873 1.1 christos yyerrflag = 3;
1874 1.1 christos for (;;)
1875 1.1 christos {
1876 1.1 christos if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
1877 1.1 christos yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
1878 1.1 christos {
1879 1.1 christos #if YYDEBUG
1880 1.1 christos if (yydebug)
1881 1.1 christos fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n",
1882 1.1 christos YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]);
1883 1.1 christos #endif
1884 1.1 christos if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1885 1.1 christos yystate = yytable[yyn];
1886 1.1 christos *++yystack.s_mark = yytable[yyn];
1887 1.1 christos *++yystack.l_mark = yylval;
1888 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1889 1.1 christos /* lookahead position is error end position */
1890 1.1 christos yyerror_loc_range[1] = yylloc;
1891 1.1 christos YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */
1892 1.1 christos *++yystack.p_mark = yyloc;
1893 1.1 christos #endif
1894 1.1 christos goto yyloop;
1895 1.1 christos }
1896 1.1 christos else
1897 1.1 christos {
1898 1.1 christos #if YYDEBUG
1899 1.1 christos if (yydebug)
1900 1.1 christos fprintf(stderr, "%s[%d]: error recovery discarding state %d\n",
1901 1.1 christos YYDEBUGSTR, yydepth, *yystack.s_mark);
1902 1.1 christos #endif
1903 1.1 christos if (yystack.s_mark <= yystack.s_base) goto yyabort;
1904 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1905 1.1 christos /* the current TOS position is the error start position */
1906 1.1 christos yyerror_loc_range[0] = *yystack.p_mark;
1907 1.1 christos #endif
1908 1.1 christos #if defined(YYDESTRUCT_CALL)
1909 1.1 christos #if YYBTYACC
1910 1.1 christos if (!yytrial)
1911 1.1 christos #endif /* YYBTYACC */
1912 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1913 1.1 christos YYDESTRUCT_CALL("error: discarding state",
1914 1.1 christos yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark);
1915 1.1 christos #else
1916 1.1 christos YYDESTRUCT_CALL("error: discarding state",
1917 1.1 christos yystos[*yystack.s_mark], yystack.l_mark);
1918 1.1 christos #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1919 1.1 christos #endif /* defined(YYDESTRUCT_CALL) */
1920 1.1 christos --yystack.s_mark;
1921 1.1 christos --yystack.l_mark;
1922 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1923 1.1 christos --yystack.p_mark;
1924 1.1 christos #endif
1925 1.1 christos }
1926 1.1 christos }
1927 1.1 christos }
1928 1.1 christos else
1929 1.1 christos {
1930 1.1 christos if (yychar == YYEOF) goto yyabort;
1931 1.1 christos #if YYDEBUG
1932 1.1 christos if (yydebug)
1933 1.1 christos {
1934 1.1 christos yys = yyname[YYTRANSLATE(yychar)];
1935 1.1 christos fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
1936 1.1 christos YYDEBUGSTR, yydepth, yystate, yychar, yys);
1937 1.1 christos }
1938 1.1 christos #endif
1939 1.1 christos #if defined(YYDESTRUCT_CALL)
1940 1.1 christos #if YYBTYACC
1941 1.1 christos if (!yytrial)
1942 1.1 christos #endif /* YYBTYACC */
1943 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1944 1.1 christos YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc);
1945 1.1 christos #else
1946 1.1 christos YYDESTRUCT_CALL("error: discarding token", yychar, &yylval);
1947 1.1 christos #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
1948 1.1 christos #endif /* defined(YYDESTRUCT_CALL) */
1949 1.1 christos yychar = YYEMPTY;
1950 1.1 christos goto yyloop;
1951 1.1 christos }
1952 1.1 christos
1953 1.1 christos yyreduce:
1954 1.1 christos yym = yylen[yyn];
1955 1.1 christos #if YYDEBUG
1956 1.1 christos if (yydebug)
1957 1.1 christos {
1958 1.1 christos fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)",
1959 1.1 christos YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]);
1960 1.1 christos #ifdef YYSTYPE_TOSTRING
1961 1.1 christos #if YYBTYACC
1962 1.1 christos if (!yytrial)
1963 1.1 christos #endif /* YYBTYACC */
1964 1.1 christos if (yym > 0)
1965 1.1 christos {
1966 1.1 christos int i;
1967 1.1 christos fputc('<', stderr);
1968 1.1 christos for (i = yym; i > 0; i--)
1969 1.1 christos {
1970 1.1 christos if (i != yym) fputs(", ", stderr);
1971 1.1 christos fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]],
1972 1.1 christos yystack.l_mark[1-i]), stderr);
1973 1.1 christos }
1974 1.1 christos fputc('>', stderr);
1975 1.1 christos }
1976 1.1 christos #endif
1977 1.1 christos fputc('\n', stderr);
1978 1.1 christos }
1979 1.1 christos #endif
1980 1.1 christos if (yym > 0)
1981 1.1 christos yyval = yystack.l_mark[1-yym];
1982 1.1 christos else
1983 1.1 christos memset(&yyval, 0, sizeof yyval);
1984 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1985 1.1 christos
1986 1.1 christos /* Perform position reduction */
1987 1.1 christos memset(&yyloc, 0, sizeof(yyloc));
1988 1.1 christos #if YYBTYACC
1989 1.1 christos if (!yytrial)
1990 1.1 christos #endif /* YYBTYACC */
1991 1.1 christos {
1992 1.1 christos YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym);
1993 1.1 christos /* just in case YYERROR is invoked within the action, save
1994 1.1 christos the start of the rhs as the error start position */
1995 1.1 christos yyerror_loc_range[0] = yystack.p_mark[1-yym];
1996 1.1 christos }
1997 1.1 christos #endif
1998 1.1 christos
1999 1.1 christos switch (yyn)
2000 1.1 christos {
2001 1.1 christos case 10:
2002 1.1 christos #line 377 "grammar.y"
2003 1.1 christos {
2004 1.1 christos yyerrok;
2005 1.1 christos }
2006 1.1 christos break;
2007 1.1 christos case 11:
2008 1.1 christos #line 381 "grammar.y"
2009 1.1 christos {
2010 1.1 christos yyerrok;
2011 1.1 christos }
2012 1.1 christos break;
2013 1.1 christos case 13:
2014 1.1 christos #line 392 "grammar.y"
2015 1.1 christos {
2016 1.1 christos /* Provide an empty action here so bison will not complain about
2017 1.1 christos * incompatible types in the default action it normally would
2018 1.1 christos * have generated.
2019 1.1 christos */
2020 1.1 christos }
2021 1.1 christos break;
2022 1.1 christos case 14:
2023 1.1 christos #line 399 "grammar.y"
2024 1.1 christos {
2025 1.1 christos /* empty */
2026 1.1 christos }
2027 1.1 christos break;
2028 1.1 christos case 15:
2029 1.1 christos #line 406 "grammar.y"
2030 1.1 christos {
2031 1.1 christos #if OPT_LINTLIBRARY
2032 1.1 christos if (types_out && want_typedef()) {
2033 1.1 christos gen_declarations(&yystack.l_mark[-1].decl_spec, (DeclaratorList *)0);
2034 1.1 christos flush_varargs();
2035 1.1 christos }
2036 1.1 christos #endif
2037 1.1 christos free_decl_spec(&yystack.l_mark[-1].decl_spec);
2038 1.1 christos end_typedef();
2039 1.1 christos }
2040 1.1 christos break;
2041 1.1 christos case 16:
2042 1.1 christos #line 417 "grammar.y"
2043 1.1 christos {
2044 1.1 christos if (func_params != NULL) {
2045 1.1 christos set_param_types(func_params, &yystack.l_mark[-2].decl_spec, &yystack.l_mark[-1].decl_list);
2046 1.1 christos } else {
2047 1.1 christos gen_declarations(&yystack.l_mark[-2].decl_spec, &yystack.l_mark[-1].decl_list);
2048 1.1 christos #if OPT_LINTLIBRARY
2049 1.1 christos flush_varargs();
2050 1.1 christos #endif
2051 1.1 christos free_decl_list(&yystack.l_mark[-1].decl_list);
2052 1.1 christos }
2053 1.1 christos free_decl_spec(&yystack.l_mark[-2].decl_spec);
2054 1.1 christos end_typedef();
2055 1.1 christos }
2056 1.1 christos break;
2057 1.1 christos case 17:
2058 1.1 christos #line 431 "grammar.y"
2059 1.1 christos {
2060 1.1 christos cur_decl_spec_flags = yystack.l_mark[0].decl_spec.flags;
2061 1.1 christos free_decl_spec(&yystack.l_mark[0].decl_spec);
2062 1.1 christos }
2063 1.1 christos break;
2064 1.1 christos case 18:
2065 1.1 christos #line 436 "grammar.y"
2066 1.1 christos {
2067 1.1 christos end_typedef();
2068 1.1 christos }
2069 1.1 christos break;
2070 1.1 christos case 19:
2071 1.1 christos #line 443 "grammar.y"
2072 1.1 christos {
2073 1.1 christos begin_typedef();
2074 1.1 christos }
2075 1.1 christos break;
2076 1.1 christos case 20:
2077 1.1 christos #line 447 "grammar.y"
2078 1.1 christos {
2079 1.1 christos begin_typedef();
2080 1.1 christos }
2081 1.1 christos break;
2082 1.1 christos case 23:
2083 1.1 christos #line 459 "grammar.y"
2084 1.1 christos {
2085 1.1 christos int flags = cur_decl_spec_flags;
2086 1.1 christos
2087 1.1 christos /* If the typedef is a pointer type, then reset the short type
2088 1.1 christos * flags so it does not get promoted.
2089 1.1 christos */
2090 1.1 christos if (strcmp(yystack.l_mark[0].declarator->text, yystack.l_mark[0].declarator->name) != 0)
2091 1.1 christos flags &= ~(DS_CHAR | DS_SHORT | DS_FLOAT);
2092 1.1 christos new_symbol(typedef_names, yystack.l_mark[0].declarator->name, NULL, flags);
2093 1.1 christos free_declarator(yystack.l_mark[0].declarator);
2094 1.1 christos }
2095 1.1 christos break;
2096 1.1 christos case 24:
2097 1.1 christos #line 471 "grammar.y"
2098 1.1 christos {
2099 1.1 christos int flags = cur_decl_spec_flags;
2100 1.1 christos
2101 1.1 christos if (strcmp(yystack.l_mark[0].declarator->text, yystack.l_mark[0].declarator->name) != 0)
2102 1.1 christos flags &= ~(DS_CHAR | DS_SHORT | DS_FLOAT);
2103 1.1 christos new_symbol(typedef_names, yystack.l_mark[0].declarator->name, NULL, flags);
2104 1.1 christos free_declarator(yystack.l_mark[0].declarator);
2105 1.1 christos }
2106 1.1 christos break;
2107 1.1 christos case 25:
2108 1.1 christos #line 483 "grammar.y"
2109 1.1 christos {
2110 1.1 christos check_untagged(&yystack.l_mark[-1].decl_spec);
2111 1.1 christos if (yystack.l_mark[0].declarator->func_def == FUNC_NONE) {
2112 1.1 christos yyerror("syntax error");
2113 1.1 christos YYERROR;
2114 1.1 christos }
2115 1.1 christos func_params = &(yystack.l_mark[0].declarator->head->params);
2116 1.1 christos func_params->begin_comment = cur_file->begin_comment;
2117 1.1 christos func_params->end_comment = cur_file->end_comment;
2118 1.1 christos }
2119 1.1 christos break;
2120 1.1 christos case 26:
2121 1.1 christos #line 494 "grammar.y"
2122 1.1 christos {
2123 1.1 christos /* If we're converting to K&R and we've got a nominally K&R
2124 1.1 christos * function which has a parameter which is ANSI (i.e., a prototyped
2125 1.1 christos * function pointer), then we must override the deciphered value of
2126 1.1 christos * 'func_def' so that the parameter will be converted.
2127 1.1 christos */
2128 1.1 christos if (func_style == FUNC_TRADITIONAL
2129 1.1 christos && haveAnsiParam()
2130 1.1 christos && yystack.l_mark[-3].declarator->head->func_def == func_style) {
2131 1.1 christos yystack.l_mark[-3].declarator->head->func_def = FUNC_BOTH;
2132 1.1 christos }
2133 1.1 christos
2134 1.1 christos func_params = NULL;
2135 1.1 christos
2136 1.1 christos if (cur_file->convert)
2137 1.1 christos gen_func_definition(&yystack.l_mark[-4].decl_spec, yystack.l_mark[-3].declarator);
2138 1.1 christos gen_prototype(&yystack.l_mark[-4].decl_spec, yystack.l_mark[-3].declarator);
2139 1.1 christos #if OPT_LINTLIBRARY
2140 1.1 christos flush_varargs();
2141 1.1 christos #endif
2142 1.1 christos free_decl_spec(&yystack.l_mark[-4].decl_spec);
2143 1.1 christos free_declarator(yystack.l_mark[-3].declarator);
2144 1.1 christos }
2145 1.1 christos break;
2146 1.1 christos case 28:
2147 1.1 christos #line 519 "grammar.y"
2148 1.1 christos {
2149 1.1 christos if (yystack.l_mark[0].declarator->func_def == FUNC_NONE) {
2150 1.1 christos yyerror("syntax error");
2151 1.1 christos YYERROR;
2152 1.1 christos }
2153 1.1 christos func_params = &(yystack.l_mark[0].declarator->head->params);
2154 1.1 christos func_params->begin_comment = cur_file->begin_comment;
2155 1.1 christos func_params->end_comment = cur_file->end_comment;
2156 1.1 christos }
2157 1.1 christos break;
2158 1.1 christos case 29:
2159 1.1 christos #line 529 "grammar.y"
2160 1.1 christos {
2161 1.1 christos DeclSpec decl_spec;
2162 1.1 christos
2163 1.1 christos func_params = NULL;
2164 1.1 christos
2165 1.1 christos new_decl_spec(&decl_spec, dft_decl_spec(), yystack.l_mark[-4].declarator->begin, DS_NONE);
2166 1.1 christos if (cur_file->convert)
2167 1.1 christos gen_func_definition(&decl_spec, yystack.l_mark[-4].declarator);
2168 1.1 christos gen_prototype(&decl_spec, yystack.l_mark[-4].declarator);
2169 1.1 christos #if OPT_LINTLIBRARY
2170 1.1 christos flush_varargs();
2171 1.1 christos #endif
2172 1.1 christos free_decl_spec(&decl_spec);
2173 1.1 christos free_declarator(yystack.l_mark[-4].declarator);
2174 1.1 christos }
2175 1.1 christos break;
2176 1.1 christos case 36:
2177 1.1 christos #line 560 "grammar.y"
2178 1.1 christos {
2179 1.1 christos join_decl_specs(&yyval.decl_spec, &yystack.l_mark[-1].decl_spec, &yystack.l_mark[0].decl_spec);
2180 1.1 christos free(yystack.l_mark[-1].decl_spec.text);
2181 1.1 christos free(yystack.l_mark[0].decl_spec.text);
2182 1.1 christos }
2183 1.1 christos break;
2184 1.1 christos case 40:
2185 1.1 christos #line 575 "grammar.y"
2186 1.1 christos {
2187 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
2188 1.1 christos }
2189 1.1 christos break;
2190 1.1 christos case 41:
2191 1.1 christos #line 579 "grammar.y"
2192 1.1 christos {
2193 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_EXTERN);
2194 1.1 christos }
2195 1.1 christos break;
2196 1.1 christos case 42:
2197 1.1 christos #line 583 "grammar.y"
2198 1.1 christos {
2199 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
2200 1.1 christos }
2201 1.1 christos break;
2202 1.1 christos case 43:
2203 1.1 christos #line 587 "grammar.y"
2204 1.1 christos {
2205 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_STATIC);
2206 1.1 christos }
2207 1.1 christos break;
2208 1.1 christos case 44:
2209 1.1 christos #line 591 "grammar.y"
2210 1.1 christos {
2211 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_INLINE);
2212 1.1 christos }
2213 1.1 christos break;
2214 1.1 christos case 45:
2215 1.1 christos #line 595 "grammar.y"
2216 1.1 christos {
2217 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_JUNK);
2218 1.1 christos }
2219 1.1 christos break;
2220 1.1 christos case 46:
2221 1.1 christos #line 602 "grammar.y"
2222 1.1 christos {
2223 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_CHAR);
2224 1.1 christos }
2225 1.1 christos break;
2226 1.1 christos case 47:
2227 1.1 christos #line 606 "grammar.y"
2228 1.1 christos {
2229 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
2230 1.1 christos }
2231 1.1 christos break;
2232 1.1 christos case 48:
2233 1.1 christos #line 610 "grammar.y"
2234 1.1 christos {
2235 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_FLOAT);
2236 1.1 christos }
2237 1.1 christos break;
2238 1.1 christos case 49:
2239 1.1 christos #line 614 "grammar.y"
2240 1.1 christos {
2241 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
2242 1.1 christos }
2243 1.1 christos break;
2244 1.1 christos case 50:
2245 1.1 christos #line 618 "grammar.y"
2246 1.1 christos {
2247 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
2248 1.1 christos }
2249 1.1 christos break;
2250 1.1 christos case 51:
2251 1.1 christos #line 622 "grammar.y"
2252 1.1 christos {
2253 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_SHORT);
2254 1.1 christos }
2255 1.1 christos break;
2256 1.1 christos case 52:
2257 1.1 christos #line 626 "grammar.y"
2258 1.1 christos {
2259 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
2260 1.1 christos }
2261 1.1 christos break;
2262 1.1 christos case 53:
2263 1.1 christos #line 630 "grammar.y"
2264 1.1 christos {
2265 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
2266 1.1 christos }
2267 1.1 christos break;
2268 1.1 christos case 54:
2269 1.1 christos #line 634 "grammar.y"
2270 1.1 christos {
2271 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
2272 1.1 christos }
2273 1.1 christos break;
2274 1.1 christos case 55:
2275 1.1 christos #line 638 "grammar.y"
2276 1.1 christos {
2277 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_CHAR);
2278 1.1 christos }
2279 1.1 christos break;
2280 1.1 christos case 56:
2281 1.1 christos #line 642 "grammar.y"
2282 1.1 christos {
2283 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
2284 1.1 christos }
2285 1.1 christos break;
2286 1.1 christos case 57:
2287 1.1 christos #line 646 "grammar.y"
2288 1.1 christos {
2289 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
2290 1.1 christos }
2291 1.1 christos break;
2292 1.1 christos case 58:
2293 1.1 christos #line 650 "grammar.y"
2294 1.1 christos {
2295 1.1 christos Symbol *s;
2296 1.1 christos s = find_symbol(typedef_names, yystack.l_mark[0].text.text);
2297 1.1 christos if (s != NULL)
2298 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, s->flags);
2299 1.1 christos }
2300 1.1 christos break;
2301 1.1 christos case 61:
2302 1.1 christos #line 662 "grammar.y"
2303 1.1 christos {
2304 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
2305 1.1 christos }
2306 1.1 christos break;
2307 1.1 christos case 62:
2308 1.1 christos #line 666 "grammar.y"
2309 1.1 christos {
2310 1.1 christos /* This rule allows the <pointer> nonterminal to scan #define
2311 1.1 christos * names as if they were type modifiers.
2312 1.1 christos */
2313 1.1 christos Symbol *s;
2314 1.1 christos s = find_symbol(define_names, yystack.l_mark[0].text.text);
2315 1.1 christos if (s != NULL)
2316 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, s->flags);
2317 1.1 christos }
2318 1.1 christos break;
2319 1.1 christos case 63:
2320 1.1 christos #line 679 "grammar.y"
2321 1.1 christos {
2322 1.1 christos char *s;
2323 1.1 christos if ((s = implied_typedef()) == 0)
2324 1.1 christos (void)sprintf(s = buf, "%s %s", yystack.l_mark[-2].text.text, yystack.l_mark[-1].text.text);
2325 1.1 christos new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-2].text.begin, DS_NONE);
2326 1.1 christos }
2327 1.1 christos break;
2328 1.1 christos case 64:
2329 1.1 christos #line 686 "grammar.y"
2330 1.1 christos {
2331 1.1 christos char *s;
2332 1.1 christos if ((s = implied_typedef()) == 0)
2333 1.1 christos (void)sprintf(s = buf, "%s {}", yystack.l_mark[-1].text.text);
2334 1.1 christos new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-1].text.begin, DS_NONE);
2335 1.1 christos }
2336 1.1 christos break;
2337 1.1 christos case 65:
2338 1.1 christos #line 693 "grammar.y"
2339 1.1 christos {
2340 1.1 christos (void)sprintf(buf, "%s %s", yystack.l_mark[-1].text.text, yystack.l_mark[0].text.text);
2341 1.1 christos new_decl_spec(&yyval.decl_spec, buf, yystack.l_mark[-1].text.begin, DS_NONE);
2342 1.1 christos }
2343 1.1 christos break;
2344 1.1 christos case 66:
2345 1.1 christos #line 701 "grammar.y"
2346 1.1 christos {
2347 1.1 christos imply_typedef(yyval.text.text);
2348 1.1 christos }
2349 1.1 christos break;
2350 1.1 christos case 67:
2351 1.1 christos #line 705 "grammar.y"
2352 1.1 christos {
2353 1.1 christos imply_typedef(yyval.text.text);
2354 1.1 christos }
2355 1.1 christos break;
2356 1.1 christos case 68:
2357 1.1 christos #line 712 "grammar.y"
2358 1.1 christos {
2359 1.1 christos new_decl_list(&yyval.decl_list, yystack.l_mark[0].declarator);
2360 1.1 christos }
2361 1.1 christos break;
2362 1.1 christos case 69:
2363 1.1 christos #line 716 "grammar.y"
2364 1.1 christos {
2365 1.1 christos add_decl_list(&yyval.decl_list, &yystack.l_mark[-2].decl_list, yystack.l_mark[0].declarator);
2366 1.1 christos }
2367 1.1 christos break;
2368 1.1 christos case 70:
2369 1.1 christos #line 723 "grammar.y"
2370 1.1 christos {
2371 1.1 christos if (yystack.l_mark[0].declarator->func_def != FUNC_NONE && func_params == NULL &&
2372 1.1 christos func_style == FUNC_TRADITIONAL && cur_file->convert) {
2373 1.1 christos gen_func_declarator(yystack.l_mark[0].declarator);
2374 1.1 christos fputs(cur_text(), cur_file->tmp_file);
2375 1.1 christos }
2376 1.1 christos cur_declarator = yyval.declarator;
2377 1.1 christos }
2378 1.1 christos break;
2379 1.1 christos case 71:
2380 1.1 christos #line 732 "grammar.y"
2381 1.1 christos {
2382 1.1 christos if (yystack.l_mark[-1].declarator->func_def != FUNC_NONE && func_params == NULL &&
2383 1.1 christos func_style == FUNC_TRADITIONAL && cur_file->convert) {
2384 1.1 christos gen_func_declarator(yystack.l_mark[-1].declarator);
2385 1.1 christos fputs(" =", cur_file->tmp_file);
2386 1.1 christos }
2387 1.1 christos }
2388 1.1 christos break;
2389 1.1 christos case 73:
2390 1.1 christos #line 744 "grammar.y"
2391 1.1 christos {
2392 1.1 christos char *s;
2393 1.1 christos if ((s = implied_typedef()) == 0)
2394 1.1 christos (void)sprintf(s = buf, "enum %s", yystack.l_mark[-1].text.text);
2395 1.1 christos new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-2].text.begin, DS_NONE);
2396 1.1 christos }
2397 1.1 christos break;
2398 1.1 christos case 74:
2399 1.1 christos #line 751 "grammar.y"
2400 1.1 christos {
2401 1.1 christos char *s;
2402 1.1 christos if ((s = implied_typedef()) == 0)
2403 1.1 christos (void)sprintf(s = buf, "%s {}", yystack.l_mark[-1].text.text);
2404 1.1 christos new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-1].text.begin, DS_NONE);
2405 1.1 christos }
2406 1.1 christos break;
2407 1.1 christos case 75:
2408 1.1 christos #line 758 "grammar.y"
2409 1.1 christos {
2410 1.1 christos (void)sprintf(buf, "enum %s", yystack.l_mark[0].text.text);
2411 1.1 christos new_decl_spec(&yyval.decl_spec, buf, yystack.l_mark[-1].text.begin, DS_NONE);
2412 1.1 christos }
2413 1.1 christos break;
2414 1.1 christos case 76:
2415 1.1 christos #line 766 "grammar.y"
2416 1.1 christos {
2417 1.1 christos imply_typedef("enum");
2418 1.1 christos yyval.text = yystack.l_mark[0].text;
2419 1.1 christos }
2420 1.1 christos break;
2421 1.1 christos case 79:
2422 1.1 christos #line 779 "grammar.y"
2423 1.1 christos {
2424 1.1 christos yyval.declarator = yystack.l_mark[0].declarator;
2425 1.1 christos (void)sprintf(buf, "%s%s", yystack.l_mark[-1].text.text, yyval.declarator->text);
2426 1.1 christos free(yyval.declarator->text);
2427 1.1 christos yyval.declarator->text = xstrdup(buf);
2428 1.1 christos yyval.declarator->begin = yystack.l_mark[-1].text.begin;
2429 1.1 christos yyval.declarator->pointer = TRUE;
2430 1.1 christos }
2431 1.1 christos break;
2432 1.1 christos case 81:
2433 1.1 christos #line 792 "grammar.y"
2434 1.1 christos {
2435 1.1 christos yyval.declarator = new_declarator(yystack.l_mark[0].text.text, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin);
2436 1.1 christos }
2437 1.1 christos break;
2438 1.1 christos case 82:
2439 1.1 christos #line 796 "grammar.y"
2440 1.1 christos {
2441 1.1 christos yyval.declarator = yystack.l_mark[-1].declarator;
2442 1.1 christos (void)sprintf(buf, "(%s)", yyval.declarator->text);
2443 1.1 christos free(yyval.declarator->text);
2444 1.1 christos yyval.declarator->text = xstrdup(buf);
2445 1.1 christos yyval.declarator->begin = yystack.l_mark[-2].text.begin;
2446 1.1 christos }
2447 1.1 christos break;
2448 1.1 christos case 83:
2449 1.1 christos #line 804 "grammar.y"
2450 1.1 christos {
2451 1.1 christos yyval.declarator = yystack.l_mark[-1].declarator;
2452 1.1 christos (void)sprintf(buf, "%s%s", yyval.declarator->text, yystack.l_mark[0].text.text);
2453 1.1 christos free(yyval.declarator->text);
2454 1.1 christos yyval.declarator->text = xstrdup(buf);
2455 1.1 christos }
2456 1.1 christos break;
2457 1.1 christos case 84:
2458 1.1 christos #line 811 "grammar.y"
2459 1.1 christos {
2460 1.1 christos yyval.declarator = new_declarator("%s()", yystack.l_mark[-3].declarator->name, yystack.l_mark[-3].declarator->begin);
2461 1.1 christos yyval.declarator->params = yystack.l_mark[-1].param_list;
2462 1.1 christos yyval.declarator->func_stack = yystack.l_mark[-3].declarator;
2463 1.1 christos yyval.declarator->head = (yystack.l_mark[-3].declarator->func_stack == NULL) ? yyval.declarator : yystack.l_mark[-3].declarator->head;
2464 1.1 christos yyval.declarator->func_def = FUNC_ANSI;
2465 1.1 christos }
2466 1.1 christos break;
2467 1.1 christos case 85:
2468 1.1 christos #line 819 "grammar.y"
2469 1.1 christos {
2470 1.1 christos yyval.declarator = new_declarator("%s()", yystack.l_mark[-3].declarator->name, yystack.l_mark[-3].declarator->begin);
2471 1.1 christos yyval.declarator->params = yystack.l_mark[-1].param_list;
2472 1.1 christos yyval.declarator->func_stack = yystack.l_mark[-3].declarator;
2473 1.1 christos yyval.declarator->head = (yystack.l_mark[-3].declarator->func_stack == NULL) ? yyval.declarator : yystack.l_mark[-3].declarator->head;
2474 1.1 christos yyval.declarator->func_def = FUNC_TRADITIONAL;
2475 1.1 christos }
2476 1.1 christos break;
2477 1.1 christos case 86:
2478 1.1 christos #line 830 "grammar.y"
2479 1.1 christos {
2480 1.1 christos (void)sprintf(yyval.text.text, "*%s", yystack.l_mark[0].text.text);
2481 1.1 christos yyval.text.begin = yystack.l_mark[-1].text.begin;
2482 1.1 christos }
2483 1.1 christos break;
2484 1.1 christos case 87:
2485 1.1 christos #line 835 "grammar.y"
2486 1.1 christos {
2487 1.1 christos (void)sprintf(yyval.text.text, "*%s%s", yystack.l_mark[-1].text.text, yystack.l_mark[0].text.text);
2488 1.1 christos yyval.text.begin = yystack.l_mark[-2].text.begin;
2489 1.1 christos }
2490 1.1 christos break;
2491 1.1 christos case 88:
2492 1.1 christos #line 843 "grammar.y"
2493 1.1 christos {
2494 1.1 christos strcpy(yyval.text.text, "");
2495 1.1 christos yyval.text.begin = 0L;
2496 1.1 christos }
2497 1.1 christos break;
2498 1.1 christos case 90:
2499 1.1 christos #line 852 "grammar.y"
2500 1.1 christos {
2501 1.1 christos (void)sprintf(yyval.text.text, "%s ", yystack.l_mark[0].decl_spec.text);
2502 1.1 christos yyval.text.begin = yystack.l_mark[0].decl_spec.begin;
2503 1.1 christos free(yystack.l_mark[0].decl_spec.text);
2504 1.1 christos }
2505 1.1 christos break;
2506 1.1 christos case 91:
2507 1.1 christos #line 858 "grammar.y"
2508 1.1 christos {
2509 1.1 christos (void)sprintf(yyval.text.text, "%s%s ", yystack.l_mark[-1].text.text, yystack.l_mark[0].decl_spec.text);
2510 1.1 christos yyval.text.begin = yystack.l_mark[-1].text.begin;
2511 1.1 christos free(yystack.l_mark[0].decl_spec.text);
2512 1.1 christos }
2513 1.1 christos break;
2514 1.1 christos case 93:
2515 1.1 christos #line 868 "grammar.y"
2516 1.1 christos {
2517 1.1 christos add_ident_list(&yyval.param_list, &yystack.l_mark[-2].param_list, "...");
2518 1.1 christos }
2519 1.1 christos break;
2520 1.1 christos case 94:
2521 1.1 christos #line 875 "grammar.y"
2522 1.1 christos {
2523 1.1 christos new_param_list(&yyval.param_list, yystack.l_mark[0].parameter);
2524 1.1 christos }
2525 1.1 christos break;
2526 1.1 christos case 95:
2527 1.1 christos #line 879 "grammar.y"
2528 1.1 christos {
2529 1.1 christos add_param_list(&yyval.param_list, &yystack.l_mark[-2].param_list, yystack.l_mark[0].parameter);
2530 1.1 christos }
2531 1.1 christos break;
2532 1.1 christos case 96:
2533 1.1 christos #line 886 "grammar.y"
2534 1.1 christos {
2535 1.1 christos check_untagged(&yystack.l_mark[-1].decl_spec);
2536 1.1 christos yyval.parameter = new_parameter(&yystack.l_mark[-1].decl_spec, yystack.l_mark[0].declarator);
2537 1.1 christos }
2538 1.1 christos break;
2539 1.1 christos case 97:
2540 1.1 christos #line 891 "grammar.y"
2541 1.1 christos {
2542 1.1 christos check_untagged(&yystack.l_mark[-1].decl_spec);
2543 1.1 christos yyval.parameter = new_parameter(&yystack.l_mark[-1].decl_spec, yystack.l_mark[0].declarator);
2544 1.1 christos }
2545 1.1 christos break;
2546 1.1 christos case 98:
2547 1.1 christos #line 896 "grammar.y"
2548 1.1 christos {
2549 1.1 christos check_untagged(&yystack.l_mark[0].decl_spec);
2550 1.1 christos yyval.parameter = new_parameter(&yystack.l_mark[0].decl_spec, (Declarator *)0);
2551 1.1 christos }
2552 1.1 christos break;
2553 1.1 christos case 99:
2554 1.1 christos #line 904 "grammar.y"
2555 1.1 christos {
2556 1.1 christos new_ident_list(&yyval.param_list);
2557 1.1 christos }
2558 1.1 christos break;
2559 1.1 christos case 101:
2560 1.1 christos #line 912 "grammar.y"
2561 1.1 christos {
2562 1.1 christos new_ident_list(&yyval.param_list);
2563 1.1 christos add_ident_list(&yyval.param_list, &yyval.param_list, yystack.l_mark[0].text.text);
2564 1.1 christos }
2565 1.1 christos break;
2566 1.1 christos case 102:
2567 1.1 christos #line 917 "grammar.y"
2568 1.1 christos {
2569 1.1 christos add_ident_list(&yyval.param_list, &yystack.l_mark[-2].param_list, yystack.l_mark[0].text.text);
2570 1.1 christos }
2571 1.1 christos break;
2572 1.1 christos case 103:
2573 1.1 christos #line 924 "grammar.y"
2574 1.1 christos {
2575 1.1 christos yyval.text = yystack.l_mark[0].text;
2576 1.1 christos }
2577 1.1 christos break;
2578 1.1 christos case 104:
2579 1.1 christos #line 928 "grammar.y"
2580 1.1 christos {
2581 1.1 christos #if OPT_LINTLIBRARY
2582 1.1 christos if (lintLibrary()) { /* Lint doesn't grok C++ ref variables */
2583 1.1 christos yyval.text = yystack.l_mark[0].text;
2584 1.1 christos } else
2585 1.1 christos #endif
2586 1.1 christos (void)sprintf(yyval.text.text, "&%s", yystack.l_mark[0].text.text);
2587 1.1 christos yyval.text.begin = yystack.l_mark[-1].text.begin;
2588 1.1 christos }
2589 1.1 christos break;
2590 1.1 christos case 105:
2591 1.1 christos #line 941 "grammar.y"
2592 1.1 christos {
2593 1.1 christos yyval.declarator = new_declarator(yystack.l_mark[0].text.text, "", yystack.l_mark[0].text.begin);
2594 1.1 christos }
2595 1.1 christos break;
2596 1.1 christos case 106:
2597 1.1 christos #line 945 "grammar.y"
2598 1.1 christos {
2599 1.1 christos yyval.declarator = yystack.l_mark[0].declarator;
2600 1.1 christos (void)sprintf(buf, "%s%s", yystack.l_mark[-1].text.text, yyval.declarator->text);
2601 1.1 christos free(yyval.declarator->text);
2602 1.1 christos yyval.declarator->text = xstrdup(buf);
2603 1.1 christos yyval.declarator->begin = yystack.l_mark[-1].text.begin;
2604 1.1 christos }
2605 1.1 christos break;
2606 1.1 christos case 108:
2607 1.1 christos #line 957 "grammar.y"
2608 1.1 christos {
2609 1.1 christos yyval.declarator = yystack.l_mark[-1].declarator;
2610 1.1 christos (void)sprintf(buf, "(%s)", yyval.declarator->text);
2611 1.1 christos free(yyval.declarator->text);
2612 1.1 christos yyval.declarator->text = xstrdup(buf);
2613 1.1 christos yyval.declarator->begin = yystack.l_mark[-2].text.begin;
2614 1.1 christos }
2615 1.1 christos break;
2616 1.1 christos case 109:
2617 1.1 christos #line 965 "grammar.y"
2618 1.1 christos {
2619 1.1 christos yyval.declarator = yystack.l_mark[-1].declarator;
2620 1.1 christos (void)sprintf(buf, "%s%s", yyval.declarator->text, yystack.l_mark[0].text.text);
2621 1.1 christos free(yyval.declarator->text);
2622 1.1 christos yyval.declarator->text = xstrdup(buf);
2623 1.1 christos }
2624 1.1 christos break;
2625 1.1 christos case 110:
2626 1.1 christos #line 972 "grammar.y"
2627 1.1 christos {
2628 1.1 christos yyval.declarator = new_declarator(yystack.l_mark[0].text.text, "", yystack.l_mark[0].text.begin);
2629 1.1 christos }
2630 1.1 christos break;
2631 1.1 christos case 111:
2632 1.1 christos #line 976 "grammar.y"
2633 1.1 christos {
2634 1.1 christos yyval.declarator = new_declarator("%s()", "", yystack.l_mark[-3].declarator->begin);
2635 1.1 christos yyval.declarator->params = yystack.l_mark[-1].param_list;
2636 1.1 christos yyval.declarator->func_stack = yystack.l_mark[-3].declarator;
2637 1.1 christos yyval.declarator->head = (yystack.l_mark[-3].declarator->func_stack == NULL) ? yyval.declarator : yystack.l_mark[-3].declarator->head;
2638 1.1 christos yyval.declarator->func_def = FUNC_ANSI;
2639 1.1 christos }
2640 1.1 christos break;
2641 1.1 christos case 112:
2642 1.1 christos #line 984 "grammar.y"
2643 1.1 christos {
2644 1.1 christos yyval.declarator = new_declarator("%s()", "", yystack.l_mark[-2].declarator->begin);
2645 1.1 christos yyval.declarator->func_stack = yystack.l_mark[-2].declarator;
2646 1.1 christos yyval.declarator->head = (yystack.l_mark[-2].declarator->func_stack == NULL) ? yyval.declarator : yystack.l_mark[-2].declarator->head;
2647 1.1 christos yyval.declarator->func_def = FUNC_ANSI;
2648 1.1 christos }
2649 1.1 christos break;
2650 1.1 christos case 113:
2651 1.1 christos #line 991 "grammar.y"
2652 1.1 christos {
2653 1.1 christos Declarator *d;
2654 1.1 christos
2655 1.1 christos d = new_declarator("", "", yystack.l_mark[-2].text.begin);
2656 1.1 christos yyval.declarator = new_declarator("%s()", "", yystack.l_mark[-2].text.begin);
2657 1.1 christos yyval.declarator->params = yystack.l_mark[-1].param_list;
2658 1.1 christos yyval.declarator->func_stack = d;
2659 1.1 christos yyval.declarator->head = yyval.declarator;
2660 1.1 christos yyval.declarator->func_def = FUNC_ANSI;
2661 1.1 christos }
2662 1.1 christos break;
2663 1.1 christos case 114:
2664 1.1 christos #line 1002 "grammar.y"
2665 1.1 christos {
2666 1.1 christos Declarator *d;
2667 1.1 christos
2668 1.1 christos d = new_declarator("", "", yystack.l_mark[-1].text.begin);
2669 1.1 christos yyval.declarator = new_declarator("%s()", "", yystack.l_mark[-1].text.begin);
2670 1.1 christos yyval.declarator->func_stack = d;
2671 1.1 christos yyval.declarator->head = yyval.declarator;
2672 1.1 christos yyval.declarator->func_def = FUNC_ANSI;
2673 1.1 christos }
2674 1.1 christos break;
2675 1.1 christos #line 2676 "grammar.tab.c"
2676 1.1 christos default:
2677 1.1 christos break;
2678 1.1 christos }
2679 1.1 christos yystack.s_mark -= yym;
2680 1.1 christos yystate = *yystack.s_mark;
2681 1.1 christos yystack.l_mark -= yym;
2682 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2683 1.1 christos yystack.p_mark -= yym;
2684 1.1 christos #endif
2685 1.1 christos yym = yylhs[yyn];
2686 1.1 christos if (yystate == 0 && yym == 0)
2687 1.1 christos {
2688 1.1 christos #if YYDEBUG
2689 1.1 christos if (yydebug)
2690 1.1 christos {
2691 1.1 christos fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
2692 1.1 christos #ifdef YYSTYPE_TOSTRING
2693 1.1 christos #if YYBTYACC
2694 1.1 christos if (!yytrial)
2695 1.1 christos #endif /* YYBTYACC */
2696 1.1 christos fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval));
2697 1.1 christos #endif
2698 1.1 christos fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL);
2699 1.1 christos }
2700 1.1 christos #endif
2701 1.1 christos yystate = YYFINAL;
2702 1.1 christos *++yystack.s_mark = YYFINAL;
2703 1.1 christos *++yystack.l_mark = yyval;
2704 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2705 1.1 christos *++yystack.p_mark = yyloc;
2706 1.1 christos #endif
2707 1.1 christos if (yychar < 0)
2708 1.1 christos {
2709 1.1 christos #if YYBTYACC
2710 1.1 christos do {
2711 1.1 christos if (yylvp < yylve)
2712 1.1 christos {
2713 1.1 christos /* we're currently re-reading tokens */
2714 1.1 christos yylval = *yylvp++;
2715 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2716 1.1 christos yylloc = *yylpp++;
2717 1.1 christos #endif
2718 1.1 christos yychar = *yylexp++;
2719 1.1 christos break;
2720 1.1 christos }
2721 1.1 christos if (yyps->save)
2722 1.1 christos {
2723 1.1 christos /* in trial mode; save scanner results for future parse attempts */
2724 1.1 christos if (yylvp == yylvlim)
2725 1.1 christos { /* Enlarge lexical value queue */
2726 1.1 christos size_t p = (size_t) (yylvp - yylvals);
2727 1.1 christos size_t s = (size_t) (yylvlim - yylvals);
2728 1.1 christos
2729 1.1 christos s += YYLVQUEUEGROWTH;
2730 1.1 christos if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL)
2731 1.1 christos goto yyenomem;
2732 1.1 christos if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)
2733 1.1 christos goto yyenomem;
2734 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2735 1.1 christos if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)
2736 1.1 christos goto yyenomem;
2737 1.1 christos #endif
2738 1.1 christos yylvp = yylve = yylvals + p;
2739 1.1 christos yylvlim = yylvals + s;
2740 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2741 1.1 christos yylpp = yylpe = yylpsns + p;
2742 1.1 christos yylplim = yylpsns + s;
2743 1.1 christos #endif
2744 1.1 christos yylexp = yylexemes + p;
2745 1.1 christos }
2746 1.1 christos *yylexp = (short) YYLEX;
2747 1.1 christos *yylvp++ = yylval;
2748 1.1 christos yylve++;
2749 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2750 1.1 christos *yylpp++ = yylloc;
2751 1.1 christos yylpe++;
2752 1.1 christos #endif
2753 1.1 christos yychar = *yylexp++;
2754 1.1 christos break;
2755 1.1 christos }
2756 1.1 christos /* normal operation, no conflict encountered */
2757 1.1 christos #endif /* YYBTYACC */
2758 1.1 christos yychar = YYLEX;
2759 1.1 christos #if YYBTYACC
2760 1.1 christos } while (0);
2761 1.1 christos #endif /* YYBTYACC */
2762 1.1 christos if (yychar < 0) yychar = YYEOF;
2763 1.1 christos /* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
2764 1.1 christos #if YYDEBUG
2765 1.1 christos if (yydebug)
2766 1.1 christos {
2767 1.1 christos yys = yyname[YYTRANSLATE(yychar)];
2768 1.1 christos fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
2769 1.1 christos YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
2770 1.1 christos }
2771 1.1 christos #endif
2772 1.1 christos }
2773 1.1 christos if (yychar == YYEOF) goto yyaccept;
2774 1.1 christos goto yyloop;
2775 1.1 christos }
2776 1.1 christos if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
2777 1.1 christos yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
2778 1.1 christos yystate = yytable[yyn];
2779 1.1 christos else
2780 1.1 christos yystate = yydgoto[yym];
2781 1.1 christos #if YYDEBUG
2782 1.1 christos if (yydebug)
2783 1.1 christos {
2784 1.1 christos fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
2785 1.1 christos #ifdef YYSTYPE_TOSTRING
2786 1.1 christos #if YYBTYACC
2787 1.1 christos if (!yytrial)
2788 1.1 christos #endif /* YYBTYACC */
2789 1.1 christos fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval));
2790 1.1 christos #endif
2791 1.1 christos fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate);
2792 1.1 christos }
2793 1.1 christos #endif
2794 1.1 christos if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
2795 1.1 christos *++yystack.s_mark = (short) yystate;
2796 1.1 christos *++yystack.l_mark = yyval;
2797 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2798 1.1 christos *++yystack.p_mark = yyloc;
2799 1.1 christos #endif
2800 1.1 christos goto yyloop;
2801 1.1 christos #if YYBTYACC
2802 1.1 christos
2803 1.1 christos /* Reduction declares that this path is valid. Set yypath and do a full parse */
2804 1.1 christos yyvalid:
2805 1.1 christos if (yypath) YYABORT;
2806 1.1 christos while (yyps->save)
2807 1.1 christos {
2808 1.1 christos YYParseState *save = yyps->save;
2809 1.1 christos yyps->save = save->save;
2810 1.1 christos save->save = yypath;
2811 1.1 christos yypath = save;
2812 1.1 christos }
2813 1.1 christos #if YYDEBUG
2814 1.1 christos if (yydebug)
2815 1.1 christos fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n",
2816 1.1 christos YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme));
2817 1.1 christos #endif
2818 1.1 christos if (yyerrctx)
2819 1.1 christos {
2820 1.1 christos yyFreeState(yyerrctx);
2821 1.1 christos yyerrctx = NULL;
2822 1.1 christos }
2823 1.1 christos yylvp = yylvals + yypath->lexeme;
2824 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2825 1.1 christos yylpp = yylpsns + yypath->lexeme;
2826 1.1 christos #endif
2827 1.1 christos yylexp = yylexemes + yypath->lexeme;
2828 1.1 christos yychar = YYEMPTY;
2829 1.1 christos yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
2830 1.1 christos memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
2831 1.1 christos yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
2832 1.1 christos memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
2833 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2834 1.1 christos yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base);
2835 1.1 christos memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
2836 1.1 christos #endif
2837 1.1 christos yystate = yypath->state;
2838 1.1 christos goto yyloop;
2839 1.1 christos #endif /* YYBTYACC */
2840 1.1 christos
2841 1.1 christos yyoverflow:
2842 1.1 christos YYERROR_CALL("yacc stack overflow");
2843 1.1 christos #if YYBTYACC
2844 1.1 christos goto yyabort_nomem;
2845 1.1 christos yyenomem:
2846 1.1 christos YYERROR_CALL("memory exhausted");
2847 1.1 christos yyabort_nomem:
2848 1.1 christos #endif /* YYBTYACC */
2849 1.1 christos yyresult = 2;
2850 1.1 christos goto yyreturn;
2851 1.1 christos
2852 1.1 christos yyabort:
2853 1.1 christos yyresult = 1;
2854 1.1 christos goto yyreturn;
2855 1.1 christos
2856 1.1 christos yyaccept:
2857 1.1 christos #if YYBTYACC
2858 1.1 christos if (yyps->save) goto yyvalid;
2859 1.1 christos #endif /* YYBTYACC */
2860 1.1 christos yyresult = 0;
2861 1.1 christos
2862 1.1 christos yyreturn:
2863 1.1 christos #if defined(YYDESTRUCT_CALL)
2864 1.1 christos if (yychar != YYEOF && yychar != YYEMPTY)
2865 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2866 1.1 christos YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc);
2867 1.1 christos #else
2868 1.1 christos YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval);
2869 1.1 christos #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
2870 1.1 christos
2871 1.1 christos {
2872 1.1 christos YYSTYPE *pv;
2873 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
2874 1.1 christos YYLTYPE *pp;
2875 1.1 christos
2876 1.1 christos for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp)
2877 1.1 christos YYDESTRUCT_CALL("cleanup: discarding state",
2878 1.1 christos yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp);
2879 1.1 christos #else
2880 1.1 christos for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv)
2881 1.1 christos YYDESTRUCT_CALL("cleanup: discarding state",
2882 1.1 christos yystos[*(yystack.s_base + (pv - yystack.l_base))], pv);
2883 1.1 christos #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
2884 1.1 christos }
2885 1.1 christos #endif /* defined(YYDESTRUCT_CALL) */
2886 1.1 christos
2887 1.1 christos #if YYBTYACC
2888 1.1 christos if (yyerrctx)
2889 1.1 christos {
2890 1.1 christos yyFreeState(yyerrctx);
2891 1.1 christos yyerrctx = NULL;
2892 1.1 christos }
2893 1.1 christos while (yyps)
2894 1.1 christos {
2895 1.1 christos YYParseState *save = yyps;
2896 1.1 christos yyps = save->save;
2897 1.1 christos save->save = NULL;
2898 1.1 christos yyFreeState(save);
2899 1.1 christos }
2900 1.1 christos while (yypath)
2901 1.1 christos {
2902 1.1 christos YYParseState *save = yypath;
2903 1.1 christos yypath = save->save;
2904 1.1 christos save->save = NULL;
2905 1.1 christos yyFreeState(save);
2906 1.1 christos }
2907 1.1 christos #endif /* YYBTYACC */
2908 1.1 christos yyfreestack(&yystack);
2909 1.1 christos return (yyresult);
2910 1.1 christos }
2911