2 /* A Bison parser, made from defparse.y
3 by GNU Bison version 1.28 */
5 #define YYBISON 1 /* Identify Bison output. */
9 #define DESCRIPTION 259
28 #define INITINSTANCE 278
29 #define INITGLOBAL 279
30 #define TERMINSTANCE 280
31 #define TERMGLOBAL 281
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. */
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,
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,
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
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,
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
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,
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,
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,
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
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,
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,
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)
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
295 #define YYSTACK_USE_ALLOCA
296 #else /* alloca not defined */
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
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. */
313 #else /* not MSDOS, or __TURBOC__ */
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> */
319 #define YYSTACK_USE_ALLOCA
320 #else /* not MSDOS, or __TURBOC__, or _AIX */
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
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
338 #define YYSTACK_ALLOC malloc
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)
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) \
360 if (yychar == YYEMPTY && yylen == 1) \
361 { yychar = (token), yylval = (value); \
362 yychar1 = YYTRANSLATE (yychar); \
367 { yyerror ("syntax error: cannot back up"); YYERROR; } \
371 #define YYERRCODE 256
374 #define YYLEX yylex()
380 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
382 #define YYLEX yylex(&yylval, &yylloc)
384 #else /* not YYLSP_NEEDED */
386 #define YYLEX yylex(&yylval, YYLEX_PARAM)
388 #define YYLEX yylex(&yylval)
390 #endif /* not YYLSP_NEEDED */
393 /* If nonreentrant, generate the variables here */
397 int yychar
; /* the lookahead symbol */
398 YYSTYPE yylval
; /* the semantic value of the */
399 /* lookahead symbol */
402 YYLTYPE yylloc
; /* location data for the lookahead */
406 int yynerrs
; /* number of parse errors so far */
407 #endif /* not YYPURE */
410 int yydebug
; /* nonzero means print parse trace */
411 /* Since this is uninitialized, it does not stop multiple parsers
415 /* YYINITDEPTH indicates the initial size of the parser's stacks */
418 #define YYINITDEPTH 200
421 /* YYMAXDEPTH is the maximum size the stacks can grow to
422 (effective only if the built-in stack extension method is used). */
429 #define YYMAXDEPTH 10000
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++ */
442 /* This is the most reliable way to avoid incompatibilities
443 in available built-in functions on various systems. */
445 __yy_memcpy (to
, from
, count
)
450 register char *f
= from
;
451 register char *t
= to
;
452 register int i
= count
;
458 #else /* __cplusplus */
460 /* This is the most reliable way to avoid incompatibilities
461 in available built-in functions on various systems. */
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
;
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. */
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. */
500 int yyparse (void *);
507 yyparse(YYPARSE_PARAM_ARG
)
510 register int yystate
;
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 */
524 YYLTYPE yylsa
[YYINITDEPTH
]; /* the location stack */
525 YYLTYPE
*yyls
= yylsa
;
528 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
530 #define YYPOPSTACK (yyvsp--, yyssp--)
533 int yystacksize
= YYINITDEPTH
;
534 int yyfree_stacks
= 0;
545 YYSTYPE yyval
; /* the variable used to return */
546 /* semantic values from the action */
553 fprintf(stderr
, "Starting parse\n");
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. */
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. */
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
;
586 YYLTYPE
*yyls1
= yyls
;
589 /* Get the current used size of the three stacks, in elements. */
590 int size
= yyssp
- yyss
+ 1;
593 /* Each stack pointer address is followed by the size of
594 the data in use in that stack, in bytes. */
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
),
604 yyoverflow("parser stack overflow",
605 &yyss1
, size
* sizeof (*yyssp
),
606 &yyvs1
, size
* sizeof (*yyvsp
),
610 yyss
= yyss1
; yyvs
= yyvs1
;
614 #else /* no yyoverflow */
615 /* Extend the stack our own way. */
616 if (yystacksize
>= YYMAXDEPTH
)
618 yyerror("parser stack overflow");
630 if (yystacksize
> YYMAXDEPTH
)
631 yystacksize
= YYMAXDEPTH
;
632 #ifndef YYSTACK_USE_ALLOCA
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
));
642 yyls
= (YYLTYPE
*) YYSTACK_ALLOC (yystacksize
* sizeof (*yylsp
));
643 __yy_memcpy ((char *)yyls
, (char *)yyls1
,
644 size
* (unsigned int) sizeof (*yylsp
));
646 #endif /* no yyoverflow */
648 yyssp
= yyss
+ size
- 1;
649 yyvsp
= yyvs
+ size
- 1;
651 yylsp
= yyls
+ size
- 1;
656 fprintf(stderr
, "Stack size increased to %d\n", yystacksize
);
659 if (yyssp
>= yyss
+ yystacksize
- 1)
665 fprintf(stderr
, "Entering state %d\n", yystate
);
671 /* Do appropriate processing given the current state. */
672 /* Read a lookahead token if we need one and don't already have one. */
675 /* First try to decide what to do without reference to lookahead token. */
677 yyn
= yypact
[yystate
];
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
)
690 fprintf(stderr
, "Reading a token: ");
695 /* Convert token to internal form (in yychar1) for indexing tables with */
697 if (yychar
<= 0) /* This means end of input. */
700 yychar
= YYEOF
; /* Don't call YYLEX any more */
704 fprintf(stderr
, "Now at end of input.\n");
709 yychar1
= YYTRANSLATE(yychar
);
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. */
718 YYPRINT (stderr
, yychar
, yylval
);
720 fprintf (stderr
, ")\n");
726 if (yyn
< 0 || yyn
> YYLAST
|| yycheck
[yyn
] != yychar1
)
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,
736 0, or most negative number => error. */
751 /* Shift the lookahead token. */
755 fprintf(stderr
, "Shifting token %d (%s), ", yychar
, yytname
[yychar1
]);
758 /* Discard the token being shifted unless it is eof. */
767 /* count tokens shifted since error; after three, turn off error status. */
768 if (yyerrstatus
) yyerrstatus
--;
773 /* Do the default action for the current state. */
776 yyn
= yydefact
[yystate
];
780 /* Do a reduction. yyn is the number of a rule to reduce with. */
784 yyval
= yyvsp
[1-yylen
]; /* implement default value of the action */
791 fprintf (stderr
, "Reducing via rule %d (line %d), ",
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
]]);
805 #line 48 "defparse.y"
806 { def_name (yyvsp
[-1].id
, yyvsp
[0].number
); ;
809 #line 49 "defparse.y"
810 { def_library (yyvsp
[-2].id
, yyvsp
[-1].number
); ;
813 #line 51 "defparse.y"
814 { def_description (yyvsp
[0].id
);;
817 #line 52 "defparse.y"
818 { def_stacksize (yyvsp
[-1].number
, yyvsp
[0].number
);;
821 #line 53 "defparse.y"
822 { def_heapsize (yyvsp
[-1].number
, yyvsp
[0].number
);;
825 #line 54 "defparse.y"
826 { def_code (yyvsp
[0].number
);;
829 #line 55 "defparse.y"
830 { def_data (yyvsp
[0].number
);;
833 #line 58 "defparse.y"
834 { def_version (yyvsp
[0].number
,0);;
837 #line 59 "defparse.y"
838 { def_version (yyvsp
[-2].number
,yyvsp
[0].number
);;
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
);;
845 #line 78 "defparse.y"
846 { def_import (yyvsp
[-6].id
,yyvsp
[-4].id
,yyvsp
[-2].id
,yyvsp
[0].id
, 0); ;
849 #line 79 "defparse.y"
850 { def_import (yyvsp
[-6].id
,yyvsp
[-4].id
,yyvsp
[-2].id
, 0,yyvsp
[0].number
); ;
853 #line 80 "defparse.y"
854 { def_import (yyvsp
[-4].id
,yyvsp
[-2].id
, 0,yyvsp
[0].id
, 0); ;
857 #line 81 "defparse.y"
858 { def_import (yyvsp
[-4].id
,yyvsp
[-2].id
, 0, 0,yyvsp
[0].number
); ;
861 #line 82 "defparse.y"
862 { def_import ( 0,yyvsp
[-4].id
,yyvsp
[-2].id
,yyvsp
[0].id
, 0); ;
865 #line 83 "defparse.y"
866 { def_import ( 0,yyvsp
[-4].id
,yyvsp
[-2].id
, 0,yyvsp
[0].number
); ;
869 #line 84 "defparse.y"
870 { def_import ( 0,yyvsp
[-2].id
, 0,yyvsp
[0].id
, 0); ;
873 #line 85 "defparse.y"
874 { def_import ( 0,yyvsp
[-2].id
, 0, 0,yyvsp
[0].number
); ;
877 #line 94 "defparse.y"
878 { def_section (yyvsp
[-1].id
,yyvsp
[0].number
);;
881 #line 106 "defparse.y"
882 { yyval
.number
=yyvsp
[0].number
;;
885 #line 107 "defparse.y"
889 #line 111 "defparse.y"
890 { yyval
.number
= 1; ;
893 #line 112 "defparse.y"
894 { yyval
.number
= 2; ;
897 #line 113 "defparse.y"
898 { yyval
.number
= 4; ;
901 #line 114 "defparse.y"
902 { yyval
.number
= 8; ;
905 #line 115 "defparse.y"
906 { yyval
.number
= 0; ;
909 #line 116 "defparse.y"
910 { yyval
.number
= 0; ;
913 #line 117 "defparse.y"
914 { yyval
.number
= 0; ;
917 #line 121 "defparse.y"
921 #line 122 "defparse.y"
925 #line 126 "defparse.y"
929 #line 127 "defparse.y"
933 #line 131 "defparse.y"
934 { yyval
.number
= 1; ;
937 #line 132 "defparse.y"
938 { yyval
.number
= 0; ;
941 #line 135 "defparse.y"
942 { yyval
.id
=yyvsp
[0].id
; ;
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
);
953 #line 142 "defparse.y"
957 #line 146 "defparse.y"
958 { yyval
.number
=yyvsp
[0].number
;;
961 #line 147 "defparse.y"
965 #line 151 "defparse.y"
966 { yyval
.id
= yyvsp
[0].id
; ;
969 #line 152 "defparse.y"
973 #line 155 "defparse.y"
974 { yyval
.number
= yyvsp
[0].number
;;
977 #line 156 "defparse.y"
981 /* the action file gets copied in in place of this dollarsign */
982 #line 543 "/usr/share/bison/bison.simple"
993 short *ssp1
= yyss
- 1;
994 fprintf (stderr
, "state stack now");
995 while (ssp1
!= yyssp
)
996 fprintf (stderr
, " %d", *++ssp1
);
997 fprintf (stderr
, "\n");
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
;
1015 yylsp
->last_line
= (yylsp
+yylen
-1)->last_line
;
1016 yylsp
->last_column
= (yylsp
+yylen
-1)->last_column
;
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. */
1027 yystate
= yypgoto
[yyn
- YYNTBASE
] + *yyssp
;
1028 if (yystate
>= 0 && yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1029 yystate
= yytable
[yystate
];
1031 yystate
= yydefgoto
[yyn
- YYNTBASE
];
1035 yyerrlab
: /* here on detecting error */
1038 /* If not already recovering from an error, report this error. */
1042 #ifdef YYERROR_VERBOSE
1043 yyn
= yypact
[yystate
];
1045 if (yyn
> YYFLAG
&& yyn
< YYLAST
)
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);
1060 strcpy(msg
, "parse error");
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
]);
1079 yyerror ("parse error; also virtual memory exceeded");
1082 #endif /* YYERROR_VERBOSE */
1083 yyerror("parse error");
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
)
1099 fprintf(stderr
, "Discarding token %d (%s).\n", yychar
, yytname
[yychar1
]);
1105 /* Else will try to reuse lookahead token
1106 after shifting the error token. */
1108 yyerrstatus
= 3; /* Each real token shifted decrements this */
1112 yyerrdefault
: /* current state does not do anything special for the error token. */
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
;
1121 yyerrpop
: /* pop the current state because it cannot handle the error token */
1123 if (yyssp
== yyss
) YYABORT
;
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");
1143 yyn
= yypact
[yystate
];
1148 if (yyn
< 0 || yyn
> YYLAST
|| yycheck
[yyn
] != YYTERROR
)
1167 fprintf(stderr
, "Shifting error token, ");
1179 /* YYACCEPT comes here. */
1191 /* YYABORT comes here. */
1202 #line 170 "defparse.y"