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