2 /* A Bison parser, made from scripts/genksyms/parse.y
3 by GNU Bison version 1.28 */
5 #define YYBISON 1 /* Identify Bison output. */
8 #define ATTRIBUTE_KEYW 258
12 #define CONST_KEYW 262
13 #define DOUBLE_KEYW 263
15 #define EXTERN_KEYW 265
16 #define FLOAT_KEYW 266
17 #define INLINE_KEYW 267
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
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
48 #line 24 "scripts/genksyms/parse.y"
55 static int is_typedef;
57 static char *current_name;
58 static struct string_list *decl_spec;
60 static void yyerror(const char *);
63 remove_node(struct string_list **p)
65 struct string_list *node = *p;
71 remove_list(struct string_list **pb, struct string_list **pe)
73 struct string_list *b = *pb, *e = *pe;
99 #define YYTRANSLATE(x) ((unsigned)(x) <= 296 ? yytranslate[x] : 96)
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
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,
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, 62, 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,
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,
208 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
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
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,
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,
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,
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,
293 static const short yypact[] = {-32768,
294 15,-32768, 197,-32768, 23,-32768,-32768,-32768,-32768,-32768,
295 -18,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
296 -32768, -28,-32768, -25,-32768,-32768,-32768, -26, -22, -12,
297 -32768,-32768,-32768,-32768, 49, 493,-32768,-32768,-32768,-32768,
298 -32768,-32768,-32768,-32768,-32768,-32768,-32768, 27, -8, 101,
299 -32768, 493, -8,-32768, 493, 10,-32768,-32768, 11, 9,
300 18, 26,-32768, 49, -15, -13,-32768,-32768,-32768, 25,
301 24, 48, 149,-32768,-32768, 49,-32768, 414, 39, 40,
302 47,-32768, 9,-32768,-32768, 49,-32768,-32768,-32768, 66,
303 -32768, 241,-32768,-32768, 50,-32768, 5, 65, 42, 66,
304 17, 56, 55,-32768,-32768,-32768, 60,-32768, 75,-32768,
305 80,-32768,-32768,-32768,-32768,-32768, 81, 82, 370, 85,
306 98, 89,-32768,-32768, 88,-32768, 91,-32768,-32768,-32768,
307 -32768, 284,-32768, 24,-32768, 103,-32768,-32768,-32768,-32768,
308 -32768, 8, 43,-32768, 30,-32768,-32768, 457,-32768,-32768,
309 92, 93,-32768,-32768, 95,-32768, 96,-32768,-32768, 327,
310 -32768,-32768,-32768,-32768,-32768,-32768, 99, 104,-32768,-32768,
314 static const short yypgoto[] = {-32768,
315 152,-32768,-32768,-32768, 119,-32768,-32768, 94, 0, -55,
316 -35,-32768,-32768,-32768, -69,-32768,-32768, -56, -30,-32768,
317 -76,-32768, -122,-32768,-32768, 29, -62,-32768,-32768,-32768,
318 -32768, -17,-32768,-32768, 105,-32768,-32768, 52, 86, 83,
326 static const short yytable[] = { 78,
327 67, 99, 35, 84, 65, 125, 54, 49, 155, 152,
328 53, 80, 47, 88, 171, 89, 9, 48, 91, 55,
329 127, 50, 129, 56, 50, 18, 114, 99, 81, 99,
330 57, 69, 92, 87, 27, 77, 119, 168, 31, -89,
331 126, 50, 67, 140, 96, 79, 58, 156, 131, 143,
332 97, 76, 60, 142, -89, 60, 59, 68, 60, 95,
333 85, 159, 132, 96, 99, 45, 46, 93, 94, 97,
334 86, 60, 143, 143, 98, 160, 119, 126, 140, 157,
335 158, 96, 156, 67, 58, 111, 112, 97, 142, 60,
336 60, 106, 119, 113, 59, 116, 60, 128, 133, 134,
337 98, 70, 93, 88, 119, 6, 7, 8, 9, 10,
338 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
339 21, 22, 135, 24, 25, 26, 27, 28, 139, 136,
340 31, 146, 147, 148, 149, 154, -19, 150, 163, 164,
341 32, 165, 166, -19, -103, 169, -19, 172, -19, 107,
342 170, -19, 4, 6, 7, 8, 9, 10, 11, 12,
343 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
344 75, 24, 25, 26, 27, 28, 162, 108, 31, 115,
345 124, 0, 130, 0, -19, 153, 0, 0, 32, 0,
346 0, -19, -104, 0, -19, 0, -19, 5, 0, -19,
347 0, 6, 7, 8, 9, 10, 11, 12, 13, 14,
348 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
349 25, 26, 27, 28, 29, 30, 31, 0, 0, 0,
350 0, 0, -19, 0, 0, 0, 32, 0, 0, -19,
351 0, 118, -19, 0, -19, 6, 7, 8, 9, 10,
352 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
353 21, 22, 0, 24, 25, 26, 27, 28, 0, 0,
354 31, 0, 0, 0, 0, -82, 0, 0, 0, 0,
355 32, 0, 0, 0, 151, 0, 0, -82, 6, 7,
356 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
357 18, 19, 20, 21, 22, 0, 24, 25, 26, 27,
358 28, 0, 0, 31, 0, 0, 0, 0, -82, 0,
359 0, 0, 0, 32, 0, 0, 0, 167, 0, 0,
360 -82, 6, 7, 8, 9, 10, 11, 12, 13, 14,
361 15, 16, 17, 18, 19, 20, 21, 22, 0, 24,
362 25, 26, 27, 28, 0, 0, 31, 0, 0, 0,
363 0, -82, 0, 0, 0, 0, 32, 0, 0, 0,
364 0, 0, 0, -82, 6, 7, 8, 9, 10, 11,
365 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
366 22, 0, 24, 25, 26, 27, 28, 0, 0, 31,
367 0, 0, 0, 0, 0, 140, 0, 0, 0, 141,
368 0, 0, 0, 0, 0, 142, 0, 60, 6, 7,
369 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
370 18, 19, 20, 21, 22, 0, 24, 25, 26, 27,
371 28, 0, 0, 31, 0, 0, 0, 0, 0, 0,
372 0, 0, 0, 32, 0, 0, 0, 0, 0, 0,
373 110, 6, 7, 8, 9, 10, 11, 12, 13, 14,
374 15, 16, 17, 18, 19, 20, 21, 22, 0, 24,
375 25, 26, 27, 28, 0, 0, 31, 0, 0, 0,
376 0, 161, 0, 0, 0, 0, 32, 6, 7, 8,
377 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
378 19, 20, 21, 22, 0, 24, 25, 26, 27, 28,
379 0, 0, 31, 0, 0, 0, 0, 0, 0, 0,
383 static const short yycheck[] = { 55,
384 36, 71, 3, 60, 35, 1, 24, 36, 1, 132,
385 36, 1, 31, 29, 0, 31, 8, 36, 32, 46,
386 97, 50, 99, 46, 50, 17, 83, 97, 59, 99,
387 43, 49, 46, 64, 26, 53, 92, 160, 30, 32,
388 36, 50, 78, 36, 40, 36, 36, 40, 32, 119,
389 46, 52, 48, 46, 47, 48, 46, 31, 48, 36,
390 43, 32, 46, 40, 134, 43, 44, 43, 44, 46,
391 45, 48, 142, 143, 51, 46, 132, 36, 36, 142,
392 143, 40, 40, 119, 36, 47, 47, 46, 46, 48,
393 48, 44, 148, 47, 46, 30, 48, 33, 43, 45,
394 51, 1, 43, 29, 160, 5, 6, 7, 8, 9,
395 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
396 20, 21, 43, 23, 24, 25, 26, 27, 47, 49,
397 30, 47, 35, 45, 47, 33, 36, 47, 47, 47,
398 40, 47, 47, 43, 44, 47, 46, 0, 48, 1,
399 47, 51, 1, 5, 6, 7, 8, 9, 10, 11,
400 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
401 52, 23, 24, 25, 26, 27, 148, 73, 30, 86,
402 95, -1, 100, -1, 36, 134, -1, -1, 40, -1,
403 -1, 43, 44, -1, 46, -1, 48, 1, -1, 51,
404 -1, 5, 6, 7, 8, 9, 10, 11, 12, 13,
405 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
406 24, 25, 26, 27, 28, 29, 30, -1, -1, -1,
407 -1, -1, 36, -1, -1, -1, 40, -1, -1, 43,
408 -1, 1, 46, -1, 48, 5, 6, 7, 8, 9,
409 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
410 20, 21, -1, 23, 24, 25, 26, 27, -1, -1,
411 30, -1, -1, -1, -1, 35, -1, -1, -1, -1,
412 40, -1, -1, -1, 1, -1, -1, 47, 5, 6,
413 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
414 17, 18, 19, 20, 21, -1, 23, 24, 25, 26,
415 27, -1, -1, 30, -1, -1, -1, -1, 35, -1,
416 -1, -1, -1, 40, -1, -1, -1, 1, -1, -1,
417 47, 5, 6, 7, 8, 9, 10, 11, 12, 13,
418 14, 15, 16, 17, 18, 19, 20, 21, -1, 23,
419 24, 25, 26, 27, -1, -1, 30, -1, -1, -1,
420 -1, 35, -1, -1, -1, -1, 40, -1, -1, -1,
421 -1, -1, -1, 47, 5, 6, 7, 8, 9, 10,
422 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
423 21, -1, 23, 24, 25, 26, 27, -1, -1, 30,
424 -1, -1, -1, -1, -1, 36, -1, -1, -1, 40,
425 -1, -1, -1, -1, -1, 46, -1, 48, 5, 6,
426 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
427 17, 18, 19, 20, 21, -1, 23, 24, 25, 26,
428 27, -1, -1, 30, -1, -1, -1, -1, -1, -1,
429 -1, -1, -1, 40, -1, -1, -1, -1, -1, -1,
430 47, 5, 6, 7, 8, 9, 10, 11, 12, 13,
431 14, 15, 16, 17, 18, 19, 20, 21, -1, 23,
432 24, 25, 26, 27, -1, -1, 30, -1, -1, -1,
433 -1, 35, -1, -1, -1, -1, 40, 5, 6, 7,
434 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
435 18, 19, 20, 21, -1, 23, 24, 25, 26, 27,
436 -1, -1, 30, -1, -1, -1, -1, -1, -1, -1,
439 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
440 #line 3 "/usr/lib/bison.simple"
441 /* This file comes from bison-1.28. */
443 /* Skeleton output parser for bison,
444 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
446 This program is free software; you can redistribute it and/or modify
447 it under the terms of the GNU General Public License as published by
448 the Free Software Foundation; either version 2, or (at your option)
451 This program is distributed in the hope that it will be useful,
452 but WITHOUT ANY WARRANTY; without even the implied warranty of
453 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
454 GNU General Public License for more details.
456 You should have received a copy of the GNU General Public License
457 along with this program; if not, write to the Free Software
458 Foundation, Inc., 59 Temple Place - Suite 330,
459 Boston, MA 02111-1307, USA. */
461 /* As a special exception, when this file is copied by Bison into a
462 Bison output file, you may use that output file without restriction.
463 This special exception was added by the Free Software Foundation
464 in version 1.24 of Bison. */
466 /* This is the parser code that is written into each bison parser
467 when the %semantic_parser declaration is not specified in the grammar.
468 It was written by Richard Stallman by simplifying the hairy parser
469 used when %semantic_parser is specified. */
471 #ifndef YYSTACK_USE_ALLOCA
473 #define YYSTACK_USE_ALLOCA
474 #else /* alloca not defined */
476 #define YYSTACK_USE_ALLOCA
477 #define alloca __builtin_alloca
478 #else /* not GNU C. */
479 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
480 #define YYSTACK_USE_ALLOCA
482 #else /* not sparc */
483 /* We think this test detects Watcom and Microsoft C. */
484 /* This used to test MSDOS, but that is a bad idea
485 since that symbol is in the user namespace. */
486 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
487 #if 0 /* No need for malloc.h, which pollutes the namespace;
488 instead, just don't use alloca. */
491 #else /* not MSDOS, or __TURBOC__ */
493 /* I don't know what this was needed for, but it pollutes the namespace.
494 So I turned it off. rms, 2 May 1997. */
495 /* #include <malloc.h> */
497 #define YYSTACK_USE_ALLOCA
498 #else /* not MSDOS, or __TURBOC__, or _AIX */
500 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
501 and on HPUX 10. Eventually we can turn this on. */
502 #define YYSTACK_USE_ALLOCA
503 #define alloca __builtin_alloca
506 #endif /* not _AIX */
507 #endif /* not MSDOS, or __TURBOC__ */
508 #endif /* not sparc */
509 #endif /* not GNU C */
510 #endif /* alloca not defined */
511 #endif /* YYSTACK_USE_ALLOCA not defined */
513 #ifdef YYSTACK_USE_ALLOCA
514 #define YYSTACK_ALLOC alloca
516 #define YYSTACK_ALLOC malloc
519 /* Note: there must be only one dollar sign in this file.
520 It is replaced by the list of actions, each action
521 as one case of the switch. */
523 #define yyerrok (yyerrstatus = 0)
524 #define yyclearin (yychar = YYEMPTY)
527 #define YYACCEPT goto yyacceptlab
528 #define YYABORT goto yyabortlab
529 #define YYERROR goto yyerrlab1
530 /* Like YYERROR except do call yyerror.
531 This remains here temporarily to ease the
532 transition to the new meaning of YYERROR, for GCC.
533 Once GCC version 2 has supplanted version 1, this can go. */
534 #define YYFAIL goto yyerrlab
535 #define YYRECOVERING() (!!yyerrstatus)
536 #define YYBACKUP(token, value) \
538 if (yychar == YYEMPTY && yylen == 1) \
539 { yychar = (token), yylval = (value); \
540 yychar1 = YYTRANSLATE (yychar); \
545 { yyerror ("syntax error: cannot back up"); YYERROR; } \
549 #define YYERRCODE 256
552 #define YYLEX yylex()
558 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
560 #define YYLEX yylex(&yylval, &yylloc)
562 #else /* not YYLSP_NEEDED */
564 #define YYLEX yylex(&yylval, YYLEX_PARAM)
566 #define YYLEX yylex(&yylval)
568 #endif /* not YYLSP_NEEDED */
571 /* If nonreentrant, generate the variables here */
575 int yychar; /* the lookahead symbol */
576 YYSTYPE yylval; /* the semantic value of the */
577 /* lookahead symbol */
580 YYLTYPE yylloc; /* location data for the lookahead */
584 int yynerrs; /* number of parse errors so far */
585 #endif /* not YYPURE */
588 int yydebug; /* nonzero means print parse trace */
589 /* Since this is uninitialized, it does not stop multiple parsers
593 /* YYINITDEPTH indicates the initial size of the parser's stacks */
596 #define YYINITDEPTH 200
599 /* YYMAXDEPTH is the maximum size the stacks can grow to
600 (effective only if the built-in stack extension method is used). */
607 #define YYMAXDEPTH 10000
610 /* Define __yy_memcpy. Note that the size argument
611 should be passed with type unsigned int, because that is what the non-GCC
612 definitions require. With GCC, __builtin_memcpy takes an arg
613 of type size_t, but it can handle unsigned int. */
615 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
616 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
617 #else /* not GNU C or C++ */
620 /* This is the most reliable way to avoid incompatibilities
621 in available built-in functions on various systems. */
623 __yy_memcpy (to, from, count)
628 register char *f = from;
629 register char *t = to;
630 register int i = count;
636 #else /* __cplusplus */
638 /* This is the most reliable way to avoid incompatibilities
639 in available built-in functions on various systems. */
641 __yy_memcpy (char *to, char *from, unsigned int count)
643 register char *t = to;
644 register char *f = from;
645 register int i = count;
654 #line 217 "/usr/lib/bison.simple"
656 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
657 into yyparse. The argument should have type void *.
658 It should actually point to an object.
659 Grammar actions can access the variable by casting it
660 to the proper pointer type. */
664 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
665 #define YYPARSE_PARAM_DECL
666 #else /* not __cplusplus */
667 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
668 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
669 #endif /* not __cplusplus */
670 #else /* not YYPARSE_PARAM */
671 #define YYPARSE_PARAM_ARG
672 #define YYPARSE_PARAM_DECL
673 #endif /* not YYPARSE_PARAM */
675 /* Prevent warning if -Wstrict-prototypes. */
678 int yyparse (void *);
685 yyparse(YYPARSE_PARAM_ARG)
688 register int yystate;
690 register short *yyssp;
691 register YYSTYPE *yyvsp;
692 int yyerrstatus; /* number of tokens to shift before error messages enabled */
693 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
695 short yyssa[YYINITDEPTH]; /* the state stack */
696 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
698 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
699 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
702 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
703 YYLTYPE *yyls = yylsa;
706 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
708 #define YYPOPSTACK (yyvsp--, yyssp--)
711 int yystacksize = YYINITDEPTH;
712 int yyfree_stacks = 0;
723 YYSTYPE yyval; /* the variable used to return */
724 /* semantic values from the action */
731 fprintf(stderr, "Starting parse\n");
737 yychar = YYEMPTY; /* Cause a token to be read. */
739 /* Initialize stack pointers.
740 Waste one element of value and location stack
741 so that they stay on the same level as the state stack.
742 The wasted elements are never initialized. */
750 /* Push a new state, which is found in yystate . */
751 /* In all cases, when you get here, the value and location stacks
752 have just been pushed. so pushing a state here evens the stacks. */
757 if (yyssp >= yyss + yystacksize - 1)
759 /* Give user a chance to reallocate the stack */
760 /* Use copies of these so that the &'s don't force the real ones into memory. */
761 YYSTYPE *yyvs1 = yyvs;
764 YYLTYPE *yyls1 = yyls;
767 /* Get the current used size of the three stacks, in elements. */
768 int size = yyssp - yyss + 1;
771 /* Each stack pointer address is followed by the size of
772 the data in use in that stack, in bytes. */
774 /* This used to be a conditional around just the two extra args,
775 but that might be undefined if yyoverflow is a macro. */
776 yyoverflow("parser stack overflow",
777 &yyss1, size * sizeof (*yyssp),
778 &yyvs1, size * sizeof (*yyvsp),
779 &yyls1, size * sizeof (*yylsp),
782 yyoverflow("parser stack overflow",
783 &yyss1, size * sizeof (*yyssp),
784 &yyvs1, size * sizeof (*yyvsp),
788 yyss = yyss1; yyvs = yyvs1;
792 #else /* no yyoverflow */
793 /* Extend the stack our own way. */
794 if (yystacksize >= YYMAXDEPTH)
796 yyerror("parser stack overflow");
808 if (yystacksize > YYMAXDEPTH)
809 yystacksize = YYMAXDEPTH;
810 #ifndef YYSTACK_USE_ALLOCA
813 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
814 __yy_memcpy ((char *)yyss, (char *)yyss1,
815 size * (unsigned int) sizeof (*yyssp));
816 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
817 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
818 size * (unsigned int) sizeof (*yyvsp));
820 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
821 __yy_memcpy ((char *)yyls, (char *)yyls1,
822 size * (unsigned int) sizeof (*yylsp));
824 #endif /* no yyoverflow */
826 yyssp = yyss + size - 1;
827 yyvsp = yyvs + size - 1;
829 yylsp = yyls + size - 1;
834 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
837 if (yyssp >= yyss + yystacksize - 1)
843 fprintf(stderr, "Entering state %d\n", yystate);
849 /* Do appropriate processing given the current state. */
850 /* Read a lookahead token if we need one and don't already have one. */
853 /* First try to decide what to do without reference to lookahead token. */
855 yyn = yypact[yystate];
859 /* Not known => get a lookahead token if don't already have one. */
861 /* yychar is either YYEMPTY or YYEOF
862 or a valid token in external form. */
864 if (yychar == YYEMPTY)
868 fprintf(stderr, "Reading a token: ");
873 /* Convert token to internal form (in yychar1) for indexing tables with */
875 if (yychar <= 0) /* This means end of input. */
878 yychar = YYEOF; /* Don't call YYLEX any more */
882 fprintf(stderr, "Now at end of input.\n");
887 yychar1 = YYTRANSLATE(yychar);
892 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
893 /* Give the individual parser a way to print the precise meaning
894 of a token, for further debugging info. */
896 YYPRINT (stderr, yychar, yylval);
898 fprintf (stderr, ")\n");
904 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
909 /* yyn is what to do for this token type in this state.
910 Negative => reduce, -yyn is rule number.
911 Positive => shift, yyn is new state.
912 New state is final state => don't bother to shift,
914 0, or most negative number => error. */
929 /* Shift the lookahead token. */
933 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
936 /* Discard the token being shifted unless it is eof. */
945 /* count tokens shifted since error; after three, turn off error status. */
946 if (yyerrstatus) yyerrstatus--;
951 /* Do the default action for the current state. */
954 yyn = yydefact[yystate];
958 /* Do a reduction. yyn is the number of a rule to reduce with. */
962 yyval = yyvsp[1-yylen]; /* implement default value of the action */
969 fprintf (stderr, "Reducing via rule %d (line %d), ",
972 /* Print the symbols being reduced, and their result. */
973 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
974 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
975 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
983 #line 107 "scripts/genksyms/parse.y"
984 { is_typedef = 0; is_extern = 0; current_name = NULL; decl_spec = NULL; ;
987 #line 109 "scripts/genksyms/parse.y"
988 { free_list(*yyvsp[0], NULL); *yyvsp[0] = NULL; ;
991 #line 113 "scripts/genksyms/parse.y"
995 #line 114 "scripts/genksyms/parse.y"
996 { yyval = yyvsp[0]; ;
999 #line 119 "scripts/genksyms/parse.y"
1000 { yyval = yyvsp[0]; ;
1003 #line 120 "scripts/genksyms/parse.y"
1004 { yyval = yyvsp[0]; ;
1007 #line 125 "scripts/genksyms/parse.y"
1008 { if (current_name) {
1009 struct string_list *decl = (*yyvsp[0])->next;
1010 (*yyvsp[0])->next = NULL;
1011 add_symbol(current_name,
1012 is_typedef ? SYM_TYPEDEF : SYM_NORMAL,
1014 current_name = NULL;
1020 #line 138 "scripts/genksyms/parse.y"
1024 #line 144 "scripts/genksyms/parse.y"
1025 { struct string_list *decl = *yyvsp[0];
1027 add_symbol(current_name,
1028 is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern);
1029 current_name = NULL;
1034 #line 152 "scripts/genksyms/parse.y"
1035 { struct string_list *decl = *yyvsp[0];
1037 free_list(*yyvsp[-1], NULL);
1038 *yyvsp[-1] = decl_spec;
1039 add_symbol(current_name,
1040 is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern);
1041 current_name = NULL;
1046 #line 165 "scripts/genksyms/parse.y"
1047 { yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1] ? yyvsp[-1] : yyvsp[-2] ? yyvsp[-2] : yyvsp[-3]; ;
1050 #line 170 "scripts/genksyms/parse.y"
1051 { decl_spec = NULL; ;
1054 #line 175 "scripts/genksyms/parse.y"
1055 { decl_spec = *yyvsp[0]; ;
1058 #line 176 "scripts/genksyms/parse.y"
1059 { decl_spec = *yyvsp[0]; ;
1062 #line 181 "scripts/genksyms/parse.y"
1063 { /* Version 2 checksumming ignores storage class, as that
1064 is really irrelevant to the linkage. */
1065 remove_node(yyvsp[0]);
1070 #line 193 "scripts/genksyms/parse.y"
1071 { is_extern = 1; yyval = yyvsp[0]; ;
1074 #line 194 "scripts/genksyms/parse.y"
1075 { is_extern = 0; yyval = yyvsp[0]; ;
1078 #line 205 "scripts/genksyms/parse.y"
1079 { remove_node(yyvsp[-1]); (*yyvsp[0])->tag = SYM_STRUCT; yyval = yyvsp[0]; ;
1082 #line 207 "scripts/genksyms/parse.y"
1083 { remove_node(yyvsp[-1]); (*yyvsp[0])->tag = SYM_UNION; yyval = yyvsp[0]; ;
1086 #line 209 "scripts/genksyms/parse.y"
1087 { remove_node(yyvsp[-1]); (*yyvsp[0])->tag = SYM_ENUM; yyval = yyvsp[0]; ;
1090 #line 213 "scripts/genksyms/parse.y"
1091 { struct string_list *s = *yyvsp[0], *i = *yyvsp[-1], *r;
1092 r = copy_node(i); r->tag = SYM_STRUCT;
1093 r->next = (*yyvsp[-2])->next; *yyvsp[0] = r; (*yyvsp[-2])->next = NULL;
1094 add_symbol(i->string, SYM_STRUCT, s, is_extern);
1099 #line 220 "scripts/genksyms/parse.y"
1100 { struct string_list *s = *yyvsp[0], *i = *yyvsp[-1], *r;
1101 r = copy_node(i); r->tag = SYM_UNION;
1102 r->next = (*yyvsp[-2])->next; *yyvsp[0] = r; (*yyvsp[-2])->next = NULL;
1103 add_symbol(i->string, SYM_UNION, s, is_extern);
1108 #line 227 "scripts/genksyms/parse.y"
1109 { struct string_list *s = *yyvsp[0], *i = *yyvsp[-1], *r;
1110 r = copy_node(i); r->tag = SYM_ENUM;
1111 r->next = (*yyvsp[-2])->next; *yyvsp[0] = r; (*yyvsp[-2])->next = NULL;
1112 add_symbol(i->string, SYM_ENUM, s, is_extern);
1117 #line 235 "scripts/genksyms/parse.y"
1118 { yyval = yyvsp[0]; ;
1121 #line 236 "scripts/genksyms/parse.y"
1122 { yyval = yyvsp[0]; ;
1125 #line 237 "scripts/genksyms/parse.y"
1126 { yyval = yyvsp[0]; ;
1129 #line 251 "scripts/genksyms/parse.y"
1130 { (*yyvsp[0])->tag = SYM_TYPEDEF; yyval = yyvsp[0]; ;
1133 #line 256 "scripts/genksyms/parse.y"
1134 { yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ;
1137 #line 260 "scripts/genksyms/parse.y"
1141 #line 266 "scripts/genksyms/parse.y"
1142 { yyval = yyvsp[0]; ;
1145 #line 272 "scripts/genksyms/parse.y"
1146 { /* restrict has no effect in prototypes so ignore it */
1147 remove_node(yyvsp[0]);
1152 #line 279 "scripts/genksyms/parse.y"
1153 { yyval = yyvsp[0]; ;
1156 #line 285 "scripts/genksyms/parse.y"
1157 { if (current_name != NULL) {
1158 error_with_pos("unexpected second declaration name");
1161 current_name = (*yyvsp[0])->string;
1167 #line 294 "scripts/genksyms/parse.y"
1168 { yyval = yyvsp[0]; ;
1171 #line 296 "scripts/genksyms/parse.y"
1172 { yyval = yyvsp[0]; ;
1175 #line 298 "scripts/genksyms/parse.y"
1176 { yyval = yyvsp[0]; ;
1179 #line 300 "scripts/genksyms/parse.y"
1180 { yyval = yyvsp[0]; ;
1183 #line 302 "scripts/genksyms/parse.y"
1184 { yyval = yyvsp[0]; ;
1187 #line 308 "scripts/genksyms/parse.y"
1188 { yyval = yyvsp[0]; ;
1191 #line 316 "scripts/genksyms/parse.y"
1192 { yyval = yyvsp[0]; ;
1195 #line 318 "scripts/genksyms/parse.y"
1196 { yyval = yyvsp[0]; ;
1199 #line 320 "scripts/genksyms/parse.y"
1200 { yyval = yyvsp[0]; ;
1203 #line 322 "scripts/genksyms/parse.y"
1204 { yyval = yyvsp[0]; ;
1207 #line 324 "scripts/genksyms/parse.y"
1208 { yyval = yyvsp[0]; ;
1211 #line 328 "scripts/genksyms/parse.y"
1212 { yyval = yyvsp[0]; ;
1215 #line 330 "scripts/genksyms/parse.y"
1216 { yyval = yyvsp[0]; ;
1219 #line 334 "scripts/genksyms/parse.y"
1223 #line 341 "scripts/genksyms/parse.y"
1224 { yyval = yyvsp[0]; ;
1227 #line 346 "scripts/genksyms/parse.y"
1228 { yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ;
1231 #line 351 "scripts/genksyms/parse.y"
1232 { yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ;
1235 #line 356 "scripts/genksyms/parse.y"
1239 #line 358 "scripts/genksyms/parse.y"
1240 { /* For version 2 checksums, we don't want to remember
1241 private parameter names. */
1242 remove_node(yyvsp[0]);
1247 #line 366 "scripts/genksyms/parse.y"
1248 { remove_node(yyvsp[0]);
1253 #line 370 "scripts/genksyms/parse.y"
1254 { yyval = yyvsp[0]; ;
1257 #line 372 "scripts/genksyms/parse.y"
1258 { yyval = yyvsp[0]; ;
1261 #line 374 "scripts/genksyms/parse.y"
1262 { yyval = yyvsp[0]; ;
1265 #line 376 "scripts/genksyms/parse.y"
1266 { yyval = yyvsp[0]; ;
1269 #line 378 "scripts/genksyms/parse.y"
1270 { yyval = yyvsp[0]; ;
1273 #line 383 "scripts/genksyms/parse.y"
1274 { struct string_list *decl = *yyvsp[-1];
1276 add_symbol(current_name, SYM_NORMAL, decl, is_extern);
1281 #line 391 "scripts/genksyms/parse.y"
1285 #line 398 "scripts/genksyms/parse.y"
1286 { remove_list(yyvsp[0], &(*yyvsp[-1])->next); yyval = yyvsp[0]; ;
1289 #line 402 "scripts/genksyms/parse.y"
1290 { yyval = yyvsp[0]; ;
1293 #line 403 "scripts/genksyms/parse.y"
1294 { yyval = yyvsp[0]; ;
1297 #line 407 "scripts/genksyms/parse.y"
1301 #line 413 "scripts/genksyms/parse.y"
1302 { yyval = yyvsp[0]; ;
1305 #line 418 "scripts/genksyms/parse.y"
1306 { yyval = yyvsp[0]; ;
1309 #line 420 "scripts/genksyms/parse.y"
1310 { yyval = yyvsp[0]; ;
1313 #line 424 "scripts/genksyms/parse.y"
1317 #line 430 "scripts/genksyms/parse.y"
1318 { yyval = yyvsp[0]; ;
1321 #line 434 "scripts/genksyms/parse.y"
1322 { yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ;
1325 #line 435 "scripts/genksyms/parse.y"
1326 { yyval = yyvsp[0]; ;
1329 #line 440 "scripts/genksyms/parse.y"
1330 { yyval = yyvsp[0]; ;
1333 #line 444 "scripts/genksyms/parse.y"
1337 #line 449 "scripts/genksyms/parse.y"
1338 { yyval = yyvsp[0]; ;
1341 #line 453 "scripts/genksyms/parse.y"
1345 #line 459 "scripts/genksyms/parse.y"
1346 { export_symbol((*yyvsp[-2])->string); yyval = yyvsp[0]; ;
1349 /* the action file gets copied in in place of this dollarsign */
1350 #line 543 "/usr/lib/bison.simple"
1361 short *ssp1 = yyss - 1;
1362 fprintf (stderr, "state stack now");
1363 while (ssp1 != yyssp)
1364 fprintf (stderr, " %d", *++ssp1);
1365 fprintf (stderr, "\n");
1375 yylsp->first_line = yylloc.first_line;
1376 yylsp->first_column = yylloc.first_column;
1377 yylsp->last_line = (yylsp-1)->last_line;
1378 yylsp->last_column = (yylsp-1)->last_column;
1383 yylsp->last_line = (yylsp+yylen-1)->last_line;
1384 yylsp->last_column = (yylsp+yylen-1)->last_column;
1388 /* Now "shift" the result of the reduction.
1389 Determine what state that goes to,
1390 based on the state we popped back to
1391 and the rule number reduced by. */
1395 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1396 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1397 yystate = yytable[yystate];
1399 yystate = yydefgoto[yyn - YYNTBASE];
1403 yyerrlab: /* here on detecting error */
1406 /* If not already recovering from an error, report this error. */
1410 #ifdef YYERROR_VERBOSE
1411 yyn = yypact[yystate];
1413 if (yyn > YYFLAG && yyn < YYLAST)
1420 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
1421 for (x = (yyn < 0 ? -yyn : 0);
1422 x < (sizeof(yytname) / sizeof(char *)); x++)
1423 if (yycheck[x + yyn] == x)
1424 size += strlen(yytname[x]) + 15, count++;
1425 msg = (char *) malloc(size + 15);
1428 strcpy(msg, "parse error");
1433 for (x = (yyn < 0 ? -yyn : 0);
1434 x < (sizeof(yytname) / sizeof(char *)); x++)
1435 if (yycheck[x + yyn] == x)
1437 strcat(msg, count == 0 ? ", expecting `" : " or `");
1438 strcat(msg, yytname[x]);
1447 yyerror ("parse error; also virtual memory exceeded");
1450 #endif /* YYERROR_VERBOSE */
1451 yyerror("parse error");
1455 yyerrlab1: /* here on error raised explicitly by an action */
1457 if (yyerrstatus == 3)
1459 /* if just tried and failed to reuse lookahead token after an error, discard it. */
1461 /* return failure if at end of input */
1462 if (yychar == YYEOF)
1467 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
1473 /* Else will try to reuse lookahead token
1474 after shifting the error token. */
1476 yyerrstatus = 3; /* Each real token shifted decrements this */
1480 yyerrdefault: /* current state does not do anything special for the error token. */
1483 /* This is wrong; only states that explicitly want error tokens
1484 should shift them. */
1485 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
1486 if (yyn) goto yydefault;
1489 yyerrpop: /* pop the current state because it cannot handle the error token */
1491 if (yyssp == yyss) YYABORT;
1501 short *ssp1 = yyss - 1;
1502 fprintf (stderr, "Error: state stack now");
1503 while (ssp1 != yyssp)
1504 fprintf (stderr, " %d", *++ssp1);
1505 fprintf (stderr, "\n");
1511 yyn = yypact[yystate];
1516 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1535 fprintf(stderr, "Shifting error token, ");
1547 /* YYACCEPT comes here. */
1559 /* YYABORT comes here. */
1570 #line 463 "scripts/genksyms/parse.y"
1574 yyerror(const char *e)
1576 error_with_pos("%s", e);