Create startup files from the GCC sources and drop our versions.
[dragonfly.git] / contrib / gcc-4.0 / gcc / gengtype-yacc.c
1 /* A Bison parser, made by GNU Bison 2.0.  */
2
3 /* Skeleton parser for Yacc-like parsing with Bison,
4    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
5
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)
9    any later version.
10
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.
15
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.  */
20
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.  */
25
26 /* Written by Richard Stallman by simplifying the original so called
27    ``semantic'' parser.  */
28
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.  */
35
36 /* Identify Bison output.  */
37 #define YYBISON 1
38
39 /* Skeleton name.  */
40 #define YYSKELETON_NAME "yacc.c"
41
42 /* Pure parsers.  */
43 #define YYPURE 0
44
45 /* Using locations.  */
46 #define YYLSP_NEEDED 0
47
48
49
50 /* Tokens.  */
51 #ifndef YYTOKENTYPE
52 # define YYTOKENTYPE
53    /* Put the tokens into the symbol table, so that GDB and other debuggers
54       know about them.  */
55    enum yytokentype {
56      ENT_TYPEDEF_STRUCT = 258,
57      ENT_STRUCT = 259,
58      ENT_EXTERNSTATIC = 260,
59      ENT_YACCUNION = 261,
60      GTY_TOKEN = 262,
61      UNION = 263,
62      STRUCT = 264,
63      ENUM = 265,
64      ALIAS = 266,
65      NESTED_PTR = 267,
66      PARAM_IS = 268,
67      NUM = 269,
68      PERCENTPERCENT = 270,
69      SCALAR = 271,
70      ID = 272,
71      STRING = 273,
72      ARRAY = 274,
73      PERCENT_ID = 275,
74      CHAR = 276
75    };
76 #endif
77 #define ENT_TYPEDEF_STRUCT 258
78 #define ENT_STRUCT 259
79 #define ENT_EXTERNSTATIC 260
80 #define ENT_YACCUNION 261
81 #define GTY_TOKEN 262
82 #define UNION 263
83 #define STRUCT 264
84 #define ENUM 265
85 #define ALIAS 266
86 #define NESTED_PTR 267
87 #define PARAM_IS 268
88 #define NUM 269
89 #define PERCENTPERCENT 270
90 #define SCALAR 271
91 #define ID 272
92 #define STRING 273
93 #define ARRAY 274
94 #define PERCENT_ID 275
95 #define CHAR 276
96
97
98
99
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"
102
103 #include "bconfig.h"
104 #include "system.h"
105 #include "coretypes.h"
106 #include "tm.h"
107 #include "gengtype.h"
108 #define YYERROR_VERBOSE
109
110
111 /* Enabling traces.  */
112 #ifndef YYDEBUG
113 # define YYDEBUG 0
114 #endif
115
116 /* Enabling verbose error messages.  */
117 #ifdef YYERROR_VERBOSE
118 # undef YYERROR_VERBOSE
119 # define YYERROR_VERBOSE 1
120 #else
121 # define YYERROR_VERBOSE 0
122 #endif
123
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 {
127   type_p t;
128   pair_p p;
129   options_p o;
130   const char *s;
131 } 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
137 #endif
138
139
140
141 /* Copy the second part of user declarations.  */
142
143
144 /* Line 213 of yacc.c.  */
145 #line 146 "gengtype-yacc.c"
146
147 #if ! defined (yyoverflow) || YYERROR_VERBOSE
148
149 # ifndef YYFREE
150 #  define YYFREE free
151 # endif
152 # ifndef YYMALLOC
153 #  define YYMALLOC malloc
154 # endif
155
156 /* The parser invokes alloca or malloc; define the necessary symbols.  */
157
158 # ifdef YYSTACK_USE_ALLOCA
159 #  if YYSTACK_USE_ALLOCA
160 #   ifdef __GNUC__
161 #    define YYSTACK_ALLOC __builtin_alloca
162 #   else
163 #    define YYSTACK_ALLOC alloca
164 #   endif
165 #  endif
166 # endif
167
168 # ifdef YYSTACK_ALLOC
169    /* Pacify GCC's `empty if-body' warning. */
170 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
171 # else
172 #  if defined (__STDC__) || defined (__cplusplus)
173 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
174 #   define YYSIZE_T size_t
175 #  endif
176 #  define YYSTACK_ALLOC YYMALLOC
177 #  define YYSTACK_FREE YYFREE
178 # endif
179 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
180
181
182 #if (! defined (yyoverflow) \
183      && (! defined (__cplusplus) \
184          || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
185
186 /* A type that is properly aligned for any stack member.  */
187 union yyalloc
188 {
189   short int yyss;
190   YYSTYPE yyvs;
191   };
192
193 /* The size of the maximum gap between one aligned stack and the next.  */
194 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
195
196 /* The size of an array large to enough to hold all stacks, each with
197    N elements.  */
198 # define YYSTACK_BYTES(N) \
199      ((N) * (sizeof (short int) + sizeof (YYSTYPE))                     \
200       + YYSTACK_GAP_MAXIMUM)
201
202 /* Copy COUNT objects from FROM to TO.  The source and destination do
203    not overlap.  */
204 # ifndef YYCOPY
205 #  if defined (__GNUC__) && 1 < __GNUC__
206 #   define YYCOPY(To, From, Count) \
207       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
208 #  else
209 #   define YYCOPY(To, From, Count)              \
210       do                                        \
211         {                                       \
212           register YYSIZE_T yyi;                \
213           for (yyi = 0; yyi < (Count); yyi++)   \
214             (To)[yyi] = (From)[yyi];            \
215         }                                       \
216       while (0)
217 #  endif
218 # endif
219
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
224    stack.  */
225 # define YYSTACK_RELOCATE(Stack)                                        \
226     do                                                                  \
227       {                                                                 \
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);                          \
233       }                                                                 \
234     while (0)
235
236 #endif
237
238 #if defined (__STDC__) || defined (__cplusplus)
239    typedef signed char yysigned_char;
240 #else
241    typedef short int yysigned_char;
242 #endif
243
244 /* YYFINAL -- State number of the termination state. */
245 #define YYFINAL  14
246 /* YYLAST -- Last index in YYTABLE.  */
247 #define YYLAST   118
248
249 /* YYNTOKENS -- Number of terminals. */
250 #define YYNTOKENS  33
251 /* YYNNTS -- Number of nonterminals. */
252 #define YYNNTS  23
253 /* YYNRULES -- Number of rules. */
254 #define YYNRULES  59
255 /* YYNRULES -- Number of states. */
256 #define YYNSTATES  127
257
258 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
259 #define YYUNDEFTOK  2
260 #define YYMAXUTOK   276
261
262 #define YYTRANSLATE(YYX)                                                \
263   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
264
265 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
266 static const unsigned char yytranslate[] =
267 {
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
296 };
297
298 #if YYDEBUG
299 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
300    YYRHS.  */
301 static const unsigned char yyprhs[] =
302 {
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
309 };
310
311 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
312 static const yysigned_char yyrhs[] =
313 {
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
336 };
337
338 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
339 static const unsigned short int yyrline[] =
340 {
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
347 };
348 #endif
349
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[] =
354 {
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",
364   "stringseq", 0
365 };
366 #endif
367
368 # ifdef YYPRINT
369 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
370    token YYLEX-NUM.  */
371 static const unsigned short int yytoknum[] =
372 {
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,
376       44,    40,    41
377 };
378 # endif
379
380 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
381 static const unsigned char yyr1[] =
382 {
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
389 };
390
391 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
392 static const unsigned char yyr2[] =
393 {
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
400 };
401
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[] =
406 {
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
420 };
421
422 /* YYDEFGOTO[NTERM-NUM]. */
423 static const yysigned_char yydefgoto[] =
424 {
425       -1,     5,     6,    89,    70,     7,    26,    58,     8,    59,
426       99,    28,    82,    62,    29,    74,    40,    10,    46,    47,
427       48,    49,    85
428 };
429
430 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
431    STATE-NUM.  */
432 #define YYPACT_NINF -98
433 static const yysigned_char yypact[] =
434 {
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
448 };
449
450 /* YYPGOTO[NTERM-NUM].  */
451 static const yysigned_char yypgoto[] =
452 {
453      -98,    64,   -98,   -98,   -98,   -98,   -98,   -45,   -98,   -98,
454      -27,   -19,   -98,    17,   -10,   -70,   -98,     2,   -98,    46,
455      -98,   -98,   -97
456 };
457
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[] =
464 {
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
477 };
478
479 static const yysigned_char yycheck[] =
480 {
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
493 };
494
495 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
496    symbol of state STATE-NUM.  */
497 static const unsigned char yystos[] =
498 {
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
512 };
513
514 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
515 # define YYSIZE_T __SIZE_TYPE__
516 #endif
517 #if ! defined (YYSIZE_T) && defined (size_t)
518 # define YYSIZE_T size_t
519 #endif
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
524 # endif
525 #endif
526 #if ! defined (YYSIZE_T)
527 # define YYSIZE_T unsigned int
528 #endif
529
530 #define yyerrok         (yyerrstatus = 0)
531 #define yyclearin       (yychar = YYEMPTY)
532 #define YYEMPTY         (-2)
533 #define YYEOF           0
534
535 #define YYACCEPT        goto yyacceptlab
536 #define YYABORT         goto yyabortlab
537 #define YYERROR         goto yyerrorlab
538
539
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.  */
543
544 #define YYFAIL          goto yyerrlab
545
546 #define YYRECOVERING()  (!!yyerrstatus)
547
548 #define YYBACKUP(Token, Value)                                  \
549 do                                                              \
550   if (yychar == YYEMPTY && yylen == 1)                          \
551     {                                                           \
552       yychar = (Token);                                         \
553       yylval = (Value);                                         \
554       yytoken = YYTRANSLATE (yychar);                           \
555       YYPOPSTACK;                                               \
556       goto yybackup;                                            \
557     }                                                           \
558   else                                                          \
559     {                                                           \
560       yyerror ("syntax error: cannot back up");\
561       YYERROR;                                                  \
562     }                                                           \
563 while (0)
564
565
566 #define YYTERROR        1
567 #define YYERRCODE       256
568
569
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).  */
573
574 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
575 #ifndef YYLLOC_DEFAULT
576 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
577     do                                                                  \
578       if (N)                                                            \
579         {                                                               \
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;       \
584         }                                                               \
585       else                                                              \
586         {                                                               \
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;                              \
591         }                                                               \
592     while (0)
593 #endif
594
595
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.  */
599
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)
606 # else
607 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
608 # endif
609 #endif
610
611
612 /* YYLEX -- calling `yylex' with the right arguments.  */
613
614 #ifdef YYLEX_PARAM
615 # define YYLEX yylex (YYLEX_PARAM)
616 #else
617 # define YYLEX yylex ()
618 #endif
619
620 /* Enable debugging if requested.  */
621 #if YYDEBUG
622
623 # ifndef YYFPRINTF
624 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
625 #  define YYFPRINTF fprintf
626 # endif
627
628 # define YYDPRINTF(Args)                        \
629 do {                                            \
630   if (yydebug)                                  \
631     YYFPRINTF Args;                             \
632 } while (0)
633
634 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)          \
635 do {                                                            \
636   if (yydebug)                                                  \
637     {                                                           \
638       YYFPRINTF (stderr, "%s ", Title);                         \
639       yysymprint (stderr,                                       \
640                   Type, Value); \
641       YYFPRINTF (stderr, "\n");                                 \
642     }                                                           \
643 } while (0)
644
645 /*------------------------------------------------------------------.
646 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
647 | TOP (included).                                                   |
648 `------------------------------------------------------------------*/
649
650 #if defined (__STDC__) || defined (__cplusplus)
651 static void
652 yy_stack_print (short int *bottom, short int *top)
653 #else
654 static void
655 yy_stack_print (bottom, top)
656     short int *bottom;
657     short int *top;
658 #endif
659 {
660   YYFPRINTF (stderr, "Stack now");
661   for (/* Nothing. */; bottom <= top; ++bottom)
662     YYFPRINTF (stderr, " %d", *bottom);
663   YYFPRINTF (stderr, "\n");
664 }
665
666 # define YY_STACK_PRINT(Bottom, Top)                            \
667 do {                                                            \
668   if (yydebug)                                                  \
669     yy_stack_print ((Bottom), (Top));                           \
670 } while (0)
671
672
673 /*------------------------------------------------.
674 | Report that the YYRULE is going to be reduced.  |
675 `------------------------------------------------*/
676
677 #if defined (__STDC__) || defined (__cplusplus)
678 static void
679 yy_reduce_print (int yyrule)
680 #else
681 static void
682 yy_reduce_print (yyrule)
683     int yyrule;
684 #endif
685 {
686   int yyi;
687   unsigned int yylno = yyrline[yyrule];
688   YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
689              yyrule - 1, yylno);
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]]);
694 }
695
696 # define YY_REDUCE_PRINT(Rule)          \
697 do {                                    \
698   if (yydebug)                          \
699     yy_reduce_print (Rule);             \
700 } while (0)
701
702 /* Nonzero means print parse trace.  It is left uninitialized so that
703    multiple parsers can coexist.  */
704 int yydebug;
705 #else /* !YYDEBUG */
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 */
711
712
713 /* YYINITDEPTH -- initial size of the parser's stacks.  */
714 #ifndef YYINITDEPTH
715 # define YYINITDEPTH 200
716 #endif
717
718 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
719    if the built-in stack extension method is used).
720
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.  */
724
725 #ifndef YYMAXDEPTH
726 # define YYMAXDEPTH 10000
727 #endif
728
729 \f
730
731 #if YYERROR_VERBOSE
732
733 # ifndef yystrlen
734 #  if defined (__GLIBC__) && defined (_STRING_H)
735 #   define yystrlen strlen
736 #  else
737 /* Return the length of YYSTR.  */
738 static YYSIZE_T
739 #   if defined (__STDC__) || defined (__cplusplus)
740 yystrlen (const char *yystr)
741 #   else
742 yystrlen (yystr)
743      const char *yystr;
744 #   endif
745 {
746   register const char *yys = yystr;
747
748   while (*yys++ != '\0')
749     continue;
750
751   return yys - yystr - 1;
752 }
753 #  endif
754 # endif
755
756 # ifndef yystpcpy
757 #  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
758 #   define yystpcpy stpcpy
759 #  else
760 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
761    YYDEST.  */
762 static char *
763 #   if defined (__STDC__) || defined (__cplusplus)
764 yystpcpy (char *yydest, const char *yysrc)
765 #   else
766 yystpcpy (yydest, yysrc)
767      char *yydest;
768      const char *yysrc;
769 #   endif
770 {
771   register char *yyd = yydest;
772   register const char *yys = yysrc;
773
774   while ((*yyd++ = *yys++) != '\0')
775     continue;
776
777   return yyd - 1;
778 }
779 #  endif
780 # endif
781
782 #endif /* !YYERROR_VERBOSE */
783
784 \f
785
786 #if YYDEBUG
787 /*--------------------------------.
788 | Print this symbol on YYOUTPUT.  |
789 `--------------------------------*/
790
791 #if defined (__STDC__) || defined (__cplusplus)
792 static void
793 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
794 #else
795 static void
796 yysymprint (yyoutput, yytype, yyvaluep)
797     FILE *yyoutput;
798     int yytype;
799     YYSTYPE *yyvaluep;
800 #endif
801 {
802   /* Pacify ``unused variable'' warnings.  */
803   (void) yyvaluep;
804
805   if (yytype < YYNTOKENS)
806     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
807   else
808     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
809
810
811 # ifdef YYPRINT
812   if (yytype < YYNTOKENS)
813     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
814 # endif
815   switch (yytype)
816     {
817       default:
818         break;
819     }
820   YYFPRINTF (yyoutput, ")");
821 }
822
823 #endif /* ! YYDEBUG */
824 /*-----------------------------------------------.
825 | Release the memory associated to this symbol.  |
826 `-----------------------------------------------*/
827
828 #if defined (__STDC__) || defined (__cplusplus)
829 static void
830 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
831 #else
832 static void
833 yydestruct (yymsg, yytype, yyvaluep)
834     const char *yymsg;
835     int yytype;
836     YYSTYPE *yyvaluep;
837 #endif
838 {
839   /* Pacify ``unused variable'' warnings.  */
840   (void) yyvaluep;
841
842   if (!yymsg)
843     yymsg = "Deleting";
844   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
845
846   switch (yytype)
847     {
848
849       default:
850         break;
851     }
852 }
853 \f
854
855 /* Prevent warnings from -Wmissing-prototypes.  */
856
857 #ifdef YYPARSE_PARAM
858 # if defined (__STDC__) || defined (__cplusplus)
859 int yyparse (void *YYPARSE_PARAM);
860 # else
861 int yyparse ();
862 # endif
863 #else /* ! YYPARSE_PARAM */
864 #if defined (__STDC__) || defined (__cplusplus)
865 int yyparse (void);
866 #else
867 int yyparse ();
868 #endif
869 #endif /* ! YYPARSE_PARAM */
870
871
872
873 /* The look-ahead symbol.  */
874 int yychar;
875
876 /* The semantic value of the look-ahead symbol.  */
877 YYSTYPE yylval;
878
879 /* Number of syntax errors so far.  */
880 int yynerrs;
881
882
883
884 /*----------.
885 | yyparse.  |
886 `----------*/
887
888 #ifdef YYPARSE_PARAM
889 # if defined (__STDC__) || defined (__cplusplus)
890 int yyparse (void *YYPARSE_PARAM)
891 # else
892 int yyparse (YYPARSE_PARAM)
893   void *YYPARSE_PARAM;
894 # endif
895 #else /* ! YYPARSE_PARAM */
896 #if defined (__STDC__) || defined (__cplusplus)
897 int
898 yyparse (void)
899 #else
900 int
901 yyparse ()
902
903 #endif
904 #endif
905 {
906   
907   register int yystate;
908   register int yyn;
909   int yyresult;
910   /* Number of tokens to shift before error messages enabled.  */
911   int yyerrstatus;
912   /* Look-ahead token as an internal (translated) token number.  */
913   int yytoken = 0;
914
915   /* Three stacks and their tools:
916      `yyss': related to states,
917      `yyvs': related to semantic values,
918      `yyls': related to locations.
919
920      Refer to the stacks thru separate pointers, to allow yyoverflow
921      to reallocate them elsewhere.  */
922
923   /* The state stack.  */
924   short int yyssa[YYINITDEPTH];
925   short int *yyss = yyssa;
926   register short int *yyssp;
927
928   /* The semantic value stack.  */
929   YYSTYPE yyvsa[YYINITDEPTH];
930   YYSTYPE *yyvs = yyvsa;
931   register YYSTYPE *yyvsp;
932
933
934
935 #define YYPOPSTACK   (yyvsp--, yyssp--)
936
937   YYSIZE_T yystacksize = YYINITDEPTH;
938
939   /* The variables used to return semantic value and location from the
940      action routines.  */
941   YYSTYPE yyval;
942
943
944   /* When reducing, the number of symbols on the RHS of the reduced
945      rule.  */
946   int yylen;
947
948   YYDPRINTF ((stderr, "Starting parse\n"));
949
950   yystate = 0;
951   yyerrstatus = 0;
952   yynerrs = 0;
953   yychar = YYEMPTY;             /* Cause a token to be read.  */
954
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.  */
959
960   yyssp = yyss;
961   yyvsp = yyvs;
962
963
964   yyvsp[0] = yylval;
965
966   goto yysetstate;
967
968 /*------------------------------------------------------------.
969 | yynewstate -- Push a new state, which is found in yystate.  |
970 `------------------------------------------------------------*/
971  yynewstate:
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.
974      */
975   yyssp++;
976
977  yysetstate:
978   *yyssp = yystate;
979
980   if (yyss + yystacksize - 1 <= yyssp)
981     {
982       /* Get the current used size of the three stacks, in elements.  */
983       YYSIZE_T yysize = yyssp - yyss + 1;
984
985 #ifdef yyoverflow
986       {
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
989            memory.  */
990         YYSTYPE *yyvs1 = yyvs;
991         short int *yyss1 = yyss;
992
993
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),
1001
1002                     &yystacksize);
1003
1004         yyss = yyss1;
1005         yyvs = yyvs1;
1006       }
1007 #else /* no yyoverflow */
1008 # ifndef YYSTACK_RELOCATE
1009       goto yyoverflowlab;
1010 # else
1011       /* Extend the stack our own way.  */
1012       if (YYMAXDEPTH <= yystacksize)
1013         goto yyoverflowlab;
1014       yystacksize *= 2;
1015       if (YYMAXDEPTH < yystacksize)
1016         yystacksize = YYMAXDEPTH;
1017
1018       {
1019         short int *yyss1 = yyss;
1020         union yyalloc *yyptr =
1021           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1022         if (! yyptr)
1023           goto yyoverflowlab;
1024         YYSTACK_RELOCATE (yyss);
1025         YYSTACK_RELOCATE (yyvs);
1026
1027 #  undef YYSTACK_RELOCATE
1028         if (yyss1 != yyssa)
1029           YYSTACK_FREE (yyss1);
1030       }
1031 # endif
1032 #endif /* no yyoverflow */
1033
1034       yyssp = yyss + yysize - 1;
1035       yyvsp = yyvs + yysize - 1;
1036
1037
1038       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1039                   (unsigned long int) yystacksize));
1040
1041       if (yyss + yystacksize - 1 <= yyssp)
1042         YYABORT;
1043     }
1044
1045   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1046
1047   goto yybackup;
1048
1049 /*-----------.
1050 | yybackup.  |
1051 `-----------*/
1052 yybackup:
1053
1054 /* Do appropriate processing given the current state.  */
1055 /* Read a look-ahead token if we need one and don't already have one.  */
1056 /* yyresume: */
1057
1058   /* First try to decide what to do without reference to look-ahead token.  */
1059
1060   yyn = yypact[yystate];
1061   if (yyn == YYPACT_NINF)
1062     goto yydefault;
1063
1064   /* Not known => get a look-ahead token if don't already have one.  */
1065
1066   /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
1067   if (yychar == YYEMPTY)
1068     {
1069       YYDPRINTF ((stderr, "Reading a token: "));
1070       yychar = YYLEX;
1071     }
1072
1073   if (yychar <= YYEOF)
1074     {
1075       yychar = yytoken = YYEOF;
1076       YYDPRINTF ((stderr, "Now at end of input.\n"));
1077     }
1078   else
1079     {
1080       yytoken = YYTRANSLATE (yychar);
1081       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1082     }
1083
1084   /* If the proper action on seeing token YYTOKEN is to reduce or to
1085      detect an error, take that action.  */
1086   yyn += yytoken;
1087   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1088     goto yydefault;
1089   yyn = yytable[yyn];
1090   if (yyn <= 0)
1091     {
1092       if (yyn == 0 || yyn == YYTABLE_NINF)
1093         goto yyerrlab;
1094       yyn = -yyn;
1095       goto yyreduce;
1096     }
1097
1098   if (yyn == YYFINAL)
1099     YYACCEPT;
1100
1101   /* Shift the look-ahead token.  */
1102   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1103
1104   /* Discard the token being shifted unless it is eof.  */
1105   if (yychar != YYEOF)
1106     yychar = YYEMPTY;
1107
1108   *++yyvsp = yylval;
1109
1110
1111   /* Count tokens shifted since error; after three, turn off error
1112      status.  */
1113   if (yyerrstatus)
1114     yyerrstatus--;
1115
1116   yystate = yyn;
1117   goto yynewstate;
1118
1119
1120 /*-----------------------------------------------------------.
1121 | yydefault -- do the default action for the current state.  |
1122 `-----------------------------------------------------------*/
1123 yydefault:
1124   yyn = yydefact[yystate];
1125   if (yyn == 0)
1126     goto yyerrlab;
1127   goto yyreduce;
1128
1129
1130 /*-----------------------------.
1131 | yyreduce -- Do a reduction.  |
1132 `-----------------------------*/
1133 yyreduce:
1134   /* yyn is the number of a rule to reduce with.  */
1135   yylen = yyr2[yyn];
1136
1137   /* If YYLEN is nonzero, implement the default value of the action:
1138      `$$ = $1'.
1139
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];
1146
1147
1148   YY_REDUCE_PRINT (yyn);
1149   switch (yyn)
1150     {
1151         case 6:
1152 #line 72 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1153     {
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;
1158                    ;}
1159     break;
1160
1161   case 7:
1162 #line 79 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1163     {;}
1164     break;
1165
1166   case 8:
1167 #line 81 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1168     {
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;
1172                    ;}
1173     break;
1174
1175   case 9:
1176 #line 87 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1177     {;}
1178     break;
1179
1180   case 10:
1181 #line 91 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1182     {
1183                    note_variable ((yyvsp[-1].s), adjust_field_type ((yyvsp[-2].t), (yyvsp[-3].o)), (yyvsp[-3].o),
1184                                   &lexer_line);
1185                  ;}
1186     break;
1187
1188   case 11:
1189 #line 96 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1190     {
1191                    note_variable ((yyvsp[-2].s), create_array ((yyvsp[-3].t), (yyvsp[-1].s)),
1192                             (yyvsp[-4].o), &lexer_line);
1193                  ;}
1194     break;
1195
1196   case 12:
1197 #line 101 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1198     {
1199                    note_variable ((yyvsp[-3].s), create_array (create_array ((yyvsp[-4].t), (yyvsp[-1].s)),
1200                                               (yyvsp[-2].s)),
1201                             (yyvsp[-5].o), &lexer_line);
1202                  ;}
1203     break;
1204
1205   case 13:
1206 #line 109 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1207     {
1208               lexer_toplevel_done = 1;
1209               (yyval.t) = (yyvsp[0].t);
1210             ;}
1211     break;
1212
1213   case 16:
1214 #line 121 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1215     {
1216                 note_yacc_type ((yyvsp[-4].o), (yyvsp[-3].p), (yyvsp[-1].p), &lexer_line);
1217               ;}
1218     break;
1219
1220   case 17:
1221 #line 127 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1222     { (yyval.p) = NULL; ;}
1223     break;
1224
1225   case 18:
1226 #line 129 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1227     {
1228                      pair_p p;
1229                      for (p = (yyvsp[0].p); p->next != NULL; p = p->next)
1230                        {
1231                          p->name = NULL;
1232                          p->type = NULL;
1233                        }
1234                      p->name = NULL;
1235                      p->type = NULL;
1236                      p->next = (yyvsp[-2].p);
1237                      (yyval.p) = (yyvsp[0].p);
1238                    ;}
1239     break;
1240
1241   case 19:
1242 #line 142 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1243     {
1244                      pair_p p;
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)
1249                        {
1250                          p->name = (yyvsp[-2].s);
1251                          p->type = newtype;
1252                        }
1253                      p->name = (yyvsp[-2].s);
1254                      p->next = (yyvsp[-5].p);
1255                      p->type = newtype;
1256                      (yyval.p) = (yyvsp[0].p);
1257                    ;}
1258     break;
1259
1260   case 20:
1261 #line 160 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1262     { (yyval.p) = NULL; ;}
1263     break;
1264
1265   case 21:
1266 #line 162 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1267     {
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);
1275           (yyval.p) = p;
1276         ;}
1277     break;
1278
1279   case 22:
1280 #line 173 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1281     {
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));
1289           (yyval.p) = p;
1290         ;}
1291     break;
1292
1293   case 23:
1294 #line 185 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1295     { (yyval.p) = NULL; ;}
1296     break;
1297
1298   case 24:
1299 #line 187 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1300     {
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;
1307                     (yyval.p) = p;
1308                   ;}
1309     break;
1310
1311   case 25:
1312 #line 197 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1313     {
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;
1320                     (yyval.p) = p;
1321                   ;}
1322     break;
1323
1324   case 26:
1325 #line 207 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1326     {
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;
1333                     (yyval.p) = p;
1334                   ;}
1335     break;
1336
1337   case 27:
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); ;}
1340     break;
1341
1342   case 31:
1343 #line 225 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1344     { ;}
1345     break;
1346
1347   case 32:
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); ;}
1350     break;
1351
1352   case 33:
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); ;}
1355     break;
1356
1357   case 34:
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)); ;}
1360     break;
1361
1362   case 35:
1363 #line 235 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1364     {
1365            new_structure ((yyvsp[-3].s), 0, &lexer_line, (yyvsp[-1].p), NULL);
1366            (yyval.t) = find_structure ((yyvsp[-3].s), 0);
1367          ;}
1368     break;
1369
1370   case 36:
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); ;}
1373     break;
1374
1375   case 37:
1376 #line 242 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1377     {
1378            new_structure ((yyvsp[-3].s), 1, &lexer_line, (yyvsp[-1].p), NULL);
1379            (yyval.t) = find_structure ((yyvsp[-3].s), 1);
1380          ;}
1381     break;
1382
1383   case 38:
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); ;}
1386     break;
1387
1388   case 39:
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))); ;}
1391     break;
1392
1393   case 40:
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))); ;}
1396     break;
1397
1398   case 42:
1399 #line 256 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1400     { ;}
1401     break;
1402
1403   case 43:
1404 #line 258 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1405     { ;}
1406     break;
1407
1408   case 44:
1409 #line 260 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1410     { ;}
1411     break;
1412
1413   case 45:
1414 #line 263 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1415     { (yyval.o) = NULL; ;}
1416     break;
1417
1418   case 46:
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); ;}
1421     break;
1422
1423   case 47:
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); ;}
1426     break;
1427
1428   case 48:
1429 #line 272 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1430     { (yyval.s) = "ptr_alias"; ;}
1431     break;
1432
1433   case 49:
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); ;}
1436     break;
1437
1438   case 50:
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 *)""); ;}
1441     break;
1442
1443   case 51:
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)); ;}
1446     break;
1447
1448   case 52:
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)); ;}
1451     break;
1452
1453   case 53:
1454 #line 284 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1455     {
1456               struct nested_ptr_data d;
1457
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)));
1463             ;}
1464     break;
1465
1466   case 54:
1467 #line 296 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1468     {
1469                 (yyvsp[0].o)->next = NULL;
1470                 (yyval.o) = (yyvsp[0].o);
1471               ;}
1472     break;
1473
1474   case 55:
1475 #line 301 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1476     {
1477                 (yyvsp[0].o)->next = (yyvsp[-2].o);
1478                 (yyval.o) = (yyvsp[0].o);
1479               ;}
1480     break;
1481
1482   case 56:
1483 #line 307 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1484     { (yyval.o) = NULL; ;}
1485     break;
1486
1487   case 57:
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); ;}
1490     break;
1491
1492   case 58:
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); ;}
1495     break;
1496
1497   case 59:
1498 #line 314 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1499     {
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));
1505                (yyval.s) = s;
1506              ;}
1507     break;
1508
1509
1510     }
1511
1512 /* Line 1037 of yacc.c.  */
1513 #line 1514 "gengtype-yacc.c"
1514 \f
1515   yyvsp -= yylen;
1516   yyssp -= yylen;
1517
1518
1519   YY_STACK_PRINT (yyss, yyssp);
1520
1521   *++yyvsp = yyval;
1522
1523
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.  */
1527
1528   yyn = yyr1[yyn];
1529
1530   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1531   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1532     yystate = yytable[yystate];
1533   else
1534     yystate = yydefgoto[yyn - YYNTOKENS];
1535
1536   goto yynewstate;
1537
1538
1539 /*------------------------------------.
1540 | yyerrlab -- here on detecting error |
1541 `------------------------------------*/
1542 yyerrlab:
1543   /* If not already recovering from an error, report this error.  */
1544   if (!yyerrstatus)
1545     {
1546       ++yynerrs;
1547 #if YYERROR_VERBOSE
1548       yyn = yypact[yystate];
1549
1550       if (YYPACT_NINF < yyn && yyn < YYLAST)
1551         {
1552           YYSIZE_T yysize = 0;
1553           int yytype = YYTRANSLATE (yychar);
1554           const char* yyprefix;
1555           char *yymsg;
1556           int yyx;
1557
1558           /* Start YYX at -YYN if negative to avoid negative indexes in
1559              YYCHECK.  */
1560           int yyxbegin = yyn < 0 ? -yyn : 0;
1561
1562           /* Stay within bounds of both yycheck and yytname.  */
1563           int yychecklim = YYLAST - yyn;
1564           int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1565           int yycount = 0;
1566
1567           yyprefix = ", expecting ";
1568           for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1569             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1570               {
1571                 yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
1572                 yycount += 1;
1573                 if (yycount == 5)
1574                   {
1575                     yysize = 0;
1576                     break;
1577                   }
1578               }
1579           yysize += (sizeof ("syntax error, unexpected ")
1580                      + yystrlen (yytname[yytype]));
1581           yymsg = (char *) YYSTACK_ALLOC (yysize);
1582           if (yymsg != 0)
1583             {
1584               char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
1585               yyp = yystpcpy (yyp, yytname[yytype]);
1586
1587               if (yycount < 5)
1588                 {
1589                   yyprefix = ", expecting ";
1590                   for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1591                     if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1592                       {
1593                         yyp = yystpcpy (yyp, yyprefix);
1594                         yyp = yystpcpy (yyp, yytname[yyx]);
1595                         yyprefix = " or ";
1596                       }
1597                 }
1598               yyerror (yymsg);
1599               YYSTACK_FREE (yymsg);
1600             }
1601           else
1602             yyerror ("syntax error; also virtual memory exhausted");
1603         }
1604       else
1605 #endif /* YYERROR_VERBOSE */
1606         yyerror ("syntax error");
1607     }
1608
1609
1610
1611   if (yyerrstatus == 3)
1612     {
1613       /* If just tried and failed to reuse look-ahead token after an
1614          error, discard it.  */
1615
1616       if (yychar <= YYEOF)
1617         {
1618           /* If at end of input, pop the error token,
1619              then the rest of the stack, then return failure.  */
1620           if (yychar == YYEOF)
1621              for (;;)
1622                {
1623
1624                  YYPOPSTACK;
1625                  if (yyssp == yyss)
1626                    YYABORT;
1627                  yydestruct ("Error: popping",
1628                              yystos[*yyssp], yyvsp);
1629                }
1630         }
1631       else
1632         {
1633           yydestruct ("Error: discarding", yytoken, &yylval);
1634           yychar = YYEMPTY;
1635         }
1636     }
1637
1638   /* Else will try to reuse look-ahead token after shifting the error
1639      token.  */
1640   goto yyerrlab1;
1641
1642
1643 /*---------------------------------------------------.
1644 | yyerrorlab -- error raised explicitly by YYERROR.  |
1645 `---------------------------------------------------*/
1646 yyerrorlab:
1647
1648 #ifdef __GNUC__
1649   /* Pacify GCC when the user code never invokes YYERROR and the label
1650      yyerrorlab therefore never appears in user code.  */
1651   if (0)
1652      goto yyerrorlab;
1653 #endif
1654
1655 yyvsp -= yylen;
1656   yyssp -= yylen;
1657   yystate = *yyssp;
1658   goto yyerrlab1;
1659
1660
1661 /*-------------------------------------------------------------.
1662 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
1663 `-------------------------------------------------------------*/
1664 yyerrlab1:
1665   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
1666
1667   for (;;)
1668     {
1669       yyn = yypact[yystate];
1670       if (yyn != YYPACT_NINF)
1671         {
1672           yyn += YYTERROR;
1673           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1674             {
1675               yyn = yytable[yyn];
1676               if (0 < yyn)
1677                 break;
1678             }
1679         }
1680
1681       /* Pop the current state because it cannot handle the error token.  */
1682       if (yyssp == yyss)
1683         YYABORT;
1684
1685
1686       yydestruct ("Error: popping", yystos[yystate], yyvsp);
1687       YYPOPSTACK;
1688       yystate = *yyssp;
1689       YY_STACK_PRINT (yyss, yyssp);
1690     }
1691
1692   if (yyn == YYFINAL)
1693     YYACCEPT;
1694
1695   *++yyvsp = yylval;
1696
1697
1698   /* Shift the error token. */
1699   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1700
1701   yystate = yyn;
1702   goto yynewstate;
1703
1704
1705 /*-------------------------------------.
1706 | yyacceptlab -- YYACCEPT comes here.  |
1707 `-------------------------------------*/
1708 yyacceptlab:
1709   yyresult = 0;
1710   goto yyreturn;
1711
1712 /*-----------------------------------.
1713 | yyabortlab -- YYABORT comes here.  |
1714 `-----------------------------------*/
1715 yyabortlab:
1716   yydestruct ("Error: discarding lookahead",
1717               yytoken, &yylval);
1718   yychar = YYEMPTY;
1719   yyresult = 1;
1720   goto yyreturn;
1721
1722 #ifndef yyoverflow
1723 /*----------------------------------------------.
1724 | yyoverflowlab -- parser overflow comes here.  |
1725 `----------------------------------------------*/
1726 yyoverflowlab:
1727   yyerror ("parser stack overflow");
1728   yyresult = 2;
1729   /* Fall through.  */
1730 #endif
1731
1732 yyreturn:
1733 #ifndef yyoverflow
1734   if (yyss != yyssa)
1735     YYSTACK_FREE (yyss);
1736 #endif
1737   return yyresult;
1738 }
1739
1740
1741 #line 323 "/scratch/mitchell/gcc-releases/gcc-4.0.1/gcc-4.0.1/gcc/gengtype-yacc.y"
1742
1743