1 /* A Bison parser, made from defparse.y
4 #define YYBISON 1 /* Identify Bison output. */
8 # define DESCRIPTION 259
23 # define NONSHARED 274
27 # define INITINSTANCE 278
28 # define INITGLOBAL 279
29 # define TERMINSTANCE 280
30 # define TERMGLOBAL 281
35 /* defparse.y - parser for .def files */
37 /* Copyright 1995, 1997, 1998, 1999 Free Software Foundation, Inc.
39 This file is part of GNU Binutils.
41 This program is free software; you can redistribute it and/or modify
42 it under the terms of the GNU General Public License as published by
43 the Free Software Foundation; either version 2 of the License, or
44 (at your option) any later version.
46 This program is distributed in the hope that it will be useful,
47 but WITHOUT ANY WARRANTY; without even the implied warranty of
48 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49 GNU General Public License for more details.
51 You should have received a copy of the GNU General Public License
52 along with this program; if not, write to the Free Software
53 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
65 # define YYSTYPE yystype
77 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
78 #define YYTRANSLATE(x) ((unsigned)(x) <= 283 ? yytranslate[x] : 55)
80 /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
81 static const char yytranslate[] =
83 0, 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, 2, 2, 2, 2, 2, 2, 2,
87 2, 2, 2, 2, 32, 2, 30, 2, 2, 2,
88 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
89 2, 31, 2, 2, 33, 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, 2, 2, 2, 2, 2,
108 2, 2, 2, 2, 2, 2, 1, 3, 4, 5,
109 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
110 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
115 static const short yyprhs[] =
117 0, 0, 3, 5, 9, 14, 17, 20, 24, 28,
118 31, 34, 37, 40, 43, 48, 49, 52, 59, 62,
119 64, 72, 80, 86, 92, 98, 104, 108, 112, 115,
120 117, 120, 124, 126, 128, 129, 132, 133, 135, 137,
121 139, 141, 143, 145, 147, 149, 150, 152, 153, 155,
122 156, 158, 162, 163, 166, 167, 170, 175, 176, 180,
123 181, 182, 186, 188, 190, 192
125 static const short yyrhs[] =
127 34, 35, 0, 35, 0, 3, 49, 52, 0, 4,
128 49, 52, 53, 0, 11, 36, 0, 5, 28, 0,
129 6, 29, 44, 0, 7, 29, 44, 0, 8, 42,
130 0, 9, 42, 0, 10, 40, 0, 12, 38, 0,
131 13, 29, 0, 13, 29, 30, 29, 0, 0, 36,
132 37, 0, 28, 51, 50, 47, 46, 48, 0, 38,
133 39, 0, 39, 0, 28, 31, 28, 30, 28, 30,
134 28, 0, 28, 31, 28, 30, 28, 30, 29, 0,
135 28, 31, 28, 30, 28, 0, 28, 31, 28, 30,
136 29, 0, 28, 30, 28, 30, 28, 0, 28, 30,
137 28, 30, 29, 0, 28, 30, 28, 0, 28, 30,
138 29, 0, 40, 41, 0, 41, 0, 28, 42, 0,
139 42, 43, 45, 0, 45, 0, 32, 0, 0, 32,
140 29, 0, 0, 16, 0, 17, 0, 18, 0, 19,
141 0, 20, 0, 22, 0, 23, 0, 15, 0, 0,
142 21, 0, 0, 9, 0, 0, 28, 0, 28, 30,
143 28, 0, 0, 33, 29, 0, 0, 31, 28, 0,
144 31, 28, 30, 28, 0, 0, 14, 31, 29, 0,
145 0, 0, 53, 43, 54, 0, 24, 0, 25, 0,
152 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
153 static const short yyrline[] =
155 0, 43, 44, 47, 49, 50, 51, 52, 53, 54,
156 55, 56, 57, 58, 59, 63, 65, 68, 72, 74,
157 77, 79, 80, 81, 82, 83, 84, 85, 88, 90,
158 93, 97, 99, 102, 104, 106, 107, 110, 112, 113,
159 114, 115, 116, 117, 120, 122, 125, 127, 130, 132,
160 135, 136, 142, 145, 147, 150, 152, 158, 161, 162,
161 165, 167, 170, 172, 173, 174
166 #if (YYDEBUG) || defined YYERROR_VERBOSE
168 /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
169 static const char *const yytname[] =
171 "$", "error", "$undefined.", "NAME", "LIBRARY", "DESCRIPTION",
172 "STACKSIZE", "HEAPSIZE", "CODE", "DATA", "SECTIONS", "EXPORTS",
173 "IMPORTS", "VERSIONK", "BASE", "CONSTANT", "READ", "WRITE", "EXECUTE",
174 "SHARED", "NONSHARED", "NONAME", "SINGLE", "MULTIPLE", "INITINSTANCE",
175 "INITGLOBAL", "TERMINSTANCE", "TERMGLOBAL", "ID", "NUMBER", "'.'",
176 "'='", "','", "'@'", "start", "command", "explist", "expline",
177 "implist", "impline", "seclist", "secline", "attr_list", "opt_comma",
178 "opt_number", "attr", "opt_CONSTANT", "opt_NONAME", "opt_DATA",
179 "opt_name", "opt_ordinal", "opt_equal_name", "opt_base", "option_list",
184 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
185 static const short yyr1[] =
187 0, 34, 34, 35, 35, 35, 35, 35, 35, 35,
188 35, 35, 35, 35, 35, 36, 36, 37, 38, 38,
189 39, 39, 39, 39, 39, 39, 39, 39, 40, 40,
190 41, 42, 42, 43, 43, 44, 44, 45, 45, 45,
191 45, 45, 45, 45, 46, 46, 47, 47, 48, 48,
192 49, 49, 49, 50, 50, 51, 51, 51, 52, 52,
193 53, 53, 54, 54, 54, 54
196 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
197 static const short yyr2[] =
199 0, 2, 1, 3, 4, 2, 2, 3, 3, 2,
200 2, 2, 2, 2, 4, 0, 2, 6, 2, 1,
201 7, 7, 5, 5, 5, 5, 3, 3, 2, 1,
202 2, 3, 1, 1, 0, 2, 0, 1, 1, 1,
203 1, 1, 1, 1, 1, 0, 1, 0, 1, 0,
204 1, 3, 0, 2, 0, 2, 4, 0, 3, 0,
208 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
209 doesn't specify something else to do. Zero means the default is an
211 static const short yydefact[] =
213 0, 52, 52, 0, 0, 0, 0, 0, 0, 15,
214 0, 0, 0, 2, 50, 59, 59, 6, 36, 36,
215 37, 38, 39, 40, 41, 42, 43, 9, 32, 10,
216 0, 11, 29, 5, 0, 12, 19, 13, 1, 0,
217 0, 3, 60, 0, 7, 8, 33, 0, 30, 28,
218 57, 16, 0, 0, 18, 0, 51, 0, 4, 35,
219 31, 0, 54, 26, 27, 0, 14, 58, 0, 55,
220 0, 47, 0, 0, 62, 63, 64, 65, 61, 0,
221 53, 46, 45, 24, 25, 22, 23, 56, 44, 49,
222 0, 48, 17, 20, 21, 0, 0
225 static const short yydefgoto[] =
227 12, 13, 33, 51, 35, 36, 31, 32, 27, 47,
228 44, 28, 89, 82, 92, 15, 71, 62, 41, 58,
232 static const short yypact[] =
234 32, -22, -22, -19, -13, 22, 30, 30, -6,-32768,
235 26, 38, 21,-32768, 29, 46, 46,-32768, 36, 36,
236 -32768,-32768,-32768,-32768,-32768,-32768,-32768, -15,-32768, -15,
237 30, -6,-32768, 41, -16, 26,-32768, 40,-32768, 43,
238 42,-32768,-32768, 45,-32768,-32768,-32768, 30, -15,-32768,
239 44,-32768, -9, 48,-32768, 49,-32768, 50, -14,-32768,
240 -32768, 52, 39, 47,-32768, 51,-32768,-32768, 31, 53,
241 55, 61, 33, 35,-32768,-32768,-32768,-32768,-32768, 57,
242 -32768,-32768, 71,-32768,-32768, 58,-32768,-32768,-32768, 78,
243 37,-32768,-32768,-32768,-32768, 89,-32768
246 static const short yypgoto[] =
248 -32768, 79,-32768,-32768,-32768, 59,-32768, 62, -7, 34,
249 76, 54,-32768,-32768,-32768, 88,-32768,-32768, 80,-32768,
257 static const short yytable[] =
259 29, -34, -34, -34, -34, -34, 14, -34, -34, 17,
260 -34, -34, -34, -34, 52, 53, 18, 46, 46, 63,
261 64, 95, 30, 48, 1, 2, 3, 4, 5, 6,
262 7, 8, 9, 10, 11, 1, 2, 3, 4, 5,
263 6, 7, 8, 9, 10, 11, 20, 21, 22, 23,
264 24, 19, 25, 26, 34, 74, 75, 76, 77, 39,
265 40, 83, 84, 85, 86, 93, 94, 37, 43, 50,
266 55, 56, 70, 57, 59, 61, 65, 72, 66, 67,
267 69, 73, 81, 79, 80, 87, 88, 91, 90, 96,
268 16, 38, 68, 49, 54, 45, 42, 0, 0, 0,
272 static const short yycheck[] =
274 7, 16, 17, 18, 19, 20, 28, 22, 23, 28,
275 24, 25, 26, 27, 30, 31, 29, 32, 32, 28,
276 29, 0, 28, 30, 3, 4, 5, 6, 7, 8,
277 9, 10, 11, 12, 13, 3, 4, 5, 6, 7,
278 8, 9, 10, 11, 12, 13, 16, 17, 18, 19,
279 20, 29, 22, 23, 28, 24, 25, 26, 27, 30,
280 14, 28, 29, 28, 29, 28, 29, 29, 32, 28,
281 30, 28, 33, 31, 29, 31, 28, 30, 29, 29,
282 28, 30, 21, 30, 29, 28, 15, 9, 30, 0,
283 2, 12, 58, 31, 35, 19, 16, -1, -1, -1,
286 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
287 #line 3 "/usr/share/bison/bison.simple"
289 /* Skeleton output parser for bison,
291 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
294 This program is free software; you can redistribute it and/or modify
295 it under the terms of the GNU General Public License as published by
296 the Free Software Foundation; either version 2, or (at your option)
299 This program is distributed in the hope that it will be useful,
300 but WITHOUT ANY WARRANTY; without even the implied warranty of
301 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
302 GNU General Public License for more details.
304 You should have received a copy of the GNU General Public License
305 along with this program; if not, write to the Free Software
306 Foundation, Inc., 59 Temple Place - Suite 330,
307 Boston, MA 02111-1307, USA. */
309 /* As a special exception, when this file is copied by Bison into a
310 Bison output file, you may use that output file without restriction.
311 This special exception was added by the Free Software Foundation
312 in version 1.24 of Bison. */
314 /* This is the parser code that is written into each bison parser when
315 the %semantic_parser declaration is not specified in the grammar.
316 It was written by Richard Stallman by simplifying the hairy parser
317 used when %semantic_parser is specified. */
319 /* All symbols defined below should begin with yy or YY, to avoid
320 infringing on user name space. This should be done even for local
321 variables, as they might otherwise be expanded by user macros.
322 There are some unavoidable exceptions within include files to
323 define necessary library symbols; they are noted "INFRINGES ON
324 USER NAME SPACE" below. */
327 # define YYSTD(x) std::x
332 #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
334 /* The parser invokes alloca or malloc; define the necessary symbols. */
336 # if YYSTACK_USE_ALLOCA
337 # define YYSTACK_ALLOC alloca
339 # ifndef YYSTACK_USE_ALLOCA
340 # if defined (alloca) || defined (_ALLOCA_H)
341 # define YYSTACK_ALLOC alloca
344 # define YYSTACK_ALLOC __builtin_alloca
350 # ifdef YYSTACK_ALLOC
351 /* Pacify GCC's `empty if-body' warning. */
352 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
355 # include <cstdlib> /* INFRINGES ON USER NAME SPACE */
356 # define YYSIZE_T std::size_t
359 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
360 # define YYSIZE_T size_t
363 # define YYSTACK_ALLOC YYSTD (malloc)
364 # define YYSTACK_FREE YYSTD (free)
367 /* A type that is properly aligned for any stack member. */
377 /* The size of the maximum gap between one aligned stack and the next. */
378 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
380 /* The size of an array large to enough to hold all stacks, each with
383 # define YYSTACK_BYTES(N) \
384 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
385 + 2 * YYSTACK_GAP_MAX)
387 # define YYSTACK_BYTES(N) \
388 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
392 /* Relocate the TYPE STACK from its old location to the new one. The
393 local variables YYSIZE and YYSTACKSIZE give the old and new number of
394 elements in the stack, and YYPTR gives the new location of the
395 stack. Advance YYPTR to a properly aligned location for the next
397 # define YYSTACK_RELOCATE(Type, Stack) \
400 YYSIZE_T yynewbytes; \
401 yymemcpy ((char *) yyptr, (char *) (Stack), \
402 yysize * (YYSIZE_T) sizeof (Type)); \
403 Stack = &yyptr->Stack; \
404 yynewbytes = yystacksize * sizeof (Type) + YYSTACK_GAP_MAX; \
405 yyptr += yynewbytes / sizeof (*yyptr); \
409 #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
412 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
413 # define YYSIZE_T __SIZE_TYPE__
415 #if ! defined (YYSIZE_T) && defined (size_t)
416 # define YYSIZE_T size_t
418 #if ! defined (YYSIZE_T)
420 # include <cstddef> /* INFRINGES ON USER NAME SPACE */
421 # define YYSIZE_T std::size_t
424 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
425 # define YYSIZE_T size_t
429 #if ! defined (YYSIZE_T)
430 # define YYSIZE_T unsigned int
433 #define yyerrok (yyerrstatus = 0)
434 #define yyclearin (yychar = YYEMPTY)
437 #define YYACCEPT goto yyacceptlab
438 #define YYABORT goto yyabortlab
439 #define YYERROR goto yyerrlab1
440 /* Like YYERROR except do call yyerror. This remains here temporarily
441 to ease the transition to the new meaning of YYERROR, for GCC.
442 Once GCC version 2 has supplanted version 1, this can go. */
443 #define YYFAIL goto yyerrlab
444 #define YYRECOVERING() (!!yyerrstatus)
445 #define YYBACKUP(Token, Value) \
447 if (yychar == YYEMPTY && yylen == 1) \
451 yychar1 = YYTRANSLATE (yychar); \
457 yyerror ("syntax error: cannot back up"); \
463 #define YYERRCODE 256
466 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
469 When YYLLOC_DEFAULT is run, CURRENT is set the location of the
470 first token. By default, to implement support for ranges, extend
471 its range to the last symbol. */
473 #ifndef YYLLOC_DEFAULT
474 # define YYLLOC_DEFAULT(Current, Rhs, N) \
475 Current.last_line = Rhs[N].last_line; \
476 Current.last_column = Rhs[N].last_column;
480 /* YYLEX -- calling `yylex' with the right arguments. */
485 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
487 # define YYLEX yylex (&yylval, &yylloc)
489 # else /* !YYLSP_NEEDED */
491 # define YYLEX yylex (&yylval, YYLEX_PARAM)
493 # define YYLEX yylex (&yylval)
495 # endif /* !YYLSP_NEEDED */
497 # define YYLEX yylex ()
501 /* Enable debugging if requested. */
506 # include <cstdio> /* INFRINGES ON USER NAME SPACE */
508 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
510 # define YYFPRINTF YYSTD (fprintf)
513 # define YYDPRINTF(Args) \
518 /* Nonzero means print parse trace. [The following comment makes no
519 sense to me. Could someone clarify it? --akim] Since this is
520 uninitialized, it does not stop multiple parsers from coexisting.
524 # define YYDPRINTF(Args)
525 #endif /* !YYDEBUG */
527 /* YYINITDEPTH -- initial size of the parser's stacks. */
529 # define YYINITDEPTH 200
532 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
533 if the built-in stack extension method is used).
535 Do not make this value too large; the results are undefined if
536 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
537 evaluated with infinite-precision integer arithmetic. */
544 # define YYMAXDEPTH 10000
547 #if ! defined (yyoverflow) && ! defined (yymemcpy)
548 # if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
549 # define yymemcpy __builtin_memcpy
550 # else /* not GNU C or C++ */
552 /* This is the most reliable way to avoid incompatibilities
553 in available built-in functions on various systems. */
555 # if defined (__STDC__) || defined (__cplusplus)
556 yymemcpy (char *yyto, const char *yyfrom, YYSIZE_T yycount)
558 yymemcpy (yyto, yyfrom, yycount)
564 register const char *yyf = yyfrom;
565 register char *yyt = yyto;
566 register YYSIZE_T yyi = yycount;
574 #ifdef YYERROR_VERBOSE
577 # if defined (__GLIBC__) && defined (_STRING_H)
578 # define yystrlen strlen
580 /* Return the length of YYSTR. */
582 # if defined (__STDC__) || defined (__cplusplus)
583 yystrlen (const char *yystr)
589 register const char *yys = yystr;
591 while (*yys++ != '\0')
594 return yys - yystr - 1;
600 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
601 # define yystpcpy stpcpy
603 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
606 # if defined (__STDC__) || defined (__cplusplus)
607 yystpcpy (char *yydest, const char *yysrc)
609 yystpcpy (yydest, yysrc)
614 register char *yyd = yydest;
615 register const char *yys = yysrc;
617 while ((*yyd++ = *yys++) != '\0')
626 #line 341 "/usr/share/bison/bison.simple"
629 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
630 into yyparse. The argument should have type void *.
631 It should actually point to an object.
632 Grammar actions can access the variable by casting it
633 to the proper pointer type. */
637 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
638 # define YYPARSE_PARAM_DECL
639 # else /* !__cplusplus */
640 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
641 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
642 # endif /* !__cplusplus */
643 #else /* !YYPARSE_PARAM */
644 # define YYPARSE_PARAM_ARG
645 # define YYPARSE_PARAM_DECL
646 #endif /* !YYPARSE_PARAM */
648 /* Prevent warning if -Wstrict-prototypes. */
650 # ifdef YYPARSE_PARAM
651 int yyparse (void *);
657 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
658 variables are global, or local to YYPARSE. */
660 #define YY_DECL_NON_LSP_VARIABLES \
661 /* The lookahead symbol. */ \
664 /* The semantic value of the lookahead symbol. */ \
667 /* Number of parse errors so far. */ \
671 # define YY_DECL_VARIABLES \
672 YY_DECL_NON_LSP_VARIABLES \
674 /* Location data for the lookahead symbol. */ \
677 # define YY_DECL_VARIABLES \
678 YY_DECL_NON_LSP_VARIABLES
682 /* If nonreentrant, generate the variables here. */
689 yyparse (YYPARSE_PARAM_ARG)
692 /* If reentrant, generate the variables here. */
697 register int yystate;
700 /* Number of tokens to shift before error messages enabled. */
702 /* Lookahead token as an internal (translated) token number. */
705 /* Three stacks and their tools:
706 `yyss': related to states,
707 `yyvs': related to semantic values,
708 `yyls': related to locations.
710 Refer to the stacks thru separate pointers, to allow yyoverflow
711 to reallocate them elsewhere. */
713 /* The state stack. */
714 short yyssa[YYINITDEPTH];
716 register short *yyssp;
718 /* The semantic value stack. */
719 YYSTYPE yyvsa[YYINITDEPTH];
720 YYSTYPE *yyvs = yyvsa;
721 register YYSTYPE *yyvsp;
724 /* The location stack. */
725 YYLTYPE yylsa[YYINITDEPTH];
726 YYLTYPE *yyls = yylsa;
731 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
733 # define YYPOPSTACK (yyvsp--, yyssp--)
736 YYSIZE_T yystacksize = YYINITDEPTH;
739 /* The variables used to return semantic value and location from the
746 /* When reducing, the number of symbols on the RHS of the reduced
750 YYDPRINTF ((stderr, "Starting parse\n"));
755 yychar = YYEMPTY; /* Cause a token to be read. */
757 /* Initialize stack pointers.
758 Waste one element of value and location stack
759 so that they stay on the same level as the state stack.
760 The wasted elements are never initialized. */
769 /*------------------------------------------------------------.
770 | yynewstate -- Push a new state, which is found in yystate. |
771 `------------------------------------------------------------*/
773 /* In all cases, when you get here, the value and location stacks
774 have just been pushed. so pushing a state here evens the stacks.
781 if (yyssp >= yyss + yystacksize - 1)
783 /* Get the current used size of the three stacks, in elements. */
784 YYSIZE_T yysize = yyssp - yyss + 1;
788 /* Give user a chance to reallocate the stack. Use copies of
789 these so that the &'s don't force the real ones into
791 YYSTYPE *yyvs1 = yyvs;
794 /* Each stack pointer address is followed by the size of the
795 data in use in that stack, in bytes. */
797 YYLTYPE *yyls1 = yyls;
798 /* This used to be a conditional around just the two extra args,
799 but that might be undefined if yyoverflow is a macro. */
800 yyoverflow ("parser stack overflow",
801 &yyss1, yysize * sizeof (*yyssp),
802 &yyvs1, yysize * sizeof (*yyvsp),
803 &yyls1, yysize * sizeof (*yylsp),
807 yyoverflow ("parser stack overflow",
808 &yyss1, yysize * sizeof (*yyssp),
809 &yyvs1, yysize * sizeof (*yyvsp),
815 #else /* no yyoverflow */
816 /* Extend the stack our own way. */
817 if (yystacksize >= YYMAXDEPTH)
820 if (yystacksize > YYMAXDEPTH)
821 yystacksize = YYMAXDEPTH;
825 union yyalloc *yyptr =
826 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
829 YYSTACK_RELOCATE (short, yyss);
830 YYSTACK_RELOCATE (YYSTYPE, yyvs);
832 YYSTACK_RELOCATE (YYLTYPE, yyls);
834 # undef YYSTACK_RELOCATE
836 YYSTACK_FREE (yyss1);
838 #endif /* no yyoverflow */
840 yyssp = yyss + yysize - 1;
841 yyvsp = yyvs + yysize - 1;
843 yylsp = yyls + yysize - 1;
846 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
847 (unsigned long int) yystacksize));
849 if (yyssp >= yyss + yystacksize - 1)
853 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
863 /* Do appropriate processing given the current state. */
864 /* Read a lookahead token if we need one and don't already have one. */
867 /* First try to decide what to do without reference to lookahead token. */
869 yyn = yypact[yystate];
873 /* Not known => get a lookahead token if don't already have one. */
875 /* yychar is either YYEMPTY or YYEOF
876 or a valid token in external form. */
878 if (yychar == YYEMPTY)
880 YYDPRINTF ((stderr, "Reading a token: "));
884 /* Convert token to internal form (in yychar1) for indexing tables with */
886 if (yychar <= 0) /* This means end of input. */
889 yychar = YYEOF; /* Don't call YYLEX any more */
891 YYDPRINTF ((stderr, "Now at end of input.\n"));
895 yychar1 = YYTRANSLATE (yychar);
898 /* We have to keep this `#if YYDEBUG', since we use variables
899 which are defined only if `YYDEBUG' is set. */
902 YYFPRINTF (stderr, "Next token is %d (%s",
903 yychar, yytname[yychar1]);
904 /* Give the individual parser a way to print the precise
905 meaning of a token, for further debugging info. */
907 YYPRINT (stderr, yychar, yylval);
909 YYFPRINTF (stderr, ")\n");
915 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
920 /* yyn is what to do for this token type in this state.
921 Negative => reduce, -yyn is rule number.
922 Positive => shift, yyn is new state.
923 New state is final state => don't bother to shift,
925 0, or most negative number => error. */
940 /* Shift the lookahead token. */
941 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
942 yychar, yytname[yychar1]));
944 /* Discard the token being shifted unless it is eof. */
953 /* Count tokens shifted since error; after three, turn off error
962 /*-----------------------------------------------------------.
963 | yydefault -- do the default action for the current state. |
964 `-----------------------------------------------------------*/
966 yyn = yydefact[yystate];
972 /*-----------------------------.
973 | yyreduce -- Do a reduction. |
974 `-----------------------------*/
976 /* yyn is the number of a rule to reduce with. */
979 /* If YYLEN is nonzero, implement the default value of the action:
982 Otherwise, the following line sets YYVAL to the semantic value of
983 the lookahead token. This behavior is undocumented and Bison
984 users should not rely upon it. Assigning to YYVAL
985 unconditionally makes the parser a bit smaller, and it avoids a
986 GCC warning that YYVAL may be used uninitialized. */
987 yyval = yyvsp[1-yylen];
990 /* Similarly for the default location. Let the user run additional
991 commands if for instance locations are ranges. */
992 yyloc = yylsp[1-yylen];
993 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
997 /* We have to keep this `#if YYDEBUG', since we use variables which
998 are defined only if `YYDEBUG' is set. */
1003 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
1006 /* Print the symbols being reduced, and their result. */
1007 for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
1008 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
1009 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1016 #line 48 "defparse.y"
1017 { def_name (yyvsp[-1].id, yyvsp[0].number); }
1020 #line 49 "defparse.y"
1021 { def_library (yyvsp[-2].id, yyvsp[-1].number); }
1024 #line 51 "defparse.y"
1025 { def_description (yyvsp[0].id);}
1028 #line 52 "defparse.y"
1029 { def_stacksize (yyvsp[-1].number, yyvsp[0].number);}
1032 #line 53 "defparse.y"
1033 { def_heapsize (yyvsp[-1].number, yyvsp[0].number);}
1036 #line 54 "defparse.y"
1037 { def_code (yyvsp[0].number);}
1040 #line 55 "defparse.y"
1041 { def_data (yyvsp[0].number);}
1044 #line 58 "defparse.y"
1045 { def_version (yyvsp[0].number,0);}
1048 #line 59 "defparse.y"
1049 { def_version (yyvsp[-2].number,yyvsp[0].number);}
1052 #line 70 "defparse.y"
1053 { def_exports (yyvsp[-5].id, yyvsp[-4].id, yyvsp[-3].number, yyvsp[-2].number, yyvsp[-1].number, yyvsp[0].number);}
1056 #line 78 "defparse.y"
1057 { def_import (yyvsp[-6].id,yyvsp[-4].id,yyvsp[-2].id,yyvsp[0].id, 0); }
1060 #line 79 "defparse.y"
1061 { def_import (yyvsp[-6].id,yyvsp[-4].id,yyvsp[-2].id, 0,yyvsp[0].number); }
1064 #line 80 "defparse.y"
1065 { def_import (yyvsp[-4].id,yyvsp[-2].id, 0,yyvsp[0].id, 0); }
1068 #line 81 "defparse.y"
1069 { def_import (yyvsp[-4].id,yyvsp[-2].id, 0, 0,yyvsp[0].number); }
1072 #line 82 "defparse.y"
1073 { def_import ( 0,yyvsp[-4].id,yyvsp[-2].id,yyvsp[0].id, 0); }
1076 #line 83 "defparse.y"
1077 { def_import ( 0,yyvsp[-4].id,yyvsp[-2].id, 0,yyvsp[0].number); }
1080 #line 84 "defparse.y"
1081 { def_import ( 0,yyvsp[-2].id, 0,yyvsp[0].id, 0); }
1084 #line 85 "defparse.y"
1085 { def_import ( 0,yyvsp[-2].id, 0, 0,yyvsp[0].number); }
1088 #line 94 "defparse.y"
1089 { def_section (yyvsp[-1].id,yyvsp[0].number);}
1092 #line 106 "defparse.y"
1093 { yyval.number=yyvsp[0].number;}
1096 #line 107 "defparse.y"
1100 #line 111 "defparse.y"
1101 { yyval.number = 1; }
1104 #line 112 "defparse.y"
1105 { yyval.number = 2; }
1108 #line 113 "defparse.y"
1109 { yyval.number = 4; }
1112 #line 114 "defparse.y"
1113 { yyval.number = 8; }
1116 #line 115 "defparse.y"
1117 { yyval.number = 0; }
1120 #line 116 "defparse.y"
1121 { yyval.number = 0; }
1124 #line 117 "defparse.y"
1125 { yyval.number = 0; }
1128 #line 121 "defparse.y"
1132 #line 122 "defparse.y"
1136 #line 126 "defparse.y"
1140 #line 127 "defparse.y"
1144 #line 131 "defparse.y"
1145 { yyval.number = 1; }
1148 #line 132 "defparse.y"
1149 { yyval.number = 0; }
1152 #line 135 "defparse.y"
1153 { yyval.id =yyvsp[0].id; }
1156 #line 137 "defparse.y"
1158 char *name = xmalloc (strlen (yyvsp[-2].id) + 1 + strlen (yyvsp[0].id) + 1);
1159 sprintf (name, "%s.%s", yyvsp[-2].id, yyvsp[0].id);
1164 #line 142 "defparse.y"
1168 #line 146 "defparse.y"
1169 { yyval.number=yyvsp[0].number;}
1172 #line 147 "defparse.y"
1176 #line 151 "defparse.y"
1177 { yyval.id = yyvsp[0].id; }
1180 #line 153 "defparse.y"
1182 char *name = xmalloc (strlen (yyvsp[-2].id) + 1 + strlen (yyvsp[0].id) + 1);
1183 sprintf (name, "%s.%s", yyvsp[-2].id, yyvsp[0].id);
1188 #line 158 "defparse.y"
1192 #line 161 "defparse.y"
1193 { yyval.number= yyvsp[0].number;}
1196 #line 162 "defparse.y"
1201 #line 727 "/usr/share/bison/bison.simple"
1213 short *yyssp1 = yyss - 1;
1214 YYFPRINTF (stderr, "state stack now");
1215 while (yyssp1 != yyssp)
1216 YYFPRINTF (stderr, " %d", *++yyssp1);
1217 YYFPRINTF (stderr, "\n");
1226 /* Now `shift' the result of the reduction. Determine what state
1227 that goes to, based on the state we popped back to and the rule
1228 number reduced by. */
1232 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1233 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1234 yystate = yytable[yystate];
1236 yystate = yydefgoto[yyn - YYNTBASE];
1241 /*------------------------------------.
1242 | yyerrlab -- here on detecting error |
1243 `------------------------------------*/
1245 /* If not already recovering from an error, report this error. */
1250 #ifdef YYERROR_VERBOSE
1251 yyn = yypact[yystate];
1253 if (yyn > YYFLAG && yyn < YYLAST)
1255 YYSIZE_T yysize = 0;
1260 /* Start YYX at -YYN if negative to avoid negative indexes in
1262 for (yyx = yyn < 0 ? -yyn : 0;
1263 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1264 if (yycheck[yyx + yyn] == yyx)
1265 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1266 yysize += yystrlen ("parse error, unexpected ") + 1;
1267 yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
1268 yymsg = (char *) YYSTACK_ALLOC (yysize);
1271 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1272 yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
1277 for (yyx = yyn < 0 ? -yyn : 0;
1278 yyx < (int) (sizeof (yytname) / sizeof (char *));
1280 if (yycheck[yyx + yyn] == yyx)
1282 const char *yyq = ! yycount ? ", expecting " : " or ";
1283 yyp = yystpcpy (yyp, yyq);
1284 yyp = yystpcpy (yyp, yytname[yyx]);
1289 YYSTACK_FREE (yymsg);
1292 yyerror ("parse error; also virtual memory exhausted");
1295 #endif /* defined (YYERROR_VERBOSE) */
1296 yyerror ("parse error");
1301 /*--------------------------------------------------.
1302 | yyerrlab1 -- error raised explicitly by an action |
1303 `--------------------------------------------------*/
1305 if (yyerrstatus == 3)
1307 /* If just tried and failed to reuse lookahead token after an
1308 error, discard it. */
1310 /* return failure if at end of input */
1311 if (yychar == YYEOF)
1313 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1314 yychar, yytname[yychar1]));
1318 /* Else will try to reuse lookahead token after shifting the error
1321 yyerrstatus = 3; /* Each real token shifted decrements this */
1326 /*-------------------------------------------------------------------.
1327 | yyerrdefault -- current state does not do anything special for the |
1329 `-------------------------------------------------------------------*/
1332 /* This is wrong; only states that explicitly want error tokens
1333 should shift them. */
1335 /* If its default is to accept any token, ok. Otherwise pop it. */
1336 yyn = yydefact[yystate];
1342 /*---------------------------------------------------------------.
1343 | yyerrpop -- pop the current state because it cannot handle the |
1345 `---------------------------------------------------------------*/
1358 short *yyssp1 = yyss - 1;
1359 YYFPRINTF (stderr, "Error: state stack now");
1360 while (yyssp1 != yyssp)
1361 YYFPRINTF (stderr, " %d", *++yyssp1);
1362 YYFPRINTF (stderr, "\n");
1370 yyn = yypact[yystate];
1375 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1392 YYDPRINTF ((stderr, "Shifting error token, "));
1403 /*-------------------------------------.
1404 | yyacceptlab -- YYACCEPT comes here. |
1405 `-------------------------------------*/
1410 /*-----------------------------------.
1411 | yyabortlab -- YYABORT comes here. |
1412 `-----------------------------------*/
1417 /*---------------------------------------------.
1418 | yyoverflowab -- parser overflow comes here. |
1419 `---------------------------------------------*/
1421 yyerror ("parser stack overflow");
1428 YYSTACK_FREE (yyss);
1432 #line 176 "defparse.y"