at v2.6.12-rc3 1577 lines 51 kB view raw
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 55static int is_typedef; 56static int is_extern; 57static char *current_name; 58static struct string_list *decl_spec; 59 60static void yyerror(const char *); 61 62static inline void 63remove_node(struct string_list **p) 64{ 65 struct string_list *node = *p; 66 *p = node->next; 67 free_node(node); 68} 69 70static inline void 71remove_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 101static 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 135static 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 151static 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, 184 46, 36, 47, 43, 0 185}; 186 187#endif 188 189#if YYDEBUG != 0 190static 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 210static 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 232static 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 248static 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 264static 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 285static 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 293static 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, 311 148,-32768 312}; 313 314static 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, 319-32768,-32768,-32768 320}; 321 322 323#define YYLAST 533 324 325 326static 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, 380 0, 0, 32 381}; 382 383static 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, 437 -1, -1, 40 438}; 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. */ 442 443/* Skeleton output parser for bison, 444 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. 445 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) 449 any later version. 450 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. 455 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. */ 460 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. */ 465 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. */ 470 471#ifndef YYSTACK_USE_ALLOCA 472#ifdef alloca 473#define YYSTACK_USE_ALLOCA 474#else /* alloca not defined */ 475#ifdef __GNUC__ 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 481#include <alloca.h> 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. */ 489#include <malloc.h> 490#endif 491#else /* not MSDOS, or __TURBOC__ */ 492#if defined(_AIX) 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> */ 496 #pragma alloca 497#define YYSTACK_USE_ALLOCA 498#else /* not MSDOS, or __TURBOC__, or _AIX */ 499#if 0 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 504#endif /* __hpux */ 505#endif 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 */ 512 513#ifdef YYSTACK_USE_ALLOCA 514#define YYSTACK_ALLOC alloca 515#else 516#define YYSTACK_ALLOC malloc 517#endif 518 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. */ 522 523#define yyerrok (yyerrstatus = 0) 524#define yyclearin (yychar = YYEMPTY) 525#define YYEMPTY -2 526#define YYEOF 0 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) \ 537do \ 538 if (yychar == YYEMPTY && yylen == 1) \ 539 { yychar = (token), yylval = (value); \ 540 yychar1 = YYTRANSLATE (yychar); \ 541 YYPOPSTACK; \ 542 goto yybackup; \ 543 } \ 544 else \ 545 { yyerror ("syntax error: cannot back up"); YYERROR; } \ 546while (0) 547 548#define YYTERROR 1 549#define YYERRCODE 256 550 551#ifndef YYPURE 552#define YYLEX yylex() 553#endif 554 555#ifdef YYPURE 556#ifdef YYLSP_NEEDED 557#ifdef YYLEX_PARAM 558#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) 559#else 560#define YYLEX yylex(&yylval, &yylloc) 561#endif 562#else /* not YYLSP_NEEDED */ 563#ifdef YYLEX_PARAM 564#define YYLEX yylex(&yylval, YYLEX_PARAM) 565#else 566#define YYLEX yylex(&yylval) 567#endif 568#endif /* not YYLSP_NEEDED */ 569#endif 570 571/* If nonreentrant, generate the variables here */ 572 573#ifndef YYPURE 574 575int yychar; /* the lookahead symbol */ 576YYSTYPE yylval; /* the semantic value of the */ 577 /* lookahead symbol */ 578 579#ifdef YYLSP_NEEDED 580YYLTYPE yylloc; /* location data for the lookahead */ 581 /* symbol */ 582#endif 583 584int yynerrs; /* number of parse errors so far */ 585#endif /* not YYPURE */ 586 587#if YYDEBUG != 0 588int yydebug; /* nonzero means print parse trace */ 589/* Since this is uninitialized, it does not stop multiple parsers 590 from coexisting. */ 591#endif 592 593/* YYINITDEPTH indicates the initial size of the parser's stacks */ 594 595#ifndef YYINITDEPTH 596#define YYINITDEPTH 200 597#endif 598 599/* YYMAXDEPTH is the maximum size the stacks can grow to 600 (effective only if the built-in stack extension method is used). */ 601 602#if YYMAXDEPTH == 0 603#undef YYMAXDEPTH 604#endif 605 606#ifndef YYMAXDEPTH 607#define YYMAXDEPTH 10000 608#endif 609 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. */ 614 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++ */ 618#ifndef __cplusplus 619 620/* This is the most reliable way to avoid incompatibilities 621 in available built-in functions on various systems. */ 622static void 623__yy_memcpy (to, from, count) 624 char *to; 625 char *from; 626 unsigned int count; 627{ 628 register char *f = from; 629 register char *t = to; 630 register int i = count; 631 632 while (i-- > 0) 633 *t++ = *f++; 634} 635 636#else /* __cplusplus */ 637 638/* This is the most reliable way to avoid incompatibilities 639 in available built-in functions on various systems. */ 640static void 641__yy_memcpy (char *to, char *from, unsigned int count) 642{ 643 register char *t = to; 644 register char *f = from; 645 register int i = count; 646 647 while (i-- > 0) 648 *t++ = *f++; 649} 650 651#endif 652#endif 653 654#line 217 "/usr/lib/bison.simple" 655 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. */ 661 662#ifdef YYPARSE_PARAM 663#ifdef __cplusplus 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 */ 674 675/* Prevent warning if -Wstrict-prototypes. */ 676#ifdef __GNUC__ 677#ifdef YYPARSE_PARAM 678int yyparse (void *); 679#else 680int yyparse (void); 681#endif 682#endif 683 684int 685yyparse(YYPARSE_PARAM_ARG) 686 YYPARSE_PARAM_DECL 687{ 688 register int yystate; 689 register int yyn; 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 */ 694 695 short yyssa[YYINITDEPTH]; /* the state stack */ 696 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ 697 698 short *yyss = yyssa; /* refer to the stacks thru separate pointers */ 699 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ 700 701#ifdef YYLSP_NEEDED 702 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ 703 YYLTYPE *yyls = yylsa; 704 YYLTYPE *yylsp; 705 706#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) 707#else 708#define YYPOPSTACK (yyvsp--, yyssp--) 709#endif 710 711 int yystacksize = YYINITDEPTH; 712 int yyfree_stacks = 0; 713 714#ifdef YYPURE 715 int yychar; 716 YYSTYPE yylval; 717 int yynerrs; 718#ifdef YYLSP_NEEDED 719 YYLTYPE yylloc; 720#endif 721#endif 722 723 YYSTYPE yyval; /* the variable used to return */ 724 /* semantic values from the action */ 725 /* routines */ 726 727 int yylen; 728 729#if YYDEBUG != 0 730 if (yydebug) 731 fprintf(stderr, "Starting parse\n"); 732#endif 733 734 yystate = 0; 735 yyerrstatus = 0; 736 yynerrs = 0; 737 yychar = YYEMPTY; /* Cause a token to be read. */ 738 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. */ 743 744 yyssp = yyss - 1; 745 yyvsp = yyvs; 746#ifdef YYLSP_NEEDED 747 yylsp = yyls; 748#endif 749 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. */ 753yynewstate: 754 755 *++yyssp = yystate; 756 757 if (yyssp >= yyss + yystacksize - 1) 758 { 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; 762 short *yyss1 = yyss; 763#ifdef YYLSP_NEEDED 764 YYLTYPE *yyls1 = yyls; 765#endif 766 767 /* Get the current used size of the three stacks, in elements. */ 768 int size = yyssp - yyss + 1; 769 770#ifdef yyoverflow 771 /* Each stack pointer address is followed by the size of 772 the data in use in that stack, in bytes. */ 773#ifdef YYLSP_NEEDED 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), 780 &yystacksize); 781#else 782 yyoverflow("parser stack overflow", 783 &yyss1, size * sizeof (*yyssp), 784 &yyvs1, size * sizeof (*yyvsp), 785 &yystacksize); 786#endif 787 788 yyss = yyss1; yyvs = yyvs1; 789#ifdef YYLSP_NEEDED 790 yyls = yyls1; 791#endif 792#else /* no yyoverflow */ 793 /* Extend the stack our own way. */ 794 if (yystacksize >= YYMAXDEPTH) 795 { 796 yyerror("parser stack overflow"); 797 if (yyfree_stacks) 798 { 799 free (yyss); 800 free (yyvs); 801#ifdef YYLSP_NEEDED 802 free (yyls); 803#endif 804 } 805 return 2; 806 } 807 yystacksize *= 2; 808 if (yystacksize > YYMAXDEPTH) 809 yystacksize = YYMAXDEPTH; 810#ifndef YYSTACK_USE_ALLOCA 811 yyfree_stacks = 1; 812#endif 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)); 819#ifdef YYLSP_NEEDED 820 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); 821 __yy_memcpy ((char *)yyls, (char *)yyls1, 822 size * (unsigned int) sizeof (*yylsp)); 823#endif 824#endif /* no yyoverflow */ 825 826 yyssp = yyss + size - 1; 827 yyvsp = yyvs + size - 1; 828#ifdef YYLSP_NEEDED 829 yylsp = yyls + size - 1; 830#endif 831 832#if YYDEBUG != 0 833 if (yydebug) 834 fprintf(stderr, "Stack size increased to %d\n", yystacksize); 835#endif 836 837 if (yyssp >= yyss + yystacksize - 1) 838 YYABORT; 839 } 840 841#if YYDEBUG != 0 842 if (yydebug) 843 fprintf(stderr, "Entering state %d\n", yystate); 844#endif 845 846 goto yybackup; 847 yybackup: 848 849/* Do appropriate processing given the current state. */ 850/* Read a lookahead token if we need one and don't already have one. */ 851/* yyresume: */ 852 853 /* First try to decide what to do without reference to lookahead token. */ 854 855 yyn = yypact[yystate]; 856 if (yyn == YYFLAG) 857 goto yydefault; 858 859 /* Not known => get a lookahead token if don't already have one. */ 860 861 /* yychar is either YYEMPTY or YYEOF 862 or a valid token in external form. */ 863 864 if (yychar == YYEMPTY) 865 { 866#if YYDEBUG != 0 867 if (yydebug) 868 fprintf(stderr, "Reading a token: "); 869#endif 870 yychar = YYLEX; 871 } 872 873 /* Convert token to internal form (in yychar1) for indexing tables with */ 874 875 if (yychar <= 0) /* This means end of input. */ 876 { 877 yychar1 = 0; 878 yychar = YYEOF; /* Don't call YYLEX any more */ 879 880#if YYDEBUG != 0 881 if (yydebug) 882 fprintf(stderr, "Now at end of input.\n"); 883#endif 884 } 885 else 886 { 887 yychar1 = YYTRANSLATE(yychar); 888 889#if YYDEBUG != 0 890 if (yydebug) 891 { 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. */ 895#ifdef YYPRINT 896 YYPRINT (stderr, yychar, yylval); 897#endif 898 fprintf (stderr, ")\n"); 899 } 900#endif 901 } 902 903 yyn += yychar1; 904 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) 905 goto yydefault; 906 907 yyn = yytable[yyn]; 908 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, 913 just return success. 914 0, or most negative number => error. */ 915 916 if (yyn < 0) 917 { 918 if (yyn == YYFLAG) 919 goto yyerrlab; 920 yyn = -yyn; 921 goto yyreduce; 922 } 923 else if (yyn == 0) 924 goto yyerrlab; 925 926 if (yyn == YYFINAL) 927 YYACCEPT; 928 929 /* Shift the lookahead token. */ 930 931#if YYDEBUG != 0 932 if (yydebug) 933 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); 934#endif 935 936 /* Discard the token being shifted unless it is eof. */ 937 if (yychar != YYEOF) 938 yychar = YYEMPTY; 939 940 *++yyvsp = yylval; 941#ifdef YYLSP_NEEDED 942 *++yylsp = yylloc; 943#endif 944 945 /* count tokens shifted since error; after three, turn off error status. */ 946 if (yyerrstatus) yyerrstatus--; 947 948 yystate = yyn; 949 goto yynewstate; 950 951/* Do the default action for the current state. */ 952yydefault: 953 954 yyn = yydefact[yystate]; 955 if (yyn == 0) 956 goto yyerrlab; 957 958/* Do a reduction. yyn is the number of a rule to reduce with. */ 959yyreduce: 960 yylen = yyr2[yyn]; 961 if (yylen > 0) 962 yyval = yyvsp[1-yylen]; /* implement default value of the action */ 963 964#if YYDEBUG != 0 965 if (yydebug) 966 { 967 int i; 968 969 fprintf (stderr, "Reducing via rule %d (line %d), ", 970 yyn, yyrline[yyn]); 971 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]]); 976 } 977#endif 978 979 980 switch (yyn) { 981 982case 3: 983#line 107 "scripts/genksyms/parse.y" 984{ is_typedef = 0; is_extern = 0; current_name = NULL; decl_spec = NULL; ; 985 break;} 986case 4: 987#line 109 "scripts/genksyms/parse.y" 988{ free_list(*yyvsp[0], NULL); *yyvsp[0] = NULL; ; 989 break;} 990case 5: 991#line 113 "scripts/genksyms/parse.y" 992{ is_typedef = 1; ; 993 break;} 994case 6: 995#line 114 "scripts/genksyms/parse.y" 996{ yyval = yyvsp[0]; ; 997 break;} 998case 11: 999#line 119 "scripts/genksyms/parse.y" 1000{ yyval = yyvsp[0]; ; 1001 break;} 1002case 12: 1003#line 120 "scripts/genksyms/parse.y" 1004{ yyval = yyvsp[0]; ; 1005 break;} 1006case 13: 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, 1013 decl, is_extern); 1014 current_name = NULL; 1015 } 1016 yyval = yyvsp[0]; 1017 ; 1018 break;} 1019case 14: 1020#line 138 "scripts/genksyms/parse.y" 1021{ yyval = NULL; ; 1022 break;} 1023case 16: 1024#line 144 "scripts/genksyms/parse.y" 1025{ struct string_list *decl = *yyvsp[0]; 1026 *yyvsp[0] = NULL; 1027 add_symbol(current_name, 1028 is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern); 1029 current_name = NULL; 1030 yyval = yyvsp[0]; 1031 ; 1032 break;} 1033case 17: 1034#line 152 "scripts/genksyms/parse.y" 1035{ struct string_list *decl = *yyvsp[0]; 1036 *yyvsp[0] = NULL; 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; 1042 yyval = yyvsp[0]; 1043 ; 1044 break;} 1045case 18: 1046#line 165 "scripts/genksyms/parse.y" 1047{ yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1] ? yyvsp[-1] : yyvsp[-2] ? yyvsp[-2] : yyvsp[-3]; ; 1048 break;} 1049case 19: 1050#line 170 "scripts/genksyms/parse.y" 1051{ decl_spec = NULL; ; 1052 break;} 1053case 21: 1054#line 175 "scripts/genksyms/parse.y" 1055{ decl_spec = *yyvsp[0]; ; 1056 break;} 1057case 22: 1058#line 176 "scripts/genksyms/parse.y" 1059{ decl_spec = *yyvsp[0]; ; 1060 break;} 1061case 23: 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]); 1066 yyval = yyvsp[0]; 1067 ; 1068 break;} 1069case 28: 1070#line 193 "scripts/genksyms/parse.y" 1071{ is_extern = 1; yyval = yyvsp[0]; ; 1072 break;} 1073case 29: 1074#line 194 "scripts/genksyms/parse.y" 1075{ is_extern = 0; yyval = yyvsp[0]; ; 1076 break;} 1077case 33: 1078#line 205 "scripts/genksyms/parse.y" 1079{ remove_node(yyvsp[-1]); (*yyvsp[0])->tag = SYM_STRUCT; yyval = yyvsp[0]; ; 1080 break;} 1081case 34: 1082#line 207 "scripts/genksyms/parse.y" 1083{ remove_node(yyvsp[-1]); (*yyvsp[0])->tag = SYM_UNION; yyval = yyvsp[0]; ; 1084 break;} 1085case 35: 1086#line 209 "scripts/genksyms/parse.y" 1087{ remove_node(yyvsp[-1]); (*yyvsp[0])->tag = SYM_ENUM; yyval = yyvsp[0]; ; 1088 break;} 1089case 36: 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); 1095 yyval = yyvsp[0]; 1096 ; 1097 break;} 1098case 37: 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); 1104 yyval = yyvsp[0]; 1105 ; 1106 break;} 1107case 38: 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); 1113 yyval = yyvsp[0]; 1114 ; 1115 break;} 1116case 39: 1117#line 235 "scripts/genksyms/parse.y" 1118{ yyval = yyvsp[0]; ; 1119 break;} 1120case 40: 1121#line 236 "scripts/genksyms/parse.y" 1122{ yyval = yyvsp[0]; ; 1123 break;} 1124case 41: 1125#line 237 "scripts/genksyms/parse.y" 1126{ yyval = yyvsp[0]; ; 1127 break;} 1128case 52: 1129#line 251 "scripts/genksyms/parse.y" 1130{ (*yyvsp[0])->tag = SYM_TYPEDEF; yyval = yyvsp[0]; ; 1131 break;} 1132case 53: 1133#line 256 "scripts/genksyms/parse.y" 1134{ yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ; 1135 break;} 1136case 54: 1137#line 260 "scripts/genksyms/parse.y" 1138{ yyval = NULL; ; 1139 break;} 1140case 57: 1141#line 266 "scripts/genksyms/parse.y" 1142{ yyval = yyvsp[0]; ; 1143 break;} 1144case 61: 1145#line 272 "scripts/genksyms/parse.y" 1146{ /* restrict has no effect in prototypes so ignore it */ 1147 remove_node(yyvsp[0]); 1148 yyval = yyvsp[0]; 1149 ; 1150 break;} 1151case 62: 1152#line 279 "scripts/genksyms/parse.y" 1153{ yyval = yyvsp[0]; ; 1154 break;} 1155case 64: 1156#line 285 "scripts/genksyms/parse.y" 1157{ if (current_name != NULL) { 1158 error_with_pos("unexpected second declaration name"); 1159 YYERROR; 1160 } else { 1161 current_name = (*yyvsp[0])->string; 1162 yyval = yyvsp[0]; 1163 } 1164 ; 1165 break;} 1166case 65: 1167#line 294 "scripts/genksyms/parse.y" 1168{ yyval = yyvsp[0]; ; 1169 break;} 1170case 66: 1171#line 296 "scripts/genksyms/parse.y" 1172{ yyval = yyvsp[0]; ; 1173 break;} 1174case 67: 1175#line 298 "scripts/genksyms/parse.y" 1176{ yyval = yyvsp[0]; ; 1177 break;} 1178case 68: 1179#line 300 "scripts/genksyms/parse.y" 1180{ yyval = yyvsp[0]; ; 1181 break;} 1182case 69: 1183#line 302 "scripts/genksyms/parse.y" 1184{ yyval = yyvsp[0]; ; 1185 break;} 1186case 70: 1187#line 308 "scripts/genksyms/parse.y" 1188{ yyval = yyvsp[0]; ; 1189 break;} 1190case 74: 1191#line 316 "scripts/genksyms/parse.y" 1192{ yyval = yyvsp[0]; ; 1193 break;} 1194case 75: 1195#line 318 "scripts/genksyms/parse.y" 1196{ yyval = yyvsp[0]; ; 1197 break;} 1198case 76: 1199#line 320 "scripts/genksyms/parse.y" 1200{ yyval = yyvsp[0]; ; 1201 break;} 1202case 77: 1203#line 322 "scripts/genksyms/parse.y" 1204{ yyval = yyvsp[0]; ; 1205 break;} 1206case 78: 1207#line 324 "scripts/genksyms/parse.y" 1208{ yyval = yyvsp[0]; ; 1209 break;} 1210case 79: 1211#line 328 "scripts/genksyms/parse.y" 1212{ yyval = yyvsp[0]; ; 1213 break;} 1214case 81: 1215#line 330 "scripts/genksyms/parse.y" 1216{ yyval = yyvsp[0]; ; 1217 break;} 1218case 82: 1219#line 334 "scripts/genksyms/parse.y" 1220{ yyval = NULL; ; 1221 break;} 1222case 85: 1223#line 341 "scripts/genksyms/parse.y" 1224{ yyval = yyvsp[0]; ; 1225 break;} 1226case 86: 1227#line 346 "scripts/genksyms/parse.y" 1228{ yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ; 1229 break;} 1230case 87: 1231#line 351 "scripts/genksyms/parse.y" 1232{ yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ; 1233 break;} 1234case 89: 1235#line 356 "scripts/genksyms/parse.y" 1236{ yyval = NULL; ; 1237 break;} 1238case 90: 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]); 1243 yyval = yyvsp[0]; 1244 ; 1245 break;} 1246case 91: 1247#line 366 "scripts/genksyms/parse.y" 1248{ remove_node(yyvsp[0]); 1249 yyval = yyvsp[0]; 1250 ; 1251 break;} 1252case 92: 1253#line 370 "scripts/genksyms/parse.y" 1254{ yyval = yyvsp[0]; ; 1255 break;} 1256case 93: 1257#line 372 "scripts/genksyms/parse.y" 1258{ yyval = yyvsp[0]; ; 1259 break;} 1260case 94: 1261#line 374 "scripts/genksyms/parse.y" 1262{ yyval = yyvsp[0]; ; 1263 break;} 1264case 95: 1265#line 376 "scripts/genksyms/parse.y" 1266{ yyval = yyvsp[0]; ; 1267 break;} 1268case 96: 1269#line 378 "scripts/genksyms/parse.y" 1270{ yyval = yyvsp[0]; ; 1271 break;} 1272case 97: 1273#line 383 "scripts/genksyms/parse.y" 1274{ struct string_list *decl = *yyvsp[-1]; 1275 *yyvsp[-1] = NULL; 1276 add_symbol(current_name, SYM_NORMAL, decl, is_extern); 1277 yyval = yyvsp[0]; 1278 ; 1279 break;} 1280case 98: 1281#line 391 "scripts/genksyms/parse.y" 1282{ yyval = NULL; ; 1283 break;} 1284case 100: 1285#line 398 "scripts/genksyms/parse.y" 1286{ remove_list(yyvsp[0], &(*yyvsp[-1])->next); yyval = yyvsp[0]; ; 1287 break;} 1288case 101: 1289#line 402 "scripts/genksyms/parse.y" 1290{ yyval = yyvsp[0]; ; 1291 break;} 1292case 102: 1293#line 403 "scripts/genksyms/parse.y" 1294{ yyval = yyvsp[0]; ; 1295 break;} 1296case 103: 1297#line 407 "scripts/genksyms/parse.y" 1298{ yyval = NULL; ; 1299 break;} 1300case 106: 1301#line 413 "scripts/genksyms/parse.y" 1302{ yyval = yyvsp[0]; ; 1303 break;} 1304case 107: 1305#line 418 "scripts/genksyms/parse.y" 1306{ yyval = yyvsp[0]; ; 1307 break;} 1308case 108: 1309#line 420 "scripts/genksyms/parse.y" 1310{ yyval = yyvsp[0]; ; 1311 break;} 1312case 109: 1313#line 424 "scripts/genksyms/parse.y" 1314{ yyval = NULL; ; 1315 break;} 1316case 112: 1317#line 430 "scripts/genksyms/parse.y" 1318{ yyval = yyvsp[0]; ; 1319 break;} 1320case 113: 1321#line 434 "scripts/genksyms/parse.y" 1322{ yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ; 1323 break;} 1324case 114: 1325#line 435 "scripts/genksyms/parse.y" 1326{ yyval = yyvsp[0]; ; 1327 break;} 1328case 116: 1329#line 440 "scripts/genksyms/parse.y" 1330{ yyval = yyvsp[0]; ; 1331 break;} 1332case 117: 1333#line 444 "scripts/genksyms/parse.y" 1334{ yyval = NULL; ; 1335 break;} 1336case 119: 1337#line 449 "scripts/genksyms/parse.y" 1338{ yyval = yyvsp[0]; ; 1339 break;} 1340case 120: 1341#line 453 "scripts/genksyms/parse.y" 1342{ yyval = NULL; ; 1343 break;} 1344case 122: 1345#line 459 "scripts/genksyms/parse.y" 1346{ export_symbol((*yyvsp[-2])->string); yyval = yyvsp[0]; ; 1347 break;} 1348} 1349 /* the action file gets copied in in place of this dollarsign */ 1350#line 543 "/usr/lib/bison.simple" 1351 1352 yyvsp -= yylen; 1353 yyssp -= yylen; 1354#ifdef YYLSP_NEEDED 1355 yylsp -= yylen; 1356#endif 1357 1358#if YYDEBUG != 0 1359 if (yydebug) 1360 { 1361 short *ssp1 = yyss - 1; 1362 fprintf (stderr, "state stack now"); 1363 while (ssp1 != yyssp) 1364 fprintf (stderr, " %d", *++ssp1); 1365 fprintf (stderr, "\n"); 1366 } 1367#endif 1368 1369 *++yyvsp = yyval; 1370 1371#ifdef YYLSP_NEEDED 1372 yylsp++; 1373 if (yylen == 0) 1374 { 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; 1379 yylsp->text = 0; 1380 } 1381 else 1382 { 1383 yylsp->last_line = (yylsp+yylen-1)->last_line; 1384 yylsp->last_column = (yylsp+yylen-1)->last_column; 1385 } 1386#endif 1387 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. */ 1392 1393 yyn = yyr1[yyn]; 1394 1395 yystate = yypgoto[yyn - YYNTBASE] + *yyssp; 1396 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) 1397 yystate = yytable[yystate]; 1398 else 1399 yystate = yydefgoto[yyn - YYNTBASE]; 1400 1401 goto yynewstate; 1402 1403yyerrlab: /* here on detecting error */ 1404 1405 if (! yyerrstatus) 1406 /* If not already recovering from an error, report this error. */ 1407 { 1408 ++yynerrs; 1409 1410#ifdef YYERROR_VERBOSE 1411 yyn = yypact[yystate]; 1412 1413 if (yyn > YYFLAG && yyn < YYLAST) 1414 { 1415 int size = 0; 1416 char *msg; 1417 int x, count; 1418 1419 count = 0; 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); 1426 if (msg != 0) 1427 { 1428 strcpy(msg, "parse error"); 1429 1430 if (count < 5) 1431 { 1432 count = 0; 1433 for (x = (yyn < 0 ? -yyn : 0); 1434 x < (sizeof(yytname) / sizeof(char *)); x++) 1435 if (yycheck[x + yyn] == x) 1436 { 1437 strcat(msg, count == 0 ? ", expecting `" : " or `"); 1438 strcat(msg, yytname[x]); 1439 strcat(msg, "'"); 1440 count++; 1441 } 1442 } 1443 yyerror(msg); 1444 free(msg); 1445 } 1446 else 1447 yyerror ("parse error; also virtual memory exceeded"); 1448 } 1449 else 1450#endif /* YYERROR_VERBOSE */ 1451 yyerror("parse error"); 1452 } 1453 1454 goto yyerrlab1; 1455yyerrlab1: /* here on error raised explicitly by an action */ 1456 1457 if (yyerrstatus == 3) 1458 { 1459 /* if just tried and failed to reuse lookahead token after an error, discard it. */ 1460 1461 /* return failure if at end of input */ 1462 if (yychar == YYEOF) 1463 YYABORT; 1464 1465#if YYDEBUG != 0 1466 if (yydebug) 1467 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); 1468#endif 1469 1470 yychar = YYEMPTY; 1471 } 1472 1473 /* Else will try to reuse lookahead token 1474 after shifting the error token. */ 1475 1476 yyerrstatus = 3; /* Each real token shifted decrements this */ 1477 1478 goto yyerrhandle; 1479 1480yyerrdefault: /* current state does not do anything special for the error token. */ 1481 1482#if 0 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; 1487#endif 1488 1489yyerrpop: /* pop the current state because it cannot handle the error token */ 1490 1491 if (yyssp == yyss) YYABORT; 1492 yyvsp--; 1493 yystate = *--yyssp; 1494#ifdef YYLSP_NEEDED 1495 yylsp--; 1496#endif 1497 1498#if YYDEBUG != 0 1499 if (yydebug) 1500 { 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"); 1506 } 1507#endif 1508 1509yyerrhandle: 1510 1511 yyn = yypact[yystate]; 1512 if (yyn == YYFLAG) 1513 goto yyerrdefault; 1514 1515 yyn += YYTERROR; 1516 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) 1517 goto yyerrdefault; 1518 1519 yyn = yytable[yyn]; 1520 if (yyn < 0) 1521 { 1522 if (yyn == YYFLAG) 1523 goto yyerrpop; 1524 yyn = -yyn; 1525 goto yyreduce; 1526 } 1527 else if (yyn == 0) 1528 goto yyerrpop; 1529 1530 if (yyn == YYFINAL) 1531 YYACCEPT; 1532 1533#if YYDEBUG != 0 1534 if (yydebug) 1535 fprintf(stderr, "Shifting error token, "); 1536#endif 1537 1538 *++yyvsp = yylval; 1539#ifdef YYLSP_NEEDED 1540 *++yylsp = yylloc; 1541#endif 1542 1543 yystate = yyn; 1544 goto yynewstate; 1545 1546 yyacceptlab: 1547 /* YYACCEPT comes here. */ 1548 if (yyfree_stacks) 1549 { 1550 free (yyss); 1551 free (yyvs); 1552#ifdef YYLSP_NEEDED 1553 free (yyls); 1554#endif 1555 } 1556 return 0; 1557 1558 yyabortlab: 1559 /* YYABORT comes here. */ 1560 if (yyfree_stacks) 1561 { 1562 free (yyss); 1563 free (yyvs); 1564#ifdef YYLSP_NEEDED 1565 free (yyls); 1566#endif 1567 } 1568 return 1; 1569} 1570#line 463 "scripts/genksyms/parse.y" 1571 1572 1573static void 1574yyerror(const char *e) 1575{ 1576 error_with_pos("%s", e); 1577}