Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
kbuild: Make DEBUG_SECTION_MISMATCH selectable, but not on by default
genksyms: Regenerate lexer and parser
genksyms: Track changes to enum constants
genksyms: simplify usage of find_symbol()
genksyms: Add helpers for building string lists
genksyms: Simplify printing of symbol types
genksyms: Simplify lexer
genksyms: Do not paste the bison header file to lex.c
modpost: fix trailing comma
KBuild: silence "'scripts/unifdef' is up to date."
kbuild: Add extra gcc checks
kbuild: reenable section mismatch analysis
unifdef: update to upstream version 2.5

+1235 -939
+5
Documentation/kbuild/kbuild.txt
··· 196 196 To get all available archs you can also specify all. E.g.: 197 197 198 198 $ make ALLSOURCE_ARCHS=all tags 199 + 200 + KBUILD_ENABLE_EXTRA_GCC_CHECKS 201 + -------------------------------------------------- 202 + If enabled over the make command line with "W=1", it turns on additional 203 + gcc -W... options for more extensive build-time checking.
+6 -1
Makefile
··· 102 102 KBUILD_OUTPUT := $(O) 103 103 endif 104 104 105 + ifeq ("$(origin W)", "command line") 106 + export KBUILD_ENABLE_EXTRA_GCC_CHECKS := 1 107 + endif 108 + 105 109 # That's our default target when none is given on the command line 106 110 PHONY := _all 107 111 _all: ··· 1022 1018 1023 1019 PHONY += __headers 1024 1020 __headers: include/linux/version.h scripts_basic FORCE 1025 - $(Q)$(MAKE) $(build)=scripts scripts/unifdef 1021 + $(Q)$(MAKE) $(build)=scripts build_unifdef 1026 1022 1027 1023 PHONY += headers_install_all 1028 1024 headers_install_all: ··· 1267 1263 @echo ' make O=dir [targets] Locate all output files in "dir", including .config' 1268 1264 @echo ' make C=1 [targets] Check all c source with $$CHECK (sparse by default)' 1269 1265 @echo ' make C=2 [targets] Force check of all c source with $$CHECK' 1266 + @echo ' make W=1 [targets] Enable extra gcc checks' 1270 1267 @echo '' 1271 1268 @echo 'Execute "make" or "make all" to build all targets marked with [*] ' 1272 1269 @echo 'For further info see the ./README file'
-5
lib/Kconfig.debug
··· 102 102 103 103 config DEBUG_SECTION_MISMATCH 104 104 bool "Enable full Section mismatch analysis" 105 - depends on UNDEFINED || (BLACKFIN) 106 - default y 107 - # This option is on purpose disabled for now. 108 - # It will be enabled when we are down to a reasonable number 109 - # of section mismatch warnings (< 10 for an allyesconfig build) 110 105 help 111 106 The section mismatch analysis checks if there are illegal 112 107 references from one section to another section.
+5
scripts/Makefile
··· 18 18 # The following hostprogs-y programs are only build on demand 19 19 hostprogs-y += unifdef 20 20 21 + # This target is used internally to avoid "is up to date" messages 22 + PHONY += build_unifdef 23 + build_unifdef: scripts/unifdef FORCE 24 + @: 25 + 21 26 subdir-$(CONFIG_MODVERSIONS) += genksyms 22 27 subdir-y += mod 23 28 subdir-$(CONFIG_SECURITY_SELINUX) += selinux
+34 -1
scripts/Makefile.build
··· 49 49 $(error CFLAGS was changed in "$(kbuild-file)". Fix it to use EXTRA_CFLAGS) 50 50 endif 51 51 endif 52 + 53 + # 54 + # make W=1 settings 55 + # 56 + # $(call cc-option... ) handles gcc -W.. options which 57 + # are not supported by all versions of the compiler 58 + ifdef KBUILD_ENABLE_EXTRA_GCC_CHECKS 59 + KBUILD_EXTRA_WARNINGS := -Wextra 60 + KBUILD_EXTRA_WARNINGS += -Wunused -Wno-unused-parameter 61 + KBUILD_EXTRA_WARNINGS += -Waggregate-return 62 + KBUILD_EXTRA_WARNINGS += -Wbad-function-cast 63 + KBUILD_EXTRA_WARNINGS += -Wcast-qual 64 + KBUILD_EXTRA_WARNINGS += -Wcast-align 65 + KBUILD_EXTRA_WARNINGS += -Wconversion 66 + KBUILD_EXTRA_WARNINGS += -Wdisabled-optimization 67 + KBUILD_EXTRA_WARNINGS += -Wlogical-op 68 + KBUILD_EXTRA_WARNINGS += -Wmissing-declarations 69 + KBUILD_EXTRA_WARNINGS += -Wmissing-format-attribute 70 + KBUILD_EXTRA_WARNINGS += $(call cc-option, -Wmissing-include-dirs,) 71 + KBUILD_EXTRA_WARNINGS += -Wmissing-prototypes 72 + KBUILD_EXTRA_WARNINGS += -Wnested-externs 73 + KBUILD_EXTRA_WARNINGS += -Wold-style-definition 74 + KBUILD_EXTRA_WARNINGS += $(call cc-option, -Woverlength-strings,) 75 + KBUILD_EXTRA_WARNINGS += -Wpacked 76 + KBUILD_EXTRA_WARNINGS += -Wpacked-bitfield-compat 77 + KBUILD_EXTRA_WARNINGS += -Wpadded 78 + KBUILD_EXTRA_WARNINGS += -Wpointer-arith 79 + KBUILD_EXTRA_WARNINGS += -Wredundant-decls 80 + KBUILD_EXTRA_WARNINGS += -Wshadow 81 + KBUILD_EXTRA_WARNINGS += -Wswitch-default 82 + KBUILD_EXTRA_WARNINGS += $(call cc-option, -Wvla,) 83 + KBUILD_CFLAGS += $(KBUILD_EXTRA_WARNINGS) 84 + endif 85 + 52 86 include scripts/Makefile.lib 53 87 54 88 ifdef host-progs ··· 436 402 ifneq ($(cmd_files),) 437 403 include $(cmd_files) 438 404 endif 439 - 440 405 441 406 # Declare the contents of the .PHONY variable as phony. We keep that 442 407 # information in a variable se we can use it in if_changed and friends.
+2 -2
scripts/genksyms/Makefile
··· 28 28 # flex 29 29 30 30 quiet_cmd_lex.c = FLEX $@ 31 - cmd_lex.c = flex -o$@ -d $< $(obj)/parse.h 31 + cmd_lex.c = flex -o$@ -d $< 32 32 33 - $(obj)/lex.c: $(obj)/lex.l $(obj)/parse.h $(obj)/keywords.c FORCE 33 + $(obj)/lex.c: $(obj)/lex.l $(obj)/keywords.c FORCE 34 34 $(call if_changed,lex.c) 35 35 cp $@ $@_shipped 36 36
+136 -56
scripts/genksyms/genksyms.c
··· 53 53 static struct symbol *expansion_trail; 54 54 static struct symbol *visited_symbols; 55 55 56 - static const char *const symbol_type_name[] = { 57 - "normal", "typedef", "enum", "struct", "union" 56 + static const struct { 57 + int n; 58 + const char *name; 59 + } symbol_types[] = { 60 + [SYM_NORMAL] = { 0, NULL}, 61 + [SYM_TYPEDEF] = {'t', "typedef"}, 62 + [SYM_ENUM] = {'e', "enum"}, 63 + [SYM_STRUCT] = {'s', "struct"}, 64 + [SYM_UNION] = {'u', "union"}, 65 + [SYM_ENUM_CONST] = {'E', "enum constant"}, 58 66 }; 59 67 60 68 static int equal_list(struct string_list *a, struct string_list *b); 61 69 static void print_list(FILE * f, struct string_list *list); 70 + static struct string_list *concat_list(struct string_list *start, ...); 71 + static struct string_list *mk_node(const char *string); 62 72 static void print_location(void); 63 73 static void print_type_name(enum symbol_type type, const char *name); 64 74 ··· 150 140 151 141 static enum symbol_type map_to_ns(enum symbol_type t) 152 142 { 153 - if (t == SYM_TYPEDEF) 154 - t = SYM_NORMAL; 155 - else if (t == SYM_UNION) 156 - t = SYM_STRUCT; 143 + switch (t) { 144 + case SYM_ENUM_CONST: 145 + case SYM_NORMAL: 146 + case SYM_TYPEDEF: 147 + return SYM_NORMAL; 148 + case SYM_ENUM: 149 + case SYM_STRUCT: 150 + case SYM_UNION: 151 + return SYM_STRUCT; 152 + } 157 153 return t; 158 154 } 159 155 160 - struct symbol *find_symbol(const char *name, enum symbol_type ns) 156 + struct symbol *find_symbol(const char *name, enum symbol_type ns, int exact) 161 157 { 162 158 unsigned long h = crc32(name) % HASH_BUCKETS; 163 159 struct symbol *sym; ··· 174 158 sym->is_declared) 175 159 break; 176 160 161 + if (exact && sym && sym->type != ns) 162 + return NULL; 177 163 return sym; 178 164 } 179 165 ··· 198 180 struct string_list *defn, int is_extern, 199 181 int is_reference) 200 182 { 201 - unsigned long h = crc32(name) % HASH_BUCKETS; 183 + unsigned long h; 202 184 struct symbol *sym; 203 185 enum symbol_status status = STATUS_UNCHANGED; 186 + /* The parser adds symbols in the order their declaration completes, 187 + * so it is safe to store the value of the previous enum constant in 188 + * a static variable. 189 + */ 190 + static int enum_counter; 191 + static struct string_list *last_enum_expr; 204 192 193 + if (type == SYM_ENUM_CONST) { 194 + if (defn) { 195 + free_list(last_enum_expr, NULL); 196 + last_enum_expr = copy_list_range(defn, NULL); 197 + enum_counter = 1; 198 + } else { 199 + struct string_list *expr; 200 + char buf[20]; 201 + 202 + snprintf(buf, sizeof(buf), "%d", enum_counter++); 203 + if (last_enum_expr) { 204 + expr = copy_list_range(last_enum_expr, NULL); 205 + defn = concat_list(mk_node("("), 206 + expr, 207 + mk_node(")"), 208 + mk_node("+"), 209 + mk_node(buf), NULL); 210 + } else { 211 + defn = mk_node(buf); 212 + } 213 + } 214 + } else if (type == SYM_ENUM) { 215 + free_list(last_enum_expr, NULL); 216 + last_enum_expr = NULL; 217 + enum_counter = 0; 218 + if (!name) 219 + /* Anonymous enum definition, nothing more to do */ 220 + return NULL; 221 + } 222 + 223 + h = crc32(name) % HASH_BUCKETS; 205 224 for (sym = symtab[h]; sym; sym = sym->hash_next) { 206 225 if (map_to_ns(sym->type) == map_to_ns(type) && 207 226 strcmp(name, sym->name) == 0) { ··· 302 247 sym->is_override = 0; 303 248 304 249 if (flag_debug) { 305 - fprintf(debugfile, "Defn for %s %s == <", 306 - symbol_type_name[type], name); 250 + if (symbol_types[type].name) 251 + fprintf(debugfile, "Defn for %s %s == <", 252 + symbol_types[type].name, name); 253 + else 254 + fprintf(debugfile, "Defn for type%d %s == <", 255 + type, name); 307 256 if (is_extern) 308 257 fputs("extern ", debugfile); 309 258 print_list(debugfile, defn); ··· 347 288 } 348 289 } 349 290 291 + static struct string_list *mk_node(const char *string) 292 + { 293 + struct string_list *newnode; 294 + 295 + newnode = xmalloc(sizeof(*newnode)); 296 + newnode->string = xstrdup(string); 297 + newnode->tag = SYM_NORMAL; 298 + newnode->next = NULL; 299 + 300 + return newnode; 301 + } 302 + 303 + static struct string_list *concat_list(struct string_list *start, ...) 304 + { 305 + va_list ap; 306 + struct string_list *n, *n2; 307 + 308 + if (!start) 309 + return NULL; 310 + for (va_start(ap, start); (n = va_arg(ap, struct string_list *));) { 311 + for (n2 = n; n2->next; n2 = n2->next) 312 + ; 313 + n2->next = start; 314 + start = n; 315 + } 316 + va_end(ap); 317 + return start; 318 + } 319 + 350 320 struct string_list *copy_node(struct string_list *node) 351 321 { 352 322 struct string_list *newnode; ··· 385 297 newnode->tag = node->tag; 386 298 387 299 return newnode; 300 + } 301 + 302 + struct string_list *copy_list_range(struct string_list *start, 303 + struct string_list *end) 304 + { 305 + struct string_list *res, *n; 306 + 307 + if (start == end) 308 + return NULL; 309 + n = res = copy_node(start); 310 + for (start = start->next; start != end; start = start->next) { 311 + n->next = copy_node(start); 312 + n = n->next; 313 + } 314 + n->next = NULL; 315 + return res; 388 316 } 389 317 390 318 static int equal_list(struct string_list *a, struct string_list *b) ··· 450 346 if (node.string[1] == '#') { 451 347 int n; 452 348 453 - for (n = 0; n < ARRAY_SIZE(symbol_type_name); n++) { 454 - if (node.string[0] == symbol_type_name[n][0]) { 349 + for (n = 0; n < ARRAY_SIZE(symbol_types); n++) { 350 + if (node.string[0] == symbol_types[n].n) { 455 351 node.tag = n; 456 352 node.string += 2; 457 353 return copy_node(&node); ··· 501 397 502 398 static void print_node(FILE * f, struct string_list *list) 503 399 { 504 - if (list->tag != SYM_NORMAL) { 505 - putc(symbol_type_name[list->tag][0], f); 400 + if (symbol_types[list->tag].n) { 401 + putc(symbol_types[list->tag].n, f); 506 402 putc('#', f); 507 403 } 508 404 fputs(list->string, f); ··· 572 468 crc = partial_crc32_one(' ', crc); 573 469 break; 574 470 471 + case SYM_ENUM_CONST: 575 472 case SYM_TYPEDEF: 576 - subsym = find_symbol(cur->string, cur->tag); 473 + subsym = find_symbol(cur->string, cur->tag, 0); 577 474 /* FIXME: Bad reference files can segfault here. */ 578 475 if (subsym->expansion_trail) { 579 476 if (flag_dump_defs) ··· 591 486 case SYM_STRUCT: 592 487 case SYM_UNION: 593 488 case SYM_ENUM: 594 - subsym = find_symbol(cur->string, cur->tag); 489 + subsym = find_symbol(cur->string, cur->tag, 0); 595 490 if (!subsym) { 596 - struct string_list *n, *t = NULL; 491 + struct string_list *n; 597 492 598 493 error_with_pos("expand undefined %s %s", 599 - symbol_type_name[cur->tag], 494 + symbol_types[cur->tag].name, 600 495 cur->string); 601 - 602 - n = xmalloc(sizeof(*n)); 603 - n->string = xstrdup(symbol_type_name[cur->tag]); 604 - n->tag = SYM_NORMAL; 605 - n->next = t; 606 - t = n; 607 - 608 - n = xmalloc(sizeof(*n)); 609 - n->string = xstrdup(cur->string); 610 - n->tag = SYM_NORMAL; 611 - n->next = t; 612 - t = n; 613 - 614 - n = xmalloc(sizeof(*n)); 615 - n->string = xstrdup("{"); 616 - n->tag = SYM_NORMAL; 617 - n->next = t; 618 - t = n; 619 - 620 - n = xmalloc(sizeof(*n)); 621 - n->string = xstrdup("UNKNOWN"); 622 - n->tag = SYM_NORMAL; 623 - n->next = t; 624 - t = n; 625 - 626 - n = xmalloc(sizeof(*n)); 627 - n->string = xstrdup("}"); 628 - n->tag = SYM_NORMAL; 629 - n->next = t; 630 - t = n; 631 - 496 + n = concat_list(mk_node 497 + (symbol_types[cur->tag].name), 498 + mk_node(cur->string), 499 + mk_node("{"), 500 + mk_node("UNKNOWN"), 501 + mk_node("}"), NULL); 632 502 subsym = 633 503 add_symbol(cur->string, cur->tag, n, 0); 634 504 } 635 505 if (subsym->expansion_trail) { 636 506 if (flag_dump_defs) { 637 507 fprintf(debugfile, "%s %s ", 638 - symbol_type_name[cur->tag], 508 + symbol_types[cur->tag].name, 639 509 cur->string); 640 510 } 641 511 642 - crc = partial_crc32(symbol_type_name[cur->tag], 512 + crc = partial_crc32(symbol_types[cur->tag].name, 643 513 crc); 644 514 crc = partial_crc32_one(' ', crc); 645 515 crc = partial_crc32(cur->string, crc); ··· 645 565 { 646 566 struct symbol *sym; 647 567 648 - sym = find_symbol(name, SYM_NORMAL); 568 + sym = find_symbol(name, SYM_NORMAL, 0); 649 569 if (!sym) 650 570 error_with_pos("export undefined symbol %s", name); 651 571 else { ··· 704 624 705 625 static void print_type_name(enum symbol_type type, const char *name) 706 626 { 707 - if (type != SYM_NORMAL) 708 - fprintf(stderr, "%s %s", symbol_type_name[type], name); 627 + if (symbol_types[type].name) 628 + fprintf(stderr, "%s %s", symbol_types[type].name, name); 709 629 else 710 630 fprintf(stderr, "%s", name); 711 631 } ··· 851 771 852 772 if (sym->is_override) 853 773 fputs("override ", dumpfile); 854 - if (sym->type != SYM_NORMAL) { 855 - putc(symbol_type_name[sym->type][0], dumpfile); 774 + if (symbol_types[sym->type].n) { 775 + putc(symbol_types[sym->type].n, dumpfile); 856 776 putc('#', dumpfile); 857 777 } 858 778 fputs(sym->name, dumpfile);
+5 -2
scripts/genksyms/genksyms.h
··· 26 26 #include <stdio.h> 27 27 28 28 enum symbol_type { 29 - SYM_NORMAL, SYM_TYPEDEF, SYM_ENUM, SYM_STRUCT, SYM_UNION 29 + SYM_NORMAL, SYM_TYPEDEF, SYM_ENUM, SYM_STRUCT, SYM_UNION, 30 + SYM_ENUM_CONST 30 31 }; 31 32 32 33 enum symbol_status { ··· 59 58 extern int cur_line; 60 59 extern char *cur_filename; 61 60 62 - struct symbol *find_symbol(const char *name, enum symbol_type ns); 61 + struct symbol *find_symbol(const char *name, enum symbol_type ns, int exact); 63 62 struct symbol *add_symbol(const char *name, enum symbol_type type, 64 63 struct string_list *defn, int is_extern); 65 64 void export_symbol(const char *); ··· 67 66 void free_node(struct string_list *list); 68 67 void free_list(struct string_list *s, struct string_list *e); 69 68 struct string_list *copy_node(struct string_list *); 69 + struct string_list *copy_list_range(struct string_list *start, 70 + struct string_list *end); 70 71 71 72 int yylex(void); 72 73 int yyparse(void);
+144 -271
scripts/genksyms/lex.c_shipped
··· 79 79 typedef unsigned char flex_uint8_t; 80 80 typedef unsigned short int flex_uint16_t; 81 81 typedef unsigned int flex_uint32_t; 82 + #endif /* ! C99 */ 82 83 83 84 /* Limits of integral types. */ 84 85 #ifndef INT8_MIN ··· 109 108 #ifndef UINT32_MAX 110 109 #define UINT32_MAX (4294967295U) 111 110 #endif 112 - 113 - #endif /* ! C99 */ 114 111 115 112 #endif /* ! FLEXINT_H */ 116 113 ··· 455 456 flex_int32_t yy_verify; 456 457 flex_int32_t yy_nxt; 457 458 }; 458 - static yyconst flex_int16_t yy_accept[76] = 459 + static yyconst flex_int16_t yy_accept[73] = 459 460 { 0, 460 - 0, 0, 0, 0, 14, 12, 4, 3, 12, 7, 461 - 12, 12, 7, 12, 12, 12, 12, 12, 9, 9, 462 - 12, 12, 12, 4, 0, 5, 0, 7, 0, 6, 463 - 0, 0, 0, 0, 0, 0, 2, 8, 10, 10, 464 - 9, 0, 0, 9, 9, 0, 9, 0, 0, 11, 465 - 0, 0, 0, 10, 0, 10, 9, 9, 0, 0, 466 - 0, 0, 0, 0, 0, 10, 10, 0, 0, 0, 467 - 0, 0, 0, 1, 0 461 + 0, 0, 14, 12, 4, 3, 12, 7, 12, 12, 462 + 12, 12, 12, 9, 9, 12, 12, 7, 12, 12, 463 + 4, 0, 5, 0, 7, 8, 0, 6, 0, 0, 464 + 10, 10, 9, 0, 0, 9, 9, 0, 9, 0, 465 + 0, 0, 0, 2, 0, 0, 11, 0, 10, 0, 466 + 10, 9, 9, 0, 0, 0, 10, 10, 0, 0, 467 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 468 + 1, 0 468 469 } ; 469 470 470 471 static yyconst flex_int32_t yy_ec[256] = ··· 506 507 8, 7, 3, 3, 3, 1, 3, 1 507 508 } ; 508 509 509 - static yyconst flex_int16_t yy_base[88] = 510 + static yyconst flex_int16_t yy_base[85] = 510 511 { 0, 511 - 0, 147, 21, 140, 145, 284, 39, 284, 26, 0, 512 - 32, 126, 40, 44, 115, 35, 36, 46, 50, 53, 513 - 39, 61, 54, 79, 65, 284, 0, 0, 66, 284, 514 - 0, 119, 79, 75, 123, 104, 284, 284, 107, 0, 515 - 79, 73, 76, 76, 66, 0, 0, 85, 86, 284, 516 - 133, 83, 91, 284, 99, 147, 284, 114, 122, 70, 517 - 107, 141, 172, 151, 135, 181, 284, 137, 114, 157, 518 - 149, 48, 45, 284, 284, 208, 214, 222, 230, 238, 519 - 246, 250, 255, 256, 261, 267, 275 512 + 0, 145, 150, 266, 27, 266, 25, 0, 131, 23, 513 + 23, 16, 23, 39, 31, 25, 39, 60, 22, 65, 514 + 57, 43, 266, 0, 0, 266, 61, 266, 0, 128, 515 + 74, 0, 113, 59, 62, 113, 52, 0, 0, 72, 516 + 66, 110, 100, 266, 73, 74, 266, 70, 266, 90, 517 + 103, 266, 84, 129, 108, 113, 143, 266, 107, 66, 518 + 118, 137, 168, 120, 80, 91, 145, 143, 83, 41, 519 + 266, 266, 190, 196, 204, 212, 220, 228, 232, 237, 520 + 238, 243, 249, 257 520 521 } ; 521 522 522 - static yyconst flex_int16_t yy_def[88] = 523 + static yyconst flex_int16_t yy_def[85] = 523 524 { 0, 524 - 75, 1, 1, 3, 75, 75, 75, 75, 76, 77, 525 - 78, 75, 77, 79, 75, 75, 75, 75, 75, 19, 526 - 75, 75, 75, 75, 76, 75, 80, 77, 78, 75, 527 - 81, 75, 76, 78, 79, 79, 75, 75, 75, 39, 528 - 19, 82, 83, 75, 75, 84, 20, 76, 78, 75, 529 - 79, 51, 85, 75, 75, 75, 75, 84, 79, 51, 530 - 79, 79, 79, 51, 75, 75, 75, 86, 79, 63, 531 - 86, 87, 87, 75, 0, 75, 75, 75, 75, 75, 532 - 75, 75, 75, 75, 75, 75, 75 525 + 72, 1, 72, 72, 72, 72, 73, 74, 72, 72, 526 + 75, 72, 72, 72, 14, 72, 72, 74, 72, 76, 527 + 72, 73, 72, 77, 74, 72, 75, 72, 78, 72, 528 + 72, 31, 14, 79, 80, 72, 72, 81, 15, 73, 529 + 75, 76, 76, 72, 73, 75, 72, 82, 72, 72, 530 + 72, 72, 81, 76, 54, 72, 72, 72, 76, 54, 531 + 76, 76, 76, 54, 83, 76, 63, 83, 84, 84, 532 + 72, 0, 72, 72, 72, 72, 72, 72, 72, 72, 533 + 72, 72, 72, 72 533 534 } ; 534 535 535 - static yyconst flex_int16_t yy_nxt[313] = 536 + static yyconst flex_int16_t yy_nxt[295] = 536 537 { 0, 537 - 6, 7, 8, 7, 9, 6, 10, 6, 6, 11, 538 - 6, 6, 12, 6, 6, 6, 6, 6, 6, 10, 539 - 10, 10, 13, 10, 10, 6, 10, 6, 15, 16, 540 - 26, 15, 17, 18, 19, 20, 20, 21, 15, 22, 541 - 24, 30, 24, 38, 33, 36, 37, 74, 23, 34, 542 - 74, 27, 38, 38, 38, 38, 38, 31, 32, 39, 543 - 39, 39, 40, 41, 41, 42, 47, 47, 47, 26, 544 - 43, 38, 44, 45, 46, 30, 44, 75, 38, 38, 545 - 24, 38, 24, 26, 30, 40, 55, 55, 57, 26, 546 - 27, 31, 57, 43, 35, 30, 64, 64, 64, 57, 538 + 4, 5, 6, 5, 7, 4, 8, 9, 10, 11, 539 + 9, 12, 13, 14, 15, 15, 16, 9, 17, 8, 540 + 8, 8, 18, 8, 8, 4, 8, 19, 21, 23, 541 + 21, 26, 28, 26, 26, 30, 31, 31, 31, 26, 542 + 26, 26, 26, 71, 39, 39, 39, 23, 29, 26, 543 + 24, 32, 33, 33, 34, 72, 26, 26, 21, 35, 544 + 21, 36, 37, 38, 40, 36, 43, 44, 24, 41, 545 + 28, 32, 50, 50, 52, 28, 23, 23, 52, 35, 546 + 56, 56, 44, 28, 42, 71, 29, 31, 31, 31, 547 + 42, 29, 59, 44, 48, 49, 49, 24, 24, 29, 547 548 548 - 31, 65, 65, 75, 27, 36, 37, 35, 59, 37, 549 - 27, 31, 56, 56, 56, 59, 37, 51, 52, 52, 550 - 39, 39, 39, 59, 37, 37, 68, 53, 54, 54, 551 - 69, 50, 38, 54, 59, 37, 44, 45, 32, 37, 552 - 44, 35, 59, 37, 75, 14, 60, 60, 66, 66, 553 - 66, 37, 14, 72, 75, 61, 62, 63, 59, 61, 554 - 56, 56, 56, 69, 64, 64, 64, 69, 67, 67, 555 - 75, 75, 75, 67, 37, 35, 75, 75, 75, 61, 556 - 62, 75, 75, 61, 75, 70, 70, 70, 75, 75, 557 - 75, 70, 70, 70, 66, 66, 66, 75, 75, 75, 549 + 49, 43, 44, 51, 51, 51, 36, 37, 59, 44, 550 + 36, 65, 44, 54, 55, 55, 51, 51, 51, 59, 551 + 44, 64, 64, 64, 58, 58, 57, 57, 57, 58, 552 + 59, 44, 42, 64, 64, 64, 52, 72, 59, 44, 553 + 47, 66, 60, 60, 42, 44, 59, 69, 26, 72, 554 + 20, 61, 62, 63, 72, 61, 57, 57, 57, 66, 555 + 72, 72, 72, 66, 49, 49, 72, 61, 62, 49, 556 + 44, 61, 72, 72, 72, 72, 72, 72, 72, 72, 557 + 72, 67, 67, 67, 72, 72, 72, 67, 67, 67, 558 + 22, 22, 22, 22, 22, 22, 22, 22, 25, 72, 558 559 559 - 75, 75, 54, 54, 75, 75, 75, 54, 25, 25, 560 - 25, 25, 25, 25, 25, 25, 28, 75, 75, 28, 561 - 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 562 - 35, 35, 35, 35, 35, 35, 35, 35, 48, 75, 563 - 48, 48, 48, 48, 48, 48, 49, 75, 49, 49, 564 - 49, 49, 49, 49, 42, 42, 75, 42, 56, 75, 565 - 56, 58, 58, 58, 66, 75, 66, 71, 71, 71, 566 - 71, 71, 71, 71, 71, 73, 73, 73, 73, 73, 567 - 73, 73, 73, 5, 75, 75, 75, 75, 75, 75, 568 - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 560 + 72, 25, 25, 25, 27, 27, 27, 27, 27, 27, 561 + 27, 27, 42, 42, 42, 42, 42, 42, 42, 42, 562 + 45, 72, 45, 45, 45, 45, 45, 45, 46, 72, 563 + 46, 46, 46, 46, 46, 46, 34, 34, 72, 34, 564 + 51, 72, 51, 53, 53, 53, 57, 72, 57, 68, 565 + 68, 68, 68, 68, 68, 68, 68, 70, 70, 70, 566 + 70, 70, 70, 70, 70, 3, 72, 72, 72, 72, 567 + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 568 + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 569 + 72, 72, 72, 72 569 570 570 - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 571 - 75, 75 572 571 } ; 573 572 574 - static yyconst flex_int16_t yy_chk[313] = 573 + static yyconst flex_int16_t yy_chk[295] = 575 574 { 0, 576 575 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 577 576 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 578 - 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 579 - 9, 3, 3, 3, 3, 3, 3, 3, 3, 3, 580 - 7, 11, 7, 16, 13, 14, 14, 73, 3, 13, 581 - 72, 9, 16, 17, 17, 21, 21, 11, 18, 18, 582 - 18, 18, 19, 19, 19, 19, 20, 20, 20, 25, 583 - 19, 23, 19, 19, 19, 29, 19, 20, 22, 22, 584 - 24, 23, 24, 33, 34, 42, 43, 43, 45, 48, 585 - 25, 29, 45, 42, 60, 49, 52, 52, 52, 44, 577 + 1, 1, 1, 1, 1, 1, 1, 1, 5, 7, 578 + 5, 10, 11, 12, 12, 13, 13, 13, 13, 19, 579 + 10, 16, 16, 70, 15, 15, 15, 22, 11, 19, 580 + 7, 14, 14, 14, 14, 15, 17, 17, 21, 14, 581 + 21, 14, 14, 14, 18, 14, 20, 20, 22, 18, 582 + 27, 34, 35, 35, 37, 41, 40, 45, 37, 34, 583 + 48, 48, 65, 46, 65, 69, 27, 31, 31, 31, 584 + 60, 41, 66, 66, 31, 31, 31, 40, 45, 46, 586 585 587 - 34, 53, 53, 41, 33, 36, 36, 52, 61, 61, 588 - 48, 49, 55, 55, 55, 69, 69, 36, 36, 36, 589 - 39, 39, 39, 59, 59, 35, 59, 39, 39, 39, 590 - 61, 32, 15, 39, 51, 51, 58, 58, 12, 68, 591 - 58, 68, 62, 62, 5, 4, 51, 51, 65, 65, 592 - 65, 71, 2, 71, 0, 51, 51, 51, 70, 51, 593 - 56, 56, 56, 62, 64, 64, 64, 62, 56, 56, 594 - 0, 0, 0, 56, 63, 64, 0, 0, 0, 70, 595 - 70, 0, 0, 70, 0, 63, 63, 63, 0, 0, 596 - 0, 63, 63, 63, 66, 66, 66, 0, 0, 0, 586 + 31, 43, 43, 50, 50, 50, 53, 53, 59, 59, 587 + 53, 59, 42, 43, 43, 43, 51, 51, 51, 61, 588 + 61, 55, 55, 55, 51, 51, 56, 56, 56, 51, 589 + 54, 54, 55, 64, 64, 64, 36, 33, 62, 62, 590 + 30, 61, 54, 54, 64, 68, 67, 68, 9, 3, 591 + 2, 54, 54, 54, 0, 54, 57, 57, 57, 62, 592 + 0, 0, 0, 62, 57, 57, 0, 67, 67, 57, 593 + 63, 67, 0, 0, 0, 0, 0, 0, 0, 0, 594 + 0, 63, 63, 63, 0, 0, 0, 63, 63, 63, 595 + 73, 73, 73, 73, 73, 73, 73, 73, 74, 0, 597 596 598 - 0, 0, 66, 66, 0, 0, 0, 66, 76, 76, 599 - 76, 76, 76, 76, 76, 76, 77, 0, 0, 77, 600 - 77, 77, 78, 78, 78, 78, 78, 78, 78, 78, 601 - 79, 79, 79, 79, 79, 79, 79, 79, 80, 0, 602 - 80, 80, 80, 80, 80, 80, 81, 0, 81, 81, 603 - 81, 81, 81, 81, 82, 82, 0, 82, 83, 0, 604 - 83, 84, 84, 84, 85, 0, 85, 86, 86, 86, 605 - 86, 86, 86, 86, 86, 87, 87, 87, 87, 87, 606 - 87, 87, 87, 75, 75, 75, 75, 75, 75, 75, 607 - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 597 + 0, 74, 74, 74, 75, 75, 75, 75, 75, 75, 598 + 75, 75, 76, 76, 76, 76, 76, 76, 76, 76, 599 + 77, 0, 77, 77, 77, 77, 77, 77, 78, 0, 600 + 78, 78, 78, 78, 78, 78, 79, 79, 0, 79, 601 + 80, 0, 80, 81, 81, 81, 82, 0, 82, 83, 602 + 83, 83, 83, 83, 83, 83, 83, 84, 84, 84, 603 + 84, 84, 84, 84, 84, 72, 72, 72, 72, 72, 604 + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 605 + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 606 + 72, 72, 72, 72 608 607 609 - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 610 - 75, 75 611 608 } ; 612 609 613 610 static yy_state_type yy_last_accepting_state; ··· 614 619 615 620 static yyconst flex_int16_t yy_rule_linenum[13] = 616 621 { 0, 617 - 71, 72, 73, 76, 79, 80, 81, 87, 88, 89, 618 - 91, 94 622 + 67, 68, 69, 72, 75, 76, 77, 83, 84, 85, 623 + 87, 90 619 624 } ; 620 625 621 626 /* The intent behind this definition is that it'll catch ··· 662 667 and then we categorize those basic tokens in the second stage. */ 663 668 #define YY_DECL static int yylex1(void) 664 669 665 - /* Version 2 checksumming does proper tokenization; version 1 wasn't 666 - quite so pedantic. */ 667 - 668 670 /* We don't do multiple input files. */ 669 671 #define YY_NO_INPUT 1 670 - #line 676 "scripts/genksyms/lex.c" 672 + #line 668 "scripts/genksyms/lex.c" 671 673 672 674 #define INITIAL 0 673 - #define V2_TOKENS 1 674 675 675 676 #ifndef YY_NO_UNISTD_H 676 677 /* Special case for "unistd.h", since it is non-ANSI. We include it way ··· 799 808 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ 800 809 { \ 801 810 int c = '*'; \ 802 - size_t n; \ 811 + int n; \ 803 812 for ( n = 0; n < max_size && \ 804 813 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 805 814 buf[n] = (char) c; \ ··· 909 918 register int yy_act; 910 919 911 920 /* %% [7.0] user's declarations go here */ 912 - #line 67 "scripts/genksyms/lex.l" 921 + #line 63 "scripts/genksyms/lex.l" 913 922 914 923 915 924 916 925 /* Keep track of our location in the original source files. */ 917 - #line 927 "scripts/genksyms/lex.c" 926 + #line 918 "scripts/genksyms/lex.c" 918 927 919 928 if ( !(yy_init) ) 920 929 { ··· 978 987 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 979 988 { 980 989 yy_current_state = (int) yy_def[yy_current_state]; 981 - if ( yy_current_state >= 76 ) 990 + if ( yy_current_state >= 73 ) 982 991 yy_c = yy_meta[(unsigned int) yy_c]; 983 992 } 984 993 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 985 994 ++yy_cp; 986 995 } 987 - while ( yy_base[yy_current_state] != 284 ); 996 + while ( yy_base[yy_current_state] != 266 ); 988 997 989 998 yy_find_action: 990 999 /* %% [10.0] code to find the action number goes here */ ··· 1032 1041 case 1: 1033 1042 /* rule 1 can match eol */ 1034 1043 YY_RULE_SETUP 1035 - #line 71 "scripts/genksyms/lex.l" 1044 + #line 67 "scripts/genksyms/lex.l" 1036 1045 return FILENAME; 1037 1046 YY_BREAK 1038 1047 case 2: 1039 1048 /* rule 2 can match eol */ 1040 1049 YY_RULE_SETUP 1041 - #line 72 "scripts/genksyms/lex.l" 1050 + #line 68 "scripts/genksyms/lex.l" 1042 1051 cur_line++; 1043 1052 YY_BREAK 1044 1053 case 3: 1045 1054 /* rule 3 can match eol */ 1046 1055 YY_RULE_SETUP 1047 - #line 73 "scripts/genksyms/lex.l" 1056 + #line 69 "scripts/genksyms/lex.l" 1048 1057 cur_line++; 1049 1058 YY_BREAK 1050 1059 /* Ignore all other whitespace. */ 1051 1060 case 4: 1052 1061 YY_RULE_SETUP 1053 - #line 76 "scripts/genksyms/lex.l" 1062 + #line 72 "scripts/genksyms/lex.l" 1054 1063 ; 1055 1064 YY_BREAK 1056 1065 case 5: 1057 1066 /* rule 5 can match eol */ 1058 1067 YY_RULE_SETUP 1059 - #line 79 "scripts/genksyms/lex.l" 1068 + #line 75 "scripts/genksyms/lex.l" 1060 1069 return STRING; 1061 1070 YY_BREAK 1062 1071 case 6: 1063 1072 /* rule 6 can match eol */ 1064 1073 YY_RULE_SETUP 1065 - #line 80 "scripts/genksyms/lex.l" 1074 + #line 76 "scripts/genksyms/lex.l" 1066 1075 return CHAR; 1067 1076 YY_BREAK 1068 1077 case 7: 1069 1078 YY_RULE_SETUP 1070 - #line 81 "scripts/genksyms/lex.l" 1079 + #line 77 "scripts/genksyms/lex.l" 1071 1080 return IDENT; 1072 1081 YY_BREAK 1073 1082 /* The Pedant requires that the other C multi-character tokens be ··· 1076 1085 around them properly. */ 1077 1086 case 8: 1078 1087 YY_RULE_SETUP 1079 - #line 87 "scripts/genksyms/lex.l" 1088 + #line 83 "scripts/genksyms/lex.l" 1080 1089 return OTHER; 1081 1090 YY_BREAK 1082 1091 case 9: 1083 1092 YY_RULE_SETUP 1084 - #line 88 "scripts/genksyms/lex.l" 1093 + #line 84 "scripts/genksyms/lex.l" 1085 1094 return INT; 1086 1095 YY_BREAK 1087 1096 case 10: 1088 1097 YY_RULE_SETUP 1089 - #line 89 "scripts/genksyms/lex.l" 1098 + #line 85 "scripts/genksyms/lex.l" 1090 1099 return REAL; 1091 1100 YY_BREAK 1092 1101 case 11: 1093 1102 YY_RULE_SETUP 1094 - #line 91 "scripts/genksyms/lex.l" 1103 + #line 87 "scripts/genksyms/lex.l" 1095 1104 return DOTS; 1096 1105 YY_BREAK 1097 1106 /* All other tokens are single characters. */ 1098 1107 case 12: 1099 1108 YY_RULE_SETUP 1100 - #line 94 "scripts/genksyms/lex.l" 1109 + #line 90 "scripts/genksyms/lex.l" 1101 1110 return yytext[0]; 1102 1111 YY_BREAK 1103 1112 case 13: 1104 1113 YY_RULE_SETUP 1105 - #line 97 "scripts/genksyms/lex.l" 1114 + #line 93 "scripts/genksyms/lex.l" 1106 1115 ECHO; 1107 1116 YY_BREAK 1108 - #line 1118 "scripts/genksyms/lex.c" 1117 + #line 1109 "scripts/genksyms/lex.c" 1109 1118 case YY_STATE_EOF(INITIAL): 1110 - case YY_STATE_EOF(V2_TOKENS): 1111 1119 yyterminate(); 1112 1120 1113 1121 case YY_END_OF_BUFFER: ··· 1419 1429 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1420 1430 { 1421 1431 yy_current_state = (int) yy_def[yy_current_state]; 1422 - if ( yy_current_state >= 76 ) 1432 + if ( yy_current_state >= 73 ) 1423 1433 yy_c = yy_meta[(unsigned int) yy_c]; 1424 1434 } 1425 1435 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ··· 1452 1462 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1453 1463 { 1454 1464 yy_current_state = (int) yy_def[yy_current_state]; 1455 - if ( yy_current_state >= 76 ) 1465 + if ( yy_current_state >= 73 ) 1456 1466 yy_c = yy_meta[(unsigned int) yy_c]; 1457 1467 } 1458 1468 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1459 - yy_is_jam = (yy_current_state == 75); 1469 + yy_is_jam = (yy_current_state == 72); 1460 1470 1461 1471 return yy_is_jam ? 0 : yy_current_state; 1462 1472 } ··· 2242 2252 2243 2253 /* %ok-for-header */ 2244 2254 2245 - #line 97 "scripts/genksyms/lex.l" 2255 + #line 93 "scripts/genksyms/lex.l" 2246 2256 2247 2257 2248 2258 ··· 2253 2263 2254 2264 /* Macros to append to our phrase collection list. */ 2255 2265 2266 + /* 2267 + * We mark any token, that that equals to a known enumerator, as 2268 + * SYM_ENUM_CONST. The parser will change this for struct and union tags later, 2269 + * the only problem is struct and union members: 2270 + * enum e { a, b }; struct s { int a, b; } 2271 + * but in this case, the only effect will be, that the ABI checksums become 2272 + * more volatile, which is acceptable. Also, such collisions are quite rare, 2273 + * so far it was only observed in include/linux/telephony.h. 2274 + */ 2256 2275 #define _APP(T,L) do { \ 2257 2276 cur_node = next_node; \ 2258 2277 next_node = xmalloc(sizeof(*next_node)); \ 2259 2278 next_node->next = cur_node; \ 2260 2279 cur_node->string = memcpy(xmalloc(L+1), T, L+1); \ 2261 - cur_node->tag = SYM_NORMAL; \ 2280 + cur_node->tag = \ 2281 + find_symbol(cur_node->string, SYM_ENUM_CONST, 1)?\ 2282 + SYM_ENUM_CONST : SYM_NORMAL ; \ 2262 2283 } while (0) 2263 2284 2264 2285 #define APP _APP(yytext, yyleng) ··· 2295 2294 2296 2295 if (lexstate == ST_NOTSTARTED) 2297 2296 { 2298 - BEGIN(V2_TOKENS); 2299 2297 next_node = xmalloc(sizeof(*next_node)); 2300 2298 next_node->next = NULL; 2301 2299 lexstate = ST_NORMAL; ··· 2347 2347 2348 2348 case STRUCT_KEYW: 2349 2349 case UNION_KEYW: 2350 - dont_want_brace_phrase = 3; 2351 2350 case ENUM_KEYW: 2351 + dont_want_brace_phrase = 3; 2352 2352 suppress_type_lookup = 2; 2353 2353 goto fini; 2354 2354 ··· 2358 2358 } 2359 2359 if (!suppress_type_lookup) 2360 2360 { 2361 - struct symbol *sym = find_symbol(yytext, SYM_TYPEDEF); 2362 - if (sym && sym->type == SYM_TYPEDEF) 2361 + if (find_symbol(yytext, SYM_TYPEDEF, 1)) 2363 2362 token = TYPE; 2364 2363 } 2365 2364 } ··· 2477 2478 ++count; 2478 2479 APP; 2479 2480 goto repeat; 2480 - case ')': case ']': case '}': 2481 + case '}': 2482 + /* is this the last line of an enum declaration? */ 2483 + if (count == 0) 2484 + { 2485 + /* Put back the token we just read so's we can find it again 2486 + after registering the expression. */ 2487 + unput(token); 2488 + 2489 + lexstate = ST_NORMAL; 2490 + token = EXPRESSION_PHRASE; 2491 + break; 2492 + } 2493 + /* FALLTHRU */ 2494 + case ')': case ']': 2481 2495 --count; 2482 2496 APP; 2483 2497 goto repeat; ··· 2579 2567 2580 2568 return token; 2581 2569 } 2582 - /* A Bison parser, made by GNU Bison 2.3. */ 2583 - 2584 - /* Skeleton interface for Bison's Yacc-like parsers in C 2585 - 2586 - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 2587 - Free Software Foundation, Inc. 2588 - 2589 - This program is free software; you can redistribute it and/or modify 2590 - it under the terms of the GNU General Public License as published by 2591 - the Free Software Foundation; either version 2, or (at your option) 2592 - any later version. 2593 - 2594 - This program is distributed in the hope that it will be useful, 2595 - but WITHOUT ANY WARRANTY; without even the implied warranty of 2596 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 2597 - GNU General Public License for more details. 2598 - 2599 - You should have received a copy of the GNU General Public License 2600 - along with this program; if not, write to the Free Software 2601 - Foundation, Inc., 51 Franklin Street, Fifth Floor, 2602 - Boston, MA 02110-1301, USA. */ 2603 - 2604 - /* As a special exception, you may create a larger work that contains 2605 - part or all of the Bison parser skeleton and distribute that work 2606 - under terms of your choice, so long as that work isn't itself a 2607 - parser generator using the skeleton or a modified version thereof 2608 - as a parser skeleton. Alternatively, if you modify or redistribute 2609 - the parser skeleton itself, you may (at your option) remove this 2610 - special exception, which will cause the skeleton and the resulting 2611 - Bison output files to be licensed under the GNU General Public 2612 - License without this special exception. 2613 - 2614 - This special exception was added by the Free Software Foundation in 2615 - version 2.2 of Bison. */ 2616 - 2617 - /* Tokens. */ 2618 - #ifndef YYTOKENTYPE 2619 - # define YYTOKENTYPE 2620 - /* Put the tokens into the symbol table, so that GDB and other debuggers 2621 - know about them. */ 2622 - enum yytokentype { 2623 - ASM_KEYW = 258, 2624 - ATTRIBUTE_KEYW = 259, 2625 - AUTO_KEYW = 260, 2626 - BOOL_KEYW = 261, 2627 - CHAR_KEYW = 262, 2628 - CONST_KEYW = 263, 2629 - DOUBLE_KEYW = 264, 2630 - ENUM_KEYW = 265, 2631 - EXTERN_KEYW = 266, 2632 - EXTENSION_KEYW = 267, 2633 - FLOAT_KEYW = 268, 2634 - INLINE_KEYW = 269, 2635 - INT_KEYW = 270, 2636 - LONG_KEYW = 271, 2637 - REGISTER_KEYW = 272, 2638 - RESTRICT_KEYW = 273, 2639 - SHORT_KEYW = 274, 2640 - SIGNED_KEYW = 275, 2641 - STATIC_KEYW = 276, 2642 - STRUCT_KEYW = 277, 2643 - TYPEDEF_KEYW = 278, 2644 - UNION_KEYW = 279, 2645 - UNSIGNED_KEYW = 280, 2646 - VOID_KEYW = 281, 2647 - VOLATILE_KEYW = 282, 2648 - TYPEOF_KEYW = 283, 2649 - EXPORT_SYMBOL_KEYW = 284, 2650 - ASM_PHRASE = 285, 2651 - ATTRIBUTE_PHRASE = 286, 2652 - BRACE_PHRASE = 287, 2653 - BRACKET_PHRASE = 288, 2654 - EXPRESSION_PHRASE = 289, 2655 - CHAR = 290, 2656 - DOTS = 291, 2657 - IDENT = 292, 2658 - INT = 293, 2659 - REAL = 294, 2660 - STRING = 295, 2661 - TYPE = 296, 2662 - OTHER = 297, 2663 - FILENAME = 298 2664 - }; 2665 - #endif 2666 - /* Tokens. */ 2667 - #define ASM_KEYW 258 2668 - #define ATTRIBUTE_KEYW 259 2669 - #define AUTO_KEYW 260 2670 - #define BOOL_KEYW 261 2671 - #define CHAR_KEYW 262 2672 - #define CONST_KEYW 263 2673 - #define DOUBLE_KEYW 264 2674 - #define ENUM_KEYW 265 2675 - #define EXTERN_KEYW 266 2676 - #define EXTENSION_KEYW 267 2677 - #define FLOAT_KEYW 268 2678 - #define INLINE_KEYW 269 2679 - #define INT_KEYW 270 2680 - #define LONG_KEYW 271 2681 - #define REGISTER_KEYW 272 2682 - #define RESTRICT_KEYW 273 2683 - #define SHORT_KEYW 274 2684 - #define SIGNED_KEYW 275 2685 - #define STATIC_KEYW 276 2686 - #define STRUCT_KEYW 277 2687 - #define TYPEDEF_KEYW 278 2688 - #define UNION_KEYW 279 2689 - #define UNSIGNED_KEYW 280 2690 - #define VOID_KEYW 281 2691 - #define VOLATILE_KEYW 282 2692 - #define TYPEOF_KEYW 283 2693 - #define EXPORT_SYMBOL_KEYW 284 2694 - #define ASM_PHRASE 285 2695 - #define ATTRIBUTE_PHRASE 286 2696 - #define BRACE_PHRASE 287 2697 - #define BRACKET_PHRASE 288 2698 - #define EXPRESSION_PHRASE 289 2699 - #define CHAR 290 2700 - #define DOTS 291 2701 - #define IDENT 292 2702 - #define INT 293 2703 - #define REAL 294 2704 - #define STRING 295 2705 - #define TYPE 296 2706 - #define OTHER 297 2707 - #define FILENAME 298 2708 - 2709 - 2710 - 2711 - 2712 - #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 2713 - typedef int YYSTYPE; 2714 - # define yystype YYSTYPE /* obsolescent; will be withdrawn */ 2715 - # define YYSTYPE_IS_DECLARED 1 2716 - # define YYSTYPE_IS_TRIVIAL 1 2717 - #endif 2718 - 2719 - extern YYSTYPE yylval; 2720 - 2721 2570
+31 -13
scripts/genksyms/lex.l
··· 55 55 56 56 MC_TOKEN ([~%^&*+=|<>/-]=)|(&&)|("||")|(->)|(<<)|(>>) 57 57 58 - /* Version 2 checksumming does proper tokenization; version 1 wasn't 59 - quite so pedantic. */ 60 - %s V2_TOKENS 61 - 62 58 /* We don't do multiple input files. */ 63 59 %option noyywrap 64 60 ··· 80 84 recognized as tokens. We don't actually use them since we don't 81 85 parse expressions, but we do want whitespace to be arranged 82 86 around them properly. */ 83 - <V2_TOKENS>{MC_TOKEN} return OTHER; 84 - <V2_TOKENS>{INT} return INT; 85 - <V2_TOKENS>{REAL} return REAL; 87 + {MC_TOKEN} return OTHER; 88 + {INT} return INT; 89 + {REAL} return REAL; 86 90 87 91 "..." return DOTS; 88 92 ··· 99 103 100 104 /* Macros to append to our phrase collection list. */ 101 105 106 + /* 107 + * We mark any token, that that equals to a known enumerator, as 108 + * SYM_ENUM_CONST. The parser will change this for struct and union tags later, 109 + * the only problem is struct and union members: 110 + * enum e { a, b }; struct s { int a, b; } 111 + * but in this case, the only effect will be, that the ABI checksums become 112 + * more volatile, which is acceptable. Also, such collisions are quite rare, 113 + * so far it was only observed in include/linux/telephony.h. 114 + */ 102 115 #define _APP(T,L) do { \ 103 116 cur_node = next_node; \ 104 117 next_node = xmalloc(sizeof(*next_node)); \ 105 118 next_node->next = cur_node; \ 106 119 cur_node->string = memcpy(xmalloc(L+1), T, L+1); \ 107 - cur_node->tag = SYM_NORMAL; \ 120 + cur_node->tag = \ 121 + find_symbol(cur_node->string, SYM_ENUM_CONST, 1)?\ 122 + SYM_ENUM_CONST : SYM_NORMAL ; \ 108 123 } while (0) 109 124 110 125 #define APP _APP(yytext, yyleng) ··· 141 134 142 135 if (lexstate == ST_NOTSTARTED) 143 136 { 144 - BEGIN(V2_TOKENS); 145 137 next_node = xmalloc(sizeof(*next_node)); 146 138 next_node->next = NULL; 147 139 lexstate = ST_NORMAL; ··· 193 187 194 188 case STRUCT_KEYW: 195 189 case UNION_KEYW: 196 - dont_want_brace_phrase = 3; 197 190 case ENUM_KEYW: 191 + dont_want_brace_phrase = 3; 198 192 suppress_type_lookup = 2; 199 193 goto fini; 200 194 ··· 204 198 } 205 199 if (!suppress_type_lookup) 206 200 { 207 - struct symbol *sym = find_symbol(yytext, SYM_TYPEDEF); 208 - if (sym && sym->type == SYM_TYPEDEF) 201 + if (find_symbol(yytext, SYM_TYPEDEF, 1)) 209 202 token = TYPE; 210 203 } 211 204 } ··· 323 318 ++count; 324 319 APP; 325 320 goto repeat; 326 - case ')': case ']': case '}': 321 + case '}': 322 + /* is this the last line of an enum declaration? */ 323 + if (count == 0) 324 + { 325 + /* Put back the token we just read so's we can find it again 326 + after registering the expression. */ 327 + unput(token); 328 + 329 + lexstate = ST_NORMAL; 330 + token = EXPRESSION_PHRASE; 331 + break; 332 + } 333 + /* FALLTHRU */ 334 + case ')': case ']': 327 335 --count; 328 336 APP; 329 337 goto repeat;
+623 -456
scripts/genksyms/parse.c_shipped
··· 1 - /* A Bison parser, made by GNU Bison 2.3. */ 1 + 2 + /* A Bison parser, made by GNU Bison 2.4.1. */ 2 3 3 4 /* Skeleton implementation for Bison's Yacc-like parsers in C 4 - 5 - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 5 + 6 + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 6 7 Free Software Foundation, Inc. 7 - 8 - This program is free software; you can redistribute it and/or modify 8 + 9 + This program is free software: you can redistribute it and/or modify 9 10 it under the terms of the GNU General Public License as published by 10 - the Free Software Foundation; either version 2, or (at your option) 11 - any later version. 12 - 11 + the Free Software Foundation, either version 3 of the License, or 12 + (at your option) any later version. 13 + 13 14 This program is distributed in the hope that it will be useful, 14 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 17 GNU General Public License for more details. 17 - 18 + 18 19 You should have received a copy of the GNU General Public License 19 - along with this program; if not, write to the Free Software 20 - Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 - Boston, MA 02110-1301, USA. */ 20 + along with this program. If not, see <http://www.gnu.org/licenses/>. */ 22 21 23 22 /* As a special exception, you may create a larger work that contains 24 23 part or all of the Bison parser skeleton and distribute that work ··· 28 29 special exception, which will cause the skeleton and the resulting 29 30 Bison output files to be licensed under the GNU General Public 30 31 License without this special exception. 31 - 32 + 32 33 This special exception was added by the Free Software Foundation in 33 34 version 2.2 of Bison. */ 34 35 ··· 46 47 #define YYBISON 1 47 48 48 49 /* Bison version. */ 49 - #define YYBISON_VERSION "2.3" 50 + #define YYBISON_VERSION "2.4.1" 50 51 51 52 /* Skeleton name. */ 52 53 #define YYSKELETON_NAME "yacc.c" ··· 54 55 /* Pure parsers. */ 55 56 #define YYPURE 0 56 57 58 + /* Push parsers. */ 59 + #define YYPUSH 0 60 + 61 + /* Pull parsers. */ 62 + #define YYPULL 1 63 + 57 64 /* Using locations. */ 58 65 #define YYLSP_NEEDED 0 59 66 67 + 68 + 69 + /* Copy the first part of user declarations. */ 70 + 71 + /* Line 189 of yacc.c */ 72 + #line 24 "scripts/genksyms/parse.y" 73 + 74 + 75 + #include <assert.h> 76 + #include <stdlib.h> 77 + #include <string.h> 78 + #include "genksyms.h" 79 + 80 + static int is_typedef; 81 + static int is_extern; 82 + static char *current_name; 83 + static struct string_list *decl_spec; 84 + 85 + static void yyerror(const char *); 86 + 87 + static inline void 88 + remove_node(struct string_list **p) 89 + { 90 + struct string_list *node = *p; 91 + *p = node->next; 92 + free_node(node); 93 + } 94 + 95 + static inline void 96 + remove_list(struct string_list **pb, struct string_list **pe) 97 + { 98 + struct string_list *b = *pb, *e = *pe; 99 + *pb = e; 100 + free_list(b, e); 101 + } 102 + 103 + 104 + 105 + /* Line 189 of yacc.c */ 106 + #line 106 "scripts/genksyms/parse.c" 107 + 108 + /* Enabling traces. */ 109 + #ifndef YYDEBUG 110 + # define YYDEBUG 1 111 + #endif 112 + 113 + /* Enabling verbose error messages. */ 114 + #ifdef YYERROR_VERBOSE 115 + # undef YYERROR_VERBOSE 116 + # define YYERROR_VERBOSE 1 117 + #else 118 + # define YYERROR_VERBOSE 0 119 + #endif 120 + 121 + /* Enabling the token table. */ 122 + #ifndef YYTOKEN_TABLE 123 + # define YYTOKEN_TABLE 0 124 + #endif 60 125 61 126 62 127 /* Tokens. */ ··· 172 109 FILENAME = 298 173 110 }; 174 111 #endif 175 - /* Tokens. */ 176 - #define ASM_KEYW 258 177 - #define ATTRIBUTE_KEYW 259 178 - #define AUTO_KEYW 260 179 - #define BOOL_KEYW 261 180 - #define CHAR_KEYW 262 181 - #define CONST_KEYW 263 182 - #define DOUBLE_KEYW 264 183 - #define ENUM_KEYW 265 184 - #define EXTERN_KEYW 266 185 - #define EXTENSION_KEYW 267 186 - #define FLOAT_KEYW 268 187 - #define INLINE_KEYW 269 188 - #define INT_KEYW 270 189 - #define LONG_KEYW 271 190 - #define REGISTER_KEYW 272 191 - #define RESTRICT_KEYW 273 192 - #define SHORT_KEYW 274 193 - #define SIGNED_KEYW 275 194 - #define STATIC_KEYW 276 195 - #define STRUCT_KEYW 277 196 - #define TYPEDEF_KEYW 278 197 - #define UNION_KEYW 279 198 - #define UNSIGNED_KEYW 280 199 - #define VOID_KEYW 281 200 - #define VOLATILE_KEYW 282 201 - #define TYPEOF_KEYW 283 202 - #define EXPORT_SYMBOL_KEYW 284 203 - #define ASM_PHRASE 285 204 - #define ATTRIBUTE_PHRASE 286 205 - #define BRACE_PHRASE 287 206 - #define BRACKET_PHRASE 288 207 - #define EXPRESSION_PHRASE 289 208 - #define CHAR 290 209 - #define DOTS 291 210 - #define IDENT 292 211 - #define INT 293 212 - #define REAL 294 213 - #define STRING 295 214 - #define TYPE 296 215 - #define OTHER 297 216 - #define FILENAME 298 217 112 218 113 219 - 220 - 221 - /* Copy the first part of user declarations. */ 222 - #line 24 "scripts/genksyms/parse.y" 223 - 224 - 225 - #include <assert.h> 226 - #include <stdlib.h> 227 - #include "genksyms.h" 228 - 229 - static int is_typedef; 230 - static int is_extern; 231 - static char *current_name; 232 - static struct string_list *decl_spec; 233 - 234 - static void yyerror(const char *); 235 - 236 - static inline void 237 - remove_node(struct string_list **p) 238 - { 239 - struct string_list *node = *p; 240 - *p = node->next; 241 - free_node(node); 242 - } 243 - 244 - static inline void 245 - remove_list(struct string_list **pb, struct string_list **pe) 246 - { 247 - struct string_list *b = *pb, *e = *pe; 248 - *pb = e; 249 - free_list(b, e); 250 - } 251 - 252 - 253 - 254 - /* Enabling traces. */ 255 - #ifndef YYDEBUG 256 - # define YYDEBUG 1 257 - #endif 258 - 259 - /* Enabling verbose error messages. */ 260 - #ifdef YYERROR_VERBOSE 261 - # undef YYERROR_VERBOSE 262 - # define YYERROR_VERBOSE 1 263 - #else 264 - # define YYERROR_VERBOSE 0 265 - #endif 266 - 267 - /* Enabling the token table. */ 268 - #ifndef YYTOKEN_TABLE 269 - # define YYTOKEN_TABLE 0 270 - #endif 271 114 272 115 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 273 116 typedef int YYSTYPE; 117 + # define YYSTYPE_IS_TRIVIAL 1 274 118 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ 275 119 # define YYSTYPE_IS_DECLARED 1 276 - # define YYSTYPE_IS_TRIVIAL 1 277 120 #endif 278 - 279 121 280 122 281 123 /* Copy the second part of user declarations. */ 282 124 283 125 284 - /* Line 216 of yacc.c. */ 285 - #line 223 "scripts/genksyms/parse.c" 126 + /* Line 264 of yacc.c */ 127 + #line 191 "scripts/genksyms/parse.c" 286 128 287 129 #ifdef short 288 130 # undef short ··· 262 294 #if (defined __STDC__ || defined __C99__FUNC__ \ 263 295 || defined __cplusplus || defined _MSC_VER) 264 296 static int 265 - YYID (int i) 297 + YYID (int yyi) 266 298 #else 267 299 static int 268 - YYID (i) 269 - int i; 300 + YYID (yyi) 301 + int yyi; 270 302 #endif 271 303 { 272 - return i; 304 + return yyi; 273 305 } 274 306 #endif 275 307 ··· 350 382 /* A type that is properly aligned for any stack member. */ 351 383 union yyalloc 352 384 { 353 - yytype_int16 yyss; 354 - YYSTYPE yyvs; 355 - }; 385 + yytype_int16 yyss_alloc; 386 + YYSTYPE yyvs_alloc; 387 + }; 356 388 357 389 /* The size of the maximum gap between one aligned stack and the next. */ 358 390 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) ··· 386 418 elements in the stack, and YYPTR gives the new location of the 387 419 stack. Advance YYPTR to a properly aligned location for the next 388 420 stack. */ 389 - # define YYSTACK_RELOCATE(Stack) \ 421 + # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 390 422 do \ 391 423 { \ 392 424 YYSIZE_T yynewbytes; \ 393 - YYCOPY (&yyptr->Stack, Stack, yysize); \ 394 - Stack = &yyptr->Stack; \ 425 + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 426 + Stack = &yyptr->Stack_alloc; \ 395 427 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 396 428 yyptr += yynewbytes / sizeof (*yyptr); \ 397 429 } \ ··· 402 434 /* YYFINAL -- State number of the termination state. */ 403 435 #define YYFINAL 4 404 436 /* YYLAST -- Last index in YYTABLE. */ 405 - #define YYLAST 523 437 + #define YYLAST 532 406 438 407 439 /* YYNTOKENS -- Number of terminals. */ 408 440 #define YYNTOKENS 53 409 441 /* YYNNTS -- Number of nonterminals. */ 410 - #define YYNNTS 46 442 + #define YYNNTS 49 411 443 /* YYNRULES -- Number of rules. */ 412 - #define YYNRULES 126 444 + #define YYNRULES 132 413 445 /* YYNRULES -- Number of states. */ 414 - #define YYNSTATES 178 446 + #define YYNSTATES 188 415 447 416 448 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 417 449 #define YYUNDEFTOK 2 ··· 472 504 239, 242, 245, 247, 248, 250, 252, 257, 262, 265, 473 505 269, 273, 277, 278, 280, 283, 287, 291, 292, 294, 474 506 296, 299, 303, 306, 307, 309, 311, 315, 318, 321, 475 - 323, 326, 327, 330, 333, 334, 336 507 + 323, 326, 327, 330, 334, 339, 341, 345, 347, 351, 508 + 354, 355, 357 476 509 }; 477 510 478 511 /* YYRHS -- A `-1'-separated list of the rules' RHS. */ ··· 481 512 { 482 513 54, 0, -1, 55, -1, 54, 55, -1, -1, 56, 483 514 57, -1, -1, 12, 23, 58, 60, -1, -1, 23, 484 - 59, 60, -1, 60, -1, 84, -1, 96, -1, 98, 515 + 59, 60, -1, 60, -1, 84, -1, 99, -1, 101, 485 516 -1, 1, 44, -1, 1, 45, -1, 64, 61, 44, 486 517 -1, -1, 62, -1, 63, -1, 62, 46, 63, -1, 487 - 74, 97, 95, 85, -1, -1, 65, -1, 66, -1, 518 + 74, 100, 95, 85, -1, -1, 65, -1, 66, -1, 488 519 65, 66, -1, 67, -1, 68, -1, 5, -1, 17, 489 520 -1, 21, -1, 11, -1, 14, -1, 69, -1, 73, 490 521 -1, 28, 47, 65, 48, 49, -1, 28, 47, 65, 491 522 49, -1, 22, 37, -1, 24, 37, -1, 10, 37, 492 523 -1, 22, 37, 87, -1, 24, 37, 87, -1, 10, 493 - 37, 32, -1, 10, 32, -1, 22, 87, -1, 24, 524 + 37, 96, -1, 10, 96, -1, 22, 87, -1, 24, 494 525 87, -1, 7, -1, 19, -1, 15, -1, 16, -1, 495 526 20, -1, 25, -1, 13, -1, 9, -1, 26, -1, 496 527 6, -1, 41, -1, 48, 71, -1, -1, 72, -1, ··· 512 543 91, 44, -1, 1, 44, -1, -1, 92, -1, 93, 513 544 -1, 92, 46, 93, -1, 76, 95, -1, 37, 94, 514 545 -1, 94, -1, 52, 34, -1, -1, 95, 31, -1, 515 - 30, 44, -1, -1, 30, -1, 29, 47, 37, 49, 516 - 44, -1 546 + 51, 97, 45, -1, 51, 97, 46, 45, -1, 98, 547 + -1, 97, 46, 98, -1, 37, -1, 37, 50, 34, 548 + -1, 30, 44, -1, -1, 30, -1, 29, 47, 37, 549 + 49, 44, -1 517 550 }; 518 551 519 552 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 520 553 static const yytype_uint16 yyrline[] = 521 554 { 522 - 0, 103, 103, 104, 108, 108, 114, 114, 116, 116, 523 - 118, 119, 120, 121, 122, 123, 127, 141, 142, 146, 524 - 154, 167, 173, 174, 178, 179, 183, 189, 193, 194, 525 - 195, 196, 197, 201, 202, 203, 204, 208, 210, 212, 526 - 216, 223, 230, 239, 240, 241, 245, 246, 247, 248, 527 - 249, 250, 251, 252, 253, 254, 255, 259, 264, 265, 528 - 269, 270, 274, 274, 274, 275, 283, 284, 288, 297, 529 - 299, 301, 303, 305, 312, 313, 317, 318, 319, 321, 530 - 323, 325, 327, 332, 333, 334, 338, 339, 343, 344, 531 - 349, 354, 356, 360, 361, 369, 373, 375, 377, 379, 532 - 381, 386, 395, 396, 401, 406, 407, 411, 412, 416, 533 - 417, 421, 423, 428, 429, 433, 434, 438, 439, 440, 534 - 444, 448, 449, 453, 457, 458, 462 555 + 0, 104, 104, 105, 109, 109, 115, 115, 117, 117, 556 + 119, 120, 121, 122, 123, 124, 128, 142, 143, 147, 557 + 155, 168, 174, 175, 179, 180, 184, 190, 194, 195, 558 + 196, 197, 198, 202, 203, 204, 205, 209, 211, 213, 559 + 217, 224, 231, 241, 244, 245, 249, 250, 251, 252, 560 + 253, 254, 255, 256, 257, 258, 259, 263, 268, 269, 561 + 273, 274, 278, 278, 278, 279, 287, 288, 292, 301, 562 + 303, 305, 307, 309, 316, 317, 321, 322, 323, 325, 563 + 327, 329, 331, 336, 337, 338, 342, 343, 347, 348, 564 + 353, 358, 360, 364, 365, 373, 377, 379, 381, 383, 565 + 385, 390, 399, 400, 405, 410, 411, 415, 416, 420, 566 + 421, 425, 427, 432, 433, 437, 438, 442, 443, 444, 567 + 448, 452, 453, 457, 458, 462, 463, 466, 471, 479, 568 + 483, 484, 488 535 569 }; 536 570 #endif 537 571 ··· 553 581 "ATTRIBUTE_PHRASE", "BRACE_PHRASE", "BRACKET_PHRASE", 554 582 "EXPRESSION_PHRASE", "CHAR", "DOTS", "IDENT", "INT", "REAL", "STRING", 555 583 "TYPE", "OTHER", "FILENAME", "';'", "'}'", "','", "'('", "'*'", "')'", 556 - "'='", "'{'", "':'", "$accept", "declaration_seq", "declaration", "@1", 557 - "declaration1", "@2", "@3", "simple_declaration", 584 + "'='", "'{'", "':'", "$accept", "declaration_seq", "declaration", "$@1", 585 + "declaration1", "$@2", "$@3", "simple_declaration", 558 586 "init_declarator_list_opt", "init_declarator_list", "init_declarator", 559 587 "decl_specifier_seq_opt", "decl_specifier_seq", "decl_specifier", 560 588 "storage_class_specifier", "type_specifier", "simple_type_specifier", ··· 568 596 "member_specification", "member_declaration", 569 597 "member_declarator_list_opt", "member_declarator_list", 570 598 "member_declarator", "member_bitfield_declarator", "attribute_opt", 571 - "asm_definition", "asm_phrase_opt", "export_definition", 0 599 + "enum_body", "enumerator_list", "enumerator", "asm_definition", 600 + "asm_phrase_opt", "export_definition", 0 572 601 }; 573 602 #endif 574 603 ··· 602 629 81, 82, 82, 83, 83, 83, 83, 83, 83, 83, 603 630 83, 84, 85, 85, 86, 87, 87, 88, 88, 89, 604 631 89, 90, 90, 91, 91, 92, 92, 93, 93, 93, 605 - 94, 95, 95, 96, 97, 97, 98 632 + 94, 95, 95, 96, 96, 97, 97, 98, 98, 99, 633 + 100, 100, 101 606 634 }; 607 635 608 636 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ ··· 621 647 2, 2, 1, 0, 1, 1, 4, 4, 2, 3, 622 648 3, 3, 0, 1, 2, 3, 3, 0, 1, 1, 623 649 2, 3, 2, 0, 1, 1, 3, 2, 2, 1, 624 - 2, 0, 2, 2, 0, 1, 5 650 + 2, 0, 2, 3, 4, 1, 3, 1, 3, 2, 651 + 0, 1, 5 625 652 }; 626 653 627 654 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state ··· 634 659 62, 53, 0, 31, 0, 52, 32, 48, 49, 29, 635 660 65, 47, 50, 30, 0, 8, 0, 51, 54, 63, 636 661 0, 0, 0, 64, 56, 5, 10, 17, 23, 24, 637 - 26, 27, 33, 34, 11, 12, 13, 14, 15, 43, 638 - 39, 6, 37, 0, 44, 22, 38, 45, 0, 0, 639 - 123, 68, 0, 58, 0, 18, 19, 0, 124, 67, 640 - 25, 42, 22, 40, 0, 113, 0, 0, 109, 9, 641 - 17, 41, 0, 0, 0, 0, 57, 59, 60, 16, 642 - 0, 66, 125, 101, 121, 71, 0, 7, 112, 106, 643 - 76, 77, 0, 0, 0, 121, 75, 0, 114, 115, 644 - 119, 105, 0, 110, 124, 0, 36, 0, 73, 72, 645 - 61, 20, 102, 0, 93, 0, 84, 87, 88, 118, 662 + 26, 27, 33, 34, 11, 12, 13, 14, 15, 39, 663 + 0, 43, 6, 37, 0, 44, 22, 38, 45, 0, 664 + 0, 129, 68, 0, 58, 0, 18, 19, 0, 130, 665 + 67, 25, 42, 127, 0, 125, 22, 40, 0, 113, 666 + 0, 0, 109, 9, 17, 41, 0, 0, 0, 0, 667 + 57, 59, 60, 16, 0, 66, 131, 101, 121, 71, 668 + 0, 0, 123, 0, 7, 112, 106, 76, 77, 0, 669 + 0, 0, 121, 75, 0, 114, 115, 119, 105, 0, 670 + 110, 130, 0, 36, 0, 73, 72, 61, 20, 102, 671 + 0, 93, 0, 84, 87, 88, 128, 124, 126, 118, 646 672 0, 76, 0, 120, 74, 117, 80, 0, 111, 0, 647 - 35, 126, 122, 0, 21, 103, 70, 94, 56, 0, 673 + 35, 132, 122, 0, 21, 103, 70, 94, 56, 0, 648 674 93, 90, 92, 69, 83, 0, 82, 81, 0, 0, 649 675 116, 104, 0, 95, 0, 91, 98, 0, 85, 89, 650 676 79, 78, 100, 99, 0, 0, 97, 96 ··· 654 678 /* YYDEFGOTO[NTERM-NUM]. */ 655 679 static const yytype_int16 yydefgoto[] = 656 680 { 657 - -1, 1, 2, 3, 35, 72, 55, 36, 64, 65, 658 - 66, 75, 38, 39, 40, 41, 42, 67, 86, 87, 659 - 43, 114, 69, 105, 106, 125, 126, 127, 128, 151, 660 - 152, 44, 144, 145, 54, 76, 77, 78, 107, 108, 661 - 109, 110, 122, 45, 94, 46 681 + -1, 1, 2, 3, 35, 76, 56, 36, 65, 66, 682 + 67, 79, 38, 39, 40, 41, 42, 68, 90, 91, 683 + 43, 121, 70, 112, 113, 132, 133, 134, 135, 161, 684 + 162, 44, 154, 155, 55, 80, 81, 82, 114, 115, 685 + 116, 117, 129, 51, 74, 75, 45, 98, 46 662 686 }; 663 687 664 688 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 665 689 STATE-NUM. */ 666 - #define YYPACT_NINF -134 690 + #define YYPACT_NINF -135 667 691 static const yytype_int16 yypact[] = 668 692 { 669 - -134, 16, -134, 312, -134, -134, 20, -134, -134, -134, 670 - -134, -134, -18, -134, -3, -134, -134, -134, -134, -134, 671 - -134, -134, -134, -134, -26, -134, -25, -134, -134, -134, 672 - -7, 5, 27, -134, -134, -134, -134, 46, 482, -134, 673 - -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, 674 - -8, -134, 30, 97, -134, 482, 30, -134, 482, 7, 675 - -134, -134, 12, 10, 42, 55, -134, 46, -15, 15, 676 - -134, -134, 482, -134, 25, 26, 47, 145, -134, -134, 677 - 46, -134, 356, 39, 71, 77, -134, 10, -134, -134, 678 - 46, -134, -134, -134, -134, -134, 193, -134, -134, -134, 679 - 75, -134, 6, 95, 43, -134, 28, 86, 85, -134, 680 - -134, -134, 88, -134, 103, 87, -134, 91, -134, -134, 681 - -134, -134, -23, 90, 401, 94, 101, 102, -134, -134, 682 - 98, -134, 108, -134, -134, 109, -134, 230, -134, 26, 683 - -134, -134, -134, 134, -134, -134, -134, -134, -134, 9, 684 - 48, -134, 35, -134, -134, 445, -134, -134, 125, 126, 685 - -134, -134, 128, -134, 129, -134, -134, 267, -134, -134, 686 - -134, -134, -134, -134, 130, 131, -134, -134 693 + -135, 20, -135, 321, -135, -135, 30, -135, -135, -135, 694 + -135, -135, -28, -135, 2, -135, -135, -135, -135, -135, 695 + -135, -135, -135, -135, -6, -135, 9, -135, -135, -135, 696 + -5, 15, -17, -135, -135, -135, -135, 18, 491, -135, 697 + -135, -135, -135, -135, -135, -135, -135, -135, -135, -22, 698 + 31, -135, -135, 19, 106, -135, 491, 19, -135, 491, 699 + 50, -135, -135, 11, -3, 51, 57, -135, 18, -14, 700 + 14, -135, -135, 48, 46, -135, 491, -135, 33, 32, 701 + 59, 154, -135, -135, 18, -135, 365, 56, 60, 61, 702 + -135, -3, -135, -135, 18, -135, -135, -135, -135, -135, 703 + 202, 74, -135, -23, -135, -135, -135, 77, -135, 16, 704 + 101, 49, -135, 34, 92, 93, -135, -135, -135, 94, 705 + -135, 110, 95, -135, 97, -135, -135, -135, -135, -20, 706 + 96, 410, 99, 113, 100, -135, -135, -135, -135, -135, 707 + 103, -135, 107, -135, -135, 111, -135, 239, -135, 32, 708 + -135, -135, -135, 123, -135, -135, -135, -135, -135, 3, 709 + 52, -135, 38, -135, -135, 454, -135, -135, 117, 128, 710 + -135, -135, 134, -135, 135, -135, -135, 276, -135, -135, 711 + -135, -135, -135, -135, 137, 138, -135, -135 687 712 }; 688 713 689 714 /* YYPGOTO[NTERM-NUM]. */ 690 715 static const yytype_int16 yypgoto[] = 691 716 { 692 - -134, -134, 180, -134, -134, -134, -134, -33, -134, -134, 693 - 93, 0, -58, -37, -134, -134, -134, -73, -134, -134, 694 - -54, -32, -134, -81, -134, -133, -134, -134, 29, -50, 695 - -134, -134, -134, -134, -20, -134, -134, 110, -134, -134, 696 - 49, 96, 80, -134, -134, -134 717 + -135, -135, 187, -135, -135, -135, -135, -50, -135, -135, 718 + 98, 0, -59, -37, -135, -135, -135, -77, -135, -135, 719 + -54, -30, -135, -90, -135, -134, -135, -135, 24, -58, 720 + -135, -135, -135, -135, -18, -135, -135, 109, -135, -135, 721 + 44, 87, 84, 148, -135, 102, -135, -135, -135 697 722 }; 698 723 699 724 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If ··· 704 727 #define YYTABLE_NINF -109 705 728 static const yytype_int16 yytable[] = 706 729 { 707 - 82, 70, 104, 37, 159, 68, 57, 130, 142, 88, 708 - 162, 52, 56, 84, 49, 92, 4, 93, 10, 50, 709 - 51, 132, 79, 134, 71, 53, 53, 143, 20, 104, 710 - 85, 104, 73, 120, 175, 91, 81, 29, 124, 97, 711 - 58, 33, -93, 131, 83, 70, 147, 101, 95, 61, 712 - 163, 150, 59, 102, 63, 80, 149, 63, -93, 62, 713 - 63, 136, 96, 100, 47, 48, 104, 101, 166, 98, 714 - 99, 60, 80, 102, 63, 137, 150, 150, 103, 124, 715 - 131, 53, 167, 61, 101, 147, 89, 70, 117, 163, 716 - 102, 63, 111, 62, 63, 149, 63, 124, 74, 164, 717 - 165, 90, 7, 8, 9, 10, 11, 12, 13, 124, 718 - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 719 - 118, 26, 27, 28, 29, 30, 119, 103, 33, 133, 720 - 138, 139, 98, 92, -22, 141, 140, 154, 34, 146, 721 - 142, -22, -107, 153, -22, -22, 112, 156, 155, -22, 722 - 7, 8, 9, 10, 11, 12, 13, 157, 15, 16, 723 - 17, 18, 19, 20, 21, 22, 23, 24, 161, 26, 724 - 27, 28, 29, 30, 170, 171, 33, 172, 173, 176, 725 - 177, 5, -22, 121, 169, 135, 34, 113, 160, -22, 726 - -108, 0, -22, -22, 123, 0, 129, -22, 7, 8, 727 - 9, 10, 11, 12, 13, 0, 15, 16, 17, 18, 728 - 19, 20, 21, 22, 23, 24, 0, 26, 27, 28, 729 - 29, 30, 0, 0, 33, 0, 0, 0, 0, -86, 730 - 0, 158, 0, 0, 34, 7, 8, 9, 10, 11, 731 - 12, 13, -86, 15, 16, 17, 18, 19, 20, 21, 732 - 22, 23, 24, 0, 26, 27, 28, 29, 30, 0, 733 - 0, 33, 0, 0, 0, 0, -86, 0, 174, 0, 734 - 0, 34, 7, 8, 9, 10, 11, 12, 13, -86, 735 - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 736 - 0, 26, 27, 28, 29, 30, 0, 0, 33, 0, 737 - 0, 0, 0, -86, 0, 0, 0, 0, 34, 0, 738 - 0, 0, 0, 6, 0, 0, -86, 7, 8, 9, 739 - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 740 - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 741 - 30, 31, 32, 33, 0, 0, 0, 0, 0, -22, 742 - 0, 0, 0, 34, 0, 0, -22, 0, 0, -22, 743 - -22, 7, 8, 9, 10, 11, 12, 13, 0, 15, 730 + 86, 71, 111, 37, 172, 10, 83, 69, 58, 49, 731 + 92, 152, 88, 169, 73, 20, 96, 140, 97, 142, 732 + 4, 144, 137, 50, 29, 52, 104, 61, 33, 50, 733 + 153, 53, 111, 89, 111, 77, -93, 127, 95, 85, 734 + 157, 131, 59, 185, 173, 54, 57, 99, 62, 71, 735 + 159, 64, -93, 141, 160, 62, 84, 108, 63, 64, 736 + 54, 100, 60, 109, 64, 63, 64, 146, 73, 107, 737 + 54, 176, 111, 108, 47, 48, 84, 105, 106, 109, 738 + 64, 147, 160, 160, 110, 177, 141, 87, 131, 157, 739 + 108, 102, 103, 173, 71, 93, 109, 64, 101, 159, 740 + 64, 174, 175, 94, 118, 124, 131, 78, 136, 125, 741 + 126, 7, 8, 9, 10, 11, 12, 13, 131, 15, 742 + 16, 17, 18, 19, 20, 21, 22, 23, 24, 110, 743 + 26, 27, 28, 29, 30, 143, 148, 33, 105, 149, 744 + 96, 151, 152, -22, 150, 156, 165, 34, 163, 164, 745 + -22, -107, 166, -22, -22, 119, 167, 171, -22, 7, 746 + 8, 9, 10, 11, 12, 13, 180, 15, 16, 17, 747 + 18, 19, 20, 21, 22, 23, 24, 181, 26, 27, 748 + 28, 29, 30, 182, 183, 33, 186, 187, 5, 179, 749 + 120, -22, 128, 170, 139, 34, 145, 72, -22, -108, 750 + 0, -22, -22, 130, 0, 138, -22, 7, 8, 9, 751 + 10, 11, 12, 13, 0, 15, 16, 17, 18, 19, 752 + 20, 21, 22, 23, 24, 0, 26, 27, 28, 29, 753 + 30, 0, 0, 33, 0, 0, 0, 0, -86, 0, 754 + 168, 0, 0, 34, 7, 8, 9, 10, 11, 12, 755 + 13, -86, 15, 16, 17, 18, 19, 20, 21, 22, 756 + 23, 24, 0, 26, 27, 28, 29, 30, 0, 0, 757 + 33, 0, 0, 0, 0, -86, 0, 184, 0, 0, 758 + 34, 7, 8, 9, 10, 11, 12, 13, -86, 15, 744 759 16, 17, 18, 19, 20, 21, 22, 23, 24, 0, 745 760 26, 27, 28, 29, 30, 0, 0, 33, 0, 0, 746 - 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 747 - 0, 0, 0, 0, 115, 116, 7, 8, 9, 10, 748 - 11, 12, 13, 0, 15, 16, 17, 18, 19, 20, 749 - 21, 22, 23, 24, 0, 26, 27, 28, 29, 30, 750 - 0, 0, 33, 0, 0, 0, 0, 0, 147, 0, 751 - 0, 0, 148, 0, 0, 0, 0, 0, 149, 63, 761 + 0, 0, -86, 0, 0, 0, 0, 34, 0, 0, 762 + 0, 0, 6, 0, 0, -86, 7, 8, 9, 10, 763 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 764 + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 765 + 31, 32, 33, 0, 0, 0, 0, 0, -22, 0, 766 + 0, 0, 34, 0, 0, -22, 0, 0, -22, -22, 752 767 7, 8, 9, 10, 11, 12, 13, 0, 15, 16, 753 768 17, 18, 19, 20, 21, 22, 23, 24, 0, 26, 754 769 27, 28, 29, 30, 0, 0, 33, 0, 0, 0, 755 - 0, 168, 0, 0, 0, 0, 34, 7, 8, 9, 756 - 10, 11, 12, 13, 0, 15, 16, 17, 18, 19, 757 - 20, 21, 22, 23, 24, 0, 26, 27, 28, 29, 758 - 30, 0, 0, 33, 0, 0, 0, 0, 0, 0, 759 - 0, 0, 0, 34 770 + 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 771 + 0, 0, 0, 122, 123, 7, 8, 9, 10, 11, 772 + 12, 13, 0, 15, 16, 17, 18, 19, 20, 21, 773 + 22, 23, 24, 0, 26, 27, 28, 29, 30, 0, 774 + 0, 33, 0, 0, 0, 0, 0, 157, 0, 0, 775 + 0, 158, 0, 0, 0, 0, 0, 159, 64, 7, 776 + 8, 9, 10, 11, 12, 13, 0, 15, 16, 17, 777 + 18, 19, 20, 21, 22, 23, 24, 0, 26, 27, 778 + 28, 29, 30, 0, 0, 33, 0, 0, 0, 0, 779 + 178, 0, 0, 0, 0, 34, 7, 8, 9, 10, 780 + 11, 12, 13, 0, 15, 16, 17, 18, 19, 20, 781 + 21, 22, 23, 24, 0, 26, 27, 28, 29, 30, 782 + 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 783 + 0, 0, 34 760 784 }; 761 785 762 786 static const yytype_int16 yycheck[] = 763 787 { 764 - 58, 38, 75, 3, 137, 37, 26, 1, 31, 63, 765 - 1, 37, 37, 1, 32, 30, 0, 32, 8, 37, 766 - 23, 102, 55, 104, 32, 51, 51, 50, 18, 102, 767 - 62, 104, 52, 87, 167, 67, 56, 27, 96, 72, 768 - 47, 31, 33, 37, 37, 82, 37, 41, 33, 37, 769 - 41, 124, 47, 47, 48, 55, 47, 48, 49, 47, 770 - 48, 33, 47, 37, 44, 45, 139, 41, 33, 44, 771 - 45, 44, 72, 47, 48, 47, 149, 150, 52, 137, 772 - 37, 51, 47, 37, 41, 37, 44, 124, 49, 41, 773 - 47, 48, 45, 47, 48, 47, 48, 155, 1, 149, 774 - 150, 46, 5, 6, 7, 8, 9, 10, 11, 167, 775 - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 776 - 49, 24, 25, 26, 27, 28, 49, 52, 31, 34, 777 - 44, 46, 44, 30, 37, 44, 49, 36, 41, 49, 778 - 31, 44, 45, 49, 47, 48, 1, 49, 46, 52, 779 - 5, 6, 7, 8, 9, 10, 11, 49, 13, 14, 780 - 15, 16, 17, 18, 19, 20, 21, 22, 34, 24, 781 - 25, 26, 27, 28, 49, 49, 31, 49, 49, 49, 782 - 49, 1, 37, 90, 155, 105, 41, 77, 139, 44, 783 - 45, -1, 47, 48, 1, -1, 100, 52, 5, 6, 784 - 7, 8, 9, 10, 11, -1, 13, 14, 15, 16, 785 - 17, 18, 19, 20, 21, 22, -1, 24, 25, 26, 786 - 27, 28, -1, -1, 31, -1, -1, -1, -1, 36, 787 - -1, 1, -1, -1, 41, 5, 6, 7, 8, 9, 788 - 10, 11, 49, 13, 14, 15, 16, 17, 18, 19, 789 - 20, 21, 22, -1, 24, 25, 26, 27, 28, -1, 790 - -1, 31, -1, -1, -1, -1, 36, -1, 1, -1, 791 - -1, 41, 5, 6, 7, 8, 9, 10, 11, 49, 792 - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 793 - -1, 24, 25, 26, 27, 28, -1, -1, 31, -1, 794 - -1, -1, -1, 36, -1, -1, -1, -1, 41, -1, 795 - -1, -1, -1, 1, -1, -1, 49, 5, 6, 7, 796 - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 797 - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 798 - 28, 29, 30, 31, -1, -1, -1, -1, -1, 37, 799 - -1, -1, -1, 41, -1, -1, 44, -1, -1, 47, 800 - 48, 5, 6, 7, 8, 9, 10, 11, -1, 13, 788 + 59, 38, 79, 3, 1, 8, 56, 37, 26, 37, 789 + 64, 31, 1, 147, 37, 18, 30, 1, 32, 109, 790 + 0, 111, 45, 51, 27, 23, 76, 44, 31, 51, 791 + 50, 37, 109, 63, 111, 53, 33, 91, 68, 57, 792 + 37, 100, 47, 177, 41, 51, 37, 33, 37, 86, 793 + 47, 48, 49, 37, 131, 37, 56, 41, 47, 48, 794 + 51, 47, 47, 47, 48, 47, 48, 33, 37, 37, 795 + 51, 33, 149, 41, 44, 45, 76, 44, 45, 47, 796 + 48, 47, 159, 160, 52, 47, 37, 37, 147, 37, 797 + 41, 45, 46, 41, 131, 44, 47, 48, 50, 47, 798 + 48, 159, 160, 46, 45, 49, 165, 1, 34, 49, 799 + 49, 5, 6, 7, 8, 9, 10, 11, 177, 13, 800 + 14, 15, 16, 17, 18, 19, 20, 21, 22, 52, 801 + 24, 25, 26, 27, 28, 34, 44, 31, 44, 46, 802 + 30, 44, 31, 37, 49, 49, 46, 41, 49, 36, 803 + 44, 45, 49, 47, 48, 1, 49, 34, 52, 5, 804 + 6, 7, 8, 9, 10, 11, 49, 13, 14, 15, 805 + 16, 17, 18, 19, 20, 21, 22, 49, 24, 25, 806 + 26, 27, 28, 49, 49, 31, 49, 49, 1, 165, 807 + 81, 37, 94, 149, 107, 41, 112, 49, 44, 45, 808 + -1, 47, 48, 1, -1, 103, 52, 5, 6, 7, 809 + 8, 9, 10, 11, -1, 13, 14, 15, 16, 17, 810 + 18, 19, 20, 21, 22, -1, 24, 25, 26, 27, 811 + 28, -1, -1, 31, -1, -1, -1, -1, 36, -1, 812 + 1, -1, -1, 41, 5, 6, 7, 8, 9, 10, 813 + 11, 49, 13, 14, 15, 16, 17, 18, 19, 20, 814 + 21, 22, -1, 24, 25, 26, 27, 28, -1, -1, 815 + 31, -1, -1, -1, -1, 36, -1, 1, -1, -1, 816 + 41, 5, 6, 7, 8, 9, 10, 11, 49, 13, 801 817 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, 802 818 24, 25, 26, 27, 28, -1, -1, 31, -1, -1, 803 - -1, -1, -1, -1, -1, -1, -1, 41, -1, -1, 804 - -1, -1, -1, -1, 48, 49, 5, 6, 7, 8, 805 - 9, 10, 11, -1, 13, 14, 15, 16, 17, 18, 806 - 19, 20, 21, 22, -1, 24, 25, 26, 27, 28, 807 - -1, -1, 31, -1, -1, -1, -1, -1, 37, -1, 808 - -1, -1, 41, -1, -1, -1, -1, -1, 47, 48, 819 + -1, -1, 36, -1, -1, -1, -1, 41, -1, -1, 820 + -1, -1, 1, -1, -1, 49, 5, 6, 7, 8, 821 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 822 + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 823 + 29, 30, 31, -1, -1, -1, -1, -1, 37, -1, 824 + -1, -1, 41, -1, -1, 44, -1, -1, 47, 48, 809 825 5, 6, 7, 8, 9, 10, 11, -1, 13, 14, 810 826 15, 16, 17, 18, 19, 20, 21, 22, -1, 24, 811 827 25, 26, 27, 28, -1, -1, 31, -1, -1, -1, 812 - -1, 36, -1, -1, -1, -1, 41, 5, 6, 7, 813 - 8, 9, 10, 11, -1, 13, 14, 15, 16, 17, 814 - 18, 19, 20, 21, 22, -1, 24, 25, 26, 27, 815 - 28, -1, -1, 31, -1, -1, -1, -1, -1, -1, 816 - -1, -1, -1, 41 828 + -1, -1, -1, -1, -1, -1, 41, -1, -1, -1, 829 + -1, -1, -1, 48, 49, 5, 6, 7, 8, 9, 830 + 10, 11, -1, 13, 14, 15, 16, 17, 18, 19, 831 + 20, 21, 22, -1, 24, 25, 26, 27, 28, -1, 832 + -1, 31, -1, -1, -1, -1, -1, 37, -1, -1, 833 + -1, 41, -1, -1, -1, -1, -1, 47, 48, 5, 834 + 6, 7, 8, 9, 10, 11, -1, 13, 14, 15, 835 + 16, 17, 18, 19, 20, 21, 22, -1, 24, 25, 836 + 26, 27, 28, -1, -1, 31, -1, -1, -1, -1, 837 + 36, -1, -1, -1, -1, 41, 5, 6, 7, 8, 838 + 9, 10, 11, -1, 13, 14, 15, 16, 17, 18, 839 + 19, 20, 21, 22, -1, 24, 25, 26, 27, 28, 840 + -1, -1, 31, -1, -1, -1, -1, -1, -1, -1, 841 + -1, -1, 41 817 842 }; 818 843 819 844 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing ··· 826 847 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 827 848 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 828 849 28, 29, 30, 31, 41, 57, 60, 64, 65, 66, 829 - 67, 68, 69, 73, 84, 96, 98, 44, 45, 32, 830 - 37, 23, 37, 51, 87, 59, 37, 87, 47, 47, 831 - 44, 37, 47, 48, 61, 62, 63, 70, 74, 75, 832 - 66, 32, 58, 87, 1, 64, 88, 89, 90, 60, 833 - 64, 87, 65, 37, 1, 74, 71, 72, 73, 44, 834 - 46, 74, 30, 32, 97, 33, 47, 60, 44, 45, 835 - 37, 41, 47, 52, 70, 76, 77, 91, 92, 93, 836 - 94, 45, 1, 90, 74, 48, 49, 49, 49, 49, 837 - 73, 63, 95, 1, 65, 78, 79, 80, 81, 94, 850 + 67, 68, 69, 73, 84, 99, 101, 44, 45, 37, 851 + 51, 96, 23, 37, 51, 87, 59, 37, 87, 47, 852 + 47, 44, 37, 47, 48, 61, 62, 63, 70, 74, 853 + 75, 66, 96, 37, 97, 98, 58, 87, 1, 64, 854 + 88, 89, 90, 60, 64, 87, 65, 37, 1, 74, 855 + 71, 72, 73, 44, 46, 74, 30, 32, 100, 33, 856 + 47, 50, 45, 46, 60, 44, 45, 37, 41, 47, 857 + 52, 70, 76, 77, 91, 92, 93, 94, 45, 1, 858 + 90, 74, 48, 49, 49, 49, 49, 73, 63, 95, 859 + 1, 65, 78, 79, 80, 81, 34, 45, 98, 94, 838 860 1, 37, 76, 34, 76, 95, 33, 47, 44, 46, 839 861 49, 44, 31, 50, 85, 86, 49, 37, 41, 47, 840 862 70, 82, 83, 49, 36, 46, 49, 49, 1, 78, ··· 1025 1045 #if (defined __STDC__ || defined __C99__FUNC__ \ 1026 1046 || defined __cplusplus || defined _MSC_VER) 1027 1047 static void 1028 - yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) 1048 + yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) 1029 1049 #else 1030 1050 static void 1031 - yy_stack_print (bottom, top) 1032 - yytype_int16 *bottom; 1033 - yytype_int16 *top; 1051 + yy_stack_print (yybottom, yytop) 1052 + yytype_int16 *yybottom; 1053 + yytype_int16 *yytop; 1034 1054 #endif 1035 1055 { 1036 1056 YYFPRINTF (stderr, "Stack now"); 1037 - for (; bottom <= top; ++bottom) 1038 - YYFPRINTF (stderr, " %d", *bottom); 1057 + for (; yybottom <= yytop; yybottom++) 1058 + { 1059 + int yybot = *yybottom; 1060 + YYFPRINTF (stderr, " %d", yybot); 1061 + } 1039 1062 YYFPRINTF (stderr, "\n"); 1040 1063 } 1041 1064 ··· 1072 1089 /* The symbols being reduced. */ 1073 1090 for (yyi = 0; yyi < yynrhs; yyi++) 1074 1091 { 1075 - fprintf (stderr, " $%d = ", yyi + 1); 1092 + YYFPRINTF (stderr, " $%d = ", yyi + 1); 1076 1093 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 1077 1094 &(yyvsp[(yyi + 1) - (yynrhs)]) 1078 1095 ); 1079 - fprintf (stderr, "\n"); 1096 + YYFPRINTF (stderr, "\n"); 1080 1097 } 1081 1098 } 1082 1099 ··· 1356 1373 break; 1357 1374 } 1358 1375 } 1359 - 1360 1376 1361 1377 /* Prevent warnings from -Wmissing-prototypes. */ 1362 - 1363 1378 #ifdef YYPARSE_PARAM 1364 1379 #if defined __STDC__ || defined __cplusplus 1365 1380 int yyparse (void *YYPARSE_PARAM); ··· 1373 1392 #endif /* ! YYPARSE_PARAM */ 1374 1393 1375 1394 1376 - 1377 - /* The look-ahead symbol. */ 1395 + /* The lookahead symbol. */ 1378 1396 int yychar; 1379 1397 1380 - /* The semantic value of the look-ahead symbol. */ 1398 + /* The semantic value of the lookahead symbol. */ 1381 1399 YYSTYPE yylval; 1382 1400 1383 1401 /* Number of syntax errors so far. */ ··· 1384 1404 1385 1405 1386 1406 1387 - /*----------. 1388 - | yyparse. | 1389 - `----------*/ 1407 + /*-------------------------. 1408 + | yyparse or yypush_parse. | 1409 + `-------------------------*/ 1390 1410 1391 1411 #ifdef YYPARSE_PARAM 1392 1412 #if (defined __STDC__ || defined __C99__FUNC__ \ ··· 1410 1430 #endif 1411 1431 #endif 1412 1432 { 1413 - 1414 - int yystate; 1433 + 1434 + 1435 + int yystate; 1436 + /* Number of tokens to shift before error messages enabled. */ 1437 + int yyerrstatus; 1438 + 1439 + /* The stacks and their tools: 1440 + `yyss': related to states. 1441 + `yyvs': related to semantic values. 1442 + 1443 + Refer to the stacks thru separate pointers, to allow yyoverflow 1444 + to reallocate them elsewhere. */ 1445 + 1446 + /* The state stack. */ 1447 + yytype_int16 yyssa[YYINITDEPTH]; 1448 + yytype_int16 *yyss; 1449 + yytype_int16 *yyssp; 1450 + 1451 + /* The semantic value stack. */ 1452 + YYSTYPE yyvsa[YYINITDEPTH]; 1453 + YYSTYPE *yyvs; 1454 + YYSTYPE *yyvsp; 1455 + 1456 + YYSIZE_T yystacksize; 1457 + 1415 1458 int yyn; 1416 1459 int yyresult; 1417 - /* Number of tokens to shift before error messages enabled. */ 1418 - int yyerrstatus; 1419 - /* Look-ahead token as an internal (translated) token number. */ 1420 - int yytoken = 0; 1460 + /* Lookahead token as an internal (translated) token number. */ 1461 + int yytoken; 1462 + /* The variables used to return semantic value and location from the 1463 + action routines. */ 1464 + YYSTYPE yyval; 1465 + 1421 1466 #if YYERROR_VERBOSE 1422 1467 /* Buffer for error messages, and its allocated size. */ 1423 1468 char yymsgbuf[128]; ··· 1450 1445 YYSIZE_T yymsg_alloc = sizeof yymsgbuf; 1451 1446 #endif 1452 1447 1453 - /* Three stacks and their tools: 1454 - `yyss': related to states, 1455 - `yyvs': related to semantic values, 1456 - `yyls': related to locations. 1457 - 1458 - Refer to the stacks thru separate pointers, to allow yyoverflow 1459 - to reallocate them elsewhere. */ 1460 - 1461 - /* The state stack. */ 1462 - yytype_int16 yyssa[YYINITDEPTH]; 1463 - yytype_int16 *yyss = yyssa; 1464 - yytype_int16 *yyssp; 1465 - 1466 - /* The semantic value stack. */ 1467 - YYSTYPE yyvsa[YYINITDEPTH]; 1468 - YYSTYPE *yyvs = yyvsa; 1469 - YYSTYPE *yyvsp; 1470 - 1471 - 1472 - 1473 1448 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 1474 - 1475 - YYSIZE_T yystacksize = YYINITDEPTH; 1476 - 1477 - /* The variables used to return semantic value and location from the 1478 - action routines. */ 1479 - YYSTYPE yyval; 1480 - 1481 1449 1482 1450 /* The number of symbols on the RHS of the reduced rule. 1483 1451 Keep to zero when no symbol should be popped. */ 1484 1452 int yylen = 0; 1453 + 1454 + yytoken = 0; 1455 + yyss = yyssa; 1456 + yyvs = yyvsa; 1457 + yystacksize = YYINITDEPTH; 1485 1458 1486 1459 YYDPRINTF ((stderr, "Starting parse\n")); 1487 1460 1488 1461 yystate = 0; 1489 1462 yyerrstatus = 0; 1490 1463 yynerrs = 0; 1491 - yychar = YYEMPTY; /* Cause a token to be read. */ 1464 + yychar = YYEMPTY; /* Cause a token to be read. */ 1492 1465 1493 1466 /* Initialize stack pointers. 1494 1467 Waste one element of value and location stack 1495 1468 so that they stay on the same level as the state stack. 1496 1469 The wasted elements are never initialized. */ 1497 - 1498 1470 yyssp = yyss; 1499 1471 yyvsp = yyvs; 1500 1472 ··· 1501 1519 YYSTYPE *yyvs1 = yyvs; 1502 1520 yytype_int16 *yyss1 = yyss; 1503 1521 1504 - 1505 1522 /* Each stack pointer address is followed by the size of the 1506 1523 data in use in that stack, in bytes. This used to be a 1507 1524 conditional around just the two extra args, but that might ··· 1508 1527 yyoverflow (YY_("memory exhausted"), 1509 1528 &yyss1, yysize * sizeof (*yyssp), 1510 1529 &yyvs1, yysize * sizeof (*yyvsp), 1511 - 1512 1530 &yystacksize); 1513 1531 1514 1532 yyss = yyss1; ··· 1530 1550 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1531 1551 if (! yyptr) 1532 1552 goto yyexhaustedlab; 1533 - YYSTACK_RELOCATE (yyss); 1534 - YYSTACK_RELOCATE (yyvs); 1535 - 1553 + YYSTACK_RELOCATE (yyss_alloc, yyss); 1554 + YYSTACK_RELOCATE (yyvs_alloc, yyvs); 1536 1555 # undef YYSTACK_RELOCATE 1537 1556 if (yyss1 != yyssa) 1538 1557 YYSTACK_FREE (yyss1); ··· 1542 1563 yyssp = yyss + yysize - 1; 1543 1564 yyvsp = yyvs + yysize - 1; 1544 1565 1545 - 1546 1566 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1547 1567 (unsigned long int) yystacksize)); 1548 1568 ··· 1551 1573 1552 1574 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 1553 1575 1576 + if (yystate == YYFINAL) 1577 + YYACCEPT; 1578 + 1554 1579 goto yybackup; 1555 1580 1556 1581 /*-----------. ··· 1562 1581 yybackup: 1563 1582 1564 1583 /* Do appropriate processing given the current state. Read a 1565 - look-ahead token if we need one and don't already have one. */ 1584 + lookahead token if we need one and don't already have one. */ 1566 1585 1567 - /* First try to decide what to do without reference to look-ahead token. */ 1586 + /* First try to decide what to do without reference to lookahead token. */ 1568 1587 yyn = yypact[yystate]; 1569 1588 if (yyn == YYPACT_NINF) 1570 1589 goto yydefault; 1571 1590 1572 - /* Not known => get a look-ahead token if don't already have one. */ 1591 + /* Not known => get a lookahead token if don't already have one. */ 1573 1592 1574 - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ 1593 + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ 1575 1594 if (yychar == YYEMPTY) 1576 1595 { 1577 1596 YYDPRINTF ((stderr, "Reading a token: ")); ··· 1603 1622 goto yyreduce; 1604 1623 } 1605 1624 1606 - if (yyn == YYFINAL) 1607 - YYACCEPT; 1608 - 1609 1625 /* Count tokens shifted since error; after three, turn off error 1610 1626 status. */ 1611 1627 if (yyerrstatus) 1612 1628 yyerrstatus--; 1613 1629 1614 - /* Shift the look-ahead token. */ 1630 + /* Shift the lookahead token. */ 1615 1631 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 1616 1632 1617 - /* Discard the shifted token unless it is eof. */ 1618 - if (yychar != YYEOF) 1619 - yychar = YYEMPTY; 1633 + /* Discard the shifted token. */ 1634 + yychar = YYEMPTY; 1620 1635 1621 1636 yystate = yyn; 1622 1637 *++yyvsp = yylval; ··· 1652 1675 switch (yyn) 1653 1676 { 1654 1677 case 4: 1655 - #line 108 "scripts/genksyms/parse.y" 1678 + 1679 + /* Line 1455 of yacc.c */ 1680 + #line 109 "scripts/genksyms/parse.y" 1656 1681 { is_typedef = 0; is_extern = 0; current_name = NULL; decl_spec = NULL; ;} 1657 1682 break; 1658 1683 1659 1684 case 5: 1660 - #line 110 "scripts/genksyms/parse.y" 1685 + 1686 + /* Line 1455 of yacc.c */ 1687 + #line 111 "scripts/genksyms/parse.y" 1661 1688 { free_list(*(yyvsp[(2) - (2)]), NULL); *(yyvsp[(2) - (2)]) = NULL; ;} 1662 1689 break; 1663 1690 1664 1691 case 6: 1665 - #line 114 "scripts/genksyms/parse.y" 1692 + 1693 + /* Line 1455 of yacc.c */ 1694 + #line 115 "scripts/genksyms/parse.y" 1666 1695 { is_typedef = 1; ;} 1667 1696 break; 1668 1697 1669 1698 case 7: 1670 - #line 115 "scripts/genksyms/parse.y" 1699 + 1700 + /* Line 1455 of yacc.c */ 1701 + #line 116 "scripts/genksyms/parse.y" 1671 1702 { (yyval) = (yyvsp[(4) - (4)]); ;} 1672 1703 break; 1673 1704 1674 1705 case 8: 1675 - #line 116 "scripts/genksyms/parse.y" 1706 + 1707 + /* Line 1455 of yacc.c */ 1708 + #line 117 "scripts/genksyms/parse.y" 1676 1709 { is_typedef = 1; ;} 1677 1710 break; 1678 1711 1679 1712 case 9: 1680 - #line 117 "scripts/genksyms/parse.y" 1713 + 1714 + /* Line 1455 of yacc.c */ 1715 + #line 118 "scripts/genksyms/parse.y" 1681 1716 { (yyval) = (yyvsp[(3) - (3)]); ;} 1682 1717 break; 1683 1718 1684 1719 case 14: 1685 - #line 122 "scripts/genksyms/parse.y" 1686 - { (yyval) = (yyvsp[(2) - (2)]); ;} 1687 - break; 1688 1720 1689 - case 15: 1721 + /* Line 1455 of yacc.c */ 1690 1722 #line 123 "scripts/genksyms/parse.y" 1691 1723 { (yyval) = (yyvsp[(2) - (2)]); ;} 1692 1724 break; 1693 1725 1726 + case 15: 1727 + 1728 + /* Line 1455 of yacc.c */ 1729 + #line 124 "scripts/genksyms/parse.y" 1730 + { (yyval) = (yyvsp[(2) - (2)]); ;} 1731 + break; 1732 + 1694 1733 case 16: 1695 - #line 128 "scripts/genksyms/parse.y" 1734 + 1735 + /* Line 1455 of yacc.c */ 1736 + #line 129 "scripts/genksyms/parse.y" 1696 1737 { if (current_name) { 1697 1738 struct string_list *decl = (*(yyvsp[(3) - (3)]))->next; 1698 1739 (*(yyvsp[(3) - (3)]))->next = NULL; ··· 1724 1729 break; 1725 1730 1726 1731 case 17: 1727 - #line 141 "scripts/genksyms/parse.y" 1732 + 1733 + /* Line 1455 of yacc.c */ 1734 + #line 142 "scripts/genksyms/parse.y" 1728 1735 { (yyval) = NULL; ;} 1729 1736 break; 1730 1737 1731 1738 case 19: 1732 - #line 147 "scripts/genksyms/parse.y" 1739 + 1740 + /* Line 1455 of yacc.c */ 1741 + #line 148 "scripts/genksyms/parse.y" 1733 1742 { struct string_list *decl = *(yyvsp[(1) - (1)]); 1734 1743 *(yyvsp[(1) - (1)]) = NULL; 1735 1744 add_symbol(current_name, ··· 1744 1745 break; 1745 1746 1746 1747 case 20: 1747 - #line 155 "scripts/genksyms/parse.y" 1748 + 1749 + /* Line 1455 of yacc.c */ 1750 + #line 156 "scripts/genksyms/parse.y" 1748 1751 { struct string_list *decl = *(yyvsp[(3) - (3)]); 1749 1752 *(yyvsp[(3) - (3)]) = NULL; 1750 1753 free_list(*(yyvsp[(2) - (3)]), NULL); ··· 1759 1758 break; 1760 1759 1761 1760 case 21: 1762 - #line 168 "scripts/genksyms/parse.y" 1761 + 1762 + /* Line 1455 of yacc.c */ 1763 + #line 169 "scripts/genksyms/parse.y" 1763 1764 { (yyval) = (yyvsp[(4) - (4)]) ? (yyvsp[(4) - (4)]) : (yyvsp[(3) - (4)]) ? (yyvsp[(3) - (4)]) : (yyvsp[(2) - (4)]) ? (yyvsp[(2) - (4)]) : (yyvsp[(1) - (4)]); ;} 1764 1765 break; 1765 1766 1766 1767 case 22: 1767 - #line 173 "scripts/genksyms/parse.y" 1768 + 1769 + /* Line 1455 of yacc.c */ 1770 + #line 174 "scripts/genksyms/parse.y" 1768 1771 { decl_spec = NULL; ;} 1769 1772 break; 1770 1773 1771 1774 case 24: 1772 - #line 178 "scripts/genksyms/parse.y" 1775 + 1776 + /* Line 1455 of yacc.c */ 1777 + #line 179 "scripts/genksyms/parse.y" 1773 1778 { decl_spec = *(yyvsp[(1) - (1)]); ;} 1774 1779 break; 1775 1780 1776 1781 case 25: 1777 - #line 179 "scripts/genksyms/parse.y" 1782 + 1783 + /* Line 1455 of yacc.c */ 1784 + #line 180 "scripts/genksyms/parse.y" 1778 1785 { decl_spec = *(yyvsp[(2) - (2)]); ;} 1779 1786 break; 1780 1787 1781 1788 case 26: 1782 - #line 184 "scripts/genksyms/parse.y" 1789 + 1790 + /* Line 1455 of yacc.c */ 1791 + #line 185 "scripts/genksyms/parse.y" 1783 1792 { /* Version 2 checksumming ignores storage class, as that 1784 1793 is really irrelevant to the linkage. */ 1785 1794 remove_node((yyvsp[(1) - (1)])); ··· 1798 1787 break; 1799 1788 1800 1789 case 31: 1801 - #line 196 "scripts/genksyms/parse.y" 1790 + 1791 + /* Line 1455 of yacc.c */ 1792 + #line 197 "scripts/genksyms/parse.y" 1802 1793 { is_extern = 1; (yyval) = (yyvsp[(1) - (1)]); ;} 1803 1794 break; 1804 1795 1805 1796 case 32: 1806 - #line 197 "scripts/genksyms/parse.y" 1797 + 1798 + /* Line 1455 of yacc.c */ 1799 + #line 198 "scripts/genksyms/parse.y" 1807 1800 { is_extern = 0; (yyval) = (yyvsp[(1) - (1)]); ;} 1808 1801 break; 1809 1802 1810 1803 case 37: 1811 - #line 209 "scripts/genksyms/parse.y" 1804 + 1805 + /* Line 1455 of yacc.c */ 1806 + #line 210 "scripts/genksyms/parse.y" 1812 1807 { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_STRUCT; (yyval) = (yyvsp[(2) - (2)]); ;} 1813 1808 break; 1814 1809 1815 1810 case 38: 1816 - #line 211 "scripts/genksyms/parse.y" 1811 + 1812 + /* Line 1455 of yacc.c */ 1813 + #line 212 "scripts/genksyms/parse.y" 1817 1814 { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_UNION; (yyval) = (yyvsp[(2) - (2)]); ;} 1818 1815 break; 1819 1816 1820 1817 case 39: 1821 - #line 213 "scripts/genksyms/parse.y" 1818 + 1819 + /* Line 1455 of yacc.c */ 1820 + #line 214 "scripts/genksyms/parse.y" 1822 1821 { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_ENUM; (yyval) = (yyvsp[(2) - (2)]); ;} 1823 1822 break; 1824 1823 1825 1824 case 40: 1826 - #line 217 "scripts/genksyms/parse.y" 1825 + 1826 + /* Line 1455 of yacc.c */ 1827 + #line 218 "scripts/genksyms/parse.y" 1827 1828 { struct string_list *s = *(yyvsp[(3) - (3)]), *i = *(yyvsp[(2) - (3)]), *r; 1828 1829 r = copy_node(i); r->tag = SYM_STRUCT; 1829 1830 r->next = (*(yyvsp[(1) - (3)]))->next; *(yyvsp[(3) - (3)]) = r; (*(yyvsp[(1) - (3)]))->next = NULL; ··· 1845 1822 break; 1846 1823 1847 1824 case 41: 1848 - #line 224 "scripts/genksyms/parse.y" 1825 + 1826 + /* Line 1455 of yacc.c */ 1827 + #line 225 "scripts/genksyms/parse.y" 1849 1828 { struct string_list *s = *(yyvsp[(3) - (3)]), *i = *(yyvsp[(2) - (3)]), *r; 1850 1829 r = copy_node(i); r->tag = SYM_UNION; 1851 1830 r->next = (*(yyvsp[(1) - (3)]))->next; *(yyvsp[(3) - (3)]) = r; (*(yyvsp[(1) - (3)]))->next = NULL; ··· 1857 1832 break; 1858 1833 1859 1834 case 42: 1860 - #line 231 "scripts/genksyms/parse.y" 1835 + 1836 + /* Line 1455 of yacc.c */ 1837 + #line 232 "scripts/genksyms/parse.y" 1861 1838 { struct string_list *s = *(yyvsp[(3) - (3)]), *i = *(yyvsp[(2) - (3)]), *r; 1862 1839 r = copy_node(i); r->tag = SYM_ENUM; 1863 1840 r->next = (*(yyvsp[(1) - (3)]))->next; *(yyvsp[(3) - (3)]) = r; (*(yyvsp[(1) - (3)]))->next = NULL; ··· 1869 1842 break; 1870 1843 1871 1844 case 43: 1872 - #line 239 "scripts/genksyms/parse.y" 1873 - { (yyval) = (yyvsp[(2) - (2)]); ;} 1845 + 1846 + /* Line 1455 of yacc.c */ 1847 + #line 242 "scripts/genksyms/parse.y" 1848 + { add_symbol(NULL, SYM_ENUM, NULL, 0); (yyval) = (yyvsp[(2) - (2)]); ;} 1874 1849 break; 1875 1850 1876 1851 case 44: 1877 - #line 240 "scripts/genksyms/parse.y" 1852 + 1853 + /* Line 1455 of yacc.c */ 1854 + #line 244 "scripts/genksyms/parse.y" 1878 1855 { (yyval) = (yyvsp[(2) - (2)]); ;} 1879 1856 break; 1880 1857 1881 1858 case 45: 1882 - #line 241 "scripts/genksyms/parse.y" 1859 + 1860 + /* Line 1455 of yacc.c */ 1861 + #line 245 "scripts/genksyms/parse.y" 1883 1862 { (yyval) = (yyvsp[(2) - (2)]); ;} 1884 1863 break; 1885 1864 1886 1865 case 56: 1887 - #line 255 "scripts/genksyms/parse.y" 1866 + 1867 + /* Line 1455 of yacc.c */ 1868 + #line 259 "scripts/genksyms/parse.y" 1888 1869 { (*(yyvsp[(1) - (1)]))->tag = SYM_TYPEDEF; (yyval) = (yyvsp[(1) - (1)]); ;} 1889 1870 break; 1890 1871 1891 1872 case 57: 1892 - #line 260 "scripts/genksyms/parse.y" 1873 + 1874 + /* Line 1455 of yacc.c */ 1875 + #line 264 "scripts/genksyms/parse.y" 1893 1876 { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;} 1894 1877 break; 1895 1878 1896 1879 case 58: 1897 - #line 264 "scripts/genksyms/parse.y" 1880 + 1881 + /* Line 1455 of yacc.c */ 1882 + #line 268 "scripts/genksyms/parse.y" 1898 1883 { (yyval) = NULL; ;} 1899 1884 break; 1900 1885 1901 1886 case 61: 1902 - #line 270 "scripts/genksyms/parse.y" 1887 + 1888 + /* Line 1455 of yacc.c */ 1889 + #line 274 "scripts/genksyms/parse.y" 1903 1890 { (yyval) = (yyvsp[(2) - (2)]); ;} 1904 1891 break; 1905 1892 1906 1893 case 65: 1907 - #line 276 "scripts/genksyms/parse.y" 1894 + 1895 + /* Line 1455 of yacc.c */ 1896 + #line 280 "scripts/genksyms/parse.y" 1908 1897 { /* restrict has no effect in prototypes so ignore it */ 1909 1898 remove_node((yyvsp[(1) - (1)])); 1910 1899 (yyval) = (yyvsp[(1) - (1)]); ··· 1928 1885 break; 1929 1886 1930 1887 case 66: 1931 - #line 283 "scripts/genksyms/parse.y" 1888 + 1889 + /* Line 1455 of yacc.c */ 1890 + #line 287 "scripts/genksyms/parse.y" 1932 1891 { (yyval) = (yyvsp[(2) - (2)]); ;} 1933 1892 break; 1934 1893 1935 1894 case 68: 1936 - #line 289 "scripts/genksyms/parse.y" 1895 + 1896 + /* Line 1455 of yacc.c */ 1897 + #line 293 "scripts/genksyms/parse.y" 1937 1898 { if (current_name != NULL) { 1938 1899 error_with_pos("unexpected second declaration name"); 1939 1900 YYERROR; ··· 1949 1902 break; 1950 1903 1951 1904 case 69: 1952 - #line 298 "scripts/genksyms/parse.y" 1905 + 1906 + /* Line 1455 of yacc.c */ 1907 + #line 302 "scripts/genksyms/parse.y" 1953 1908 { (yyval) = (yyvsp[(4) - (4)]); ;} 1954 1909 break; 1955 1910 1956 1911 case 70: 1957 - #line 300 "scripts/genksyms/parse.y" 1912 + 1913 + /* Line 1455 of yacc.c */ 1914 + #line 304 "scripts/genksyms/parse.y" 1958 1915 { (yyval) = (yyvsp[(4) - (4)]); ;} 1959 1916 break; 1960 1917 1961 1918 case 71: 1962 - #line 302 "scripts/genksyms/parse.y" 1919 + 1920 + /* Line 1455 of yacc.c */ 1921 + #line 306 "scripts/genksyms/parse.y" 1963 1922 { (yyval) = (yyvsp[(2) - (2)]); ;} 1964 1923 break; 1965 1924 1966 1925 case 72: 1967 - #line 304 "scripts/genksyms/parse.y" 1926 + 1927 + /* Line 1455 of yacc.c */ 1928 + #line 308 "scripts/genksyms/parse.y" 1968 1929 { (yyval) = (yyvsp[(3) - (3)]); ;} 1969 1930 break; 1970 1931 1971 1932 case 73: 1972 - #line 306 "scripts/genksyms/parse.y" 1933 + 1934 + /* Line 1455 of yacc.c */ 1935 + #line 310 "scripts/genksyms/parse.y" 1973 1936 { (yyval) = (yyvsp[(3) - (3)]); ;} 1974 1937 break; 1975 1938 1976 1939 case 74: 1977 - #line 312 "scripts/genksyms/parse.y" 1940 + 1941 + /* Line 1455 of yacc.c */ 1942 + #line 316 "scripts/genksyms/parse.y" 1978 1943 { (yyval) = (yyvsp[(2) - (2)]); ;} 1979 1944 break; 1980 1945 1981 1946 case 78: 1982 - #line 320 "scripts/genksyms/parse.y" 1947 + 1948 + /* Line 1455 of yacc.c */ 1949 + #line 324 "scripts/genksyms/parse.y" 1983 1950 { (yyval) = (yyvsp[(4) - (4)]); ;} 1984 1951 break; 1985 1952 1986 1953 case 79: 1987 - #line 322 "scripts/genksyms/parse.y" 1954 + 1955 + /* Line 1455 of yacc.c */ 1956 + #line 326 "scripts/genksyms/parse.y" 1988 1957 { (yyval) = (yyvsp[(4) - (4)]); ;} 1989 1958 break; 1990 1959 1991 1960 case 80: 1992 - #line 324 "scripts/genksyms/parse.y" 1961 + 1962 + /* Line 1455 of yacc.c */ 1963 + #line 328 "scripts/genksyms/parse.y" 1993 1964 { (yyval) = (yyvsp[(2) - (2)]); ;} 1994 1965 break; 1995 1966 1996 1967 case 81: 1997 - #line 326 "scripts/genksyms/parse.y" 1968 + 1969 + /* Line 1455 of yacc.c */ 1970 + #line 330 "scripts/genksyms/parse.y" 1998 1971 { (yyval) = (yyvsp[(3) - (3)]); ;} 1999 1972 break; 2000 1973 2001 1974 case 82: 2002 - #line 328 "scripts/genksyms/parse.y" 1975 + 1976 + /* Line 1455 of yacc.c */ 1977 + #line 332 "scripts/genksyms/parse.y" 2003 1978 { (yyval) = (yyvsp[(3) - (3)]); ;} 2004 1979 break; 2005 1980 2006 1981 case 83: 2007 - #line 332 "scripts/genksyms/parse.y" 1982 + 1983 + /* Line 1455 of yacc.c */ 1984 + #line 336 "scripts/genksyms/parse.y" 2008 1985 { (yyval) = (yyvsp[(2) - (2)]); ;} 2009 1986 break; 2010 1987 2011 1988 case 85: 2012 - #line 334 "scripts/genksyms/parse.y" 1989 + 1990 + /* Line 1455 of yacc.c */ 1991 + #line 338 "scripts/genksyms/parse.y" 2013 1992 { (yyval) = (yyvsp[(3) - (3)]); ;} 2014 1993 break; 2015 1994 2016 1995 case 86: 2017 - #line 338 "scripts/genksyms/parse.y" 1996 + 1997 + /* Line 1455 of yacc.c */ 1998 + #line 342 "scripts/genksyms/parse.y" 2018 1999 { (yyval) = NULL; ;} 2019 2000 break; 2020 2001 2021 2002 case 89: 2022 - #line 345 "scripts/genksyms/parse.y" 2003 + 2004 + /* Line 1455 of yacc.c */ 2005 + #line 349 "scripts/genksyms/parse.y" 2023 2006 { (yyval) = (yyvsp[(3) - (3)]); ;} 2024 2007 break; 2025 2008 2026 2009 case 90: 2027 - #line 350 "scripts/genksyms/parse.y" 2010 + 2011 + /* Line 1455 of yacc.c */ 2012 + #line 354 "scripts/genksyms/parse.y" 2028 2013 { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;} 2029 2014 break; 2030 2015 2031 2016 case 91: 2032 - #line 355 "scripts/genksyms/parse.y" 2017 + 2018 + /* Line 1455 of yacc.c */ 2019 + #line 359 "scripts/genksyms/parse.y" 2033 2020 { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;} 2034 2021 break; 2035 2022 2036 2023 case 93: 2037 - #line 360 "scripts/genksyms/parse.y" 2024 + 2025 + /* Line 1455 of yacc.c */ 2026 + #line 364 "scripts/genksyms/parse.y" 2038 2027 { (yyval) = NULL; ;} 2039 2028 break; 2040 2029 2041 2030 case 94: 2042 - #line 362 "scripts/genksyms/parse.y" 2031 + 2032 + /* Line 1455 of yacc.c */ 2033 + #line 366 "scripts/genksyms/parse.y" 2043 2034 { /* For version 2 checksums, we don't want to remember 2044 2035 private parameter names. */ 2045 2036 remove_node((yyvsp[(1) - (1)])); ··· 2086 2001 break; 2087 2002 2088 2003 case 95: 2089 - #line 370 "scripts/genksyms/parse.y" 2004 + 2005 + /* Line 1455 of yacc.c */ 2006 + #line 374 "scripts/genksyms/parse.y" 2090 2007 { remove_node((yyvsp[(1) - (1)])); 2091 2008 (yyval) = (yyvsp[(1) - (1)]); 2092 2009 ;} 2093 2010 break; 2094 2011 2095 2012 case 96: 2096 - #line 374 "scripts/genksyms/parse.y" 2013 + 2014 + /* Line 1455 of yacc.c */ 2015 + #line 378 "scripts/genksyms/parse.y" 2097 2016 { (yyval) = (yyvsp[(4) - (4)]); ;} 2098 2017 break; 2099 2018 2100 2019 case 97: 2101 - #line 376 "scripts/genksyms/parse.y" 2020 + 2021 + /* Line 1455 of yacc.c */ 2022 + #line 380 "scripts/genksyms/parse.y" 2102 2023 { (yyval) = (yyvsp[(4) - (4)]); ;} 2103 2024 break; 2104 2025 2105 2026 case 98: 2106 - #line 378 "scripts/genksyms/parse.y" 2027 + 2028 + /* Line 1455 of yacc.c */ 2029 + #line 382 "scripts/genksyms/parse.y" 2107 2030 { (yyval) = (yyvsp[(2) - (2)]); ;} 2108 2031 break; 2109 2032 2110 2033 case 99: 2111 - #line 380 "scripts/genksyms/parse.y" 2034 + 2035 + /* Line 1455 of yacc.c */ 2036 + #line 384 "scripts/genksyms/parse.y" 2112 2037 { (yyval) = (yyvsp[(3) - (3)]); ;} 2113 2038 break; 2114 2039 2115 2040 case 100: 2116 - #line 382 "scripts/genksyms/parse.y" 2041 + 2042 + /* Line 1455 of yacc.c */ 2043 + #line 386 "scripts/genksyms/parse.y" 2117 2044 { (yyval) = (yyvsp[(3) - (3)]); ;} 2118 2045 break; 2119 2046 2120 2047 case 101: 2121 - #line 387 "scripts/genksyms/parse.y" 2048 + 2049 + /* Line 1455 of yacc.c */ 2050 + #line 391 "scripts/genksyms/parse.y" 2122 2051 { struct string_list *decl = *(yyvsp[(2) - (3)]); 2123 2052 *(yyvsp[(2) - (3)]) = NULL; 2124 2053 add_symbol(current_name, SYM_NORMAL, decl, is_extern); ··· 2141 2042 break; 2142 2043 2143 2044 case 102: 2144 - #line 395 "scripts/genksyms/parse.y" 2045 + 2046 + /* Line 1455 of yacc.c */ 2047 + #line 399 "scripts/genksyms/parse.y" 2145 2048 { (yyval) = NULL; ;} 2146 2049 break; 2147 2050 2148 2051 case 104: 2149 - #line 402 "scripts/genksyms/parse.y" 2052 + 2053 + /* Line 1455 of yacc.c */ 2054 + #line 406 "scripts/genksyms/parse.y" 2150 2055 { remove_list((yyvsp[(2) - (2)]), &(*(yyvsp[(1) - (2)]))->next); (yyval) = (yyvsp[(2) - (2)]); ;} 2151 2056 break; 2152 2057 2153 2058 case 105: 2154 - #line 406 "scripts/genksyms/parse.y" 2059 + 2060 + /* Line 1455 of yacc.c */ 2061 + #line 410 "scripts/genksyms/parse.y" 2155 2062 { (yyval) = (yyvsp[(3) - (3)]); ;} 2156 2063 break; 2157 2064 2158 2065 case 106: 2159 - #line 407 "scripts/genksyms/parse.y" 2066 + 2067 + /* Line 1455 of yacc.c */ 2068 + #line 411 "scripts/genksyms/parse.y" 2160 2069 { (yyval) = (yyvsp[(3) - (3)]); ;} 2161 2070 break; 2162 2071 2163 2072 case 107: 2164 - #line 411 "scripts/genksyms/parse.y" 2073 + 2074 + /* Line 1455 of yacc.c */ 2075 + #line 415 "scripts/genksyms/parse.y" 2165 2076 { (yyval) = NULL; ;} 2166 2077 break; 2167 2078 2168 2079 case 110: 2169 - #line 417 "scripts/genksyms/parse.y" 2080 + 2081 + /* Line 1455 of yacc.c */ 2082 + #line 421 "scripts/genksyms/parse.y" 2170 2083 { (yyval) = (yyvsp[(2) - (2)]); ;} 2171 2084 break; 2172 2085 2173 2086 case 111: 2174 - #line 422 "scripts/genksyms/parse.y" 2087 + 2088 + /* Line 1455 of yacc.c */ 2089 + #line 426 "scripts/genksyms/parse.y" 2175 2090 { (yyval) = (yyvsp[(3) - (3)]); ;} 2176 2091 break; 2177 2092 2178 2093 case 112: 2179 - #line 424 "scripts/genksyms/parse.y" 2094 + 2095 + /* Line 1455 of yacc.c */ 2096 + #line 428 "scripts/genksyms/parse.y" 2180 2097 { (yyval) = (yyvsp[(2) - (2)]); ;} 2181 2098 break; 2182 2099 2183 2100 case 113: 2184 - #line 428 "scripts/genksyms/parse.y" 2101 + 2102 + /* Line 1455 of yacc.c */ 2103 + #line 432 "scripts/genksyms/parse.y" 2185 2104 { (yyval) = NULL; ;} 2186 2105 break; 2187 2106 2188 2107 case 116: 2189 - #line 434 "scripts/genksyms/parse.y" 2108 + 2109 + /* Line 1455 of yacc.c */ 2110 + #line 438 "scripts/genksyms/parse.y" 2190 2111 { (yyval) = (yyvsp[(3) - (3)]); ;} 2191 2112 break; 2192 2113 2193 2114 case 117: 2194 - #line 438 "scripts/genksyms/parse.y" 2115 + 2116 + /* Line 1455 of yacc.c */ 2117 + #line 442 "scripts/genksyms/parse.y" 2195 2118 { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;} 2196 2119 break; 2197 2120 2198 2121 case 118: 2199 - #line 439 "scripts/genksyms/parse.y" 2122 + 2123 + /* Line 1455 of yacc.c */ 2124 + #line 443 "scripts/genksyms/parse.y" 2200 2125 { (yyval) = (yyvsp[(2) - (2)]); ;} 2201 2126 break; 2202 2127 2203 2128 case 120: 2204 - #line 444 "scripts/genksyms/parse.y" 2129 + 2130 + /* Line 1455 of yacc.c */ 2131 + #line 448 "scripts/genksyms/parse.y" 2205 2132 { (yyval) = (yyvsp[(2) - (2)]); ;} 2206 2133 break; 2207 2134 2208 2135 case 121: 2209 - #line 448 "scripts/genksyms/parse.y" 2136 + 2137 + /* Line 1455 of yacc.c */ 2138 + #line 452 "scripts/genksyms/parse.y" 2210 2139 { (yyval) = NULL; ;} 2211 2140 break; 2212 2141 2213 2142 case 123: 2214 - #line 453 "scripts/genksyms/parse.y" 2215 - { (yyval) = (yyvsp[(2) - (2)]); ;} 2143 + 2144 + /* Line 1455 of yacc.c */ 2145 + #line 457 "scripts/genksyms/parse.y" 2146 + { (yyval) = (yyvsp[(3) - (3)]); ;} 2216 2147 break; 2217 2148 2218 2149 case 124: 2219 - #line 457 "scripts/genksyms/parse.y" 2150 + 2151 + /* Line 1455 of yacc.c */ 2152 + #line 458 "scripts/genksyms/parse.y" 2153 + { (yyval) = (yyvsp[(4) - (4)]); ;} 2154 + break; 2155 + 2156 + case 127: 2157 + 2158 + /* Line 1455 of yacc.c */ 2159 + #line 467 "scripts/genksyms/parse.y" 2160 + { 2161 + const char *name = strdup((*(yyvsp[(1) - (1)]))->string); 2162 + add_symbol(name, SYM_ENUM_CONST, NULL, 0); 2163 + ;} 2164 + break; 2165 + 2166 + case 128: 2167 + 2168 + /* Line 1455 of yacc.c */ 2169 + #line 472 "scripts/genksyms/parse.y" 2170 + { 2171 + const char *name = strdup((*(yyvsp[(1) - (3)]))->string); 2172 + struct string_list *expr = copy_list_range(*(yyvsp[(3) - (3)]), *(yyvsp[(2) - (3)])); 2173 + add_symbol(name, SYM_ENUM_CONST, expr, 0); 2174 + ;} 2175 + break; 2176 + 2177 + case 129: 2178 + 2179 + /* Line 1455 of yacc.c */ 2180 + #line 479 "scripts/genksyms/parse.y" 2181 + { (yyval) = (yyvsp[(2) - (2)]); ;} 2182 + break; 2183 + 2184 + case 130: 2185 + 2186 + /* Line 1455 of yacc.c */ 2187 + #line 483 "scripts/genksyms/parse.y" 2220 2188 { (yyval) = NULL; ;} 2221 2189 break; 2222 2190 2223 - case 126: 2224 - #line 463 "scripts/genksyms/parse.y" 2191 + case 132: 2192 + 2193 + /* Line 1455 of yacc.c */ 2194 + #line 489 "scripts/genksyms/parse.y" 2225 2195 { export_symbol((*(yyvsp[(3) - (5)]))->string); (yyval) = (yyvsp[(5) - (5)]); ;} 2226 2196 break; 2227 2197 2228 2198 2229 - /* Line 1267 of yacc.c. */ 2230 - #line 2132 "scripts/genksyms/parse.c" 2199 + 2200 + /* Line 1455 of yacc.c */ 2201 + #line 2301 "scripts/genksyms/parse.c" 2231 2202 default: break; 2232 2203 } 2233 2204 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); ··· 2307 2138 YY_STACK_PRINT (yyss, yyssp); 2308 2139 2309 2140 *++yyvsp = yyval; 2310 - 2311 2141 2312 2142 /* Now `shift' the result of the reduction. Determine what state 2313 2143 that goes to, based on the state we popped back to and the rule ··· 2372 2204 2373 2205 if (yyerrstatus == 3) 2374 2206 { 2375 - /* If just tried and failed to reuse look-ahead token after an 2207 + /* If just tried and failed to reuse lookahead token after an 2376 2208 error, discard it. */ 2377 2209 2378 2210 if (yychar <= YYEOF) ··· 2389 2221 } 2390 2222 } 2391 2223 2392 - /* Else will try to reuse look-ahead token after shifting the error 2224 + /* Else will try to reuse lookahead token after shifting the error 2393 2225 token. */ 2394 2226 goto yyerrlab1; 2395 2227 ··· 2446 2278 YY_STACK_PRINT (yyss, yyssp); 2447 2279 } 2448 2280 2449 - if (yyn == YYFINAL) 2450 - YYACCEPT; 2451 - 2452 2281 *++yyvsp = yylval; 2453 2282 2454 2283 ··· 2470 2305 yyresult = 1; 2471 2306 goto yyreturn; 2472 2307 2473 - #ifndef yyoverflow 2308 + #if !defined(yyoverflow) || YYERROR_VERBOSE 2474 2309 /*-------------------------------------------------. 2475 2310 | yyexhaustedlab -- memory exhaustion comes here. | 2476 2311 `-------------------------------------------------*/ ··· 2481 2316 #endif 2482 2317 2483 2318 yyreturn: 2484 - if (yychar != YYEOF && yychar != YYEMPTY) 2319 + if (yychar != YYEMPTY) 2485 2320 yydestruct ("Cleanup: discarding lookahead", 2486 2321 yytoken, &yylval); 2487 2322 /* Do not reclaim the symbols of the rule which action triggered ··· 2507 2342 } 2508 2343 2509 2344 2510 - #line 467 "scripts/genksyms/parse.y" 2345 + 2346 + /* Line 1675 of yacc.c */ 2347 + #line 493 "scripts/genksyms/parse.y" 2511 2348 2512 2349 2513 2350 static void
+15 -57
scripts/genksyms/parse.h_shipped
··· 1 - /* A Bison parser, made by GNU Bison 2.3. */ 1 + 2 + /* A Bison parser, made by GNU Bison 2.4.1. */ 2 3 3 4 /* Skeleton interface for Bison's Yacc-like parsers in C 4 - 5 - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 5 + 6 + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 6 7 Free Software Foundation, Inc. 7 - 8 - This program is free software; you can redistribute it and/or modify 8 + 9 + This program is free software: you can redistribute it and/or modify 9 10 it under the terms of the GNU General Public License as published by 10 - the Free Software Foundation; either version 2, or (at your option) 11 - any later version. 12 - 11 + the Free Software Foundation, either version 3 of the License, or 12 + (at your option) any later version. 13 + 13 14 This program is distributed in the hope that it will be useful, 14 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 17 GNU General Public License for more details. 17 - 18 + 18 19 You should have received a copy of the GNU General Public License 19 - along with this program; if not, write to the Free Software 20 - Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 - Boston, MA 02110-1301, USA. */ 20 + along with this program. If not, see <http://www.gnu.org/licenses/>. */ 22 21 23 22 /* As a special exception, you may create a larger work that contains 24 23 part or all of the Bison parser skeleton and distribute that work ··· 28 29 special exception, which will cause the skeleton and the resulting 29 30 Bison output files to be licensed under the GNU General Public 30 31 License without this special exception. 31 - 32 + 32 33 This special exception was added by the Free Software Foundation in 33 34 version 2.2 of Bison. */ 35 + 34 36 35 37 /* Tokens. */ 36 38 #ifndef YYTOKENTYPE ··· 82 82 FILENAME = 298 83 83 }; 84 84 #endif 85 - /* Tokens. */ 86 - #define ASM_KEYW 258 87 - #define ATTRIBUTE_KEYW 259 88 - #define AUTO_KEYW 260 89 - #define BOOL_KEYW 261 90 - #define CHAR_KEYW 262 91 - #define CONST_KEYW 263 92 - #define DOUBLE_KEYW 264 93 - #define ENUM_KEYW 265 94 - #define EXTERN_KEYW 266 95 - #define EXTENSION_KEYW 267 96 - #define FLOAT_KEYW 268 97 - #define INLINE_KEYW 269 98 - #define INT_KEYW 270 99 - #define LONG_KEYW 271 100 - #define REGISTER_KEYW 272 101 - #define RESTRICT_KEYW 273 102 - #define SHORT_KEYW 274 103 - #define SIGNED_KEYW 275 104 - #define STATIC_KEYW 276 105 - #define STRUCT_KEYW 277 106 - #define TYPEDEF_KEYW 278 107 - #define UNION_KEYW 279 108 - #define UNSIGNED_KEYW 280 109 - #define VOID_KEYW 281 110 - #define VOLATILE_KEYW 282 111 - #define TYPEOF_KEYW 283 112 - #define EXPORT_SYMBOL_KEYW 284 113 - #define ASM_PHRASE 285 114 - #define ATTRIBUTE_PHRASE 286 115 - #define BRACE_PHRASE 287 116 - #define BRACKET_PHRASE 288 117 - #define EXPRESSION_PHRASE 289 118 - #define CHAR 290 119 - #define DOTS 291 120 - #define IDENT 292 121 - #define INT 293 122 - #define REAL 294 123 - #define STRING 295 124 - #define TYPE 296 125 - #define OTHER 297 126 - #define FILENAME 298 127 - 128 85 129 86 130 87 131 88 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 132 89 typedef int YYSTYPE; 90 + # define YYSTYPE_IS_TRIVIAL 1 133 91 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ 134 92 # define YYSTYPE_IS_DECLARED 1 135 - # define YYSTYPE_IS_TRIVIAL 1 136 93 #endif 137 94 138 95 extern YYSTYPE yylval; 96 + 139 97
+30 -4
scripts/genksyms/parse.y
··· 25 25 26 26 #include <assert.h> 27 27 #include <stdlib.h> 28 + #include <string.h> 28 29 #include "genksyms.h" 29 30 30 31 static int is_typedef; ··· 228 227 add_symbol(i->string, SYM_UNION, s, is_extern); 229 228 $$ = $3; 230 229 } 231 - | ENUM_KEYW IDENT BRACE_PHRASE 230 + | ENUM_KEYW IDENT enum_body 232 231 { struct string_list *s = *$3, *i = *$2, *r; 233 232 r = copy_node(i); r->tag = SYM_ENUM; 234 233 r->next = (*$1)->next; *$3 = r; (*$1)->next = NULL; 235 234 add_symbol(i->string, SYM_ENUM, s, is_extern); 236 235 $$ = $3; 237 236 } 238 - 239 - /* Anonymous s/u/e definitions. Nothing needs doing. */ 240 - | ENUM_KEYW BRACE_PHRASE { $$ = $2; } 237 + /* 238 + * Anonymous enum definition. Tell add_symbol() to restart its counter. 239 + */ 240 + | ENUM_KEYW enum_body 241 + { add_symbol(NULL, SYM_ENUM, NULL, 0); $$ = $2; } 242 + /* Anonymous s/u definitions. Nothing needs doing. */ 241 243 | STRUCT_KEYW class_body { $$ = $2; } 242 244 | UNION_KEYW class_body { $$ = $2; } 243 245 ; ··· 452 448 /* empty */ { $$ = NULL; } 453 449 | attribute_opt ATTRIBUTE_PHRASE 454 450 ; 451 + 452 + enum_body: 453 + '{' enumerator_list '}' { $$ = $3; } 454 + | '{' enumerator_list ',' '}' { $$ = $4; } 455 + ; 456 + 457 + enumerator_list: 458 + enumerator 459 + | enumerator_list ',' enumerator 460 + 461 + enumerator: 462 + IDENT 463 + { 464 + const char *name = strdup((*$1)->string); 465 + add_symbol(name, SYM_ENUM_CONST, NULL, 0); 466 + } 467 + | IDENT '=' EXPRESSION_PHRASE 468 + { 469 + const char *name = strdup((*$1)->string); 470 + struct string_list *expr = copy_list_range(*$3, *$2); 471 + add_symbol(name, SYM_ENUM_CONST, expr, 0); 472 + } 455 473 456 474 asm_definition: 457 475 ASM_PHRASE ';' { $$ = $2; }
+15 -8
scripts/mod/modpost.c
··· 1248 1248 return -1; 1249 1249 } 1250 1250 1251 + static void print_section_list(const char * const list[20]) 1252 + { 1253 + const char *const *s = list; 1254 + 1255 + while (*s) { 1256 + fprintf(stderr, "%s", *s); 1257 + s++; 1258 + if (*s) 1259 + fprintf(stderr, ", "); 1260 + } 1261 + fprintf(stderr, "\n"); 1262 + } 1263 + 1251 1264 /* 1252 1265 * Print a warning about a section mismatch. 1253 1266 * Try to find symbols near it so user can find it. ··· 1317 1304 break; 1318 1305 case DATA_TO_ANY_INIT: { 1319 1306 prl_to = sec2annotation(tosec); 1320 - const char *const *s = mismatch->symbol_white_list; 1321 1307 fprintf(stderr, 1322 1308 "The variable %s references\n" 1323 1309 "the %s %s%s%s\n" ··· 1324 1312 "variable with __init* or __refdata (see linux/init.h) " 1325 1313 "or name the variable:\n", 1326 1314 fromsym, to, prl_to, tosym, to_p); 1327 - while (*s) 1328 - fprintf(stderr, "%s, ", *s++); 1329 - fprintf(stderr, "\n"); 1315 + print_section_list(mismatch->symbol_white_list); 1330 1316 free(prl_to); 1331 1317 break; 1332 1318 } ··· 1339 1329 break; 1340 1330 case DATA_TO_ANY_EXIT: { 1341 1331 prl_to = sec2annotation(tosec); 1342 - const char *const *s = mismatch->symbol_white_list; 1343 1332 fprintf(stderr, 1344 1333 "The variable %s references\n" 1345 1334 "the %s %s%s%s\n" ··· 1346 1337 "variable with __exit* (see linux/init.h) or " 1347 1338 "name the variable:\n", 1348 1339 fromsym, to, prl_to, tosym, to_p); 1349 - while (*s) 1350 - fprintf(stderr, "%s, ", *s++); 1351 - fprintf(stderr, "\n"); 1340 + print_section_list(mismatch->symbol_white_list); 1352 1341 free(prl_to); 1353 1342 break; 1354 1343 }
+184 -63
scripts/unifdef.c
··· 1 1 /* 2 - * Copyright (c) 2002 - 2009 Tony Finch <dot@dotat.at> 2 + * Copyright (c) 2002 - 2011 Tony Finch <dot@dotat.at> 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without 5 5 * modification, are permitted provided that the following conditions ··· 24 24 */ 25 25 26 26 /* 27 + * unifdef - remove ifdef'ed lines 28 + * 27 29 * This code was derived from software contributed to Berkeley by Dave Yost. 28 30 * It was rewritten to support ANSI C by Tony Finch. The original version 29 31 * of unifdef carried the 4-clause BSD copyright licence. None of its code 30 32 * remains in this version (though some of the names remain) so it now 31 33 * carries a more liberal licence. 32 - * 33 - * The latest version is available from http://dotat.at/prog/unifdef 34 - */ 35 - 36 - static const char * const copyright[] = { 37 - "@(#) Copyright (c) 2002 - 2009 Tony Finch <dot@dotat.at>\n", 38 - "$dotat: unifdef/unifdef.c,v 1.190 2009/11/27 17:21:26 fanf2 Exp $", 39 - }; 40 - 41 - /* 42 - * unifdef - remove ifdef'ed lines 43 34 * 44 35 * Wishlist: 45 36 * provide an option which will append the name of the ··· 39 48 * #else's and #endif's to see that they match their 40 49 * corresponding #ifdef or #ifndef 41 50 * 42 - * The first two items above require better buffer handling, which would 43 - * also make it possible to handle all "dodgy" directives correctly. 51 + * These require better buffer handling, which would also make 52 + * it possible to handle all "dodgy" directives correctly. 44 53 */ 54 + 55 + #include <sys/types.h> 56 + #include <sys/stat.h> 45 57 46 58 #include <ctype.h> 47 59 #include <err.h> 60 + #include <errno.h> 48 61 #include <stdarg.h> 49 62 #include <stdbool.h> 50 63 #include <stdio.h> 51 64 #include <stdlib.h> 52 65 #include <string.h> 53 66 #include <unistd.h> 67 + 68 + const char copyright[] = 69 + "@(#) $Version: unifdef-2.5 $\n" 70 + "@(#) $Author: Tony Finch (dot@dotat.at) $\n" 71 + "@(#) $URL: http://dotat.at/prog/unifdef $\n" 72 + ; 54 73 55 74 /* types of input lines: */ 56 75 typedef enum { ··· 154 153 #define EDITSLOP 10 155 154 156 155 /* 156 + * For temporary filenames 157 + */ 158 + #define TEMPLATE "unifdef.XXXXXX" 159 + 160 + /* 157 161 * Globals. 158 162 */ 159 163 ··· 171 165 static bool killconsts; /* -k: eval constant #ifs */ 172 166 static bool lnnum; /* -n: add #line directives */ 173 167 static bool symlist; /* -s: output symbol list */ 168 + static bool symdepth; /* -S: output symbol depth */ 174 169 static bool text; /* -t: this is a text file */ 175 170 176 171 static const char *symname[MAXSYMS]; /* symbol name */ ··· 182 175 static FILE *input; /* input file pointer */ 183 176 static const char *filename; /* input file name */ 184 177 static int linenum; /* current line number */ 178 + static FILE *output; /* output file pointer */ 179 + static const char *ofilename; /* output file name */ 180 + static bool overwriting; /* output overwrites input */ 181 + static char tempname[FILENAME_MAX]; /* used when overwriting */ 185 182 186 183 static char tline[MAXLINE+EDITSLOP];/* input buffer plus space */ 187 184 static char *keyword; /* used for editing #elif's */ 185 + 186 + static const char *newline; /* input file format */ 187 + static const char newline_unix[] = "\n"; 188 + static const char newline_crlf[] = "\r\n"; 188 189 189 190 static Comment_state incomment; /* comment parser state */ 190 191 static Line_state linestate; /* #if line parser state */ ··· 204 189 static unsigned blankcount; /* count of blank lines */ 205 190 static unsigned blankmax; /* maximum recent blankcount */ 206 191 static bool constexpr; /* constant #if expression */ 192 + static bool zerosyms = true; /* to format symdepth output */ 193 + static bool firstsym; /* ditto */ 207 194 208 195 static int exitstat; /* program exit status */ 209 196 210 197 static void addsym(bool, bool, char *); 198 + static void closeout(void); 211 199 static void debug(const char *, ...); 212 200 static void done(void); 213 201 static void error(const char *); ··· 230 212 static int strlcmp(const char *, const char *, size_t); 231 213 static void unnest(void); 232 214 static void usage(void); 215 + static void version(void); 233 216 234 217 #define endsym(c) (!isalnum((unsigned char)c) && c != '_') 235 218 ··· 242 223 { 243 224 int opt; 244 225 245 - while ((opt = getopt(argc, argv, "i:D:U:I:BbcdeKklnst")) != -1) 226 + while ((opt = getopt(argc, argv, "i:D:U:I:o:bBcdeKklnsStV")) != -1) 246 227 switch (opt) { 247 228 case 'i': /* treat stuff controlled by these symbols as text */ 248 229 /* ··· 264 245 case 'U': /* undef a symbol */ 265 246 addsym(false, false, optarg); 266 247 break; 267 - case 'I': 268 - /* no-op for compatibility with cpp */ 269 - break; 270 - case 'B': /* compress blank lines around removed section */ 271 - compblank = true; 248 + case 'I': /* no-op for compatibility with cpp */ 272 249 break; 273 250 case 'b': /* blank deleted lines instead of omitting them */ 274 251 case 'l': /* backwards compatibility */ 275 252 lnblank = true; 253 + break; 254 + case 'B': /* compress blank lines around removed section */ 255 + compblank = true; 276 256 break; 277 257 case 'c': /* treat -D as -U and vice versa */ 278 258 complement = true; ··· 291 273 case 'n': /* add #line directive after deleted lines */ 292 274 lnnum = true; 293 275 break; 276 + case 'o': /* output to a file */ 277 + ofilename = optarg; 278 + break; 294 279 case 's': /* only output list of symbols that control #ifs */ 295 280 symlist = true; 281 + break; 282 + case 'S': /* list symbols with their nesting depth */ 283 + symlist = symdepth = true; 296 284 break; 297 285 case 't': /* don't parse C comments */ 298 286 text = true; 299 287 break; 288 + case 'V': /* print version */ 289 + version(); 300 290 default: 301 291 usage(); 302 292 } ··· 316 290 errx(2, "can only do one file"); 317 291 } else if (argc == 1 && strcmp(*argv, "-") != 0) { 318 292 filename = *argv; 319 - input = fopen(filename, "r"); 293 + input = fopen(filename, "rb"); 320 294 if (input == NULL) 321 295 err(2, "can't open %s", filename); 322 296 } else { 323 297 filename = "[stdin]"; 324 298 input = stdin; 325 299 } 300 + if (ofilename == NULL) { 301 + ofilename = "[stdout]"; 302 + output = stdout; 303 + } else { 304 + struct stat ist, ost; 305 + if (stat(ofilename, &ost) == 0 && 306 + fstat(fileno(input), &ist) == 0) 307 + overwriting = (ist.st_dev == ost.st_dev 308 + && ist.st_ino == ost.st_ino); 309 + if (overwriting) { 310 + const char *dirsep; 311 + int ofd; 312 + 313 + dirsep = strrchr(ofilename, '/'); 314 + if (dirsep != NULL) 315 + snprintf(tempname, sizeof(tempname), 316 + "%.*s/" TEMPLATE, 317 + (int)(dirsep - ofilename), ofilename); 318 + else 319 + snprintf(tempname, sizeof(tempname), 320 + TEMPLATE); 321 + ofd = mkstemp(tempname); 322 + if (ofd != -1) 323 + output = fdopen(ofd, "wb+"); 324 + if (output == NULL) 325 + err(2, "can't create temporary file"); 326 + fchmod(ofd, ist.st_mode & (S_IRWXU|S_IRWXG|S_IRWXO)); 327 + } else { 328 + output = fopen(ofilename, "wb"); 329 + if (output == NULL) 330 + err(2, "can't open %s", ofilename); 331 + } 332 + } 326 333 process(); 327 334 abort(); /* bug */ 328 335 } 329 336 330 337 static void 338 + version(void) 339 + { 340 + const char *c = copyright; 341 + for (;;) { 342 + while (*++c != '$') 343 + if (*c == '\0') 344 + exit(0); 345 + while (*++c != '$') 346 + putc(*c, stderr); 347 + putc('\n', stderr); 348 + } 349 + } 350 + 351 + static void 331 352 usage(void) 332 353 { 333 - fprintf(stderr, "usage: unifdef [-BbcdeKknst] [-Ipath]" 354 + fprintf(stderr, "usage: unifdef [-bBcdeKknsStV] [-Ipath]" 334 355 " [-Dsym[=val]] [-Usym] [-iDsym[=val]] [-iUsym] ... [file]\n"); 335 356 exit(2); 336 357 } ··· 395 322 * When we have processed a group that starts off with a known-false 396 323 * #if/#elif sequence (which has therefore been deleted) followed by a 397 324 * #elif that we don't understand and therefore must keep, we edit the 398 - * latter into a #if to keep the nesting correct. 325 + * latter into a #if to keep the nesting correct. We use strncpy() to 326 + * overwrite the 4 byte token "elif" with "if " without a '\0' byte. 399 327 * 400 328 * When we find a true #elif in a group, the following block will 401 329 * always be kept and the rest of the sequence after the next #elif or ··· 449 375 static void Idrop (void) { Fdrop(); ignoreon(); } 450 376 static void Itrue (void) { Ftrue(); ignoreon(); } 451 377 static void Ifalse(void) { Ffalse(); ignoreon(); } 452 - /* edit this line */ 378 + /* modify this line */ 453 379 static void Mpass (void) { strncpy(keyword, "if ", 4); Pelif(); } 454 - static void Mtrue (void) { keywordedit("else\n"); state(IS_TRUE_MIDDLE); } 455 - static void Melif (void) { keywordedit("endif\n"); state(IS_FALSE_TRAILER); } 456 - static void Melse (void) { keywordedit("endif\n"); state(IS_FALSE_ELSE); } 380 + static void Mtrue (void) { keywordedit("else"); state(IS_TRUE_MIDDLE); } 381 + static void Melif (void) { keywordedit("endif"); state(IS_FALSE_TRAILER); } 382 + static void Melse (void) { keywordedit("endif"); state(IS_FALSE_ELSE); } 457 383 458 384 static state_fn * const trans_table[IS_COUNT][LT_COUNT] = { 459 385 /* IS_OUTSIDE */ ··· 505 431 * State machine utility functions 506 432 */ 507 433 static void 508 - done(void) 509 - { 510 - if (incomment) 511 - error("EOF in comment"); 512 - exit(exitstat); 513 - } 514 - static void 515 434 ignoreoff(void) 516 435 { 517 436 if (depth == 0) ··· 519 452 static void 520 453 keywordedit(const char *replacement) 521 454 { 522 - size_t size = tline + sizeof(tline) - keyword; 523 - char *dst = keyword; 524 - const char *src = replacement; 525 - if (size != 0) { 526 - while ((--size != 0) && (*src != '\0')) 527 - *dst++ = *src++; 528 - *dst = '\0'; 529 - } 455 + snprintf(keyword, tline + sizeof(tline) - keyword, 456 + "%s%s", replacement, newline); 530 457 print(); 531 458 } 532 459 static void ··· 555 494 if (symlist) 556 495 return; 557 496 if (keep ^ complement) { 558 - bool blankline = tline[strspn(tline, " \t\n")] == '\0'; 497 + bool blankline = tline[strspn(tline, " \t\r\n")] == '\0'; 559 498 if (blankline && compblank && blankcount != blankmax) { 560 499 delcount += 1; 561 500 blankcount += 1; 562 501 } else { 563 502 if (lnnum && delcount > 0) 564 - printf("#line %d\n", linenum); 565 - fputs(tline, stdout); 503 + printf("#line %d%s", linenum, newline); 504 + fputs(tline, output); 566 505 delcount = 0; 567 506 blankmax = blankcount = blankline ? blankcount + 1 : 0; 568 507 } 569 508 } else { 570 509 if (lnblank) 571 - putc('\n', stdout); 510 + fputs(newline, output); 572 511 exitstat = 1; 573 512 delcount += 1; 574 513 blankcount = 0; 575 514 } 515 + if (debugging) 516 + fflush(output); 576 517 } 577 518 578 519 /* ··· 583 520 static void 584 521 process(void) 585 522 { 586 - Linetype lineval; 587 - 588 523 /* When compressing blank lines, act as if the file 589 524 is preceded by a large number of blank lines. */ 590 525 blankmax = blankcount = 1000; 591 526 for (;;) { 592 - linenum++; 593 - lineval = parseline(); 527 + Linetype lineval = parseline(); 594 528 trans_table[ifstate[depth]][lineval](); 595 - debug("process %s -> %s depth %d", 596 - linetype_name[lineval], 529 + debug("process line %d %s -> %s depth %d", 530 + linenum, linetype_name[lineval], 597 531 ifstate_name[ifstate[depth]], depth); 598 532 } 533 + } 534 + 535 + /* 536 + * Flush the output and handle errors. 537 + */ 538 + static void 539 + closeout(void) 540 + { 541 + if (symdepth && !zerosyms) 542 + printf("\n"); 543 + if (fclose(output) == EOF) { 544 + warn("couldn't write to %s", ofilename); 545 + if (overwriting) { 546 + unlink(tempname); 547 + errx(2, "%s unchanged", filename); 548 + } else { 549 + exit(2); 550 + } 551 + } 552 + } 553 + 554 + /* 555 + * Clean up and exit. 556 + */ 557 + static void 558 + done(void) 559 + { 560 + if (incomment) 561 + error("EOF in comment"); 562 + closeout(); 563 + if (overwriting && rename(tempname, ofilename) == -1) { 564 + warn("couldn't rename temporary file"); 565 + unlink(tempname); 566 + errx(2, "%s unchanged", ofilename); 567 + } 568 + exit(exitstat); 599 569 } 600 570 601 571 /* ··· 645 549 Linetype retval; 646 550 Comment_state wascomment; 647 551 552 + linenum++; 648 553 if (fgets(tline, MAXLINE, input) == NULL) 649 554 return (LT_EOF); 555 + if (newline == NULL) { 556 + if (strrchr(tline, '\n') == strrchr(tline, '\r') + 1) 557 + newline = newline_crlf; 558 + else 559 + newline = newline_unix; 560 + } 650 561 retval = LT_PLAIN; 651 562 wascomment = incomment; 652 563 cp = skipcomment(tline); 653 564 if (linestate == LS_START) { 654 565 if (*cp == '#') { 655 566 linestate = LS_HASH; 567 + firstsym = true; 656 568 cp = skipcomment(cp + 1); 657 569 } else if (*cp != '\0') 658 570 linestate = LS_DIRTY; ··· 670 566 cp = skipsym(cp); 671 567 kwlen = cp - keyword; 672 568 /* no way can we deal with a continuation inside a keyword */ 673 - if (strncmp(cp, "\\\n", 2) == 0) 569 + if (strncmp(cp, "\\\r\n", 3) == 0 || 570 + strncmp(cp, "\\\n", 2) == 0) 674 571 Eioccc(); 675 572 if (strlcmp("ifdef", keyword, kwlen) == 0 || 676 573 strlcmp("ifndef", keyword, kwlen) == 0) { ··· 722 617 size_t len = cp - tline; 723 618 if (fgets(tline + len, MAXLINE - len, input) == NULL) { 724 619 /* append the missing newline */ 725 - tline[len+0] = '\n'; 726 - tline[len+1] = '\0'; 727 - cp++; 620 + strcpy(tline + len, newline); 621 + cp += strlen(newline); 728 622 linestate = LS_START; 729 623 } else { 730 624 linestate = LS_DIRTY; ··· 734 630 while (*cp != '\0') 735 631 cp = skipcomment(cp + 1); 736 632 } 737 - debug("parser %s comment %s line", 633 + debug("parser line %d state %s comment %s line", linenum, 738 634 comment_name[incomment], linestate_name[linestate]); 739 635 return (retval); 740 636 } ··· 979 875 } 980 876 while (*cp != '\0') 981 877 /* don't reset to LS_START after a line continuation */ 982 - if (strncmp(cp, "\\\n", 2) == 0) 878 + if (strncmp(cp, "\\\r\n", 3) == 0) 879 + cp += 3; 880 + else if (strncmp(cp, "\\\n", 2) == 0) 983 881 cp += 2; 984 882 else switch (incomment) { 985 883 case NO_COMMENT: 986 - if (strncmp(cp, "/\\\n", 3) == 0) { 884 + if (strncmp(cp, "/\\\r\n", 4) == 0) { 885 + incomment = STARTING_COMMENT; 886 + cp += 4; 887 + } else if (strncmp(cp, "/\\\n", 3) == 0) { 987 888 incomment = STARTING_COMMENT; 988 889 cp += 3; 989 890 } else if (strncmp(cp, "/*", 2) == 0) { ··· 1008 899 } else if (strncmp(cp, "\n", 1) == 0) { 1009 900 linestate = LS_START; 1010 901 cp += 1; 1011 - } else if (strchr(" \t", *cp) != NULL) { 902 + } else if (strchr(" \r\t", *cp) != NULL) { 1012 903 cp += 1; 1013 904 } else 1014 905 return (cp); ··· 1040 931 cp += 1; 1041 932 continue; 1042 933 case C_COMMENT: 1043 - if (strncmp(cp, "*\\\n", 3) == 0) { 934 + if (strncmp(cp, "*\\\r\n", 4) == 0) { 935 + incomment = FINISHING_COMMENT; 936 + cp += 4; 937 + } else if (strncmp(cp, "*\\\n", 3) == 0) { 1044 938 incomment = FINISHING_COMMENT; 1045 939 cp += 3; 1046 940 } else if (strncmp(cp, "*/", 2) == 0) { ··· 1127 1015 if (cp == str) 1128 1016 return (-1); 1129 1017 if (symlist) { 1130 - printf("%.*s\n", (int)(cp-str), str); 1018 + if (symdepth && firstsym) 1019 + printf("%s%3d", zerosyms ? "" : "\n", depth); 1020 + firstsym = zerosyms = false; 1021 + printf("%s%.*s%s", 1022 + symdepth ? " " : "", 1023 + (int)(cp-str), str, 1024 + symdepth ? "" : "\n"); 1131 1025 /* we don't care about the value of the symbol */ 1132 1026 return (0); 1133 1027 } ··· 1170 1052 value[symind] = val+1; 1171 1053 *val = '\0'; 1172 1054 } else if (*val == '\0') 1173 - value[symind] = ""; 1055 + value[symind] = "1"; 1174 1056 else 1175 1057 usage(); 1176 1058 } else { ··· 1178 1060 usage(); 1179 1061 value[symind] = NULL; 1180 1062 } 1063 + debug("addsym %s=%s", symname[symind], 1064 + value[symind] ? value[symind] : "undef"); 1181 1065 } 1182 1066 1183 1067 /* ··· 1220 1100 else 1221 1101 warnx("%s: %d: %s (#if line %d depth %d)", 1222 1102 filename, linenum, msg, stifline[depth], depth); 1103 + closeout(); 1223 1104 errx(2, "output may be truncated"); 1224 1105 }