1 /* A Bison parser, made from defparse.y
2 by GNU bison 1.35. */
3
4 #define YYBISON 1 /* Identify Bison output. */
5
6 # define NAME 257
7 # define LIBRARY 258
8 # define DESCRIPTION 259
9 # define STACKSIZE 260
10 # define HEAPSIZE 261
11 # define CODE 262
12 # define DATA 263
13 # define SECTIONS 264
14 # define EXPORTS 265
15 # define IMPORTS 266
16 # define VERSIONK 267
17 # define BASE 268
18 # define CONSTANT 269
19 # define READ 270
20 # define WRITE 271
21 # define EXECUTE 272
22 # define SHARED 273
23 # define NONSHARED 274
24 # define NONAME 275
25 # define PRIVATE 276
26 # define SINGLE 277
27 # define MULTIPLE 278
28 # define INITINSTANCE 279
29 # define INITGLOBAL 280
30 # define TERMINSTANCE 281
31 # define TERMGLOBAL 282
32 # define ID 283
33 # define NUMBER 284
34
35 #line 1 "defparse.y"
36 /* defparse.y - parser for .def files */
37
38 /* Copyright 1995, 1997, 1998, 1999, 2004
39 Free Software Foundation, Inc.
40
41 This file is part of GNU Binutils.
42
43 This program is free software; you can redistribute it and/or modify
44 it under the terms of the GNU General Public License as published by
45 the Free Software Foundation; either version 2 of the License, or
46 (at your option) any later version.
47
48 This program is distributed in the hope that it will be useful,
49 but WITHOUT ANY WARRANTY; without even the implied warranty of
50 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
51 GNU General Public License for more details.
52
53 You should have received a copy of the GNU General Public License
54 along with this program; if not, write to the Free Software
55 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
56
57 #include "bfd.h"
58 #include "bucomm.h"
59 #include "dlltool.h"
60
61 #line 27 "defparse.y"
62 #ifndef YYSTYPE
63 typedef union {
64 char *id;
65 int number;
66 } yystype;
67 # define YYSTYPE yystype
68 # define YYSTYPE_IS_TRIVIAL 1
69 #endif
70 #ifndef YYDEBUG
71 # define YYDEBUG 0
72 #endif
73
74
75
76 #define YYFINAL 98
77 #define YYFLAG -32768
78 #define YYNTBASE 35
79
80 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
81 #define YYTRANSLATE(x) ((unsigned)(x) <= 284 ? yytranslate[x] : 57)
82
83 /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
84 static const char yytranslate[] =
85 {
86 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
87 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
88 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
89 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
90 2, 2, 2, 2, 33, 2, 31, 2, 2, 2,
91 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
92 2, 32, 2, 2, 34, 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, 2, 2, 2, 2,
109 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
110 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
111 2, 2, 2, 2, 2, 2, 1, 3, 4, 5,
112 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
113 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
114 26, 27, 28, 29, 30
115 };
116
117 #if YYDEBUG
118 static const short yyprhs[] =
119 {
120 0, 0, 3, 5, 9, 14, 17, 20, 24, 28,
121 31, 34, 37, 40, 43, 48, 49, 52, 60, 63,
122 65, 73, 81, 87, 93, 99, 105, 109, 113, 116,
123 118, 121, 125, 127, 129, 130, 133, 134, 136, 138,
124 140, 142, 144, 146, 148, 150, 151, 153, 154, 156,
125 157, 159, 160, 162, 166, 167, 170, 171, 174, 179,
126 180, 184, 185, 186, 190, 192, 194, 196
127 };
128 static const short yyrhs[] =
129 {
130 35, 36, 0, 36, 0, 3, 51, 54, 0, 4,
131 51, 54, 55, 0, 11, 37, 0, 5, 29, 0,
132 6, 30, 45, 0, 7, 30, 45, 0, 8, 43,
133 0, 9, 43, 0, 10, 41, 0, 12, 39, 0,
134 13, 30, 0, 13, 30, 31, 30, 0, 0, 37,
135 38, 0, 29, 53, 52, 48, 47, 49, 50, 0,
136 39, 40, 0, 40, 0, 29, 32, 29, 31, 29,
137 31, 29, 0, 29, 32, 29, 31, 29, 31, 30,
138 0, 29, 32, 29, 31, 29, 0, 29, 32, 29,
139 31, 30, 0, 29, 31, 29, 31, 29, 0, 29,
140 31, 29, 31, 30, 0, 29, 31, 29, 0, 29,
141 31, 30, 0, 41, 42, 0, 42, 0, 29, 43,
142 0, 43, 44, 46, 0, 46, 0, 33, 0, 0,
143 33, 30, 0, 0, 16, 0, 17, 0, 18, 0,
144 19, 0, 20, 0, 23, 0, 24, 0, 15, 0,
145 0, 21, 0, 0, 9, 0, 0, 22, 0, 0,
146 29, 0, 29, 31, 29, 0, 0, 34, 30, 0,
147 0, 32, 29, 0, 32, 29, 31, 29, 0, 0,
148 14, 32, 30, 0, 0, 0, 55, 44, 56, 0,
149 25, 0, 26, 0, 27, 0, 28, 0
150 };
151
152 #endif
153
154 #if YYDEBUG
155 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
156 static const short yyrline[] =
157 {
158 0, 44, 45, 48, 50, 51, 52, 53, 54, 55,
159 56, 57, 58, 59, 60, 64, 66, 69, 73, 75,
160 78, 80, 81, 82, 83, 84, 85, 86, 89, 91,
161 94, 98, 100, 103, 105, 107, 108, 111, 113, 114,
162 115, 116, 117, 118, 121, 123, 126, 128, 131, 133,
163 136, 138, 141, 142, 148, 151, 153, 156, 158, 164,
164 167, 168, 171, 173, 176, 178, 179, 180
165 };
166 #endif
167
168
169 #if (YYDEBUG) || defined YYERROR_VERBOSE
170
171 /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
172 static const char *const yytname[] =
173 {
174 "$", "error", "$undefined.", "NAME", "LIBRARY", "DESCRIPTION",
175 "STACKSIZE", "HEAPSIZE", "CODE", "DATA", "SECTIONS", "EXPORTS",
176 "IMPORTS", "VERSIONK", "BASE", "CONSTANT", "READ", "WRITE", "EXECUTE",
177 "SHARED", "NONSHARED", "NONAME", "PRIVATE", "SINGLE", "MULTIPLE",
178 "INITINSTANCE", "INITGLOBAL", "TERMINSTANCE", "TERMGLOBAL", "ID",
179 "NUMBER", "'.'", "'='", "','", "'@'", "start", "command", "explist",
180 "expline", "implist", "impline", "seclist", "secline", "attr_list",
181 "opt_comma", "opt_number", "attr", "opt_CONSTANT", "opt_NONAME",
182 "opt_DATA", "opt_PRIVATE", "opt_name", "opt_ordinal", "opt_equal_name",
183 "opt_base", "option_list", "option", 0
184 };
185 #endif
186
187 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
188 static const short yyr1[] =
189 {
190 0, 35, 35, 36, 36, 36, 36, 36, 36, 36,
191 36, 36, 36, 36, 36, 37, 37, 38, 39, 39,
192 40, 40, 40, 40, 40, 40, 40, 40, 41, 41,
193 42, 43, 43, 44, 44, 45, 45, 46, 46, 46,
194 46, 46, 46, 46, 47, 47, 48, 48, 49, 49,
195 50, 50, 51, 51, 51, 52, 52, 53, 53, 53,
196 54, 54, 55, 55, 56, 56, 56, 56
197 };
198
199 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
200 static const short yyr2[] =
201 {
202 0, 2, 1, 3, 4, 2, 2, 3, 3, 2,
203 2, 2, 2, 2, 4, 0, 2, 7, 2, 1,
204 7, 7, 5, 5, 5, 5, 3, 3, 2, 1,
205 2, 3, 1, 1, 0, 2, 0, 1, 1, 1,
206 1, 1, 1, 1, 1, 0, 1, 0, 1, 0,
207 1, 0, 1, 3, 0, 2, 0, 2, 4, 0,
208 3, 0, 0, 3, 1, 1, 1, 1
209 };
210
211 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
212 doesn't specify something else to do. Zero means the default is an
213 error. */
214 static const short yydefact[] =
215 {
216 0, 54, 54, 0, 0, 0, 0, 0, 0, 15,
217 0, 0, 0, 2, 52, 61, 61, 6, 36, 36,
218 37, 38, 39, 40, 41, 42, 43, 9, 32, 10,
219 0, 11, 29, 5, 0, 12, 19, 13, 1, 0,
220 0, 3, 62, 0, 7, 8, 33, 0, 30, 28,
221 59, 16, 0, 0, 18, 0, 53, 0, 4, 35,
222 31, 0, 56, 26, 27, 0, 14, 60, 0, 57,
223 0, 47, 0, 0, 64, 65, 66, 67, 63, 0,
224 55, 46, 45, 24, 25, 22, 23, 58, 44, 49,
225 0, 48, 51, 20, 21, 50, 17, 0, 0
226 };
227
228 static const short yydefgoto[] =
229 {
230 12, 13, 33, 51, 35, 36, 31, 32, 27, 47,
231 44, 28, 89, 82, 92, 96, 15, 71, 62, 41,
232 58, 78
233 };
234
235 static const short yypact[] =
236 {
237 32, -12, -12, 17, -8, 33, -4, -4, 35,-32768,
238 36, 37, 21,-32768, 38, 48, 48,-32768, 39, 39,
239 -32768,-32768,-32768,-32768,-32768,-32768,-32768, -15,-32768, -15,
240 -4, 35,-32768, 41, -25, 36,-32768, 40,-32768, 44,
241 34,-32768,-32768, 45,-32768,-32768,-32768, -4, -15,-32768,
242 42,-32768, -19, 47,-32768, 49,-32768, 50, 22,-32768,
243 -32768, 52, 43, 51,-32768, 53,-32768,-32768, 26, 54,
244 56, 57, 27, 29,-32768,-32768,-32768,-32768,-32768, 58,
245 -32768,-32768, 68,-32768,-32768, 59,-32768,-32768,-32768, 79,
246 31,-32768, 46,-32768,-32768,-32768,-32768, 89,-32768
247 };
248
249 static const short yypgoto[] =
250 {
251 -32768, 80,-32768,-32768,-32768, 60,-32768, 62, -7, 55,
252 72, 61,-32768,-32768,-32768,-32768, 92,-32768,-32768, 81,
253 -32768,-32768
254 };
255
256
257 #define YYLAST 113
258
259
260 static const short yytable[] =
261 {
262 29, -34, -34, -34, -34, -34, 52, 53, -34, -34,
263 63, 64, 20, 21, 22, 23, 24, 14, 46, 25,
264 26, 97, 18, 48, 1, 2, 3, 4, 5, 6,
265 7, 8, 9, 10, 11, 1, 2, 3, 4, 5,
266 6, 7, 8, 9, 10, 11, 17, -34, -34, -34,
267 -34, 74, 75, 76, 77, 46, 83, 84, 85, 86,
268 93, 94, 40, 19, 30, 34, 57, 37, 95, 39,
269 50, 55, 43, 56, 61, 59, 65, 70, 81, 66,
270 67, 69, 72, 88, 73, 79, 80, 87, 91, 98,
271 90, 45, 38, 49, 16, 54, 0, 42, 0, 0,
272 0, 0, 0, 0, 0, 0, 0, 0, 60, 0,
273 0, 0, 0, 68
274 };
275
276 static const short yycheck[] =
277 {
278 7, 16, 17, 18, 19, 20, 31, 32, 23, 24,
279 29, 30, 16, 17, 18, 19, 20, 29, 33, 23,
280 24, 0, 30, 30, 3, 4, 5, 6, 7, 8,
281 9, 10, 11, 12, 13, 3, 4, 5, 6, 7,
282 8, 9, 10, 11, 12, 13, 29, 25, 26, 27,
283 28, 25, 26, 27, 28, 33, 29, 30, 29, 30,
284 29, 30, 14, 30, 29, 29, 32, 30, 22, 31,
285 29, 31, 33, 29, 32, 30, 29, 34, 21, 30,
286 30, 29, 31, 15, 31, 31, 30, 29, 9, 0,
287 31, 19, 12, 31, 2, 35, -1, 16, -1, -1,
288 -1, -1, -1, -1, -1, -1, -1, -1, 47, -1,
289 -1, -1, -1, 58
290 };
291 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
292 #line 3 "/usr/share/bison-1.35/bison.simple"
293
294 /* Skeleton output parser for bison,
295
296 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
297 Foundation, Inc.
298
299 This program is free software; you can redistribute it and/or modify
300 it under the terms of the GNU General Public License as published by
301 the Free Software Foundation; either version 2, or (at your option)
302 any later version.
303
304 This program is distributed in the hope that it will be useful,
305 but WITHOUT ANY WARRANTY; without even the implied warranty of
306 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
307 GNU General Public License for more details.
308
309 You should have received a copy of the GNU General Public License
310 along with this program; if not, write to the Free Software
311 Foundation, Inc., 59 Temple Place - Suite 330,
312 Boston, MA 02111-1307, USA. */
313
314 /* As a special exception, when this file is copied by Bison into a
315 Bison output file, you may use that output file without restriction.
316 This special exception was added by the Free Software Foundation
317 in version 1.24 of Bison. */
318
319 /* This is the parser code that is written into each bison parser when
320 the %semantic_parser declaration is not specified in the grammar.
321 It was written by Richard Stallman by simplifying the hairy parser
322 used when %semantic_parser is specified. */
323
324 /* All symbols defined below should begin with yy or YY, to avoid
325 infringing on user name space. This should be done even for local
326 variables, as they might otherwise be expanded by user macros.
327 There are some unavoidable exceptions within include files to
328 define necessary library symbols; they are noted "INFRINGES ON
329 USER NAME SPACE" below. */
330
331 #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
332
333 /* The parser invokes alloca or malloc; define the necessary symbols. */
334
335 # if YYSTACK_USE_ALLOCA
336 # define YYSTACK_ALLOC alloca
337 # else
338 # ifndef YYSTACK_USE_ALLOCA
339 # if defined (alloca) || defined (_ALLOCA_H)
340 # define YYSTACK_ALLOC alloca
341 # else
342 # ifdef __GNUC__
343 # define YYSTACK_ALLOC __builtin_alloca
344 # endif
345 # endif
346 # endif
347 # endif
348
349 # ifdef YYSTACK_ALLOC
350 /* Pacify GCC's `empty if-body' warning. */
351 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
352 # else
353 # if defined (__STDC__) || defined (__cplusplus)
354 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
355 # define YYSIZE_T size_t
356 # endif
357 # define YYSTACK_ALLOC malloc
358 # define YYSTACK_FREE free
359 # endif
360 #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
361
362
363 #if (! defined (yyoverflow) \
364 && (! defined (__cplusplus) \
365 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
366
367 /* A type that is properly aligned for any stack member. */
368 union yyalloc
369 {
370 short yyss;
371 YYSTYPE yyvs;
372 # if YYLSP_NEEDED
373 YYLTYPE yyls;
374 # endif
375 };
376
377 /* The size of the maximum gap between one aligned stack and the next. */
378 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
379
380 /* The size of an array large to enough to hold all stacks, each with
381 N elements. */
382 # if YYLSP_NEEDED
383 # define YYSTACK_BYTES(N) \
384 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
385 + 2 * YYSTACK_GAP_MAX)
386 # else
387 # define YYSTACK_BYTES(N) \
388 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
389 + YYSTACK_GAP_MAX)
390 # endif
391
392 /* Copy COUNT objects from FROM to TO. The source and destination do
393 not overlap. */
394 # ifndef YYCOPY
395 # if 1 < __GNUC__
396 # define YYCOPY(To, From, Count) \
397 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
398 # else
399 # define YYCOPY(To, From, Count) \
400 do \
401 { \
402 register YYSIZE_T yyi; \
403 for (yyi = 0; yyi < (Count); yyi++) \
404 (To)[yyi] = (From)[yyi]; \
405 } \
406 while (0)
407 # endif
408 # endif
409
410 /* Relocate STACK from its old location to the new one. The
411 local variables YYSIZE and YYSTACKSIZE give the old and new number of
412 elements in the stack, and YYPTR gives the new location of the
413 stack. Advance YYPTR to a properly aligned location for the next
414 stack. */
415 # define YYSTACK_RELOCATE(Stack) \
416 do \
417 { \
418 YYSIZE_T yynewbytes; \
419 YYCOPY (&yyptr->Stack, Stack, yysize); \
420 Stack = &yyptr->Stack; \
421 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
422 yyptr += yynewbytes / sizeof (*yyptr); \
423 } \
424 while (0)
425
426 #endif
427
428
429 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
430 # define YYSIZE_T __SIZE_TYPE__
431 #endif
432 #if ! defined (YYSIZE_T) && defined (size_t)
433 # define YYSIZE_T size_t
434 #endif
435 #if ! defined (YYSIZE_T)
436 # if defined (__STDC__) || defined (__cplusplus)
437 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
438 # define YYSIZE_T size_t
439 # endif
440 #endif
441 #if ! defined (YYSIZE_T)
442 # define YYSIZE_T unsigned int
443 #endif
444
445 #define yyerrok (yyerrstatus = 0)
446 #define yyclearin (yychar = YYEMPTY)
447 #define YYEMPTY -2
448 #define YYEOF 0
449 #define YYACCEPT goto yyacceptlab
450 #define YYABORT goto yyabortlab
451 #define YYERROR goto yyerrlab1
452 /* Like YYERROR except do call yyerror. This remains here temporarily
453 to ease the transition to the new meaning of YYERROR, for GCC.
454 Once GCC version 2 has supplanted version 1, this can go. */
455 #define YYFAIL goto yyerrlab
456 #define YYRECOVERING() (!!yyerrstatus)
457 #define YYBACKUP(Token, Value) \
458 do \
459 if (yychar == YYEMPTY && yylen == 1) \
460 { \
461 yychar = (Token); \
462 yylval = (Value); \
463 yychar1 = YYTRANSLATE (yychar); \
464 YYPOPSTACK; \
465 goto yybackup; \
466 } \
467 else \
468 { \
469 yyerror ("syntax error: cannot back up"); \
470 YYERROR; \
471 } \
472 while (0)
473
474 #define YYTERROR 1
475 #define YYERRCODE 256
476
477
478 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
479 are run).
480
481 When YYLLOC_DEFAULT is run, CURRENT is set the location of the
482 first token. By default, to implement support for ranges, extend
483 its range to the last symbol. */
484
485 #ifndef YYLLOC_DEFAULT
486 # define YYLLOC_DEFAULT(Current, Rhs, N) \
487 Current.last_line = Rhs[N].last_line; \
488 Current.last_column = Rhs[N].last_column;
489 #endif
490
491
492 /* YYLEX -- calling `yylex' with the right arguments. */
493
494 #if YYPURE
495 # if YYLSP_NEEDED
496 # ifdef YYLEX_PARAM
497 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
498 # else
499 # define YYLEX yylex (&yylval, &yylloc)
500 # endif
501 # else /* !YYLSP_NEEDED */
502 # ifdef YYLEX_PARAM
503 # define YYLEX yylex (&yylval, YYLEX_PARAM)
504 # else
505 # define YYLEX yylex (&yylval)
506 # endif
507 # endif /* !YYLSP_NEEDED */
508 #else /* !YYPURE */
509 # define YYLEX yylex ()
510 #endif /* !YYPURE */
511
512
513 /* Enable debugging if requested. */
514 #if YYDEBUG
515
516 # ifndef YYFPRINTF
517 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
518 # define YYFPRINTF fprintf
519 # endif
520
521 # define YYDPRINTF(Args) \
522 do { \
523 if (yydebug) \
524 YYFPRINTF Args; \
525 } while (0)
526 /* Nonzero means print parse trace. It is left uninitialized so that
527 multiple parsers can coexist. */
528 int yydebug;
529 #else /* !YYDEBUG */
530 # define YYDPRINTF(Args)
531 #endif /* !YYDEBUG */
532
533 /* YYINITDEPTH -- initial size of the parser's stacks. */
534 #ifndef YYINITDEPTH
535 # define YYINITDEPTH 200
536 #endif
537
538 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
539 if the built-in stack extension method is used).
540
541 Do not make this value too large; the results are undefined if
542 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
543 evaluated with infinite-precision integer arithmetic. */
544
545 #if YYMAXDEPTH == 0
546 # undef YYMAXDEPTH
547 #endif
548
549 #ifndef YYMAXDEPTH
550 # define YYMAXDEPTH 10000
551 #endif
552
553 #ifdef YYERROR_VERBOSE
554
555 # ifndef yystrlen
556 # if defined (__GLIBC__) && defined (_STRING_H)
557 # define yystrlen strlen
558 # else
559 /* Return the length of YYSTR. */
560 static YYSIZE_T
561 # if defined (__STDC__) || defined (__cplusplus)
yystrlen(const char * yystr)562 yystrlen (const char *yystr)
563 # else
564 yystrlen (yystr)
565 const char *yystr;
566 # endif
567 {
568 register const char *yys = yystr;
569
570 while (*yys++ != '\0')
571 continue;
572
573 return yys - yystr - 1;
574 }
575 # endif
576 # endif
577
578 # ifndef yystpcpy
579 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
580 # define yystpcpy stpcpy
581 # else
582 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
583 YYDEST. */
584 static char *
585 # if defined (__STDC__) || defined (__cplusplus)
yystpcpy(char * yydest,const char * yysrc)586 yystpcpy (char *yydest, const char *yysrc)
587 # else
588 yystpcpy (yydest, yysrc)
589 char *yydest;
590 const char *yysrc;
591 # endif
592 {
593 register char *yyd = yydest;
594 register const char *yys = yysrc;
595
596 while ((*yyd++ = *yys++) != '\0')
597 continue;
598
599 return yyd - 1;
600 }
601 # endif
602 # endif
603 #endif
604
605 #line 315 "/usr/share/bison-1.35/bison.simple"
606
607
608 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
609 into yyparse. The argument should have type void *.
610 It should actually point to an object.
611 Grammar actions can access the variable by casting it
612 to the proper pointer type. */
613
614 #ifdef YYPARSE_PARAM
615 # if defined (__STDC__) || defined (__cplusplus)
616 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
617 # define YYPARSE_PARAM_DECL
618 # else
619 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
620 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
621 # endif
622 #else /* !YYPARSE_PARAM */
623 # define YYPARSE_PARAM_ARG
624 # define YYPARSE_PARAM_DECL
625 #endif /* !YYPARSE_PARAM */
626
627 /* Prevent warning if -Wstrict-prototypes. */
628 #ifdef __GNUC__
629 # ifdef YYPARSE_PARAM
630 int yyparse (void *);
631 # else
632 int yyparse (void);
633 # endif
634 #endif
635
636 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
637 variables are global, or local to YYPARSE. */
638
639 #define YY_DECL_NON_LSP_VARIABLES \
640 /* The lookahead symbol. */ \
641 int yychar; \
642 \
643 /* The semantic value of the lookahead symbol. */ \
644 YYSTYPE yylval; \
645 \
646 /* Number of parse errors so far. */ \
647 int yynerrs;
648
649 #if YYLSP_NEEDED
650 # define YY_DECL_VARIABLES \
651 YY_DECL_NON_LSP_VARIABLES \
652 \
653 /* Location data for the lookahead symbol. */ \
654 YYLTYPE yylloc;
655 #else
656 # define YY_DECL_VARIABLES \
657 YY_DECL_NON_LSP_VARIABLES
658 #endif
659
660
661 /* If nonreentrant, generate the variables here. */
662
663 #if !YYPURE
664 YY_DECL_VARIABLES
665 #endif /* !YYPURE */
666
667 int
yyparse(YYPARSE_PARAM_ARG)668 yyparse (YYPARSE_PARAM_ARG)
669 YYPARSE_PARAM_DECL
670 {
671 /* If reentrant, generate the variables here. */
672 #if YYPURE
673 YY_DECL_VARIABLES
674 #endif /* !YYPURE */
675
676 register int yystate;
677 register int yyn;
678 int yyresult;
679 /* Number of tokens to shift before error messages enabled. */
680 int yyerrstatus;
681 /* Lookahead token as an internal (translated) token number. */
682 int yychar1 = 0;
683
684 /* Three stacks and their tools:
685 `yyss': related to states,
686 `yyvs': related to semantic values,
687 `yyls': related to locations.
688
689 Refer to the stacks thru separate pointers, to allow yyoverflow
690 to reallocate them elsewhere. */
691
692 /* The state stack. */
693 short yyssa[YYINITDEPTH];
694 short *yyss = yyssa;
695 register short *yyssp;
696
697 /* The semantic value stack. */
698 YYSTYPE yyvsa[YYINITDEPTH];
699 YYSTYPE *yyvs = yyvsa;
700 register YYSTYPE *yyvsp;
701
702 #if YYLSP_NEEDED
703 /* The location stack. */
704 YYLTYPE yylsa[YYINITDEPTH];
705 YYLTYPE *yyls = yylsa;
706 YYLTYPE *yylsp;
707 #endif
708
709 #if YYLSP_NEEDED
710 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
711 #else
712 # define YYPOPSTACK (yyvsp--, yyssp--)
713 #endif
714
715 YYSIZE_T yystacksize = YYINITDEPTH;
716
717
718 /* The variables used to return semantic value and location from the
719 action routines. */
720 YYSTYPE yyval;
721 #if YYLSP_NEEDED
722 YYLTYPE yyloc;
723 #endif
724
725 /* When reducing, the number of symbols on the RHS of the reduced
726 rule. */
727 int yylen;
728
729 YYDPRINTF ((stderr, "Starting parse\n"));
730
731 yystate = 0;
732 yyerrstatus = 0;
733 yynerrs = 0;
734 yychar = YYEMPTY; /* Cause a token to be read. */
735
736 /* Initialize stack pointers.
737 Waste one element of value and location stack
738 so that they stay on the same level as the state stack.
739 The wasted elements are never initialized. */
740
741 yyssp = yyss;
742 yyvsp = yyvs;
743 #if YYLSP_NEEDED
744 yylsp = yyls;
745 #endif
746 goto yysetstate;
747
748 /*------------------------------------------------------------.
749 | yynewstate -- Push a new state, which is found in yystate. |
750 `------------------------------------------------------------*/
751 yynewstate:
752 /* In all cases, when you get here, the value and location stacks
753 have just been pushed. so pushing a state here evens the stacks.
754 */
755 yyssp++;
756
757 yysetstate:
758 *yyssp = yystate;
759
760 if (yyssp >= yyss + yystacksize - 1)
761 {
762 /* Get the current used size of the three stacks, in elements. */
763 YYSIZE_T yysize = yyssp - yyss + 1;
764
765 #ifdef yyoverflow
766 {
767 /* Give user a chance to reallocate the stack. Use copies of
768 these so that the &'s don't force the real ones into
769 memory. */
770 YYSTYPE *yyvs1 = yyvs;
771 short *yyss1 = yyss;
772
773 /* Each stack pointer address is followed by the size of the
774 data in use in that stack, in bytes. */
775 # if YYLSP_NEEDED
776 YYLTYPE *yyls1 = yyls;
777 /* This used to be a conditional around just the two extra args,
778 but that might be undefined if yyoverflow is a macro. */
779 yyoverflow ("parser stack overflow",
780 &yyss1, yysize * sizeof (*yyssp),
781 &yyvs1, yysize * sizeof (*yyvsp),
782 &yyls1, yysize * sizeof (*yylsp),
783 &yystacksize);
784 yyls = yyls1;
785 # else
786 yyoverflow ("parser stack overflow",
787 &yyss1, yysize * sizeof (*yyssp),
788 &yyvs1, yysize * sizeof (*yyvsp),
789 &yystacksize);
790 # endif
791 yyss = yyss1;
792 yyvs = yyvs1;
793 }
794 #else /* no yyoverflow */
795 # ifndef YYSTACK_RELOCATE
796 goto yyoverflowlab;
797 # else
798 /* Extend the stack our own way. */
799 if (yystacksize >= YYMAXDEPTH)
800 goto yyoverflowlab;
801 yystacksize *= 2;
802 if (yystacksize > YYMAXDEPTH)
803 yystacksize = YYMAXDEPTH;
804
805 {
806 short *yyss1 = yyss;
807 union yyalloc *yyptr =
808 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
809 if (! yyptr)
810 goto yyoverflowlab;
811 YYSTACK_RELOCATE (yyss);
812 YYSTACK_RELOCATE (yyvs);
813 # if YYLSP_NEEDED
814 YYSTACK_RELOCATE (yyls);
815 # endif
816 # undef YYSTACK_RELOCATE
817 if (yyss1 != yyssa)
818 YYSTACK_FREE (yyss1);
819 }
820 # endif
821 #endif /* no yyoverflow */
822
823 yyssp = yyss + yysize - 1;
824 yyvsp = yyvs + yysize - 1;
825 #if YYLSP_NEEDED
826 yylsp = yyls + yysize - 1;
827 #endif
828
829 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
830 (unsigned long int) yystacksize));
831
832 if (yyssp >= yyss + yystacksize - 1)
833 YYABORT;
834 }
835
836 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
837
838 goto yybackup;
839
840
841 /*-----------.
842 | yybackup. |
843 `-----------*/
844 yybackup:
845
846 /* Do appropriate processing given the current state. */
847 /* Read a lookahead token if we need one and don't already have one. */
848 /* yyresume: */
849
850 /* First try to decide what to do without reference to lookahead token. */
851
852 yyn = yypact[yystate];
853 if (yyn == YYFLAG)
854 goto yydefault;
855
856 /* Not known => get a lookahead token if don't already have one. */
857
858 /* yychar is either YYEMPTY or YYEOF
859 or a valid token in external form. */
860
861 if (yychar == YYEMPTY)
862 {
863 YYDPRINTF ((stderr, "Reading a token: "));
864 yychar = YYLEX;
865 }
866
867 /* Convert token to internal form (in yychar1) for indexing tables with */
868
869 if (yychar <= 0) /* This means end of input. */
870 {
871 yychar1 = 0;
872 yychar = YYEOF; /* Don't call YYLEX any more */
873
874 YYDPRINTF ((stderr, "Now at end of input.\n"));
875 }
876 else
877 {
878 yychar1 = YYTRANSLATE (yychar);
879
880 #if YYDEBUG
881 /* We have to keep this `#if YYDEBUG', since we use variables
882 which are defined only if `YYDEBUG' is set. */
883 if (yydebug)
884 {
885 YYFPRINTF (stderr, "Next token is %d (%s",
886 yychar, yytname[yychar1]);
887 /* Give the individual parser a way to print the precise
888 meaning of a token, for further debugging info. */
889 # ifdef YYPRINT
890 YYPRINT (stderr, yychar, yylval);
891 # endif
892 YYFPRINTF (stderr, ")\n");
893 }
894 #endif
895 }
896
897 yyn += yychar1;
898 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
899 goto yydefault;
900
901 yyn = yytable[yyn];
902
903 /* yyn is what to do for this token type in this state.
904 Negative => reduce, -yyn is rule number.
905 Positive => shift, yyn is new state.
906 New state is final state => don't bother to shift,
907 just return success.
908 0, or most negative number => error. */
909
910 if (yyn < 0)
911 {
912 if (yyn == YYFLAG)
913 goto yyerrlab;
914 yyn = -yyn;
915 goto yyreduce;
916 }
917 else if (yyn == 0)
918 goto yyerrlab;
919
920 if (yyn == YYFINAL)
921 YYACCEPT;
922
923 /* Shift the lookahead token. */
924 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
925 yychar, yytname[yychar1]));
926
927 /* Discard the token being shifted unless it is eof. */
928 if (yychar != YYEOF)
929 yychar = YYEMPTY;
930
931 *++yyvsp = yylval;
932 #if YYLSP_NEEDED
933 *++yylsp = yylloc;
934 #endif
935
936 /* Count tokens shifted since error; after three, turn off error
937 status. */
938 if (yyerrstatus)
939 yyerrstatus--;
940
941 yystate = yyn;
942 goto yynewstate;
943
944
945 /*-----------------------------------------------------------.
946 | yydefault -- do the default action for the current state. |
947 `-----------------------------------------------------------*/
948 yydefault:
949 yyn = yydefact[yystate];
950 if (yyn == 0)
951 goto yyerrlab;
952 goto yyreduce;
953
954
955 /*-----------------------------.
956 | yyreduce -- Do a reduction. |
957 `-----------------------------*/
958 yyreduce:
959 /* yyn is the number of a rule to reduce with. */
960 yylen = yyr2[yyn];
961
962 /* If YYLEN is nonzero, implement the default value of the action:
963 `$$ = $1'.
964
965 Otherwise, the following line sets YYVAL to the semantic value of
966 the lookahead token. This behavior is undocumented and Bison
967 users should not rely upon it. Assigning to YYVAL
968 unconditionally makes the parser a bit smaller, and it avoids a
969 GCC warning that YYVAL may be used uninitialized. */
970 yyval = yyvsp[1-yylen];
971
972 #if YYLSP_NEEDED
973 /* Similarly for the default location. Let the user run additional
974 commands if for instance locations are ranges. */
975 yyloc = yylsp[1-yylen];
976 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
977 #endif
978
979 #if YYDEBUG
980 /* We have to keep this `#if YYDEBUG', since we use variables which
981 are defined only if `YYDEBUG' is set. */
982 if (yydebug)
983 {
984 int yyi;
985
986 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
987 yyn, yyrline[yyn]);
988
989 /* Print the symbols being reduced, and their result. */
990 for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
991 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
992 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
993 }
994 #endif
995
996 switch (yyn) {
997
998 case 3:
999 #line 49 "defparse.y"
1000 { def_name (yyvsp[-1].id, yyvsp[0].number); }
1001 break;
1002 case 4:
1003 #line 50 "defparse.y"
1004 { def_library (yyvsp[-2].id, yyvsp[-1].number); }
1005 break;
1006 case 6:
1007 #line 52 "defparse.y"
1008 { def_description (yyvsp[0].id);}
1009 break;
1010 case 7:
1011 #line 53 "defparse.y"
1012 { def_stacksize (yyvsp[-1].number, yyvsp[0].number);}
1013 break;
1014 case 8:
1015 #line 54 "defparse.y"
1016 { def_heapsize (yyvsp[-1].number, yyvsp[0].number);}
1017 break;
1018 case 9:
1019 #line 55 "defparse.y"
1020 { def_code (yyvsp[0].number);}
1021 break;
1022 case 10:
1023 #line 56 "defparse.y"
1024 { def_data (yyvsp[0].number);}
1025 break;
1026 case 13:
1027 #line 59 "defparse.y"
1028 { def_version (yyvsp[0].number,0);}
1029 break;
1030 case 14:
1031 #line 60 "defparse.y"
1032 { def_version (yyvsp[-2].number,yyvsp[0].number);}
1033 break;
1034 case 17:
1035 #line 71 "defparse.y"
1036 { def_exports (yyvsp[-6].id, yyvsp[-5].id, yyvsp[-4].number, yyvsp[-3].number, yyvsp[-2].number, yyvsp[-1].number, yyvsp[0].number);}
1037 break;
1038 case 20:
1039 #line 79 "defparse.y"
1040 { def_import (yyvsp[-6].id,yyvsp[-4].id,yyvsp[-2].id,yyvsp[0].id, 0); }
1041 break;
1042 case 21:
1043 #line 80 "defparse.y"
1044 { def_import (yyvsp[-6].id,yyvsp[-4].id,yyvsp[-2].id, 0,yyvsp[0].number); }
1045 break;
1046 case 22:
1047 #line 81 "defparse.y"
1048 { def_import (yyvsp[-4].id,yyvsp[-2].id, 0,yyvsp[0].id, 0); }
1049 break;
1050 case 23:
1051 #line 82 "defparse.y"
1052 { def_import (yyvsp[-4].id,yyvsp[-2].id, 0, 0,yyvsp[0].number); }
1053 break;
1054 case 24:
1055 #line 83 "defparse.y"
1056 { def_import ( 0,yyvsp[-4].id,yyvsp[-2].id,yyvsp[0].id, 0); }
1057 break;
1058 case 25:
1059 #line 84 "defparse.y"
1060 { def_import ( 0,yyvsp[-4].id,yyvsp[-2].id, 0,yyvsp[0].number); }
1061 break;
1062 case 26:
1063 #line 85 "defparse.y"
1064 { def_import ( 0,yyvsp[-2].id, 0,yyvsp[0].id, 0); }
1065 break;
1066 case 27:
1067 #line 86 "defparse.y"
1068 { def_import ( 0,yyvsp[-2].id, 0, 0,yyvsp[0].number); }
1069 break;
1070 case 30:
1071 #line 95 "defparse.y"
1072 { def_section (yyvsp[-1].id,yyvsp[0].number);}
1073 break;
1074 case 35:
1075 #line 107 "defparse.y"
1076 { yyval.number=yyvsp[0].number;}
1077 break;
1078 case 36:
1079 #line 108 "defparse.y"
1080 { yyval.number=-1;}
1081 break;
1082 case 37:
1083 #line 112 "defparse.y"
1084 { yyval.number = 1; }
1085 break;
1086 case 38:
1087 #line 113 "defparse.y"
1088 { yyval.number = 2; }
1089 break;
1090 case 39:
1091 #line 114 "defparse.y"
1092 { yyval.number = 4; }
1093 break;
1094 case 40:
1095 #line 115 "defparse.y"
1096 { yyval.number = 8; }
1097 break;
1098 case 41:
1099 #line 116 "defparse.y"
1100 { yyval.number = 0; }
1101 break;
1102 case 42:
1103 #line 117 "defparse.y"
1104 { yyval.number = 0; }
1105 break;
1106 case 43:
1107 #line 118 "defparse.y"
1108 { yyval.number = 0; }
1109 break;
1110 case 44:
1111 #line 122 "defparse.y"
1112 {yyval.number=1;}
1113 break;
1114 case 45:
1115 #line 123 "defparse.y"
1116 {yyval.number=0;}
1117 break;
1118 case 46:
1119 #line 127 "defparse.y"
1120 {yyval.number=1;}
1121 break;
1122 case 47:
1123 #line 128 "defparse.y"
1124 {yyval.number=0;}
1125 break;
1126 case 48:
1127 #line 132 "defparse.y"
1128 { yyval.number = 1; }
1129 break;
1130 case 49:
1131 #line 133 "defparse.y"
1132 { yyval.number = 0; }
1133 break;
1134 case 50:
1135 #line 137 "defparse.y"
1136 { yyval.number = 1; }
1137 break;
1138 case 51:
1139 #line 138 "defparse.y"
1140 { yyval.number = 0; }
1141 break;
1142 case 52:
1143 #line 141 "defparse.y"
1144 { yyval.id =yyvsp[0].id; }
1145 break;
1146 case 53:
1147 #line 143 "defparse.y"
1148 {
1149 char *name = xmalloc (strlen (yyvsp[-2].id) + 1 + strlen (yyvsp[0].id) + 1);
1150 sprintf (name, "%s.%s", yyvsp[-2].id, yyvsp[0].id);
1151 yyval.id = name;
1152 }
1153 break;
1154 case 54:
1155 #line 148 "defparse.y"
1156 { yyval.id=""; }
1157 break;
1158 case 55:
1159 #line 152 "defparse.y"
1160 { yyval.number=yyvsp[0].number;}
1161 break;
1162 case 56:
1163 #line 153 "defparse.y"
1164 { yyval.number=-1;}
1165 break;
1166 case 57:
1167 #line 157 "defparse.y"
1168 { yyval.id = yyvsp[0].id; }
1169 break;
1170 case 58:
1171 #line 159 "defparse.y"
1172 {
1173 char *name = xmalloc (strlen (yyvsp[-2].id) + 1 + strlen (yyvsp[0].id) + 1);
1174 sprintf (name, "%s.%s", yyvsp[-2].id, yyvsp[0].id);
1175 yyval.id = name;
1176 }
1177 break;
1178 case 59:
1179 #line 164 "defparse.y"
1180 { yyval.id = 0; }
1181 break;
1182 case 60:
1183 #line 167 "defparse.y"
1184 { yyval.number= yyvsp[0].number;}
1185 break;
1186 case 61:
1187 #line 168 "defparse.y"
1188 { yyval.number=-1;}
1189 break;
1190 }
1191
1192 #line 705 "/usr/share/bison-1.35/bison.simple"
1193
1194
1195 yyvsp -= yylen;
1196 yyssp -= yylen;
1197 #if YYLSP_NEEDED
1198 yylsp -= yylen;
1199 #endif
1200
1201 #if YYDEBUG
1202 if (yydebug)
1203 {
1204 short *yyssp1 = yyss - 1;
1205 YYFPRINTF (stderr, "state stack now");
1206 while (yyssp1 != yyssp)
1207 YYFPRINTF (stderr, " %d", *++yyssp1);
1208 YYFPRINTF (stderr, "\n");
1209 }
1210 #endif
1211
1212 *++yyvsp = yyval;
1213 #if YYLSP_NEEDED
1214 *++yylsp = yyloc;
1215 #endif
1216
1217 /* Now `shift' the result of the reduction. Determine what state
1218 that goes to, based on the state we popped back to and the rule
1219 number reduced by. */
1220
1221 yyn = yyr1[yyn];
1222
1223 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1224 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1225 yystate = yytable[yystate];
1226 else
1227 yystate = yydefgoto[yyn - YYNTBASE];
1228
1229 goto yynewstate;
1230
1231
1232 /*------------------------------------.
1233 | yyerrlab -- here on detecting error |
1234 `------------------------------------*/
1235 yyerrlab:
1236 /* If not already recovering from an error, report this error. */
1237 if (!yyerrstatus)
1238 {
1239 ++yynerrs;
1240
1241 #ifdef YYERROR_VERBOSE
1242 yyn = yypact[yystate];
1243
1244 if (yyn > YYFLAG && yyn < YYLAST)
1245 {
1246 YYSIZE_T yysize = 0;
1247 char *yymsg;
1248 int yyx, yycount;
1249
1250 yycount = 0;
1251 /* Start YYX at -YYN if negative to avoid negative indexes in
1252 YYCHECK. */
1253 for (yyx = yyn < 0 ? -yyn : 0;
1254 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1255 if (yycheck[yyx + yyn] == yyx)
1256 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1257 yysize += yystrlen ("parse error, unexpected ") + 1;
1258 yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
1259 yymsg = (char *) YYSTACK_ALLOC (yysize);
1260 if (yymsg != 0)
1261 {
1262 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1263 yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
1264
1265 if (yycount < 5)
1266 {
1267 yycount = 0;
1268 for (yyx = yyn < 0 ? -yyn : 0;
1269 yyx < (int) (sizeof (yytname) / sizeof (char *));
1270 yyx++)
1271 if (yycheck[yyx + yyn] == yyx)
1272 {
1273 const char *yyq = ! yycount ? ", expecting " : " or ";
1274 yyp = yystpcpy (yyp, yyq);
1275 yyp = yystpcpy (yyp, yytname[yyx]);
1276 yycount++;
1277 }
1278 }
1279 yyerror (yymsg);
1280 YYSTACK_FREE (yymsg);
1281 }
1282 else
1283 yyerror ("parse error; also virtual memory exhausted");
1284 }
1285 else
1286 #endif /* defined (YYERROR_VERBOSE) */
1287 yyerror ("parse error");
1288 }
1289 goto yyerrlab1;
1290
1291
1292 /*--------------------------------------------------.
1293 | yyerrlab1 -- error raised explicitly by an action |
1294 `--------------------------------------------------*/
1295 yyerrlab1:
1296 if (yyerrstatus == 3)
1297 {
1298 /* If just tried and failed to reuse lookahead token after an
1299 error, discard it. */
1300
1301 /* return failure if at end of input */
1302 if (yychar == YYEOF)
1303 YYABORT;
1304 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1305 yychar, yytname[yychar1]));
1306 yychar = YYEMPTY;
1307 }
1308
1309 /* Else will try to reuse lookahead token after shifting the error
1310 token. */
1311
1312 yyerrstatus = 3; /* Each real token shifted decrements this */
1313
1314 goto yyerrhandle;
1315
1316
1317 /*-------------------------------------------------------------------.
1318 | yyerrdefault -- current state does not do anything special for the |
1319 | error token. |
1320 `-------------------------------------------------------------------*/
1321 yyerrdefault:
1322 #if 0
1323 /* This is wrong; only states that explicitly want error tokens
1324 should shift them. */
1325
1326 /* If its default is to accept any token, ok. Otherwise pop it. */
1327 yyn = yydefact[yystate];
1328 if (yyn)
1329 goto yydefault;
1330 #endif
1331
1332
1333 /*---------------------------------------------------------------.
1334 | yyerrpop -- pop the current state because it cannot handle the |
1335 | error token |
1336 `---------------------------------------------------------------*/
1337 yyerrpop:
1338 if (yyssp == yyss)
1339 YYABORT;
1340 yyvsp--;
1341 yystate = *--yyssp;
1342 #if YYLSP_NEEDED
1343 yylsp--;
1344 #endif
1345
1346 #if YYDEBUG
1347 if (yydebug)
1348 {
1349 short *yyssp1 = yyss - 1;
1350 YYFPRINTF (stderr, "Error: state stack now");
1351 while (yyssp1 != yyssp)
1352 YYFPRINTF (stderr, " %d", *++yyssp1);
1353 YYFPRINTF (stderr, "\n");
1354 }
1355 #endif
1356
1357 /*--------------.
1358 | yyerrhandle. |
1359 `--------------*/
1360 yyerrhandle:
1361 yyn = yypact[yystate];
1362 if (yyn == YYFLAG)
1363 goto yyerrdefault;
1364
1365 yyn += YYTERROR;
1366 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1367 goto yyerrdefault;
1368
1369 yyn = yytable[yyn];
1370 if (yyn < 0)
1371 {
1372 if (yyn == YYFLAG)
1373 goto yyerrpop;
1374 yyn = -yyn;
1375 goto yyreduce;
1376 }
1377 else if (yyn == 0)
1378 goto yyerrpop;
1379
1380 if (yyn == YYFINAL)
1381 YYACCEPT;
1382
1383 YYDPRINTF ((stderr, "Shifting error token, "));
1384
1385 *++yyvsp = yylval;
1386 #if YYLSP_NEEDED
1387 *++yylsp = yylloc;
1388 #endif
1389
1390 yystate = yyn;
1391 goto yynewstate;
1392
1393
1394 /*-------------------------------------.
1395 | yyacceptlab -- YYACCEPT comes here. |
1396 `-------------------------------------*/
1397 yyacceptlab:
1398 yyresult = 0;
1399 goto yyreturn;
1400
1401 /*-----------------------------------.
1402 | yyabortlab -- YYABORT comes here. |
1403 `-----------------------------------*/
1404 yyabortlab:
1405 yyresult = 1;
1406 goto yyreturn;
1407
1408 /*---------------------------------------------.
1409 | yyoverflowab -- parser overflow comes here. |
1410 `---------------------------------------------*/
1411 yyoverflowlab:
1412 yyerror ("parser stack overflow");
1413 yyresult = 2;
1414 /* Fall through. */
1415
1416 yyreturn:
1417 #ifndef yyoverflow
1418 if (yyss != yyssa)
1419 YYSTACK_FREE (yyss);
1420 #endif
1421 return yyresult;
1422 }
1423 #line 182 "defparse.y"
1424