1 /* A Bison parser, made by GNU Bison 2.0. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
29 /* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
36 /* Identify Bison output. */
40 #define YYSKELETON_NAME "yacc.c"
45 /* Using locations. */
46 #define YYLSP_NEEDED 0
53 /* Put the tokens into the symbol table, so that GDB and other debuggers
56 ENT_TYPEDEF_STRUCT = 258,
58 ENT_EXTERNSTATIC = 260,
77 #define ENT_TYPEDEF_STRUCT 258
78 #define ENT_STRUCT 259
79 #define ENT_EXTERNSTATIC 260
80 #define ENT_YACCUNION 261
86 #define NESTED_PTR 267
89 #define PERCENTPERCENT 270
94 #define PERCENT_ID 275
100 /* Copy the first part of user declarations. */
101 #line 22 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
105 #include "coretypes.h"
107 #include "gengtype.h"
108 #define YYERROR_VERBOSE
111 /* Enabling traces. */
116 /* Enabling verbose error messages. */
117 #ifdef YYERROR_VERBOSE
118 # undef YYERROR_VERBOSE
119 # define YYERROR_VERBOSE 1
121 # define YYERROR_VERBOSE 0
124 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
125 #line 31 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
126 typedef union YYSTYPE {
132 /* Line 190 of yacc.c. */
133 #line 134 "gengtype-yacc.c"
134 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
135 # define YYSTYPE_IS_DECLARED 1
136 # define YYSTYPE_IS_TRIVIAL 1
141 /* Copy the second part of user declarations. */
144 /* Line 213 of yacc.c. */
145 #line 146 "gengtype-yacc.c"
147 #if ! defined (yyoverflow) || YYERROR_VERBOSE
153 # define YYMALLOC malloc
156 /* The parser invokes alloca or malloc; define the necessary symbols. */
158 # ifdef YYSTACK_USE_ALLOCA
159 # if YYSTACK_USE_ALLOCA
161 # define YYSTACK_ALLOC __builtin_alloca
163 # define YYSTACK_ALLOC alloca
168 # ifdef YYSTACK_ALLOC
169 /* Pacify GCC's `empty if-body' warning. */
170 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
172 # if defined (__STDC__) || defined (__cplusplus)
173 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
174 # define YYSIZE_T size_t
176 # define YYSTACK_ALLOC YYMALLOC
177 # define YYSTACK_FREE YYFREE
179 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
182 #if (! defined (yyoverflow) \
183 && (! defined (__cplusplus) \
184 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
186 /* A type that is properly aligned for any stack member. */
193 /* The size of the maximum gap between one aligned stack and the next. */
194 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
196 /* The size of an array large to enough to hold all stacks, each with
198 # define YYSTACK_BYTES(N) \
199 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
200 + YYSTACK_GAP_MAXIMUM)
202 /* Copy COUNT objects from FROM to TO. The source and destination do
205 # if defined (__GNUC__) && 1 < __GNUC__
206 # define YYCOPY(To, From, Count) \
207 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
209 # define YYCOPY(To, From, Count) \
212 register YYSIZE_T yyi; \
213 for (yyi = 0; yyi < (Count); yyi++) \
214 (To)[yyi] = (From)[yyi]; \
220 /* Relocate STACK from its old location to the new one. The
221 local variables YYSIZE and YYSTACKSIZE give the old and new number of
222 elements in the stack, and YYPTR gives the new location of the
223 stack. Advance YYPTR to a properly aligned location for the next
225 # define YYSTACK_RELOCATE(Stack) \
228 YYSIZE_T yynewbytes; \
229 YYCOPY (&yyptr->Stack, Stack, yysize); \
230 Stack = &yyptr->Stack; \
231 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
232 yyptr += yynewbytes / sizeof (*yyptr); \
238 #if defined (__STDC__) || defined (__cplusplus)
239 typedef signed char yysigned_char;
241 typedef short int yysigned_char;
244 /* YYFINAL -- State number of the termination state. */
246 /* YYLAST -- Last index in YYTABLE. */
249 /* YYNTOKENS -- Number of terminals. */
251 /* YYNNTS -- Number of nonterminals. */
253 /* YYNRULES -- Number of rules. */
255 /* YYNRULES -- Number of states. */
256 #define YYNSTATES 127
258 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
260 #define YYMAXUTOK 276
262 #define YYTRANSLATE(YYX) \
263 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
265 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
266 static const unsigned char yytranslate[] =
268 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
269 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
270 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
271 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
272 31, 32, 29, 2, 30, 2, 2, 2, 2, 2,
273 2, 2, 2, 2, 2, 2, 2, 2, 28, 24,
274 26, 25, 27, 2, 2, 2, 2, 2, 2, 2,
275 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
276 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
277 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
278 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
279 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
280 2, 2, 2, 22, 2, 23, 2, 2, 2, 2,
281 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
282 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
283 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
284 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
285 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
286 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
287 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
288 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
289 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
290 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
291 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
292 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
293 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
294 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
295 15, 16, 17, 18, 19, 20, 21
299 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
301 static const unsigned char yyprhs[] =
303 0, 0, 3, 4, 7, 10, 13, 14, 23, 24,
304 32, 38, 45, 53, 55, 57, 59, 66, 67, 71,
305 78, 79, 82, 85, 86, 93, 100, 108, 114, 115,
306 118, 120, 122, 124, 126, 129, 135, 138, 144, 147,
307 150, 156, 157, 163, 167, 170, 171, 173, 180, 182,
308 184, 186, 191, 196, 205, 207, 211, 212, 214, 216
311 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
312 static const yysigned_char yyrhs[] =
314 34, 0, -1, -1, 35, 34, -1, 38, 34, -1,
315 41, 34, -1, -1, 3, 50, 22, 44, 23, 17,
316 36, 24, -1, -1, 4, 50, 22, 44, 23, 37,
317 24, -1, 5, 50, 39, 17, 40, -1, 5, 50,
318 39, 17, 19, 40, -1, 5, 50, 39, 17, 19,
319 19, 40, -1, 47, -1, 24, -1, 25, -1, 6,
320 50, 44, 23, 42, 15, -1, -1, 42, 20, 43,
321 -1, 42, 20, 26, 17, 27, 43, -1, -1, 43,
322 17, -1, 43, 21, -1, -1, 47, 49, 17, 45,
323 24, 44, -1, 47, 49, 17, 19, 24, 44, -1,
324 47, 49, 17, 19, 19, 24, 44, -1, 47, 28,
325 46, 24, 44, -1, -1, 28, 46, -1, 14, -1,
326 17, -1, 16, -1, 17, -1, 47, 29, -1, 9,
327 17, 22, 44, 23, -1, 9, 17, -1, 8, 17,
328 22, 44, 23, -1, 8, 17, -1, 10, 17, -1,
329 10, 17, 22, 48, 23, -1, -1, 17, 25, 14,
330 30, 48, -1, 17, 30, 48, -1, 17, 48, -1,
331 -1, 50, -1, 7, 31, 31, 54, 32, 32, -1,
332 11, -1, 13, -1, 17, -1, 17, 31, 55, 32,
333 -1, 51, 31, 47, 32, -1, 12, 31, 47, 30,
334 55, 30, 55, 32, -1, 52, -1, 53, 30, 52,
335 -1, -1, 53, -1, 18, -1, 55, 18, -1
338 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
339 static const unsigned short int yyrline[] =
341 0, 65, 65, 66, 67, 68, 72, 71, 81, 80,
342 90, 95, 100, 108, 115, 116, 119, 127, 128, 141,
343 160, 161, 172, 185, 186, 196, 206, 216, 220, 221,
344 224, 224, 228, 230, 232, 234, 239, 241, 246, 248,
345 250, 254, 255, 257, 259, 263, 264, 267, 271, 273,
346 277, 279, 281, 283, 295, 300, 307, 308, 311, 313
350 #if YYDEBUG || YYERROR_VERBOSE
351 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
352 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
353 static const char *const yytname[] =
355 "$end", "error", "$undefined", "ENT_TYPEDEF_STRUCT", "ENT_STRUCT",
356 "ENT_EXTERNSTATIC", "ENT_YACCUNION", "GTY_TOKEN", "UNION", "STRUCT",
357 "ENUM", "ALIAS", "NESTED_PTR", "PARAM_IS", "NUM", "\"%%\"", "SCALAR",
358 "ID", "STRING", "ARRAY", "PERCENT_ID", "CHAR", "'{'", "'}'", "';'",
359 "'='", "'<'", "'>'", "':'", "'*'", "','", "'('", "')'", "$accept",
360 "start", "typedef_struct", "@1", "@2", "externstatic", "lasttype",
361 "semiequal", "yacc_union", "yacc_typematch", "yacc_ids", "struct_fields",
362 "bitfieldopt", "bitfieldlen", "type", "enum_items", "optionsopt",
363 "options", "type_option", "option", "optionseq", "optionseqopt",
369 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
371 static const unsigned short int yytoknum[] =
373 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
374 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
375 275, 276, 123, 125, 59, 61, 60, 62, 58, 42,
380 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
381 static const unsigned char yyr1[] =
383 0, 33, 34, 34, 34, 34, 36, 35, 37, 35,
384 38, 38, 38, 39, 40, 40, 41, 42, 42, 42,
385 43, 43, 43, 44, 44, 44, 44, 44, 45, 45,
386 46, 46, 47, 47, 47, 47, 47, 47, 47, 47,
387 47, 48, 48, 48, 48, 49, 49, 50, 51, 51,
388 52, 52, 52, 52, 53, 53, 54, 54, 55, 55
391 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
392 static const unsigned char yyr2[] =
394 0, 2, 0, 2, 2, 2, 0, 8, 0, 7,
395 5, 6, 7, 1, 1, 1, 6, 0, 3, 6,
396 0, 2, 2, 0, 6, 6, 7, 5, 0, 2,
397 1, 1, 1, 1, 2, 5, 2, 5, 2, 2,
398 5, 0, 5, 3, 2, 0, 1, 6, 1, 1,
399 1, 4, 4, 8, 1, 3, 0, 1, 1, 2
402 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
403 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
404 means the default is an error. */
405 static const unsigned char yydefact[] =
407 2, 0, 0, 0, 0, 0, 2, 2, 2, 0,
408 0, 0, 0, 23, 1, 3, 4, 5, 0, 23,
409 23, 0, 0, 0, 32, 33, 0, 13, 0, 45,
410 56, 0, 0, 38, 36, 39, 0, 34, 17, 0,
411 0, 46, 48, 0, 49, 50, 0, 54, 57, 0,
412 0, 8, 23, 23, 41, 0, 14, 15, 10, 0,
413 30, 31, 0, 28, 0, 0, 0, 0, 0, 6,
414 0, 0, 0, 41, 0, 0, 11, 16, 20, 23,
415 0, 0, 0, 0, 58, 0, 0, 55, 47, 0,
416 9, 37, 35, 0, 41, 44, 40, 12, 0, 18,
417 27, 0, 23, 29, 23, 0, 59, 51, 52, 7,
418 0, 43, 0, 21, 22, 23, 25, 24, 0, 41,
419 20, 26, 0, 42, 19, 0, 53
422 /* YYDEFGOTO[NTERM-NUM]. */
423 static const yysigned_char yydefgoto[] =
425 -1, 5, 6, 89, 70, 7, 26, 58, 8, 59,
426 99, 28, 82, 62, 29, 74, 40, 10, 46, 47,
430 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
432 #define YYPACT_NINF -98
433 static const yysigned_char yypact[] =
435 58, 12, 12, 12, 12, 43, 58, 58, 58, 5,
436 45, 53, 29, 29, -98, -98, -98, -98, 28, 29,
437 29, 41, 59, 60, -98, -98, 61, 50, 57, 0,
438 4, 63, 65, 62, 67, 68, 16, -98, -98, 51,
439 70, -98, -98, 66, -98, 69, 71, -98, 52, 49,
440 74, -98, 29, 29, 75, 23, -98, -98, -98, -2,
441 -98, -98, 77, -8, 29, 76, 29, 4, 72, -98,
442 79, 82, 83, -3, 84, 27, -98, -98, 73, 29,
443 31, 51, 85, 44, -98, -9, 37, -98, -98, 86,
444 -98, -98, -98, 81, 75, -98, -98, -98, 91, 36,
445 -98, 87, 29, -98, 29, 76, -98, -98, -98, -98,
446 88, -98, 89, -98, -98, 29, -98, -98, 14, 75,
447 -98, -98, 76, -98, 36, -6, -98
450 /* YYPGOTO[NTERM-NUM]. */
451 static const yysigned_char yypgoto[] =
453 -98, 64, -98, -98, -98, -98, -98, -45, -98, -98,
454 -27, -19, -98, 17, -10, -70, -98, 2, -98, 46,
458 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
459 positive, shift that token. If negative, reduce the rule which
460 number is the opposite. If zero, do what YYDEFACT says.
461 If YYTABLE_NINF, syntax error. */
462 #define YYTABLE_NINF -1
463 static const unsigned char yytable[] =
465 31, 32, 27, 95, 11, 12, 13, 9, 118, 106,
466 76, 80, 106, 77, 73, 42, 43, 44, 78, 9,
467 81, 45, 93, 107, 111, 125, 126, 94, 39, 37,
468 97, 41, 106, 71, 72, 55, 18, 21, 22, 23,
469 56, 57, 75, 14, 122, 24, 25, 56, 57, 123,
470 101, 56, 57, 113, 83, 102, 86, 114, 33, 30,
471 100, 1, 2, 3, 4, 60, 37, 19, 61, 108,
472 15, 16, 17, 37, 105, 20, 34, 35, 36, 37,
473 38, 68, 67, 116, 52, 117, 50, 63, 51, 53,
474 54, 69, 73, 124, 84, 110, 121, 64, 103, 98,
475 65, 79, 66, 90, 88, 91, 92, 96, 112, 104,
476 109, 115, 0, 87, 0, 0, 120, 0, 119
479 static const yysigned_char yycheck[] =
481 19, 20, 12, 73, 2, 3, 4, 7, 105, 18,
482 55, 19, 18, 15, 17, 11, 12, 13, 20, 7,
483 28, 17, 25, 32, 94, 122, 32, 30, 28, 29,
484 75, 29, 18, 52, 53, 19, 31, 8, 9, 10,
485 24, 25, 19, 0, 30, 16, 17, 24, 25, 119,
486 19, 24, 25, 17, 64, 24, 66, 21, 17, 31,
487 79, 3, 4, 5, 6, 14, 29, 22, 17, 32,
488 6, 7, 8, 29, 30, 22, 17, 17, 17, 29,
489 23, 32, 30, 102, 22, 104, 23, 17, 23, 22,
490 22, 17, 17, 120, 18, 14, 115, 31, 81, 26,
491 31, 24, 31, 24, 32, 23, 23, 23, 17, 24,
492 24, 24, -1, 67, -1, -1, 27, -1, 30
495 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
496 symbol of state STATE-NUM. */
497 static const unsigned char yystos[] =
499 0, 3, 4, 5, 6, 34, 35, 38, 41, 7,
500 50, 50, 50, 50, 0, 34, 34, 34, 31, 22,
501 22, 8, 9, 10, 16, 17, 39, 47, 44, 47,
502 31, 44, 44, 17, 17, 17, 17, 29, 23, 28,
503 49, 50, 11, 12, 13, 17, 51, 52, 53, 54,
504 23, 23, 22, 22, 22, 19, 24, 25, 40, 42,
505 14, 17, 46, 17, 31, 31, 31, 30, 32, 17,
506 37, 44, 44, 17, 48, 19, 40, 15, 20, 24,
507 19, 28, 45, 47, 18, 55, 47, 52, 32, 36,
508 24, 23, 23, 25, 30, 48, 23, 40, 26, 43,
509 44, 19, 24, 46, 24, 30, 18, 32, 32, 24,
510 14, 48, 17, 17, 21, 24, 44, 44, 55, 30,
511 27, 44, 30, 48, 43, 55, 32
514 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
515 # define YYSIZE_T __SIZE_TYPE__
517 #if ! defined (YYSIZE_T) && defined (size_t)
518 # define YYSIZE_T size_t
520 #if ! defined (YYSIZE_T)
521 # if defined (__STDC__) || defined (__cplusplus)
522 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
523 # define YYSIZE_T size_t
526 #if ! defined (YYSIZE_T)
527 # define YYSIZE_T unsigned int
530 #define yyerrok (yyerrstatus = 0)
531 #define yyclearin (yychar = YYEMPTY)
535 #define YYACCEPT goto yyacceptlab
536 #define YYABORT goto yyabortlab
537 #define YYERROR goto yyerrorlab
540 /* Like YYERROR except do call yyerror. This remains here temporarily
541 to ease the transition to the new meaning of YYERROR, for GCC.
542 Once GCC version 2 has supplanted version 1, this can go. */
544 #define YYFAIL goto yyerrlab
546 #define YYRECOVERING() (!!yyerrstatus)
548 #define YYBACKUP(Token, Value) \
550 if (yychar == YYEMPTY && yylen == 1) \
554 yytoken = YYTRANSLATE (yychar); \
560 yyerror ("syntax error: cannot back up");\
567 #define YYERRCODE 256
570 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
571 If N is 0, then set CURRENT to the empty location which ends
572 the previous symbol: RHS[0] (always defined). */
574 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
575 #ifndef YYLLOC_DEFAULT
576 # define YYLLOC_DEFAULT(Current, Rhs, N) \
580 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
581 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
582 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
583 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
587 (Current).first_line = (Current).last_line = \
588 YYRHSLOC (Rhs, 0).last_line; \
589 (Current).first_column = (Current).last_column = \
590 YYRHSLOC (Rhs, 0).last_column; \
596 /* YY_LOCATION_PRINT -- Print the location on the stream.
597 This macro was not mandated originally: define only if we know
598 we won't break user code: when these are the locations we know. */
600 #ifndef YY_LOCATION_PRINT
601 # if YYLTYPE_IS_TRIVIAL
602 # define YY_LOCATION_PRINT(File, Loc) \
603 fprintf (File, "%d.%d-%d.%d", \
604 (Loc).first_line, (Loc).first_column, \
605 (Loc).last_line, (Loc).last_column)
607 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
612 /* YYLEX -- calling `yylex' with the right arguments. */
615 # define YYLEX yylex (YYLEX_PARAM)
617 # define YYLEX yylex ()
620 /* Enable debugging if requested. */
624 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
625 # define YYFPRINTF fprintf
628 # define YYDPRINTF(Args) \
634 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
638 YYFPRINTF (stderr, "%s ", Title); \
639 yysymprint (stderr, \
641 YYFPRINTF (stderr, "\n"); \
645 /*------------------------------------------------------------------.
646 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
648 `------------------------------------------------------------------*/
650 #if defined (__STDC__) || defined (__cplusplus)
652 yy_stack_print (short int *bottom, short int *top)
655 yy_stack_print (bottom, top)
660 YYFPRINTF (stderr, "Stack now");
661 for (/* Nothing. */; bottom <= top; ++bottom)
662 YYFPRINTF (stderr, " %d", *bottom);
663 YYFPRINTF (stderr, "\n");
666 # define YY_STACK_PRINT(Bottom, Top) \
669 yy_stack_print ((Bottom), (Top)); \
673 /*------------------------------------------------.
674 | Report that the YYRULE is going to be reduced. |
675 `------------------------------------------------*/
677 #if defined (__STDC__) || defined (__cplusplus)
679 yy_reduce_print (int yyrule)
682 yy_reduce_print (yyrule)
687 unsigned int yylno = yyrline[yyrule];
688 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
690 /* Print the symbols being reduced, and their result. */
691 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
692 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
693 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
696 # define YY_REDUCE_PRINT(Rule) \
699 yy_reduce_print (Rule); \
702 /* Nonzero means print parse trace. It is left uninitialized so that
703 multiple parsers can coexist. */
706 # define YYDPRINTF(Args)
707 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
708 # define YY_STACK_PRINT(Bottom, Top)
709 # define YY_REDUCE_PRINT(Rule)
710 #endif /* !YYDEBUG */
713 /* YYINITDEPTH -- initial size of the parser's stacks. */
715 # define YYINITDEPTH 200
718 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
719 if the built-in stack extension method is used).
721 Do not make this value too large; the results are undefined if
722 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
723 evaluated with infinite-precision integer arithmetic. */
726 # define YYMAXDEPTH 10000
734 # if defined (__GLIBC__) && defined (_STRING_H)
735 # define yystrlen strlen
737 /* Return the length of YYSTR. */
739 # if defined (__STDC__) || defined (__cplusplus)
740 yystrlen (const char *yystr)
746 register const char *yys = yystr;
748 while (*yys++ != '\0')
751 return yys - yystr - 1;
757 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
758 # define yystpcpy stpcpy
760 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
763 # if defined (__STDC__) || defined (__cplusplus)
764 yystpcpy (char *yydest, const char *yysrc)
766 yystpcpy (yydest, yysrc)
771 register char *yyd = yydest;
772 register const char *yys = yysrc;
774 while ((*yyd++ = *yys++) != '\0')
782 #endif /* !YYERROR_VERBOSE */
787 /*--------------------------------.
788 | Print this symbol on YYOUTPUT. |
789 `--------------------------------*/
791 #if defined (__STDC__) || defined (__cplusplus)
793 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
796 yysymprint (yyoutput, yytype, yyvaluep)
802 /* Pacify ``unused variable'' warnings. */
805 if (yytype < YYNTOKENS)
806 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
808 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
812 if (yytype < YYNTOKENS)
813 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
820 YYFPRINTF (yyoutput, ")");
823 #endif /* ! YYDEBUG */
824 /*-----------------------------------------------.
825 | Release the memory associated to this symbol. |
826 `-----------------------------------------------*/
828 #if defined (__STDC__) || defined (__cplusplus)
830 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
833 yydestruct (yymsg, yytype, yyvaluep)
839 /* Pacify ``unused variable'' warnings. */
844 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
855 /* Prevent warnings from -Wmissing-prototypes. */
858 # if defined (__STDC__) || defined (__cplusplus)
859 int yyparse (void *YYPARSE_PARAM);
863 #else /* ! YYPARSE_PARAM */
864 #if defined (__STDC__) || defined (__cplusplus)
869 #endif /* ! YYPARSE_PARAM */
873 /* The look-ahead symbol. */
876 /* The semantic value of the look-ahead symbol. */
879 /* Number of syntax errors so far. */
889 # if defined (__STDC__) || defined (__cplusplus)
890 int yyparse (void *YYPARSE_PARAM)
892 int yyparse (YYPARSE_PARAM)
895 #else /* ! YYPARSE_PARAM */
896 #if defined (__STDC__) || defined (__cplusplus)
907 register int yystate;
910 /* Number of tokens to shift before error messages enabled. */
912 /* Look-ahead token as an internal (translated) token number. */
915 /* Three stacks and their tools:
916 `yyss': related to states,
917 `yyvs': related to semantic values,
918 `yyls': related to locations.
920 Refer to the stacks thru separate pointers, to allow yyoverflow
921 to reallocate them elsewhere. */
923 /* The state stack. */
924 short int yyssa[YYINITDEPTH];
925 short int *yyss = yyssa;
926 register short int *yyssp;
928 /* The semantic value stack. */
929 YYSTYPE yyvsa[YYINITDEPTH];
930 YYSTYPE *yyvs = yyvsa;
931 register YYSTYPE *yyvsp;
935 #define YYPOPSTACK (yyvsp--, yyssp--)
937 YYSIZE_T yystacksize = YYINITDEPTH;
939 /* The variables used to return semantic value and location from the
944 /* When reducing, the number of symbols on the RHS of the reduced
948 YYDPRINTF ((stderr, "Starting parse\n"));
953 yychar = YYEMPTY; /* Cause a token to be read. */
955 /* Initialize stack pointers.
956 Waste one element of value and location stack
957 so that they stay on the same level as the state stack.
958 The wasted elements are never initialized. */
968 /*------------------------------------------------------------.
969 | yynewstate -- Push a new state, which is found in yystate. |
970 `------------------------------------------------------------*/
972 /* In all cases, when you get here, the value and location stacks
973 have just been pushed. so pushing a state here evens the stacks.
980 if (yyss + yystacksize - 1 <= yyssp)
982 /* Get the current used size of the three stacks, in elements. */
983 YYSIZE_T yysize = yyssp - yyss + 1;
987 /* Give user a chance to reallocate the stack. Use copies of
988 these so that the &'s don't force the real ones into
990 YYSTYPE *yyvs1 = yyvs;
991 short int *yyss1 = yyss;
994 /* Each stack pointer address is followed by the size of the
995 data in use in that stack, in bytes. This used to be a
996 conditional around just the two extra args, but that might
997 be undefined if yyoverflow is a macro. */
998 yyoverflow ("parser stack overflow",
999 &yyss1, yysize * sizeof (*yyssp),
1000 &yyvs1, yysize * sizeof (*yyvsp),
1007 #else /* no yyoverflow */
1008 # ifndef YYSTACK_RELOCATE
1011 /* Extend the stack our own way. */
1012 if (YYMAXDEPTH <= yystacksize)
1015 if (YYMAXDEPTH < yystacksize)
1016 yystacksize = YYMAXDEPTH;
1019 short int *yyss1 = yyss;
1020 union yyalloc *yyptr =
1021 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1024 YYSTACK_RELOCATE (yyss);
1025 YYSTACK_RELOCATE (yyvs);
1027 # undef YYSTACK_RELOCATE
1029 YYSTACK_FREE (yyss1);
1032 #endif /* no yyoverflow */
1034 yyssp = yyss + yysize - 1;
1035 yyvsp = yyvs + yysize - 1;
1038 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1039 (unsigned long int) yystacksize));
1041 if (yyss + yystacksize - 1 <= yyssp)
1045 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1054 /* Do appropriate processing given the current state. */
1055 /* Read a look-ahead token if we need one and don't already have one. */
1058 /* First try to decide what to do without reference to look-ahead token. */
1060 yyn = yypact[yystate];
1061 if (yyn == YYPACT_NINF)
1064 /* Not known => get a look-ahead token if don't already have one. */
1066 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1067 if (yychar == YYEMPTY)
1069 YYDPRINTF ((stderr, "Reading a token: "));
1073 if (yychar <= YYEOF)
1075 yychar = yytoken = YYEOF;
1076 YYDPRINTF ((stderr, "Now at end of input.\n"));
1080 yytoken = YYTRANSLATE (yychar);
1081 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1084 /* If the proper action on seeing token YYTOKEN is to reduce or to
1085 detect an error, take that action. */
1087 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1092 if (yyn == 0 || yyn == YYTABLE_NINF)
1101 /* Shift the look-ahead token. */
1102 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1104 /* Discard the token being shifted unless it is eof. */
1105 if (yychar != YYEOF)
1111 /* Count tokens shifted since error; after three, turn off error
1120 /*-----------------------------------------------------------.
1121 | yydefault -- do the default action for the current state. |
1122 `-----------------------------------------------------------*/
1124 yyn = yydefact[yystate];
1130 /*-----------------------------.
1131 | yyreduce -- Do a reduction. |
1132 `-----------------------------*/
1134 /* yyn is the number of a rule to reduce with. */
1137 /* If YYLEN is nonzero, implement the default value of the action:
1140 Otherwise, the following line sets YYVAL to garbage.
1141 This behavior is undocumented and Bison
1142 users should not rely upon it. Assigning to YYVAL
1143 unconditionally makes the parser a bit smaller, and it avoids a
1144 GCC warning that YYVAL may be used uninitialized. */
1145 yyval = yyvsp[1-yylen];
1148 YY_REDUCE_PRINT (yyn);
1152 #line 72 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1154 new_structure ((yyvsp[-5].t)->u.s.tag, UNION_P ((yyvsp[-5].t)), &lexer_line,
1155 (yyvsp[-2].p), (yyvsp[-4].o));
1156 do_typedef ((yyvsp[0].s), (yyvsp[-5].t), &lexer_line);
1157 lexer_toplevel_done = 1;
1162 #line 79 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1167 #line 81 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1169 new_structure ((yyvsp[-4].t)->u.s.tag, UNION_P ((yyvsp[-4].t)), &lexer_line,
1170 (yyvsp[-1].p), (yyvsp[-3].o));
1171 lexer_toplevel_done = 1;
1176 #line 87 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1181 #line 91 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1183 note_variable ((yyvsp[-1].s), adjust_field_type ((yyvsp[-2].t), (yyvsp[-3].o)), (yyvsp[-3].o),
1189 #line 96 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1191 note_variable ((yyvsp[-2].s), create_array ((yyvsp[-3].t), (yyvsp[-1].s)),
1192 (yyvsp[-4].o), &lexer_line);
1197 #line 101 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1199 note_variable ((yyvsp[-3].s), create_array (create_array ((yyvsp[-4].t), (yyvsp[-1].s)),
1201 (yyvsp[-5].o), &lexer_line);
1206 #line 109 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1208 lexer_toplevel_done = 1;
1209 (yyval.t) = (yyvsp[0].t);
1214 #line 121 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1216 note_yacc_type ((yyvsp[-4].o), (yyvsp[-3].p), (yyvsp[-1].p), &lexer_line);
1221 #line 127 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1222 { (yyval.p) = NULL; ;}
1226 #line 129 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1229 for (p = (yyvsp[0].p); p->next != NULL; p = p->next)
1236 p->next = (yyvsp[-2].p);
1237 (yyval.p) = (yyvsp[0].p);
1242 #line 142 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1245 type_p newtype = NULL;
1246 if (strcmp ((yyvsp[-4].s), "type") == 0)
1247 newtype = (type_p) 1;
1248 for (p = (yyvsp[0].p); p->next != NULL; p = p->next)
1250 p->name = (yyvsp[-2].s);
1253 p->name = (yyvsp[-2].s);
1254 p->next = (yyvsp[-5].p);
1256 (yyval.p) = (yyvsp[0].p);
1261 #line 160 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1262 { (yyval.p) = NULL; ;}
1266 #line 162 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1268 pair_p p = XCNEW (struct pair);
1269 p->next = (yyvsp[-1].p);
1270 p->line = lexer_line;
1271 p->opt = XNEW (struct options);
1272 p->opt->name = "tag";
1273 p->opt->next = NULL;
1274 p->opt->info = (char *)(yyvsp[0].s);
1280 #line 173 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1282 pair_p p = XCNEW (struct pair);
1283 p->next = (yyvsp[-1].p);
1284 p->line = lexer_line;
1285 p->opt = XNEW (struct options);
1286 p->opt->name = "tag";
1287 p->opt->next = NULL;
1288 p->opt->info = xasprintf ("'%s'", (yyvsp[0].s));
1294 #line 185 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1295 { (yyval.p) = NULL; ;}
1299 #line 187 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1301 pair_p p = XNEW (struct pair);
1302 p->type = adjust_field_type ((yyvsp[-5].t), (yyvsp[-4].o));
1303 p->opt = (yyvsp[-4].o);
1304 p->name = (yyvsp[-3].s);
1305 p->next = (yyvsp[0].p);
1306 p->line = lexer_line;
1312 #line 197 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1314 pair_p p = XNEW (struct pair);
1315 p->type = adjust_field_type (create_array ((yyvsp[-5].t), (yyvsp[-2].s)), (yyvsp[-4].o));
1316 p->opt = (yyvsp[-4].o);
1317 p->name = (yyvsp[-3].s);
1318 p->next = (yyvsp[0].p);
1319 p->line = lexer_line;
1325 #line 207 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1327 pair_p p = XNEW (struct pair);
1328 p->type = create_array (create_array ((yyvsp[-6].t), (yyvsp[-2].s)), (yyvsp[-3].s));
1329 p->opt = (yyvsp[-5].o);
1330 p->name = (yyvsp[-4].s);
1331 p->next = (yyvsp[0].p);
1332 p->line = lexer_line;
1338 #line 217 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1339 { (yyval.p) = (yyvsp[0].p); ;}
1343 #line 225 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1348 #line 229 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1349 { (yyval.t) = (yyvsp[0].t); ;}
1353 #line 231 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1354 { (yyval.t) = resolve_typedef ((yyvsp[0].s), &lexer_line); ;}
1358 #line 233 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1359 { (yyval.t) = create_pointer ((yyvsp[-1].t)); ;}
1363 #line 235 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1365 new_structure ((yyvsp[-3].s), 0, &lexer_line, (yyvsp[-1].p), NULL);
1366 (yyval.t) = find_structure ((yyvsp[-3].s), 0);
1371 #line 240 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1372 { (yyval.t) = find_structure ((yyvsp[0].s), 0); ;}
1376 #line 242 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1378 new_structure ((yyvsp[-3].s), 1, &lexer_line, (yyvsp[-1].p), NULL);
1379 (yyval.t) = find_structure ((yyvsp[-3].s), 1);
1384 #line 247 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1385 { (yyval.t) = find_structure ((yyvsp[0].s), 1); ;}
1389 #line 249 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1390 { (yyval.t) = create_scalar_type ((yyvsp[0].s), strlen ((yyvsp[0].s))); ;}
1394 #line 251 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1395 { (yyval.t) = create_scalar_type ((yyvsp[-3].s), strlen ((yyvsp[-3].s))); ;}
1399 #line 256 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1404 #line 258 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1409 #line 260 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1414 #line 263 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1415 { (yyval.o) = NULL; ;}
1419 #line 264 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1420 { (yyval.o) = (yyvsp[0].o); ;}
1424 #line 268 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1425 { (yyval.o) = (yyvsp[-2].o); ;}
1429 #line 272 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1430 { (yyval.s) = "ptr_alias"; ;}
1434 #line 274 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1435 { (yyval.s) = (yyvsp[0].s); ;}
1439 #line 278 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1440 { (yyval.o) = create_option ((yyvsp[0].s), (void *)""); ;}
1444 #line 280 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1445 { (yyval.o) = create_option ((yyvsp[-3].s), (void *)(yyvsp[-1].s)); ;}
1449 #line 282 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1450 { (yyval.o) = create_option ((yyvsp[-3].s), adjust_field_type ((yyvsp[-1].t), NULL)); ;}
1454 #line 284 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1456 struct nested_ptr_data d;
1458 d.type = adjust_field_type ((yyvsp[-5].t), NULL);
1459 d.convert_to = (yyvsp[-3].s);
1460 d.convert_from = (yyvsp[-1].s);
1461 (yyval.o) = create_option ("nested_ptr",
1462 xmemdup (&d, sizeof (d), sizeof (d)));
1467 #line 296 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1469 (yyvsp[0].o)->next = NULL;
1470 (yyval.o) = (yyvsp[0].o);
1475 #line 301 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1477 (yyvsp[0].o)->next = (yyvsp[-2].o);
1478 (yyval.o) = (yyvsp[0].o);
1483 #line 307 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1484 { (yyval.o) = NULL; ;}
1488 #line 308 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1489 { (yyval.o) = (yyvsp[0].o); ;}
1493 #line 312 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1494 { (yyval.s) = (yyvsp[0].s); ;}
1498 #line 314 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1500 size_t l1 = strlen ((yyvsp[-1].s));
1501 size_t l2 = strlen ((yyvsp[0].s));
1502 char *s = XRESIZEVEC (char, (yyvsp[-1].s), l1 + l2 + 1);
1503 memcpy (s + l1, (yyvsp[0].s), l2 + 1);
1504 XDELETE ((yyvsp[0].s));
1512 /* Line 1037 of yacc.c. */
1513 #line 1514 "gengtype-yacc.c"
1519 YY_STACK_PRINT (yyss, yyssp);
1524 /* Now `shift' the result of the reduction. Determine what state
1525 that goes to, based on the state we popped back to and the rule
1526 number reduced by. */
1530 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1531 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1532 yystate = yytable[yystate];
1534 yystate = yydefgoto[yyn - YYNTOKENS];
1539 /*------------------------------------.
1540 | yyerrlab -- here on detecting error |
1541 `------------------------------------*/
1543 /* If not already recovering from an error, report this error. */
1548 yyn = yypact[yystate];
1550 if (YYPACT_NINF < yyn && yyn < YYLAST)
1552 YYSIZE_T yysize = 0;
1553 int yytype = YYTRANSLATE (yychar);
1554 const char* yyprefix;
1558 /* Start YYX at -YYN if negative to avoid negative indexes in
1560 int yyxbegin = yyn < 0 ? -yyn : 0;
1562 /* Stay within bounds of both yycheck and yytname. */
1563 int yychecklim = YYLAST - yyn;
1564 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1567 yyprefix = ", expecting ";
1568 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1569 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1571 yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
1579 yysize += (sizeof ("syntax error, unexpected ")
1580 + yystrlen (yytname[yytype]));
1581 yymsg = (char *) YYSTACK_ALLOC (yysize);
1584 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
1585 yyp = yystpcpy (yyp, yytname[yytype]);
1589 yyprefix = ", expecting ";
1590 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1591 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1593 yyp = yystpcpy (yyp, yyprefix);
1594 yyp = yystpcpy (yyp, yytname[yyx]);
1599 YYSTACK_FREE (yymsg);
1602 yyerror ("syntax error; also virtual memory exhausted");
1605 #endif /* YYERROR_VERBOSE */
1606 yyerror ("syntax error");
1611 if (yyerrstatus == 3)
1613 /* If just tried and failed to reuse look-ahead token after an
1614 error, discard it. */
1616 if (yychar <= YYEOF)
1618 /* If at end of input, pop the error token,
1619 then the rest of the stack, then return failure. */
1620 if (yychar == YYEOF)
1627 yydestruct ("Error: popping",
1628 yystos[*yyssp], yyvsp);
1633 yydestruct ("Error: discarding", yytoken, &yylval);
1638 /* Else will try to reuse look-ahead token after shifting the error
1643 /*---------------------------------------------------.
1644 | yyerrorlab -- error raised explicitly by YYERROR. |
1645 `---------------------------------------------------*/
1649 /* Pacify GCC when the user code never invokes YYERROR and the label
1650 yyerrorlab therefore never appears in user code. */
1661 /*-------------------------------------------------------------.
1662 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1663 `-------------------------------------------------------------*/
1665 yyerrstatus = 3; /* Each real token shifted decrements this. */
1669 yyn = yypact[yystate];
1670 if (yyn != YYPACT_NINF)
1673 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1681 /* Pop the current state because it cannot handle the error token. */
1686 yydestruct ("Error: popping", yystos[yystate], yyvsp);
1689 YY_STACK_PRINT (yyss, yyssp);
1698 /* Shift the error token. */
1699 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1705 /*-------------------------------------.
1706 | yyacceptlab -- YYACCEPT comes here. |
1707 `-------------------------------------*/
1712 /*-----------------------------------.
1713 | yyabortlab -- YYABORT comes here. |
1714 `-----------------------------------*/
1716 yydestruct ("Error: discarding lookahead",
1723 /*----------------------------------------------.
1724 | yyoverflowlab -- parser overflow comes here. |
1725 `----------------------------------------------*/
1727 yyerror ("parser stack overflow");
1735 YYSTACK_FREE (yyss);
1741 #line 323 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"