update generated files
[binutils.git] / binutils / defparse.c
blob42f0c9d342ca96754c44e649d790476c42174d50
2 /* A Bison parser, made from defparse.y
3 by GNU Bison version 1.28 */
5 #define YYBISON 1 /* Identify Bison output. */
7 #define NAME 257
8 #define LIBRARY 258
9 #define DESCRIPTION 259
10 #define STACKSIZE 260
11 #define HEAPSIZE 261
12 #define CODE 262
13 #define DATA 263
14 #define SECTIONS 264
15 #define EXPORTS 265
16 #define IMPORTS 266
17 #define VERSIONK 267
18 #define BASE 268
19 #define CONSTANT 269
20 #define READ 270
21 #define WRITE 271
22 #define EXECUTE 272
23 #define SHARED 273
24 #define NONSHARED 274
25 #define NONAME 275
26 #define SINGLE 276
27 #define MULTIPLE 277
28 #define INITINSTANCE 278
29 #define INITGLOBAL 279
30 #define TERMINSTANCE 280
31 #define TERMGLOBAL 281
32 #define ID 282
33 #define NUMBER 283
35 #line 1 "defparse.y"
36 /* defparse.y - parser for .def files */
38 /* Copyright 1995, 1997, 1998, 1999 Free Software Foundation, Inc.
40 This file is part of GNU Binutils.
42 This program is free software; you can redistribute it and/or modify
43 it under the terms of the GNU General Public License as published by
44 the Free Software Foundation; either version 2 of the License, or
45 (at your option) any later version.
47 This program is distributed in the hope that it will be useful,
48 but WITHOUT ANY WARRANTY; without even the implied warranty of
49 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50 GNU General Public License for more details.
52 You should have received a copy of the GNU General Public License
53 along with this program; if not, write to the Free Software
54 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
56 #include "bfd.h"
57 #include "bucomm.h"
58 #include "dlltool.h"
60 #line 26 "defparse.y"
61 typedef union {
62 char *id;
63 int number;
64 } YYSTYPE;
65 #include <stdio.h>
67 #ifndef __cplusplus
68 #ifndef __STDC__
69 #define const
70 #endif
71 #endif
75 #define YYFINAL 94
76 #define YYFLAG -32768
77 #define YYNTBASE 34
79 #define YYTRANSLATE(x) ((unsigned)(x) <= 283 ? yytranslate[x] : 55)
81 static const char yytranslate[] = { 0,
82 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
83 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
84 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
85 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
86 2, 2, 2, 32, 2, 30, 2, 2, 2, 2,
87 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
88 31, 2, 2, 33, 2, 2, 2, 2, 2, 2,
89 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
90 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
91 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
92 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
93 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
94 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
95 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
96 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
97 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
98 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
99 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
100 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
101 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
102 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
103 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
104 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
105 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
106 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
107 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
108 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
109 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
110 27, 28, 29
113 #if YYDEBUG != 0
114 static const short yyprhs[] = { 0,
115 0, 3, 5, 9, 14, 17, 20, 24, 28, 31,
116 34, 37, 40, 43, 48, 49, 52, 59, 62, 64,
117 72, 80, 86, 92, 98, 104, 108, 112, 115, 117,
118 120, 124, 126, 128, 129, 132, 133, 135, 137, 139,
119 141, 143, 145, 147, 149, 150, 152, 153, 155, 156,
120 158, 162, 163, 166, 167, 170, 171, 175, 176, 177,
121 181, 183, 185, 187
124 static const short yyrhs[] = { 34,
125 35, 0, 35, 0, 3, 49, 52, 0, 4, 49,
126 52, 53, 0, 11, 36, 0, 5, 28, 0, 6,
127 29, 44, 0, 7, 29, 44, 0, 8, 42, 0,
128 9, 42, 0, 10, 40, 0, 12, 38, 0, 13,
129 29, 0, 13, 29, 30, 29, 0, 0, 36, 37,
130 0, 28, 51, 50, 47, 46, 48, 0, 38, 39,
131 0, 39, 0, 28, 31, 28, 30, 28, 30, 28,
132 0, 28, 31, 28, 30, 28, 30, 29, 0, 28,
133 31, 28, 30, 28, 0, 28, 31, 28, 30, 29,
134 0, 28, 30, 28, 30, 28, 0, 28, 30, 28,
135 30, 29, 0, 28, 30, 28, 0, 28, 30, 29,
136 0, 40, 41, 0, 41, 0, 28, 42, 0, 42,
137 43, 45, 0, 45, 0, 32, 0, 0, 32, 29,
138 0, 0, 16, 0, 17, 0, 18, 0, 19, 0,
139 20, 0, 22, 0, 23, 0, 15, 0, 0, 21,
140 0, 0, 9, 0, 0, 28, 0, 28, 30, 28,
141 0, 0, 33, 29, 0, 0, 31, 28, 0, 0,
142 14, 31, 29, 0, 0, 0, 53, 43, 54, 0,
143 24, 0, 25, 0, 26, 0, 27, 0
146 #endif
148 #if YYDEBUG != 0
149 static const short yyrline[] = { 0,
150 43, 44, 47, 49, 50, 51, 52, 53, 54, 55,
151 56, 57, 58, 59, 63, 65, 68, 72, 74, 77,
152 79, 80, 81, 82, 83, 84, 85, 88, 90, 93,
153 97, 99, 102, 104, 106, 107, 110, 112, 113, 114,
154 115, 116, 117, 120, 122, 125, 127, 130, 132, 135,
155 136, 142, 145, 147, 150, 152, 155, 156, 159, 161,
156 164, 166, 167, 168
158 #endif
161 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
163 static const char * const yytname[] = { "$","error","$undefined.","NAME","LIBRARY",
164 "DESCRIPTION","STACKSIZE","HEAPSIZE","CODE","DATA","SECTIONS","EXPORTS","IMPORTS",
165 "VERSIONK","BASE","CONSTANT","READ","WRITE","EXECUTE","SHARED","NONSHARED","NONAME",
166 "SINGLE","MULTIPLE","INITINSTANCE","INITGLOBAL","TERMINSTANCE","TERMGLOBAL",
167 "ID","NUMBER","'.'","'='","','","'@'","start","command","explist","expline",
168 "implist","impline","seclist","secline","attr_list","opt_comma","opt_number",
169 "attr","opt_CONSTANT","opt_NONAME","opt_DATA","opt_name","opt_ordinal","opt_equal_name",
170 "opt_base","option_list","option", NULL
172 #endif
174 static const short yyr1[] = { 0,
175 34, 34, 35, 35, 35, 35, 35, 35, 35, 35,
176 35, 35, 35, 35, 36, 36, 37, 38, 38, 39,
177 39, 39, 39, 39, 39, 39, 39, 40, 40, 41,
178 42, 42, 43, 43, 44, 44, 45, 45, 45, 45,
179 45, 45, 45, 46, 46, 47, 47, 48, 48, 49,
180 49, 49, 50, 50, 51, 51, 52, 52, 53, 53,
181 54, 54, 54, 54
184 static const short yyr2[] = { 0,
185 2, 1, 3, 4, 2, 2, 3, 3, 2, 2,
186 2, 2, 2, 4, 0, 2, 6, 2, 1, 7,
187 7, 5, 5, 5, 5, 3, 3, 2, 1, 2,
188 3, 1, 1, 0, 2, 0, 1, 1, 1, 1,
189 1, 1, 1, 1, 0, 1, 0, 1, 0, 1,
190 3, 0, 2, 0, 2, 0, 3, 0, 0, 3,
191 1, 1, 1, 1
194 static const short yydefact[] = { 0,
195 52, 52, 0, 0, 0, 0, 0, 0, 15, 0,
196 0, 0, 2, 50, 58, 58, 6, 36, 36, 37,
197 38, 39, 40, 41, 42, 43, 9, 32, 10, 0,
198 11, 29, 5, 0, 12, 19, 13, 1, 0, 0,
199 3, 59, 0, 7, 8, 33, 0, 30, 28, 56,
200 16, 0, 0, 18, 0, 51, 0, 4, 35, 31,
201 0, 54, 26, 27, 0, 14, 57, 0, 55, 0,
202 47, 0, 0, 61, 62, 63, 64, 60, 53, 46,
203 45, 24, 25, 22, 23, 44, 49, 0, 48, 17,
204 20, 21, 0, 0
207 static const short yydefgoto[] = { 12,
208 13, 33, 51, 35, 36, 31, 32, 27, 47, 44,
209 28, 87, 81, 90, 15, 71, 62, 41, 58, 78
212 static const short yypact[] = { 32,
213 -22, -22, -19, -13, 22, 30, 30, -6,-32768, 26,
214 38, 21,-32768, 29, 46, 46,-32768, 36, 36,-32768,
215 -32768,-32768,-32768,-32768,-32768,-32768, -15,-32768, -15, 30,
216 -6,-32768, 41, -16, 26,-32768, 40,-32768, 43, 42,
217 -32768,-32768, 45,-32768,-32768,-32768, 30, -15,-32768, 44,
218 -32768, -9, 48,-32768, 49,-32768, 50, -14,-32768,-32768,
219 52, 39, 47,-32768, 51,-32768,-32768, 31,-32768, 53,
220 62, 33, 35,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
221 69,-32768,-32768, 55,-32768,-32768, 77, 37,-32768,-32768,
222 -32768,-32768, 87,-32768
225 static const short yypgoto[] = {-32768,
226 76,-32768,-32768,-32768, 54,-32768, 59, -7, 34, 72,
227 56,-32768,-32768,-32768, 91,-32768,-32768, 78,-32768,-32768
231 #define YYLAST 103
234 static const short yytable[] = { 29,
235 -34, -34, -34, -34, -34, 14, -34, -34, 17, -34,
236 -34, -34, -34, 52, 53, 18, 46, 46, 63, 64,
237 93, 30, 48, 1, 2, 3, 4, 5, 6, 7,
238 8, 9, 10, 11, 1, 2, 3, 4, 5, 6,
239 7, 8, 9, 10, 11, 20, 21, 22, 23, 24,
240 19, 25, 26, 34, 74, 75, 76, 77, 39, 40,
241 82, 83, 84, 85, 91, 92, 37, 43, 50, 55,
242 56, 70, 57, 59, 61, 65, 72, 66, 67, 69,
243 73, 79, 80, 86, 88, 89, 94, 38, 54, 49,
244 45, 68, 16, 42, 0, 0, 0, 0, 0, 0,
245 0, 0, 60
248 static const short yycheck[] = { 7,
249 16, 17, 18, 19, 20, 28, 22, 23, 28, 24,
250 25, 26, 27, 30, 31, 29, 32, 32, 28, 29,
251 0, 28, 30, 3, 4, 5, 6, 7, 8, 9,
252 10, 11, 12, 13, 3, 4, 5, 6, 7, 8,
253 9, 10, 11, 12, 13, 16, 17, 18, 19, 20,
254 29, 22, 23, 28, 24, 25, 26, 27, 30, 14,
255 28, 29, 28, 29, 28, 29, 29, 32, 28, 30,
256 28, 33, 31, 29, 31, 28, 30, 29, 29, 28,
257 30, 29, 21, 15, 30, 9, 0, 12, 35, 31,
258 19, 58, 2, 16, -1, -1, -1, -1, -1, -1,
259 -1, -1, 47
261 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
262 #line 3 "/usr/share/bison/bison.simple"
263 /* This file comes from bison-1.28. */
265 /* Skeleton output parser for bison,
266 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
268 This program is free software; you can redistribute it and/or modify
269 it under the terms of the GNU General Public License as published by
270 the Free Software Foundation; either version 2, or (at your option)
271 any later version.
273 This program is distributed in the hope that it will be useful,
274 but WITHOUT ANY WARRANTY; without even the implied warranty of
275 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
276 GNU General Public License for more details.
278 You should have received a copy of the GNU General Public License
279 along with this program; if not, write to the Free Software
280 Foundation, Inc., 59 Temple Place - Suite 330,
281 Boston, MA 02111-1307, USA. */
283 /* As a special exception, when this file is copied by Bison into a
284 Bison output file, you may use that output file without restriction.
285 This special exception was added by the Free Software Foundation
286 in version 1.24 of Bison. */
288 /* This is the parser code that is written into each bison parser
289 when the %semantic_parser declaration is not specified in the grammar.
290 It was written by Richard Stallman by simplifying the hairy parser
291 used when %semantic_parser is specified. */
293 #ifndef YYSTACK_USE_ALLOCA
294 #ifdef alloca
295 #define YYSTACK_USE_ALLOCA
296 #else /* alloca not defined */
297 #ifdef __GNUC__
298 #define YYSTACK_USE_ALLOCA
299 #define alloca __builtin_alloca
300 #else /* not GNU C. */
301 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
302 #define YYSTACK_USE_ALLOCA
303 #include <alloca.h>
304 #else /* not sparc */
305 /* We think this test detects Watcom and Microsoft C. */
306 /* This used to test MSDOS, but that is a bad idea
307 since that symbol is in the user namespace. */
308 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
309 #if 0 /* No need for malloc.h, which pollutes the namespace;
310 instead, just don't use alloca. */
311 #include <malloc.h>
312 #endif
313 #else /* not MSDOS, or __TURBOC__ */
314 #if defined(_AIX)
315 /* I don't know what this was needed for, but it pollutes the namespace.
316 So I turned it off. rms, 2 May 1997. */
317 /* #include <malloc.h> */
318 #pragma alloca
319 #define YYSTACK_USE_ALLOCA
320 #else /* not MSDOS, or __TURBOC__, or _AIX */
321 #if 0
322 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
323 and on HPUX 10. Eventually we can turn this on. */
324 #define YYSTACK_USE_ALLOCA
325 #define alloca __builtin_alloca
326 #endif /* __hpux */
327 #endif
328 #endif /* not _AIX */
329 #endif /* not MSDOS, or __TURBOC__ */
330 #endif /* not sparc */
331 #endif /* not GNU C */
332 #endif /* alloca not defined */
333 #endif /* YYSTACK_USE_ALLOCA not defined */
335 #ifdef YYSTACK_USE_ALLOCA
336 #define YYSTACK_ALLOC alloca
337 #else
338 #define YYSTACK_ALLOC malloc
339 #endif
341 /* Note: there must be only one dollar sign in this file.
342 It is replaced by the list of actions, each action
343 as one case of the switch. */
345 #define yyerrok (yyerrstatus = 0)
346 #define yyclearin (yychar = YYEMPTY)
347 #define YYEMPTY -2
348 #define YYEOF 0
349 #define YYACCEPT goto yyacceptlab
350 #define YYABORT goto yyabortlab
351 #define YYERROR goto yyerrlab1
352 /* Like YYERROR except do call yyerror.
353 This remains here temporarily to ease the
354 transition to the new meaning of YYERROR, for GCC.
355 Once GCC version 2 has supplanted version 1, this can go. */
356 #define YYFAIL goto yyerrlab
357 #define YYRECOVERING() (!!yyerrstatus)
358 #define YYBACKUP(token, value) \
359 do \
360 if (yychar == YYEMPTY && yylen == 1) \
361 { yychar = (token), yylval = (value); \
362 yychar1 = YYTRANSLATE (yychar); \
363 YYPOPSTACK; \
364 goto yybackup; \
366 else \
367 { yyerror ("syntax error: cannot back up"); YYERROR; } \
368 while (0)
370 #define YYTERROR 1
371 #define YYERRCODE 256
373 #ifndef YYPURE
374 #define YYLEX yylex()
375 #endif
377 #ifdef YYPURE
378 #ifdef YYLSP_NEEDED
379 #ifdef YYLEX_PARAM
380 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
381 #else
382 #define YYLEX yylex(&yylval, &yylloc)
383 #endif
384 #else /* not YYLSP_NEEDED */
385 #ifdef YYLEX_PARAM
386 #define YYLEX yylex(&yylval, YYLEX_PARAM)
387 #else
388 #define YYLEX yylex(&yylval)
389 #endif
390 #endif /* not YYLSP_NEEDED */
391 #endif
393 /* If nonreentrant, generate the variables here */
395 #ifndef YYPURE
397 int yychar; /* the lookahead symbol */
398 YYSTYPE yylval; /* the semantic value of the */
399 /* lookahead symbol */
401 #ifdef YYLSP_NEEDED
402 YYLTYPE yylloc; /* location data for the lookahead */
403 /* symbol */
404 #endif
406 int yynerrs; /* number of parse errors so far */
407 #endif /* not YYPURE */
409 #if YYDEBUG != 0
410 int yydebug; /* nonzero means print parse trace */
411 /* Since this is uninitialized, it does not stop multiple parsers
412 from coexisting. */
413 #endif
415 /* YYINITDEPTH indicates the initial size of the parser's stacks */
417 #ifndef YYINITDEPTH
418 #define YYINITDEPTH 200
419 #endif
421 /* YYMAXDEPTH is the maximum size the stacks can grow to
422 (effective only if the built-in stack extension method is used). */
424 #if YYMAXDEPTH == 0
425 #undef YYMAXDEPTH
426 #endif
428 #ifndef YYMAXDEPTH
429 #define YYMAXDEPTH 10000
430 #endif
432 /* Define __yy_memcpy. Note that the size argument
433 should be passed with type unsigned int, because that is what the non-GCC
434 definitions require. With GCC, __builtin_memcpy takes an arg
435 of type size_t, but it can handle unsigned int. */
437 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
438 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
439 #else /* not GNU C or C++ */
440 #ifndef __cplusplus
442 /* This is the most reliable way to avoid incompatibilities
443 in available built-in functions on various systems. */
444 static void
445 __yy_memcpy (to, from, count)
446 char *to;
447 char *from;
448 unsigned int count;
450 register char *f = from;
451 register char *t = to;
452 register int i = count;
454 while (i-- > 0)
455 *t++ = *f++;
458 #else /* __cplusplus */
460 /* This is the most reliable way to avoid incompatibilities
461 in available built-in functions on various systems. */
462 static void
463 __yy_memcpy (char *to, char *from, unsigned int count)
465 register char *t = to;
466 register char *f = from;
467 register int i = count;
469 while (i-- > 0)
470 *t++ = *f++;
473 #endif
474 #endif
476 #line 217 "/usr/share/bison/bison.simple"
478 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
479 into yyparse. The argument should have type void *.
480 It should actually point to an object.
481 Grammar actions can access the variable by casting it
482 to the proper pointer type. */
484 #ifdef YYPARSE_PARAM
485 #ifdef __cplusplus
486 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
487 #define YYPARSE_PARAM_DECL
488 #else /* not __cplusplus */
489 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
490 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
491 #endif /* not __cplusplus */
492 #else /* not YYPARSE_PARAM */
493 #define YYPARSE_PARAM_ARG
494 #define YYPARSE_PARAM_DECL
495 #endif /* not YYPARSE_PARAM */
497 /* Prevent warning if -Wstrict-prototypes. */
498 #ifdef __GNUC__
499 #ifdef YYPARSE_PARAM
500 int yyparse (void *);
501 #else
502 int yyparse (void);
503 #endif
504 #endif
507 yyparse(YYPARSE_PARAM_ARG)
508 YYPARSE_PARAM_DECL
510 register int yystate;
511 register int yyn;
512 register short *yyssp;
513 register YYSTYPE *yyvsp;
514 int yyerrstatus; /* number of tokens to shift before error messages enabled */
515 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
517 short yyssa[YYINITDEPTH]; /* the state stack */
518 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
520 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
521 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
523 #ifdef YYLSP_NEEDED
524 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
525 YYLTYPE *yyls = yylsa;
526 YYLTYPE *yylsp;
528 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
529 #else
530 #define YYPOPSTACK (yyvsp--, yyssp--)
531 #endif
533 int yystacksize = YYINITDEPTH;
534 int yyfree_stacks = 0;
536 #ifdef YYPURE
537 int yychar;
538 YYSTYPE yylval;
539 int yynerrs;
540 #ifdef YYLSP_NEEDED
541 YYLTYPE yylloc;
542 #endif
543 #endif
545 YYSTYPE yyval; /* the variable used to return */
546 /* semantic values from the action */
547 /* routines */
549 int yylen;
551 #if YYDEBUG != 0
552 if (yydebug)
553 fprintf(stderr, "Starting parse\n");
554 #endif
556 yystate = 0;
557 yyerrstatus = 0;
558 yynerrs = 0;
559 yychar = YYEMPTY; /* Cause a token to be read. */
561 /* Initialize stack pointers.
562 Waste one element of value and location stack
563 so that they stay on the same level as the state stack.
564 The wasted elements are never initialized. */
566 yyssp = yyss - 1;
567 yyvsp = yyvs;
568 #ifdef YYLSP_NEEDED
569 yylsp = yyls;
570 #endif
572 /* Push a new state, which is found in yystate . */
573 /* In all cases, when you get here, the value and location stacks
574 have just been pushed. so pushing a state here evens the stacks. */
575 yynewstate:
577 *++yyssp = yystate;
579 if (yyssp >= yyss + yystacksize - 1)
581 /* Give user a chance to reallocate the stack */
582 /* Use copies of these so that the &'s don't force the real ones into memory. */
583 YYSTYPE *yyvs1 = yyvs;
584 short *yyss1 = yyss;
585 #ifdef YYLSP_NEEDED
586 YYLTYPE *yyls1 = yyls;
587 #endif
589 /* Get the current used size of the three stacks, in elements. */
590 int size = yyssp - yyss + 1;
592 #ifdef yyoverflow
593 /* Each stack pointer address is followed by the size of
594 the data in use in that stack, in bytes. */
595 #ifdef YYLSP_NEEDED
596 /* This used to be a conditional around just the two extra args,
597 but that might be undefined if yyoverflow is a macro. */
598 yyoverflow("parser stack overflow",
599 &yyss1, size * sizeof (*yyssp),
600 &yyvs1, size * sizeof (*yyvsp),
601 &yyls1, size * sizeof (*yylsp),
602 &yystacksize);
603 #else
604 yyoverflow("parser stack overflow",
605 &yyss1, size * sizeof (*yyssp),
606 &yyvs1, size * sizeof (*yyvsp),
607 &yystacksize);
608 #endif
610 yyss = yyss1; yyvs = yyvs1;
611 #ifdef YYLSP_NEEDED
612 yyls = yyls1;
613 #endif
614 #else /* no yyoverflow */
615 /* Extend the stack our own way. */
616 if (yystacksize >= YYMAXDEPTH)
618 yyerror("parser stack overflow");
619 if (yyfree_stacks)
621 free (yyss);
622 free (yyvs);
623 #ifdef YYLSP_NEEDED
624 free (yyls);
625 #endif
627 return 2;
629 yystacksize *= 2;
630 if (yystacksize > YYMAXDEPTH)
631 yystacksize = YYMAXDEPTH;
632 #ifndef YYSTACK_USE_ALLOCA
633 yyfree_stacks = 1;
634 #endif
635 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
636 __yy_memcpy ((char *)yyss, (char *)yyss1,
637 size * (unsigned int) sizeof (*yyssp));
638 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
639 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
640 size * (unsigned int) sizeof (*yyvsp));
641 #ifdef YYLSP_NEEDED
642 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
643 __yy_memcpy ((char *)yyls, (char *)yyls1,
644 size * (unsigned int) sizeof (*yylsp));
645 #endif
646 #endif /* no yyoverflow */
648 yyssp = yyss + size - 1;
649 yyvsp = yyvs + size - 1;
650 #ifdef YYLSP_NEEDED
651 yylsp = yyls + size - 1;
652 #endif
654 #if YYDEBUG != 0
655 if (yydebug)
656 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
657 #endif
659 if (yyssp >= yyss + yystacksize - 1)
660 YYABORT;
663 #if YYDEBUG != 0
664 if (yydebug)
665 fprintf(stderr, "Entering state %d\n", yystate);
666 #endif
668 goto yybackup;
669 yybackup:
671 /* Do appropriate processing given the current state. */
672 /* Read a lookahead token if we need one and don't already have one. */
673 /* yyresume: */
675 /* First try to decide what to do without reference to lookahead token. */
677 yyn = yypact[yystate];
678 if (yyn == YYFLAG)
679 goto yydefault;
681 /* Not known => get a lookahead token if don't already have one. */
683 /* yychar is either YYEMPTY or YYEOF
684 or a valid token in external form. */
686 if (yychar == YYEMPTY)
688 #if YYDEBUG != 0
689 if (yydebug)
690 fprintf(stderr, "Reading a token: ");
691 #endif
692 yychar = YYLEX;
695 /* Convert token to internal form (in yychar1) for indexing tables with */
697 if (yychar <= 0) /* This means end of input. */
699 yychar1 = 0;
700 yychar = YYEOF; /* Don't call YYLEX any more */
702 #if YYDEBUG != 0
703 if (yydebug)
704 fprintf(stderr, "Now at end of input.\n");
705 #endif
707 else
709 yychar1 = YYTRANSLATE(yychar);
711 #if YYDEBUG != 0
712 if (yydebug)
714 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
715 /* Give the individual parser a way to print the precise meaning
716 of a token, for further debugging info. */
717 #ifdef YYPRINT
718 YYPRINT (stderr, yychar, yylval);
719 #endif
720 fprintf (stderr, ")\n");
722 #endif
725 yyn += yychar1;
726 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
727 goto yydefault;
729 yyn = yytable[yyn];
731 /* yyn is what to do for this token type in this state.
732 Negative => reduce, -yyn is rule number.
733 Positive => shift, yyn is new state.
734 New state is final state => don't bother to shift,
735 just return success.
736 0, or most negative number => error. */
738 if (yyn < 0)
740 if (yyn == YYFLAG)
741 goto yyerrlab;
742 yyn = -yyn;
743 goto yyreduce;
745 else if (yyn == 0)
746 goto yyerrlab;
748 if (yyn == YYFINAL)
749 YYACCEPT;
751 /* Shift the lookahead token. */
753 #if YYDEBUG != 0
754 if (yydebug)
755 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
756 #endif
758 /* Discard the token being shifted unless it is eof. */
759 if (yychar != YYEOF)
760 yychar = YYEMPTY;
762 *++yyvsp = yylval;
763 #ifdef YYLSP_NEEDED
764 *++yylsp = yylloc;
765 #endif
767 /* count tokens shifted since error; after three, turn off error status. */
768 if (yyerrstatus) yyerrstatus--;
770 yystate = yyn;
771 goto yynewstate;
773 /* Do the default action for the current state. */
774 yydefault:
776 yyn = yydefact[yystate];
777 if (yyn == 0)
778 goto yyerrlab;
780 /* Do a reduction. yyn is the number of a rule to reduce with. */
781 yyreduce:
782 yylen = yyr2[yyn];
783 if (yylen > 0)
784 yyval = yyvsp[1-yylen]; /* implement default value of the action */
786 #if YYDEBUG != 0
787 if (yydebug)
789 int i;
791 fprintf (stderr, "Reducing via rule %d (line %d), ",
792 yyn, yyrline[yyn]);
794 /* Print the symbols being reduced, and their result. */
795 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
796 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
797 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
799 #endif
802 switch (yyn) {
804 case 3:
805 #line 48 "defparse.y"
806 { def_name (yyvsp[-1].id, yyvsp[0].number); ;
807 break;}
808 case 4:
809 #line 49 "defparse.y"
810 { def_library (yyvsp[-2].id, yyvsp[-1].number); ;
811 break;}
812 case 6:
813 #line 51 "defparse.y"
814 { def_description (yyvsp[0].id);;
815 break;}
816 case 7:
817 #line 52 "defparse.y"
818 { def_stacksize (yyvsp[-1].number, yyvsp[0].number);;
819 break;}
820 case 8:
821 #line 53 "defparse.y"
822 { def_heapsize (yyvsp[-1].number, yyvsp[0].number);;
823 break;}
824 case 9:
825 #line 54 "defparse.y"
826 { def_code (yyvsp[0].number);;
827 break;}
828 case 10:
829 #line 55 "defparse.y"
830 { def_data (yyvsp[0].number);;
831 break;}
832 case 13:
833 #line 58 "defparse.y"
834 { def_version (yyvsp[0].number,0);;
835 break;}
836 case 14:
837 #line 59 "defparse.y"
838 { def_version (yyvsp[-2].number,yyvsp[0].number);;
839 break;}
840 case 17:
841 #line 70 "defparse.y"
842 { def_exports (yyvsp[-5].id, yyvsp[-4].id, yyvsp[-3].number, yyvsp[-2].number, yyvsp[-1].number, yyvsp[0].number);;
843 break;}
844 case 20:
845 #line 78 "defparse.y"
846 { def_import (yyvsp[-6].id,yyvsp[-4].id,yyvsp[-2].id,yyvsp[0].id, 0); ;
847 break;}
848 case 21:
849 #line 79 "defparse.y"
850 { def_import (yyvsp[-6].id,yyvsp[-4].id,yyvsp[-2].id, 0,yyvsp[0].number); ;
851 break;}
852 case 22:
853 #line 80 "defparse.y"
854 { def_import (yyvsp[-4].id,yyvsp[-2].id, 0,yyvsp[0].id, 0); ;
855 break;}
856 case 23:
857 #line 81 "defparse.y"
858 { def_import (yyvsp[-4].id,yyvsp[-2].id, 0, 0,yyvsp[0].number); ;
859 break;}
860 case 24:
861 #line 82 "defparse.y"
862 { def_import ( 0,yyvsp[-4].id,yyvsp[-2].id,yyvsp[0].id, 0); ;
863 break;}
864 case 25:
865 #line 83 "defparse.y"
866 { def_import ( 0,yyvsp[-4].id,yyvsp[-2].id, 0,yyvsp[0].number); ;
867 break;}
868 case 26:
869 #line 84 "defparse.y"
870 { def_import ( 0,yyvsp[-2].id, 0,yyvsp[0].id, 0); ;
871 break;}
872 case 27:
873 #line 85 "defparse.y"
874 { def_import ( 0,yyvsp[-2].id, 0, 0,yyvsp[0].number); ;
875 break;}
876 case 30:
877 #line 94 "defparse.y"
878 { def_section (yyvsp[-1].id,yyvsp[0].number);;
879 break;}
880 case 35:
881 #line 106 "defparse.y"
882 { yyval.number=yyvsp[0].number;;
883 break;}
884 case 36:
885 #line 107 "defparse.y"
886 { yyval.number=-1;;
887 break;}
888 case 37:
889 #line 111 "defparse.y"
890 { yyval.number = 1; ;
891 break;}
892 case 38:
893 #line 112 "defparse.y"
894 { yyval.number = 2; ;
895 break;}
896 case 39:
897 #line 113 "defparse.y"
898 { yyval.number = 4; ;
899 break;}
900 case 40:
901 #line 114 "defparse.y"
902 { yyval.number = 8; ;
903 break;}
904 case 41:
905 #line 115 "defparse.y"
906 { yyval.number = 0; ;
907 break;}
908 case 42:
909 #line 116 "defparse.y"
910 { yyval.number = 0; ;
911 break;}
912 case 43:
913 #line 117 "defparse.y"
914 { yyval.number = 0; ;
915 break;}
916 case 44:
917 #line 121 "defparse.y"
918 {yyval.number=1;;
919 break;}
920 case 45:
921 #line 122 "defparse.y"
922 {yyval.number=0;;
923 break;}
924 case 46:
925 #line 126 "defparse.y"
926 {yyval.number=1;;
927 break;}
928 case 47:
929 #line 127 "defparse.y"
930 {yyval.number=0;;
931 break;}
932 case 48:
933 #line 131 "defparse.y"
934 { yyval.number = 1; ;
935 break;}
936 case 49:
937 #line 132 "defparse.y"
938 { yyval.number = 0; ;
939 break;}
940 case 50:
941 #line 135 "defparse.y"
942 { yyval.id =yyvsp[0].id; ;
943 break;}
944 case 51:
945 #line 137 "defparse.y"
947 char *name = xmalloc (strlen (yyvsp[-2].id) + 1 + strlen (yyvsp[0].id) + 1);
948 sprintf (name, "%s.%s", yyvsp[-2].id, yyvsp[0].id);
949 yyval.id = name;
951 break;}
952 case 52:
953 #line 142 "defparse.y"
954 { yyval.id=""; ;
955 break;}
956 case 53:
957 #line 146 "defparse.y"
958 { yyval.number=yyvsp[0].number;;
959 break;}
960 case 54:
961 #line 147 "defparse.y"
962 { yyval.number=-1;;
963 break;}
964 case 55:
965 #line 151 "defparse.y"
966 { yyval.id = yyvsp[0].id; ;
967 break;}
968 case 56:
969 #line 152 "defparse.y"
970 { yyval.id = 0; ;
971 break;}
972 case 57:
973 #line 155 "defparse.y"
974 { yyval.number= yyvsp[0].number;;
975 break;}
976 case 58:
977 #line 156 "defparse.y"
978 { yyval.number=-1;;
979 break;}
981 /* the action file gets copied in in place of this dollarsign */
982 #line 543 "/usr/share/bison/bison.simple"
984 yyvsp -= yylen;
985 yyssp -= yylen;
986 #ifdef YYLSP_NEEDED
987 yylsp -= yylen;
988 #endif
990 #if YYDEBUG != 0
991 if (yydebug)
993 short *ssp1 = yyss - 1;
994 fprintf (stderr, "state stack now");
995 while (ssp1 != yyssp)
996 fprintf (stderr, " %d", *++ssp1);
997 fprintf (stderr, "\n");
999 #endif
1001 *++yyvsp = yyval;
1003 #ifdef YYLSP_NEEDED
1004 yylsp++;
1005 if (yylen == 0)
1007 yylsp->first_line = yylloc.first_line;
1008 yylsp->first_column = yylloc.first_column;
1009 yylsp->last_line = (yylsp-1)->last_line;
1010 yylsp->last_column = (yylsp-1)->last_column;
1011 yylsp->text = 0;
1013 else
1015 yylsp->last_line = (yylsp+yylen-1)->last_line;
1016 yylsp->last_column = (yylsp+yylen-1)->last_column;
1018 #endif
1020 /* Now "shift" the result of the reduction.
1021 Determine what state that goes to,
1022 based on the state we popped back to
1023 and the rule number reduced by. */
1025 yyn = yyr1[yyn];
1027 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1028 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1029 yystate = yytable[yystate];
1030 else
1031 yystate = yydefgoto[yyn - YYNTBASE];
1033 goto yynewstate;
1035 yyerrlab: /* here on detecting error */
1037 if (! yyerrstatus)
1038 /* If not already recovering from an error, report this error. */
1040 ++yynerrs;
1042 #ifdef YYERROR_VERBOSE
1043 yyn = yypact[yystate];
1045 if (yyn > YYFLAG && yyn < YYLAST)
1047 int size = 0;
1048 char *msg;
1049 int x, count;
1051 count = 0;
1052 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
1053 for (x = (yyn < 0 ? -yyn : 0);
1054 x < (sizeof(yytname) / sizeof(char *)); x++)
1055 if (yycheck[x + yyn] == x)
1056 size += strlen(yytname[x]) + 15, count++;
1057 msg = (char *) malloc(size + 15);
1058 if (msg != 0)
1060 strcpy(msg, "parse error");
1062 if (count < 5)
1064 count = 0;
1065 for (x = (yyn < 0 ? -yyn : 0);
1066 x < (sizeof(yytname) / sizeof(char *)); x++)
1067 if (yycheck[x + yyn] == x)
1069 strcat(msg, count == 0 ? ", expecting `" : " or `");
1070 strcat(msg, yytname[x]);
1071 strcat(msg, "'");
1072 count++;
1075 yyerror(msg);
1076 free(msg);
1078 else
1079 yyerror ("parse error; also virtual memory exceeded");
1081 else
1082 #endif /* YYERROR_VERBOSE */
1083 yyerror("parse error");
1086 goto yyerrlab1;
1087 yyerrlab1: /* here on error raised explicitly by an action */
1089 if (yyerrstatus == 3)
1091 /* if just tried and failed to reuse lookahead token after an error, discard it. */
1093 /* return failure if at end of input */
1094 if (yychar == YYEOF)
1095 YYABORT;
1097 #if YYDEBUG != 0
1098 if (yydebug)
1099 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
1100 #endif
1102 yychar = YYEMPTY;
1105 /* Else will try to reuse lookahead token
1106 after shifting the error token. */
1108 yyerrstatus = 3; /* Each real token shifted decrements this */
1110 goto yyerrhandle;
1112 yyerrdefault: /* current state does not do anything special for the error token. */
1114 #if 0
1115 /* This is wrong; only states that explicitly want error tokens
1116 should shift them. */
1117 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
1118 if (yyn) goto yydefault;
1119 #endif
1121 yyerrpop: /* pop the current state because it cannot handle the error token */
1123 if (yyssp == yyss) YYABORT;
1124 yyvsp--;
1125 yystate = *--yyssp;
1126 #ifdef YYLSP_NEEDED
1127 yylsp--;
1128 #endif
1130 #if YYDEBUG != 0
1131 if (yydebug)
1133 short *ssp1 = yyss - 1;
1134 fprintf (stderr, "Error: state stack now");
1135 while (ssp1 != yyssp)
1136 fprintf (stderr, " %d", *++ssp1);
1137 fprintf (stderr, "\n");
1139 #endif
1141 yyerrhandle:
1143 yyn = yypact[yystate];
1144 if (yyn == YYFLAG)
1145 goto yyerrdefault;
1147 yyn += YYTERROR;
1148 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1149 goto yyerrdefault;
1151 yyn = yytable[yyn];
1152 if (yyn < 0)
1154 if (yyn == YYFLAG)
1155 goto yyerrpop;
1156 yyn = -yyn;
1157 goto yyreduce;
1159 else if (yyn == 0)
1160 goto yyerrpop;
1162 if (yyn == YYFINAL)
1163 YYACCEPT;
1165 #if YYDEBUG != 0
1166 if (yydebug)
1167 fprintf(stderr, "Shifting error token, ");
1168 #endif
1170 *++yyvsp = yylval;
1171 #ifdef YYLSP_NEEDED
1172 *++yylsp = yylloc;
1173 #endif
1175 yystate = yyn;
1176 goto yynewstate;
1178 yyacceptlab:
1179 /* YYACCEPT comes here. */
1180 if (yyfree_stacks)
1182 free (yyss);
1183 free (yyvs);
1184 #ifdef YYLSP_NEEDED
1185 free (yyls);
1186 #endif
1188 return 0;
1190 yyabortlab:
1191 /* YYABORT comes here. */
1192 if (yyfree_stacks)
1194 free (yyss);
1195 free (yyvs);
1196 #ifdef YYLSP_NEEDED
1197 free (yyls);
1198 #endif
1200 return 1;
1202 #line 170 "defparse.y"