| 1 | /* A Bison parser, made from c-parse.y |
| 2 | by GNU bison 1.35. */ |
| 3 | |
| 4 | #define YYBISON 1 /* Identify Bison output. */ |
| 5 | |
| 6 | #define YYLSP_NEEDED 1 |
| 7 | |
| 8 | # define MEMBER 257 |
| 9 | # define INCR 258 |
| 10 | # define DECR 259 |
| 11 | # define SL 260 |
| 12 | # define SR 261 |
| 13 | # define LE 262 |
| 14 | # define GE 263 |
| 15 | # define EQ 264 |
| 16 | # define NE 265 |
| 17 | # define AND 266 |
| 18 | # define OR 267 |
| 19 | # define MULEQ 268 |
| 20 | # define DIVEQ 269 |
| 21 | # define MODEQ 270 |
| 22 | # define ADDEQ 271 |
| 23 | # define SUBEQ 272 |
| 24 | # define SLEQ 273 |
| 25 | # define SREQ 274 |
| 26 | # define ANDEQ 275 |
| 27 | # define XOREQ 276 |
| 28 | # define OREQ 277 |
| 29 | # define VARARG 278 |
| 30 | # define AUTO 279 |
| 31 | # define BREAK 280 |
| 32 | # define CASE 281 |
| 33 | # define CHAR 282 |
| 34 | # define CONST 283 |
| 35 | # define CONTINUE 284 |
| 36 | # define DEFAULT 285 |
| 37 | # define DO 286 |
| 38 | # define DOUBLE 287 |
| 39 | # define ELSE 288 |
| 40 | # define ENUM 289 |
| 41 | # define EXTERN 290 |
| 42 | # define FLOAT 291 |
| 43 | # define FOR 292 |
| 44 | # define GOTO 293 |
| 45 | # define IF 294 |
| 46 | # define INLINE 295 |
| 47 | # define INT 296 |
| 48 | # define LONG 297 |
| 49 | # define REGISTER 298 |
| 50 | # define RESTRICT 299 |
| 51 | # define RETURN 300 |
| 52 | # define SHORT 301 |
| 53 | # define SIGNED 302 |
| 54 | # define SIZEOF 303 |
| 55 | # define STATIC 304 |
| 56 | # define STRUCT 305 |
| 57 | # define SWITCH 306 |
| 58 | # define TYPEDEF 307 |
| 59 | # define UNION 308 |
| 60 | # define UNSIGNED 309 |
| 61 | # define VOID 310 |
| 62 | # define VOLATILE 311 |
| 63 | # define WHILE 312 |
| 64 | # define BOOL 313 |
| 65 | # define COMPLEX 314 |
| 66 | # define IMAGINARY 315 |
| 67 | # define ATTRIBUTE 316 |
| 68 | # define GCC_VA_LIST 317 |
| 69 | # define GCC_VA_ARG 318 |
| 70 | # define GCC_EXPECT 319 |
| 71 | # define TYPEDEF_NAME 320 |
| 72 | # define ID 321 |
| 73 | # define NUMBER 322 |
| 74 | # define STRINGLIT 323 |
| 75 | # define CHARLIT 324 |
| 76 | # define WSTRINGLIT 325 |
| 77 | # define WCHARLIT 326 |
| 78 | |
| 79 | #line 1 "c-parse.y" |
| 80 | |
| 81 | |
| 82 | /* enable chatty error messages */ |
| 83 | #define YYERROR_VERBOSE 1 |
| 84 | |
| 85 | /* figure out the location of a non-terminal. We discard extent information |
| 86 | * but this isn't necessarily disastrous for our purpose. */ |
| 87 | #define YYLLOC_DEFAULT(Current, Rhs, N) do { \ |
| 88 | Current = Rhs[1]; \ |
| 89 | } while(0) |
| 90 | |
| 91 | #include "cparse.h" |
| 92 | #include <stddef.h> |
| 93 | #include <assert.h> |
| 94 | |
| 95 | /* various bits of parsing infrastructure. increasingly i'm thinking some of |
| 96 | * this belongs in its own file. still... */ |
| 97 | |
| 98 | /* hang on to both ends of a declarator while it is being parsed. This idiom |
| 99 | * is used a lot with anonymous structures below, but we need an actual name |
| 100 | * for the type for this particular case. */ |
| 101 | struct parsing_declarator { |
| 102 | struct declarator_type *first, **end; |
| 103 | char *name; /* pick up name */ |
| 104 | }; |
| 105 | |
| 106 | /* we need to know what declaration specifiers apply to the current |
| 107 | * declarator. This means we need a stack of them to cope with nested |
| 108 | * declarations. */ |
| 109 | struct declaration_specifiers_stack { |
| 110 | struct declaration_specifiers_stack *next; |
| 111 | struct declaration_specifiers *ds; |
| 112 | }; |
| 113 | |
| 114 | static struct declaration_specifiers_stack *declaration_specifiers_stack; |
| 115 | |
| 116 | static void push_declaration_specifiers(struct declaration_specifiers *ds) { |
| 117 | struct declaration_specifiers_stack *n; |
| 118 | |
| 119 | NEW(n); |
| 120 | n->next = declaration_specifiers_stack; |
| 121 | n->ds = ds; |
| 122 | declaration_specifiers_stack = n; |
| 123 | } |
| 124 | |
| 125 | static void pop_declaration_specifiers(void) { |
| 126 | /* can we have ->= and .= operators? */ |
| 127 | declaration_specifiers_stack = declaration_specifiers_stack->next; |
| 128 | } |
| 129 | |
| 130 | static struct declaration_specifiers *top_declaration_specifiers(void) { |
| 131 | return declaration_specifiers_stack->ds; |
| 132 | } |
| 133 | |
| 134 | static void check_top_declaration_specifier(struct declaration_specifiers *ds) { |
| 135 | assert(declaration_specifiers_stack->ds == ds); |
| 136 | } |
| 137 | |
| 138 | /* make up an actual declarator from a completed parse */ |
| 139 | static struct declarator *get_declarator(struct parsing_declarator *pd, |
| 140 | const struct location *where) { |
| 141 | struct declarator *d; |
| 142 | |
| 143 | NEW(d); |
| 144 | d->declarator_type = pd->first; |
| 145 | d->declaration_specifiers = top_declaration_specifiers(); |
| 146 | d->name = pd->name; |
| 147 | d->where = *where; |
| 148 | return d; |
| 149 | } |
| 150 | |
| 151 | static struct expression expr_star; /* kludge */ |
| 152 | |
| 153 | static void warn_old_style_function(const struct location *where) { |
| 154 | inputwarning(where, warn_obsolete, |
| 155 | "old-style function declarator"); |
| 156 | } |
| 157 | |
| 158 | void parser_init(FILE *fp) { |
| 159 | yyin = fp; |
| 160 | translation_unit = 0; |
| 161 | scope_init(); |
| 162 | gcc_extensions(); |
| 163 | } |
| 164 | |
| 165 | |
| 166 | #line 93 "c-parse.y" |
| 167 | #ifndef YYSTYPE |
| 168 | typedef union { |
| 169 | long i; |
| 170 | unsigned long u; |
| 171 | char *s; |
| 172 | struct { |
| 173 | char *name; |
| 174 | struct declarator *declarator; |
| 175 | } name; |
| 176 | struct declaration_specifiers *declaration_specifiers; |
| 177 | struct declarator *declarator; |
| 178 | struct parsing_declarator *declarator_parse; |
| 179 | struct declaration *declaration; |
| 180 | struct identifier_list *identifier_list; |
| 181 | struct expression *expression; |
| 182 | struct expression_list *expression_list; |
| 183 | struct initializer *initializer; |
| 184 | struct designator *designator; |
| 185 | struct external_declaration *external_declaration; |
| 186 | struct function_definition *function_definition; |
| 187 | struct enumerator *enumerator; |
| 188 | struct statement *statement; |
| 189 | /* transients for parsing lists */ |
| 190 | struct { struct declarator *first, **end; } *declarator_list; |
| 191 | struct { struct declaration *first, **end; } *declaration_list; |
| 192 | struct { struct identifier_list *first, **end; } *identifier_list_parse; |
| 193 | struct { struct expression_list *first, **end; } *parsing_expression_list; |
| 194 | struct { struct initializer *first, **end; } *initializer_list; |
| 195 | struct { struct designator *first, **end; } *designator_list; |
| 196 | struct { struct external_declaration *first, **end; } *external_declaration_list; |
| 197 | struct { struct enumerator *first, **end; } *enumerator_list; |
| 198 | struct { struct statement *first, **end; } *statement_list; |
| 199 | } yystype; |
| 200 | # define YYSTYPE yystype |
| 201 | # define YYSTYPE_IS_TRIVIAL 1 |
| 202 | #endif |
| 203 | |
| 204 | #ifndef YYLTYPE |
| 205 | typedef struct yyltype |
| 206 | { |
| 207 | int first_line; |
| 208 | int first_column; |
| 209 | |
| 210 | int last_line; |
| 211 | int last_column; |
| 212 | } yyltype; |
| 213 | |
| 214 | # define YYLTYPE yyltype |
| 215 | # define YYLTYPE_IS_TRIVIAL 1 |
| 216 | #endif |
| 217 | |
| 218 | #ifndef YYDEBUG |
| 219 | # define YYDEBUG 1 |
| 220 | #endif |
| 221 | |
| 222 | |
| 223 | |
| 224 | #define YYFINAL 435 |
| 225 | #define YYFLAG -32768 |
| 226 | #define YYNTBASE 97 |
| 227 | |
| 228 | /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ |
| 229 | #define YYTRANSLATE(x) ((unsigned)(x) <= 326 ? yytranslate[x] : 203) |
| 230 | |
| 231 | /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ |
| 232 | static const char yytranslate[] = |
| 233 | { |
| 234 | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 235 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 236 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 237 | 2, 2, 2, 30, 2, 2, 2, 32, 25, 2, |
| 238 | 88, 89, 26, 27, 37, 28, 39, 31, 2, 2, |
| 239 | 2, 2, 2, 2, 2, 2, 2, 2, 95, 96, |
| 240 | 33, 38, 34, 94, 2, 2, 2, 2, 2, 2, |
| 241 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 242 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 243 | 2, 90, 2, 91, 35, 2, 2, 2, 2, 2, |
| 244 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 245 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 246 | 2, 2, 2, 92, 36, 93, 29, 2, 2, 2, |
| 247 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 248 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 249 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 250 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 251 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 252 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 253 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 254 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 255 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 256 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 257 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 258 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 259 | 2, 2, 2, 2, 2, 2, 1, 3, 4, 5, |
| 260 | 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, |
| 261 | 16, 17, 18, 19, 20, 21, 22, 23, 24, 40, |
| 262 | 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, |
| 263 | 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, |
| 264 | 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, |
| 265 | 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, |
| 266 | 81, 82, 83, 84, 85, 86, 87 |
| 267 | }; |
| 268 | |
| 269 | #if YYDEBUG |
| 270 | static const short yyprhs[] = |
| 271 | { |
| 272 | 0, 0, 2, 4, 6, 8, 9, 11, 13, 15, |
| 273 | 17, 19, 21, 25, 27, 32, 37, 44, 51, 55, |
| 274 | 58, 66, 68, 70, 72, 74, 76, 80, 82, 83, |
| 275 | 85, 88, 91, 96, 98, 100, 102, 104, 106, 108, |
| 276 | 110, 112, 117, 119, 123, 125, 127, 129, 131, 135, |
| 277 | 137, 139, 141, 145, 147, 149, 151, 155, 157, 159, |
| 278 | 161, 163, 165, 169, 171, 173, 175, 179, 181, 185, |
| 279 | 187, 191, 193, 197, 199, 203, 205, 211, 213, 217, |
| 280 | 219, 221, 223, 225, 227, 229, 231, 233, 235, 237, |
| 281 | 239, 241, 245, 247, 248, 250, 254, 256, 259, 262, |
| 282 | 265, 268, 271, 273, 274, 276, 277, 279, 284, 287, |
| 283 | 289, 290, 295, 297, 299, 301, 303, 305, 307, 309, |
| 284 | 311, 313, 315, 317, 319, 321, 323, 325, 327, 329, |
| 285 | 331, 333, 335, 337, 339, 346, 349, 351, 354, 357, |
| 286 | 359, 362, 366, 368, 371, 374, 377, 380, 383, 385, |
| 287 | 386, 389, 395, 397, 401, 409, 412, 415, 417, 421, |
| 288 | 423, 425, 429, 431, 433, 435, 437, 439, 440, 443, |
| 289 | 445, 447, 452, 458, 463, 469, 471, 473, 474, 476, |
| 290 | 479, 482, 485, 486, 488, 489, 492, 496, 498, 501, |
| 291 | 504, 506, 507, 509, 513, 515, 518, 521, 523, 524, |
| 292 | 526, 530, 533, 538, 544, 548, 554, 556, 557, 559, |
| 293 | 560, 562, 565, 567, 572, 574, 575, 577, 581, 585, |
| 294 | 588, 592, 594, 596, 599, 603, 606, 611, 616, 620, |
| 295 | 627, 633, 636, 642, 650, 660, 661, 671, 675, 678, |
| 296 | 681, 685, 686, 691, 695, 698, 699, 701, 703, 706, |
| 297 | 707, 709, 712, 715, 717, 719, 720, 721, 728, 731, |
| 298 | 732, 735, 736, 743, 746, 747, 749, 751, 752, 753 |
| 299 | }; |
| 300 | static const short yyrhs[] = |
| 301 | { |
| 302 | 191, 0, 82, 0, 81, 0, 98, 0, 0, 82, |
| 303 | 0, 83, 0, 85, 0, 84, 0, 87, 0, 86, |
| 304 | 0, 88, 127, 89, 0, 100, 0, 101, 90, 127, |
| 305 | 91, 0, 101, 88, 105, 89, 0, 79, 88, 125, |
| 306 | 37, 173, 89, 0, 80, 88, 125, 37, 125, 89, |
| 307 | 0, 101, 102, 98, 0, 101, 103, 0, 88, 173, |
| 308 | 89, 92, 180, 179, 93, 0, 39, 0, 3, 0, |
| 309 | 4, 0, 5, 0, 125, 0, 104, 37, 125, 0, |
| 310 | 104, 0, 0, 101, 0, 107, 108, 0, 64, 106, |
| 311 | 0, 64, 88, 173, 89, 0, 25, 0, 26, 0, |
| 312 | 27, 0, 28, 0, 29, 0, 30, 0, 103, 0, |
| 313 | 106, 0, 88, 173, 89, 108, 0, 108, 0, 109, |
| 314 | 110, 108, 0, 26, 0, 31, 0, 32, 0, 109, |
| 315 | 0, 111, 112, 109, 0, 27, 0, 28, 0, 111, |
| 316 | 0, 113, 114, 111, 0, 6, 0, 7, 0, 113, |
| 317 | 0, 115, 116, 113, 0, 33, 0, 34, 0, 8, |
| 318 | 0, 9, 0, 115, 0, 117, 118, 115, 0, 10, |
| 319 | 0, 11, 0, 117, 0, 119, 25, 117, 0, 119, |
| 320 | 0, 120, 35, 119, 0, 120, 0, 121, 36, 120, |
| 321 | 0, 121, 0, 122, 12, 121, 0, 122, 0, 123, |
| 322 | 13, 122, 0, 123, 0, 123, 94, 127, 95, 124, |
| 323 | 0, 124, 0, 106, 126, 125, 0, 38, 0, 14, |
| 324 | 0, 15, 0, 16, 0, 17, 0, 18, 0, 19, |
| 325 | 0, 20, 0, 21, 0, 22, 0, 23, 0, 125, |
| 326 | 0, 127, 37, 125, 0, 127, 0, 0, 124, 0, |
| 327 | 131, 134, 96, 0, 132, 0, 139, 133, 0, 140, |
| 328 | 133, 0, 156, 133, 0, 157, 133, 0, 198, 133, |
| 329 | 0, 132, 0, 0, 135, 0, 0, 137, 0, 135, |
| 330 | 37, 197, 137, 0, 159, 197, 0, 136, 0, 0, |
| 331 | 136, 38, 138, 178, 0, 68, 0, 51, 0, 65, |
| 332 | 0, 40, 0, 59, 0, 141, 0, 142, 0, 151, |
| 333 | 0, 81, 0, 71, 0, 43, 0, 62, 0, 57, |
| 334 | 0, 58, 0, 52, 0, 48, 0, 63, 0, 70, |
| 335 | 0, 74, 0, 75, 0, 76, 0, 78, 0, 143, |
| 336 | 99, 92, 144, 93, 197, 0, 143, 98, 0, 143, |
| 337 | 0, 66, 197, 0, 69, 197, 0, 145, 0, 144, |
| 338 | 145, 0, 146, 149, 96, 0, 147, 0, 140, 148, |
| 339 | 0, 156, 148, 0, 139, 148, 0, 157, 148, 0, |
| 340 | 198, 148, 0, 147, 0, 0, 150, 197, 0, 149, |
| 341 | 37, 197, 150, 197, 0, 136, 0, 158, 95, 129, |
| 342 | 0, 152, 99, 92, 153, 179, 93, 197, 0, 152, |
| 343 | 98, 0, 50, 197, 0, 154, 0, 153, 37, 154, |
| 344 | 0, 155, 0, 98, 0, 98, 38, 129, 0, 44, |
| 345 | 0, 60, 0, 72, 0, 56, 0, 159, 0, 0, |
| 346 | 165, 160, 0, 160, 0, 82, 0, 88, 197, 159, |
| 347 | 89, 0, 160, 90, 162, 161, 91, 0, 160, 88, |
| 348 | 171, 89, 0, 160, 88, 168, 163, 89, 0, 125, |
| 349 | 0, 26, 0, 0, 167, 0, 65, 167, 0, 166, |
| 350 | 65, 0, 37, 24, 0, 0, 165, 0, 0, 26, |
| 351 | 167, 0, 26, 167, 165, 0, 156, 0, 166, 156, |
| 352 | 0, 166, 198, 0, 166, 0, 0, 170, 0, 168, |
| 353 | 37, 170, 0, 131, 0, 169, 159, 0, 169, 176, |
| 354 | 0, 172, 0, 0, 82, 0, 172, 37, 82, 0, |
| 355 | 146, 176, 0, 88, 197, 177, 89, 0, 175, 90, |
| 356 | 162, 161, 91, 0, 175, 88, 89, 0, 175, 88, |
| 357 | 168, 163, 89, 0, 174, 0, 0, 177, 0, 0, |
| 358 | 165, 0, 164, 174, 0, 125, 0, 92, 180, 179, |
| 359 | 93, 0, 37, 0, 0, 181, 0, 180, 37, 181, |
| 360 | 0, 182, 38, 178, 0, 183, 178, 0, 82, 95, |
| 361 | 178, 0, 178, 0, 183, 0, 182, 183, 0, 90, |
| 362 | 129, 91, 0, 39, 98, 0, 98, 95, 197, 184, |
| 363 | 0, 42, 129, 95, 184, 0, 46, 95, 184, 0, |
| 364 | 55, 88, 127, 89, 184, 190, 0, 67, 88, 127, |
| 365 | 89, 184, 0, 128, 96, 0, 73, 88, 127, 89, |
| 366 | 184, 0, 47, 184, 73, 88, 127, 89, 96, 0, |
| 367 | 53, 88, 128, 96, 128, 96, 128, 89, 184, 0, |
| 368 | 0, 53, 88, 185, 130, 128, 96, 128, 89, 184, |
| 369 | 0, 54, 98, 96, 0, 45, 96, 0, 41, 96, |
| 370 | 0, 61, 128, 96, 0, 0, 92, 186, 188, 93, |
| 371 | 0, 92, 188, 93, 0, 188, 189, 0, 0, 130, |
| 372 | 0, 184, 0, 49, 184, 0, 0, 192, 0, 191, |
| 373 | 192, 0, 191, 96, 0, 130, 0, 193, 0, 0, |
| 374 | 0, 131, 136, 194, 196, 195, 187, 0, 196, 130, |
| 375 | 0, 0, 197, 198, 0, 0, 77, 88, 88, 199, |
| 376 | 89, 89, 0, 199, 200, 0, 0, 44, 0, 98, |
| 377 | 0, 0, 0, 98, 88, 201, 105, 202, 89, 0 |
| 378 | }; |
| 379 | |
| 380 | #endif |
| 381 | |
| 382 | #if YYDEBUG |
| 383 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ |
| 384 | static const short yyrline[] = |
| 385 | { |
| 386 | 0, 326, 333, 335, 338, 340, 348, 363, 368, 371, |
| 387 | 374, 377, 380, 385, 387, 390, 393, 399, 408, 413, |
| 388 | 416, 425, 425, 427, 427, 429, 436, 445, 447, 450, |
| 389 | 452, 455, 458, 466, 468, 469, 470, 471, 472, 473, |
| 390 | 476, 478, 486, 488, 493, 495, 496, 499, 501, 506, |
| 391 | 508, 511, 513, 518, 520, 523, 525, 530, 532, 533, |
| 392 | 534, 537, 539, 544, 546, 549, 551, 556, 558, 563, |
| 393 | 565, 570, 572, 577, 579, 584, 586, 591, 593, 598, |
| 394 | 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, |
| 395 | 612, 614, 619, 621, 624, 630, 646, 653, 668, 671, |
| 396 | 685, 699, 704, 706, 711, 713, 716, 722, 729, 733, |
| 397 | 737, 737, 748, 750, 751, 752, 753, 758, 763, 764, |
| 398 | 765, 773, 775, 776, 777, 778, 779, 780, 781, 782, |
| 399 | 783, 784, 785, 786, 797, 804, 809, 816, 818, 821, |
| 400 | 827, 834, 847, 854, 858, 872, 876, 880, 885, 887, |
| 401 | 892, 898, 905, 907, 919, 931, 938, 942, 948, 954, |
| 402 | 968, 974, 984, 986, 987, 992, 998, 1000, 1003, 1009, |
| 403 | 1012, 1019, 1022, 1039, 1051, 1065, 1067, 1068, 1071, 1075, |
| 404 | 1080, 1087, 1089, 1093, 1095, 1101, 1113, 1126, 1128, 1129, |
| 405 | 1132, 1134, 1137, 1143, 1149, 1157, 1167, 1182, 1184, 1187, |
| 406 | 1198, 1211, 1224, 1228, 1245, 1257, 1271, 1273, 1280, 1282, |
| 407 | 1289, 1291, 1300, 1306, 1313, 1315, 1318, 1324, 1330, 1335, |
| 408 | 1341, 1353, 1356, 1362, 1368, 1375, 1385, 1394, 1401, 1407, |
| 409 | 1415, 1422, 1428, 1435, 1442, 1453, 1453, 1467, 1473, 1478, |
| 410 | 1483, 1489, 1489, 1501, 1512, 1517, 1523, 1531, 1535, 1537, |
| 411 | 1542, 1548, 1553, 1558, 1565, 1576, 1576, 1576, 1675, 1680, |
| 412 | 1688, 1690, 1693, 1701, 1703, 1706, 1708, 1709, 1709, 1709 |
| 413 | }; |
| 414 | #endif |
| 415 | |
| 416 | |
| 417 | #if (YYDEBUG) || defined YYERROR_VERBOSE |
| 418 | |
| 419 | /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */ |
| 420 | static const char *const yytname[] = |
| 421 | { |
| 422 | "$", "error", "$undefined.", "\"->\"", "\"++\"", "\"--\"", "\"<<\"", |
| 423 | "\">>\"", "\"<=\"", "\">=\"", "\"==\"", "\"!=\"", "\"&&\"", "\"||\"", |
| 424 | "\"*=\"", "\"/=\"", "\"%=\"", "\"+=\"", "\"-=\"", "\"<<=\"", "\">>=\"", |
| 425 | "\"&=\"", "\"^=\"", "\"|=\"", "\"...\"", "'&'", "'*'", "'+'", "'-'", |
| 426 | "'~'", "'!'", "'/'", "'%'", "'<'", "'>'", "'^'", "'|'", "','", "'='", |
| 427 | "'.'", "\"auto\"", "\"break\"", "\"case\"", "\"char\"", "\"const\"", |
| 428 | "\"continue\"", "\"default\"", "\"do\"", "\"double\"", "\"else\"", |
| 429 | "\"enum\"", "\"extern\"", "\"float\"", "\"for\"", "\"goto\"", "\"if\"", |
| 430 | "\"inline\"", "\"int\"", "\"long\"", "\"register\"", "\"restrict\"", |
| 431 | "\"return\"", "\"short\"", "\"signed\"", "\"sizeof\"", "\"static\"", |
| 432 | "\"struct\"", "\"switch\"", "\"typedef\"", "\"union\"", "\"unsigned\"", |
| 433 | "\"void\"", "\"volatile\"", "\"while\"", "\"_Bool\"", "\"_Complex\"", |
| 434 | "\"_Imaginary\"", "\"__attribute__\"", "\"__builtin_va_list\"", |
| 435 | "\"__builtin_va_arg\"", "\"__builtin_expect\"", "TYPEDEF_NAME", "ID", |
| 436 | "NUMBER", "STRINGLIT", "CHARLIT", "WSTRINGLIT", "WCHARLIT", "'('", |
| 437 | "')'", "'['", "']'", "'{'", "'}'", "'?'", "':'", "';'", "main", |
| 438 | "identifier", "identifier_opt", "primary_expression", |
| 439 | "postfix_expression", "member_operator", "incrdecr", |
| 440 | "argument_expression_list", "argument_expression_list_opt", |
| 441 | "unary_expression", "unary_operator", "cast_expression", |
| 442 | "multiplicative_expression", "multiplicative_operator", |
| 443 | "additive_expression", "additive_operator", "shift_expression", |
| 444 | "shift_operator", "relational_expression", "relational_operator", |
| 445 | "equality_expression", "equality_operator", "AND_expression", |
| 446 | "exclusive_OR_expression", "inclusive_OR_expression", |
| 447 | "logical_AND_expression", "logical_OR_expression", |
| 448 | "conditional_expression", "assignment_expression", |
| 449 | "assignment_operator", "expression", "expression_opt", |
| 450 | "constant_expression", "declaration", "declaration_specifiers", |
| 451 | "declaration_specifiers_definition", "declaration_specifiers_opt", |
| 452 | "init_declarator_list_opt", "init_declarator_list", |
| 453 | "attributed_declarator", "attributed_init_declarator", "@1", |
| 454 | "storage_class_specifier", "type_specifier", "basic_type_specifier", |
| 455 | "struct_or_union_specifier", "struct_or_union", |
| 456 | "struct_declaration_list", "struct_declaration", |
| 457 | "specifier_qualifier_list", "specifier_qualifier_list_definition", |
| 458 | "specifier_qualifier_list_opt", "struct_declarator_list", |
| 459 | "struct_declarator", "enum_specifier", "enum", "enumerator_list", |
| 460 | "registered_enumerator", "enumerator", "type_qualifier", |
| 461 | "function_specifier", "declarator_opt", "declarator", |
| 462 | "direct_declarator", "array_size", "array_specifiers", "variadic", |
| 463 | "pointer_opt", "pointer", "type_qualifier_list", |
| 464 | "type_qualifier_list_opt", "parameter_list", |
| 465 | "parameter_declaration_specifiers", "parameter_declaration", |
| 466 | "ID_list_opt", "ID_list", "type_name", "direct_abstract_declarator", |
| 467 | "direct_abstract_declarator_opt", "abstract_declarator_opt", |
| 468 | "abstract_declarator", "initializer", "comma_opt", "initializer_list", |
| 469 | "designated_initializer", "designator_list", "designator", "statement", |
| 470 | "@2", "@3", "function_body", "block_item_list_opt", "block_item", |
| 471 | "else_part_opt", "translation_unit", "external_declaration", |
| 472 | "function_definition", "@4", "@5", "declaration_list_opt", |
| 473 | "attribute_specifier_list", "attribute_specifier", "attribute_list", |
| 474 | "attribute", "@6", "@7", 0 |
| 475 | }; |
| 476 | #endif |
| 477 | |
| 478 | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
| 479 | static const short yyr1[] = |
| 480 | { |
| 481 | 0, 97, 98, 98, 99, 99, 100, 100, 100, 100, |
| 482 | 100, 100, 100, 101, 101, 101, 101, 101, 101, 101, |
| 483 | 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, |
| 484 | 106, 106, 106, 107, 107, 107, 107, 107, 107, 107, |
| 485 | 108, 108, 109, 109, 110, 110, 110, 111, 111, 112, |
| 486 | 112, 113, 113, 114, 114, 115, 115, 116, 116, 116, |
| 487 | 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, |
| 488 | 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, |
| 489 | 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, |
| 490 | 127, 127, 128, 128, 129, 130, 131, 132, 132, 132, |
| 491 | 132, 132, 133, 133, 134, 134, 135, 135, 136, 137, |
| 492 | 138, 137, 139, 139, 139, 139, 139, 140, 140, 140, |
| 493 | 140, 141, 141, 141, 141, 141, 141, 141, 141, 141, |
| 494 | 141, 141, 141, 141, 142, 142, 142, 143, 143, 144, |
| 495 | 144, 145, 146, 147, 147, 147, 147, 147, 148, 148, |
| 496 | 149, 149, 150, 150, 151, 151, 152, 153, 153, 154, |
| 497 | 155, 155, 156, 156, 156, 157, 158, 158, 159, 159, |
| 498 | 160, 160, 160, 160, 160, 161, 161, 161, 162, 162, |
| 499 | 162, 163, 163, 164, 164, 165, 165, 166, 166, 166, |
| 500 | 167, 167, 168, 168, 169, 170, 170, 171, 171, 172, |
| 501 | 172, 173, 174, 174, 174, 174, 175, 175, 176, 176, |
| 502 | 177, 177, 178, 178, 179, 179, 180, 180, 181, 181, |
| 503 | 181, 181, 182, 182, 183, 183, 184, 184, 184, 184, |
| 504 | 184, 184, 184, 184, 184, 185, 184, 184, 184, 184, |
| 505 | 184, 186, 184, 187, 188, 188, 189, 189, 190, 190, |
| 506 | 191, 191, 191, 192, 192, 194, 195, 193, 196, 196, |
| 507 | 197, 197, 198, 199, 199, 200, 200, 201, 202, 200 |
| 508 | }; |
| 509 | |
| 510 | /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ |
| 511 | static const short yyr2[] = |
| 512 | { |
| 513 | 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, |
| 514 | 1, 1, 3, 1, 4, 4, 6, 6, 3, 2, |
| 515 | 7, 1, 1, 1, 1, 1, 3, 1, 0, 1, |
| 516 | 2, 2, 4, 1, 1, 1, 1, 1, 1, 1, |
| 517 | 1, 4, 1, 3, 1, 1, 1, 1, 3, 1, |
| 518 | 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, |
| 519 | 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, |
| 520 | 3, 1, 3, 1, 3, 1, 5, 1, 3, 1, |
| 521 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 522 | 1, 3, 1, 0, 1, 3, 1, 2, 2, 2, |
| 523 | 2, 2, 1, 0, 1, 0, 1, 4, 2, 1, |
| 524 | 0, 4, 1, 1, 1, 1, 1, 1, 1, 1, |
| 525 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 526 | 1, 1, 1, 1, 6, 2, 1, 2, 2, 1, |
| 527 | 2, 3, 1, 2, 2, 2, 2, 2, 1, 0, |
| 528 | 2, 5, 1, 3, 7, 2, 2, 1, 3, 1, |
| 529 | 1, 3, 1, 1, 1, 1, 1, 0, 2, 1, |
| 530 | 1, 4, 5, 4, 5, 1, 1, 0, 1, 2, |
| 531 | 2, 2, 0, 1, 0, 2, 3, 1, 2, 2, |
| 532 | 1, 0, 1, 3, 1, 2, 2, 1, 0, 1, |
| 533 | 3, 2, 4, 5, 3, 5, 1, 0, 1, 0, |
| 534 | 1, 2, 1, 4, 1, 0, 1, 3, 3, 2, |
| 535 | 3, 1, 1, 2, 3, 2, 4, 4, 3, 6, |
| 536 | 5, 2, 5, 7, 9, 0, 9, 3, 2, 2, |
| 537 | 3, 0, 4, 3, 2, 0, 1, 1, 2, 0, |
| 538 | 1, 2, 2, 1, 1, 0, 0, 6, 2, 0, |
| 539 | 2, 0, 6, 2, 0, 1, 1, 0, 0, 6 |
| 540 | }; |
| 541 | |
| 542 | /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE |
| 543 | doesn't specify something else to do. Zero means the default is an |
| 544 | error. */ |
| 545 | static const short yydefact[] = |
| 546 | { |
| 547 | 0, 115, 122, 162, 127, 261, 113, 126, 165, 124, |
| 548 | 125, 116, 163, 123, 128, 114, 261, 112, 261, 129, |
| 549 | 121, 164, 130, 131, 132, 0, 133, 120, 253, 105, |
| 550 | 96, 103, 103, 117, 118, 136, 119, 5, 103, 103, |
| 551 | 1, 250, 254, 103, 156, 137, 138, 0, 191, 170, |
| 552 | 261, 0, 104, 255, 106, 261, 169, 0, 102, 97, |
| 553 | 98, 3, 2, 135, 0, 155, 0, 99, 100, 252, |
| 554 | 251, 101, 260, 264, 187, 190, 185, 0, 95, 261, |
| 555 | 110, 259, 108, 198, 191, 168, 0, 0, 0, 188, |
| 556 | 189, 186, 0, 0, 0, 256, 199, 194, 182, 209, |
| 557 | 192, 0, 197, 191, 177, 190, 178, 149, 149, 0, |
| 558 | 139, 167, 142, 149, 149, 149, 160, 215, 157, 159, |
| 559 | 265, 0, 266, 263, 171, 109, 107, 23, 24, 33, |
| 560 | 34, 35, 36, 37, 38, 0, 0, 0, 6, 7, |
| 561 | 9, 8, 11, 10, 0, 0, 13, 29, 39, 40, |
| 562 | 0, 42, 47, 51, 55, 61, 65, 67, 69, 71, |
| 563 | 73, 75, 77, 212, 111, 258, 105, 0, 0, 0, |
| 564 | 195, 207, 210, 196, 208, 173, 0, 179, 34, 175, |
| 565 | 0, 180, 148, 145, 143, 261, 140, 152, 0, 261, |
| 566 | 0, 261, 144, 146, 147, 0, 214, 0, 262, 267, |
| 567 | 0, 31, 0, 0, 90, 0, 184, 0, 0, 6, |
| 568 | 0, 221, 215, 216, 0, 222, 22, 21, 28, 0, |
| 569 | 0, 19, 80, 81, 82, 83, 84, 85, 86, 87, |
| 570 | 88, 89, 79, 0, 40, 30, 44, 45, 46, 0, |
| 571 | 49, 50, 0, 53, 54, 0, 59, 60, 57, 58, |
| 572 | 0, 63, 64, 0, 0, 0, 0, 0, 0, 0, |
| 573 | 245, 257, 181, 193, 174, 261, 206, 0, 200, 172, |
| 574 | 134, 261, 141, 150, 0, 94, 161, 158, 261, 28, |
| 575 | 0, 0, 0, 0, 12, 183, 201, 0, 225, 0, |
| 576 | 0, 214, 0, 0, 223, 219, 27, 0, 25, 0, |
| 577 | 18, 78, 43, 48, 52, 56, 62, 66, 68, 70, |
| 578 | 72, 74, 0, 93, 184, 0, 191, 167, 153, 154, |
| 579 | 268, 32, 0, 0, 91, 0, 41, 220, 224, 217, |
| 580 | 213, 218, 0, 15, 14, 0, 0, 0, 0, 0, |
| 581 | 93, 0, 0, 0, 93, 0, 0, 120, 6, 241, |
| 582 | 243, 0, 92, 0, 246, 247, 244, 0, 204, 182, |
| 583 | 177, 261, 0, 0, 0, 215, 26, 76, 239, 0, |
| 584 | 238, 93, 0, 235, 0, 0, 0, 0, 0, 245, |
| 585 | 261, 231, 202, 0, 0, 151, 269, 16, 17, 0, |
| 586 | 93, 228, 0, 0, 0, 237, 0, 240, 0, 0, |
| 587 | 93, 93, 205, 203, 20, 227, 0, 93, 93, 93, |
| 588 | 93, 93, 242, 226, 0, 0, 0, 249, 230, 232, |
| 589 | 0, 93, 93, 93, 229, 233, 0, 0, 248, 93, |
| 590 | 93, 234, 236, 0, 0, 0 |
| 591 | }; |
| 592 | |
| 593 | static const short yydefgoto[] = |
| 594 | { |
| 595 | 433, 351, 64, 146, 147, 220, 148, 296, 297, 149, |
| 596 | 150, 151, 152, 239, 153, 242, 154, 245, 155, 250, |
| 597 | 156, 253, 157, 158, 159, 160, 161, 162, 204, 233, |
| 598 | 352, 353, 276, 28, 166, 30, 59, 51, 52, 125, |
| 599 | 54, 94, 31, 32, 33, 34, 35, 109, 110, 206, |
| 600 | 112, 183, 188, 189, 36, 37, 117, 118, 119, 38, |
| 601 | 39, 190, 55, 56, 180, 104, 169, 171, 57, 75, |
| 602 | 106, 98, 99, 100, 101, 102, 207, 266, 267, 173, |
| 603 | 174, 211, 197, 212, 213, 214, 215, 355, 394, 379, |
| 604 | 261, 313, 356, 424, 40, 41, 42, 81, 167, 95, |
| 605 | 82, 43, 88, 123, 279, 362 |
| 606 | }; |
| 607 | |
| 608 | static const short yypact[] = |
| 609 | { |
| 610 | 1198,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, |
| 611 | -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, |
| 612 | -32768,-32768,-32768,-32768,-32768, -50,-32768,-32768,-32768, 14, |
| 613 | -32768, 1198, 1198,-32768,-32768, 42,-32768, 68, 1198, 1198, |
| 614 | 1037,-32768,-32768, 1198, -35, -35, -35, -42, 7,-32768, |
| 615 | -32768, -40, 36, -13,-32768,-32768, 141, -41,-32768,-32768, |
| 616 | -32768,-32768,-32768, 30, 50, 30, 54,-32768,-32768,-32768, |
| 617 | -32768,-32768,-32768,-32768,-32768, 149, 106, 115,-32768,-32768, |
| 618 | -32768,-32768, -35, 1158, 221, 141, 1198, 68, 152,-32768, |
| 619 | -32768,-32768, -1, 115, 752, 1198,-32768,-32768, 114, 9, |
| 620 | -32768, 102, 162, 7, 922, 192,-32768, 1198, 1198, 1079, |
| 621 | -32768, 14,-32768, 1198, 1198, 1198, 178, 185,-32768,-32768, |
| 622 | -32768, 139, 144,-32768,-32768, 197,-32768,-32768,-32768,-32768, |
| 623 | -32768,-32768,-32768,-32768,-32768, 932, 151, 154,-32768,-32768, |
| 624 | -32768,-32768,-32768,-32768, 837, 725,-32768, 89,-32768, 370, |
| 625 | 949,-32768, 271, 160, 62, 250, 239, 243, 211, 236, |
| 626 | 268, 16,-32768,-32768,-32768,-32768, 14, 198, 998, 200, |
| 627 | -32768, 210, -27,-32768,-32768,-32768, 222,-32768, 218,-32768, |
| 628 | 219,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -7,-32768, |
| 629 | 223, 226,-32768,-32768,-32768, 949, 68, 230,-32768,-32768, |
| 630 | 837,-32768, 949, 949,-32768, -9, -4, 235, 68, 231, |
| 631 | 949,-32768, 290,-32768, 147, 752,-32768,-32768, 949, 949, |
| 632 | 68,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, |
| 633 | -32768,-32768,-32768, 949,-32768,-32768,-32768,-32768,-32768, 949, |
| 634 | -32768,-32768, 949,-32768,-32768, 949,-32768,-32768,-32768,-32768, |
| 635 | 949,-32768,-32768, 949, 949, 949, 949, 949, 949, 949, |
| 636 | -32768,-32768,-32768,-32768,-32768,-32768, 22, 225,-32768,-32768, |
| 637 | -35,-32768,-32768, -35, 949,-32768,-32768,-32768,-32768, 949, |
| 638 | 246, 299, 300, 949,-32768, 249,-32768, 766,-32768, 752, |
| 639 | 248, 725, 247, 752,-32768,-32768, 304, 254,-32768, 15, |
| 640 | -32768,-32768,-32768, 271, 160, 62, 250, 239, 243, 211, |
| 641 | 236, 268, 41, 415, 27, 1118, 221, 115,-32768, -35, |
| 642 | -32768, 252, 1198, 949,-32768, 725,-32768,-32768,-32768,-32768, |
| 643 | -32768,-32768, 949,-32768,-32768, 949, 255, 949, 257, 251, |
| 644 | 655, 262, 68, 264, 949, 266, 267, 265, 269,-32768, |
| 645 | -32768, 270, 308, 261,-32768,-32768,-32768, 272,-32768, 114, |
| 646 | 922,-32768, 274, 277, 285, 290,-32768,-32768,-32768, 281, |
| 647 | -32768, 655, 286, 343, 282, 949, 283, 949, 949,-32768, |
| 648 | -32768,-32768,-32768, 288, 289, -35,-32768,-32768,-32768, 301, |
| 649 | 655,-32768, 293, 302, 1198,-32768, 40,-32768, 118, 128, |
| 650 | 500, 585,-32768,-32768,-32768,-32768, 949, 949, 949, 655, |
| 651 | 655, 655,-32768,-32768, 134, 303, 305, 333,-32768,-32768, |
| 652 | 306, 949, 949, 655,-32768,-32768, 307, 311,-32768, 655, |
| 653 | 655,-32768,-32768, 395, 397,-32768 |
| 654 | }; |
| 655 | |
| 656 | static const short yypgoto[] = |
| 657 | { |
| 658 | -32768, -30, 366,-32768,-32768,-32768, 258,-32768, 125, 75, |
| 659 | -32768, -123, 164,-32768, 166,-32768, 159,-32768, 161,-32768, |
| 660 | 163,-32768, 158, 165, 167, 157,-32768, -174, -85,-32768, |
| 661 | -124, -130, -192, -89, 4, 256, 224,-32768,-32768, -21, |
| 662 | 323,-32768, 12, 45,-32768,-32768,-32768,-32768, 309, -55, |
| 663 | 193, 105,-32768, 116,-32768,-32768,-32768, 238,-32768, 0, |
| 664 | 61,-32768, -62, -34, 72, 119, 77,-32768, -66, -72, |
| 665 | -22, 122,-32768, 278,-32768,-32768, -183,-32768,-32768, 232, |
| 666 | 133, -78, -198, 123, 173,-32768, 237, -228,-32768,-32768, |
| 667 | -32768, 70,-32768,-32768,-32768, 410,-32768,-32768,-32768,-32768, |
| 668 | -5, -43,-32768,-32768,-32768,-32768 |
| 669 | }; |
| 670 | |
| 671 | |
| 672 | #define YYLAST 1279 |
| 673 | |
| 674 | |
| 675 | static const short yytable[] = |
| 676 | { |
| 677 | 44, 72, 72, 72, 29, 63, 165, 65, 53, 163, |
| 678 | 91, 45, 105, 46, 292, 92, 164, 280, 290, 179, |
| 679 | 205, 275, 48, 85, -109, 80, 76, 235, 283, 258, |
| 680 | 271, 111, 90, 172, 72, 48, 275, 170, 47, 72, |
| 681 | 48, 49, 25, 115, 29, 77, 73, 50, 74, 191, |
| 682 | 72, 3, 283, 48, 111, 49, 78, 116, 122, -211, |
| 683 | 163, 50, 90, -183, 115, 115, 115, 12, 243, 244, |
| 684 | 115, 115, 115, 79, 93, 89, 205, 283, 283, 21, |
| 685 | 284, 177, 318, -109, 74, -209, 113, 97, 124, 272, |
| 686 | 187, 49, 216, 127, 128, 299, 49, 50, 107, -184, |
| 687 | 275, 115, 50, 74, 25, 89, 334, 113, 113, 113, |
| 688 | 259, -211, 372, 113, 113, 113, 302, 281, 282, 107, |
| 689 | 107, 107, -4, 61, 62, 107, 107, 107, 217, 409, |
| 690 | 163, 108, 48, 298, -5, 312, 335, 295, 85, 363, |
| 691 | 285, 48, 86, 391, 113, 369, 87, 114, 301, 61, |
| 692 | 62, 168, 108, 108, 108, 283, 107, 115, 108, 108, |
| 693 | 108, 367, 405, 275, 326, 283, 116, 389, 114, 114, |
| 694 | 114, 283, 97, 413, 114, 114, 114, 218, 288, 219, |
| 695 | 270, 417, 418, 419, 273, 293, 208, 240, 241, 108, |
| 696 | 300, 175, 25, 3, 298, 428, 120, 49, 324, 176, |
| 697 | 113, 431, 432, 50, 163, 114, 163, 410, 163, 12, |
| 698 | 201, 327, 107, 184, 376, 331, 195, 411, 192, 193, |
| 699 | 194, 21, 196, 420, 354, 234, 25, 72, 198, 83, |
| 700 | 72, 84, 199, 61, 62, 80, 3, 210, 364, 202, |
| 701 | 163, 121, 203, 393, 105, 108, 255, 366, 285, 251, |
| 702 | 252, 396, 12, 398, 399, 191, 60, 181, 246, 247, |
| 703 | 314, 114, 67, 68, 21, 3, 317, 71, 254, 25, |
| 704 | 234, 72, 256, 319, 72, 179, 72, 415, 416, 115, |
| 705 | 257, 12, 414, 248, 249, 234, 103, 58, 58, 264, |
| 706 | 260, 426, 427, 21, 58, 58, 187, 236, 265, 58, |
| 707 | 182, 182, 237, 238, 268, 408, 182, 182, 182, -176, |
| 708 | 269, 354, 374, 315, 234, 316, 74, 234, 274, 97, |
| 709 | 234, -166, 113, 278, 287, 234, 289, 291, 234, 234, |
| 710 | 234, 234, 234, 234, 107, 321, 322, 323, -210, 328, |
| 711 | 330, 332, 72, 333, 325, 283, 371, 127, 128, 234, |
| 712 | 373, 368, 375, 370, 377, 378, 385, 381, 72, 392, |
| 713 | -3, 382, 234, 386, -2, 380, 387, 108, 129, 130, |
| 714 | 131, 132, 133, 134, 388, 401, 390, 402, 395, 397, |
| 715 | 403, 406, 423, 114, 222, 223, 224, 225, 226, 227, |
| 716 | 228, 229, 230, 231, 404, 434, 429, 435, 407, 421, |
| 717 | 430, 422, 425, 66, 320, 221, 303, 135, 232, 305, |
| 718 | 234, 304, 234, 308, 306, 311, 126, 307, 186, 127, |
| 719 | 128, 309, 136, 137, 310, 138, 139, 140, 141, 142, |
| 720 | 143, 144, 384, 361, 277, 360, 383, 359, 286, -93, |
| 721 | 129, 130, 131, 132, 133, 134, 263, 357, 365, 400, |
| 722 | 70, 294, 0, 0, 0, 1, 336, 337, 2, 3, |
| 723 | 338, 339, 340, 4, 329, 5, 6, 7, 341, 342, |
| 724 | 343, 8, 9, 10, 11, 12, 344, 13, 14, 135, |
| 725 | 15, 16, 345, 17, 18, 19, 20, 21, 346, 22, |
| 726 | 23, 24, 25, 26, 136, 137, 347, 348, 139, 140, |
| 727 | 141, 142, 143, 144, 127, 128, 0, 349, 350, 0, |
| 728 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 729 | 0, 0, 0, 0, 0, 129, 130, 131, 132, 133, |
| 730 | 134, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 731 | 1, 336, 337, 2, 3, 338, 339, 340, 4, 0, |
| 732 | 5, 6, 7, 341, 342, 343, 8, 9, 10, 11, |
| 733 | 12, 344, 13, 14, 135, 15, 16, 345, 17, 18, |
| 734 | 19, 20, 21, 346, 22, 23, 24, 25, 26, 136, |
| 735 | 137, 347, 348, 139, 140, 141, 142, 143, 144, 127, |
| 736 | 128, 0, 349, 412, 0, 0, 0, 0, 0, 0, |
| 737 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 738 | 129, 130, 131, 132, 133, 134, 0, 0, 0, 0, |
| 739 | 0, 0, 0, 0, 0, 0, 336, 337, 0, 0, |
| 740 | 338, 339, 340, 0, 0, 0, 0, 0, 341, 342, |
| 741 | 343, 0, 0, 0, 0, 0, 344, 0, 0, 135, |
| 742 | 0, 0, 345, 0, 0, 0, 0, 0, 346, 127, |
| 743 | 128, 0, 25, 0, 136, 137, 61, 348, 139, 140, |
| 744 | 141, 142, 143, 144, 0, 0, 0, 349, 0, 0, |
| 745 | 129, 130, 131, 132, 133, 134, 0, 0, 0, 0, |
| 746 | 0, 0, 0, 0, 0, 0, 336, 337, 0, 0, |
| 747 | 338, 339, 340, 0, 0, 0, 0, 0, 341, 342, |
| 748 | 343, 0, 0, 0, 0, 0, 344, 0, 0, 135, |
| 749 | 0, 0, 345, 0, 0, 0, 0, 0, 346, 127, |
| 750 | 128, 0, 0, 0, 136, 137, 61, 348, 139, 140, |
| 751 | 141, 142, 143, 144, 0, 0, 0, 349, 0, 0, |
| 752 | 129, 130, 131, 132, 133, 134, 127, 128, 0, 0, |
| 753 | 0, 0, 0, 0, 208, 0, 0, 0, 0, 0, |
| 754 | 127, 128, 0, 0, 0, 0, 0, 129, 130, 131, |
| 755 | 132, 133, 134, 0, 0, 0, 0, 0, 0, 135, |
| 756 | 0, 129, 130, 131, 132, 133, 134, 0, 0, 0, |
| 757 | 0, 0, 0, 0, 136, 137, 0, 209, 139, 140, |
| 758 | 141, 142, 143, 144, 0, 210, 135, 145, 0, 0, |
| 759 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 760 | 135, 136, 137, 0, 138, 139, 140, 141, 142, 143, |
| 761 | 144, 127, 128, 0, 145, 136, 137, 0, 138, 139, |
| 762 | 140, 141, 142, 143, 144, 0, 0, 0, 325, 0, |
| 763 | 0, 0, 129, 130, 131, 132, 133, 134, 0, 0, |
| 764 | 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, |
| 765 | 2, 3, 0, 0, 0, 4, 0, 5, 6, 7, |
| 766 | 0, 0, 0, 8, 9, 10, 11, 12, 0, 13, |
| 767 | 14, 135, 15, 16, 0, 17, 18, 19, 20, 21, |
| 768 | 0, 22, 23, 24, 25, 26, 136, 137, 27, 138, |
| 769 | 139, 140, 141, 142, 143, 144, 127, 128, 0, 0, |
| 770 | 0, 0, 0, 0, 0, 0, 127, 128, 0, 0, |
| 771 | 0, 0, 0, 0, 0, 0, 0, 129, 178, 131, |
| 772 | 132, 133, 134, 127, 128, 0, 0, 129, 130, 131, |
| 773 | 132, 133, 134, 0, 0, 0, 0, 0, 0, 0, |
| 774 | 0, 0, 0, 0, 129, 130, 131, 132, 133, 134, |
| 775 | 0, 0, 0, 0, 0, 0, 135, 0, 0, 0, |
| 776 | 0, 0, 0, 0, 0, 0, 135, 0, 0, 0, |
| 777 | 0, 136, 137, 0, 138, 139, 140, 141, 142, 143, |
| 778 | 144, 136, 137, 135, 138, 139, 140, 141, 142, 143, |
| 779 | 200, 0, 262, 0, 0, 0, 0, 0, 136, 137, |
| 780 | 0, 138, 139, 140, 141, 142, 143, 144, 1, 0, |
| 781 | 0, 2, 3, 0, 0, 0, 4, 0, 5, 6, |
| 782 | 7, 0, 0, 0, 8, 9, 10, 11, 12, 0, |
| 783 | 13, 14, 0, 15, 16, 0, 17, 18, 19, 20, |
| 784 | 21, 0, 22, 23, 24, 25, 26, 1, 0, 27, |
| 785 | 2, 3, 0, 0, 0, 4, 0, 5, 6, 7, |
| 786 | 0, 0, 0, 8, 9, 10, 11, 12, 0, 13, |
| 787 | 14, 0, 15, 16, 0, 17, 18, 19, 20, 21, |
| 788 | 0, 22, 23, 24, 25, 26, 0, 0, 27, 1, |
| 789 | 0, 0, 2, 3, 0, 0, 0, 4, 0, 5, |
| 790 | 6, 7, 0, 69, 0, 8, 9, 10, 11, 12, |
| 791 | 0, 13, 14, 0, 15, 16, 0, 17, 18, 19, |
| 792 | 20, 21, 0, 22, 23, 24, 25, 26, 1, 0, |
| 793 | 27, 2, 3, 0, 0, 0, 4, 0, 5, 6, |
| 794 | 7, 0, 185, 0, 8, 9, 10, 11, 12, 0, |
| 795 | 13, 14, 0, 15, 16, 0, 17, 18, 19, 20, |
| 796 | 21, 0, 22, 23, 24, 25, 26, 0, 1, 27, |
| 797 | 0, 2, 3, 0, 0, 0, 4, 358, 5, 6, |
| 798 | 7, 0, 0, 0, 8, 9, 10, 11, 12, 0, |
| 799 | 13, 14, 0, 15, 16, 0, 17, 18, 19, 20, |
| 800 | 21, 0, 22, 23, 24, 25, 26, 0, 1, 27, |
| 801 | 96, 2, 3, 0, 0, 0, 4, 0, 5, 6, |
| 802 | 7, 0, 0, 0, 8, 9, 10, 11, 12, 0, |
| 803 | 13, 14, 0, 15, 16, 0, 17, 18, 19, 20, |
| 804 | 21, 0, 22, 23, 24, 25, 26, 0, 0, 27 |
| 805 | }; |
| 806 | |
| 807 | static const short yycheck[] = |
| 808 | { |
| 809 | 5, 44, 45, 46, 0, 35, 95, 37, 29, 94, |
| 810 | 76, 16, 84, 18, 212, 77, 94, 200, 210, 104, |
| 811 | 144, 195, 26, 57, 37, 38, 48, 150, 37, 13, |
| 812 | 37, 86, 75, 99, 77, 26, 210, 99, 88, 82, |
| 813 | 26, 82, 77, 86, 40, 50, 88, 88, 48, 111, |
| 814 | 93, 44, 37, 26, 109, 82, 96, 87, 88, 37, |
| 815 | 145, 88, 105, 90, 107, 108, 109, 60, 6, 7, |
| 816 | 113, 114, 115, 37, 79, 75, 200, 37, 37, 72, |
| 817 | 89, 103, 274, 96, 84, 89, 86, 83, 89, 96, |
| 818 | 111, 82, 3, 4, 5, 219, 82, 88, 86, 90, |
| 819 | 274, 144, 88, 103, 77, 105, 91, 107, 108, 109, |
| 820 | 94, 89, 340, 113, 114, 115, 239, 202, 203, 107, |
| 821 | 108, 109, 92, 81, 82, 113, 114, 115, 39, 89, |
| 822 | 215, 86, 26, 218, 92, 259, 95, 215, 172, 322, |
| 823 | 206, 26, 92, 371, 144, 337, 92, 86, 233, 81, |
| 824 | 82, 37, 107, 108, 109, 37, 144, 200, 113, 114, |
| 825 | 115, 335, 390, 337, 287, 37, 196, 365, 107, 108, |
| 826 | 109, 37, 168, 401, 113, 114, 115, 88, 208, 90, |
| 827 | 185, 409, 410, 411, 189, 38, 39, 27, 28, 144, |
| 828 | 220, 89, 77, 44, 279, 423, 44, 82, 283, 37, |
| 829 | 200, 429, 430, 88, 289, 144, 291, 89, 293, 60, |
| 830 | 135, 289, 200, 108, 344, 293, 38, 89, 113, 114, |
| 831 | 115, 72, 37, 89, 313, 150, 77, 270, 89, 88, |
| 832 | 273, 90, 88, 81, 82, 38, 44, 90, 323, 88, |
| 833 | 325, 89, 88, 373, 316, 200, 35, 332, 314, 10, |
| 834 | 11, 375, 60, 377, 378, 317, 32, 65, 8, 9, |
| 835 | 265, 200, 38, 39, 72, 44, 271, 43, 25, 77, |
| 836 | 195, 314, 36, 278, 317, 360, 319, 407, 408, 322, |
| 837 | 12, 60, 406, 33, 34, 210, 65, 31, 32, 89, |
| 838 | 92, 421, 422, 72, 38, 39, 317, 26, 88, 43, |
| 839 | 107, 108, 31, 32, 82, 394, 113, 114, 115, 91, |
| 840 | 91, 400, 342, 88, 239, 90, 316, 242, 95, 315, |
| 841 | 245, 95, 322, 93, 89, 250, 95, 37, 253, 254, |
| 842 | 255, 256, 257, 258, 322, 89, 37, 37, 89, 91, |
| 843 | 93, 37, 385, 89, 92, 37, 95, 4, 5, 274, |
| 844 | 88, 96, 88, 96, 88, 88, 361, 96, 401, 73, |
| 845 | 95, 89, 287, 89, 95, 95, 89, 322, 25, 26, |
| 846 | 27, 28, 29, 30, 89, 380, 95, 89, 96, 96, |
| 847 | 91, 88, 49, 322, 14, 15, 16, 17, 18, 19, |
| 848 | 20, 21, 22, 23, 93, 0, 89, 0, 96, 96, |
| 849 | 89, 96, 96, 37, 279, 147, 242, 64, 38, 250, |
| 850 | 335, 245, 337, 255, 253, 258, 93, 254, 109, 4, |
| 851 | 5, 256, 79, 80, 257, 82, 83, 84, 85, 86, |
| 852 | 87, 88, 360, 317, 196, 316, 359, 315, 206, 96, |
| 853 | 25, 26, 27, 28, 29, 30, 168, 314, 325, 379, |
| 854 | 40, 214, -1, -1, -1, 40, 41, 42, 43, 44, |
| 855 | 45, 46, 47, 48, 291, 50, 51, 52, 53, 54, |
| 856 | 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, |
| 857 | 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
| 858 | 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, |
| 859 | 85, 86, 87, 88, 4, 5, -1, 92, 93, -1, |
| 860 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| 861 | -1, -1, -1, -1, -1, 25, 26, 27, 28, 29, |
| 862 | 30, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| 863 | 40, 41, 42, 43, 44, 45, 46, 47, 48, -1, |
| 864 | 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, |
| 865 | 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, |
| 866 | 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, |
| 867 | 80, 81, 82, 83, 84, 85, 86, 87, 88, 4, |
| 868 | 5, -1, 92, 93, -1, -1, -1, -1, -1, -1, |
| 869 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| 870 | 25, 26, 27, 28, 29, 30, -1, -1, -1, -1, |
| 871 | -1, -1, -1, -1, -1, -1, 41, 42, -1, -1, |
| 872 | 45, 46, 47, -1, -1, -1, -1, -1, 53, 54, |
| 873 | 55, -1, -1, -1, -1, -1, 61, -1, -1, 64, |
| 874 | -1, -1, 67, -1, -1, -1, -1, -1, 73, 4, |
| 875 | 5, -1, 77, -1, 79, 80, 81, 82, 83, 84, |
| 876 | 85, 86, 87, 88, -1, -1, -1, 92, -1, -1, |
| 877 | 25, 26, 27, 28, 29, 30, -1, -1, -1, -1, |
| 878 | -1, -1, -1, -1, -1, -1, 41, 42, -1, -1, |
| 879 | 45, 46, 47, -1, -1, -1, -1, -1, 53, 54, |
| 880 | 55, -1, -1, -1, -1, -1, 61, -1, -1, 64, |
| 881 | -1, -1, 67, -1, -1, -1, -1, -1, 73, 4, |
| 882 | 5, -1, -1, -1, 79, 80, 81, 82, 83, 84, |
| 883 | 85, 86, 87, 88, -1, -1, -1, 92, -1, -1, |
| 884 | 25, 26, 27, 28, 29, 30, 4, 5, -1, -1, |
| 885 | -1, -1, -1, -1, 39, -1, -1, -1, -1, -1, |
| 886 | 4, 5, -1, -1, -1, -1, -1, 25, 26, 27, |
| 887 | 28, 29, 30, -1, -1, -1, -1, -1, -1, 64, |
| 888 | -1, 25, 26, 27, 28, 29, 30, -1, -1, -1, |
| 889 | -1, -1, -1, -1, 79, 80, -1, 82, 83, 84, |
| 890 | 85, 86, 87, 88, -1, 90, 64, 92, -1, -1, |
| 891 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| 892 | 64, 79, 80, -1, 82, 83, 84, 85, 86, 87, |
| 893 | 88, 4, 5, -1, 92, 79, 80, -1, 82, 83, |
| 894 | 84, 85, 86, 87, 88, -1, -1, -1, 92, -1, |
| 895 | -1, -1, 25, 26, 27, 28, 29, 30, -1, -1, |
| 896 | -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, |
| 897 | 43, 44, -1, -1, -1, 48, -1, 50, 51, 52, |
| 898 | -1, -1, -1, 56, 57, 58, 59, 60, -1, 62, |
| 899 | 63, 64, 65, 66, -1, 68, 69, 70, 71, 72, |
| 900 | -1, 74, 75, 76, 77, 78, 79, 80, 81, 82, |
| 901 | 83, 84, 85, 86, 87, 88, 4, 5, -1, -1, |
| 902 | -1, -1, -1, -1, -1, -1, 4, 5, -1, -1, |
| 903 | -1, -1, -1, -1, -1, -1, -1, 25, 26, 27, |
| 904 | 28, 29, 30, 4, 5, -1, -1, 25, 26, 27, |
| 905 | 28, 29, 30, -1, -1, -1, -1, -1, -1, -1, |
| 906 | -1, -1, -1, -1, 25, 26, 27, 28, 29, 30, |
| 907 | -1, -1, -1, -1, -1, -1, 64, -1, -1, -1, |
| 908 | -1, -1, -1, -1, -1, -1, 64, -1, -1, -1, |
| 909 | -1, 79, 80, -1, 82, 83, 84, 85, 86, 87, |
| 910 | 88, 79, 80, 64, 82, 83, 84, 85, 86, 87, |
| 911 | 88, -1, 24, -1, -1, -1, -1, -1, 79, 80, |
| 912 | -1, 82, 83, 84, 85, 86, 87, 88, 40, -1, |
| 913 | -1, 43, 44, -1, -1, -1, 48, -1, 50, 51, |
| 914 | 52, -1, -1, -1, 56, 57, 58, 59, 60, -1, |
| 915 | 62, 63, -1, 65, 66, -1, 68, 69, 70, 71, |
| 916 | 72, -1, 74, 75, 76, 77, 78, 40, -1, 81, |
| 917 | 43, 44, -1, -1, -1, 48, -1, 50, 51, 52, |
| 918 | -1, -1, -1, 56, 57, 58, 59, 60, -1, 62, |
| 919 | 63, -1, 65, 66, -1, 68, 69, 70, 71, 72, |
| 920 | -1, 74, 75, 76, 77, 78, -1, -1, 81, 40, |
| 921 | -1, -1, 43, 44, -1, -1, -1, 48, -1, 50, |
| 922 | 51, 52, -1, 96, -1, 56, 57, 58, 59, 60, |
| 923 | -1, 62, 63, -1, 65, 66, -1, 68, 69, 70, |
| 924 | 71, 72, -1, 74, 75, 76, 77, 78, 40, -1, |
| 925 | 81, 43, 44, -1, -1, -1, 48, -1, 50, 51, |
| 926 | 52, -1, 93, -1, 56, 57, 58, 59, 60, -1, |
| 927 | 62, 63, -1, 65, 66, -1, 68, 69, 70, 71, |
| 928 | 72, -1, 74, 75, 76, 77, 78, -1, 40, 81, |
| 929 | -1, 43, 44, -1, -1, -1, 48, 89, 50, 51, |
| 930 | 52, -1, -1, -1, 56, 57, 58, 59, 60, -1, |
| 931 | 62, 63, -1, 65, 66, -1, 68, 69, 70, 71, |
| 932 | 72, -1, 74, 75, 76, 77, 78, -1, 40, 81, |
| 933 | 82, 43, 44, -1, -1, -1, 48, -1, 50, 51, |
| 934 | 52, -1, -1, -1, 56, 57, 58, 59, 60, -1, |
| 935 | 62, 63, -1, 65, 66, -1, 68, 69, 70, 71, |
| 936 | 72, -1, 74, 75, 76, 77, 78, -1, -1, 81 |
| 937 | }; |
| 938 | /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ |
| 939 | #line 3 "/usr/share/bison/bison.simple" |
| 940 | |
| 941 | /* Skeleton output parser for bison, |
| 942 | |
| 943 | Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software |
| 944 | Foundation, Inc. |
| 945 | |
| 946 | This program is free software; you can redistribute it and/or modify |
| 947 | it under the terms of the GNU General Public License as published by |
| 948 | the Free Software Foundation; either version 2, or (at your option) |
| 949 | any later version. |
| 950 | |
| 951 | This program is distributed in the hope that it will be useful, |
| 952 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 953 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 954 | GNU General Public License for more details. |
| 955 | |
| 956 | You should have received a copy of the GNU General Public License |
| 957 | along with this program; if not, write to the Free Software |
| 958 | Foundation, Inc., 59 Temple Place - Suite 330, |
| 959 | Boston, MA 02111-1307, USA. */ |
| 960 | |
| 961 | /* As a special exception, when this file is copied by Bison into a |
| 962 | Bison output file, you may use that output file without restriction. |
| 963 | This special exception was added by the Free Software Foundation |
| 964 | in version 1.24 of Bison. */ |
| 965 | |
| 966 | /* This is the parser code that is written into each bison parser when |
| 967 | the %semantic_parser declaration is not specified in the grammar. |
| 968 | It was written by Richard Stallman by simplifying the hairy parser |
| 969 | used when %semantic_parser is specified. */ |
| 970 | |
| 971 | /* All symbols defined below should begin with yy or YY, to avoid |
| 972 | infringing on user name space. This should be done even for local |
| 973 | variables, as they might otherwise be expanded by user macros. |
| 974 | There are some unavoidable exceptions within include files to |
| 975 | define necessary library symbols; they are noted "INFRINGES ON |
| 976 | USER NAME SPACE" below. */ |
| 977 | |
| 978 | #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE) |
| 979 | |
| 980 | /* The parser invokes alloca or malloc; define the necessary symbols. */ |
| 981 | |
| 982 | # if YYSTACK_USE_ALLOCA |
| 983 | # define YYSTACK_ALLOC alloca |
| 984 | # else |
| 985 | # ifndef YYSTACK_USE_ALLOCA |
| 986 | # if defined (alloca) || defined (_ALLOCA_H) |
| 987 | # define YYSTACK_ALLOC alloca |
| 988 | # else |
| 989 | # ifdef __GNUC__ |
| 990 | # define YYSTACK_ALLOC __builtin_alloca |
| 991 | # endif |
| 992 | # endif |
| 993 | # endif |
| 994 | # endif |
| 995 | |
| 996 | # ifdef YYSTACK_ALLOC |
| 997 | /* Pacify GCC's `empty if-body' warning. */ |
| 998 | # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) |
| 999 | # else |
| 1000 | # if defined (__STDC__) || defined (__cplusplus) |
| 1001 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
| 1002 | # define YYSIZE_T size_t |
| 1003 | # endif |
| 1004 | # define YYSTACK_ALLOC malloc |
| 1005 | # define YYSTACK_FREE free |
| 1006 | # endif |
| 1007 | #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */ |
| 1008 | |
| 1009 | |
| 1010 | #if (! defined (yyoverflow) \ |
| 1011 | && (! defined (__cplusplus) \ |
| 1012 | || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) |
| 1013 | |
| 1014 | /* A type that is properly aligned for any stack member. */ |
| 1015 | union yyalloc |
| 1016 | { |
| 1017 | short yyss; |
| 1018 | YYSTYPE yyvs; |
| 1019 | # if YYLSP_NEEDED |
| 1020 | YYLTYPE yyls; |
| 1021 | # endif |
| 1022 | }; |
| 1023 | |
| 1024 | /* The size of the maximum gap between one aligned stack and the next. */ |
| 1025 | # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) |
| 1026 | |
| 1027 | /* The size of an array large to enough to hold all stacks, each with |
| 1028 | N elements. */ |
| 1029 | # if YYLSP_NEEDED |
| 1030 | # define YYSTACK_BYTES(N) \ |
| 1031 | ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ |
| 1032 | + 2 * YYSTACK_GAP_MAX) |
| 1033 | # else |
| 1034 | # define YYSTACK_BYTES(N) \ |
| 1035 | ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ |
| 1036 | + YYSTACK_GAP_MAX) |
| 1037 | # endif |
| 1038 | |
| 1039 | /* Copy COUNT objects from FROM to TO. The source and destination do |
| 1040 | not overlap. */ |
| 1041 | # ifndef YYCOPY |
| 1042 | # if 1 < __GNUC__ |
| 1043 | # define YYCOPY(To, From, Count) \ |
| 1044 | __builtin_memcpy (To, From, (Count) * sizeof (*(From))) |
| 1045 | # else |
| 1046 | # define YYCOPY(To, From, Count) \ |
| 1047 | do \ |
| 1048 | { \ |
| 1049 | register YYSIZE_T yyi; \ |
| 1050 | for (yyi = 0; yyi < (Count); yyi++) \ |
| 1051 | (To)[yyi] = (From)[yyi]; \ |
| 1052 | } \ |
| 1053 | while (0) |
| 1054 | # endif |
| 1055 | # endif |
| 1056 | |
| 1057 | /* Relocate STACK from its old location to the new one. The |
| 1058 | local variables YYSIZE and YYSTACKSIZE give the old and new number of |
| 1059 | elements in the stack, and YYPTR gives the new location of the |
| 1060 | stack. Advance YYPTR to a properly aligned location for the next |
| 1061 | stack. */ |
| 1062 | # define YYSTACK_RELOCATE(Stack) \ |
| 1063 | do \ |
| 1064 | { \ |
| 1065 | YYSIZE_T yynewbytes; \ |
| 1066 | YYCOPY (&yyptr->Stack, Stack, yysize); \ |
| 1067 | Stack = &yyptr->Stack; \ |
| 1068 | yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ |
| 1069 | yyptr += yynewbytes / sizeof (*yyptr); \ |
| 1070 | } \ |
| 1071 | while (0) |
| 1072 | |
| 1073 | #endif |
| 1074 | |
| 1075 | |
| 1076 | #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) |
| 1077 | # define YYSIZE_T __SIZE_TYPE__ |
| 1078 | #endif |
| 1079 | #if ! defined (YYSIZE_T) && defined (size_t) |
| 1080 | # define YYSIZE_T size_t |
| 1081 | #endif |
| 1082 | #if ! defined (YYSIZE_T) |
| 1083 | # if defined (__STDC__) || defined (__cplusplus) |
| 1084 | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
| 1085 | # define YYSIZE_T size_t |
| 1086 | # endif |
| 1087 | #endif |
| 1088 | #if ! defined (YYSIZE_T) |
| 1089 | # define YYSIZE_T unsigned int |
| 1090 | #endif |
| 1091 | |
| 1092 | #define yyerrok (yyerrstatus = 0) |
| 1093 | #define yyclearin (yychar = YYEMPTY) |
| 1094 | #define YYEMPTY -2 |
| 1095 | #define YYEOF 0 |
| 1096 | #define YYACCEPT goto yyacceptlab |
| 1097 | #define YYABORT goto yyabortlab |
| 1098 | #define YYERROR goto yyerrlab1 |
| 1099 | /* Like YYERROR except do call yyerror. This remains here temporarily |
| 1100 | to ease the transition to the new meaning of YYERROR, for GCC. |
| 1101 | Once GCC version 2 has supplanted version 1, this can go. */ |
| 1102 | #define YYFAIL goto yyerrlab |
| 1103 | #define YYRECOVERING() (!!yyerrstatus) |
| 1104 | #define YYBACKUP(Token, Value) \ |
| 1105 | do \ |
| 1106 | if (yychar == YYEMPTY && yylen == 1) \ |
| 1107 | { \ |
| 1108 | yychar = (Token); \ |
| 1109 | yylval = (Value); \ |
| 1110 | yychar1 = YYTRANSLATE (yychar); \ |
| 1111 | YYPOPSTACK; \ |
| 1112 | goto yybackup; \ |
| 1113 | } \ |
| 1114 | else \ |
| 1115 | { \ |
| 1116 | yyerror ("syntax error: cannot back up"); \ |
| 1117 | YYERROR; \ |
| 1118 | } \ |
| 1119 | while (0) |
| 1120 | |
| 1121 | #define YYTERROR 1 |
| 1122 | #define YYERRCODE 256 |
| 1123 | |
| 1124 | |
| 1125 | /* YYLLOC_DEFAULT -- Compute the default location (before the actions |
| 1126 | are run). |
| 1127 | |
| 1128 | When YYLLOC_DEFAULT is run, CURRENT is set the location of the |
| 1129 | first token. By default, to implement support for ranges, extend |
| 1130 | its range to the last symbol. */ |
| 1131 | |
| 1132 | #ifndef YYLLOC_DEFAULT |
| 1133 | # define YYLLOC_DEFAULT(Current, Rhs, N) \ |
| 1134 | Current.last_line = Rhs[N].last_line; \ |
| 1135 | Current.last_column = Rhs[N].last_column; |
| 1136 | #endif |
| 1137 | |
| 1138 | |
| 1139 | /* YYLEX -- calling `yylex' with the right arguments. */ |
| 1140 | |
| 1141 | #if YYPURE |
| 1142 | # if YYLSP_NEEDED |
| 1143 | # ifdef YYLEX_PARAM |
| 1144 | # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) |
| 1145 | # else |
| 1146 | # define YYLEX yylex (&yylval, &yylloc) |
| 1147 | # endif |
| 1148 | # else /* !YYLSP_NEEDED */ |
| 1149 | # ifdef YYLEX_PARAM |
| 1150 | # define YYLEX yylex (&yylval, YYLEX_PARAM) |
| 1151 | # else |
| 1152 | # define YYLEX yylex (&yylval) |
| 1153 | # endif |
| 1154 | # endif /* !YYLSP_NEEDED */ |
| 1155 | #else /* !YYPURE */ |
| 1156 | # define YYLEX yylex () |
| 1157 | #endif /* !YYPURE */ |
| 1158 | |
| 1159 | |
| 1160 | /* Enable debugging if requested. */ |
| 1161 | #if YYDEBUG |
| 1162 | |
| 1163 | # ifndef YYFPRINTF |
| 1164 | # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ |
| 1165 | # define YYFPRINTF fprintf |
| 1166 | # endif |
| 1167 | |
| 1168 | # define YYDPRINTF(Args) \ |
| 1169 | do { \ |
| 1170 | if (yydebug) \ |
| 1171 | YYFPRINTF Args; \ |
| 1172 | } while (0) |
| 1173 | /* Nonzero means print parse trace. It is left uninitialized so that |
| 1174 | multiple parsers can coexist. */ |
| 1175 | int yydebug; |
| 1176 | #else /* !YYDEBUG */ |
| 1177 | # define YYDPRINTF(Args) |
| 1178 | #endif /* !YYDEBUG */ |
| 1179 | |
| 1180 | /* YYINITDEPTH -- initial size of the parser's stacks. */ |
| 1181 | #ifndef YYINITDEPTH |
| 1182 | # define YYINITDEPTH 200 |
| 1183 | #endif |
| 1184 | |
| 1185 | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only |
| 1186 | if the built-in stack extension method is used). |
| 1187 | |
| 1188 | Do not make this value too large; the results are undefined if |
| 1189 | SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) |
| 1190 | evaluated with infinite-precision integer arithmetic. */ |
| 1191 | |
| 1192 | #if YYMAXDEPTH == 0 |
| 1193 | # undef YYMAXDEPTH |
| 1194 | #endif |
| 1195 | |
| 1196 | #ifndef YYMAXDEPTH |
| 1197 | # define YYMAXDEPTH 10000 |
| 1198 | #endif |
| 1199 | \f |
| 1200 | #ifdef YYERROR_VERBOSE |
| 1201 | |
| 1202 | # ifndef yystrlen |
| 1203 | # if defined (__GLIBC__) && defined (_STRING_H) |
| 1204 | # define yystrlen strlen |
| 1205 | # else |
| 1206 | /* Return the length of YYSTR. */ |
| 1207 | static YYSIZE_T |
| 1208 | # if defined (__STDC__) || defined (__cplusplus) |
| 1209 | yystrlen (const char *yystr) |
| 1210 | # else |
| 1211 | yystrlen (yystr) |
| 1212 | const char *yystr; |
| 1213 | # endif |
| 1214 | { |
| 1215 | register const char *yys = yystr; |
| 1216 | |
| 1217 | while (*yys++ != '\0') |
| 1218 | continue; |
| 1219 | |
| 1220 | return yys - yystr - 1; |
| 1221 | } |
| 1222 | # endif |
| 1223 | # endif |
| 1224 | |
| 1225 | # ifndef yystpcpy |
| 1226 | # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) |
| 1227 | # define yystpcpy stpcpy |
| 1228 | # else |
| 1229 | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in |
| 1230 | YYDEST. */ |
| 1231 | static char * |
| 1232 | # if defined (__STDC__) || defined (__cplusplus) |
| 1233 | yystpcpy (char *yydest, const char *yysrc) |
| 1234 | # else |
| 1235 | yystpcpy (yydest, yysrc) |
| 1236 | char *yydest; |
| 1237 | const char *yysrc; |
| 1238 | # endif |
| 1239 | { |
| 1240 | register char *yyd = yydest; |
| 1241 | register const char *yys = yysrc; |
| 1242 | |
| 1243 | while ((*yyd++ = *yys++) != '\0') |
| 1244 | continue; |
| 1245 | |
| 1246 | return yyd - 1; |
| 1247 | } |
| 1248 | # endif |
| 1249 | # endif |
| 1250 | #endif |
| 1251 | \f |
| 1252 | #line 315 "/usr/share/bison/bison.simple" |
| 1253 | |
| 1254 | |
| 1255 | /* The user can define YYPARSE_PARAM as the name of an argument to be passed |
| 1256 | into yyparse. The argument should have type void *. |
| 1257 | It should actually point to an object. |
| 1258 | Grammar actions can access the variable by casting it |
| 1259 | to the proper pointer type. */ |
| 1260 | |
| 1261 | #ifdef YYPARSE_PARAM |
| 1262 | # if defined (__STDC__) || defined (__cplusplus) |
| 1263 | # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM |
| 1264 | # define YYPARSE_PARAM_DECL |
| 1265 | # else |
| 1266 | # define YYPARSE_PARAM_ARG YYPARSE_PARAM |
| 1267 | # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; |
| 1268 | # endif |
| 1269 | #else /* !YYPARSE_PARAM */ |
| 1270 | # define YYPARSE_PARAM_ARG |
| 1271 | # define YYPARSE_PARAM_DECL |
| 1272 | #endif /* !YYPARSE_PARAM */ |
| 1273 | |
| 1274 | /* Prevent warning if -Wstrict-prototypes. */ |
| 1275 | #ifdef __GNUC__ |
| 1276 | # ifdef YYPARSE_PARAM |
| 1277 | int yyparse (void *); |
| 1278 | # else |
| 1279 | int yyparse (void); |
| 1280 | # endif |
| 1281 | #endif |
| 1282 | |
| 1283 | /* YY_DECL_VARIABLES -- depending whether we use a pure parser, |
| 1284 | variables are global, or local to YYPARSE. */ |
| 1285 | |
| 1286 | #define YY_DECL_NON_LSP_VARIABLES \ |
| 1287 | /* The lookahead symbol. */ \ |
| 1288 | int yychar; \ |
| 1289 | \ |
| 1290 | /* The semantic value of the lookahead symbol. */ \ |
| 1291 | YYSTYPE yylval; \ |
| 1292 | \ |
| 1293 | /* Number of parse errors so far. */ \ |
| 1294 | int yynerrs; |
| 1295 | |
| 1296 | #if YYLSP_NEEDED |
| 1297 | # define YY_DECL_VARIABLES \ |
| 1298 | YY_DECL_NON_LSP_VARIABLES \ |
| 1299 | \ |
| 1300 | /* Location data for the lookahead symbol. */ \ |
| 1301 | YYLTYPE yylloc; |
| 1302 | #else |
| 1303 | # define YY_DECL_VARIABLES \ |
| 1304 | YY_DECL_NON_LSP_VARIABLES |
| 1305 | #endif |
| 1306 | |
| 1307 | |
| 1308 | /* If nonreentrant, generate the variables here. */ |
| 1309 | |
| 1310 | #if !YYPURE |
| 1311 | YY_DECL_VARIABLES |
| 1312 | #endif /* !YYPURE */ |
| 1313 | |
| 1314 | int |
| 1315 | yyparse (YYPARSE_PARAM_ARG) |
| 1316 | YYPARSE_PARAM_DECL |
| 1317 | { |
| 1318 | /* If reentrant, generate the variables here. */ |
| 1319 | #if YYPURE |
| 1320 | YY_DECL_VARIABLES |
| 1321 | #endif /* !YYPURE */ |
| 1322 | |
| 1323 | register int yystate; |
| 1324 | register int yyn; |
| 1325 | int yyresult; |
| 1326 | /* Number of tokens to shift before error messages enabled. */ |
| 1327 | int yyerrstatus; |
| 1328 | /* Lookahead token as an internal (translated) token number. */ |
| 1329 | int yychar1 = 0; |
| 1330 | |
| 1331 | /* Three stacks and their tools: |
| 1332 | `yyss': related to states, |
| 1333 | `yyvs': related to semantic values, |
| 1334 | `yyls': related to locations. |
| 1335 | |
| 1336 | Refer to the stacks thru separate pointers, to allow yyoverflow |
| 1337 | to reallocate them elsewhere. */ |
| 1338 | |
| 1339 | /* The state stack. */ |
| 1340 | short yyssa[YYINITDEPTH]; |
| 1341 | short *yyss = yyssa; |
| 1342 | register short *yyssp; |
| 1343 | |
| 1344 | /* The semantic value stack. */ |
| 1345 | YYSTYPE yyvsa[YYINITDEPTH]; |
| 1346 | YYSTYPE *yyvs = yyvsa; |
| 1347 | register YYSTYPE *yyvsp; |
| 1348 | |
| 1349 | #if YYLSP_NEEDED |
| 1350 | /* The location stack. */ |
| 1351 | YYLTYPE yylsa[YYINITDEPTH]; |
| 1352 | YYLTYPE *yyls = yylsa; |
| 1353 | YYLTYPE *yylsp; |
| 1354 | #endif |
| 1355 | |
| 1356 | #if YYLSP_NEEDED |
| 1357 | # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) |
| 1358 | #else |
| 1359 | # define YYPOPSTACK (yyvsp--, yyssp--) |
| 1360 | #endif |
| 1361 | |
| 1362 | YYSIZE_T yystacksize = YYINITDEPTH; |
| 1363 | |
| 1364 | |
| 1365 | /* The variables used to return semantic value and location from the |
| 1366 | action routines. */ |
| 1367 | YYSTYPE yyval; |
| 1368 | #if YYLSP_NEEDED |
| 1369 | YYLTYPE yyloc; |
| 1370 | #endif |
| 1371 | |
| 1372 | /* When reducing, the number of symbols on the RHS of the reduced |
| 1373 | rule. */ |
| 1374 | int yylen; |
| 1375 | |
| 1376 | YYDPRINTF ((stderr, "Starting parse\n")); |
| 1377 | |
| 1378 | yystate = 0; |
| 1379 | yyerrstatus = 0; |
| 1380 | yynerrs = 0; |
| 1381 | yychar = YYEMPTY; /* Cause a token to be read. */ |
| 1382 | |
| 1383 | /* Initialize stack pointers. |
| 1384 | Waste one element of value and location stack |
| 1385 | so that they stay on the same level as the state stack. |
| 1386 | The wasted elements are never initialized. */ |
| 1387 | |
| 1388 | yyssp = yyss; |
| 1389 | yyvsp = yyvs; |
| 1390 | #if YYLSP_NEEDED |
| 1391 | yylsp = yyls; |
| 1392 | #endif |
| 1393 | goto yysetstate; |
| 1394 | |
| 1395 | /*------------------------------------------------------------. |
| 1396 | | yynewstate -- Push a new state, which is found in yystate. | |
| 1397 | `------------------------------------------------------------*/ |
| 1398 | yynewstate: |
| 1399 | /* In all cases, when you get here, the value and location stacks |
| 1400 | have just been pushed. so pushing a state here evens the stacks. |
| 1401 | */ |
| 1402 | yyssp++; |
| 1403 | |
| 1404 | yysetstate: |
| 1405 | *yyssp = yystate; |
| 1406 | |
| 1407 | if (yyssp >= yyss + yystacksize - 1) |
| 1408 | { |
| 1409 | /* Get the current used size of the three stacks, in elements. */ |
| 1410 | YYSIZE_T yysize = yyssp - yyss + 1; |
| 1411 | |
| 1412 | #ifdef yyoverflow |
| 1413 | { |
| 1414 | /* Give user a chance to reallocate the stack. Use copies of |
| 1415 | these so that the &'s don't force the real ones into |
| 1416 | memory. */ |
| 1417 | YYSTYPE *yyvs1 = yyvs; |
| 1418 | short *yyss1 = yyss; |
| 1419 | |
| 1420 | /* Each stack pointer address is followed by the size of the |
| 1421 | data in use in that stack, in bytes. */ |
| 1422 | # if YYLSP_NEEDED |
| 1423 | YYLTYPE *yyls1 = yyls; |
| 1424 | /* This used to be a conditional around just the two extra args, |
| 1425 | but that might be undefined if yyoverflow is a macro. */ |
| 1426 | yyoverflow ("parser stack overflow", |
| 1427 | &yyss1, yysize * sizeof (*yyssp), |
| 1428 | &yyvs1, yysize * sizeof (*yyvsp), |
| 1429 | &yyls1, yysize * sizeof (*yylsp), |
| 1430 | &yystacksize); |
| 1431 | yyls = yyls1; |
| 1432 | # else |
| 1433 | yyoverflow ("parser stack overflow", |
| 1434 | &yyss1, yysize * sizeof (*yyssp), |
| 1435 | &yyvs1, yysize * sizeof (*yyvsp), |
| 1436 | &yystacksize); |
| 1437 | # endif |
| 1438 | yyss = yyss1; |
| 1439 | yyvs = yyvs1; |
| 1440 | } |
| 1441 | #else /* no yyoverflow */ |
| 1442 | # ifndef YYSTACK_RELOCATE |
| 1443 | goto yyoverflowlab; |
| 1444 | # else |
| 1445 | /* Extend the stack our own way. */ |
| 1446 | if (yystacksize >= YYMAXDEPTH) |
| 1447 | goto yyoverflowlab; |
| 1448 | yystacksize *= 2; |
| 1449 | if (yystacksize > YYMAXDEPTH) |
| 1450 | yystacksize = YYMAXDEPTH; |
| 1451 | |
| 1452 | { |
| 1453 | short *yyss1 = yyss; |
| 1454 | union yyalloc *yyptr = |
| 1455 | (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); |
| 1456 | if (! yyptr) |
| 1457 | goto yyoverflowlab; |
| 1458 | YYSTACK_RELOCATE (yyss); |
| 1459 | YYSTACK_RELOCATE (yyvs); |
| 1460 | # if YYLSP_NEEDED |
| 1461 | YYSTACK_RELOCATE (yyls); |
| 1462 | # endif |
| 1463 | # undef YYSTACK_RELOCATE |
| 1464 | if (yyss1 != yyssa) |
| 1465 | YYSTACK_FREE (yyss1); |
| 1466 | } |
| 1467 | # endif |
| 1468 | #endif /* no yyoverflow */ |
| 1469 | |
| 1470 | yyssp = yyss + yysize - 1; |
| 1471 | yyvsp = yyvs + yysize - 1; |
| 1472 | #if YYLSP_NEEDED |
| 1473 | yylsp = yyls + yysize - 1; |
| 1474 | #endif |
| 1475 | |
| 1476 | YYDPRINTF ((stderr, "Stack size increased to %lu\n", |
| 1477 | (unsigned long int) yystacksize)); |
| 1478 | |
| 1479 | if (yyssp >= yyss + yystacksize - 1) |
| 1480 | YYABORT; |
| 1481 | } |
| 1482 | |
| 1483 | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
| 1484 | |
| 1485 | goto yybackup; |
| 1486 | |
| 1487 | |
| 1488 | /*-----------. |
| 1489 | | yybackup. | |
| 1490 | `-----------*/ |
| 1491 | yybackup: |
| 1492 | |
| 1493 | /* Do appropriate processing given the current state. */ |
| 1494 | /* Read a lookahead token if we need one and don't already have one. */ |
| 1495 | /* yyresume: */ |
| 1496 | |
| 1497 | /* First try to decide what to do without reference to lookahead token. */ |
| 1498 | |
| 1499 | yyn = yypact[yystate]; |
| 1500 | if (yyn == YYFLAG) |
| 1501 | goto yydefault; |
| 1502 | |
| 1503 | /* Not known => get a lookahead token if don't already have one. */ |
| 1504 | |
| 1505 | /* yychar is either YYEMPTY or YYEOF |
| 1506 | or a valid token in external form. */ |
| 1507 | |
| 1508 | if (yychar == YYEMPTY) |
| 1509 | { |
| 1510 | YYDPRINTF ((stderr, "Reading a token: ")); |
| 1511 | yychar = YYLEX; |
| 1512 | } |
| 1513 | |
| 1514 | /* Convert token to internal form (in yychar1) for indexing tables with */ |
| 1515 | |
| 1516 | if (yychar <= 0) /* This means end of input. */ |
| 1517 | { |
| 1518 | yychar1 = 0; |
| 1519 | yychar = YYEOF; /* Don't call YYLEX any more */ |
| 1520 | |
| 1521 | YYDPRINTF ((stderr, "Now at end of input.\n")); |
| 1522 | } |
| 1523 | else |
| 1524 | { |
| 1525 | yychar1 = YYTRANSLATE (yychar); |
| 1526 | |
| 1527 | #if YYDEBUG |
| 1528 | /* We have to keep this `#if YYDEBUG', since we use variables |
| 1529 | which are defined only if `YYDEBUG' is set. */ |
| 1530 | if (yydebug) |
| 1531 | { |
| 1532 | YYFPRINTF (stderr, "Next token is %d (%s", |
| 1533 | yychar, yytname[yychar1]); |
| 1534 | /* Give the individual parser a way to print the precise |
| 1535 | meaning of a token, for further debugging info. */ |
| 1536 | # ifdef YYPRINT |
| 1537 | YYPRINT (stderr, yychar, yylval); |
| 1538 | # endif |
| 1539 | YYFPRINTF (stderr, ")\n"); |
| 1540 | } |
| 1541 | #endif |
| 1542 | } |
| 1543 | |
| 1544 | yyn += yychar1; |
| 1545 | if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) |
| 1546 | goto yydefault; |
| 1547 | |
| 1548 | yyn = yytable[yyn]; |
| 1549 | |
| 1550 | /* yyn is what to do for this token type in this state. |
| 1551 | Negative => reduce, -yyn is rule number. |
| 1552 | Positive => shift, yyn is new state. |
| 1553 | New state is final state => don't bother to shift, |
| 1554 | just return success. |
| 1555 | 0, or most negative number => error. */ |
| 1556 | |
| 1557 | if (yyn < 0) |
| 1558 | { |
| 1559 | if (yyn == YYFLAG) |
| 1560 | goto yyerrlab; |
| 1561 | yyn = -yyn; |
| 1562 | goto yyreduce; |
| 1563 | } |
| 1564 | else if (yyn == 0) |
| 1565 | goto yyerrlab; |
| 1566 | |
| 1567 | if (yyn == YYFINAL) |
| 1568 | YYACCEPT; |
| 1569 | |
| 1570 | /* Shift the lookahead token. */ |
| 1571 | YYDPRINTF ((stderr, "Shifting token %d (%s), ", |
| 1572 | yychar, yytname[yychar1])); |
| 1573 | |
| 1574 | /* Discard the token being shifted unless it is eof. */ |
| 1575 | if (yychar != YYEOF) |
| 1576 | yychar = YYEMPTY; |
| 1577 | |
| 1578 | *++yyvsp = yylval; |
| 1579 | #if YYLSP_NEEDED |
| 1580 | *++yylsp = yylloc; |
| 1581 | #endif |
| 1582 | |
| 1583 | /* Count tokens shifted since error; after three, turn off error |
| 1584 | status. */ |
| 1585 | if (yyerrstatus) |
| 1586 | yyerrstatus--; |
| 1587 | |
| 1588 | yystate = yyn; |
| 1589 | goto yynewstate; |
| 1590 | |
| 1591 | |
| 1592 | /*-----------------------------------------------------------. |
| 1593 | | yydefault -- do the default action for the current state. | |
| 1594 | `-----------------------------------------------------------*/ |
| 1595 | yydefault: |
| 1596 | yyn = yydefact[yystate]; |
| 1597 | if (yyn == 0) |
| 1598 | goto yyerrlab; |
| 1599 | goto yyreduce; |
| 1600 | |
| 1601 | |
| 1602 | /*-----------------------------. |
| 1603 | | yyreduce -- Do a reduction. | |
| 1604 | `-----------------------------*/ |
| 1605 | yyreduce: |
| 1606 | /* yyn is the number of a rule to reduce with. */ |
| 1607 | yylen = yyr2[yyn]; |
| 1608 | |
| 1609 | /* If YYLEN is nonzero, implement the default value of the action: |
| 1610 | `$$ = $1'. |
| 1611 | |
| 1612 | Otherwise, the following line sets YYVAL to the semantic value of |
| 1613 | the lookahead token. This behavior is undocumented and Bison |
| 1614 | users should not rely upon it. Assigning to YYVAL |
| 1615 | unconditionally makes the parser a bit smaller, and it avoids a |
| 1616 | GCC warning that YYVAL may be used uninitialized. */ |
| 1617 | yyval = yyvsp[1-yylen]; |
| 1618 | |
| 1619 | #if YYLSP_NEEDED |
| 1620 | /* Similarly for the default location. Let the user run additional |
| 1621 | commands if for instance locations are ranges. */ |
| 1622 | yyloc = yylsp[1-yylen]; |
| 1623 | YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); |
| 1624 | #endif |
| 1625 | |
| 1626 | #if YYDEBUG |
| 1627 | /* We have to keep this `#if YYDEBUG', since we use variables which |
| 1628 | are defined only if `YYDEBUG' is set. */ |
| 1629 | if (yydebug) |
| 1630 | { |
| 1631 | int yyi; |
| 1632 | |
| 1633 | YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", |
| 1634 | yyn, yyrline[yyn]); |
| 1635 | |
| 1636 | /* Print the symbols being reduced, and their result. */ |
| 1637 | for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++) |
| 1638 | YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); |
| 1639 | YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); |
| 1640 | } |
| 1641 | #endif |
| 1642 | |
| 1643 | switch (yyn) { |
| 1644 | |
| 1645 | case 1: |
| 1646 | #line 327 "c-parse.y" |
| 1647 | { |
| 1648 | translation_unit = yyvsp[0].external_declaration_list->first; |
| 1649 | } |
| 1650 | break; |
| 1651 | case 5: |
| 1652 | #line 340 "c-parse.y" |
| 1653 | { |
| 1654 | yyval.name.name = 0; |
| 1655 | yyval.name.declarator = 0; |
| 1656 | } |
| 1657 | break; |
| 1658 | case 6: |
| 1659 | #line 349 "c-parse.y" |
| 1660 | { |
| 1661 | struct declarator *d; |
| 1662 | yyval.expression = expr(ex_id, &yylsp[0]); |
| 1663 | yyval.expression->u.name = yyvsp[0].name.name; |
| 1664 | d = yyvsp[0].name.declarator; |
| 1665 | if(!d) { |
| 1666 | inputerror(&yylsp[0], "undeclared identifier '%s'", yyvsp[0].name.name); |
| 1667 | } else if(d->declaration_specifiers |
| 1668 | && (d->declaration_specifiers->storage_class_specifiers |
| 1669 | & SCS_TYPEDEF)) |
| 1670 | inputerror(&yylsp[0], "typedef-name '%s' used in expression", yyvsp[0].name); |
| 1671 | else |
| 1672 | yyval.expression->valuetype = resolve_typedefs(d); |
| 1673 | } |
| 1674 | break; |
| 1675 | case 7: |
| 1676 | #line 363 "c-parse.y" |
| 1677 | { |
| 1678 | yyval.expression = expr(ex_number, &yylsp[0]); |
| 1679 | yyval.expression->u.constant = yyvsp[0].s; |
| 1680 | yyval.expression->valuetype = numbertype(yyval.expression); |
| 1681 | } |
| 1682 | break; |
| 1683 | case 8: |
| 1684 | #line 368 "c-parse.y" |
| 1685 | { |
| 1686 | yyval.expression = stringexpr(ex_char, yyvsp[0].s, &yylsp[0]); |
| 1687 | } |
| 1688 | break; |
| 1689 | case 9: |
| 1690 | #line 371 "c-parse.y" |
| 1691 | { |
| 1692 | yyval.expression = stringexpr(ex_string, yyvsp[0].s, &yylsp[0]); |
| 1693 | } |
| 1694 | break; |
| 1695 | case 10: |
| 1696 | #line 374 "c-parse.y" |
| 1697 | { |
| 1698 | yyval.expression = stringexpr(ex_wchar, yyvsp[0].s, &yylsp[0]); |
| 1699 | } |
| 1700 | break; |
| 1701 | case 11: |
| 1702 | #line 377 "c-parse.y" |
| 1703 | { |
| 1704 | yyval.expression = stringexpr(ex_wstring, yyvsp[0].s, &yylsp[0]); |
| 1705 | } |
| 1706 | break; |
| 1707 | case 12: |
| 1708 | #line 380 "c-parse.y" |
| 1709 | { |
| 1710 | yyval.expression = paren(yyvsp[-1].expression, &yylsp[-2]); |
| 1711 | } |
| 1712 | break; |
| 1713 | case 14: |
| 1714 | #line 387 "c-parse.y" |
| 1715 | { |
| 1716 | yyval.expression = binary('[', yyvsp[-3].expression, yyvsp[-1].expression, &yylsp[-2]); |
| 1717 | } |
| 1718 | break; |
| 1719 | case 15: |
| 1720 | #line 390 "c-parse.y" |
| 1721 | { |
| 1722 | yyval.expression = fncallexpr(yyvsp[-3].expression, yyvsp[-1].expression_list, &yylsp[-2]); |
| 1723 | } |
| 1724 | break; |
| 1725 | case 16: |
| 1726 | #line 393 "c-parse.y" |
| 1727 | { |
| 1728 | yyval.expression = expr(ex_gcc_va_arg, &yylsp[-4]); |
| 1729 | yyval.expression->u.gcc_va_arg.arg = yyvsp[-3].expression; |
| 1730 | yyval.expression->u.gcc_va_arg.type = yyvsp[-1].declaration; |
| 1731 | yyval.expression->valuetype = resolve_typedefs(yyvsp[-1].declaration->declarator_list); |
| 1732 | } |
| 1733 | break; |
| 1734 | case 17: |
| 1735 | #line 399 "c-parse.y" |
| 1736 | { |
| 1737 | /* we can't hack this in as a function as the return type is that of |
| 1738 | * the LH argument */ |
| 1739 | yyval.expression = expr(ex_gcc_expect, &yylsp[-5]); |
| 1740 | /* XXX does the LH arg undergo any implicit conversions? */ |
| 1741 | yyval.expression->u.binary.l = yyvsp[-3].expression; |
| 1742 | yyval.expression->u.binary.r = yyvsp[-1].expression; |
| 1743 | yyval.expression->valuetype = yyvsp[-3].expression->valuetype; |
| 1744 | } |
| 1745 | break; |
| 1746 | case 18: |
| 1747 | #line 408 "c-parse.y" |
| 1748 | { |
| 1749 | struct expression *e = expr(ex_id, &yylsp[-1]); |
| 1750 | e->u.name = yyvsp[0].name.name; |
| 1751 | yyval.expression = binary(yyvsp[-1].i, yyvsp[-2].expression, e, &yylsp[-1]); |
| 1752 | } |
| 1753 | break; |
| 1754 | case 19: |
| 1755 | #line 413 "c-parse.y" |
| 1756 | { |
| 1757 | yyval.expression = postfix(yyvsp[0].i, yyvsp[-1].expression, &yylsp[0]); |
| 1758 | } |
| 1759 | break; |
| 1760 | case 20: |
| 1761 | #line 416 "c-parse.y" |
| 1762 | { |
| 1763 | yyval.expression = expr(ex_compound_literal, &yylsp[-6]); |
| 1764 | yyval.expression->u.compound_literal.type = yyvsp[-5].declaration; |
| 1765 | yyval.expression->u.compound_literal.value = yyvsp[-2].initializer_list->first; |
| 1766 | declaration_constraints(yyvsp[-5].declaration, dc_compound_literal); |
| 1767 | yyval.expression->valuetype = resolve_typedefs(yyvsp[-5].declaration->declarator_list); |
| 1768 | } |
| 1769 | break; |
| 1770 | case 25: |
| 1771 | #line 430 "c-parse.y" |
| 1772 | { |
| 1773 | NEW(yyval.parsing_expression_list); |
| 1774 | NEW(yyval.parsing_expression_list->first); |
| 1775 | yyval.parsing_expression_list->first->e = yyvsp[0].expression; |
| 1776 | yyval.parsing_expression_list->end = &yyval.parsing_expression_list->first->next; |
| 1777 | } |
| 1778 | break; |
| 1779 | case 26: |
| 1780 | #line 436 "c-parse.y" |
| 1781 | { |
| 1782 | struct expression_list *e; |
| 1783 | NEW(e); |
| 1784 | e->e = yyvsp[0].expression; |
| 1785 | *(yyval.parsing_expression_list = yyvsp[-2].parsing_expression_list)->end = e; |
| 1786 | yyval.parsing_expression_list->end = &e->next; |
| 1787 | } |
| 1788 | break; |
| 1789 | case 27: |
| 1790 | #line 446 "c-parse.y" |
| 1791 | { yyval.expression_list = yyvsp[0].parsing_expression_list->first; } |
| 1792 | break; |
| 1793 | case 28: |
| 1794 | #line 447 "c-parse.y" |
| 1795 | { yyval.expression_list = 0; } |
| 1796 | break; |
| 1797 | case 30: |
| 1798 | #line 452 "c-parse.y" |
| 1799 | { |
| 1800 | yyval.expression = prefix(yyvsp[-1].i, yyvsp[0].expression, &yylsp[-1]); |
| 1801 | } |
| 1802 | break; |
| 1803 | case 31: |
| 1804 | #line 455 "c-parse.y" |
| 1805 | { |
| 1806 | yyval.expression = prefix(SIZEOF, yyvsp[0].expression, &yylsp[-1]); |
| 1807 | } |
| 1808 | break; |
| 1809 | case 32: |
| 1810 | #line 458 "c-parse.y" |
| 1811 | { |
| 1812 | yyval.expression = expr(ex_sizeof_type, &yylsp[-3]); |
| 1813 | yyval.expression->u.type = yyvsp[-1].declaration; |
| 1814 | declaration_constraints(yyvsp[-1].declaration, dc_sizeof); |
| 1815 | } |
| 1816 | break; |
| 1817 | case 41: |
| 1818 | #line 478 "c-parse.y" |
| 1819 | { |
| 1820 | yyval.expression = expr(ex_cast, &yylsp[-3]); |
| 1821 | yyval.expression->valuetype = yyvsp[-2].declaration->declarator_list; |
| 1822 | yyval.expression->u.cast = yyvsp[0].expression; |
| 1823 | declaration_constraints(yyvsp[-2].declaration, dc_cast); |
| 1824 | } |
| 1825 | break; |
| 1826 | case 43: |
| 1827 | #line 488 "c-parse.y" |
| 1828 | { |
| 1829 | yyval.expression = binary(yyvsp[-1].i, yyvsp[-2].expression, yyvsp[0].expression, &yylsp[-1]); |
| 1830 | } |
| 1831 | break; |
| 1832 | case 48: |
| 1833 | #line 501 "c-parse.y" |
| 1834 | { |
| 1835 | yyval.expression = binary(yyvsp[-1].i, yyvsp[-2].expression, yyvsp[0].expression, &yylsp[-1]); |
| 1836 | } |
| 1837 | break; |
| 1838 | case 52: |
| 1839 | #line 513 "c-parse.y" |
| 1840 | { |
| 1841 | yyval.expression = binary(yyvsp[-1].i, yyvsp[-2].expression, yyvsp[0].expression, &yylsp[-1]); |
| 1842 | } |
| 1843 | break; |
| 1844 | case 56: |
| 1845 | #line 525 "c-parse.y" |
| 1846 | { |
| 1847 | yyval.expression = binary(yyvsp[-1].i, yyvsp[-2].expression, yyvsp[0].expression, &yylsp[-1]); |
| 1848 | } |
| 1849 | break; |
| 1850 | case 62: |
| 1851 | #line 539 "c-parse.y" |
| 1852 | { |
| 1853 | yyval.expression = binary(yyvsp[-1].i, yyvsp[-2].expression, yyvsp[0].expression, &yylsp[-1]); |
| 1854 | } |
| 1855 | break; |
| 1856 | case 66: |
| 1857 | #line 551 "c-parse.y" |
| 1858 | { |
| 1859 | yyval.expression = binary(yyvsp[-1].i, yyvsp[-2].expression, yyvsp[0].expression, &yylsp[-1]); |
| 1860 | } |
| 1861 | break; |
| 1862 | case 68: |
| 1863 | #line 558 "c-parse.y" |
| 1864 | { |
| 1865 | yyval.expression = binary(yyvsp[-1].i, yyvsp[-2].expression, yyvsp[0].expression, &yylsp[-1]); |
| 1866 | } |
| 1867 | break; |
| 1868 | case 70: |
| 1869 | #line 565 "c-parse.y" |
| 1870 | { |
| 1871 | yyval.expression = binary(yyvsp[-1].i, yyvsp[-2].expression, yyvsp[0].expression, &yylsp[-1]); |
| 1872 | } |
| 1873 | break; |
| 1874 | case 72: |
| 1875 | #line 572 "c-parse.y" |
| 1876 | { |
| 1877 | yyval.expression = binary(yyvsp[-1].i, yyvsp[-2].expression, yyvsp[0].expression, &yylsp[-1]); |
| 1878 | } |
| 1879 | break; |
| 1880 | case 74: |
| 1881 | #line 579 "c-parse.y" |
| 1882 | { |
| 1883 | yyval.expression = binary(yyvsp[-1].i, yyvsp[-2].expression, yyvsp[0].expression, &yylsp[-1]); |
| 1884 | } |
| 1885 | break; |
| 1886 | case 76: |
| 1887 | #line 586 "c-parse.y" |
| 1888 | { |
| 1889 | yyval.expression = binary('?', yyvsp[-4].expression, binary(':', yyvsp[-2].expression, yyvsp[0].expression, &yylsp[-1]), &yylsp[-3]); |
| 1890 | } |
| 1891 | break; |
| 1892 | case 78: |
| 1893 | #line 593 "c-parse.y" |
| 1894 | { |
| 1895 | yyval.expression = binary(yyvsp[-1].i, yyvsp[-2].expression, yyvsp[0].expression, &yylsp[-1]); |
| 1896 | } |
| 1897 | break; |
| 1898 | case 91: |
| 1899 | #line 614 "c-parse.y" |
| 1900 | { |
| 1901 | yyval.expression = binary(yyvsp[-1].i, yyvsp[-2].expression, yyvsp[0].expression, &yylsp[-1]); |
| 1902 | } |
| 1903 | break; |
| 1904 | case 93: |
| 1905 | #line 621 "c-parse.y" |
| 1906 | { yyval.expression = 0; } |
| 1907 | break; |
| 1908 | case 95: |
| 1909 | #line 631 "c-parse.y" |
| 1910 | { |
| 1911 | struct declaration_specifiers *ds = yyvsp[-2].declaration_specifiers; |
| 1912 | struct declarator *decl = yyvsp[-1].declarator; |
| 1913 | |
| 1914 | check_top_declaration_specifier(ds); |
| 1915 | pop_declaration_specifiers(); |
| 1916 | /* will have already done add_declarator() */ |
| 1917 | NEW(yyval.declaration); |
| 1918 | yyval.declaration->declaration_specifiers = ds; |
| 1919 | yyval.declaration->declarator_list = decl; |
| 1920 | yyval.declaration->where = yylsp[-2]; |
| 1921 | /* constraints checked by calling production */ |
| 1922 | } |
| 1923 | break; |
| 1924 | case 96: |
| 1925 | #line 647 "c-parse.y" |
| 1926 | { |
| 1927 | push_declaration_specifiers(yyvsp[0].declaration_specifiers); |
| 1928 | yyval.declaration_specifiers = yyvsp[0].declaration_specifiers; |
| 1929 | } |
| 1930 | break; |
| 1931 | case 97: |
| 1932 | #line 654 "c-parse.y" |
| 1933 | { |
| 1934 | struct declaration_specifiers ds = { |
| 1935 | .type_specifiers = 0, |
| 1936 | .storage_class_specifiers = yyvsp[-1].u, |
| 1937 | .type_qualifiers = 0, |
| 1938 | .function_specifiers = 0, |
| 1939 | .name = 0, |
| 1940 | .structure = 0, |
| 1941 | .enumerators = 0, |
| 1942 | .type = 0, |
| 1943 | .enum_compat_type = 0 |
| 1944 | }; |
| 1945 | yyval.declaration_specifiers = merge_declaration_specifiers(yyvsp[0].declaration_specifiers, &ds); |
| 1946 | } |
| 1947 | break; |
| 1948 | case 98: |
| 1949 | #line 668 "c-parse.y" |
| 1950 | { |
| 1951 | yyval.declaration_specifiers = merge_declaration_specifiers(yyvsp[0].declaration_specifiers, yyvsp[-1].declaration_specifiers); |
| 1952 | } |
| 1953 | break; |
| 1954 | case 99: |
| 1955 | #line 671 "c-parse.y" |
| 1956 | { |
| 1957 | struct declaration_specifiers ds = { |
| 1958 | .type_specifiers = 0, |
| 1959 | .storage_class_specifiers = 0, |
| 1960 | .type_qualifiers = yyvsp[-1].u, |
| 1961 | .function_specifiers = 0, |
| 1962 | .name = 0, |
| 1963 | .structure = 0, |
| 1964 | .enumerators = 0, |
| 1965 | .type = 0, |
| 1966 | .enum_compat_type = 0 |
| 1967 | }; |
| 1968 | yyval.declaration_specifiers = merge_declaration_specifiers(yyvsp[0].declaration_specifiers, &ds); |
| 1969 | } |
| 1970 | break; |
| 1971 | case 100: |
| 1972 | #line 685 "c-parse.y" |
| 1973 | { |
| 1974 | struct declaration_specifiers ds = { |
| 1975 | .type_specifiers = 0, |
| 1976 | .storage_class_specifiers = 0, |
| 1977 | .type_qualifiers = 0, |
| 1978 | .function_specifiers = yyvsp[-1].u, |
| 1979 | .name = 0, |
| 1980 | .structure = 0, |
| 1981 | .enumerators = 0, |
| 1982 | .type = 0, |
| 1983 | .enum_compat_type = 0 |
| 1984 | }; |
| 1985 | yyval.declaration_specifiers = merge_declaration_specifiers(yyvsp[0].declaration_specifiers, &ds); |
| 1986 | } |
| 1987 | break; |
| 1988 | case 101: |
| 1989 | #line 699 "c-parse.y" |
| 1990 | { |
| 1991 | yyval.declaration_specifiers = yyvsp[0].declaration_specifiers; |
| 1992 | } |
| 1993 | break; |
| 1994 | case 103: |
| 1995 | #line 706 "c-parse.y" |
| 1996 | { |
| 1997 | NEW(yyval.declaration_specifiers); |
| 1998 | } |
| 1999 | break; |
| 2000 | case 104: |
| 2001 | #line 712 "c-parse.y" |
| 2002 | { yyval.declarator = yyvsp[0].declarator_list->first; } |
| 2003 | break; |
| 2004 | case 105: |
| 2005 | #line 713 "c-parse.y" |
| 2006 | { yyval.declarator = 0; } |
| 2007 | break; |
| 2008 | case 106: |
| 2009 | #line 717 "c-parse.y" |
| 2010 | { |
| 2011 | NEW(yyval.declarator_list); |
| 2012 | yyval.declarator_list->first = yyvsp[0].declarator; |
| 2013 | yyval.declarator_list->end = &yyvsp[0].declarator->next; |
| 2014 | } |
| 2015 | break; |
| 2016 | case 107: |
| 2017 | #line 722 "c-parse.y" |
| 2018 | { |
| 2019 | yyval.declarator_list = yyvsp[-3].declarator_list; |
| 2020 | *yyval.declarator_list->end = yyvsp[0].declarator; |
| 2021 | yyval.declarator_list->end = &yyvsp[0].declarator->next; |
| 2022 | } |
| 2023 | break; |
| 2024 | case 108: |
| 2025 | #line 730 "c-parse.y" |
| 2026 | { yyval.declarator = get_declarator(yyvsp[-1].declarator_parse, &yylsp[-1]); } |
| 2027 | break; |
| 2028 | case 109: |
| 2029 | #line 734 "c-parse.y" |
| 2030 | { |
| 2031 | add_declaration(yyval.declarator = yyvsp[0].declarator); |
| 2032 | } |
| 2033 | break; |
| 2034 | case 110: |
| 2035 | #line 737 "c-parse.y" |
| 2036 | { |
| 2037 | /* need to do this before we parse the initializer */ |
| 2038 | add_declaration(yyvsp[-1].declarator); |
| 2039 | } |
| 2040 | break; |
| 2041 | case 111: |
| 2042 | #line 740 "c-parse.y" |
| 2043 | { |
| 2044 | yyval.declarator = yyvsp[-3].declarator; |
| 2045 | yyval.declarator->initializer = yyvsp[0].initializer; |
| 2046 | } |
| 2047 | break; |
| 2048 | case 117: |
| 2049 | #line 759 "c-parse.y" |
| 2050 | { |
| 2051 | NEW(yyval.declaration_specifiers); |
| 2052 | yyval.declaration_specifiers->type_specifiers = yyvsp[0].u; |
| 2053 | } |
| 2054 | break; |
| 2055 | case 118: |
| 2056 | #line 763 "c-parse.y" |
| 2057 | { yyval.declaration_specifiers = yyvsp[0].declaration_specifiers; } |
| 2058 | break; |
| 2059 | case 120: |
| 2060 | #line 765 "c-parse.y" |
| 2061 | { |
| 2062 | NEW(yyval.declaration_specifiers); |
| 2063 | yyval.declaration_specifiers->type_specifiers = TS_TYPEDEF; |
| 2064 | yyval.declaration_specifiers->name = yyvsp[0].name.name; |
| 2065 | yyval.declaration_specifiers->type = yyvsp[0].name.declarator; |
| 2066 | } |
| 2067 | break; |
| 2068 | case 134: |
| 2069 | #line 798 "c-parse.y" |
| 2070 | { |
| 2071 | NEW(yyval.declaration_specifiers); |
| 2072 | yyval.declaration_specifiers->type_specifiers = yyvsp[-5].u | TS_DEFINITION; |
| 2073 | yyval.declaration_specifiers->name = yyvsp[-4].name.name; |
| 2074 | yyval.declaration_specifiers->structure = yyvsp[-2].declaration_list->first; |
| 2075 | } |
| 2076 | break; |
| 2077 | case 135: |
| 2078 | #line 804 "c-parse.y" |
| 2079 | { |
| 2080 | NEW(yyval.declaration_specifiers); |
| 2081 | yyval.declaration_specifiers->type_specifiers = yyvsp[-1].u; |
| 2082 | yyval.declaration_specifiers->name = yyvsp[0].name.name; |
| 2083 | } |
| 2084 | break; |
| 2085 | case 136: |
| 2086 | #line 809 "c-parse.y" |
| 2087 | { /* shift/reduce conflict */ |
| 2088 | inputerror(&yylsp[0], "structure must have a tag or a definition"); |
| 2089 | NEW(yyval.declaration_specifiers); |
| 2090 | yyval.declaration_specifiers->type_specifiers = yyvsp[0].u; |
| 2091 | } |
| 2092 | break; |
| 2093 | case 137: |
| 2094 | #line 817 "c-parse.y" |
| 2095 | { yyval.u = yyvsp[-1].u; } |
| 2096 | break; |
| 2097 | case 138: |
| 2098 | #line 818 "c-parse.y" |
| 2099 | { yyval.u = yyvsp[-1].u; } |
| 2100 | break; |
| 2101 | case 139: |
| 2102 | #line 822 "c-parse.y" |
| 2103 | { |
| 2104 | NEW(yyval.declaration_list); |
| 2105 | yyval.declaration_list->first = yyvsp[0].declaration; |
| 2106 | yyval.declaration_list->end = &yyvsp[0].declaration->next; |
| 2107 | } |
| 2108 | break; |
| 2109 | case 140: |
| 2110 | #line 827 "c-parse.y" |
| 2111 | { |
| 2112 | yyval.declaration_list = yyvsp[-1].declaration_list; |
| 2113 | *yyval.declaration_list->end = yyvsp[0].declaration; |
| 2114 | yyval.declaration_list->end = &yyvsp[0].declaration->next; |
| 2115 | } |
| 2116 | break; |
| 2117 | case 141: |
| 2118 | #line 835 "c-parse.y" |
| 2119 | { |
| 2120 | check_top_declaration_specifier(yyvsp[-2].declaration_specifiers); |
| 2121 | pop_declaration_specifiers(); |
| 2122 | NEW(yyval.declaration); |
| 2123 | yyval.declaration->declaration_specifiers = yyvsp[-2].declaration_specifiers; |
| 2124 | yyval.declaration->declarator_list = yyvsp[-1].declarator_list->first; |
| 2125 | declaration_constraints(yyval.declaration, dc_struct_member); |
| 2126 | /* XXX perhaps add to a dictionary of struct/union declarations? */ |
| 2127 | yyval.declaration->where = yylsp[-2]; |
| 2128 | } |
| 2129 | break; |
| 2130 | case 142: |
| 2131 | #line 848 "c-parse.y" |
| 2132 | { |
| 2133 | push_declaration_specifiers(yyvsp[0].declaration_specifiers); |
| 2134 | yyval.declaration_specifiers = yyvsp[0].declaration_specifiers; |
| 2135 | } |
| 2136 | break; |
| 2137 | case 143: |
| 2138 | #line 855 "c-parse.y" |
| 2139 | { |
| 2140 | yyval.declaration_specifiers = merge_declaration_specifiers(yyvsp[0].declaration_specifiers, yyvsp[-1].declaration_specifiers); |
| 2141 | } |
| 2142 | break; |
| 2143 | case 144: |
| 2144 | #line 858 "c-parse.y" |
| 2145 | { |
| 2146 | struct declaration_specifiers ds = { |
| 2147 | .type_specifiers = 0, |
| 2148 | .storage_class_specifiers = 0, |
| 2149 | .type_qualifiers = yyvsp[-1].u, |
| 2150 | .function_specifiers = 0, |
| 2151 | .name = 0, |
| 2152 | .structure = 0, |
| 2153 | .enumerators = 0, |
| 2154 | .type = 0, |
| 2155 | .enum_compat_type = 0 |
| 2156 | }; |
| 2157 | yyval.declaration_specifiers = merge_declaration_specifiers(yyvsp[0].declaration_specifiers, &ds); |
| 2158 | } |
| 2159 | break; |
| 2160 | case 145: |
| 2161 | #line 872 "c-parse.y" |
| 2162 | { |
| 2163 | inputerror(&yylsp[-1], "storage class specifiers not allowed here"); |
| 2164 | yyval.declaration_specifiers = yyvsp[0].declaration_specifiers; |
| 2165 | } |
| 2166 | break; |
| 2167 | case 146: |
| 2168 | #line 876 "c-parse.y" |
| 2169 | { |
| 2170 | inputerror(&yylsp[-1], "function specifiers not allowed here"); |
| 2171 | yyval.declaration_specifiers = yyvsp[0].declaration_specifiers; |
| 2172 | } |
| 2173 | break; |
| 2174 | case 147: |
| 2175 | #line 880 "c-parse.y" |
| 2176 | { |
| 2177 | yyval.declaration_specifiers = yyvsp[0].declaration_specifiers; |
| 2178 | } |
| 2179 | break; |
| 2180 | case 149: |
| 2181 | #line 887 "c-parse.y" |
| 2182 | { |
| 2183 | NEW(yyval.declaration_specifiers); |
| 2184 | } |
| 2185 | break; |
| 2186 | case 150: |
| 2187 | #line 893 "c-parse.y" |
| 2188 | { |
| 2189 | NEW(yyval.declarator_list); |
| 2190 | yyval.declarator_list->first = yyvsp[-1].declarator; |
| 2191 | yyval.declarator_list->end = &yyvsp[-1].declarator->next; |
| 2192 | } |
| 2193 | break; |
| 2194 | case 151: |
| 2195 | #line 898 "c-parse.y" |
| 2196 | { |
| 2197 | yyval.declarator_list = yyvsp[-4].declarator_list; |
| 2198 | *yyval.declarator_list->end = yyvsp[-1].declarator; |
| 2199 | yyval.declarator_list->end = &yyvsp[-1].declarator->next; |
| 2200 | } |
| 2201 | break; |
| 2202 | case 153: |
| 2203 | #line 907 "c-parse.y" |
| 2204 | { |
| 2205 | if(!(yyval.declarator = yyvsp[-2].declarator)) { |
| 2206 | NEW(yyval.declarator); |
| 2207 | yyval.declarator->declaration_specifiers = top_declaration_specifiers(); |
| 2208 | } |
| 2209 | yyval.declarator->bits = yyvsp[0].expression; |
| 2210 | yyval.declarator->where = yylsp[-1]; |
| 2211 | } |
| 2212 | break; |
| 2213 | case 154: |
| 2214 | #line 920 "c-parse.y" |
| 2215 | { |
| 2216 | NEW(yyval.declaration_specifiers); |
| 2217 | yyval.declaration_specifiers->type_specifiers = TS_ENUM | TS_DEFINITION; |
| 2218 | yyval.declaration_specifiers->name = yyvsp[-5].name.name; |
| 2219 | yyval.declaration_specifiers->enumerators = yyvsp[-3].enumerator_list->first; |
| 2220 | yyval.declaration_specifiers->enum_compat_type = TS_INT; /* XXX */ |
| 2221 | if(yyvsp[-2].i) |
| 2222 | inputwarning(&yylsp[-2], warn_compat, |
| 2223 | "enumerator-list trailing comma not supported in C89 or C++"); |
| 2224 | /* XXX pick type and fix up the declarators of all the enumerators */ |
| 2225 | } |
| 2226 | break; |
| 2227 | case 155: |
| 2228 | #line 931 "c-parse.y" |
| 2229 | { |
| 2230 | NEW(yyval.declaration_specifiers); |
| 2231 | yyval.declaration_specifiers->type_specifiers = TS_ENUM; |
| 2232 | yyval.declaration_specifiers->name = yyvsp[0].name.name; |
| 2233 | } |
| 2234 | break; |
| 2235 | case 157: |
| 2236 | #line 943 "c-parse.y" |
| 2237 | { |
| 2238 | NEW(yyval.enumerator_list); |
| 2239 | yyval.enumerator_list->first = yyvsp[0].enumerator; |
| 2240 | yyval.enumerator_list->end = &yyvsp[0].enumerator->next; |
| 2241 | } |
| 2242 | break; |
| 2243 | case 158: |
| 2244 | #line 948 "c-parse.y" |
| 2245 | { |
| 2246 | *(yyval.enumerator_list = yyvsp[-2].enumerator_list)->end = yyvsp[0].enumerator; |
| 2247 | yyval.enumerator_list->end = &yyvsp[0].enumerator->next; |
| 2248 | } |
| 2249 | break; |
| 2250 | case 159: |
| 2251 | #line 955 "c-parse.y" |
| 2252 | { |
| 2253 | struct declarator *d; |
| 2254 | NEW(d); |
| 2255 | d->name = yyvsp[0].enumerator->name; |
| 2256 | d->where = yyval.enumerator->where; |
| 2257 | NEW(d->declaration_specifiers); |
| 2258 | d->declaration_specifiers->type_specifiers = TS_INT; |
| 2259 | add_declaration(d); |
| 2260 | yyval.enumerator = yyvsp[0].enumerator; |
| 2261 | yyval.enumerator->declarator = d; |
| 2262 | } |
| 2263 | break; |
| 2264 | case 160: |
| 2265 | #line 969 "c-parse.y" |
| 2266 | { |
| 2267 | NEW(yyval.enumerator); |
| 2268 | yyval.enumerator->name = yyvsp[0].name.name; |
| 2269 | yyval.enumerator->where = yylsp[0]; |
| 2270 | } |
| 2271 | break; |
| 2272 | case 161: |
| 2273 | #line 974 "c-parse.y" |
| 2274 | { |
| 2275 | NEW(yyval.enumerator); |
| 2276 | yyval.enumerator->name = yyvsp[-2].name.name; |
| 2277 | yyval.enumerator->value = yyvsp[0].expression; |
| 2278 | yyval.enumerator->where = yylsp[-2]; |
| 2279 | } |
| 2280 | break; |
| 2281 | case 166: |
| 2282 | #line 999 "c-parse.y" |
| 2283 | { yyval.declarator = get_declarator(yyvsp[0].declarator_parse, &yylsp[0]); } |
| 2284 | break; |
| 2285 | case 167: |
| 2286 | #line 1000 "c-parse.y" |
| 2287 | { yyval.declarator = 0; } |
| 2288 | break; |
| 2289 | case 168: |
| 2290 | #line 1004 "c-parse.y" |
| 2291 | { |
| 2292 | yyval.declarator_parse = yyvsp[0].declarator_parse; |
| 2293 | *yyval.declarator_parse->end = yyvsp[-1].declarator_parse->first; |
| 2294 | yyval.declarator_parse->end = yyvsp[-1].declarator_parse->end; |
| 2295 | } |
| 2296 | break; |
| 2297 | case 170: |
| 2298 | #line 1013 "c-parse.y" |
| 2299 | { |
| 2300 | NEW(yyval.declarator_parse); |
| 2301 | yyval.declarator_parse->end = &yyval.declarator_parse->first; |
| 2302 | yyval.declarator_parse->name = yyvsp[0].name.name; |
| 2303 | /* XXX warn about redeclaration */ |
| 2304 | } |
| 2305 | break; |
| 2306 | case 171: |
| 2307 | #line 1019 "c-parse.y" |
| 2308 | { |
| 2309 | yyval.declarator_parse = yyvsp[-1].declarator_parse; |
| 2310 | } |
| 2311 | break; |
| 2312 | case 172: |
| 2313 | #line 1022 "c-parse.y" |
| 2314 | { |
| 2315 | struct declarator_type *t; |
| 2316 | |
| 2317 | NEW(t); |
| 2318 | yyval.declarator_parse = yyvsp[-4].declarator_parse; |
| 2319 | t->type = dt_array; |
| 2320 | t->type_qualifiers = yyvsp[-2].declaration_specifiers->type_qualifiers; |
| 2321 | t->storage_class_specifiers = yyvsp[-2].declaration_specifiers->storage_class_specifiers; |
| 2322 | if(yyvsp[-1].expression == &expr_star) { |
| 2323 | t->u.array.size = 0; |
| 2324 | t->u.array.flags = AF_STAR; |
| 2325 | } else |
| 2326 | t->u.array.size = yyvsp[-1].expression; |
| 2327 | t->where = yylsp[-3]; |
| 2328 | *yyval.declarator_parse->end = t; |
| 2329 | yyval.declarator_parse->end = &t->next; |
| 2330 | } |
| 2331 | break; |
| 2332 | case 173: |
| 2333 | #line 1039 "c-parse.y" |
| 2334 | { |
| 2335 | struct declarator_type *t; |
| 2336 | |
| 2337 | NEW(t); |
| 2338 | yyval.declarator_parse = yyvsp[-3].declarator_parse; |
| 2339 | t->type = dt_old_function; |
| 2340 | t->u.old_function.args = yyvsp[-1].identifier_list; |
| 2341 | t->where = yylsp[-2]; |
| 2342 | *yyval.declarator_parse->end = t; |
| 2343 | yyval.declarator_parse->end = &t->next; |
| 2344 | warn_old_style_function(&yylsp[-2]); |
| 2345 | } |
| 2346 | break; |
| 2347 | case 174: |
| 2348 | #line 1051 "c-parse.y" |
| 2349 | { |
| 2350 | struct declarator_type *t; |
| 2351 | |
| 2352 | NEW(t); |
| 2353 | yyval.declarator_parse = yyvsp[-4].declarator_parse; |
| 2354 | t->type = dt_function; |
| 2355 | t->u.function.args = yyvsp[-2].declaration_list->first; |
| 2356 | t->u.function.variadic = yyvsp[-1].i; |
| 2357 | t->where = yylsp[-3]; |
| 2358 | *yyval.declarator_parse->end = t; |
| 2359 | yyval.declarator_parse->end = &t->next; |
| 2360 | } |
| 2361 | break; |
| 2362 | case 176: |
| 2363 | #line 1067 "c-parse.y" |
| 2364 | { yyval.expression = &expr_star; } |
| 2365 | break; |
| 2366 | case 177: |
| 2367 | #line 1068 "c-parse.y" |
| 2368 | { yyval.expression = 0; } |
| 2369 | break; |
| 2370 | case 178: |
| 2371 | #line 1072 "c-parse.y" |
| 2372 | { |
| 2373 | NEW(yyval.declaration_specifiers); |
| 2374 | } |
| 2375 | break; |
| 2376 | case 179: |
| 2377 | #line 1075 "c-parse.y" |
| 2378 | { |
| 2379 | NEW(yyval.declaration_specifiers); |
| 2380 | yyval.declaration_specifiers->type_qualifiers = yyvsp[0].u; |
| 2381 | yyval.declaration_specifiers->storage_class_specifiers = SCS_STATIC; |
| 2382 | } |
| 2383 | break; |
| 2384 | case 180: |
| 2385 | #line 1080 "c-parse.y" |
| 2386 | { |
| 2387 | NEW(yyval.declaration_specifiers); |
| 2388 | yyval.declaration_specifiers->type_qualifiers = yyvsp[-1].u; |
| 2389 | yyval.declaration_specifiers->storage_class_specifiers = SCS_STATIC; |
| 2390 | } |
| 2391 | break; |
| 2392 | case 181: |
| 2393 | #line 1088 "c-parse.y" |
| 2394 | { yyval.i = 1; } |
| 2395 | break; |
| 2396 | case 182: |
| 2397 | #line 1089 "c-parse.y" |
| 2398 | { yyval.i = 0; } |
| 2399 | break; |
| 2400 | case 184: |
| 2401 | #line 1095 "c-parse.y" |
| 2402 | { |
| 2403 | NEW(yyval.declarator_parse); |
| 2404 | yyval.declarator_parse->end = &yyval.declarator_parse->first; |
| 2405 | } |
| 2406 | break; |
| 2407 | case 185: |
| 2408 | #line 1102 "c-parse.y" |
| 2409 | { |
| 2410 | struct declarator_type *t; |
| 2411 | |
| 2412 | NEW(t); |
| 2413 | t->type = dt_pointer; |
| 2414 | t->type_qualifiers = yyvsp[0].u; |
| 2415 | t->where = yylsp[-1]; |
| 2416 | NEW(yyval.declarator_parse); |
| 2417 | yyval.declarator_parse->first = t; |
| 2418 | yyval.declarator_parse->end = &t->next; |
| 2419 | } |
| 2420 | break; |
| 2421 | case 186: |
| 2422 | #line 1113 "c-parse.y" |
| 2423 | { |
| 2424 | struct declarator_type *t; |
| 2425 | |
| 2426 | NEW(t); |
| 2427 | t->type = dt_pointer; |
| 2428 | t->type_qualifiers = yyvsp[-1].u; |
| 2429 | t->where = yylsp[-2]; |
| 2430 | yyval.declarator_parse = yyvsp[0].declarator_parse; |
| 2431 | *yyval.declarator_parse->end = t; |
| 2432 | yyval.declarator_parse->end = &t->next; |
| 2433 | } |
| 2434 | break; |
| 2435 | case 188: |
| 2436 | #line 1128 "c-parse.y" |
| 2437 | { yyval.u = yyvsp[-1].u | yyvsp[0].u; } |
| 2438 | break; |
| 2439 | case 191: |
| 2440 | #line 1134 "c-parse.y" |
| 2441 | { yyval.u = 0; } |
| 2442 | break; |
| 2443 | case 192: |
| 2444 | #line 1138 "c-parse.y" |
| 2445 | { |
| 2446 | NEW(yyval.declaration_list); |
| 2447 | yyval.declaration_list->first = yyvsp[0].declaration; |
| 2448 | yyval.declaration_list->end = &yyvsp[0].declaration->next; |
| 2449 | } |
| 2450 | break; |
| 2451 | case 193: |
| 2452 | #line 1143 "c-parse.y" |
| 2453 | { |
| 2454 | *yyval.declaration_list->end = yyvsp[0].declaration; |
| 2455 | yyval.declaration_list->end = &yyvsp[0].declaration->next; |
| 2456 | } |
| 2457 | break; |
| 2458 | case 194: |
| 2459 | #line 1150 "c-parse.y" |
| 2460 | { |
| 2461 | yyval.declaration_specifiers = yyvsp[0].declaration_specifiers; |
| 2462 | } |
| 2463 | break; |
| 2464 | case 195: |
| 2465 | #line 1158 "c-parse.y" |
| 2466 | { |
| 2467 | struct declarator *d = get_declarator(yyvsp[0].declarator_parse, &yylsp[0]); |
| 2468 | check_top_declaration_specifier(yyvsp[-1].declaration_specifiers); |
| 2469 | pop_declaration_specifiers(); |
| 2470 | NEW(yyval.declaration); |
| 2471 | yyval.declaration->declaration_specifiers = yyvsp[-1].declaration_specifiers; |
| 2472 | yyval.declaration->declarator_list = d; |
| 2473 | yyval.declaration->where = yylsp[-1]; |
| 2474 | } |
| 2475 | break; |
| 2476 | case 196: |
| 2477 | #line 1167 "c-parse.y" |
| 2478 | { |
| 2479 | struct declarator *d = get_declarator(yyvsp[0].declarator_parse, yyvsp[0].declarator_parse->first ? &yylsp[0] : &yylsp[-1]); |
| 2480 | check_top_declaration_specifier(yyvsp[-1].declaration_specifiers); |
| 2481 | pop_declaration_specifiers(); |
| 2482 | NEW(yyval.declaration); |
| 2483 | yyval.declaration->declaration_specifiers = yyvsp[-1].declaration_specifiers; |
| 2484 | yyval.declaration->declarator_list = d; |
| 2485 | yyval.declaration->where = yylsp[-1]; |
| 2486 | } |
| 2487 | break; |
| 2488 | case 197: |
| 2489 | #line 1183 "c-parse.y" |
| 2490 | { yyval.identifier_list = yyvsp[0].identifier_list_parse->first; } |
| 2491 | break; |
| 2492 | case 198: |
| 2493 | #line 1184 "c-parse.y" |
| 2494 | { yyval.identifier_list = 0; } |
| 2495 | break; |
| 2496 | case 199: |
| 2497 | #line 1188 "c-parse.y" |
| 2498 | { |
| 2499 | struct identifier_list *i; |
| 2500 | |
| 2501 | NEW(i); |
| 2502 | i->id = yyvsp[0].name.name; |
| 2503 | /* XXX warn about redeclaration */ |
| 2504 | NEW(yyval.identifier_list_parse); |
| 2505 | yyval.identifier_list_parse->first = i; |
| 2506 | yyval.identifier_list_parse->end = &i->next; |
| 2507 | } |
| 2508 | break; |
| 2509 | case 200: |
| 2510 | #line 1198 "c-parse.y" |
| 2511 | { |
| 2512 | struct identifier_list *i; |
| 2513 | |
| 2514 | NEW(i); |
| 2515 | i->id = yyvsp[0].name.name; |
| 2516 | /* XXX warn about redeclaration */ |
| 2517 | *(yyval.identifier_list_parse = yyvsp[-2].identifier_list_parse)->end = i; |
| 2518 | yyval.identifier_list_parse->end = &i->next; |
| 2519 | } |
| 2520 | break; |
| 2521 | case 201: |
| 2522 | #line 1212 "c-parse.y" |
| 2523 | { |
| 2524 | struct declarator *d = get_declarator(yyvsp[0].declarator_parse, yyvsp[0].declarator_parse->first ? &yylsp[0] : &yylsp[-1]); |
| 2525 | check_top_declaration_specifier(yyvsp[-1].declaration_specifiers); |
| 2526 | pop_declaration_specifiers(); |
| 2527 | NEW(yyval.declaration); |
| 2528 | yyval.declaration->declaration_specifiers = yyvsp[-1].declaration_specifiers; |
| 2529 | yyval.declaration->declarator_list = d; |
| 2530 | yyval.declaration->where = yylsp[-1]; |
| 2531 | /* declaration_constraints checked by calling production */ |
| 2532 | } |
| 2533 | break; |
| 2534 | case 202: |
| 2535 | #line 1225 "c-parse.y" |
| 2536 | { |
| 2537 | yyval.declarator_parse = yyvsp[-1].declarator_parse; |
| 2538 | } |
| 2539 | break; |
| 2540 | case 203: |
| 2541 | #line 1228 "c-parse.y" |
| 2542 | { |
| 2543 | struct declarator_type *t; |
| 2544 | |
| 2545 | NEW(t); |
| 2546 | yyval.declarator_parse = yyvsp[-4].declarator_parse; |
| 2547 | t->type = dt_array; |
| 2548 | t->type_qualifiers = yyvsp[-2].declaration_specifiers->type_qualifiers; |
| 2549 | t->storage_class_specifiers = yyvsp[-2].declaration_specifiers->storage_class_specifiers; |
| 2550 | if(yyvsp[-1].expression == &expr_star) { |
| 2551 | t->u.array.size = 0; |
| 2552 | t->u.array.flags = AF_STAR; |
| 2553 | } else |
| 2554 | t->u.array.size = yyvsp[-1].expression; |
| 2555 | t->where = yylsp[-3]; |
| 2556 | *yyval.declarator_parse->end = t; |
| 2557 | yyval.declarator_parse->end = &t->next; |
| 2558 | } |
| 2559 | break; |
| 2560 | case 204: |
| 2561 | #line 1245 "c-parse.y" |
| 2562 | { |
| 2563 | struct declarator_type *t; |
| 2564 | |
| 2565 | NEW(t); |
| 2566 | yyval.declarator_parse = yyvsp[-2].declarator_parse; |
| 2567 | t->type = dt_old_function; |
| 2568 | t->u.old_function.args = 0; |
| 2569 | t->where = yylsp[-1]; |
| 2570 | *yyval.declarator_parse->end = t; |
| 2571 | yyval.declarator_parse->end = &t->next; |
| 2572 | warn_old_style_function(&yylsp[-1]); |
| 2573 | } |
| 2574 | break; |
| 2575 | case 205: |
| 2576 | #line 1257 "c-parse.y" |
| 2577 | { |
| 2578 | struct declarator_type *t; |
| 2579 | |
| 2580 | NEW(t); |
| 2581 | yyval.declarator_parse = yyvsp[-4].declarator_parse; |
| 2582 | t->type = dt_function; |
| 2583 | t->u.function.args = yyvsp[-2].declaration_list->first; |
| 2584 | t->u.function.variadic = yyvsp[-1].i; |
| 2585 | t->where = yylsp[-3]; |
| 2586 | *yyval.declarator_parse->end = t; |
| 2587 | yyval.declarator_parse->end = &t->next; |
| 2588 | } |
| 2589 | break; |
| 2590 | case 207: |
| 2591 | #line 1273 "c-parse.y" |
| 2592 | { |
| 2593 | NEW(yyval.declarator_parse); |
| 2594 | yyval.declarator_parse->end = &yyval.declarator_parse->first; |
| 2595 | yyloc = (struct location){path, line}; |
| 2596 | } |
| 2597 | break; |
| 2598 | case 209: |
| 2599 | #line 1282 "c-parse.y" |
| 2600 | { |
| 2601 | NEW(yyval.declarator_parse); |
| 2602 | yyval.declarator_parse->end = &yyval.declarator_parse->first; |
| 2603 | yyloc = (struct location){path, line}; |
| 2604 | } |
| 2605 | break; |
| 2606 | case 211: |
| 2607 | #line 1291 "c-parse.y" |
| 2608 | { |
| 2609 | yyval.declarator_parse = yyvsp[0].declarator_parse; |
| 2610 | *yyval.declarator_parse->end = yyvsp[-1].declarator_parse->first; |
| 2611 | yyval.declarator_parse->end = yyvsp[-1].declarator_parse->end; |
| 2612 | } |
| 2613 | break; |
| 2614 | case 212: |
| 2615 | #line 1301 "c-parse.y" |
| 2616 | { |
| 2617 | NEW(yyval.initializer); |
| 2618 | yyval.initializer->type = in_expr; |
| 2619 | yyval.initializer->u.expr = yyvsp[0].expression; |
| 2620 | } |
| 2621 | break; |
| 2622 | case 213: |
| 2623 | #line 1306 "c-parse.y" |
| 2624 | { |
| 2625 | NEW(yyval.initializer); |
| 2626 | yyval.initializer->type = in_list; |
| 2627 | yyval.initializer->u.list = yyvsp[-2].initializer_list->first; |
| 2628 | } |
| 2629 | break; |
| 2630 | case 214: |
| 2631 | #line 1314 "c-parse.y" |
| 2632 | { yyval.i = 1; } |
| 2633 | break; |
| 2634 | case 215: |
| 2635 | #line 1315 "c-parse.y" |
| 2636 | { yyval.i = 0; } |
| 2637 | break; |
| 2638 | case 216: |
| 2639 | #line 1319 "c-parse.y" |
| 2640 | { |
| 2641 | NEW(yyval.initializer_list); |
| 2642 | yyval.initializer_list->first = yyvsp[0].initializer; |
| 2643 | yyval.initializer_list->end = &yyvsp[0].initializer->next; |
| 2644 | } |
| 2645 | break; |
| 2646 | case 217: |
| 2647 | #line 1324 "c-parse.y" |
| 2648 | { |
| 2649 | *(yyval.initializer_list = yyvsp[-2].initializer_list)->end = yyvsp[0].initializer; |
| 2650 | yyval.initializer_list->end = &yyvsp[0].initializer->next; |
| 2651 | } |
| 2652 | break; |
| 2653 | case 218: |
| 2654 | #line 1331 "c-parse.y" |
| 2655 | { |
| 2656 | (yyval.initializer = yyvsp[0].initializer)->designator = yyvsp[-2].designator_list->first; |
| 2657 | yyval.initializer->syntax = des_c99; |
| 2658 | } |
| 2659 | break; |
| 2660 | case 219: |
| 2661 | #line 1335 "c-parse.y" |
| 2662 | { |
| 2663 | (yyval.initializer = yyvsp[0].initializer)->designator = yyvsp[-1].designator; |
| 2664 | yyval.initializer->syntax = des_gcc_raw; |
| 2665 | inputwarning(&yylsp[-1], warn_compat, |
| 2666 | "non-portable GNU C initializer designator"); |
| 2667 | } |
| 2668 | break; |
| 2669 | case 220: |
| 2670 | #line 1341 "c-parse.y" |
| 2671 | { |
| 2672 | struct designator *d; |
| 2673 | |
| 2674 | NEW(d); |
| 2675 | d->type = des_field; |
| 2676 | d->u.name = yyvsp[-2].name.name; |
| 2677 | d->where = yylsp[-2]; |
| 2678 | (yyval.initializer = yyvsp[0].initializer)->designator = d; |
| 2679 | yyval.initializer->syntax = des_gcc_colon; |
| 2680 | inputwarning(&yylsp[-2], warn_compat, |
| 2681 | "non-portable GNU C initializer designator"); |
| 2682 | } |
| 2683 | break; |
| 2684 | case 222: |
| 2685 | #line 1357 "c-parse.y" |
| 2686 | { |
| 2687 | NEW(yyval.designator_list); |
| 2688 | yyval.designator_list->first = yyvsp[0].designator; |
| 2689 | yyval.designator_list->end = &yyvsp[0].designator->next; |
| 2690 | } |
| 2691 | break; |
| 2692 | case 223: |
| 2693 | #line 1362 "c-parse.y" |
| 2694 | { |
| 2695 | *(yyval.designator_list = yyvsp[-1].designator_list)->end = yyvsp[0].designator; |
| 2696 | yyval.designator_list->end = &yyvsp[0].designator->next; |
| 2697 | } |
| 2698 | break; |
| 2699 | case 224: |
| 2700 | #line 1369 "c-parse.y" |
| 2701 | { |
| 2702 | NEW(yyval.designator); |
| 2703 | yyval.designator->type = des_expr; |
| 2704 | yyval.designator->u.expr = yyvsp[-1].expression; |
| 2705 | yyval.designator->where = yylsp[-2]; |
| 2706 | } |
| 2707 | break; |
| 2708 | case 225: |
| 2709 | #line 1375 "c-parse.y" |
| 2710 | { |
| 2711 | NEW(yyval.designator); |
| 2712 | yyval.designator->type = des_field; |
| 2713 | yyval.designator->u.name = yyvsp[0].name.name; |
| 2714 | yyval.designator->where = yylsp[-1]; |
| 2715 | } |
| 2716 | break; |
| 2717 | case 226: |
| 2718 | #line 1386 "c-parse.y" |
| 2719 | { |
| 2720 | NEW(yyval.statement); |
| 2721 | yyval.statement->type = st_label; |
| 2722 | yyval.statement->u.label.label = yyvsp[-3].name.name; |
| 2723 | /* XXX warn about redeclaration */ |
| 2724 | yyval.statement->u.label.body = yyvsp[0].statement; |
| 2725 | yyval.statement->where = yylsp[-3]; |
| 2726 | } |
| 2727 | break; |
| 2728 | case 227: |
| 2729 | #line 1394 "c-parse.y" |
| 2730 | { |
| 2731 | NEW(yyval.statement); |
| 2732 | yyval.statement->type = st_case; |
| 2733 | yyval.statement->u.case_.value = yyvsp[-2].expression; |
| 2734 | yyval.statement->u.case_.body = yyvsp[0].statement; |
| 2735 | yyval.statement->where = yylsp[-3]; |
| 2736 | } |
| 2737 | break; |
| 2738 | case 228: |
| 2739 | #line 1401 "c-parse.y" |
| 2740 | { |
| 2741 | NEW(yyval.statement); |
| 2742 | yyval.statement->type = st_default; |
| 2743 | yyval.statement->u.default_ = yyvsp[0].statement; |
| 2744 | yyval.statement->where = yylsp[-2]; |
| 2745 | } |
| 2746 | break; |
| 2747 | case 229: |
| 2748 | #line 1407 "c-parse.y" |
| 2749 | { |
| 2750 | NEW(yyval.statement); |
| 2751 | yyval.statement->type = st_if; |
| 2752 | yyval.statement->u.if_.cond = yyvsp[-3].expression; |
| 2753 | yyval.statement->u.if_.true = yyvsp[-1].statement; |
| 2754 | yyval.statement->u.if_.false = yyvsp[0].statement; |
| 2755 | yyval.statement->where = yylsp[-5]; |
| 2756 | } |
| 2757 | break; |
| 2758 | case 230: |
| 2759 | #line 1415 "c-parse.y" |
| 2760 | { |
| 2761 | NEW(yyval.statement); |
| 2762 | yyval.statement->type = st_switch; |
| 2763 | yyval.statement->u.switch_.cond = yyvsp[-2].expression; |
| 2764 | yyval.statement->u.switch_.body = yyvsp[0].statement; |
| 2765 | yyval.statement->where = yylsp[-4]; |
| 2766 | } |
| 2767 | break; |
| 2768 | case 231: |
| 2769 | #line 1422 "c-parse.y" |
| 2770 | { |
| 2771 | NEW(yyval.statement); |
| 2772 | yyval.statement->type = st_expression; |
| 2773 | yyval.statement->u.expression = yyvsp[-1].expression; |
| 2774 | yyval.statement->where = yyvsp[-1].expression ? yylsp[-1] : yylsp[0]; |
| 2775 | } |
| 2776 | break; |
| 2777 | case 232: |
| 2778 | #line 1428 "c-parse.y" |
| 2779 | { |
| 2780 | NEW(yyval.statement); |
| 2781 | yyval.statement->type = st_while; |
| 2782 | yyval.statement->u.while_.cond = yyvsp[-2].expression; |
| 2783 | yyval.statement->u.while_.body = yyvsp[0].statement; |
| 2784 | yyval.statement->where = yylsp[-4]; |
| 2785 | } |
| 2786 | break; |
| 2787 | case 233: |
| 2788 | #line 1435 "c-parse.y" |
| 2789 | { |
| 2790 | NEW(yyval.statement); |
| 2791 | yyval.statement->type = st_do; |
| 2792 | yyval.statement->u.while_.cond = yyvsp[-2].expression; |
| 2793 | yyval.statement->u.while_.body = yyvsp[-5].statement; |
| 2794 | yyval.statement->where = yylsp[-6]; |
| 2795 | } |
| 2796 | break; |
| 2797 | case 234: |
| 2798 | #line 1444 "c-parse.y" |
| 2799 | { |
| 2800 | NEW(yyval.statement); |
| 2801 | yyval.statement->type = st_for; |
| 2802 | yyval.statement->u.for_.init = yyvsp[-6].expression; |
| 2803 | yyval.statement->u.for_.cond = yyvsp[-4].expression; |
| 2804 | yyval.statement->u.for_.iter = yyvsp[-2].expression; |
| 2805 | yyval.statement->u.for_.body = yyvsp[0].statement; |
| 2806 | yyval.statement->where = yylsp[-8]; |
| 2807 | } |
| 2808 | break; |
| 2809 | case 235: |
| 2810 | #line 1454 "c-parse.y" |
| 2811 | { enter_scope(); } |
| 2812 | break; |
| 2813 | case 236: |
| 2814 | #line 1457 "c-parse.y" |
| 2815 | { |
| 2816 | NEW(yyval.statement); |
| 2817 | yyval.statement->type = st_for_declaration; |
| 2818 | yyval.statement->u.for_declaration.init = yyvsp[-5].declaration; |
| 2819 | yyval.statement->u.for_declaration.cond = yyvsp[-4].expression; |
| 2820 | yyval.statement->u.for_declaration.iter = yyvsp[-2].expression; |
| 2821 | yyval.statement->u.for_declaration.body = yyvsp[0].statement; |
| 2822 | yyval.statement->where = yylsp[-8]; |
| 2823 | exit_scope(); |
| 2824 | } |
| 2825 | break; |
| 2826 | case 237: |
| 2827 | #line 1467 "c-parse.y" |
| 2828 | { |
| 2829 | NEW(yyval.statement); |
| 2830 | yyval.statement->type = st_goto; |
| 2831 | yyval.statement->u.goto_ = yyvsp[-1].name.name; |
| 2832 | yyval.statement->where = yylsp[-2]; |
| 2833 | } |
| 2834 | break; |
| 2835 | case 238: |
| 2836 | #line 1473 "c-parse.y" |
| 2837 | { |
| 2838 | NEW(yyval.statement); |
| 2839 | yyval.statement->type = st_continue; |
| 2840 | yyval.statement->where = yylsp[-1]; |
| 2841 | } |
| 2842 | break; |
| 2843 | case 239: |
| 2844 | #line 1478 "c-parse.y" |
| 2845 | { |
| 2846 | NEW(yyval.statement); |
| 2847 | yyval.statement->type = st_break; |
| 2848 | yyval.statement->where = yylsp[-1]; |
| 2849 | } |
| 2850 | break; |
| 2851 | case 240: |
| 2852 | #line 1483 "c-parse.y" |
| 2853 | { |
| 2854 | NEW(yyval.statement); |
| 2855 | yyval.statement->type = st_return; |
| 2856 | yyval.statement->u.expression = yyvsp[-1].expression; |
| 2857 | yyval.statement->where = yylsp[-2]; |
| 2858 | } |
| 2859 | break; |
| 2860 | case 241: |
| 2861 | #line 1489 "c-parse.y" |
| 2862 | { enter_scope(); } |
| 2863 | break; |
| 2864 | case 242: |
| 2865 | #line 1489 "c-parse.y" |
| 2866 | { |
| 2867 | NEW(yyval.statement); |
| 2868 | yyval.statement->type = st_compound; |
| 2869 | yyval.statement->u.compound.body = yyvsp[-1].statement_list->first; |
| 2870 | yyval.statement->where = yylsp[-3]; |
| 2871 | yyval.statement->u.compound.endwhere = yylsp[0]; |
| 2872 | /*$$->u.compound.scope = scope;*/ |
| 2873 | exit_scope(); |
| 2874 | } |
| 2875 | break; |
| 2876 | case 243: |
| 2877 | #line 1502 "c-parse.y" |
| 2878 | { |
| 2879 | NEW(yyval.statement); |
| 2880 | yyval.statement->type = st_compound; |
| 2881 | yyval.statement->u.compound.body = yyvsp[-1].statement_list->first; |
| 2882 | yyval.statement->where = yylsp[-2]; |
| 2883 | yyval.statement->u.compound.endwhere = yylsp[0]; |
| 2884 | /*$$->u.compound.scope = scope;*/ |
| 2885 | } |
| 2886 | break; |
| 2887 | case 244: |
| 2888 | #line 1513 "c-parse.y" |
| 2889 | { |
| 2890 | *(yyval.statement_list = yyvsp[-1].statement_list)->end = yyvsp[0].statement; |
| 2891 | yyval.statement_list->end = &yyvsp[0].statement->next; |
| 2892 | } |
| 2893 | break; |
| 2894 | case 245: |
| 2895 | #line 1517 "c-parse.y" |
| 2896 | { |
| 2897 | NEW(yyval.statement_list); |
| 2898 | yyval.statement_list->end = &yyval.statement_list->first; |
| 2899 | } |
| 2900 | break; |
| 2901 | case 246: |
| 2902 | #line 1524 "c-parse.y" |
| 2903 | { |
| 2904 | NEW(yyval.statement); |
| 2905 | yyval.statement->type = st_declaration; |
| 2906 | yyval.statement->u.declaration = yyvsp[0].declaration; |
| 2907 | yyval.statement->where = yylsp[0]; |
| 2908 | declaration_constraints(yyvsp[0].declaration, dc_block_scope); |
| 2909 | } |
| 2910 | break; |
| 2911 | case 248: |
| 2912 | #line 1536 "c-parse.y" |
| 2913 | { yyval.statement = yyvsp[0].statement; } |
| 2914 | break; |
| 2915 | case 249: |
| 2916 | #line 1537 "c-parse.y" |
| 2917 | { yyval.statement = 0; } |
| 2918 | break; |
| 2919 | case 250: |
| 2920 | #line 1543 "c-parse.y" |
| 2921 | { |
| 2922 | NEW(yyval.external_declaration_list); |
| 2923 | translation_unit = yyval.external_declaration_list->first = yyvsp[0].external_declaration; |
| 2924 | yyval.external_declaration_list->end = &yyvsp[0].external_declaration->next; |
| 2925 | } |
| 2926 | break; |
| 2927 | case 251: |
| 2928 | #line 1548 "c-parse.y" |
| 2929 | { |
| 2930 | yyval.external_declaration_list = yyvsp[-1].external_declaration_list; |
| 2931 | *yyval.external_declaration_list->end = yyvsp[0].external_declaration; |
| 2932 | yyval.external_declaration_list->end = &yyvsp[0].external_declaration->next; |
| 2933 | } |
| 2934 | break; |
| 2935 | case 252: |
| 2936 | #line 1553 "c-parse.y" |
| 2937 | { |
| 2938 | inputerror(&yylsp[0], "redundant semicolon at top level"); |
| 2939 | } |
| 2940 | break; |
| 2941 | case 253: |
| 2942 | #line 1559 "c-parse.y" |
| 2943 | { |
| 2944 | NEW(yyval.external_declaration); |
| 2945 | yyval.external_declaration->type = ed_declaration; |
| 2946 | yyval.external_declaration->u.declaration = yyvsp[0].declaration; |
| 2947 | declaration_constraints(yyvsp[0].declaration, dc_file_scope); |
| 2948 | } |
| 2949 | break; |
| 2950 | case 254: |
| 2951 | #line 1565 "c-parse.y" |
| 2952 | { |
| 2953 | NEW(yyval.external_declaration); |
| 2954 | yyval.external_declaration->type = ed_function_definition; |
| 2955 | yyval.external_declaration->u.function_definition = yyvsp[0].function_definition; |
| 2956 | /* constraints checked in function_definition (i.e. before errors |
| 2957 | * from the function body) */ |
| 2958 | } |
| 2959 | break; |
| 2960 | case 255: |
| 2961 | #line 1577 "c-parse.y" |
| 2962 | { |
| 2963 | check_top_declaration_specifier(yyvsp[-1].declaration_specifiers); |
| 2964 | pop_declaration_specifiers(); |
| 2965 | declarator_constraints(yyvsp[-1].declaration_specifiers, yyvsp[0].declarator, dc_function_definition, 0); |
| 2966 | NEW(yyval.declaration); |
| 2967 | yyval.declaration->declaration_specifiers = yyvsp[-1].declaration_specifiers; |
| 2968 | yyval.declaration->declarator_list = yyvsp[0].declarator; |
| 2969 | yyval.declaration->where = yylsp[-1]; |
| 2970 | add_declaration(yyvsp[0].declarator); |
| 2971 | enter_scope(); |
| 2972 | { |
| 2973 | struct declarator *d; |
| 2974 | NEW(d); |
| 2975 | NEW(d->declaration_specifiers); |
| 2976 | NEW(d->declarator_type); |
| 2977 | d->name = xstrdup("__PRETTY_FUNCTION__"); |
| 2978 | d->declaration_specifiers->type_qualifiers = TQ_CONST; |
| 2979 | d->declaration_specifiers->type_specifiers = TS_CHAR; |
| 2980 | d->declarator_type->type = dt_pointer; |
| 2981 | add_declaration(d); |
| 2982 | } |
| 2983 | /* we had better be in the right scope before parsing the declaration |
| 2984 | * list for old style functions */ |
| 2985 | } |
| 2986 | break; |
| 2987 | case 256: |
| 2988 | #line 1600 "c-parse.y" |
| 2989 | { |
| 2990 | struct declaration *decl; |
| 2991 | struct declarator *d = 0; /* quieten compiler */ |
| 2992 | |
| 2993 | /* inject function args into scope */ |
| 2994 | if(yyvsp[-2].declarator->declarator_type) switch(yyvsp[-2].declarator->declarator_type->type) { |
| 2995 | case dt_function: |
| 2996 | if(!is_void_args(yyvsp[-2].declarator->declarator_type)) { |
| 2997 | for(decl = yyvsp[-2].declarator->declarator_type->u.function.args; |
| 2998 | decl; |
| 2999 | decl = decl->next) { |
| 3000 | decl->declarator_list->flags |= DF_PARAM; |
| 3001 | add_declaration(decl->declarator_list); |
| 3002 | } |
| 3003 | } |
| 3004 | if(yyvsp[0].declaration_list->first) |
| 3005 | inputerror(&yylsp[0], "declaration-list not required for new-style function definitions"); |
| 3006 | break; |
| 3007 | case dt_old_function: |
| 3008 | if(yyvsp[-2].declarator->declarator_type->u.old_function.args) { |
| 3009 | struct identifier_list *i; |
| 3010 | |
| 3011 | for(i = yyvsp[-2].declarator->declarator_type->u.old_function.args; |
| 3012 | i; |
| 3013 | i = i->next) { |
| 3014 | for(decl = yyvsp[0].declaration_list->first; |
| 3015 | decl; |
| 3016 | decl = decl->next) |
| 3017 | for(d = decl->declarator_list; |
| 3018 | d; |
| 3019 | d = d->next) |
| 3020 | if(!strcmp(d->name, i->id)) |
| 3021 | break; |
| 3022 | if(d) { |
| 3023 | d->flags |= DF_PARAM; |
| 3024 | add_declaration(d); |
| 3025 | } else { |
| 3026 | /* default to int */ |
| 3027 | NEW(d); |
| 3028 | d->name = i->id; |
| 3029 | NEW(d->declaration_specifiers); |
| 3030 | d->declaration_specifiers->type_specifiers = TS_INT; |
| 3031 | d->flags = DF_PARAM; |
| 3032 | add_declaration(d); |
| 3033 | } |
| 3034 | } |
| 3035 | } |
| 3036 | /* check that all the identifiers in the list are actually |
| 3037 | * parameters */ |
| 3038 | for(decl = yyvsp[0].declaration_list->first; decl; decl = decl->next) |
| 3039 | for(d = decl->declarator_list; |
| 3040 | d; |
| 3041 | d = d->next) { |
| 3042 | struct identifier_list *i; |
| 3043 | |
| 3044 | for(i = yyvsp[-2].declarator->declarator_type->u.old_function.args; i; i = i->next) |
| 3045 | if(!strcmp(d->name, i->id)) |
| 3046 | break; |
| 3047 | if(!i) |
| 3048 | inputerror(&d->where, "'%s' is not a parameter", d->name); |
| 3049 | } |
| 3050 | break; |
| 3051 | |
| 3052 | default: /* quieten compiler */ |
| 3053 | break; |
| 3054 | } |
| 3055 | } |
| 3056 | break; |
| 3057 | case 257: |
| 3058 | #line 1666 "c-parse.y" |
| 3059 | { |
| 3060 | NEW(yyval.function_definition); |
| 3061 | yyval.function_definition->declaration = yyvsp[-3].declaration; |
| 3062 | yyval.function_definition->args = yyvsp[-2].declaration_list->first; |
| 3063 | yyval.function_definition->body = yyvsp[0].statement; |
| 3064 | exit_scope(); |
| 3065 | } |
| 3066 | break; |
| 3067 | case 258: |
| 3068 | #line 1676 "c-parse.y" |
| 3069 | { |
| 3070 | *(yyval.declaration_list = yyvsp[-1].declaration_list)->end = yyvsp[0].declaration; |
| 3071 | yyval.declaration_list->end = &yyvsp[0].declaration->next; |
| 3072 | } |
| 3073 | break; |
| 3074 | case 259: |
| 3075 | #line 1680 "c-parse.y" |
| 3076 | { |
| 3077 | NEW(yyval.declaration_list); |
| 3078 | yyval.declaration_list->end = &yyval.declaration_list->first; |
| 3079 | } |
| 3080 | break; |
| 3081 | case 262: |
| 3082 | #line 1694 "c-parse.y" |
| 3083 | { |
| 3084 | static int attr_warning; |
| 3085 | if(!attr_warning++) |
| 3086 | inputwarning(&yylsp[-5], warn_compat, "GNU C attributes are ignored"); |
| 3087 | } |
| 3088 | break; |
| 3089 | case 265: |
| 3090 | #line 1707 "c-parse.y" |
| 3091 | { } |
| 3092 | break; |
| 3093 | case 266: |
| 3094 | #line 1708 "c-parse.y" |
| 3095 | { } |
| 3096 | break; |
| 3097 | case 267: |
| 3098 | #line 1710 "c-parse.y" |
| 3099 | { suppress_errors(); } |
| 3100 | break; |
| 3101 | case 268: |
| 3102 | #line 1712 "c-parse.y" |
| 3103 | { restore_errors(); } |
| 3104 | break; |
| 3105 | case 269: |
| 3106 | #line 1713 "c-parse.y" |
| 3107 | { } |
| 3108 | break; |
| 3109 | } |
| 3110 | |
| 3111 | #line 705 "/usr/share/bison/bison.simple" |
| 3112 | |
| 3113 | \f |
| 3114 | yyvsp -= yylen; |
| 3115 | yyssp -= yylen; |
| 3116 | #if YYLSP_NEEDED |
| 3117 | yylsp -= yylen; |
| 3118 | #endif |
| 3119 | |
| 3120 | #if YYDEBUG |
| 3121 | if (yydebug) |
| 3122 | { |
| 3123 | short *yyssp1 = yyss - 1; |
| 3124 | YYFPRINTF (stderr, "state stack now"); |
| 3125 | while (yyssp1 != yyssp) |
| 3126 | YYFPRINTF (stderr, " %d", *++yyssp1); |
| 3127 | YYFPRINTF (stderr, "\n"); |
| 3128 | } |
| 3129 | #endif |
| 3130 | |
| 3131 | *++yyvsp = yyval; |
| 3132 | #if YYLSP_NEEDED |
| 3133 | *++yylsp = yyloc; |
| 3134 | #endif |
| 3135 | |
| 3136 | /* Now `shift' the result of the reduction. Determine what state |
| 3137 | that goes to, based on the state we popped back to and the rule |
| 3138 | number reduced by. */ |
| 3139 | |
| 3140 | yyn = yyr1[yyn]; |
| 3141 | |
| 3142 | yystate = yypgoto[yyn - YYNTBASE] + *yyssp; |
| 3143 | if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) |
| 3144 | yystate = yytable[yystate]; |
| 3145 | else |
| 3146 | yystate = yydefgoto[yyn - YYNTBASE]; |
| 3147 | |
| 3148 | goto yynewstate; |
| 3149 | |
| 3150 | |
| 3151 | /*------------------------------------. |
| 3152 | | yyerrlab -- here on detecting error | |
| 3153 | `------------------------------------*/ |
| 3154 | yyerrlab: |
| 3155 | /* If not already recovering from an error, report this error. */ |
| 3156 | if (!yyerrstatus) |
| 3157 | { |
| 3158 | ++yynerrs; |
| 3159 | |
| 3160 | #ifdef YYERROR_VERBOSE |
| 3161 | yyn = yypact[yystate]; |
| 3162 | |
| 3163 | if (yyn > YYFLAG && yyn < YYLAST) |
| 3164 | { |
| 3165 | YYSIZE_T yysize = 0; |
| 3166 | char *yymsg; |
| 3167 | int yyx, yycount; |
| 3168 | |
| 3169 | yycount = 0; |
| 3170 | /* Start YYX at -YYN if negative to avoid negative indexes in |
| 3171 | YYCHECK. */ |
| 3172 | for (yyx = yyn < 0 ? -yyn : 0; |
| 3173 | yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) |
| 3174 | if (yycheck[yyx + yyn] == yyx) |
| 3175 | yysize += yystrlen (yytname[yyx]) + 15, yycount++; |
| 3176 | yysize += yystrlen ("parse error, unexpected ") + 1; |
| 3177 | yysize += yystrlen (yytname[YYTRANSLATE (yychar)]); |
| 3178 | yymsg = (char *) YYSTACK_ALLOC (yysize); |
| 3179 | if (yymsg != 0) |
| 3180 | { |
| 3181 | char *yyp = yystpcpy (yymsg, "parse error, unexpected "); |
| 3182 | yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]); |
| 3183 | |
| 3184 | if (yycount < 5) |
| 3185 | { |
| 3186 | yycount = 0; |
| 3187 | for (yyx = yyn < 0 ? -yyn : 0; |
| 3188 | yyx < (int) (sizeof (yytname) / sizeof (char *)); |
| 3189 | yyx++) |
| 3190 | if (yycheck[yyx + yyn] == yyx) |
| 3191 | { |
| 3192 | const char *yyq = ! yycount ? ", expecting " : " or "; |
| 3193 | yyp = yystpcpy (yyp, yyq); |
| 3194 | yyp = yystpcpy (yyp, yytname[yyx]); |
| 3195 | yycount++; |
| 3196 | } |
| 3197 | } |
| 3198 | yyerror (yymsg); |
| 3199 | YYSTACK_FREE (yymsg); |
| 3200 | } |
| 3201 | else |
| 3202 | yyerror ("parse error; also virtual memory exhausted"); |
| 3203 | } |
| 3204 | else |
| 3205 | #endif /* defined (YYERROR_VERBOSE) */ |
| 3206 | yyerror ("parse error"); |
| 3207 | } |
| 3208 | goto yyerrlab1; |
| 3209 | |
| 3210 | |
| 3211 | /*--------------------------------------------------. |
| 3212 | | yyerrlab1 -- error raised explicitly by an action | |
| 3213 | `--------------------------------------------------*/ |
| 3214 | yyerrlab1: |
| 3215 | if (yyerrstatus == 3) |
| 3216 | { |
| 3217 | /* If just tried and failed to reuse lookahead token after an |
| 3218 | error, discard it. */ |
| 3219 | |
| 3220 | /* return failure if at end of input */ |
| 3221 | if (yychar == YYEOF) |
| 3222 | YYABORT; |
| 3223 | YYDPRINTF ((stderr, "Discarding token %d (%s).\n", |
| 3224 | yychar, yytname[yychar1])); |
| 3225 | yychar = YYEMPTY; |
| 3226 | } |
| 3227 | |
| 3228 | /* Else will try to reuse lookahead token after shifting the error |
| 3229 | token. */ |
| 3230 | |
| 3231 | yyerrstatus = 3; /* Each real token shifted decrements this */ |
| 3232 | |
| 3233 | goto yyerrhandle; |
| 3234 | |
| 3235 | |
| 3236 | /*-------------------------------------------------------------------. |
| 3237 | | yyerrdefault -- current state does not do anything special for the | |
| 3238 | | error token. | |
| 3239 | `-------------------------------------------------------------------*/ |
| 3240 | yyerrdefault: |
| 3241 | #if 0 |
| 3242 | /* This is wrong; only states that explicitly want error tokens |
| 3243 | should shift them. */ |
| 3244 | |
| 3245 | /* If its default is to accept any token, ok. Otherwise pop it. */ |
| 3246 | yyn = yydefact[yystate]; |
| 3247 | if (yyn) |
| 3248 | goto yydefault; |
| 3249 | #endif |
| 3250 | |
| 3251 | |
| 3252 | /*---------------------------------------------------------------. |
| 3253 | | yyerrpop -- pop the current state because it cannot handle the | |
| 3254 | | error token | |
| 3255 | `---------------------------------------------------------------*/ |
| 3256 | yyerrpop: |
| 3257 | if (yyssp == yyss) |
| 3258 | YYABORT; |
| 3259 | yyvsp--; |
| 3260 | yystate = *--yyssp; |
| 3261 | #if YYLSP_NEEDED |
| 3262 | yylsp--; |
| 3263 | #endif |
| 3264 | |
| 3265 | #if YYDEBUG |
| 3266 | if (yydebug) |
| 3267 | { |
| 3268 | short *yyssp1 = yyss - 1; |
| 3269 | YYFPRINTF (stderr, "Error: state stack now"); |
| 3270 | while (yyssp1 != yyssp) |
| 3271 | YYFPRINTF (stderr, " %d", *++yyssp1); |
| 3272 | YYFPRINTF (stderr, "\n"); |
| 3273 | } |
| 3274 | #endif |
| 3275 | |
| 3276 | /*--------------. |
| 3277 | | yyerrhandle. | |
| 3278 | `--------------*/ |
| 3279 | yyerrhandle: |
| 3280 | yyn = yypact[yystate]; |
| 3281 | if (yyn == YYFLAG) |
| 3282 | goto yyerrdefault; |
| 3283 | |
| 3284 | yyn += YYTERROR; |
| 3285 | if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) |
| 3286 | goto yyerrdefault; |
| 3287 | |
| 3288 | yyn = yytable[yyn]; |
| 3289 | if (yyn < 0) |
| 3290 | { |
| 3291 | if (yyn == YYFLAG) |
| 3292 | goto yyerrpop; |
| 3293 | yyn = -yyn; |
| 3294 | goto yyreduce; |
| 3295 | } |
| 3296 | else if (yyn == 0) |
| 3297 | goto yyerrpop; |
| 3298 | |
| 3299 | if (yyn == YYFINAL) |
| 3300 | YYACCEPT; |
| 3301 | |
| 3302 | YYDPRINTF ((stderr, "Shifting error token, ")); |
| 3303 | |
| 3304 | *++yyvsp = yylval; |
| 3305 | #if YYLSP_NEEDED |
| 3306 | *++yylsp = yylloc; |
| 3307 | #endif |
| 3308 | |
| 3309 | yystate = yyn; |
| 3310 | goto yynewstate; |
| 3311 | |
| 3312 | |
| 3313 | /*-------------------------------------. |
| 3314 | | yyacceptlab -- YYACCEPT comes here. | |
| 3315 | `-------------------------------------*/ |
| 3316 | yyacceptlab: |
| 3317 | yyresult = 0; |
| 3318 | goto yyreturn; |
| 3319 | |
| 3320 | /*-----------------------------------. |
| 3321 | | yyabortlab -- YYABORT comes here. | |
| 3322 | `-----------------------------------*/ |
| 3323 | yyabortlab: |
| 3324 | yyresult = 1; |
| 3325 | goto yyreturn; |
| 3326 | |
| 3327 | /*---------------------------------------------. |
| 3328 | | yyoverflowab -- parser overflow comes here. | |
| 3329 | `---------------------------------------------*/ |
| 3330 | yyoverflowlab: |
| 3331 | yyerror ("parser stack overflow"); |
| 3332 | yyresult = 2; |
| 3333 | /* Fall through. */ |
| 3334 | |
| 3335 | yyreturn: |
| 3336 | #ifndef yyoverflow |
| 3337 | if (yyss != yyssa) |
| 3338 | YYSTACK_FREE (yyss); |
| 3339 | #endif |
| 3340 | return yyresult; |
| 3341 | } |
| 3342 | #line 1716 "c-parse.y" |
| 3343 | |
| 3344 | |
| 3345 | /* |
| 3346 | Local Variables: |
| 3347 | c-basic-offset:2 |
| 3348 | comment-column:40 |
| 3349 | fill-column:79 |
| 3350 | End: |
| 3351 | */ |