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, 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,
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 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,
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,
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,
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,
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. */
435 /* Skeleton output parser for bison,
436 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
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)
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.
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. */
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. */
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. */
463 #ifndef YYSTACK_USE_ALLOCA
465 #define YYSTACK_USE_ALLOCA
466 #else /* alloca not defined */
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
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. */
483 #else /* not MSDOS, or __TURBOC__ */
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> */
489 #define YYSTACK_USE_ALLOCA
490 #else /* not MSDOS, or __TURBOC__, or _AIX */
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
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 */
505 #ifdef YYSTACK_USE_ALLOCA
506 #define YYSTACK_ALLOC alloca
508 #define YYSTACK_ALLOC malloc
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. */
515 #define yyerrok (yyerrstatus = 0)
516 #define yyclearin (yychar = YYEMPTY)
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) \
530 if (yychar == YYEMPTY && yylen == 1) \
531 { yychar = (token), yylval = (value); \
532 yychar1 = YYTRANSLATE (yychar); \
537 { yyerror ("syntax error: cannot back up"); YYERROR; } \
541 #define YYERRCODE 256
544 #define YYLEX yylex()
550 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
552 #define YYLEX yylex(&yylval, &yylloc)
554 #else /* not YYLSP_NEEDED */
556 #define YYLEX yylex(&yylval, YYLEX_PARAM)
558 #define YYLEX yylex(&yylval)
560 #endif /* not YYLSP_NEEDED */
563 /* If nonreentrant, generate the variables here */
567 int yychar; /* the lookahead symbol */
568 YYSTYPE yylval; /* the semantic value of the */
569 /* lookahead symbol */
572 YYLTYPE yylloc; /* location data for the lookahead */
576 int yynerrs; /* number of parse errors so far */
577 #endif /* not YYPURE */
580 int yydebug; /* nonzero means print parse trace */
581 /* Since this is uninitialized, it does not stop multiple parsers
585 /* YYINITDEPTH indicates the initial size of the parser's stacks */
588 #define YYINITDEPTH 200
591 /* YYMAXDEPTH is the maximum size the stacks can grow to
592 (effective only if the built-in stack extension method is used). */
599 #define YYMAXDEPTH 10000
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. */
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++ */
612 /* This is the most reliable way to avoid incompatibilities
613 in available built-in functions on various systems. */
615 __yy_memcpy (to, from, count)
620 register char *f = from;
621 register char *t = to;
622 register int i = count;
628 #else /* __cplusplus */
630 /* This is the most reliable way to avoid incompatibilities
631 in available built-in functions on various systems. */
633 __yy_memcpy (char *to, char *from, unsigned int count)
635 register char *t = to;
636 register char *f = from;
637 register int i = count;
646 #line 217 "/usr/lib/bison.simple"
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. */
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 */
667 /* Prevent warning if -Wstrict-prototypes. */
670 int yyparse (void *);
677 yyparse(YYPARSE_PARAM_ARG)
680 register int yystate;
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 */
687 short yyssa[YYINITDEPTH]; /* the state stack */
688 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
690 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
691 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
694 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
695 YYLTYPE *yyls = yylsa;
698 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
700 #define YYPOPSTACK (yyvsp--, yyssp--)
703 int yystacksize = YYINITDEPTH;
704 int yyfree_stacks = 0;
715 YYSTYPE yyval; /* the variable used to return */
716 /* semantic values from the action */
723 fprintf(stderr, "Starting parse\n");
729 yychar = YYEMPTY; /* Cause a token to be read. */
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. */
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. */
749 if (yyssp >= yyss + yystacksize - 1)
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;
756 YYLTYPE *yyls1 = yyls;
759 /* Get the current used size of the three stacks, in elements. */
760 int size = yyssp - yyss + 1;
763 /* Each stack pointer address is followed by the size of
764 the data in use in that stack, in bytes. */
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),
774 yyoverflow("parser stack overflow",
775 &yyss1, size * sizeof (*yyssp),
776 &yyvs1, size * sizeof (*yyvsp),
780 yyss = yyss1; yyvs = yyvs1;
784 #else /* no yyoverflow */
785 /* Extend the stack our own way. */
786 if (yystacksize >= YYMAXDEPTH)
788 yyerror("parser stack overflow");
800 if (yystacksize > YYMAXDEPTH)
801 yystacksize = YYMAXDEPTH;
802 #ifndef YYSTACK_USE_ALLOCA
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));
812 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
813 __yy_memcpy ((char *)yyls, (char *)yyls1,
814 size * (unsigned int) sizeof (*yylsp));
816 #endif /* no yyoverflow */
818 yyssp = yyss + size - 1;
819 yyvsp = yyvs + size - 1;
821 yylsp = yyls + size - 1;
826 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
829 if (yyssp >= yyss + yystacksize - 1)
835 fprintf(stderr, "Entering state %d\n", yystate);
841 /* Do appropriate processing given the current state. */
842 /* Read a lookahead token if we need one and don't already have one. */
845 /* First try to decide what to do without reference to lookahead token. */
847 yyn = yypact[yystate];
851 /* Not known => get a lookahead token if don't already have one. */
853 /* yychar is either YYEMPTY or YYEOF
854 or a valid token in external form. */
856 if (yychar == YYEMPTY)
860 fprintf(stderr, "Reading a token: ");
865 /* Convert token to internal form (in yychar1) for indexing tables with */
867 if (yychar <= 0) /* This means end of input. */
870 yychar = YYEOF; /* Don't call YYLEX any more */
874 fprintf(stderr, "Now at end of input.\n");
879 yychar1 = YYTRANSLATE(yychar);
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. */
888 YYPRINT (stderr, yychar, yylval);
890 fprintf (stderr, ")\n");
896 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
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,
906 0, or most negative number => error. */
921 /* Shift the lookahead token. */
925 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
928 /* Discard the token being shifted unless it is eof. */
937 /* count tokens shifted since error; after three, turn off error status. */
938 if (yyerrstatus) yyerrstatus--;
943 /* Do the default action for the current state. */
946 yyn = yydefact[yystate];
950 /* Do a reduction. yyn is the number of a rule to reduce with. */
954 yyval = yyvsp[1-yylen]; /* implement default value of the action */
961 fprintf (stderr, "Reducing via rule %d (line %d), ",
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]]);
975 #line 107 "scripts/genksyms/parse.y"
976 { is_typedef = 0; is_extern = 0; current_name = NULL; decl_spec = NULL; ;
979 #line 109 "scripts/genksyms/parse.y"
980 { free_list(*yyvsp[0], NULL); *yyvsp[0] = NULL; ;
983 #line 113 "scripts/genksyms/parse.y"
987 #line 114 "scripts/genksyms/parse.y"
988 { yyval = yyvsp[0]; ;
991 #line 119 "scripts/genksyms/parse.y"
992 { yyval = yyvsp[0]; ;
995 #line 120 "scripts/genksyms/parse.y"
996 { yyval = yyvsp[0]; ;
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,
1006 current_name = NULL;
1012 #line 138 "scripts/genksyms/parse.y"
1016 #line 144 "scripts/genksyms/parse.y"
1017 { struct string_list *decl = *yyvsp[0];
1019 add_symbol(current_name,
1020 is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern);
1021 current_name = NULL;
1026 #line 152 "scripts/genksyms/parse.y"
1027 { struct string_list *decl = *yyvsp[0];
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;
1038 #line 165 "scripts/genksyms/parse.y"
1039 { yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1] ? yyvsp[-1] : yyvsp[-2] ? yyvsp[-2] : yyvsp[-3]; ;
1042 #line 170 "scripts/genksyms/parse.y"
1043 { decl_spec = NULL; ;
1046 #line 175 "scripts/genksyms/parse.y"
1047 { decl_spec = *yyvsp[0]; ;
1050 #line 176 "scripts/genksyms/parse.y"
1051 { decl_spec = *yyvsp[0]; ;
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]);
1062 #line 193 "scripts/genksyms/parse.y"
1063 { is_extern = 1; yyval = yyvsp[0]; ;
1066 #line 194 "scripts/genksyms/parse.y"
1067 { is_extern = 0; yyval = yyvsp[0]; ;
1070 #line 205 "scripts/genksyms/parse.y"
1071 { remove_node(yyvsp[-1]); (*yyvsp[0])->tag = SYM_STRUCT; yyval = yyvsp[0]; ;
1074 #line 207 "scripts/genksyms/parse.y"
1075 { remove_node(yyvsp[-1]); (*yyvsp[0])->tag = SYM_UNION; yyval = yyvsp[0]; ;
1078 #line 209 "scripts/genksyms/parse.y"
1079 { remove_node(yyvsp[-1]); (*yyvsp[0])->tag = SYM_ENUM; yyval = yyvsp[0]; ;
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);
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);
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);
1109 #line 235 "scripts/genksyms/parse.y"
1110 { yyval = yyvsp[0]; ;
1113 #line 236 "scripts/genksyms/parse.y"
1114 { yyval = yyvsp[0]; ;
1117 #line 237 "scripts/genksyms/parse.y"
1118 { yyval = yyvsp[0]; ;
1121 #line 251 "scripts/genksyms/parse.y"
1122 { (*yyvsp[0])->tag = SYM_TYPEDEF; yyval = yyvsp[0]; ;
1125 #line 256 "scripts/genksyms/parse.y"
1126 { yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ;
1129 #line 260 "scripts/genksyms/parse.y"
1133 #line 266 "scripts/genksyms/parse.y"
1134 { yyval = yyvsp[0]; ;
1137 #line 272 "scripts/genksyms/parse.y"
1138 { /* restrict has no effect in prototypes so ignore it */
1139 remove_node(yyvsp[0]);
1144 #line 279 "scripts/genksyms/parse.y"
1145 { yyval = yyvsp[0]; ;
1148 #line 285 "scripts/genksyms/parse.y"
1149 { if (current_name != NULL) {
1150 error_with_pos("unexpected second declaration name");
1153 current_name = (*yyvsp[0])->string;
1159 #line 294 "scripts/genksyms/parse.y"
1160 { yyval = yyvsp[0]; ;
1163 #line 296 "scripts/genksyms/parse.y"
1164 { yyval = yyvsp[0]; ;
1167 #line 298 "scripts/genksyms/parse.y"
1168 { yyval = yyvsp[0]; ;
1171 #line 300 "scripts/genksyms/parse.y"
1172 { yyval = yyvsp[0]; ;
1175 #line 302 "scripts/genksyms/parse.y"
1176 { yyval = yyvsp[0]; ;
1179 #line 308 "scripts/genksyms/parse.y"
1180 { yyval = yyvsp[0]; ;
1183 #line 316 "scripts/genksyms/parse.y"
1184 { yyval = yyvsp[0]; ;
1187 #line 318 "scripts/genksyms/parse.y"
1188 { yyval = yyvsp[0]; ;
1191 #line 320 "scripts/genksyms/parse.y"
1192 { yyval = yyvsp[0]; ;
1195 #line 322 "scripts/genksyms/parse.y"
1196 { yyval = yyvsp[0]; ;
1199 #line 324 "scripts/genksyms/parse.y"
1200 { yyval = yyvsp[0]; ;
1203 #line 328 "scripts/genksyms/parse.y"
1204 { yyval = yyvsp[0]; ;
1207 #line 330 "scripts/genksyms/parse.y"
1208 { yyval = yyvsp[0]; ;
1211 #line 334 "scripts/genksyms/parse.y"
1215 #line 341 "scripts/genksyms/parse.y"
1216 { yyval = yyvsp[0]; ;
1219 #line 346 "scripts/genksyms/parse.y"
1220 { yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ;
1223 #line 351 "scripts/genksyms/parse.y"
1224 { yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ;
1227 #line 356 "scripts/genksyms/parse.y"
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]);
1239 #line 366 "scripts/genksyms/parse.y"
1240 { remove_node(yyvsp[0]);
1245 #line 370 "scripts/genksyms/parse.y"
1246 { yyval = yyvsp[0]; ;
1249 #line 372 "scripts/genksyms/parse.y"
1250 { yyval = yyvsp[0]; ;
1253 #line 374 "scripts/genksyms/parse.y"
1254 { yyval = yyvsp[0]; ;
1257 #line 376 "scripts/genksyms/parse.y"
1258 { yyval = yyvsp[0]; ;
1261 #line 378 "scripts/genksyms/parse.y"
1262 { yyval = yyvsp[0]; ;
1265 #line 383 "scripts/genksyms/parse.y"
1266 { struct string_list *decl = *yyvsp[-1];
1268 add_symbol(current_name, SYM_NORMAL, decl, is_extern);
1273 #line 391 "scripts/genksyms/parse.y"
1277 #line 398 "scripts/genksyms/parse.y"
1278 { remove_list(yyvsp[0], &(*yyvsp[-1])->next); yyval = yyvsp[0]; ;
1281 #line 402 "scripts/genksyms/parse.y"
1282 { yyval = yyvsp[0]; ;
1285 #line 403 "scripts/genksyms/parse.y"
1286 { yyval = yyvsp[0]; ;
1289 #line 407 "scripts/genksyms/parse.y"
1293 #line 413 "scripts/genksyms/parse.y"
1294 { yyval = yyvsp[0]; ;
1297 #line 418 "scripts/genksyms/parse.y"
1298 { yyval = yyvsp[0]; ;
1301 #line 420 "scripts/genksyms/parse.y"
1302 { yyval = yyvsp[0]; ;
1305 #line 424 "scripts/genksyms/parse.y"
1309 #line 430 "scripts/genksyms/parse.y"
1310 { yyval = yyvsp[0]; ;
1313 #line 434 "scripts/genksyms/parse.y"
1314 { yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ;
1317 #line 435 "scripts/genksyms/parse.y"
1318 { yyval = yyvsp[0]; ;
1321 #line 440 "scripts/genksyms/parse.y"
1322 { yyval = yyvsp[0]; ;
1325 #line 444 "scripts/genksyms/parse.y"
1329 #line 449 "scripts/genksyms/parse.y"
1330 { yyval = yyvsp[0]; ;
1333 #line 453 "scripts/genksyms/parse.y"
1337 #line 459 "scripts/genksyms/parse.y"
1338 { export_symbol((*yyvsp[-2])->string); yyval = yyvsp[0]; ;
1341 /* the action file gets copied in in place of this dollarsign */
1342 #line 543 "/usr/lib/bison.simple"
1353 short *ssp1 = yyss - 1;
1354 fprintf (stderr, "state stack now");
1355 while (ssp1 != yyssp)
1356 fprintf (stderr, " %d", *++ssp1);
1357 fprintf (stderr, "\n");
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;
1375 yylsp->last_line = (yylsp+yylen-1)->last_line;
1376 yylsp->last_column = (yylsp+yylen-1)->last_column;
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. */
1387 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1388 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1389 yystate = yytable[yystate];
1391 yystate = yydefgoto[yyn - YYNTBASE];
1395 yyerrlab: /* here on detecting error */
1398 /* If not already recovering from an error, report this error. */
1402 #ifdef YYERROR_VERBOSE
1403 yyn = yypact[yystate];
1405 if (yyn > YYFLAG && yyn < YYLAST)
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);
1420 strcpy(msg, "parse error");
1425 for (x = (yyn < 0 ? -yyn : 0);
1426 x < (sizeof(yytname) / sizeof(char *)); x++)
1427 if (yycheck[x + yyn] == x)
1429 strcat(msg, count == 0 ? ", expecting `" : " or `");
1430 strcat(msg, yytname[x]);
1439 yyerror ("parse error; also virtual memory exceeded");
1442 #endif /* YYERROR_VERBOSE */
1443 yyerror("parse error");
1447 yyerrlab1: /* here on error raised explicitly by an action */
1449 if (yyerrstatus == 3)
1451 /* if just tried and failed to reuse lookahead token after an error, discard it. */
1453 /* return failure if at end of input */
1454 if (yychar == YYEOF)
1459 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
1465 /* Else will try to reuse lookahead token
1466 after shifting the error token. */
1468 yyerrstatus = 3; /* Each real token shifted decrements this */
1472 yyerrdefault: /* current state does not do anything special for the error token. */
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;
1481 yyerrpop: /* pop the current state because it cannot handle the error token */
1483 if (yyssp == yyss) YYABORT;
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");
1503 yyn = yypact[yystate];
1508 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1527 fprintf(stderr, "Shifting error token, ");
1539 /* YYACCEPT comes here. */
1551 /* YYABORT comes here. */
1562 #line 463 "scripts/genksyms/parse.y"
1566 yyerror(const char *e)
1568 error_with_pos("%s", e);