grammar.tab.c revision 1.1.1.3.2.1 1 1.1.1.3.2.1 pgoyette /* $NetBSD: grammar.tab.c,v 1.1.1.3.2.1 2017/03/20 06:52:18 pgoyette Exp $ */
2 1.1.1.3 christos
3 1.1 christos /* original parser id follows */
4 1.1 christos /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
5 1.1 christos /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
6 1.1 christos
7 1.1 christos #define YYBYACC 1
8 1.1 christos #define YYMAJOR 1
9 1.1 christos #define YYMINOR 9
10 1.1 christos #define YYCHECK "yyyymmdd"
11 1.1 christos
12 1.1 christos #define YYEMPTY (-1)
13 1.1 christos #define yyclearin (yychar = YYEMPTY)
14 1.1 christos #define yyerrok (yyerrflag = 0)
15 1.1 christos #define YYRECOVERING() (yyerrflag != 0)
16 1.1 christos #define YYENOMEM (-2)
17 1.1 christos #define YYEOF 0
18 1.1 christos
19 1.1 christos #ifndef yyparse
20 1.1 christos #define yyparse grammar_parse
21 1.1 christos #endif /* yyparse */
22 1.1 christos
23 1.1 christos #ifndef yylex
24 1.1 christos #define yylex grammar_lex
25 1.1 christos #endif /* yylex */
26 1.1 christos
27 1.1 christos #ifndef yyerror
28 1.1 christos #define yyerror grammar_error
29 1.1 christos #endif /* yyerror */
30 1.1 christos
31 1.1 christos #ifndef yychar
32 1.1 christos #define yychar grammar_char
33 1.1 christos #endif /* yychar */
34 1.1 christos
35 1.1 christos #ifndef yyval
36 1.1 christos #define yyval grammar_val
37 1.1 christos #endif /* yyval */
38 1.1 christos
39 1.1 christos #ifndef yylval
40 1.1 christos #define yylval grammar_lval
41 1.1 christos #endif /* yylval */
42 1.1 christos
43 1.1 christos #ifndef yydebug
44 1.1 christos #define yydebug grammar_debug
45 1.1 christos #endif /* yydebug */
46 1.1 christos
47 1.1 christos #ifndef yynerrs
48 1.1 christos #define yynerrs grammar_nerrs
49 1.1 christos #endif /* yynerrs */
50 1.1 christos
51 1.1 christos #ifndef yyerrflag
52 1.1 christos #define yyerrflag grammar_errflag
53 1.1 christos #endif /* yyerrflag */
54 1.1 christos
55 1.1 christos #ifndef yylhs
56 1.1 christos #define yylhs grammar_lhs
57 1.1 christos #endif /* yylhs */
58 1.1 christos
59 1.1 christos #ifndef yylen
60 1.1 christos #define yylen grammar_len
61 1.1 christos #endif /* yylen */
62 1.1 christos
63 1.1 christos #ifndef yydefred
64 1.1 christos #define yydefred grammar_defred
65 1.1 christos #endif /* yydefred */
66 1.1 christos
67 1.1 christos #ifndef yydgoto
68 1.1 christos #define yydgoto grammar_dgoto
69 1.1 christos #endif /* yydgoto */
70 1.1 christos
71 1.1 christos #ifndef yysindex
72 1.1 christos #define yysindex grammar_sindex
73 1.1 christos #endif /* yysindex */
74 1.1 christos
75 1.1 christos #ifndef yyrindex
76 1.1 christos #define yyrindex grammar_rindex
77 1.1 christos #endif /* yyrindex */
78 1.1 christos
79 1.1 christos #ifndef yygindex
80 1.1 christos #define yygindex grammar_gindex
81 1.1 christos #endif /* yygindex */
82 1.1 christos
83 1.1 christos #ifndef yytable
84 1.1 christos #define yytable grammar_table
85 1.1 christos #endif /* yytable */
86 1.1 christos
87 1.1 christos #ifndef yycheck
88 1.1 christos #define yycheck grammar_check
89 1.1 christos #endif /* yycheck */
90 1.1 christos
91 1.1 christos #ifndef yyname
92 1.1 christos #define yyname grammar_name
93 1.1 christos #endif /* yyname */
94 1.1 christos
95 1.1 christos #ifndef yyrule
96 1.1 christos #define yyrule grammar_rule
97 1.1 christos #endif /* yyrule */
98 1.1 christos #define YYPREFIX "grammar_"
99 1.1 christos
100 1.1 christos #define YYPURE 0
101 1.1 christos
102 1.1 christos #line 9 "grammar.y"
103 1.1 christos #ifdef YYBISON
104 1.1 christos #include <stdlib.h>
105 1.1 christos #define YYSTYPE_IS_DECLARED
106 1.1 christos #define yyerror yaccError
107 1.1 christos #endif
108 1.1 christos
109 1.1 christos #if defined(YYBISON) || !defined(YYBYACC)
110 1.1 christos static void yyerror(const char *s);
111 1.1 christos #endif
112 1.1 christos #line 81 "grammar.y"
113 1.1 christos #include <stdio.h>
114 1.1 christos #include <ctype.h>
115 1.1 christos #include <string.h>
116 1.1 christos
117 1.1 christos #define OPT_LINTLIBRARY 1
118 1.1 christos
119 1.1 christos #ifndef TRUE
120 1.1 christos #define TRUE (1)
121 1.1 christos #endif
122 1.1 christos
123 1.1 christos #ifndef FALSE
124 1.1 christos #define FALSE (0)
125 1.1 christos #endif
126 1.1 christos
127 1.1 christos /* #include "cproto.h" */
128 1.1 christos #define MAX_TEXT_SIZE 1024
129 1.1 christos
130 1.1 christos /* Prototype styles */
131 1.1 christos #if OPT_LINTLIBRARY
132 1.1 christos #define PROTO_ANSI_LLIB -2 /* form ANSI lint-library source */
133 1.1 christos #define PROTO_LINTLIBRARY -1 /* form lint-library source */
134 1.1 christos #endif
135 1.1 christos #define PROTO_NONE 0 /* do not output any prototypes */
136 1.1 christos #define PROTO_TRADITIONAL 1 /* comment out parameters */
137 1.1 christos #define PROTO_ABSTRACT 2 /* comment out parameter names */
138 1.1 christos #define PROTO_ANSI 3 /* ANSI C prototype */
139 1.1 christos
140 1.1 christos typedef int PrototypeStyle;
141 1.1 christos
142 1.1 christos typedef char boolean;
143 1.1 christos
144 1.1 christos extern boolean types_out;
145 1.1 christos extern PrototypeStyle proto_style;
146 1.1 christos
147 1.1 christos #define ansiLintLibrary() (proto_style == PROTO_ANSI_LLIB)
148 1.1 christos #define knrLintLibrary() (proto_style == PROTO_LINTLIBRARY)
149 1.1 christos #define lintLibrary() (knrLintLibrary() || ansiLintLibrary())
150 1.1 christos
151 1.1 christos #if OPT_LINTLIBRARY
152 1.1 christos #define FUNC_UNKNOWN -1 /* unspecified */
153 1.1 christos #else
154 1.1 christos #define FUNC_UNKNOWN 0 /* unspecified (same as FUNC_NONE) */
155 1.1 christos #endif
156 1.1 christos #define FUNC_NONE 0 /* not a function definition */
157 1.1 christos #define FUNC_TRADITIONAL 1 /* traditional style */
158 1.1 christos #define FUNC_ANSI 2 /* ANSI style */
159 1.1 christos #define FUNC_BOTH 3 /* both styles */
160 1.1 christos
161 1.1 christos typedef int FuncDefStyle;
162 1.1 christos
163 1.1 christos /* Source file text */
164 1.1 christos typedef struct text {
165 1.1 christos char text[MAX_TEXT_SIZE]; /* source text */
166 1.1 christos long begin; /* offset in temporary file */
167 1.1 christos } Text;
168 1.1 christos
169 1.1 christos /* Declaration specifier flags */
170 1.1 christos #define DS_NONE 0 /* default */
171 1.1 christos #define DS_EXTERN 1 /* contains "extern" specifier */
172 1.1 christos #define DS_STATIC 2 /* contains "static" specifier */
173 1.1 christos #define DS_CHAR 4 /* contains "char" type specifier */
174 1.1 christos #define DS_SHORT 8 /* contains "short" type specifier */
175 1.1 christos #define DS_FLOAT 16 /* contains "float" type specifier */
176 1.1 christos #define DS_INLINE 32 /* contains "inline" specifier */
177 1.1 christos #define DS_JUNK 64 /* we're not interested in this declaration */
178 1.1 christos
179 1.1 christos /* This structure stores information about a declaration specifier. */
180 1.1 christos typedef struct decl_spec {
181 1.1 christos unsigned short flags; /* flags defined above */
182 1.1 christos char *text; /* source text */
183 1.1 christos long begin; /* offset in temporary file */
184 1.1 christos } DeclSpec;
185 1.1 christos
186 1.1 christos /* This is a list of function parameters. */
187 1.1 christos typedef struct _ParameterList {
188 1.1 christos struct parameter *first; /* pointer to first parameter in list */
189 1.1 christos struct parameter *last; /* pointer to last parameter in list */
190 1.1 christos long begin_comment; /* begin offset of comment */
191 1.1 christos long end_comment; /* end offset of comment */
192 1.1 christos char *comment; /* comment at start of parameter list */
193 1.1 christos } ParameterList;
194 1.1 christos
195 1.1 christos /* This structure stores information about a declarator. */
196 1.1 christos typedef struct _Declarator {
197 1.1 christos char *name; /* name of variable or function */
198 1.1 christos char *text; /* source text */
199 1.1 christos long begin; /* offset in temporary file */
200 1.1 christos long begin_comment; /* begin offset of comment */
201 1.1 christos long end_comment; /* end offset of comment */
202 1.1 christos FuncDefStyle func_def; /* style of function definition */
203 1.1 christos ParameterList params; /* function parameters */
204 1.1 christos boolean pointer; /* TRUE if it declares a pointer */
205 1.1 christos struct _Declarator *head; /* head function declarator */
206 1.1 christos struct _Declarator *func_stack; /* stack of function declarators */
207 1.1 christos struct _Declarator *next; /* next declarator in list */
208 1.1 christos } Declarator;
209 1.1 christos
210 1.1 christos /* This structure stores information about a function parameter. */
211 1.1 christos typedef struct parameter {
212 1.1 christos struct parameter *next; /* next parameter in list */
213 1.1 christos DeclSpec decl_spec;
214 1.1 christos Declarator *declarator;
215 1.1 christos char *comment; /* comment following the parameter */
216 1.1 christos } Parameter;
217 1.1 christos
218 1.1 christos /* This is a list of declarators. */
219 1.1 christos typedef struct declarator_list {
220 1.1 christos Declarator *first; /* pointer to first declarator in list */
221 1.1 christos Declarator *last; /* pointer to last declarator in list */
222 1.1 christos } DeclaratorList;
223 1.1 christos
224 1.1 christos /* #include "symbol.h" */
225 1.1 christos typedef struct symbol {
226 1.1 christos struct symbol *next; /* next symbol in list */
227 1.1 christos char *name; /* name of symbol */
228 1.1 christos char *value; /* value of symbol (for defines) */
229 1.1 christos short flags; /* symbol attributes */
230 1.1 christos } Symbol;
231 1.1 christos
232 1.1 christos /* parser stack entry type */
233 1.1 christos typedef union {
234 1.1 christos Text text;
235 1.1 christos DeclSpec decl_spec;
236 1.1 christos Parameter *parameter;
237 1.1 christos ParameterList param_list;
238 1.1 christos Declarator *declarator;
239 1.1 christos DeclaratorList decl_list;
240 1.1 christos } YYSTYPE;
241 1.1 christos
242 1.1 christos /* The hash table length should be a prime number. */
243 1.1 christos #define SYM_MAX_HASH 251
244 1.1 christos
245 1.1 christos typedef struct symbol_table {
246 1.1 christos Symbol *bucket[SYM_MAX_HASH]; /* hash buckets */
247 1.1 christos } SymbolTable;
248 1.1 christos
249 1.1 christos extern SymbolTable *new_symbol_table /* Create symbol table */
250 1.1 christos (void);
251 1.1 christos extern void free_symbol_table /* Destroy symbol table */
252 1.1 christos (SymbolTable *s);
253 1.1 christos extern Symbol *find_symbol /* Lookup symbol name */
254 1.1 christos (SymbolTable *s, const char *n);
255 1.1 christos extern Symbol *new_symbol /* Define new symbol */
256 1.1 christos (SymbolTable *s, const char *n, const char *v, int f);
257 1.1 christos
258 1.1 christos /* #include "semantic.h" */
259 1.1 christos extern void new_decl_spec (DeclSpec *, const char *, long, int);
260 1.1 christos extern void free_decl_spec (DeclSpec *);
261 1.1 christos extern void join_decl_specs (DeclSpec *, DeclSpec *, DeclSpec *);
262 1.1 christos extern void check_untagged (DeclSpec *);
263 1.1 christos extern Declarator *new_declarator (const char *, const char *, long);
264 1.1 christos extern void free_declarator (Declarator *);
265 1.1 christos extern void new_decl_list (DeclaratorList *, Declarator *);
266 1.1 christos extern void free_decl_list (DeclaratorList *);
267 1.1 christos extern void add_decl_list (DeclaratorList *, DeclaratorList *, Declarator *);
268 1.1 christos extern Parameter *new_parameter (DeclSpec *, Declarator *);
269 1.1 christos extern void free_parameter (Parameter *);
270 1.1 christos extern void new_param_list (ParameterList *, Parameter *);
271 1.1 christos extern void free_param_list (ParameterList *);
272 1.1 christos extern void add_param_list (ParameterList *, ParameterList *, Parameter *);
273 1.1 christos extern void new_ident_list (ParameterList *);
274 1.1 christos extern void add_ident_list (ParameterList *, ParameterList *, const char *);
275 1.1 christos extern void set_param_types (ParameterList *, DeclSpec *, DeclaratorList *);
276 1.1 christos extern void gen_declarations (DeclSpec *, DeclaratorList *);
277 1.1 christos extern void gen_prototype (DeclSpec *, Declarator *);
278 1.1 christos extern void gen_func_declarator (Declarator *);
279 1.1 christos extern void gen_func_definition (DeclSpec *, Declarator *);
280 1.1 christos
281 1.1 christos extern void init_parser (void);
282 1.1 christos extern void process_file (FILE *infile, char *name);
283 1.1 christos extern char *cur_text (void);
284 1.1 christos extern char *cur_file_name (void);
285 1.1 christos extern char *implied_typedef (void);
286 1.1 christos extern void include_file (char *name, int convert);
287 1.1 christos extern char *supply_parm (int count);
288 1.1 christos extern char *xstrdup (const char *);
289 1.1 christos extern int already_declared (char *name);
290 1.1 christos extern int is_actual_func (Declarator *d);
291 1.1 christos extern int lint_ellipsis (Parameter *p);
292 1.1 christos extern int want_typedef (void);
293 1.1 christos extern void begin_tracking (void);
294 1.1 christos extern void begin_typedef (void);
295 1.1 christos extern void copy_typedef (char *s);
296 1.1 christos extern void ellipsis_varargs (Declarator *d);
297 1.1 christos extern void end_typedef (void);
298 1.1 christos extern void flush_varargs (void);
299 1.1 christos extern void fmt_library (int code);
300 1.1 christos extern void imply_typedef (const char *s);
301 1.1 christos extern void indent (FILE *outf);
302 1.1 christos extern void put_blankline (FILE *outf);
303 1.1 christos extern void put_body (FILE *outf, DeclSpec *decl_spec, Declarator *declarator);
304 1.1 christos extern void put_char (FILE *outf, int c);
305 1.1 christos extern void put_error (void);
306 1.1 christos extern void put_newline (FILE *outf);
307 1.1 christos extern void put_padded (FILE *outf, const char *s);
308 1.1 christos extern void put_string (FILE *outf, const char *s);
309 1.1 christos extern void track_in (void);
310 1.1 christos
311 1.1 christos extern boolean file_comments;
312 1.1 christos extern FuncDefStyle func_style;
313 1.1 christos extern char base_file[];
314 1.1 christos
315 1.1 christos extern int yylex (void);
316 1.1 christos
317 1.1 christos /* declaration specifier attributes for the typedef statement currently being
318 1.1 christos * scanned
319 1.1 christos */
320 1.1 christos static int cur_decl_spec_flags;
321 1.1 christos
322 1.1 christos /* pointer to parameter list for the current function definition */
323 1.1 christos static ParameterList *func_params;
324 1.1 christos
325 1.1 christos /* A parser semantic action sets this pointer to the current declarator in
326 1.1 christos * a function parameter declaration in order to catch any comments following
327 1.1 christos * the parameter declaration on the same line. If the lexer scans a comment
328 1.1 christos * and <cur_declarator> is not NULL, then the comment is attached to the
329 1.1 christos * declarator. To ignore subsequent comments, the lexer sets this to NULL
330 1.1 christos * after scanning a comment or end of line.
331 1.1 christos */
332 1.1 christos static Declarator *cur_declarator;
333 1.1 christos
334 1.1 christos /* temporary string buffer */
335 1.1 christos static char buf[MAX_TEXT_SIZE];
336 1.1 christos
337 1.1 christos /* table of typedef names */
338 1.1 christos static SymbolTable *typedef_names;
339 1.1 christos
340 1.1 christos /* table of define names */
341 1.1 christos static SymbolTable *define_names;
342 1.1 christos
343 1.1 christos /* table of type qualifiers */
344 1.1 christos static SymbolTable *type_qualifiers;
345 1.1 christos
346 1.1 christos /* information about the current input file */
347 1.1 christos typedef struct {
348 1.1 christos char *base_name; /* base input file name */
349 1.1 christos char *file_name; /* current file name */
350 1.1 christos FILE *file; /* input file */
351 1.1 christos unsigned line_num; /* current line number in input file */
352 1.1 christos FILE *tmp_file; /* temporary file */
353 1.1 christos long begin_comment; /* tmp file offset after last written ) or ; */
354 1.1 christos long end_comment; /* tmp file offset after last comment */
355 1.1 christos boolean convert; /* if TRUE, convert function definitions */
356 1.1 christos boolean changed; /* TRUE if conversion done in this file */
357 1.1 christos } IncludeStack;
358 1.1 christos
359 1.1 christos static IncludeStack *cur_file; /* current input file */
360 1.1 christos
361 1.1 christos /* #include "yyerror.c" */
362 1.1 christos
363 1.1 christos static int haveAnsiParam (void);
364 1.1 christos
365 1.1 christos
366 1.1 christos /* Flags to enable us to find if a procedure returns a value.
367 1.1 christos */
368 1.1 christos static int return_val; /* nonzero on BRACES iff return-expression found */
369 1.1 christos
370 1.1 christos static const char *
371 1.1 christos dft_decl_spec (void)
372 1.1 christos {
373 1.1 christos return (lintLibrary() && !return_val) ? "void" : "int";
374 1.1 christos }
375 1.1 christos
376 1.1 christos static int
377 1.1 christos haveAnsiParam (void)
378 1.1 christos {
379 1.1 christos Parameter *p;
380 1.1 christos if (func_params != 0) {
381 1.1 christos for (p = func_params->first; p != 0; p = p->next) {
382 1.1 christos if (p->declarator->func_def == FUNC_ANSI) {
383 1.1 christos return TRUE;
384 1.1 christos }
385 1.1 christos }
386 1.1 christos }
387 1.1 christos return FALSE;
388 1.1 christos }
389 1.1 christos #line 388 "grammar.tab.c"
390 1.1 christos
391 1.1 christos /* compatibility with bison */
392 1.1 christos #ifdef YYPARSE_PARAM
393 1.1 christos /* compatibility with FreeBSD */
394 1.1 christos # ifdef YYPARSE_PARAM_TYPE
395 1.1 christos # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
396 1.1 christos # else
397 1.1 christos # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
398 1.1 christos # endif
399 1.1 christos #else
400 1.1 christos # define YYPARSE_DECL() yyparse(void)
401 1.1 christos #endif
402 1.1 christos
403 1.1 christos /* Parameters sent to lex. */
404 1.1 christos #ifdef YYLEX_PARAM
405 1.1 christos # define YYLEX_DECL() yylex(void *YYLEX_PARAM)
406 1.1 christos # define YYLEX yylex(YYLEX_PARAM)
407 1.1 christos #else
408 1.1 christos # define YYLEX_DECL() yylex(void)
409 1.1 christos # define YYLEX yylex()
410 1.1 christos #endif
411 1.1 christos
412 1.1 christos /* Parameters sent to yyerror. */
413 1.1 christos #ifndef YYERROR_DECL
414 1.1 christos #define YYERROR_DECL() yyerror(const char *s)
415 1.1 christos #endif
416 1.1 christos #ifndef YYERROR_CALL
417 1.1 christos #define YYERROR_CALL(msg) yyerror(msg)
418 1.1 christos #endif
419 1.1 christos
420 1.1 christos extern int YYPARSE_DECL();
421 1.1 christos
422 1.1 christos #define T_IDENTIFIER 257
423 1.1 christos #define T_TYPEDEF_NAME 258
424 1.1 christos #define T_DEFINE_NAME 259
425 1.1 christos #define T_AUTO 260
426 1.1 christos #define T_EXTERN 261
427 1.1 christos #define T_REGISTER 262
428 1.1 christos #define T_STATIC 263
429 1.1 christos #define T_TYPEDEF 264
430 1.1 christos #define T_INLINE 265
431 1.1 christos #define T_EXTENSION 266
432 1.1 christos #define T_CHAR 267
433 1.1 christos #define T_DOUBLE 268
434 1.1 christos #define T_FLOAT 269
435 1.1 christos #define T_INT 270
436 1.1 christos #define T_VOID 271
437 1.1 christos #define T_LONG 272
438 1.1 christos #define T_SHORT 273
439 1.1 christos #define T_SIGNED 274
440 1.1 christos #define T_UNSIGNED 275
441 1.1 christos #define T_ENUM 276
442 1.1 christos #define T_STRUCT 277
443 1.1 christos #define T_UNION 278
444 1.1 christos #define T_Bool 279
445 1.1 christos #define T_Complex 280
446 1.1 christos #define T_Imaginary 281
447 1.1 christos #define T_TYPE_QUALIFIER 282
448 1.1 christos #define T_BRACKETS 283
449 1.1 christos #define T_LBRACE 284
450 1.1 christos #define T_MATCHRBRACE 285
451 1.1 christos #define T_ELLIPSIS 286
452 1.1 christos #define T_INITIALIZER 287
453 1.1 christos #define T_STRING_LITERAL 288
454 1.1 christos #define T_ASM 289
455 1.1 christos #define T_ASMARG 290
456 1.1 christos #define T_VA_DCL 291
457 1.1 christos #define YYERRCODE 256
458 1.1 christos typedef short YYINT;
459 1.1 christos static const YYINT grammar_lhs[] = { -1,
460 1.1 christos 0, 0, 26, 26, 27, 27, 27, 27, 27, 27,
461 1.1 christos 27, 31, 30, 30, 28, 28, 34, 28, 32, 32,
462 1.1 christos 33, 33, 35, 35, 37, 38, 29, 39, 29, 36,
463 1.1 christos 36, 36, 40, 40, 1, 1, 2, 2, 2, 3,
464 1.1 christos 3, 3, 3, 3, 3, 4, 4, 4, 4, 4,
465 1.1 christos 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
466 1.1 christos 5, 5, 6, 6, 6, 19, 19, 8, 8, 9,
467 1.1 christos 41, 9, 7, 7, 7, 25, 23, 23, 10, 10,
468 1.1 christos 11, 11, 11, 11, 11, 20, 20, 21, 21, 22,
469 1.1 christos 22, 14, 14, 15, 15, 16, 16, 16, 17, 17,
470 1.1 christos 18, 18, 24, 24, 12, 12, 12, 13, 13, 13,
471 1.1 christos 13, 13, 13, 13,
472 1.1 christos };
473 1.1 christos static const YYINT grammar_len[] = { 2,
474 1.1 christos 0, 1, 1, 2, 1, 1, 1, 1, 3, 2,
475 1.1 christos 2, 2, 3, 3, 2, 3, 0, 5, 2, 1,
476 1.1 christos 0, 1, 1, 3, 0, 0, 7, 0, 5, 0,
477 1.1 christos 1, 1, 1, 2, 1, 2, 1, 1, 1, 1,
478 1.1 christos 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
479 1.1 christos 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
480 1.1 christos 1, 1, 3, 2, 2, 1, 1, 1, 3, 1,
481 1.1 christos 0, 4, 3, 2, 2, 1, 1, 1, 2, 1,
482 1.1 christos 1, 3, 2, 4, 4, 2, 3, 0, 1, 1,
483 1.1 christos 2, 1, 3, 1, 3, 2, 2, 1, 0, 1,
484 1.1 christos 1, 3, 1, 2, 1, 2, 1, 3, 2, 1,
485 1.1 christos 4, 3, 3, 2,
486 1.1 christos };
487 1.1 christos static const YYINT grammar_defred[] = { 0,
488 1.1 christos 0, 0, 0, 0, 77, 0, 62, 40, 0, 42,
489 1.1 christos 43, 20, 44, 0, 46, 47, 48, 49, 54, 50,
490 1.1 christos 51, 52, 53, 76, 66, 67, 55, 56, 57, 61,
491 1.1 christos 0, 7, 0, 0, 35, 37, 38, 39, 59, 60,
492 1.1 christos 28, 0, 0, 0, 103, 81, 0, 0, 3, 5,
493 1.1 christos 6, 8, 0, 10, 11, 78, 0, 90, 0, 0,
494 1.1 christos 104, 0, 19, 0, 41, 45, 15, 36, 0, 68,
495 1.1 christos 0, 0, 0, 83, 0, 0, 64, 0, 0, 74,
496 1.1 christos 4, 58, 0, 82, 87, 91, 0, 14, 13, 9,
497 1.1 christos 16, 0, 71, 0, 31, 33, 0, 0, 0, 0,
498 1.1 christos 0, 94, 0, 0, 101, 12, 63, 73, 0, 0,
499 1.1 christos 69, 0, 0, 0, 34, 0, 110, 96, 97, 0,
500 1.1 christos 0, 84, 0, 85, 0, 23, 0, 0, 72, 26,
501 1.1 christos 29, 114, 0, 0, 0, 109, 0, 93, 95, 102,
502 1.1 christos 18, 0, 0, 108, 113, 112, 0, 24, 27, 111,
503 1.1 christos };
504 1.1 christos static const YYINT grammar_dgoto[] = { 33,
505 1.1 christos 87, 35, 36, 37, 38, 39, 40, 69, 70, 41,
506 1.1 christos 42, 119, 120, 100, 101, 102, 103, 104, 43, 44,
507 1.1 christos 59, 60, 45, 46, 47, 48, 49, 50, 51, 52,
508 1.1 christos 77, 53, 127, 109, 128, 97, 94, 143, 72, 98,
509 1.1 christos 112,
510 1.1 christos };
511 1.1 christos static const YYINT grammar_sindex[] = { -2,
512 1.1 christos -3, 27, -239, -177, 0, 0, 0, 0, -274, 0,
513 1.1 christos 0, 0, 0, -246, 0, 0, 0, 0, 0, 0,
514 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
515 1.1 christos -266, 0, 0, 455, 0, 0, 0, 0, 0, 0,
516 1.1 christos 0, -35, -245, 128, 0, 0, -245, -2, 0, 0,
517 1.1 christos 0, 0, 642, 0, 0, 0, -15, 0, -12, -239,
518 1.1 christos 0, 590, 0, -27, 0, 0, 0, 0, -10, 0,
519 1.1 christos -11, 534, -72, 0, -237, -232, 0, -35, -232, 0,
520 1.1 christos 0, 0, 642, 0, 0, 0, 455, 0, 0, 0,
521 1.1 christos 0, 27, 0, 534, 0, 0, -222, 617, 209, 34,
522 1.1 christos 39, 0, 44, 42, 0, 0, 0, 0, 27, -11,
523 1.1 christos 0, -200, -196, -195, 0, 174, 0, 0, 0, -33,
524 1.1 christos 243, 0, 561, 0, -177, 0, 33, 49, 0, 0,
525 1.1 christos 0, 0, 53, 55, 417, 0, -33, 0, 0, 0,
526 1.1 christos 0, 27, -188, 0, 0, 0, 57, 0, 0, 0,
527 1.1 christos };
528 1.1 christos static const YYINT grammar_rindex[] = { 99,
529 1.1 christos 0, 0, 275, 0, 0, -38, 0, 0, 481, 0,
530 1.1 christos 0, 0, 0, 509, 0, 0, 0, 0, 0, 0,
531 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
532 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
533 1.1 christos 0, 30, 0, 0, 0, 0, 0, 101, 0, 0,
534 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 343, 309,
535 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
536 1.1 christos 98, -182, 62, 0, 0, 133, 0, 64, 379, 0,
537 1.1 christos 0, 0, -5, 0, 0, 0, 0, 0, 0, 0,
538 1.1 christos 0, 0, 0, -182, 0, 0, 0, -180, -19, 0,
539 1.1 christos 65, 0, 0, 68, 0, 0, 0, 0, 51, 9,
540 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, -13,
541 1.1 christos 19, 0, 0, 0, 0, 0, 0, 52, 0, 0,
542 1.1 christos 0, 0, 0, 0, 0, 0, 35, 0, 0, 0,
543 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
544 1.1 christos };
545 1.1 christos static const YYINT grammar_gindex[] = { 0,
546 1.1 christos 11, -17, 0, 0, 13, 0, 0, 0, 20, 8,
547 1.1 christos -43, -1, -8, -89, 0, -9, 0, 0, 0, -44,
548 1.1 christos 0, 0, 4, 0, 0, 0, 70, -53, 0, 0,
549 1.1 christos -18, 0, 0, 0, 0, 22, 0, 0, 0, 0,
550 1.1 christos 0,
551 1.1 christos };
552 1.1 christos #define YYTABLESIZE 924
553 1.1 christos static const YYINT grammar_table[] = { 58,
554 1.1 christos 78, 58, 58, 58, 73, 58, 135, 61, 88, 57,
555 1.1 christos 34, 5, 56, 62, 85, 58, 68, 63, 96, 7,
556 1.1 christos 58, 98, 78, 64, 98, 84, 134, 107, 80, 3,
557 1.1 christos 107, 90, 17, 92, 17, 4, 17, 2, 75, 3,
558 1.1 christos 96, 71, 30, 89, 115, 147, 76, 106, 91, 93,
559 1.1 christos 79, 75, 70, 17, 121, 55, 32, 107, 34, 105,
560 1.1 christos 108, 114, 105, 83, 4, 68, 2, 70, 3, 68,
561 1.1 christos 80, 121, 86, 80, 122, 106, 105, 78, 106, 5,
562 1.1 christos 56, 68, 123, 99, 124, 125, 129, 130, 80, 131,
563 1.1 christos 80, 141, 142, 144, 110, 145, 149, 150, 1, 110,
564 1.1 christos 2, 30, 99, 32, 79, 92, 118, 79, 100, 21,
565 1.1 christos 22, 111, 137, 139, 133, 113, 126, 81, 0, 0,
566 1.1 christos 0, 0, 79, 57, 79, 0, 99, 0, 140, 0,
567 1.1 christos 0, 0, 0, 99, 0, 0, 0, 0, 0, 0,
568 1.1 christos 0, 70, 0, 0, 0, 99, 0, 0, 0, 148,
569 1.1 christos 0, 0, 0, 0, 0, 0, 70, 0, 0, 0,
570 1.1 christos 0, 0, 0, 0, 0, 4, 0, 2, 0, 0,
571 1.1 christos 65, 0, 65, 65, 65, 0, 65, 0, 0, 0,
572 1.1 christos 0, 0, 0, 0, 5, 6, 7, 8, 65, 10,
573 1.1 christos 11, 65, 13, 66, 15, 16, 17, 18, 19, 20,
574 1.1 christos 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
575 1.1 christos 0, 4, 0, 116, 132, 3, 0, 0, 58, 58,
576 1.1 christos 58, 58, 58, 58, 58, 78, 58, 58, 58, 58,
577 1.1 christos 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
578 1.1 christos 58, 58, 58, 58, 58, 78, 4, 74, 116, 136,
579 1.1 christos 3, 17, 78, 1, 5, 6, 7, 8, 9, 10,
580 1.1 christos 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
581 1.1 christos 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
582 1.1 christos 4, 54, 116, 5, 56, 0, 31, 80, 80, 80,
583 1.1 christos 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
584 1.1 christos 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
585 1.1 christos 80, 80, 88, 80, 88, 88, 88, 0, 88, 0,
586 1.1 christos 80, 79, 79, 79, 79, 79, 79, 79, 79, 79,
587 1.1 christos 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
588 1.1 christos 79, 79, 79, 79, 79, 79, 89, 79, 89, 89,
589 1.1 christos 89, 0, 89, 0, 79, 25, 25, 25, 25, 25,
590 1.1 christos 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
591 1.1 christos 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
592 1.1 christos 86, 25, 86, 86, 5, 56, 86, 0, 25, 65,
593 1.1 christos 65, 65, 65, 65, 65, 65, 0, 65, 65, 65,
594 1.1 christos 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
595 1.1 christos 65, 65, 65, 65, 65, 65, 75, 0, 75, 75,
596 1.1 christos 75, 0, 75, 0, 0, 0, 0, 0, 0, 0,
597 1.1 christos 5, 6, 7, 8, 65, 10, 11, 75, 13, 66,
598 1.1 christos 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
599 1.1 christos 25, 26, 27, 28, 29, 30, 117, 146, 0, 0,
600 1.1 christos 0, 0, 0, 0, 0, 5, 6, 7, 8, 65,
601 1.1 christos 10, 11, 0, 13, 66, 15, 16, 17, 18, 19,
602 1.1 christos 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
603 1.1 christos 30, 117, 4, 0, 2, 0, 3, 0, 0, 5,
604 1.1 christos 56, 0, 0, 0, 0, 0, 0, 0, 0, 0,
605 1.1 christos 0, 0, 0, 67, 0, 0, 0, 0, 41, 0,
606 1.1 christos 41, 0, 41, 0, 0, 117, 0, 0, 0, 0,
607 1.1 christos 0, 88, 88, 0, 0, 0, 0, 0, 0, 41,
608 1.1 christos 0, 0, 0, 0, 0, 0, 45, 0, 45, 0,
609 1.1 christos 45, 0, 0, 0, 0, 0, 0, 88, 0, 0,
610 1.1 christos 0, 0, 0, 0, 0, 89, 89, 45, 0, 0,
611 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
612 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
613 1.1 christos 0, 89, 0, 0, 0, 0, 0, 0, 0, 86,
614 1.1 christos 86, 0, 0, 0, 0, 0, 0, 0, 0, 0,
615 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
616 1.1 christos 0, 0, 0, 0, 0, 86, 0, 0, 0, 0,
617 1.1 christos 0, 0, 0, 0, 0, 75, 75, 75, 75, 75,
618 1.1 christos 75, 75, 0, 75, 75, 75, 75, 75, 75, 75,
619 1.1 christos 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
620 1.1 christos 75, 75, 0, 0, 0, 0, 0, 0, 0, 0,
621 1.1 christos 0, 0, 0, 0, 82, 7, 8, 65, 10, 11,
622 1.1 christos 0, 13, 66, 15, 16, 17, 18, 19, 20, 21,
623 1.1 christos 22, 23, 24, 25, 26, 27, 28, 29, 30, 0,
624 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
625 1.1 christos 0, 5, 6, 7, 8, 65, 10, 11, 0, 13,
626 1.1 christos 66, 15, 16, 17, 18, 19, 20, 21, 22, 23,
627 1.1 christos 24, 25, 26, 27, 28, 29, 30, 41, 41, 41,
628 1.1 christos 41, 41, 41, 41, 0, 41, 41, 41, 41, 41,
629 1.1 christos 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
630 1.1 christos 41, 41, 41, 0, 0, 45, 45, 45, 45, 45,
631 1.1 christos 45, 45, 0, 45, 45, 45, 45, 45, 45, 45,
632 1.1 christos 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
633 1.1 christos 45, 82, 7, 8, 65, 10, 11, 12, 13, 14,
634 1.1 christos 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
635 1.1 christos 25, 26, 27, 28, 29, 30, 0, 0, 82, 7,
636 1.1 christos 8, 65, 10, 11, 95, 13, 66, 15, 16, 17,
637 1.1 christos 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
638 1.1 christos 28, 29, 30, 0, 0, 0, 138, 82, 7, 8,
639 1.1 christos 65, 10, 11, 12, 13, 14, 15, 16, 17, 18,
640 1.1 christos 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
641 1.1 christos 29, 30, 0, 75, 82, 7, 8, 65, 10, 11,
642 1.1 christos 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
643 1.1 christos 22, 23, 24, 25, 26, 27, 28, 29, 30, 82,
644 1.1 christos 7, 8, 65, 10, 11, 0, 13, 66, 15, 16,
645 1.1 christos 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
646 1.1 christos 27, 28, 29, 30,
647 1.1 christos };
648 1.1 christos static const YYINT grammar_check[] = { 38,
649 1.1 christos 44, 40, 41, 42, 40, 44, 40, 4, 62, 2,
650 1.1 christos 0, 257, 258, 288, 59, 3, 34, 264, 72, 259,
651 1.1 christos 59, 41, 61, 290, 44, 41, 116, 41, 47, 42,
652 1.1 christos 44, 59, 38, 44, 40, 38, 42, 40, 284, 42,
653 1.1 christos 94, 34, 282, 62, 98, 135, 43, 285, 59, 61,
654 1.1 christos 47, 284, 44, 59, 99, 59, 59, 76, 48, 41,
655 1.1 christos 79, 284, 44, 53, 38, 83, 40, 59, 42, 87,
656 1.1 christos 41, 116, 60, 44, 41, 41, 73, 121, 44, 257,
657 1.1 christos 258, 99, 44, 73, 41, 44, 287, 284, 59, 285,
658 1.1 christos 61, 59, 44, 41, 87, 41, 285, 41, 0, 92,
659 1.1 christos 0, 284, 41, 284, 41, 41, 99, 44, 41, 59,
660 1.1 christos 59, 92, 121, 123, 116, 94, 109, 48, -1, -1,
661 1.1 christos -1, -1, 59, 116, 61, -1, 116, -1, 125, -1,
662 1.1 christos -1, -1, -1, 123, -1, -1, -1, -1, -1, -1,
663 1.1 christos -1, 44, -1, -1, -1, 135, -1, -1, -1, 142,
664 1.1 christos -1, -1, -1, -1, -1, -1, 59, -1, -1, -1,
665 1.1 christos -1, -1, -1, -1, -1, 38, -1, 40, -1, -1,
666 1.1 christos 38, -1, 40, 41, 42, -1, 44, -1, -1, -1,
667 1.1 christos -1, -1, -1, -1, 257, 258, 259, 260, 261, 262,
668 1.1 christos 263, 59, 265, 266, 267, 268, 269, 270, 271, 272,
669 1.1 christos 273, 274, 275, 276, 277, 278, 279, 280, 281, 282,
670 1.1 christos -1, 38, -1, 40, 41, 42, -1, -1, 257, 258,
671 1.1 christos 259, 260, 261, 262, 263, 264, 265, 266, 267, 268,
672 1.1 christos 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
673 1.1 christos 279, 280, 281, 282, 283, 284, 38, 283, 40, 283,
674 1.1 christos 42, 257, 291, 256, 257, 258, 259, 260, 261, 262,
675 1.1 christos 263, 264, 265, 266, 267, 268, 269, 270, 271, 272,
676 1.1 christos 273, 274, 275, 276, 277, 278, 279, 280, 281, 282,
677 1.1 christos 38, 285, 40, 257, 258, -1, 289, 258, 259, 260,
678 1.1 christos 261, 262, 263, 264, 265, 266, 267, 268, 269, 270,
679 1.1 christos 271, 272, 273, 274, 275, 276, 277, 278, 279, 280,
680 1.1 christos 281, 282, 38, 284, 40, 41, 42, -1, 44, -1,
681 1.1 christos 291, 258, 259, 260, 261, 262, 263, 264, 265, 266,
682 1.1 christos 267, 268, 269, 270, 271, 272, 273, 274, 275, 276,
683 1.1 christos 277, 278, 279, 280, 281, 282, 38, 284, 40, 41,
684 1.1 christos 42, -1, 44, -1, 291, 258, 259, 260, 261, 262,
685 1.1 christos 263, 264, 265, 266, 267, 268, 269, 270, 271, 272,
686 1.1 christos 273, 274, 275, 276, 277, 278, 279, 280, 281, 282,
687 1.1 christos 38, 284, 40, 41, 257, 258, 44, -1, 291, 257,
688 1.1 christos 258, 259, 260, 261, 262, 263, -1, 265, 266, 267,
689 1.1 christos 268, 269, 270, 271, 272, 273, 274, 275, 276, 277,
690 1.1 christos 278, 279, 280, 281, 282, 283, 38, -1, 40, 41,
691 1.1 christos 42, -1, 44, -1, -1, -1, -1, -1, -1, -1,
692 1.1 christos 257, 258, 259, 260, 261, 262, 263, 59, 265, 266,
693 1.1 christos 267, 268, 269, 270, 271, 272, 273, 274, 275, 276,
694 1.1 christos 277, 278, 279, 280, 281, 282, 283, 41, -1, -1,
695 1.1 christos -1, -1, -1, -1, -1, 257, 258, 259, 260, 261,
696 1.1 christos 262, 263, -1, 265, 266, 267, 268, 269, 270, 271,
697 1.1 christos 272, 273, 274, 275, 276, 277, 278, 279, 280, 281,
698 1.1 christos 282, 283, 38, -1, 40, -1, 42, -1, -1, 257,
699 1.1 christos 258, -1, -1, -1, -1, -1, -1, -1, -1, -1,
700 1.1 christos -1, -1, -1, 59, -1, -1, -1, -1, 38, -1,
701 1.1 christos 40, -1, 42, -1, -1, 283, -1, -1, -1, -1,
702 1.1 christos -1, 257, 258, -1, -1, -1, -1, -1, -1, 59,
703 1.1 christos -1, -1, -1, -1, -1, -1, 38, -1, 40, -1,
704 1.1 christos 42, -1, -1, -1, -1, -1, -1, 283, -1, -1,
705 1.1 christos -1, -1, -1, -1, -1, 257, 258, 59, -1, -1,
706 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
707 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
708 1.1 christos -1, 283, -1, -1, -1, -1, -1, -1, -1, 257,
709 1.1 christos 258, -1, -1, -1, -1, -1, -1, -1, -1, -1,
710 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
711 1.1 christos -1, -1, -1, -1, -1, 283, -1, -1, -1, -1,
712 1.1 christos -1, -1, -1, -1, -1, 257, 258, 259, 260, 261,
713 1.1 christos 262, 263, -1, 265, 266, 267, 268, 269, 270, 271,
714 1.1 christos 272, 273, 274, 275, 276, 277, 278, 279, 280, 281,
715 1.1 christos 282, 283, -1, -1, -1, -1, -1, -1, -1, -1,
716 1.1 christos -1, -1, -1, -1, 258, 259, 260, 261, 262, 263,
717 1.1 christos -1, 265, 266, 267, 268, 269, 270, 271, 272, 273,
718 1.1 christos 274, 275, 276, 277, 278, 279, 280, 281, 282, -1,
719 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
720 1.1 christos -1, 257, 258, 259, 260, 261, 262, 263, -1, 265,
721 1.1 christos 266, 267, 268, 269, 270, 271, 272, 273, 274, 275,
722 1.1 christos 276, 277, 278, 279, 280, 281, 282, 257, 258, 259,
723 1.1 christos 260, 261, 262, 263, -1, 265, 266, 267, 268, 269,
724 1.1 christos 270, 271, 272, 273, 274, 275, 276, 277, 278, 279,
725 1.1 christos 280, 281, 282, -1, -1, 257, 258, 259, 260, 261,
726 1.1 christos 262, 263, -1, 265, 266, 267, 268, 269, 270, 271,
727 1.1 christos 272, 273, 274, 275, 276, 277, 278, 279, 280, 281,
728 1.1 christos 282, 258, 259, 260, 261, 262, 263, 264, 265, 266,
729 1.1 christos 267, 268, 269, 270, 271, 272, 273, 274, 275, 276,
730 1.1 christos 277, 278, 279, 280, 281, 282, -1, -1, 258, 259,
731 1.1 christos 260, 261, 262, 263, 291, 265, 266, 267, 268, 269,
732 1.1 christos 270, 271, 272, 273, 274, 275, 276, 277, 278, 279,
733 1.1 christos 280, 281, 282, -1, -1, -1, 286, 258, 259, 260,
734 1.1 christos 261, 262, 263, 264, 265, 266, 267, 268, 269, 270,
735 1.1 christos 271, 272, 273, 274, 275, 276, 277, 278, 279, 280,
736 1.1 christos 281, 282, -1, 284, 258, 259, 260, 261, 262, 263,
737 1.1 christos 264, 265, 266, 267, 268, 269, 270, 271, 272, 273,
738 1.1 christos 274, 275, 276, 277, 278, 279, 280, 281, 282, 258,
739 1.1 christos 259, 260, 261, 262, 263, -1, 265, 266, 267, 268,
740 1.1 christos 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
741 1.1 christos 279, 280, 281, 282,
742 1.1 christos };
743 1.1 christos #define YYFINAL 33
744 1.1 christos #ifndef YYDEBUG
745 1.1 christos #define YYDEBUG 0
746 1.1 christos #endif
747 1.1 christos #define YYMAXTOKEN 291
748 1.1 christos #define YYUNDFTOKEN 335
749 1.1 christos #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
750 1.1 christos #if YYDEBUG
751 1.1 christos static const char *const grammar_name[] = {
752 1.1 christos
753 1.1 christos "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
754 1.1 christos 0,0,0,0,"'&'",0,"'('","')'","'*'",0,"','",0,0,0,0,0,0,0,0,0,0,0,0,0,0,"';'",0,
755 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,
756 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,
757 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,
758 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,
759 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,
760 1.1 christos "T_IDENTIFIER","T_TYPEDEF_NAME","T_DEFINE_NAME","T_AUTO","T_EXTERN",
761 1.1 christos "T_REGISTER","T_STATIC","T_TYPEDEF","T_INLINE","T_EXTENSION","T_CHAR",
762 1.1 christos "T_DOUBLE","T_FLOAT","T_INT","T_VOID","T_LONG","T_SHORT","T_SIGNED",
763 1.1 christos "T_UNSIGNED","T_ENUM","T_STRUCT","T_UNION","T_Bool","T_Complex","T_Imaginary",
764 1.1 christos "T_TYPE_QUALIFIER","T_BRACKETS","T_LBRACE","T_MATCHRBRACE","T_ELLIPSIS",
765 1.1 christos "T_INITIALIZER","T_STRING_LITERAL","T_ASM","T_ASMARG","T_VA_DCL",0,0,0,0,0,0,0,
766 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,
767 1.1 christos "illegal-symbol",
768 1.1 christos };
769 1.1 christos static const char *const grammar_rule[] = {
770 1.1 christos "$accept : program",
771 1.1 christos "program :",
772 1.1 christos "program : translation_unit",
773 1.1 christos "translation_unit : external_declaration",
774 1.1 christos "translation_unit : translation_unit external_declaration",
775 1.1 christos "external_declaration : declaration",
776 1.1 christos "external_declaration : function_definition",
777 1.1 christos "external_declaration : ';'",
778 1.1 christos "external_declaration : linkage_specification",
779 1.1 christos "external_declaration : T_ASM T_ASMARG ';'",
780 1.1 christos "external_declaration : error T_MATCHRBRACE",
781 1.1 christos "external_declaration : error ';'",
782 1.1 christos "braces : T_LBRACE T_MATCHRBRACE",
783 1.1 christos "linkage_specification : T_EXTERN T_STRING_LITERAL braces",
784 1.1 christos "linkage_specification : T_EXTERN T_STRING_LITERAL declaration",
785 1.1 christos "declaration : decl_specifiers ';'",
786 1.1 christos "declaration : decl_specifiers init_declarator_list ';'",
787 1.1 christos "$$1 :",
788 1.1 christos "declaration : any_typedef decl_specifiers $$1 opt_declarator_list ';'",
789 1.1 christos "any_typedef : T_EXTENSION T_TYPEDEF",
790 1.1 christos "any_typedef : T_TYPEDEF",
791 1.1 christos "opt_declarator_list :",
792 1.1 christos "opt_declarator_list : declarator_list",
793 1.1 christos "declarator_list : declarator",
794 1.1 christos "declarator_list : declarator_list ',' declarator",
795 1.1 christos "$$2 :",
796 1.1 christos "$$3 :",
797 1.1 christos "function_definition : decl_specifiers declarator $$2 opt_declaration_list T_LBRACE $$3 T_MATCHRBRACE",
798 1.1 christos "$$4 :",
799 1.1 christos "function_definition : declarator $$4 opt_declaration_list T_LBRACE T_MATCHRBRACE",
800 1.1 christos "opt_declaration_list :",
801 1.1 christos "opt_declaration_list : T_VA_DCL",
802 1.1 christos "opt_declaration_list : declaration_list",
803 1.1 christos "declaration_list : declaration",
804 1.1 christos "declaration_list : declaration_list declaration",
805 1.1 christos "decl_specifiers : decl_specifier",
806 1.1 christos "decl_specifiers : decl_specifiers decl_specifier",
807 1.1 christos "decl_specifier : storage_class",
808 1.1 christos "decl_specifier : type_specifier",
809 1.1 christos "decl_specifier : type_qualifier",
810 1.1 christos "storage_class : T_AUTO",
811 1.1 christos "storage_class : T_EXTERN",
812 1.1 christos "storage_class : T_REGISTER",
813 1.1 christos "storage_class : T_STATIC",
814 1.1 christos "storage_class : T_INLINE",
815 1.1 christos "storage_class : T_EXTENSION",
816 1.1 christos "type_specifier : T_CHAR",
817 1.1 christos "type_specifier : T_DOUBLE",
818 1.1 christos "type_specifier : T_FLOAT",
819 1.1 christos "type_specifier : T_INT",
820 1.1 christos "type_specifier : T_LONG",
821 1.1 christos "type_specifier : T_SHORT",
822 1.1 christos "type_specifier : T_SIGNED",
823 1.1 christos "type_specifier : T_UNSIGNED",
824 1.1 christos "type_specifier : T_VOID",
825 1.1 christos "type_specifier : T_Bool",
826 1.1 christos "type_specifier : T_Complex",
827 1.1 christos "type_specifier : T_Imaginary",
828 1.1 christos "type_specifier : T_TYPEDEF_NAME",
829 1.1 christos "type_specifier : struct_or_union_specifier",
830 1.1 christos "type_specifier : enum_specifier",
831 1.1 christos "type_qualifier : T_TYPE_QUALIFIER",
832 1.1 christos "type_qualifier : T_DEFINE_NAME",
833 1.1 christos "struct_or_union_specifier : struct_or_union any_id braces",
834 1.1 christos "struct_or_union_specifier : struct_or_union braces",
835 1.1 christos "struct_or_union_specifier : struct_or_union any_id",
836 1.1 christos "struct_or_union : T_STRUCT",
837 1.1 christos "struct_or_union : T_UNION",
838 1.1 christos "init_declarator_list : init_declarator",
839 1.1 christos "init_declarator_list : init_declarator_list ',' init_declarator",
840 1.1 christos "init_declarator : declarator",
841 1.1 christos "$$5 :",
842 1.1 christos "init_declarator : declarator '=' $$5 T_INITIALIZER",
843 1.1 christos "enum_specifier : enumeration any_id braces",
844 1.1 christos "enum_specifier : enumeration braces",
845 1.1 christos "enum_specifier : enumeration any_id",
846 1.1 christos "enumeration : T_ENUM",
847 1.1 christos "any_id : T_IDENTIFIER",
848 1.1 christos "any_id : T_TYPEDEF_NAME",
849 1.1 christos "declarator : pointer direct_declarator",
850 1.1 christos "declarator : direct_declarator",
851 1.1 christos "direct_declarator : identifier_or_ref",
852 1.1 christos "direct_declarator : '(' declarator ')'",
853 1.1 christos "direct_declarator : direct_declarator T_BRACKETS",
854 1.1 christos "direct_declarator : direct_declarator '(' parameter_type_list ')'",
855 1.1 christos "direct_declarator : direct_declarator '(' opt_identifier_list ')'",
856 1.1 christos "pointer : '*' opt_type_qualifiers",
857 1.1 christos "pointer : '*' opt_type_qualifiers pointer",
858 1.1 christos "opt_type_qualifiers :",
859 1.1 christos "opt_type_qualifiers : type_qualifier_list",
860 1.1 christos "type_qualifier_list : type_qualifier",
861 1.1 christos "type_qualifier_list : type_qualifier_list type_qualifier",
862 1.1 christos "parameter_type_list : parameter_list",
863 1.1 christos "parameter_type_list : parameter_list ',' T_ELLIPSIS",
864 1.1 christos "parameter_list : parameter_declaration",
865 1.1 christos "parameter_list : parameter_list ',' parameter_declaration",
866 1.1 christos "parameter_declaration : decl_specifiers declarator",
867 1.1 christos "parameter_declaration : decl_specifiers abs_declarator",
868 1.1 christos "parameter_declaration : decl_specifiers",
869 1.1 christos "opt_identifier_list :",
870 1.1 christos "opt_identifier_list : identifier_list",
871 1.1 christos "identifier_list : any_id",
872 1.1 christos "identifier_list : identifier_list ',' any_id",
873 1.1 christos "identifier_or_ref : any_id",
874 1.1 christos "identifier_or_ref : '&' any_id",
875 1.1 christos "abs_declarator : pointer",
876 1.1 christos "abs_declarator : pointer direct_abs_declarator",
877 1.1 christos "abs_declarator : direct_abs_declarator",
878 1.1 christos "direct_abs_declarator : '(' abs_declarator ')'",
879 1.1 christos "direct_abs_declarator : direct_abs_declarator T_BRACKETS",
880 1.1 christos "direct_abs_declarator : T_BRACKETS",
881 1.1 christos "direct_abs_declarator : direct_abs_declarator '(' parameter_type_list ')'",
882 1.1 christos "direct_abs_declarator : direct_abs_declarator '(' ')'",
883 1.1 christos "direct_abs_declarator : '(' parameter_type_list ')'",
884 1.1 christos "direct_abs_declarator : '(' ')'",
885 1.1 christos
886 1.1 christos };
887 1.1 christos #endif
888 1.1 christos
889 1.1 christos int yydebug;
890 1.1 christos int yynerrs;
891 1.1 christos
892 1.1 christos int yyerrflag;
893 1.1 christos int yychar;
894 1.1 christos YYSTYPE yyval;
895 1.1 christos YYSTYPE yylval;
896 1.1 christos
897 1.1 christos /* define the initial stack-sizes */
898 1.1 christos #ifdef YYSTACKSIZE
899 1.1 christos #undef YYMAXDEPTH
900 1.1 christos #define YYMAXDEPTH YYSTACKSIZE
901 1.1 christos #else
902 1.1 christos #ifdef YYMAXDEPTH
903 1.1 christos #define YYSTACKSIZE YYMAXDEPTH
904 1.1 christos #else
905 1.1 christos #define YYSTACKSIZE 10000
906 1.1 christos #define YYMAXDEPTH 10000
907 1.1 christos #endif
908 1.1 christos #endif
909 1.1 christos
910 1.1 christos #define YYINITSTACKSIZE 200
911 1.1 christos
912 1.1 christos typedef struct {
913 1.1 christos unsigned stacksize;
914 1.1 christos YYINT *s_base;
915 1.1 christos YYINT *s_mark;
916 1.1 christos YYINT *s_last;
917 1.1 christos YYSTYPE *l_base;
918 1.1 christos YYSTYPE *l_mark;
919 1.1 christos } YYSTACKDATA;
920 1.1 christos /* variables for the parser stack */
921 1.1 christos static YYSTACKDATA yystack;
922 1.1 christos #line 1014 "grammar.y"
923 1.1 christos
924 1.1 christos /* lex.yy.c */
925 1.1 christos #define BEGIN yy_start = 1 + 2 *
926 1.1 christos
927 1.1 christos #define CPP1 1
928 1.1 christos #define INIT1 2
929 1.1 christos #define INIT2 3
930 1.1 christos #define CURLY 4
931 1.1 christos #define LEXYACC 5
932 1.1 christos #define ASM 6
933 1.1 christos #define CPP_INLINE 7
934 1.1 christos
935 1.1 christos extern char *yytext;
936 1.1 christos extern FILE *yyin, *yyout;
937 1.1 christos
938 1.1 christos static int curly; /* number of curly brace nesting levels */
939 1.1 christos static int ly_count; /* number of occurances of %% */
940 1.1 christos static int inc_depth; /* include nesting level */
941 1.1 christos static SymbolTable *included_files; /* files already included */
942 1.1 christos static int yy_start = 0; /* start state number */
943 1.1 christos
944 1.1 christos #define grammar_error(s) yaccError(s)
945 1.1 christos
946 1.1 christos static void
947 1.1 christos yaccError (const char *msg)
948 1.1 christos {
949 1.1 christos func_params = NULL;
950 1.1 christos put_error(); /* tell what line we're on, and what file */
951 1.1 christos fprintf(stderr, "%s at token '%s'\n", msg, yytext);
952 1.1 christos }
953 1.1 christos
954 1.1 christos /* Initialize the table of type qualifier keywords recognized by the lexical
955 1.1 christos * analyzer.
956 1.1 christos */
957 1.1 christos void
958 1.1 christos init_parser (void)
959 1.1 christos {
960 1.1 christos static const char *keywords[] = {
961 1.1 christos "const",
962 1.1 christos "restrict",
963 1.1 christos "volatile",
964 1.1 christos "interrupt",
965 1.1 christos #ifdef vms
966 1.1 christos "noshare",
967 1.1 christos "readonly",
968 1.1 christos #endif
969 1.1 christos #if defined(MSDOS) || defined(OS2)
970 1.1 christos "__cdecl",
971 1.1 christos "__export",
972 1.1 christos "__far",
973 1.1 christos "__fastcall",
974 1.1 christos "__fortran",
975 1.1 christos "__huge",
976 1.1 christos "__inline",
977 1.1 christos "__interrupt",
978 1.1 christos "__loadds",
979 1.1 christos "__near",
980 1.1 christos "__pascal",
981 1.1 christos "__saveregs",
982 1.1 christos "__segment",
983 1.1 christos "__stdcall",
984 1.1 christos "__syscall",
985 1.1 christos "_cdecl",
986 1.1 christos "_cs",
987 1.1 christos "_ds",
988 1.1 christos "_es",
989 1.1 christos "_export",
990 1.1 christos "_far",
991 1.1 christos "_fastcall",
992 1.1 christos "_fortran",
993 1.1 christos "_huge",
994 1.1 christos "_interrupt",
995 1.1 christos "_loadds",
996 1.1 christos "_near",
997 1.1 christos "_pascal",
998 1.1 christos "_saveregs",
999 1.1 christos "_seg",
1000 1.1 christos "_segment",
1001 1.1 christos "_ss",
1002 1.1 christos "cdecl",
1003 1.1 christos "far",
1004 1.1 christos "huge",
1005 1.1 christos "near",
1006 1.1 christos "pascal",
1007 1.1 christos #ifdef OS2
1008 1.1 christos "__far16",
1009 1.1 christos #endif
1010 1.1 christos #endif
1011 1.1 christos #ifdef __GNUC__
1012 1.1 christos /* gcc aliases */
1013 1.1 christos "__builtin_va_arg",
1014 1.1 christos "__builtin_va_list",
1015 1.1 christos "__const",
1016 1.1 christos "__const__",
1017 1.1 christos "__inline",
1018 1.1 christos "__inline__",
1019 1.1 christos "__restrict",
1020 1.1 christos "__restrict__",
1021 1.1 christos "__volatile",
1022 1.1 christos "__volatile__",
1023 1.1 christos #endif
1024 1.1 christos };
1025 1.1 christos unsigned i;
1026 1.1 christos
1027 1.1 christos /* Initialize type qualifier table. */
1028 1.1 christos type_qualifiers = new_symbol_table();
1029 1.1 christos for (i = 0; i < sizeof(keywords)/sizeof(keywords[0]); ++i) {
1030 1.1 christos new_symbol(type_qualifiers, keywords[i], NULL, DS_NONE);
1031 1.1 christos }
1032 1.1 christos }
1033 1.1 christos
1034 1.1 christos /* Process the C source file. Write function prototypes to the standard
1035 1.1 christos * output. Convert function definitions and write the converted source
1036 1.1 christos * code to a temporary file.
1037 1.1 christos */
1038 1.1 christos void
1039 1.1 christos process_file (FILE *infile, char *name)
1040 1.1 christos {
1041 1.1 christos char *s;
1042 1.1 christos
1043 1.1 christos if (strlen(name) > 2) {
1044 1.1 christos s = name + strlen(name) - 2;
1045 1.1 christos if (*s == '.') {
1046 1.1 christos ++s;
1047 1.1 christos if (*s == 'l' || *s == 'y')
1048 1.1 christos BEGIN LEXYACC;
1049 1.1 christos #if defined(MSDOS) || defined(OS2)
1050 1.1 christos if (*s == 'L' || *s == 'Y')
1051 1.1 christos BEGIN LEXYACC;
1052 1.1 christos #endif
1053 1.1 christos }
1054 1.1 christos }
1055 1.1 christos
1056 1.1 christos included_files = new_symbol_table();
1057 1.1 christos typedef_names = new_symbol_table();
1058 1.1 christos define_names = new_symbol_table();
1059 1.1 christos inc_depth = -1;
1060 1.1 christos curly = 0;
1061 1.1 christos ly_count = 0;
1062 1.1 christos func_params = NULL;
1063 1.1 christos yyin = infile;
1064 1.1 christos include_file(strcpy(base_file, name), func_style != FUNC_NONE);
1065 1.1 christos if (file_comments) {
1066 1.1 christos #if OPT_LINTLIBRARY
1067 1.1 christos if (lintLibrary()) {
1068 1.1 christos put_blankline(stdout);
1069 1.1 christos begin_tracking();
1070 1.1 christos }
1071 1.1 christos #endif
1072 1.1 christos put_string(stdout, "/* ");
1073 1.1 christos put_string(stdout, cur_file_name());
1074 1.1 christos put_string(stdout, " */\n");
1075 1.1 christos }
1076 1.1 christos yyparse();
1077 1.1 christos free_symbol_table(define_names);
1078 1.1 christos free_symbol_table(typedef_names);
1079 1.1 christos free_symbol_table(included_files);
1080 1.1 christos }
1081 1.1 christos
1082 1.1 christos #ifdef NO_LEAKS
1083 1.1 christos void
1084 1.1 christos free_parser(void)
1085 1.1 christos {
1086 1.1 christos free_symbol_table (type_qualifiers);
1087 1.1 christos #ifdef FLEX_SCANNER
1088 1.1 christos if (yy_current_buffer != 0)
1089 1.1 christos yy_delete_buffer(yy_current_buffer);
1090 1.1 christos #endif
1091 1.1 christos }
1092 1.1 christos #endif
1093 1.1 christos #line 1092 "grammar.tab.c"
1094 1.1 christos
1095 1.1 christos #if YYDEBUG
1096 1.1.1.3.2.1 pgoyette #include <stdio.h> /* needed for printf */
1097 1.1 christos #endif
1098 1.1 christos
1099 1.1 christos #include <stdlib.h> /* needed for malloc, etc */
1100 1.1 christos #include <string.h> /* needed for memset */
1101 1.1 christos
1102 1.1 christos /* allocate initial stack or double stack size, up to YYMAXDEPTH */
1103 1.1 christos static int yygrowstack(YYSTACKDATA *data)
1104 1.1 christos {
1105 1.1 christos int i;
1106 1.1 christos unsigned newsize;
1107 1.1 christos YYINT *newss;
1108 1.1 christos YYSTYPE *newvs;
1109 1.1 christos
1110 1.1 christos if ((newsize = data->stacksize) == 0)
1111 1.1 christos newsize = YYINITSTACKSIZE;
1112 1.1 christos else if (newsize >= YYMAXDEPTH)
1113 1.1 christos return YYENOMEM;
1114 1.1 christos else if ((newsize *= 2) > YYMAXDEPTH)
1115 1.1 christos newsize = YYMAXDEPTH;
1116 1.1 christos
1117 1.1 christos i = (int) (data->s_mark - data->s_base);
1118 1.1 christos newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
1119 1.1 christos if (newss == 0)
1120 1.1 christos return YYENOMEM;
1121 1.1 christos
1122 1.1 christos data->s_base = newss;
1123 1.1 christos data->s_mark = newss + i;
1124 1.1 christos
1125 1.1 christos newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
1126 1.1 christos if (newvs == 0)
1127 1.1 christos return YYENOMEM;
1128 1.1 christos
1129 1.1 christos data->l_base = newvs;
1130 1.1 christos data->l_mark = newvs + i;
1131 1.1 christos
1132 1.1 christos data->stacksize = newsize;
1133 1.1 christos data->s_last = data->s_base + newsize - 1;
1134 1.1 christos return 0;
1135 1.1 christos }
1136 1.1 christos
1137 1.1 christos #if YYPURE || defined(YY_NO_LEAKS)
1138 1.1 christos static void yyfreestack(YYSTACKDATA *data)
1139 1.1 christos {
1140 1.1 christos free(data->s_base);
1141 1.1 christos free(data->l_base);
1142 1.1 christos memset(data, 0, sizeof(*data));
1143 1.1 christos }
1144 1.1 christos #else
1145 1.1 christos #define yyfreestack(data) /* nothing */
1146 1.1 christos #endif
1147 1.1 christos
1148 1.1 christos #define YYABORT goto yyabort
1149 1.1 christos #define YYREJECT goto yyabort
1150 1.1 christos #define YYACCEPT goto yyaccept
1151 1.1 christos #define YYERROR goto yyerrlab
1152 1.1 christos
1153 1.1 christos int
1154 1.1 christos YYPARSE_DECL()
1155 1.1 christos {
1156 1.1 christos int yym, yyn, yystate;
1157 1.1 christos #if YYDEBUG
1158 1.1 christos const char *yys;
1159 1.1 christos
1160 1.1 christos if ((yys = getenv("YYDEBUG")) != 0)
1161 1.1 christos {
1162 1.1 christos yyn = *yys;
1163 1.1 christos if (yyn >= '0' && yyn <= '9')
1164 1.1 christos yydebug = yyn - '0';
1165 1.1 christos }
1166 1.1 christos #endif
1167 1.1 christos
1168 1.1.1.3.2.1 pgoyette yym = 0;
1169 1.1.1.3.2.1 pgoyette yyn = 0;
1170 1.1 christos yynerrs = 0;
1171 1.1 christos yyerrflag = 0;
1172 1.1 christos yychar = YYEMPTY;
1173 1.1 christos yystate = 0;
1174 1.1 christos
1175 1.1 christos #if YYPURE
1176 1.1 christos memset(&yystack, 0, sizeof(yystack));
1177 1.1 christos #endif
1178 1.1 christos
1179 1.1 christos if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1180 1.1 christos yystack.s_mark = yystack.s_base;
1181 1.1 christos yystack.l_mark = yystack.l_base;
1182 1.1 christos yystate = 0;
1183 1.1 christos *yystack.s_mark = 0;
1184 1.1 christos
1185 1.1 christos yyloop:
1186 1.1 christos if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
1187 1.1 christos if (yychar < 0)
1188 1.1 christos {
1189 1.1.1.3.2.1 pgoyette yychar = YYLEX;
1190 1.1.1.3.2.1 pgoyette if (yychar < 0) yychar = YYEOF;
1191 1.1 christos #if YYDEBUG
1192 1.1 christos if (yydebug)
1193 1.1 christos {
1194 1.1.1.3.2.1 pgoyette if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
1195 1.1 christos printf("%sdebug: state %d, reading %d (%s)\n",
1196 1.1 christos YYPREFIX, yystate, yychar, yys);
1197 1.1 christos }
1198 1.1 christos #endif
1199 1.1 christos }
1200 1.1.1.3.2.1 pgoyette if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1201 1.1.1.3.2.1 pgoyette yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1202 1.1 christos {
1203 1.1 christos #if YYDEBUG
1204 1.1 christos if (yydebug)
1205 1.1 christos printf("%sdebug: state %d, shifting to state %d\n",
1206 1.1 christos YYPREFIX, yystate, yytable[yyn]);
1207 1.1 christos #endif
1208 1.1.1.3.2.1 pgoyette if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1209 1.1 christos yystate = yytable[yyn];
1210 1.1 christos *++yystack.s_mark = yytable[yyn];
1211 1.1 christos *++yystack.l_mark = yylval;
1212 1.1 christos yychar = YYEMPTY;
1213 1.1 christos if (yyerrflag > 0) --yyerrflag;
1214 1.1 christos goto yyloop;
1215 1.1 christos }
1216 1.1.1.3.2.1 pgoyette if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1217 1.1.1.3.2.1 pgoyette yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1218 1.1 christos {
1219 1.1 christos yyn = yytable[yyn];
1220 1.1 christos goto yyreduce;
1221 1.1 christos }
1222 1.1.1.3.2.1 pgoyette if (yyerrflag != 0) goto yyinrecovery;
1223 1.1 christos
1224 1.1 christos YYERROR_CALL("syntax error");
1225 1.1 christos
1226 1.1.1.3.2.1 pgoyette goto yyerrlab; /* redundant goto avoids 'unused label' warning */
1227 1.1 christos yyerrlab:
1228 1.1 christos ++yynerrs;
1229 1.1 christos
1230 1.1 christos yyinrecovery:
1231 1.1 christos if (yyerrflag < 3)
1232 1.1 christos {
1233 1.1 christos yyerrflag = 3;
1234 1.1 christos for (;;)
1235 1.1 christos {
1236 1.1.1.3.2.1 pgoyette if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
1237 1.1.1.3.2.1 pgoyette yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
1238 1.1 christos {
1239 1.1 christos #if YYDEBUG
1240 1.1 christos if (yydebug)
1241 1.1 christos printf("%sdebug: state %d, error recovery shifting\
1242 1.1 christos to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
1243 1.1 christos #endif
1244 1.1.1.3.2.1 pgoyette if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1245 1.1 christos yystate = yytable[yyn];
1246 1.1 christos *++yystack.s_mark = yytable[yyn];
1247 1.1 christos *++yystack.l_mark = yylval;
1248 1.1 christos goto yyloop;
1249 1.1 christos }
1250 1.1 christos else
1251 1.1 christos {
1252 1.1 christos #if YYDEBUG
1253 1.1 christos if (yydebug)
1254 1.1 christos printf("%sdebug: error recovery discarding state %d\n",
1255 1.1 christos YYPREFIX, *yystack.s_mark);
1256 1.1 christos #endif
1257 1.1 christos if (yystack.s_mark <= yystack.s_base) goto yyabort;
1258 1.1 christos --yystack.s_mark;
1259 1.1 christos --yystack.l_mark;
1260 1.1 christos }
1261 1.1 christos }
1262 1.1 christos }
1263 1.1 christos else
1264 1.1 christos {
1265 1.1 christos if (yychar == YYEOF) goto yyabort;
1266 1.1 christos #if YYDEBUG
1267 1.1 christos if (yydebug)
1268 1.1 christos {
1269 1.1.1.3.2.1 pgoyette if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
1270 1.1 christos printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
1271 1.1 christos YYPREFIX, yystate, yychar, yys);
1272 1.1 christos }
1273 1.1 christos #endif
1274 1.1 christos yychar = YYEMPTY;
1275 1.1 christos goto yyloop;
1276 1.1 christos }
1277 1.1 christos
1278 1.1 christos yyreduce:
1279 1.1 christos #if YYDEBUG
1280 1.1 christos if (yydebug)
1281 1.1 christos printf("%sdebug: state %d, reducing by rule %d (%s)\n",
1282 1.1 christos YYPREFIX, yystate, yyn, yyrule[yyn]);
1283 1.1 christos #endif
1284 1.1 christos yym = yylen[yyn];
1285 1.1.1.3.2.1 pgoyette if (yym > 0)
1286 1.1 christos yyval = yystack.l_mark[1-yym];
1287 1.1 christos else
1288 1.1 christos memset(&yyval, 0, sizeof yyval);
1289 1.1.1.3.2.1 pgoyette
1290 1.1 christos switch (yyn)
1291 1.1 christos {
1292 1.1 christos case 10:
1293 1.1 christos #line 377 "grammar.y"
1294 1.1 christos {
1295 1.1 christos yyerrok;
1296 1.1 christos }
1297 1.1 christos break;
1298 1.1 christos case 11:
1299 1.1 christos #line 381 "grammar.y"
1300 1.1 christos {
1301 1.1 christos yyerrok;
1302 1.1 christos }
1303 1.1 christos break;
1304 1.1 christos case 13:
1305 1.1 christos #line 392 "grammar.y"
1306 1.1 christos {
1307 1.1 christos /* Provide an empty action here so bison will not complain about
1308 1.1 christos * incompatible types in the default action it normally would
1309 1.1 christos * have generated.
1310 1.1 christos */
1311 1.1 christos }
1312 1.1 christos break;
1313 1.1 christos case 14:
1314 1.1 christos #line 399 "grammar.y"
1315 1.1 christos {
1316 1.1 christos /* empty */
1317 1.1 christos }
1318 1.1 christos break;
1319 1.1 christos case 15:
1320 1.1 christos #line 406 "grammar.y"
1321 1.1 christos {
1322 1.1 christos #if OPT_LINTLIBRARY
1323 1.1 christos if (types_out && want_typedef()) {
1324 1.1 christos gen_declarations(&yystack.l_mark[-1].decl_spec, (DeclaratorList *)0);
1325 1.1 christos flush_varargs();
1326 1.1 christos }
1327 1.1 christos #endif
1328 1.1 christos free_decl_spec(&yystack.l_mark[-1].decl_spec);
1329 1.1 christos end_typedef();
1330 1.1 christos }
1331 1.1 christos break;
1332 1.1 christos case 16:
1333 1.1 christos #line 417 "grammar.y"
1334 1.1 christos {
1335 1.1 christos if (func_params != NULL) {
1336 1.1 christos set_param_types(func_params, &yystack.l_mark[-2].decl_spec, &yystack.l_mark[-1].decl_list);
1337 1.1 christos } else {
1338 1.1 christos gen_declarations(&yystack.l_mark[-2].decl_spec, &yystack.l_mark[-1].decl_list);
1339 1.1 christos #if OPT_LINTLIBRARY
1340 1.1 christos flush_varargs();
1341 1.1 christos #endif
1342 1.1 christos free_decl_list(&yystack.l_mark[-1].decl_list);
1343 1.1 christos }
1344 1.1 christos free_decl_spec(&yystack.l_mark[-2].decl_spec);
1345 1.1 christos end_typedef();
1346 1.1 christos }
1347 1.1 christos break;
1348 1.1 christos case 17:
1349 1.1 christos #line 431 "grammar.y"
1350 1.1 christos {
1351 1.1 christos cur_decl_spec_flags = yystack.l_mark[0].decl_spec.flags;
1352 1.1 christos free_decl_spec(&yystack.l_mark[0].decl_spec);
1353 1.1 christos }
1354 1.1 christos break;
1355 1.1 christos case 18:
1356 1.1 christos #line 436 "grammar.y"
1357 1.1 christos {
1358 1.1 christos end_typedef();
1359 1.1 christos }
1360 1.1 christos break;
1361 1.1 christos case 19:
1362 1.1 christos #line 443 "grammar.y"
1363 1.1 christos {
1364 1.1 christos begin_typedef();
1365 1.1 christos }
1366 1.1 christos break;
1367 1.1 christos case 20:
1368 1.1 christos #line 447 "grammar.y"
1369 1.1 christos {
1370 1.1 christos begin_typedef();
1371 1.1 christos }
1372 1.1 christos break;
1373 1.1 christos case 23:
1374 1.1 christos #line 459 "grammar.y"
1375 1.1 christos {
1376 1.1 christos int flags = cur_decl_spec_flags;
1377 1.1 christos
1378 1.1 christos /* If the typedef is a pointer type, then reset the short type
1379 1.1 christos * flags so it does not get promoted.
1380 1.1 christos */
1381 1.1 christos if (strcmp(yystack.l_mark[0].declarator->text, yystack.l_mark[0].declarator->name) != 0)
1382 1.1 christos flags &= ~(DS_CHAR | DS_SHORT | DS_FLOAT);
1383 1.1 christos new_symbol(typedef_names, yystack.l_mark[0].declarator->name, NULL, flags);
1384 1.1 christos free_declarator(yystack.l_mark[0].declarator);
1385 1.1 christos }
1386 1.1 christos break;
1387 1.1 christos case 24:
1388 1.1 christos #line 471 "grammar.y"
1389 1.1 christos {
1390 1.1 christos int flags = cur_decl_spec_flags;
1391 1.1 christos
1392 1.1 christos if (strcmp(yystack.l_mark[0].declarator->text, yystack.l_mark[0].declarator->name) != 0)
1393 1.1 christos flags &= ~(DS_CHAR | DS_SHORT | DS_FLOAT);
1394 1.1 christos new_symbol(typedef_names, yystack.l_mark[0].declarator->name, NULL, flags);
1395 1.1 christos free_declarator(yystack.l_mark[0].declarator);
1396 1.1 christos }
1397 1.1 christos break;
1398 1.1 christos case 25:
1399 1.1 christos #line 483 "grammar.y"
1400 1.1 christos {
1401 1.1 christos check_untagged(&yystack.l_mark[-1].decl_spec);
1402 1.1 christos if (yystack.l_mark[0].declarator->func_def == FUNC_NONE) {
1403 1.1 christos yyerror("syntax error");
1404 1.1 christos YYERROR;
1405 1.1 christos }
1406 1.1 christos func_params = &(yystack.l_mark[0].declarator->head->params);
1407 1.1 christos func_params->begin_comment = cur_file->begin_comment;
1408 1.1 christos func_params->end_comment = cur_file->end_comment;
1409 1.1 christos }
1410 1.1 christos break;
1411 1.1 christos case 26:
1412 1.1 christos #line 494 "grammar.y"
1413 1.1 christos {
1414 1.1 christos /* If we're converting to K&R and we've got a nominally K&R
1415 1.1 christos * function which has a parameter which is ANSI (i.e., a prototyped
1416 1.1 christos * function pointer), then we must override the deciphered value of
1417 1.1 christos * 'func_def' so that the parameter will be converted.
1418 1.1 christos */
1419 1.1 christos if (func_style == FUNC_TRADITIONAL
1420 1.1 christos && haveAnsiParam()
1421 1.1 christos && yystack.l_mark[-3].declarator->head->func_def == func_style) {
1422 1.1 christos yystack.l_mark[-3].declarator->head->func_def = FUNC_BOTH;
1423 1.1 christos }
1424 1.1 christos
1425 1.1 christos func_params = NULL;
1426 1.1 christos
1427 1.1 christos if (cur_file->convert)
1428 1.1 christos gen_func_definition(&yystack.l_mark[-4].decl_spec, yystack.l_mark[-3].declarator);
1429 1.1 christos gen_prototype(&yystack.l_mark[-4].decl_spec, yystack.l_mark[-3].declarator);
1430 1.1 christos #if OPT_LINTLIBRARY
1431 1.1 christos flush_varargs();
1432 1.1 christos #endif
1433 1.1 christos free_decl_spec(&yystack.l_mark[-4].decl_spec);
1434 1.1 christos free_declarator(yystack.l_mark[-3].declarator);
1435 1.1 christos }
1436 1.1 christos break;
1437 1.1 christos case 28:
1438 1.1 christos #line 519 "grammar.y"
1439 1.1 christos {
1440 1.1 christos if (yystack.l_mark[0].declarator->func_def == FUNC_NONE) {
1441 1.1 christos yyerror("syntax error");
1442 1.1 christos YYERROR;
1443 1.1 christos }
1444 1.1 christos func_params = &(yystack.l_mark[0].declarator->head->params);
1445 1.1 christos func_params->begin_comment = cur_file->begin_comment;
1446 1.1 christos func_params->end_comment = cur_file->end_comment;
1447 1.1 christos }
1448 1.1 christos break;
1449 1.1 christos case 29:
1450 1.1 christos #line 529 "grammar.y"
1451 1.1 christos {
1452 1.1 christos DeclSpec decl_spec;
1453 1.1 christos
1454 1.1 christos func_params = NULL;
1455 1.1 christos
1456 1.1 christos new_decl_spec(&decl_spec, dft_decl_spec(), yystack.l_mark[-4].declarator->begin, DS_NONE);
1457 1.1 christos if (cur_file->convert)
1458 1.1 christos gen_func_definition(&decl_spec, yystack.l_mark[-4].declarator);
1459 1.1 christos gen_prototype(&decl_spec, yystack.l_mark[-4].declarator);
1460 1.1 christos #if OPT_LINTLIBRARY
1461 1.1 christos flush_varargs();
1462 1.1 christos #endif
1463 1.1 christos free_decl_spec(&decl_spec);
1464 1.1 christos free_declarator(yystack.l_mark[-4].declarator);
1465 1.1 christos }
1466 1.1 christos break;
1467 1.1 christos case 36:
1468 1.1 christos #line 560 "grammar.y"
1469 1.1 christos {
1470 1.1 christos join_decl_specs(&yyval.decl_spec, &yystack.l_mark[-1].decl_spec, &yystack.l_mark[0].decl_spec);
1471 1.1 christos free(yystack.l_mark[-1].decl_spec.text);
1472 1.1 christos free(yystack.l_mark[0].decl_spec.text);
1473 1.1 christos }
1474 1.1 christos break;
1475 1.1 christos case 40:
1476 1.1 christos #line 575 "grammar.y"
1477 1.1 christos {
1478 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
1479 1.1 christos }
1480 1.1 christos break;
1481 1.1 christos case 41:
1482 1.1 christos #line 579 "grammar.y"
1483 1.1 christos {
1484 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_EXTERN);
1485 1.1 christos }
1486 1.1 christos break;
1487 1.1 christos case 42:
1488 1.1 christos #line 583 "grammar.y"
1489 1.1 christos {
1490 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
1491 1.1 christos }
1492 1.1 christos break;
1493 1.1 christos case 43:
1494 1.1 christos #line 587 "grammar.y"
1495 1.1 christos {
1496 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_STATIC);
1497 1.1 christos }
1498 1.1 christos break;
1499 1.1 christos case 44:
1500 1.1 christos #line 591 "grammar.y"
1501 1.1 christos {
1502 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_INLINE);
1503 1.1 christos }
1504 1.1 christos break;
1505 1.1 christos case 45:
1506 1.1 christos #line 595 "grammar.y"
1507 1.1 christos {
1508 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_JUNK);
1509 1.1 christos }
1510 1.1 christos break;
1511 1.1 christos case 46:
1512 1.1 christos #line 602 "grammar.y"
1513 1.1 christos {
1514 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_CHAR);
1515 1.1 christos }
1516 1.1 christos break;
1517 1.1 christos case 47:
1518 1.1 christos #line 606 "grammar.y"
1519 1.1 christos {
1520 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
1521 1.1 christos }
1522 1.1 christos break;
1523 1.1 christos case 48:
1524 1.1 christos #line 610 "grammar.y"
1525 1.1 christos {
1526 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_FLOAT);
1527 1.1 christos }
1528 1.1 christos break;
1529 1.1 christos case 49:
1530 1.1 christos #line 614 "grammar.y"
1531 1.1 christos {
1532 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
1533 1.1 christos }
1534 1.1 christos break;
1535 1.1 christos case 50:
1536 1.1 christos #line 618 "grammar.y"
1537 1.1 christos {
1538 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
1539 1.1 christos }
1540 1.1 christos break;
1541 1.1 christos case 51:
1542 1.1 christos #line 622 "grammar.y"
1543 1.1 christos {
1544 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_SHORT);
1545 1.1 christos }
1546 1.1 christos break;
1547 1.1 christos case 52:
1548 1.1 christos #line 626 "grammar.y"
1549 1.1 christos {
1550 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
1551 1.1 christos }
1552 1.1 christos break;
1553 1.1 christos case 53:
1554 1.1 christos #line 630 "grammar.y"
1555 1.1 christos {
1556 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
1557 1.1 christos }
1558 1.1 christos break;
1559 1.1 christos case 54:
1560 1.1 christos #line 634 "grammar.y"
1561 1.1 christos {
1562 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
1563 1.1 christos }
1564 1.1 christos break;
1565 1.1 christos case 55:
1566 1.1 christos #line 638 "grammar.y"
1567 1.1 christos {
1568 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_CHAR);
1569 1.1 christos }
1570 1.1 christos break;
1571 1.1 christos case 56:
1572 1.1 christos #line 642 "grammar.y"
1573 1.1 christos {
1574 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
1575 1.1 christos }
1576 1.1 christos break;
1577 1.1 christos case 57:
1578 1.1 christos #line 646 "grammar.y"
1579 1.1 christos {
1580 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
1581 1.1 christos }
1582 1.1 christos break;
1583 1.1 christos case 58:
1584 1.1 christos #line 650 "grammar.y"
1585 1.1 christos {
1586 1.1 christos Symbol *s;
1587 1.1 christos s = find_symbol(typedef_names, yystack.l_mark[0].text.text);
1588 1.1 christos if (s != NULL)
1589 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, s->flags);
1590 1.1 christos }
1591 1.1 christos break;
1592 1.1 christos case 61:
1593 1.1 christos #line 662 "grammar.y"
1594 1.1 christos {
1595 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE);
1596 1.1 christos }
1597 1.1 christos break;
1598 1.1 christos case 62:
1599 1.1 christos #line 666 "grammar.y"
1600 1.1 christos {
1601 1.1 christos /* This rule allows the <pointer> nonterminal to scan #define
1602 1.1 christos * names as if they were type modifiers.
1603 1.1 christos */
1604 1.1 christos Symbol *s;
1605 1.1 christos s = find_symbol(define_names, yystack.l_mark[0].text.text);
1606 1.1 christos if (s != NULL)
1607 1.1 christos new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, s->flags);
1608 1.1 christos }
1609 1.1 christos break;
1610 1.1 christos case 63:
1611 1.1 christos #line 679 "grammar.y"
1612 1.1 christos {
1613 1.1 christos char *s;
1614 1.1 christos if ((s = implied_typedef()) == 0)
1615 1.1 christos (void)sprintf(s = buf, "%s %s", yystack.l_mark[-2].text.text, yystack.l_mark[-1].text.text);
1616 1.1 christos new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-2].text.begin, DS_NONE);
1617 1.1 christos }
1618 1.1 christos break;
1619 1.1 christos case 64:
1620 1.1 christos #line 686 "grammar.y"
1621 1.1 christos {
1622 1.1 christos char *s;
1623 1.1 christos if ((s = implied_typedef()) == 0)
1624 1.1 christos (void)sprintf(s = buf, "%s {}", yystack.l_mark[-1].text.text);
1625 1.1 christos new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-1].text.begin, DS_NONE);
1626 1.1 christos }
1627 1.1 christos break;
1628 1.1 christos case 65:
1629 1.1 christos #line 693 "grammar.y"
1630 1.1 christos {
1631 1.1 christos (void)sprintf(buf, "%s %s", yystack.l_mark[-1].text.text, yystack.l_mark[0].text.text);
1632 1.1 christos new_decl_spec(&yyval.decl_spec, buf, yystack.l_mark[-1].text.begin, DS_NONE);
1633 1.1 christos }
1634 1.1 christos break;
1635 1.1 christos case 66:
1636 1.1 christos #line 701 "grammar.y"
1637 1.1 christos {
1638 1.1 christos imply_typedef(yyval.text.text);
1639 1.1 christos }
1640 1.1 christos break;
1641 1.1 christos case 67:
1642 1.1 christos #line 705 "grammar.y"
1643 1.1 christos {
1644 1.1 christos imply_typedef(yyval.text.text);
1645 1.1 christos }
1646 1.1 christos break;
1647 1.1 christos case 68:
1648 1.1 christos #line 712 "grammar.y"
1649 1.1 christos {
1650 1.1 christos new_decl_list(&yyval.decl_list, yystack.l_mark[0].declarator);
1651 1.1 christos }
1652 1.1 christos break;
1653 1.1 christos case 69:
1654 1.1 christos #line 716 "grammar.y"
1655 1.1 christos {
1656 1.1 christos add_decl_list(&yyval.decl_list, &yystack.l_mark[-2].decl_list, yystack.l_mark[0].declarator);
1657 1.1 christos }
1658 1.1 christos break;
1659 1.1 christos case 70:
1660 1.1 christos #line 723 "grammar.y"
1661 1.1 christos {
1662 1.1 christos if (yystack.l_mark[0].declarator->func_def != FUNC_NONE && func_params == NULL &&
1663 1.1 christos func_style == FUNC_TRADITIONAL && cur_file->convert) {
1664 1.1 christos gen_func_declarator(yystack.l_mark[0].declarator);
1665 1.1 christos fputs(cur_text(), cur_file->tmp_file);
1666 1.1 christos }
1667 1.1 christos cur_declarator = yyval.declarator;
1668 1.1 christos }
1669 1.1 christos break;
1670 1.1 christos case 71:
1671 1.1 christos #line 732 "grammar.y"
1672 1.1 christos {
1673 1.1 christos if (yystack.l_mark[-1].declarator->func_def != FUNC_NONE && func_params == NULL &&
1674 1.1 christos func_style == FUNC_TRADITIONAL && cur_file->convert) {
1675 1.1 christos gen_func_declarator(yystack.l_mark[-1].declarator);
1676 1.1 christos fputs(" =", cur_file->tmp_file);
1677 1.1 christos }
1678 1.1 christos }
1679 1.1 christos break;
1680 1.1 christos case 73:
1681 1.1 christos #line 744 "grammar.y"
1682 1.1 christos {
1683 1.1 christos char *s;
1684 1.1 christos if ((s = implied_typedef()) == 0)
1685 1.1 christos (void)sprintf(s = buf, "enum %s", yystack.l_mark[-1].text.text);
1686 1.1 christos new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-2].text.begin, DS_NONE);
1687 1.1 christos }
1688 1.1 christos break;
1689 1.1 christos case 74:
1690 1.1 christos #line 751 "grammar.y"
1691 1.1 christos {
1692 1.1 christos char *s;
1693 1.1 christos if ((s = implied_typedef()) == 0)
1694 1.1 christos (void)sprintf(s = buf, "%s {}", yystack.l_mark[-1].text.text);
1695 1.1 christos new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-1].text.begin, DS_NONE);
1696 1.1 christos }
1697 1.1 christos break;
1698 1.1 christos case 75:
1699 1.1 christos #line 758 "grammar.y"
1700 1.1 christos {
1701 1.1 christos (void)sprintf(buf, "enum %s", yystack.l_mark[0].text.text);
1702 1.1 christos new_decl_spec(&yyval.decl_spec, buf, yystack.l_mark[-1].text.begin, DS_NONE);
1703 1.1 christos }
1704 1.1 christos break;
1705 1.1 christos case 76:
1706 1.1 christos #line 766 "grammar.y"
1707 1.1 christos {
1708 1.1 christos imply_typedef("enum");
1709 1.1 christos yyval.text = yystack.l_mark[0].text;
1710 1.1 christos }
1711 1.1 christos break;
1712 1.1 christos case 79:
1713 1.1 christos #line 779 "grammar.y"
1714 1.1 christos {
1715 1.1 christos yyval.declarator = yystack.l_mark[0].declarator;
1716 1.1 christos (void)sprintf(buf, "%s%s", yystack.l_mark[-1].text.text, yyval.declarator->text);
1717 1.1 christos free(yyval.declarator->text);
1718 1.1 christos yyval.declarator->text = xstrdup(buf);
1719 1.1 christos yyval.declarator->begin = yystack.l_mark[-1].text.begin;
1720 1.1 christos yyval.declarator->pointer = TRUE;
1721 1.1 christos }
1722 1.1 christos break;
1723 1.1 christos case 81:
1724 1.1 christos #line 792 "grammar.y"
1725 1.1 christos {
1726 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);
1727 1.1 christos }
1728 1.1 christos break;
1729 1.1 christos case 82:
1730 1.1 christos #line 796 "grammar.y"
1731 1.1 christos {
1732 1.1 christos yyval.declarator = yystack.l_mark[-1].declarator;
1733 1.1 christos (void)sprintf(buf, "(%s)", yyval.declarator->text);
1734 1.1 christos free(yyval.declarator->text);
1735 1.1 christos yyval.declarator->text = xstrdup(buf);
1736 1.1 christos yyval.declarator->begin = yystack.l_mark[-2].text.begin;
1737 1.1 christos }
1738 1.1 christos break;
1739 1.1 christos case 83:
1740 1.1 christos #line 804 "grammar.y"
1741 1.1 christos {
1742 1.1 christos yyval.declarator = yystack.l_mark[-1].declarator;
1743 1.1 christos (void)sprintf(buf, "%s%s", yyval.declarator->text, yystack.l_mark[0].text.text);
1744 1.1 christos free(yyval.declarator->text);
1745 1.1 christos yyval.declarator->text = xstrdup(buf);
1746 1.1 christos }
1747 1.1 christos break;
1748 1.1 christos case 84:
1749 1.1 christos #line 811 "grammar.y"
1750 1.1 christos {
1751 1.1 christos yyval.declarator = new_declarator("%s()", yystack.l_mark[-3].declarator->name, yystack.l_mark[-3].declarator->begin);
1752 1.1 christos yyval.declarator->params = yystack.l_mark[-1].param_list;
1753 1.1 christos yyval.declarator->func_stack = yystack.l_mark[-3].declarator;
1754 1.1 christos yyval.declarator->head = (yystack.l_mark[-3].declarator->func_stack == NULL) ? yyval.declarator : yystack.l_mark[-3].declarator->head;
1755 1.1 christos yyval.declarator->func_def = FUNC_ANSI;
1756 1.1 christos }
1757 1.1 christos break;
1758 1.1 christos case 85:
1759 1.1 christos #line 819 "grammar.y"
1760 1.1 christos {
1761 1.1 christos yyval.declarator = new_declarator("%s()", yystack.l_mark[-3].declarator->name, yystack.l_mark[-3].declarator->begin);
1762 1.1 christos yyval.declarator->params = yystack.l_mark[-1].param_list;
1763 1.1 christos yyval.declarator->func_stack = yystack.l_mark[-3].declarator;
1764 1.1 christos yyval.declarator->head = (yystack.l_mark[-3].declarator->func_stack == NULL) ? yyval.declarator : yystack.l_mark[-3].declarator->head;
1765 1.1 christos yyval.declarator->func_def = FUNC_TRADITIONAL;
1766 1.1 christos }
1767 1.1 christos break;
1768 1.1 christos case 86:
1769 1.1 christos #line 830 "grammar.y"
1770 1.1 christos {
1771 1.1 christos (void)sprintf(yyval.text.text, "*%s", yystack.l_mark[0].text.text);
1772 1.1 christos yyval.text.begin = yystack.l_mark[-1].text.begin;
1773 1.1 christos }
1774 1.1 christos break;
1775 1.1 christos case 87:
1776 1.1 christos #line 835 "grammar.y"
1777 1.1 christos {
1778 1.1 christos (void)sprintf(yyval.text.text, "*%s%s", yystack.l_mark[-1].text.text, yystack.l_mark[0].text.text);
1779 1.1 christos yyval.text.begin = yystack.l_mark[-2].text.begin;
1780 1.1 christos }
1781 1.1 christos break;
1782 1.1 christos case 88:
1783 1.1 christos #line 843 "grammar.y"
1784 1.1 christos {
1785 1.1 christos strcpy(yyval.text.text, "");
1786 1.1 christos yyval.text.begin = 0L;
1787 1.1 christos }
1788 1.1 christos break;
1789 1.1 christos case 90:
1790 1.1 christos #line 852 "grammar.y"
1791 1.1 christos {
1792 1.1 christos (void)sprintf(yyval.text.text, "%s ", yystack.l_mark[0].decl_spec.text);
1793 1.1 christos yyval.text.begin = yystack.l_mark[0].decl_spec.begin;
1794 1.1 christos free(yystack.l_mark[0].decl_spec.text);
1795 1.1 christos }
1796 1.1 christos break;
1797 1.1 christos case 91:
1798 1.1 christos #line 858 "grammar.y"
1799 1.1 christos {
1800 1.1 christos (void)sprintf(yyval.text.text, "%s%s ", yystack.l_mark[-1].text.text, yystack.l_mark[0].decl_spec.text);
1801 1.1 christos yyval.text.begin = yystack.l_mark[-1].text.begin;
1802 1.1 christos free(yystack.l_mark[0].decl_spec.text);
1803 1.1 christos }
1804 1.1 christos break;
1805 1.1 christos case 93:
1806 1.1 christos #line 868 "grammar.y"
1807 1.1 christos {
1808 1.1 christos add_ident_list(&yyval.param_list, &yystack.l_mark[-2].param_list, "...");
1809 1.1 christos }
1810 1.1 christos break;
1811 1.1 christos case 94:
1812 1.1 christos #line 875 "grammar.y"
1813 1.1 christos {
1814 1.1 christos new_param_list(&yyval.param_list, yystack.l_mark[0].parameter);
1815 1.1 christos }
1816 1.1 christos break;
1817 1.1 christos case 95:
1818 1.1 christos #line 879 "grammar.y"
1819 1.1 christos {
1820 1.1 christos add_param_list(&yyval.param_list, &yystack.l_mark[-2].param_list, yystack.l_mark[0].parameter);
1821 1.1 christos }
1822 1.1 christos break;
1823 1.1 christos case 96:
1824 1.1 christos #line 886 "grammar.y"
1825 1.1 christos {
1826 1.1 christos check_untagged(&yystack.l_mark[-1].decl_spec);
1827 1.1 christos yyval.parameter = new_parameter(&yystack.l_mark[-1].decl_spec, yystack.l_mark[0].declarator);
1828 1.1 christos }
1829 1.1 christos break;
1830 1.1 christos case 97:
1831 1.1 christos #line 891 "grammar.y"
1832 1.1 christos {
1833 1.1 christos check_untagged(&yystack.l_mark[-1].decl_spec);
1834 1.1 christos yyval.parameter = new_parameter(&yystack.l_mark[-1].decl_spec, yystack.l_mark[0].declarator);
1835 1.1 christos }
1836 1.1 christos break;
1837 1.1 christos case 98:
1838 1.1 christos #line 896 "grammar.y"
1839 1.1 christos {
1840 1.1 christos check_untagged(&yystack.l_mark[0].decl_spec);
1841 1.1 christos yyval.parameter = new_parameter(&yystack.l_mark[0].decl_spec, (Declarator *)0);
1842 1.1 christos }
1843 1.1 christos break;
1844 1.1 christos case 99:
1845 1.1 christos #line 904 "grammar.y"
1846 1.1 christos {
1847 1.1 christos new_ident_list(&yyval.param_list);
1848 1.1 christos }
1849 1.1 christos break;
1850 1.1 christos case 101:
1851 1.1 christos #line 912 "grammar.y"
1852 1.1 christos {
1853 1.1 christos new_ident_list(&yyval.param_list);
1854 1.1 christos add_ident_list(&yyval.param_list, &yyval.param_list, yystack.l_mark[0].text.text);
1855 1.1 christos }
1856 1.1 christos break;
1857 1.1 christos case 102:
1858 1.1 christos #line 917 "grammar.y"
1859 1.1 christos {
1860 1.1 christos add_ident_list(&yyval.param_list, &yystack.l_mark[-2].param_list, yystack.l_mark[0].text.text);
1861 1.1 christos }
1862 1.1 christos break;
1863 1.1 christos case 103:
1864 1.1 christos #line 924 "grammar.y"
1865 1.1 christos {
1866 1.1 christos yyval.text = yystack.l_mark[0].text;
1867 1.1 christos }
1868 1.1 christos break;
1869 1.1 christos case 104:
1870 1.1 christos #line 928 "grammar.y"
1871 1.1 christos {
1872 1.1 christos #if OPT_LINTLIBRARY
1873 1.1 christos if (lintLibrary()) { /* Lint doesn't grok C++ ref variables */
1874 1.1 christos yyval.text = yystack.l_mark[0].text;
1875 1.1 christos } else
1876 1.1 christos #endif
1877 1.1 christos (void)sprintf(yyval.text.text, "&%s", yystack.l_mark[0].text.text);
1878 1.1 christos yyval.text.begin = yystack.l_mark[-1].text.begin;
1879 1.1 christos }
1880 1.1 christos break;
1881 1.1 christos case 105:
1882 1.1 christos #line 941 "grammar.y"
1883 1.1 christos {
1884 1.1 christos yyval.declarator = new_declarator(yystack.l_mark[0].text.text, "", yystack.l_mark[0].text.begin);
1885 1.1 christos }
1886 1.1 christos break;
1887 1.1 christos case 106:
1888 1.1 christos #line 945 "grammar.y"
1889 1.1 christos {
1890 1.1 christos yyval.declarator = yystack.l_mark[0].declarator;
1891 1.1 christos (void)sprintf(buf, "%s%s", yystack.l_mark[-1].text.text, yyval.declarator->text);
1892 1.1 christos free(yyval.declarator->text);
1893 1.1 christos yyval.declarator->text = xstrdup(buf);
1894 1.1 christos yyval.declarator->begin = yystack.l_mark[-1].text.begin;
1895 1.1 christos }
1896 1.1 christos break;
1897 1.1 christos case 108:
1898 1.1 christos #line 957 "grammar.y"
1899 1.1 christos {
1900 1.1 christos yyval.declarator = yystack.l_mark[-1].declarator;
1901 1.1 christos (void)sprintf(buf, "(%s)", yyval.declarator->text);
1902 1.1 christos free(yyval.declarator->text);
1903 1.1 christos yyval.declarator->text = xstrdup(buf);
1904 1.1 christos yyval.declarator->begin = yystack.l_mark[-2].text.begin;
1905 1.1 christos }
1906 1.1 christos break;
1907 1.1 christos case 109:
1908 1.1 christos #line 965 "grammar.y"
1909 1.1 christos {
1910 1.1 christos yyval.declarator = yystack.l_mark[-1].declarator;
1911 1.1 christos (void)sprintf(buf, "%s%s", yyval.declarator->text, yystack.l_mark[0].text.text);
1912 1.1 christos free(yyval.declarator->text);
1913 1.1 christos yyval.declarator->text = xstrdup(buf);
1914 1.1 christos }
1915 1.1 christos break;
1916 1.1 christos case 110:
1917 1.1 christos #line 972 "grammar.y"
1918 1.1 christos {
1919 1.1 christos yyval.declarator = new_declarator(yystack.l_mark[0].text.text, "", yystack.l_mark[0].text.begin);
1920 1.1 christos }
1921 1.1 christos break;
1922 1.1 christos case 111:
1923 1.1 christos #line 976 "grammar.y"
1924 1.1 christos {
1925 1.1 christos yyval.declarator = new_declarator("%s()", "", yystack.l_mark[-3].declarator->begin);
1926 1.1 christos yyval.declarator->params = yystack.l_mark[-1].param_list;
1927 1.1 christos yyval.declarator->func_stack = yystack.l_mark[-3].declarator;
1928 1.1 christos yyval.declarator->head = (yystack.l_mark[-3].declarator->func_stack == NULL) ? yyval.declarator : yystack.l_mark[-3].declarator->head;
1929 1.1 christos yyval.declarator->func_def = FUNC_ANSI;
1930 1.1 christos }
1931 1.1 christos break;
1932 1.1 christos case 112:
1933 1.1 christos #line 984 "grammar.y"
1934 1.1 christos {
1935 1.1 christos yyval.declarator = new_declarator("%s()", "", yystack.l_mark[-2].declarator->begin);
1936 1.1 christos yyval.declarator->func_stack = yystack.l_mark[-2].declarator;
1937 1.1 christos yyval.declarator->head = (yystack.l_mark[-2].declarator->func_stack == NULL) ? yyval.declarator : yystack.l_mark[-2].declarator->head;
1938 1.1 christos yyval.declarator->func_def = FUNC_ANSI;
1939 1.1 christos }
1940 1.1 christos break;
1941 1.1 christos case 113:
1942 1.1 christos #line 991 "grammar.y"
1943 1.1 christos {
1944 1.1 christos Declarator *d;
1945 1.1 christos
1946 1.1 christos d = new_declarator("", "", yystack.l_mark[-2].text.begin);
1947 1.1 christos yyval.declarator = new_declarator("%s()", "", yystack.l_mark[-2].text.begin);
1948 1.1 christos yyval.declarator->params = yystack.l_mark[-1].param_list;
1949 1.1 christos yyval.declarator->func_stack = d;
1950 1.1 christos yyval.declarator->head = yyval.declarator;
1951 1.1 christos yyval.declarator->func_def = FUNC_ANSI;
1952 1.1 christos }
1953 1.1 christos break;
1954 1.1 christos case 114:
1955 1.1 christos #line 1002 "grammar.y"
1956 1.1 christos {
1957 1.1 christos Declarator *d;
1958 1.1 christos
1959 1.1 christos d = new_declarator("", "", yystack.l_mark[-1].text.begin);
1960 1.1 christos yyval.declarator = new_declarator("%s()", "", yystack.l_mark[-1].text.begin);
1961 1.1 christos yyval.declarator->func_stack = d;
1962 1.1 christos yyval.declarator->head = yyval.declarator;
1963 1.1 christos yyval.declarator->func_def = FUNC_ANSI;
1964 1.1 christos }
1965 1.1 christos break;
1966 1.1.1.3.2.1 pgoyette #line 1965 "grammar.tab.c"
1967 1.1 christos }
1968 1.1 christos yystack.s_mark -= yym;
1969 1.1 christos yystate = *yystack.s_mark;
1970 1.1 christos yystack.l_mark -= yym;
1971 1.1 christos yym = yylhs[yyn];
1972 1.1 christos if (yystate == 0 && yym == 0)
1973 1.1 christos {
1974 1.1 christos #if YYDEBUG
1975 1.1 christos if (yydebug)
1976 1.1 christos printf("%sdebug: after reduction, shifting from state 0 to\
1977 1.1 christos state %d\n", YYPREFIX, YYFINAL);
1978 1.1 christos #endif
1979 1.1 christos yystate = YYFINAL;
1980 1.1 christos *++yystack.s_mark = YYFINAL;
1981 1.1 christos *++yystack.l_mark = yyval;
1982 1.1 christos if (yychar < 0)
1983 1.1 christos {
1984 1.1.1.3.2.1 pgoyette yychar = YYLEX;
1985 1.1.1.3.2.1 pgoyette if (yychar < 0) yychar = YYEOF;
1986 1.1 christos #if YYDEBUG
1987 1.1 christos if (yydebug)
1988 1.1 christos {
1989 1.1.1.3.2.1 pgoyette if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
1990 1.1 christos printf("%sdebug: state %d, reading %d (%s)\n",
1991 1.1 christos YYPREFIX, YYFINAL, yychar, yys);
1992 1.1 christos }
1993 1.1 christos #endif
1994 1.1 christos }
1995 1.1 christos if (yychar == YYEOF) goto yyaccept;
1996 1.1 christos goto yyloop;
1997 1.1 christos }
1998 1.1.1.3.2.1 pgoyette if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
1999 1.1.1.3.2.1 pgoyette yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
2000 1.1 christos yystate = yytable[yyn];
2001 1.1 christos else
2002 1.1 christos yystate = yydgoto[yym];
2003 1.1 christos #if YYDEBUG
2004 1.1 christos if (yydebug)
2005 1.1 christos printf("%sdebug: after reduction, shifting from state %d \
2006 1.1 christos to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
2007 1.1 christos #endif
2008 1.1.1.3.2.1 pgoyette if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
2009 1.1 christos *++yystack.s_mark = (YYINT) yystate;
2010 1.1 christos *++yystack.l_mark = yyval;
2011 1.1 christos goto yyloop;
2012 1.1 christos
2013 1.1 christos yyoverflow:
2014 1.1 christos YYERROR_CALL("yacc stack overflow");
2015 1.1 christos
2016 1.1 christos yyabort:
2017 1.1 christos yyfreestack(&yystack);
2018 1.1 christos return (1);
2019 1.1 christos
2020 1.1 christos yyaccept:
2021 1.1 christos yyfreestack(&yystack);
2022 1.1 christos return (0);
2023 1.1 christos }
2024