ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / scripts / genksyms / parse.c_shipped
1
2 /*  A Bison parser, made from scripts/genksyms/parse.y
3     by GNU Bison version 1.28  */
4
5 #define YYBISON 1  /* Identify Bison output.  */
6
7 #define ASM_KEYW        257
8 #define ATTRIBUTE_KEYW  258
9 #define AUTO_KEYW       259
10 #define BOOL_KEYW       260
11 #define CHAR_KEYW       261
12 #define CONST_KEYW      262
13 #define DOUBLE_KEYW     263
14 #define ENUM_KEYW       264
15 #define EXTERN_KEYW     265
16 #define FLOAT_KEYW      266
17 #define INLINE_KEYW     267
18 #define INT_KEYW        268
19 #define LONG_KEYW       269
20 #define REGISTER_KEYW   270
21 #define RESTRICT_KEYW   271
22 #define SHORT_KEYW      272
23 #define SIGNED_KEYW     273
24 #define STATIC_KEYW     274
25 #define STRUCT_KEYW     275
26 #define TYPEDEF_KEYW    276
27 #define UNION_KEYW      277
28 #define UNSIGNED_KEYW   278
29 #define VOID_KEYW       279
30 #define VOLATILE_KEYW   280
31 #define TYPEOF_KEYW     281
32 #define EXPORT_SYMBOL_KEYW      282
33 #define ASM_PHRASE      283
34 #define ATTRIBUTE_PHRASE        284
35 #define BRACE_PHRASE    285
36 #define BRACKET_PHRASE  286
37 #define EXPRESSION_PHRASE       287
38 #define CHAR    288
39 #define DOTS    289
40 #define IDENT   290
41 #define INT     291
42 #define REAL    292
43 #define STRING  293
44 #define TYPE    294
45 #define OTHER   295
46 #define FILENAME        296
47
48 #line 24 "scripts/genksyms/parse.y"
49
50
51 #include <assert.h>
52 #include <malloc.h>
53 #include "genksyms.h"
54
55 static int is_typedef;
56 static int is_extern;
57 static char *current_name;
58 static struct string_list *decl_spec;
59
60 static void yyerror(const char *);
61
62 static inline void
63 remove_node(struct string_list **p)
64 {
65   struct string_list *node = *p;
66   *p = node->next;
67   free_node(node);
68 }
69
70 static inline void
71 remove_list(struct string_list **pb, struct string_list **pe)
72 {
73   struct string_list *b = *pb, *e = *pe;
74   *pb = e;
75   free_list(b, e);
76 }
77
78 #ifndef YYSTYPE
79 #define YYSTYPE int
80 #endif
81 #ifndef YYDEBUG
82 #define YYDEBUG 1
83 #endif
84
85 #include <stdio.h>
86
87 #ifndef __cplusplus
88 #ifndef __STDC__
89 #define const
90 #endif
91 #endif
92
93
94
95 #define YYFINAL         172
96 #define YYFLAG          -32768
97 #define YYNTBASE        52
98
99 #define YYTRANSLATE(x) ((unsigned)(x) <= 296 ? yytranslate[x] : 96)
100
101 static const char yytranslate[] = {     0,
102      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
103      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
104      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
105      2,     2,     2,     2,     2,     2,     2,     2,     2,    46,
106     47,    48,     2,    45,     2,     2,     2,     2,     2,     2,
107      2,     2,     2,     2,     2,     2,     2,    51,    43,     2,
108     49,     2,     2,     2,     2,     2,     2,     2,     2,     2,
109      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
110      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
111      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
112      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
113      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
114      2,     2,    50,     2,    44,     2,     2,     2,     2,     2,
115      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
116      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
117      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
118      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
119      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
120      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
121      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
122      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
123      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
124      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
125      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
126      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
127      2,     2,     2,     2,     2,     1,     3,     4,     5,     6,
128      7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
129     17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
130     27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
131     37,    38,    39,    40,    41,    42
132 };
133
134 #if YYDEBUG != 0
135 static const short yyprhs[] = {     0,
136      0,     2,     5,     6,     9,    10,    14,    16,    18,    20,
137     22,    25,    28,    32,    33,    35,    37,    41,    46,    47,
138     49,    51,    54,    56,    58,    60,    62,    64,    66,    68,
139     70,    72,    77,    80,    83,    86,    90,    94,    98,   101,
140    104,   107,   109,   111,   113,   115,   117,   119,   121,   123,
141    125,   127,   129,   132,   133,   135,   137,   140,   142,   144,
142    146,   148,   151,   153,   155,   160,   165,   168,   172,   176,
143    179,   181,   183,   185,   190,   195,   198,   202,   206,   209,
144    211,   215,   216,   218,   220,   224,   227,   230,   232,   233,
145    235,   237,   242,   247,   250,   254,   258,   262,   263,   265,
146    268,   272,   276,   277,   279,   281,   284,   288,   291,   292,
147    294,   296,   300,   303,   306,   308,   311,   312,   314,   317,
148    318,   320
149 };
150
151 static const short yyrhs[] = {    53,
152      0,    52,    53,     0,     0,    54,    55,     0,     0,    22,
153     56,    57,     0,    57,     0,    81,     0,    93,     0,    95,
154      0,     1,    43,     0,     1,    44,     0,    61,    58,    43,
155      0,     0,    59,     0,    60,     0,    59,    45,    60,     0,
156     71,    94,    92,    82,     0,     0,    62,     0,    63,     0,
157     62,    63,     0,    64,     0,    65,     0,     5,     0,    16,
158      0,    20,     0,    11,     0,    13,     0,    66,     0,    70,
159      0,    27,    46,    65,    47,     0,    21,    36,     0,    23,
160     36,     0,    10,    36,     0,    21,    36,    84,     0,    23,
161     36,    84,     0,    10,    36,    31,     0,    10,    31,     0,
162     21,    84,     0,    23,    84,     0,     7,     0,    18,     0,
163     14,     0,    15,     0,    19,     0,    24,     0,    12,     0,
164      9,     0,    25,     0,     6,     0,    40,     0,    48,    68,
165      0,     0,    69,     0,    70,     0,    69,    70,     0,     8,
166      0,    26,     0,    30,     0,    17,     0,    67,    71,     0,
167     72,     0,    36,     0,    72,    46,    75,    47,     0,    72,
168     46,     1,    47,     0,    72,    32,     0,    46,    71,    47,
169      0,    46,     1,    47,     0,    67,    73,     0,    74,     0,
170     36,     0,    40,     0,    74,    46,    75,    47,     0,    74,
171     46,     1,    47,     0,    74,    32,     0,    46,    73,    47,
172      0,    46,     1,    47,     0,    76,    35,     0,    76,     0,
173     77,    45,    35,     0,     0,    77,     0,    78,     0,    77,
174     45,    78,     0,    62,    79,     0,    67,    79,     0,    80,
175      0,     0,    36,     0,    40,     0,    80,    46,    75,    47,
176      0,    80,    46,     1,    47,     0,    80,    32,     0,    46,
177     79,    47,     0,    46,     1,    47,     0,    61,    71,    31,
178      0,     0,    83,     0,    49,    33,     0,    50,    85,    44,
179      0,    50,     1,    44,     0,     0,    86,     0,    87,     0,
180     86,    87,     0,    61,    88,    43,     0,     1,    43,     0,
181      0,    89,     0,    90,     0,    89,    45,    90,     0,    73,
182     92,     0,    36,    91,     0,    91,     0,    51,    33,     0,
183      0,    30,     0,    29,    43,     0,     0,    29,     0,    28,
184     46,    36,    47,    43,     0
185 };
186
187 #endif
188
189 #if YYDEBUG != 0
190 static const short yyrline[] = { 0,
191    101,   103,   106,   109,   112,   114,   115,   116,   117,   118,
192    119,   120,   123,   137,   139,   142,   151,   163,   169,   171,
193    174,   176,   179,   186,   189,   191,   192,   193,   194,   197,
194    199,   200,   204,   206,   208,   212,   219,   226,   235,   236,
195    237,   240,   242,   243,   244,   245,   246,   247,   248,   249,
196    250,   251,   254,   259,   261,   264,   266,   269,   270,   270,
197    271,   278,   280,   283,   293,   295,   297,   299,   301,   307,
198    309,   312,   314,   315,   317,   319,   321,   323,   327,   329,
199    330,   333,   335,   338,   340,   344,   349,   352,   355,   357,
200    365,   369,   371,   373,   375,   377,   381,   390,   392,   396,
201    401,   403,   406,   408,   411,   413,   416,   419,   423,   425,
202    428,   430,   433,   435,   436,   439,   443,   445,   448,   452,
203    454,   457
204 };
205 #endif
206
207
208 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
209
210 static const char * const yytname[] = {   "$","error","$undefined.","ASM_KEYW",
211 "ATTRIBUTE_KEYW","AUTO_KEYW","BOOL_KEYW","CHAR_KEYW","CONST_KEYW","DOUBLE_KEYW",
212 "ENUM_KEYW","EXTERN_KEYW","FLOAT_KEYW","INLINE_KEYW","INT_KEYW","LONG_KEYW",
213 "REGISTER_KEYW","RESTRICT_KEYW","SHORT_KEYW","SIGNED_KEYW","STATIC_KEYW","STRUCT_KEYW",
214 "TYPEDEF_KEYW","UNION_KEYW","UNSIGNED_KEYW","VOID_KEYW","VOLATILE_KEYW","TYPEOF_KEYW",
215 "EXPORT_SYMBOL_KEYW","ASM_PHRASE","ATTRIBUTE_PHRASE","BRACE_PHRASE","BRACKET_PHRASE",
216 "EXPRESSION_PHRASE","CHAR","DOTS","IDENT","INT","REAL","STRING","TYPE","OTHER",
217 "FILENAME","';'","'}'","','","'('","')'","'*'","'='","'{'","':'","declaration_seq",
218 "declaration","@1","declaration1","@2","simple_declaration","init_declarator_list_opt",
219 "init_declarator_list","init_declarator","decl_specifier_seq_opt","decl_specifier_seq",
220 "decl_specifier","storage_class_specifier","type_specifier","simple_type_specifier",
221 "ptr_operator","cvar_qualifier_seq_opt","cvar_qualifier_seq","cvar_qualifier",
222 "declarator","direct_declarator","nested_declarator","direct_nested_declarator",
223 "parameter_declaration_clause","parameter_declaration_list_opt","parameter_declaration_list",
224 "parameter_declaration","m_abstract_declarator","direct_m_abstract_declarator",
225 "function_definition","initializer_opt","initializer","class_body","member_specification_opt",
226 "member_specification","member_declaration","member_declarator_list_opt","member_declarator_list",
227 "member_declarator","member_bitfield_declarator","attribute_opt","asm_definition",
228 "asm_phrase_opt","export_definition", NULL
229 };
230 #endif
231
232 static const short yyr1[] = {     0,
233     52,    52,    54,    53,    56,    55,    55,    55,    55,    55,
234     55,    55,    57,    58,    58,    59,    59,    60,    61,    61,
235     62,    62,    63,    63,    64,    64,    64,    64,    64,    65,
236     65,    65,    65,    65,    65,    65,    65,    65,    65,    65,
237     65,    66,    66,    66,    66,    66,    66,    66,    66,    66,
238     66,    66,    67,    68,    68,    69,    69,    70,    70,    70,
239     70,    71,    71,    72,    72,    72,    72,    72,    72,    73,
240     73,    74,    74,    74,    74,    74,    74,    74,    75,    75,
241     75,    76,    76,    77,    77,    78,    79,    79,    80,    80,
242     80,    80,    80,    80,    80,    80,    81,    82,    82,    83,
243     84,    84,    85,    85,    86,    86,    87,    87,    88,    88,
244     89,    89,    90,    90,    90,    91,    92,    92,    93,    94,
245     94,    95
246 };
247
248 static const short yyr2[] = {     0,
249      1,     2,     0,     2,     0,     3,     1,     1,     1,     1,
250      2,     2,     3,     0,     1,     1,     3,     4,     0,     1,
251      1,     2,     1,     1,     1,     1,     1,     1,     1,     1,
252      1,     4,     2,     2,     2,     3,     3,     3,     2,     2,
253      2,     1,     1,     1,     1,     1,     1,     1,     1,     1,
254      1,     1,     2,     0,     1,     1,     2,     1,     1,     1,
255      1,     2,     1,     1,     4,     4,     2,     3,     3,     2,
256      1,     1,     1,     4,     4,     2,     3,     3,     2,     1,
257      3,     0,     1,     1,     3,     2,     2,     1,     0,     1,
258      1,     4,     4,     2,     3,     3,     3,     0,     1,     2,
259      3,     3,     0,     1,     1,     2,     3,     2,     0,     1,
260      1,     3,     2,     2,     1,     2,     0,     1,     2,     0,
261      1,     5
262 };
263
264 static const short yydefact[] = {     3,
265      3,     1,     0,     2,     0,    25,    51,    42,    58,    49,
266      0,    28,    48,    29,    44,    45,    26,    61,    43,    46,
267     27,     0,     5,     0,    47,    50,    59,     0,     0,     0,
268     60,    52,     4,     7,    14,    20,    21,    23,    24,    30,
269     31,     8,     9,    10,    11,    12,    39,    35,    33,     0,
270     40,    19,    34,    41,     0,     0,   119,    64,     0,    54,
271      0,    15,    16,     0,   120,    63,    22,    38,    36,     0,
272    109,     0,     0,   105,     6,    14,    37,     0,     0,     0,
273      0,    53,    55,    56,    13,     0,    62,   121,    97,   117,
274     67,     0,   108,   102,    72,    73,     0,     0,     0,   117,
275     71,     0,   110,   111,   115,   101,     0,   106,   120,    32,
276      0,    69,    68,    57,    17,   118,    98,     0,    89,     0,
277     80,    83,    84,   114,     0,    72,     0,   116,    70,   113,
278     76,     0,   107,     0,   122,     0,    18,    99,    66,    90,
279     52,     0,    89,    86,    88,    65,    79,     0,    78,    77,
280      0,     0,   112,   100,     0,    91,     0,    87,    94,     0,
281     81,    85,    75,    74,    96,    95,     0,     0,    93,    92,
282      0,     0
283 };
284
285 static const short yydefgoto[] = {     1,
286      2,     3,    33,    52,    34,    61,    62,    63,    71,    36,
287     37,    38,    39,    40,    64,    82,    83,    41,   109,    66,
288    100,   101,   120,   121,   122,   123,   144,   145,    42,   137,
289    138,    51,    72,    73,    74,   102,   103,   104,   105,   117,
290     43,    90,    44
291 };
292
293 static const short yypact[] = {-32768,
294     19,-32768,   175,-32768,    32,-32768,-32768,-32768,-32768,-32768,
295    -18,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
296 -32768,   -30,-32768,   -26,-32768,-32768,-32768,   -32,   -10,    -2,
297 -32768,-32768,-32768,-32768,     2,   428,-32768,-32768,-32768,-32768,
298 -32768,-32768,-32768,-32768,-32768,-32768,-32768,    34,    12,    79,
299 -32768,   428,    12,-32768,   455,    33,-32768,-32768,    15,    14,
300     35,    29,-32768,     2,   -14,   -21,-32768,-32768,-32768,    67,
301     31,    37,   127,-32768,-32768,     2,-32768,    54,    60,    66,
302     69,-32768,    14,-32768,-32768,     2,-32768,-32768,-32768,    84,
303 -32768,   219,-32768,-32768,    70,-32768,    20,    91,    72,    84,
304    -20,    74,    81,-32768,-32768,-32768,    86,-32768,   102,-32768,
305    106,-32768,-32768,-32768,-32768,-32768,   109,   108,   348,   112,
306    126,   117,-32768,-32768,   118,-32768,   122,-32768,-32768,-32768,
307 -32768,   262,-32768,    31,-32768,   131,-32768,-32768,-32768,-32768,
308 -32768,     7,   120,-32768,    -9,-32768,-32768,   392,-32768,-32768,
309    125,   130,-32768,-32768,   132,-32768,   159,-32768,-32768,   305,
310 -32768,-32768,-32768,-32768,-32768,-32768,   160,   161,-32768,-32768,
311    174,-32768
312 };
313
314 static const short yypgoto[] = {-32768,
315    208,-32768,-32768,-32768,   158,-32768,-32768,   128,     0,   -90,
316    -36,-32768,   157,-32768,   -70,-32768,-32768,   -51,   -31,-32768,
317    -40,-32768,  -125,-32768,-32768,    65,   -97,-32768,-32768,-32768,
318 -32768,   -19,-32768,-32768,   143,-32768,-32768,    83,   124,   141,
319 -32768,-32768,-32768
320 };
321
322
323 #define YYLAST          495
324
325
326 static const short yytable[] = {    67,
327     99,   119,    35,    65,    54,    49,   152,   155,    84,    53,
328     91,   131,    47,    55,    88,    80,    89,    48,   171,    50,
329    125,     9,   159,    50,    92,   132,    99,    81,    99,    69,
330     18,   114,    87,    77,   168,    56,   160,    58,   -89,    27,
331     57,   119,   140,    31,   157,   158,   156,    59,   143,    60,
332     58,    76,   142,   -89,    60,   126,   127,   119,   129,    96,
333     59,    50,    60,    99,    68,    97,    95,    60,    79,   119,
334     96,   143,   143,    86,    45,    46,    97,    85,    60,    70,
335    106,    98,    67,     6,     7,     8,     9,    10,    11,    12,
336     13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
337    110,    24,    25,    26,    27,    28,   111,   126,    31,    93,
338     94,    96,   112,   116,   -19,   113,   133,    97,    32,    60,
339     98,   -19,  -103,   128,   -19,   134,   -19,   107,    93,   -19,
340     88,     6,     7,     8,     9,    10,    11,    12,    13,    14,
341     15,    16,    17,    18,    19,    20,    21,    22,   135,    24,
342     25,    26,    27,    28,   139,   140,    31,   136,   146,   156,
343    147,   148,   -19,   154,   149,   142,    32,    60,   150,   -19,
344   -104,   163,   -19,   172,   -19,     5,   164,   -19,   165,     6,
345      7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
346     17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
347     27,    28,    29,    30,    31,   166,   169,   170,     4,    75,
348    -19,    78,   162,   115,    32,   108,   153,   -19,   124,   118,
349    -19,     0,   -19,     6,     7,     8,     9,    10,    11,    12,
350     13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
351    130,    24,    25,    26,    27,    28,     0,     0,    31,     0,
352      0,     0,     0,   -82,     0,     0,     0,     0,    32,     0,
353      0,     0,   151,     0,     0,   -82,     6,     7,     8,     9,
354     10,    11,    12,    13,    14,    15,    16,    17,    18,    19,
355     20,    21,    22,     0,    24,    25,    26,    27,    28,     0,
356      0,    31,     0,     0,     0,     0,   -82,     0,     0,     0,
357      0,    32,     0,     0,     0,   167,     0,     0,   -82,     6,
358      7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
359     17,    18,    19,    20,    21,    22,     0,    24,    25,    26,
360     27,    28,     0,     0,    31,     0,     0,     0,     0,   -82,
361      0,     0,     0,     0,    32,     0,     0,     0,     0,     0,
362      0,   -82,     6,     7,     8,     9,    10,    11,    12,    13,
363     14,    15,    16,    17,    18,    19,    20,    21,    22,     0,
364     24,    25,    26,    27,    28,     0,     0,    31,     0,     0,
365      0,     0,     0,   140,     0,     0,     0,   141,     0,     0,
366      0,     0,     0,   142,     0,    60,     6,     7,     8,     9,
367     10,    11,    12,    13,    14,    15,    16,    17,    18,    19,
368     20,    21,    22,     0,    24,    25,    26,    27,    28,     0,
369      0,    31,     0,     0,     0,     0,   161,     0,     0,     0,
370      0,    32,     6,     7,     8,     9,    10,    11,    12,    13,
371     14,    15,    16,    17,    18,    19,    20,    21,    22,     0,
372     24,    25,    26,    27,    28,     0,     0,    31,     0,     0,
373      7,     8,     9,    10,    11,     0,    13,    32,    15,    16,
374      0,    18,    19,    20,     0,    22,     0,    24,    25,    26,
375     27,    28,     0,     0,    31,     0,     0,     0,     0,     0,
376      0,     0,     0,     0,    32
377 };
378
379 static const short yycheck[] = {    36,
380     71,    92,     3,    35,    24,    36,   132,     1,    60,    36,
381     32,    32,    31,    46,    29,     1,    31,    36,     0,    50,
382      1,     8,    32,    50,    46,    46,    97,    59,    99,    49,
383     17,    83,    64,    53,   160,    46,    46,    36,    32,    26,
384     43,   132,    36,    30,   142,   143,    40,    46,   119,    48,
385     36,    52,    46,    47,    48,    36,    97,   148,    99,    40,
386     46,    50,    48,   134,    31,    46,    36,    48,    36,   160,
387     40,   142,   143,    45,    43,    44,    46,    43,    48,     1,
388     44,    51,   119,     5,     6,     7,     8,     9,    10,    11,
389     12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
390     47,    23,    24,    25,    26,    27,    47,    36,    30,    43,
391     44,    40,    47,    30,    36,    47,    43,    46,    40,    48,
392     51,    43,    44,    33,    46,    45,    48,     1,    43,    51,
393     29,     5,     6,     7,     8,     9,    10,    11,    12,    13,
394     14,    15,    16,    17,    18,    19,    20,    21,    43,    23,
395     24,    25,    26,    27,    47,    36,    30,    49,    47,    40,
396     35,    45,    36,    33,    47,    46,    40,    48,    47,    43,
397     44,    47,    46,     0,    48,     1,    47,    51,    47,     5,
398      6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
399     16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
400     26,    27,    28,    29,    30,    47,    47,    47,     1,    52,
401     36,    55,   148,    86,    40,    73,   134,    43,    95,     1,
402     46,    -1,    48,     5,     6,     7,     8,     9,    10,    11,
403     12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
404    100,    23,    24,    25,    26,    27,    -1,    -1,    30,    -1,
405     -1,    -1,    -1,    35,    -1,    -1,    -1,    -1,    40,    -1,
406     -1,    -1,     1,    -1,    -1,    47,     5,     6,     7,     8,
407      9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
408     19,    20,    21,    -1,    23,    24,    25,    26,    27,    -1,
409     -1,    30,    -1,    -1,    -1,    -1,    35,    -1,    -1,    -1,
410     -1,    40,    -1,    -1,    -1,     1,    -1,    -1,    47,     5,
411      6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
412     16,    17,    18,    19,    20,    21,    -1,    23,    24,    25,
413     26,    27,    -1,    -1,    30,    -1,    -1,    -1,    -1,    35,
414     -1,    -1,    -1,    -1,    40,    -1,    -1,    -1,    -1,    -1,
415     -1,    47,     5,     6,     7,     8,     9,    10,    11,    12,
416     13,    14,    15,    16,    17,    18,    19,    20,    21,    -1,
417     23,    24,    25,    26,    27,    -1,    -1,    30,    -1,    -1,
418     -1,    -1,    -1,    36,    -1,    -1,    -1,    40,    -1,    -1,
419     -1,    -1,    -1,    46,    -1,    48,     5,     6,     7,     8,
420      9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
421     19,    20,    21,    -1,    23,    24,    25,    26,    27,    -1,
422     -1,    30,    -1,    -1,    -1,    -1,    35,    -1,    -1,    -1,
423     -1,    40,     5,     6,     7,     8,     9,    10,    11,    12,
424     13,    14,    15,    16,    17,    18,    19,    20,    21,    -1,
425     23,    24,    25,    26,    27,    -1,    -1,    30,    -1,    -1,
426      6,     7,     8,     9,    10,    -1,    12,    40,    14,    15,
427     -1,    17,    18,    19,    -1,    21,    -1,    23,    24,    25,
428     26,    27,    -1,    -1,    30,    -1,    -1,    -1,    -1,    -1,
429     -1,    -1,    -1,    -1,    40
430 };
431 /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
432 #line 3 "/usr/lib/bison.simple"
433 /* This file comes from bison-1.28.  */
434
435 /* Skeleton output parser for bison,
436    Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
437
438    This program is free software; you can redistribute it and/or modify
439    it under the terms of the GNU General Public License as published by
440    the Free Software Foundation; either version 2, or (at your option)
441    any later version.
442
443    This program is distributed in the hope that it will be useful,
444    but WITHOUT ANY WARRANTY; without even the implied warranty of
445    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
446    GNU General Public License for more details.
447
448    You should have received a copy of the GNU General Public License
449    along with this program; if not, write to the Free Software
450    Foundation, Inc., 59 Temple Place - Suite 330,
451    Boston, MA 02111-1307, USA.  */
452
453 /* As a special exception, when this file is copied by Bison into a
454    Bison output file, you may use that output file without restriction.
455    This special exception was added by the Free Software Foundation
456    in version 1.24 of Bison.  */
457
458 /* This is the parser code that is written into each bison parser
459   when the %semantic_parser declaration is not specified in the grammar.
460   It was written by Richard Stallman by simplifying the hairy parser
461   used when %semantic_parser is specified.  */
462
463 #ifndef YYSTACK_USE_ALLOCA
464 #ifdef alloca
465 #define YYSTACK_USE_ALLOCA
466 #else /* alloca not defined */
467 #ifdef __GNUC__
468 #define YYSTACK_USE_ALLOCA
469 #define alloca __builtin_alloca
470 #else /* not GNU C.  */
471 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
472 #define YYSTACK_USE_ALLOCA
473 #include <alloca.h>
474 #else /* not sparc */
475 /* We think this test detects Watcom and Microsoft C.  */
476 /* This used to test MSDOS, but that is a bad idea
477    since that symbol is in the user namespace.  */
478 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
479 #if 0 /* No need for malloc.h, which pollutes the namespace;
480          instead, just don't use alloca.  */
481 #include <malloc.h>
482 #endif
483 #else /* not MSDOS, or __TURBOC__ */
484 #if defined(_AIX)
485 /* I don't know what this was needed for, but it pollutes the namespace.
486    So I turned it off.   rms, 2 May 1997.  */
487 /* #include <malloc.h>  */
488  #pragma alloca
489 #define YYSTACK_USE_ALLOCA
490 #else /* not MSDOS, or __TURBOC__, or _AIX */
491 #if 0
492 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
493                  and on HPUX 10.  Eventually we can turn this on.  */
494 #define YYSTACK_USE_ALLOCA
495 #define alloca __builtin_alloca
496 #endif /* __hpux */
497 #endif
498 #endif /* not _AIX */
499 #endif /* not MSDOS, or __TURBOC__ */
500 #endif /* not sparc */
501 #endif /* not GNU C */
502 #endif /* alloca not defined */
503 #endif /* YYSTACK_USE_ALLOCA not defined */
504
505 #ifdef YYSTACK_USE_ALLOCA
506 #define YYSTACK_ALLOC alloca
507 #else
508 #define YYSTACK_ALLOC malloc
509 #endif
510
511 /* Note: there must be only one dollar sign in this file.
512    It is replaced by the list of actions, each action
513    as one case of the switch.  */
514
515 #define yyerrok         (yyerrstatus = 0)
516 #define yyclearin       (yychar = YYEMPTY)
517 #define YYEMPTY         -2
518 #define YYEOF           0
519 #define YYACCEPT        goto yyacceptlab
520 #define YYABORT         goto yyabortlab
521 #define YYERROR         goto yyerrlab1
522 /* Like YYERROR except do call yyerror.
523    This remains here temporarily to ease the
524    transition to the new meaning of YYERROR, for GCC.
525    Once GCC version 2 has supplanted version 1, this can go.  */
526 #define YYFAIL          goto yyerrlab
527 #define YYRECOVERING()  (!!yyerrstatus)
528 #define YYBACKUP(token, value) \
529 do                                                              \
530   if (yychar == YYEMPTY && yylen == 1)                          \
531     { yychar = (token), yylval = (value);                       \
532       yychar1 = YYTRANSLATE (yychar);                           \
533       YYPOPSTACK;                                               \
534       goto yybackup;                                            \
535     }                                                           \
536   else                                                          \
537     { yyerror ("syntax error: cannot back up"); YYERROR; }      \
538 while (0)
539
540 #define YYTERROR        1
541 #define YYERRCODE       256
542
543 #ifndef YYPURE
544 #define YYLEX           yylex()
545 #endif
546
547 #ifdef YYPURE
548 #ifdef YYLSP_NEEDED
549 #ifdef YYLEX_PARAM
550 #define YYLEX           yylex(&yylval, &yylloc, YYLEX_PARAM)
551 #else
552 #define YYLEX           yylex(&yylval, &yylloc)
553 #endif
554 #else /* not YYLSP_NEEDED */
555 #ifdef YYLEX_PARAM
556 #define YYLEX           yylex(&yylval, YYLEX_PARAM)
557 #else
558 #define YYLEX           yylex(&yylval)
559 #endif
560 #endif /* not YYLSP_NEEDED */
561 #endif
562
563 /* If nonreentrant, generate the variables here */
564
565 #ifndef YYPURE
566
567 int     yychar;                 /*  the lookahead symbol                */
568 YYSTYPE yylval;                 /*  the semantic value of the           */
569                                 /*  lookahead symbol                    */
570
571 #ifdef YYLSP_NEEDED
572 YYLTYPE yylloc;                 /*  location data for the lookahead     */
573                                 /*  symbol                              */
574 #endif
575
576 int yynerrs;                    /*  number of parse errors so far       */
577 #endif  /* not YYPURE */
578
579 #if YYDEBUG != 0
580 int yydebug;                    /*  nonzero means print parse trace     */
581 /* Since this is uninitialized, it does not stop multiple parsers
582    from coexisting.  */
583 #endif
584
585 /*  YYINITDEPTH indicates the initial size of the parser's stacks       */
586
587 #ifndef YYINITDEPTH
588 #define YYINITDEPTH 200
589 #endif
590
591 /*  YYMAXDEPTH is the maximum size the stacks can grow to
592     (effective only if the built-in stack extension method is used).  */
593
594 #if YYMAXDEPTH == 0
595 #undef YYMAXDEPTH
596 #endif
597
598 #ifndef YYMAXDEPTH
599 #define YYMAXDEPTH 10000
600 #endif
601 \f
602 /* Define __yy_memcpy.  Note that the size argument
603    should be passed with type unsigned int, because that is what the non-GCC
604    definitions require.  With GCC, __builtin_memcpy takes an arg
605    of type size_t, but it can handle unsigned int.  */
606
607 #if __GNUC__ > 1                /* GNU C and GNU C++ define this.  */
608 #define __yy_memcpy(TO,FROM,COUNT)      __builtin_memcpy(TO,FROM,COUNT)
609 #else                           /* not GNU C or C++ */
610 #ifndef __cplusplus
611
612 /* This is the most reliable way to avoid incompatibilities
613    in available built-in functions on various systems.  */
614 static void
615 __yy_memcpy (to, from, count)
616      char *to;
617      char *from;
618      unsigned int count;
619 {
620   register char *f = from;
621   register char *t = to;
622   register int i = count;
623
624   while (i-- > 0)
625     *t++ = *f++;
626 }
627
628 #else /* __cplusplus */
629
630 /* This is the most reliable way to avoid incompatibilities
631    in available built-in functions on various systems.  */
632 static void
633 __yy_memcpy (char *to, char *from, unsigned int count)
634 {
635   register char *t = to;
636   register char *f = from;
637   register int i = count;
638
639   while (i-- > 0)
640     *t++ = *f++;
641 }
642
643 #endif
644 #endif
645 \f
646 #line 217 "/usr/lib/bison.simple"
647
648 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
649    into yyparse.  The argument should have type void *.
650    It should actually point to an object.
651    Grammar actions can access the variable by casting it
652    to the proper pointer type.  */
653
654 #ifdef YYPARSE_PARAM
655 #ifdef __cplusplus
656 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
657 #define YYPARSE_PARAM_DECL
658 #else /* not __cplusplus */
659 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
660 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
661 #endif /* not __cplusplus */
662 #else /* not YYPARSE_PARAM */
663 #define YYPARSE_PARAM_ARG
664 #define YYPARSE_PARAM_DECL
665 #endif /* not YYPARSE_PARAM */
666
667 /* Prevent warning if -Wstrict-prototypes.  */
668 #ifdef __GNUC__
669 #ifdef YYPARSE_PARAM
670 int yyparse (void *);
671 #else
672 int yyparse (void);
673 #endif
674 #endif
675
676 int
677 yyparse(YYPARSE_PARAM_ARG)
678      YYPARSE_PARAM_DECL
679 {
680   register int yystate;
681   register int yyn;
682   register short *yyssp;
683   register YYSTYPE *yyvsp;
684   int yyerrstatus;      /*  number of tokens to shift before error messages enabled */
685   int yychar1 = 0;              /*  lookahead token as an internal (translated) token number */
686
687   short yyssa[YYINITDEPTH];     /*  the state stack                     */
688   YYSTYPE yyvsa[YYINITDEPTH];   /*  the semantic value stack            */
689
690   short *yyss = yyssa;          /*  refer to the stacks thru separate pointers */
691   YYSTYPE *yyvs = yyvsa;        /*  to allow yyoverflow to reallocate them elsewhere */
692
693 #ifdef YYLSP_NEEDED
694   YYLTYPE yylsa[YYINITDEPTH];   /*  the location stack                  */
695   YYLTYPE *yyls = yylsa;
696   YYLTYPE *yylsp;
697
698 #define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
699 #else
700 #define YYPOPSTACK   (yyvsp--, yyssp--)
701 #endif
702
703   int yystacksize = YYINITDEPTH;
704   int yyfree_stacks = 0;
705
706 #ifdef YYPURE
707   int yychar;
708   YYSTYPE yylval;
709   int yynerrs;
710 #ifdef YYLSP_NEEDED
711   YYLTYPE yylloc;
712 #endif
713 #endif
714
715   YYSTYPE yyval;                /*  the variable used to return         */
716                                 /*  semantic values from the action     */
717                                 /*  routines                            */
718
719   int yylen;
720
721 #if YYDEBUG != 0
722   if (yydebug)
723     fprintf(stderr, "Starting parse\n");
724 #endif
725
726   yystate = 0;
727   yyerrstatus = 0;
728   yynerrs = 0;
729   yychar = YYEMPTY;             /* Cause a token to be read.  */
730
731   /* Initialize stack pointers.
732      Waste one element of value and location stack
733      so that they stay on the same level as the state stack.
734      The wasted elements are never initialized.  */
735
736   yyssp = yyss - 1;
737   yyvsp = yyvs;
738 #ifdef YYLSP_NEEDED
739   yylsp = yyls;
740 #endif
741
742 /* Push a new state, which is found in  yystate  .  */
743 /* In all cases, when you get here, the value and location stacks
744    have just been pushed. so pushing a state here evens the stacks.  */
745 yynewstate:
746
747   *++yyssp = yystate;
748
749   if (yyssp >= yyss + yystacksize - 1)
750     {
751       /* Give user a chance to reallocate the stack */
752       /* Use copies of these so that the &'s don't force the real ones into memory. */
753       YYSTYPE *yyvs1 = yyvs;
754       short *yyss1 = yyss;
755 #ifdef YYLSP_NEEDED
756       YYLTYPE *yyls1 = yyls;
757 #endif
758
759       /* Get the current used size of the three stacks, in elements.  */
760       int size = yyssp - yyss + 1;
761
762 #ifdef yyoverflow
763       /* Each stack pointer address is followed by the size of
764          the data in use in that stack, in bytes.  */
765 #ifdef YYLSP_NEEDED
766       /* This used to be a conditional around just the two extra args,
767          but that might be undefined if yyoverflow is a macro.  */
768       yyoverflow("parser stack overflow",
769                  &yyss1, size * sizeof (*yyssp),
770                  &yyvs1, size * sizeof (*yyvsp),
771                  &yyls1, size * sizeof (*yylsp),
772                  &yystacksize);
773 #else
774       yyoverflow("parser stack overflow",
775                  &yyss1, size * sizeof (*yyssp),
776                  &yyvs1, size * sizeof (*yyvsp),
777                  &yystacksize);
778 #endif
779
780       yyss = yyss1; yyvs = yyvs1;
781 #ifdef YYLSP_NEEDED
782       yyls = yyls1;
783 #endif
784 #else /* no yyoverflow */
785       /* Extend the stack our own way.  */
786       if (yystacksize >= YYMAXDEPTH)
787         {
788           yyerror("parser stack overflow");
789           if (yyfree_stacks)
790             {
791               free (yyss);
792               free (yyvs);
793 #ifdef YYLSP_NEEDED
794               free (yyls);
795 #endif
796             }
797           return 2;
798         }
799       yystacksize *= 2;
800       if (yystacksize > YYMAXDEPTH)
801         yystacksize = YYMAXDEPTH;
802 #ifndef YYSTACK_USE_ALLOCA
803       yyfree_stacks = 1;
804 #endif
805       yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
806       __yy_memcpy ((char *)yyss, (char *)yyss1,
807                    size * (unsigned int) sizeof (*yyssp));
808       yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
809       __yy_memcpy ((char *)yyvs, (char *)yyvs1,
810                    size * (unsigned int) sizeof (*yyvsp));
811 #ifdef YYLSP_NEEDED
812       yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
813       __yy_memcpy ((char *)yyls, (char *)yyls1,
814                    size * (unsigned int) sizeof (*yylsp));
815 #endif
816 #endif /* no yyoverflow */
817
818       yyssp = yyss + size - 1;
819       yyvsp = yyvs + size - 1;
820 #ifdef YYLSP_NEEDED
821       yylsp = yyls + size - 1;
822 #endif
823
824 #if YYDEBUG != 0
825       if (yydebug)
826         fprintf(stderr, "Stack size increased to %d\n", yystacksize);
827 #endif
828
829       if (yyssp >= yyss + yystacksize - 1)
830         YYABORT;
831     }
832
833 #if YYDEBUG != 0
834   if (yydebug)
835     fprintf(stderr, "Entering state %d\n", yystate);
836 #endif
837
838   goto yybackup;
839  yybackup:
840
841 /* Do appropriate processing given the current state.  */
842 /* Read a lookahead token if we need one and don't already have one.  */
843 /* yyresume: */
844
845   /* First try to decide what to do without reference to lookahead token.  */
846
847   yyn = yypact[yystate];
848   if (yyn == YYFLAG)
849     goto yydefault;
850
851   /* Not known => get a lookahead token if don't already have one.  */
852
853   /* yychar is either YYEMPTY or YYEOF
854      or a valid token in external form.  */
855
856   if (yychar == YYEMPTY)
857     {
858 #if YYDEBUG != 0
859       if (yydebug)
860         fprintf(stderr, "Reading a token: ");
861 #endif
862       yychar = YYLEX;
863     }
864
865   /* Convert token to internal form (in yychar1) for indexing tables with */
866
867   if (yychar <= 0)              /* This means end of input. */
868     {
869       yychar1 = 0;
870       yychar = YYEOF;           /* Don't call YYLEX any more */
871
872 #if YYDEBUG != 0
873       if (yydebug)
874         fprintf(stderr, "Now at end of input.\n");
875 #endif
876     }
877   else
878     {
879       yychar1 = YYTRANSLATE(yychar);
880
881 #if YYDEBUG != 0
882       if (yydebug)
883         {
884           fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
885           /* Give the individual parser a way to print the precise meaning
886              of a token, for further debugging info.  */
887 #ifdef YYPRINT
888           YYPRINT (stderr, yychar, yylval);
889 #endif
890           fprintf (stderr, ")\n");
891         }
892 #endif
893     }
894
895   yyn += yychar1;
896   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
897     goto yydefault;
898
899   yyn = yytable[yyn];
900
901   /* yyn is what to do for this token type in this state.
902      Negative => reduce, -yyn is rule number.
903      Positive => shift, yyn is new state.
904        New state is final state => don't bother to shift,
905        just return success.
906      0, or most negative number => error.  */
907
908   if (yyn < 0)
909     {
910       if (yyn == YYFLAG)
911         goto yyerrlab;
912       yyn = -yyn;
913       goto yyreduce;
914     }
915   else if (yyn == 0)
916     goto yyerrlab;
917
918   if (yyn == YYFINAL)
919     YYACCEPT;
920
921   /* Shift the lookahead token.  */
922
923 #if YYDEBUG != 0
924   if (yydebug)
925     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
926 #endif
927
928   /* Discard the token being shifted unless it is eof.  */
929   if (yychar != YYEOF)
930     yychar = YYEMPTY;
931
932   *++yyvsp = yylval;
933 #ifdef YYLSP_NEEDED
934   *++yylsp = yylloc;
935 #endif
936
937   /* count tokens shifted since error; after three, turn off error status.  */
938   if (yyerrstatus) yyerrstatus--;
939
940   yystate = yyn;
941   goto yynewstate;
942
943 /* Do the default action for the current state.  */
944 yydefault:
945
946   yyn = yydefact[yystate];
947   if (yyn == 0)
948     goto yyerrlab;
949
950 /* Do a reduction.  yyn is the number of a rule to reduce with.  */
951 yyreduce:
952   yylen = yyr2[yyn];
953   if (yylen > 0)
954     yyval = yyvsp[1-yylen]; /* implement default value of the action */
955
956 #if YYDEBUG != 0
957   if (yydebug)
958     {
959       int i;
960
961       fprintf (stderr, "Reducing via rule %d (line %d), ",
962                yyn, yyrline[yyn]);
963
964       /* Print the symbols being reduced, and their result.  */
965       for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
966         fprintf (stderr, "%s ", yytname[yyrhs[i]]);
967       fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
968     }
969 #endif
970
971
972   switch (yyn) {
973
974 case 3:
975 #line 107 "scripts/genksyms/parse.y"
976 { is_typedef = 0; is_extern = 0; current_name = NULL; decl_spec = NULL; ;
977     break;}
978 case 4:
979 #line 109 "scripts/genksyms/parse.y"
980 { free_list(*yyvsp[0], NULL); *yyvsp[0] = NULL; ;
981     break;}
982 case 5:
983 #line 113 "scripts/genksyms/parse.y"
984 { is_typedef = 1; ;
985     break;}
986 case 6:
987 #line 114 "scripts/genksyms/parse.y"
988 { yyval = yyvsp[0]; ;
989     break;}
990 case 11:
991 #line 119 "scripts/genksyms/parse.y"
992 { yyval = yyvsp[0]; ;
993     break;}
994 case 12:
995 #line 120 "scripts/genksyms/parse.y"
996 { yyval = yyvsp[0]; ;
997     break;}
998 case 13:
999 #line 125 "scripts/genksyms/parse.y"
1000 { if (current_name) {
1001                     struct string_list *decl = (*yyvsp[0])->next;
1002                     (*yyvsp[0])->next = NULL;
1003                     add_symbol(current_name,
1004                                is_typedef ? SYM_TYPEDEF : SYM_NORMAL,
1005                                decl, is_extern);
1006                     current_name = NULL;
1007                   }
1008                   yyval = yyvsp[0];
1009                 ;
1010     break;}
1011 case 14:
1012 #line 138 "scripts/genksyms/parse.y"
1013 { yyval = NULL; ;
1014     break;}
1015 case 16:
1016 #line 144 "scripts/genksyms/parse.y"
1017 { struct string_list *decl = *yyvsp[0];
1018                   *yyvsp[0] = NULL;
1019                   add_symbol(current_name,
1020                              is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern);
1021                   current_name = NULL;
1022                   yyval = yyvsp[0];
1023                 ;
1024     break;}
1025 case 17:
1026 #line 152 "scripts/genksyms/parse.y"
1027 { struct string_list *decl = *yyvsp[0];
1028                   *yyvsp[0] = NULL;
1029                   free_list(*yyvsp[-1], NULL);
1030                   *yyvsp[-1] = decl_spec;
1031                   add_symbol(current_name,
1032                              is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern);
1033                   current_name = NULL;
1034                   yyval = yyvsp[0];
1035                 ;
1036     break;}
1037 case 18:
1038 #line 165 "scripts/genksyms/parse.y"
1039 { yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1] ? yyvsp[-1] : yyvsp[-2] ? yyvsp[-2] : yyvsp[-3]; ;
1040     break;}
1041 case 19:
1042 #line 170 "scripts/genksyms/parse.y"
1043 { decl_spec = NULL; ;
1044     break;}
1045 case 21:
1046 #line 175 "scripts/genksyms/parse.y"
1047 { decl_spec = *yyvsp[0]; ;
1048     break;}
1049 case 22:
1050 #line 176 "scripts/genksyms/parse.y"
1051 { decl_spec = *yyvsp[0]; ;
1052     break;}
1053 case 23:
1054 #line 181 "scripts/genksyms/parse.y"
1055 { /* Version 2 checksumming ignores storage class, as that
1056                      is really irrelevant to the linkage.  */
1057                   remove_node(yyvsp[0]);
1058                   yyval = yyvsp[0];
1059                 ;
1060     break;}
1061 case 28:
1062 #line 193 "scripts/genksyms/parse.y"
1063 { is_extern = 1; yyval = yyvsp[0]; ;
1064     break;}
1065 case 29:
1066 #line 194 "scripts/genksyms/parse.y"
1067 { is_extern = 0; yyval = yyvsp[0]; ;
1068     break;}
1069 case 33:
1070 #line 205 "scripts/genksyms/parse.y"
1071 { remove_node(yyvsp[-1]); (*yyvsp[0])->tag = SYM_STRUCT; yyval = yyvsp[0]; ;
1072     break;}
1073 case 34:
1074 #line 207 "scripts/genksyms/parse.y"
1075 { remove_node(yyvsp[-1]); (*yyvsp[0])->tag = SYM_UNION; yyval = yyvsp[0]; ;
1076     break;}
1077 case 35:
1078 #line 209 "scripts/genksyms/parse.y"
1079 { remove_node(yyvsp[-1]); (*yyvsp[0])->tag = SYM_ENUM; yyval = yyvsp[0]; ;
1080     break;}
1081 case 36:
1082 #line 213 "scripts/genksyms/parse.y"
1083 { struct string_list *s = *yyvsp[0], *i = *yyvsp[-1], *r;
1084                   r = copy_node(i); r->tag = SYM_STRUCT;
1085                   r->next = (*yyvsp[-2])->next; *yyvsp[0] = r; (*yyvsp[-2])->next = NULL;
1086                   add_symbol(i->string, SYM_STRUCT, s, is_extern);
1087                   yyval = yyvsp[0];
1088                 ;
1089     break;}
1090 case 37:
1091 #line 220 "scripts/genksyms/parse.y"
1092 { struct string_list *s = *yyvsp[0], *i = *yyvsp[-1], *r;
1093                   r = copy_node(i); r->tag = SYM_UNION;
1094                   r->next = (*yyvsp[-2])->next; *yyvsp[0] = r; (*yyvsp[-2])->next = NULL;
1095                   add_symbol(i->string, SYM_UNION, s, is_extern);
1096                   yyval = yyvsp[0];
1097                 ;
1098     break;}
1099 case 38:
1100 #line 227 "scripts/genksyms/parse.y"
1101 { struct string_list *s = *yyvsp[0], *i = *yyvsp[-1], *r;
1102                   r = copy_node(i); r->tag = SYM_ENUM;
1103                   r->next = (*yyvsp[-2])->next; *yyvsp[0] = r; (*yyvsp[-2])->next = NULL;
1104                   add_symbol(i->string, SYM_ENUM, s, is_extern);
1105                   yyval = yyvsp[0];
1106                 ;
1107     break;}
1108 case 39:
1109 #line 235 "scripts/genksyms/parse.y"
1110 { yyval = yyvsp[0]; ;
1111     break;}
1112 case 40:
1113 #line 236 "scripts/genksyms/parse.y"
1114 { yyval = yyvsp[0]; ;
1115     break;}
1116 case 41:
1117 #line 237 "scripts/genksyms/parse.y"
1118 { yyval = yyvsp[0]; ;
1119     break;}
1120 case 52:
1121 #line 251 "scripts/genksyms/parse.y"
1122 { (*yyvsp[0])->tag = SYM_TYPEDEF; yyval = yyvsp[0]; ;
1123     break;}
1124 case 53:
1125 #line 256 "scripts/genksyms/parse.y"
1126 { yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ;
1127     break;}
1128 case 54:
1129 #line 260 "scripts/genksyms/parse.y"
1130 { yyval = NULL; ;
1131     break;}
1132 case 57:
1133 #line 266 "scripts/genksyms/parse.y"
1134 { yyval = yyvsp[0]; ;
1135     break;}
1136 case 61:
1137 #line 272 "scripts/genksyms/parse.y"
1138 { /* restrict has no effect in prototypes so ignore it */
1139                   remove_node(yyvsp[0]);
1140                   yyval = yyvsp[0];
1141                 ;
1142     break;}
1143 case 62:
1144 #line 279 "scripts/genksyms/parse.y"
1145 { yyval = yyvsp[0]; ;
1146     break;}
1147 case 64:
1148 #line 285 "scripts/genksyms/parse.y"
1149 { if (current_name != NULL) {
1150                     error_with_pos("unexpected second declaration name");
1151                     YYERROR;
1152                   } else {
1153                     current_name = (*yyvsp[0])->string;
1154                     yyval = yyvsp[0];
1155                   }
1156                 ;
1157     break;}
1158 case 65:
1159 #line 294 "scripts/genksyms/parse.y"
1160 { yyval = yyvsp[0]; ;
1161     break;}
1162 case 66:
1163 #line 296 "scripts/genksyms/parse.y"
1164 { yyval = yyvsp[0]; ;
1165     break;}
1166 case 67:
1167 #line 298 "scripts/genksyms/parse.y"
1168 { yyval = yyvsp[0]; ;
1169     break;}
1170 case 68:
1171 #line 300 "scripts/genksyms/parse.y"
1172 { yyval = yyvsp[0]; ;
1173     break;}
1174 case 69:
1175 #line 302 "scripts/genksyms/parse.y"
1176 { yyval = yyvsp[0]; ;
1177     break;}
1178 case 70:
1179 #line 308 "scripts/genksyms/parse.y"
1180 { yyval = yyvsp[0]; ;
1181     break;}
1182 case 74:
1183 #line 316 "scripts/genksyms/parse.y"
1184 { yyval = yyvsp[0]; ;
1185     break;}
1186 case 75:
1187 #line 318 "scripts/genksyms/parse.y"
1188 { yyval = yyvsp[0]; ;
1189     break;}
1190 case 76:
1191 #line 320 "scripts/genksyms/parse.y"
1192 { yyval = yyvsp[0]; ;
1193     break;}
1194 case 77:
1195 #line 322 "scripts/genksyms/parse.y"
1196 { yyval = yyvsp[0]; ;
1197     break;}
1198 case 78:
1199 #line 324 "scripts/genksyms/parse.y"
1200 { yyval = yyvsp[0]; ;
1201     break;}
1202 case 79:
1203 #line 328 "scripts/genksyms/parse.y"
1204 { yyval = yyvsp[0]; ;
1205     break;}
1206 case 81:
1207 #line 330 "scripts/genksyms/parse.y"
1208 { yyval = yyvsp[0]; ;
1209     break;}
1210 case 82:
1211 #line 334 "scripts/genksyms/parse.y"
1212 { yyval = NULL; ;
1213     break;}
1214 case 85:
1215 #line 341 "scripts/genksyms/parse.y"
1216 { yyval = yyvsp[0]; ;
1217     break;}
1218 case 86:
1219 #line 346 "scripts/genksyms/parse.y"
1220 { yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ;
1221     break;}
1222 case 87:
1223 #line 351 "scripts/genksyms/parse.y"
1224 { yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ;
1225     break;}
1226 case 89:
1227 #line 356 "scripts/genksyms/parse.y"
1228 { yyval = NULL; ;
1229     break;}
1230 case 90:
1231 #line 358 "scripts/genksyms/parse.y"
1232 { /* For version 2 checksums, we don't want to remember
1233                      private parameter names.  */
1234                   remove_node(yyvsp[0]);
1235                   yyval = yyvsp[0];
1236                 ;
1237     break;}
1238 case 91:
1239 #line 366 "scripts/genksyms/parse.y"
1240 { remove_node(yyvsp[0]);
1241                   yyval = yyvsp[0];
1242                 ;
1243     break;}
1244 case 92:
1245 #line 370 "scripts/genksyms/parse.y"
1246 { yyval = yyvsp[0]; ;
1247     break;}
1248 case 93:
1249 #line 372 "scripts/genksyms/parse.y"
1250 { yyval = yyvsp[0]; ;
1251     break;}
1252 case 94:
1253 #line 374 "scripts/genksyms/parse.y"
1254 { yyval = yyvsp[0]; ;
1255     break;}
1256 case 95:
1257 #line 376 "scripts/genksyms/parse.y"
1258 { yyval = yyvsp[0]; ;
1259     break;}
1260 case 96:
1261 #line 378 "scripts/genksyms/parse.y"
1262 { yyval = yyvsp[0]; ;
1263     break;}
1264 case 97:
1265 #line 383 "scripts/genksyms/parse.y"
1266 { struct string_list *decl = *yyvsp[-1];
1267                   *yyvsp[-1] = NULL;
1268                   add_symbol(current_name, SYM_NORMAL, decl, is_extern);
1269                   yyval = yyvsp[0];
1270                 ;
1271     break;}
1272 case 98:
1273 #line 391 "scripts/genksyms/parse.y"
1274 { yyval = NULL; ;
1275     break;}
1276 case 100:
1277 #line 398 "scripts/genksyms/parse.y"
1278 { remove_list(yyvsp[0], &(*yyvsp[-1])->next); yyval = yyvsp[0]; ;
1279     break;}
1280 case 101:
1281 #line 402 "scripts/genksyms/parse.y"
1282 { yyval = yyvsp[0]; ;
1283     break;}
1284 case 102:
1285 #line 403 "scripts/genksyms/parse.y"
1286 { yyval = yyvsp[0]; ;
1287     break;}
1288 case 103:
1289 #line 407 "scripts/genksyms/parse.y"
1290 { yyval = NULL; ;
1291     break;}
1292 case 106:
1293 #line 413 "scripts/genksyms/parse.y"
1294 { yyval = yyvsp[0]; ;
1295     break;}
1296 case 107:
1297 #line 418 "scripts/genksyms/parse.y"
1298 { yyval = yyvsp[0]; ;
1299     break;}
1300 case 108:
1301 #line 420 "scripts/genksyms/parse.y"
1302 { yyval = yyvsp[0]; ;
1303     break;}
1304 case 109:
1305 #line 424 "scripts/genksyms/parse.y"
1306 { yyval = NULL; ;
1307     break;}
1308 case 112:
1309 #line 430 "scripts/genksyms/parse.y"
1310 { yyval = yyvsp[0]; ;
1311     break;}
1312 case 113:
1313 #line 434 "scripts/genksyms/parse.y"
1314 { yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ;
1315     break;}
1316 case 114:
1317 #line 435 "scripts/genksyms/parse.y"
1318 { yyval = yyvsp[0]; ;
1319     break;}
1320 case 116:
1321 #line 440 "scripts/genksyms/parse.y"
1322 { yyval = yyvsp[0]; ;
1323     break;}
1324 case 117:
1325 #line 444 "scripts/genksyms/parse.y"
1326 { yyval = NULL; ;
1327     break;}
1328 case 119:
1329 #line 449 "scripts/genksyms/parse.y"
1330 { yyval = yyvsp[0]; ;
1331     break;}
1332 case 120:
1333 #line 453 "scripts/genksyms/parse.y"
1334 { yyval = NULL; ;
1335     break;}
1336 case 122:
1337 #line 459 "scripts/genksyms/parse.y"
1338 { export_symbol((*yyvsp[-2])->string); yyval = yyvsp[0]; ;
1339     break;}
1340 }
1341    /* the action file gets copied in in place of this dollarsign */
1342 #line 543 "/usr/lib/bison.simple"
1343 \f
1344   yyvsp -= yylen;
1345   yyssp -= yylen;
1346 #ifdef YYLSP_NEEDED
1347   yylsp -= yylen;
1348 #endif
1349
1350 #if YYDEBUG != 0
1351   if (yydebug)
1352     {
1353       short *ssp1 = yyss - 1;
1354       fprintf (stderr, "state stack now");
1355       while (ssp1 != yyssp)
1356         fprintf (stderr, " %d", *++ssp1);
1357       fprintf (stderr, "\n");
1358     }
1359 #endif
1360
1361   *++yyvsp = yyval;
1362
1363 #ifdef YYLSP_NEEDED
1364   yylsp++;
1365   if (yylen == 0)
1366     {
1367       yylsp->first_line = yylloc.first_line;
1368       yylsp->first_column = yylloc.first_column;
1369       yylsp->last_line = (yylsp-1)->last_line;
1370       yylsp->last_column = (yylsp-1)->last_column;
1371       yylsp->text = 0;
1372     }
1373   else
1374     {
1375       yylsp->last_line = (yylsp+yylen-1)->last_line;
1376       yylsp->last_column = (yylsp+yylen-1)->last_column;
1377     }
1378 #endif
1379
1380   /* Now "shift" the result of the reduction.
1381      Determine what state that goes to,
1382      based on the state we popped back to
1383      and the rule number reduced by.  */
1384
1385   yyn = yyr1[yyn];
1386
1387   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1388   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1389     yystate = yytable[yystate];
1390   else
1391     yystate = yydefgoto[yyn - YYNTBASE];
1392
1393   goto yynewstate;
1394
1395 yyerrlab:   /* here on detecting error */
1396
1397   if (! yyerrstatus)
1398     /* If not already recovering from an error, report this error.  */
1399     {
1400       ++yynerrs;
1401
1402 #ifdef YYERROR_VERBOSE
1403       yyn = yypact[yystate];
1404
1405       if (yyn > YYFLAG && yyn < YYLAST)
1406         {
1407           int size = 0;
1408           char *msg;
1409           int x, count;
1410
1411           count = 0;
1412           /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
1413           for (x = (yyn < 0 ? -yyn : 0);
1414                x < (sizeof(yytname) / sizeof(char *)); x++)
1415             if (yycheck[x + yyn] == x)
1416               size += strlen(yytname[x]) + 15, count++;
1417           msg = (char *) malloc(size + 15);
1418           if (msg != 0)
1419             {
1420               strcpy(msg, "parse error");
1421
1422               if (count < 5)
1423                 {
1424                   count = 0;
1425                   for (x = (yyn < 0 ? -yyn : 0);
1426                        x < (sizeof(yytname) / sizeof(char *)); x++)
1427                     if (yycheck[x + yyn] == x)
1428                       {
1429                         strcat(msg, count == 0 ? ", expecting `" : " or `");
1430                         strcat(msg, yytname[x]);
1431                         strcat(msg, "'");
1432                         count++;
1433                       }
1434                 }
1435               yyerror(msg);
1436               free(msg);
1437             }
1438           else
1439             yyerror ("parse error; also virtual memory exceeded");
1440         }
1441       else
1442 #endif /* YYERROR_VERBOSE */
1443         yyerror("parse error");
1444     }
1445
1446   goto yyerrlab1;
1447 yyerrlab1:   /* here on error raised explicitly by an action */
1448
1449   if (yyerrstatus == 3)
1450     {
1451       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
1452
1453       /* return failure if at end of input */
1454       if (yychar == YYEOF)
1455         YYABORT;
1456
1457 #if YYDEBUG != 0
1458       if (yydebug)
1459         fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
1460 #endif
1461
1462       yychar = YYEMPTY;
1463     }
1464
1465   /* Else will try to reuse lookahead token
1466      after shifting the error token.  */
1467
1468   yyerrstatus = 3;              /* Each real token shifted decrements this */
1469
1470   goto yyerrhandle;
1471
1472 yyerrdefault:  /* current state does not do anything special for the error token. */
1473
1474 #if 0
1475   /* This is wrong; only states that explicitly want error tokens
1476      should shift them.  */
1477   yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
1478   if (yyn) goto yydefault;
1479 #endif
1480
1481 yyerrpop:   /* pop the current state because it cannot handle the error token */
1482
1483   if (yyssp == yyss) YYABORT;
1484   yyvsp--;
1485   yystate = *--yyssp;
1486 #ifdef YYLSP_NEEDED
1487   yylsp--;
1488 #endif
1489
1490 #if YYDEBUG != 0
1491   if (yydebug)
1492     {
1493       short *ssp1 = yyss - 1;
1494       fprintf (stderr, "Error: state stack now");
1495       while (ssp1 != yyssp)
1496         fprintf (stderr, " %d", *++ssp1);
1497       fprintf (stderr, "\n");
1498     }
1499 #endif
1500
1501 yyerrhandle:
1502
1503   yyn = yypact[yystate];
1504   if (yyn == YYFLAG)
1505     goto yyerrdefault;
1506
1507   yyn += YYTERROR;
1508   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1509     goto yyerrdefault;
1510
1511   yyn = yytable[yyn];
1512   if (yyn < 0)
1513     {
1514       if (yyn == YYFLAG)
1515         goto yyerrpop;
1516       yyn = -yyn;
1517       goto yyreduce;
1518     }
1519   else if (yyn == 0)
1520     goto yyerrpop;
1521
1522   if (yyn == YYFINAL)
1523     YYACCEPT;
1524
1525 #if YYDEBUG != 0
1526   if (yydebug)
1527     fprintf(stderr, "Shifting error token, ");
1528 #endif
1529
1530   *++yyvsp = yylval;
1531 #ifdef YYLSP_NEEDED
1532   *++yylsp = yylloc;
1533 #endif
1534
1535   yystate = yyn;
1536   goto yynewstate;
1537
1538  yyacceptlab:
1539   /* YYACCEPT comes here.  */
1540   if (yyfree_stacks)
1541     {
1542       free (yyss);
1543       free (yyvs);
1544 #ifdef YYLSP_NEEDED
1545       free (yyls);
1546 #endif
1547     }
1548   return 0;
1549
1550  yyabortlab:
1551   /* YYABORT comes here.  */
1552   if (yyfree_stacks)
1553     {
1554       free (yyss);
1555       free (yyvs);
1556 #ifdef YYLSP_NEEDED
1557       free (yyls);
1558 #endif
1559     }
1560   return 1;
1561 }
1562 #line 463 "scripts/genksyms/parse.y"
1563
1564
1565 static void
1566 yyerror(const char *e)
1567 {
1568   error_with_pos("%s", e);
1569 }