diff options
Diffstat (limited to 'scripts/genksyms')
-rw-r--r-- | scripts/genksyms/.gitignore | 7 | ||||
-rw-r--r-- | scripts/genksyms/Makefile | 49 | ||||
-rw-r--r-- | scripts/genksyms/genksyms.c | 5 | ||||
-rw-r--r-- | scripts/genksyms/genksyms.h | 4 | ||||
-rw-r--r-- | scripts/genksyms/keywords.gperf | 3 | ||||
-rw-r--r-- | scripts/genksyms/keywords.hash.c_shipped (renamed from scripts/genksyms/keywords.c_shipped) | 96 | ||||
-rw-r--r-- | scripts/genksyms/lex.l | 12 | ||||
-rw-r--r-- | scripts/genksyms/lex.lex.c_shipped (renamed from scripts/genksyms/lex.c_shipped) | 363 | ||||
-rw-r--r-- | scripts/genksyms/parse.tab.c_shipped (renamed from scripts/genksyms/parse.c_shipped) | 833 | ||||
-rw-r--r-- | scripts/genksyms/parse.tab.h_shipped (renamed from scripts/genksyms/parse.h_shipped) | 8 | ||||
-rw-r--r-- | scripts/genksyms/parse.y | 40 |
11 files changed, 470 insertions, 950 deletions
diff --git a/scripts/genksyms/.gitignore b/scripts/genksyms/.gitignore index be5cadb1b90..86dc07a01b4 100644 --- a/scripts/genksyms/.gitignore +++ b/scripts/genksyms/.gitignore | |||
@@ -1,4 +1,5 @@ | |||
1 | keywords.c | 1 | *.hash.c |
2 | lex.c | 2 | *.lex.c |
3 | parse.[ch] | 3 | *.tab.c |
4 | *.tab.h | ||
4 | genksyms | 5 | genksyms |
diff --git a/scripts/genksyms/Makefile b/scripts/genksyms/Makefile index 13d03cf05d9..aca33b98bf6 100644 --- a/scripts/genksyms/Makefile +++ b/scripts/genksyms/Makefile | |||
@@ -2,52 +2,13 @@ | |||
2 | hostprogs-y := genksyms | 2 | hostprogs-y := genksyms |
3 | always := $(hostprogs-y) | 3 | always := $(hostprogs-y) |
4 | 4 | ||
5 | genksyms-objs := genksyms.o parse.o lex.o | 5 | genksyms-objs := genksyms.o parse.tab.o lex.lex.o |
6 | 6 | ||
7 | # -I needed for generated C source (shipped source) | 7 | # -I needed for generated C source (shipped source) |
8 | HOSTCFLAGS_parse.o := -Wno-uninitialized -I$(src) | 8 | HOSTCFLAGS_parse.tab.o := -I$(src) |
9 | HOSTCFLAGS_lex.lex.o := -I$(src) | ||
9 | 10 | ||
10 | # dependencies on generated files need to be listed explicitly | 11 | # dependencies on generated files need to be listed explicitly |
11 | $(obj)/lex.o: $(obj)/parse.h $(obj)/keywords.c | 12 | $(obj)/lex.lex.o: $(obj)/keywords.hash.c $(obj)/parse.tab.h |
12 | 13 | ||
13 | # -I needed for generated C source (shipped source) | 14 | clean-files := keywords.hash.c lex.lex.c parse.tab.c parse.tab.h |
14 | HOSTCFLAGS_lex.o := -I$(src) | ||
15 | |||
16 | ifdef GENERATE_PARSER | ||
17 | |||
18 | # gperf | ||
19 | |||
20 | quiet_cmd_keywords.c = GPERF $@ | ||
21 | cmd_keywords.c = gperf -L ANSI-C -a -C -E -g -H is_reserved_hash \ | ||
22 | -k 1,3,$$ -N is_reserved_word -p -t $< > $@ | ||
23 | |||
24 | $(obj)/keywords.c: $(obj)/keywords.gperf FORCE | ||
25 | $(call if_changed,keywords.c) | ||
26 | cp $@ $@_shipped | ||
27 | |||
28 | # flex | ||
29 | |||
30 | quiet_cmd_lex.c = FLEX $@ | ||
31 | cmd_lex.c = flex -o$@ -d $< | ||
32 | |||
33 | $(obj)/lex.c: $(obj)/lex.l $(obj)/keywords.c FORCE | ||
34 | $(call if_changed,lex.c) | ||
35 | cp $@ $@_shipped | ||
36 | |||
37 | # bison | ||
38 | |||
39 | quiet_cmd_parse.c = BISON $@ | ||
40 | cmd_parse.c = bison -o$@ -dtv $(filter-out FORCE,$^) | ||
41 | |||
42 | $(obj)/parse.c: $(obj)/parse.y FORCE | ||
43 | $(call if_changed,parse.c) | ||
44 | cp $@ $@_shipped | ||
45 | cp $(@:.c=.h) $(@:.c=.h)_shipped | ||
46 | |||
47 | $(obj)/parse.h: $(obj)/parse.c ; | ||
48 | |||
49 | clean-files += parse.output | ||
50 | |||
51 | endif | ||
52 | |||
53 | targets += keywords.c lex.c parse.c parse.h | ||
diff --git a/scripts/genksyms/genksyms.c b/scripts/genksyms/genksyms.c index f9e75531ea0..8a106499ec4 100644 --- a/scripts/genksyms/genksyms.c +++ b/scripts/genksyms/genksyms.c | |||
@@ -40,7 +40,8 @@ static struct symbol *symtab[HASH_BUCKETS]; | |||
40 | static FILE *debugfile; | 40 | static FILE *debugfile; |
41 | 41 | ||
42 | int cur_line = 1; | 42 | int cur_line = 1; |
43 | char *cur_filename; | 43 | char *cur_filename, *source_file; |
44 | int in_source_file; | ||
44 | 45 | ||
45 | static int flag_debug, flag_dump_defs, flag_reference, flag_dump_types, | 46 | static int flag_debug, flag_dump_defs, flag_reference, flag_dump_types, |
46 | flag_preserve, flag_warnings; | 47 | flag_preserve, flag_warnings; |
@@ -448,7 +449,7 @@ static struct string_list *read_node(FILE *f) | |||
448 | node.string = buffer; | 449 | node.string = buffer; |
449 | 450 | ||
450 | if (node.string[1] == '#') { | 451 | if (node.string[1] == '#') { |
451 | int n; | 452 | size_t n; |
452 | 453 | ||
453 | for (n = 0; n < ARRAY_SIZE(symbol_types); n++) { | 454 | for (n = 0; n < ARRAY_SIZE(symbol_types); n++) { |
454 | if (node.string[0] == symbol_types[n].n) { | 455 | if (node.string[0] == symbol_types[n].n) { |
diff --git a/scripts/genksyms/genksyms.h b/scripts/genksyms/genksyms.h index 7ec52ae3846..3bffdcaaa27 100644 --- a/scripts/genksyms/genksyms.h +++ b/scripts/genksyms/genksyms.h | |||
@@ -37,6 +37,7 @@ enum symbol_status { | |||
37 | struct string_list { | 37 | struct string_list { |
38 | struct string_list *next; | 38 | struct string_list *next; |
39 | enum symbol_type tag; | 39 | enum symbol_type tag; |
40 | int in_source_file; | ||
40 | char *string; | 41 | char *string; |
41 | }; | 42 | }; |
42 | 43 | ||
@@ -57,7 +58,8 @@ typedef struct string_list **yystype; | |||
57 | #define YYSTYPE yystype | 58 | #define YYSTYPE yystype |
58 | 59 | ||
59 | extern int cur_line; | 60 | extern int cur_line; |
60 | extern char *cur_filename; | 61 | extern char *cur_filename, *source_file; |
62 | extern int in_source_file; | ||
61 | 63 | ||
62 | struct symbol *find_symbol(const char *name, enum symbol_type ns, int exact); | 64 | struct symbol *find_symbol(const char *name, enum symbol_type ns, int exact); |
63 | struct symbol *add_symbol(const char *name, enum symbol_type type, | 65 | struct symbol *add_symbol(const char *name, enum symbol_type type, |
diff --git a/scripts/genksyms/keywords.gperf b/scripts/genksyms/keywords.gperf index e6349acb6f2..3e77a943e7b 100644 --- a/scripts/genksyms/keywords.gperf +++ b/scripts/genksyms/keywords.gperf | |||
@@ -1,3 +1,6 @@ | |||
1 | %language=ANSI-C | ||
2 | %define hash-function-name is_reserved_hash | ||
3 | %define lookup-function-name is_reserved_word | ||
1 | %{ | 4 | %{ |
2 | struct resword; | 5 | struct resword; |
3 | static const struct resword *is_reserved_word(register const char *str, register unsigned int len); | 6 | static const struct resword *is_reserved_word(register const char *str, register unsigned int len); |
diff --git a/scripts/genksyms/keywords.c_shipped b/scripts/genksyms/keywords.hash.c_shipped index 8060e06798b..82062607e8c 100644 --- a/scripts/genksyms/keywords.c_shipped +++ b/scripts/genksyms/keywords.hash.c_shipped | |||
@@ -1,5 +1,5 @@ | |||
1 | /* ANSI-C code produced by gperf version 3.0.4 */ | 1 | /* ANSI-C code produced by gperf version 3.0.4 */ |
2 | /* Command-line: gperf -L ANSI-C -a -C -E -g -H is_reserved_hash -k '1,3,$' -N is_reserved_word -p -t scripts/genksyms/keywords.gperf */ | 2 | /* Command-line: gperf -t --output-file scripts/genksyms/keywords.hash.c_shipped -a -C -E -g -k '1,3,$' -p -t scripts/genksyms/keywords.gperf */ |
3 | 3 | ||
4 | #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ | 4 | #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ |
5 | && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ | 5 | && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ |
@@ -28,11 +28,11 @@ | |||
28 | #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>." | 28 | #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>." |
29 | #endif | 29 | #endif |
30 | 30 | ||
31 | #line 1 "scripts/genksyms/keywords.gperf" | 31 | #line 4 "scripts/genksyms/keywords.gperf" |
32 | 32 | ||
33 | struct resword; | 33 | struct resword; |
34 | static const struct resword *is_reserved_word(register const char *str, register unsigned int len); | 34 | static const struct resword *is_reserved_word(register const char *str, register unsigned int len); |
35 | #line 5 "scripts/genksyms/keywords.gperf" | 35 | #line 8 "scripts/genksyms/keywords.gperf" |
36 | struct resword { const char *name; int token; }; | 36 | struct resword { const char *name; int token; }; |
37 | /* maximum key range = 64, duplicates = 0 */ | 37 | /* maximum key range = 64, duplicates = 0 */ |
38 | 38 | ||
@@ -99,108 +99,108 @@ is_reserved_word (register const char *str, register unsigned int len) | |||
99 | static const struct resword wordlist[] = | 99 | static const struct resword wordlist[] = |
100 | { | 100 | { |
101 | {""}, {""}, {""}, | 101 | {""}, {""}, {""}, |
102 | #line 30 "scripts/genksyms/keywords.gperf" | 102 | #line 33 "scripts/genksyms/keywords.gperf" |
103 | {"asm", ASM_KEYW}, | 103 | {"asm", ASM_KEYW}, |
104 | {""}, | 104 | {""}, |
105 | #line 12 "scripts/genksyms/keywords.gperf" | 105 | #line 15 "scripts/genksyms/keywords.gperf" |
106 | {"__asm", ASM_KEYW}, | 106 | {"__asm", ASM_KEYW}, |
107 | {""}, | 107 | {""}, |
108 | #line 13 "scripts/genksyms/keywords.gperf" | 108 | #line 16 "scripts/genksyms/keywords.gperf" |
109 | {"__asm__", ASM_KEYW}, | 109 | {"__asm__", ASM_KEYW}, |
110 | {""}, {""}, | 110 | {""}, {""}, |
111 | #line 56 "scripts/genksyms/keywords.gperf" | 111 | #line 59 "scripts/genksyms/keywords.gperf" |
112 | {"__typeof__", TYPEOF_KEYW}, | 112 | {"__typeof__", TYPEOF_KEYW}, |
113 | {""}, | 113 | {""}, |
114 | #line 16 "scripts/genksyms/keywords.gperf" | 114 | #line 19 "scripts/genksyms/keywords.gperf" |
115 | {"__const", CONST_KEYW}, | 115 | {"__const", CONST_KEYW}, |
116 | #line 15 "scripts/genksyms/keywords.gperf" | 116 | #line 18 "scripts/genksyms/keywords.gperf" |
117 | {"__attribute__", ATTRIBUTE_KEYW}, | 117 | {"__attribute__", ATTRIBUTE_KEYW}, |
118 | #line 17 "scripts/genksyms/keywords.gperf" | 118 | #line 20 "scripts/genksyms/keywords.gperf" |
119 | {"__const__", CONST_KEYW}, | 119 | {"__const__", CONST_KEYW}, |
120 | #line 22 "scripts/genksyms/keywords.gperf" | 120 | #line 25 "scripts/genksyms/keywords.gperf" |
121 | {"__signed__", SIGNED_KEYW}, | 121 | {"__signed__", SIGNED_KEYW}, |
122 | #line 48 "scripts/genksyms/keywords.gperf" | 122 | #line 51 "scripts/genksyms/keywords.gperf" |
123 | {"static", STATIC_KEYW}, | 123 | {"static", STATIC_KEYW}, |
124 | {""}, | 124 | {""}, |
125 | #line 43 "scripts/genksyms/keywords.gperf" | 125 | #line 46 "scripts/genksyms/keywords.gperf" |
126 | {"int", INT_KEYW}, | 126 | {"int", INT_KEYW}, |
127 | #line 36 "scripts/genksyms/keywords.gperf" | 127 | #line 39 "scripts/genksyms/keywords.gperf" |
128 | {"char", CHAR_KEYW}, | 128 | {"char", CHAR_KEYW}, |
129 | #line 37 "scripts/genksyms/keywords.gperf" | 129 | #line 40 "scripts/genksyms/keywords.gperf" |
130 | {"const", CONST_KEYW}, | 130 | {"const", CONST_KEYW}, |
131 | #line 49 "scripts/genksyms/keywords.gperf" | 131 | #line 52 "scripts/genksyms/keywords.gperf" |
132 | {"struct", STRUCT_KEYW}, | 132 | {"struct", STRUCT_KEYW}, |
133 | #line 28 "scripts/genksyms/keywords.gperf" | 133 | #line 31 "scripts/genksyms/keywords.gperf" |
134 | {"__restrict__", RESTRICT_KEYW}, | 134 | {"__restrict__", RESTRICT_KEYW}, |
135 | #line 29 "scripts/genksyms/keywords.gperf" | 135 | #line 32 "scripts/genksyms/keywords.gperf" |
136 | {"restrict", RESTRICT_KEYW}, | 136 | {"restrict", RESTRICT_KEYW}, |
137 | #line 9 "scripts/genksyms/keywords.gperf" | 137 | #line 12 "scripts/genksyms/keywords.gperf" |
138 | {"EXPORT_SYMBOL_GPL_FUTURE", EXPORT_SYMBOL_KEYW}, | 138 | {"EXPORT_SYMBOL_GPL_FUTURE", EXPORT_SYMBOL_KEYW}, |
139 | #line 20 "scripts/genksyms/keywords.gperf" | 139 | #line 23 "scripts/genksyms/keywords.gperf" |
140 | {"__inline__", INLINE_KEYW}, | 140 | {"__inline__", INLINE_KEYW}, |
141 | {""}, | 141 | {""}, |
142 | #line 24 "scripts/genksyms/keywords.gperf" | 142 | #line 27 "scripts/genksyms/keywords.gperf" |
143 | {"__volatile__", VOLATILE_KEYW}, | 143 | {"__volatile__", VOLATILE_KEYW}, |
144 | #line 7 "scripts/genksyms/keywords.gperf" | 144 | #line 10 "scripts/genksyms/keywords.gperf" |
145 | {"EXPORT_SYMBOL", EXPORT_SYMBOL_KEYW}, | 145 | {"EXPORT_SYMBOL", EXPORT_SYMBOL_KEYW}, |
146 | #line 27 "scripts/genksyms/keywords.gperf" | 146 | #line 30 "scripts/genksyms/keywords.gperf" |
147 | {"_restrict", RESTRICT_KEYW}, | 147 | {"_restrict", RESTRICT_KEYW}, |
148 | {""}, | 148 | {""}, |
149 | #line 14 "scripts/genksyms/keywords.gperf" | 149 | #line 17 "scripts/genksyms/keywords.gperf" |
150 | {"__attribute", ATTRIBUTE_KEYW}, | 150 | {"__attribute", ATTRIBUTE_KEYW}, |
151 | #line 8 "scripts/genksyms/keywords.gperf" | 151 | #line 11 "scripts/genksyms/keywords.gperf" |
152 | {"EXPORT_SYMBOL_GPL", EXPORT_SYMBOL_KEYW}, | 152 | {"EXPORT_SYMBOL_GPL", EXPORT_SYMBOL_KEYW}, |
153 | #line 18 "scripts/genksyms/keywords.gperf" | 153 | #line 21 "scripts/genksyms/keywords.gperf" |
154 | {"__extension__", EXTENSION_KEYW}, | 154 | {"__extension__", EXTENSION_KEYW}, |
155 | #line 39 "scripts/genksyms/keywords.gperf" | 155 | #line 42 "scripts/genksyms/keywords.gperf" |
156 | {"enum", ENUM_KEYW}, | 156 | {"enum", ENUM_KEYW}, |
157 | #line 10 "scripts/genksyms/keywords.gperf" | 157 | #line 13 "scripts/genksyms/keywords.gperf" |
158 | {"EXPORT_UNUSED_SYMBOL", EXPORT_SYMBOL_KEYW}, | 158 | {"EXPORT_UNUSED_SYMBOL", EXPORT_SYMBOL_KEYW}, |
159 | #line 40 "scripts/genksyms/keywords.gperf" | 159 | #line 43 "scripts/genksyms/keywords.gperf" |
160 | {"extern", EXTERN_KEYW}, | 160 | {"extern", EXTERN_KEYW}, |
161 | {""}, | 161 | {""}, |
162 | #line 21 "scripts/genksyms/keywords.gperf" | 162 | #line 24 "scripts/genksyms/keywords.gperf" |
163 | {"__signed", SIGNED_KEYW}, | 163 | {"__signed", SIGNED_KEYW}, |
164 | #line 11 "scripts/genksyms/keywords.gperf" | 164 | #line 14 "scripts/genksyms/keywords.gperf" |
165 | {"EXPORT_UNUSED_SYMBOL_GPL", EXPORT_SYMBOL_KEYW}, | 165 | {"EXPORT_UNUSED_SYMBOL_GPL", EXPORT_SYMBOL_KEYW}, |
166 | #line 51 "scripts/genksyms/keywords.gperf" | 166 | #line 54 "scripts/genksyms/keywords.gperf" |
167 | {"union", UNION_KEYW}, | 167 | {"union", UNION_KEYW}, |
168 | #line 55 "scripts/genksyms/keywords.gperf" | 168 | #line 58 "scripts/genksyms/keywords.gperf" |
169 | {"typeof", TYPEOF_KEYW}, | 169 | {"typeof", TYPEOF_KEYW}, |
170 | #line 50 "scripts/genksyms/keywords.gperf" | 170 | #line 53 "scripts/genksyms/keywords.gperf" |
171 | {"typedef", TYPEDEF_KEYW}, | 171 | {"typedef", TYPEDEF_KEYW}, |
172 | #line 19 "scripts/genksyms/keywords.gperf" | 172 | #line 22 "scripts/genksyms/keywords.gperf" |
173 | {"__inline", INLINE_KEYW}, | 173 | {"__inline", INLINE_KEYW}, |
174 | #line 35 "scripts/genksyms/keywords.gperf" | 174 | #line 38 "scripts/genksyms/keywords.gperf" |
175 | {"auto", AUTO_KEYW}, | 175 | {"auto", AUTO_KEYW}, |
176 | #line 23 "scripts/genksyms/keywords.gperf" | 176 | #line 26 "scripts/genksyms/keywords.gperf" |
177 | {"__volatile", VOLATILE_KEYW}, | 177 | {"__volatile", VOLATILE_KEYW}, |
178 | {""}, {""}, | 178 | {""}, {""}, |
179 | #line 52 "scripts/genksyms/keywords.gperf" | 179 | #line 55 "scripts/genksyms/keywords.gperf" |
180 | {"unsigned", UNSIGNED_KEYW}, | 180 | {"unsigned", UNSIGNED_KEYW}, |
181 | {""}, | 181 | {""}, |
182 | #line 46 "scripts/genksyms/keywords.gperf" | 182 | #line 49 "scripts/genksyms/keywords.gperf" |
183 | {"short", SHORT_KEYW}, | 183 | {"short", SHORT_KEYW}, |
184 | #line 42 "scripts/genksyms/keywords.gperf" | 184 | #line 45 "scripts/genksyms/keywords.gperf" |
185 | {"inline", INLINE_KEYW}, | 185 | {"inline", INLINE_KEYW}, |
186 | {""}, | 186 | {""}, |
187 | #line 54 "scripts/genksyms/keywords.gperf" | 187 | #line 57 "scripts/genksyms/keywords.gperf" |
188 | {"volatile", VOLATILE_KEYW}, | 188 | {"volatile", VOLATILE_KEYW}, |
189 | #line 44 "scripts/genksyms/keywords.gperf" | 189 | #line 47 "scripts/genksyms/keywords.gperf" |
190 | {"long", LONG_KEYW}, | 190 | {"long", LONG_KEYW}, |
191 | #line 26 "scripts/genksyms/keywords.gperf" | 191 | #line 29 "scripts/genksyms/keywords.gperf" |
192 | {"_Bool", BOOL_KEYW}, | 192 | {"_Bool", BOOL_KEYW}, |
193 | {""}, {""}, | 193 | {""}, {""}, |
194 | #line 45 "scripts/genksyms/keywords.gperf" | 194 | #line 48 "scripts/genksyms/keywords.gperf" |
195 | {"register", REGISTER_KEYW}, | 195 | {"register", REGISTER_KEYW}, |
196 | #line 53 "scripts/genksyms/keywords.gperf" | 196 | #line 56 "scripts/genksyms/keywords.gperf" |
197 | {"void", VOID_KEYW}, | 197 | {"void", VOID_KEYW}, |
198 | #line 41 "scripts/genksyms/keywords.gperf" | 198 | #line 44 "scripts/genksyms/keywords.gperf" |
199 | {"float", FLOAT_KEYW}, | 199 | {"float", FLOAT_KEYW}, |
200 | #line 38 "scripts/genksyms/keywords.gperf" | 200 | #line 41 "scripts/genksyms/keywords.gperf" |
201 | {"double", DOUBLE_KEYW}, | 201 | {"double", DOUBLE_KEYW}, |
202 | {""}, {""}, {""}, {""}, | 202 | {""}, {""}, {""}, {""}, |
203 | #line 47 "scripts/genksyms/keywords.gperf" | 203 | #line 50 "scripts/genksyms/keywords.gperf" |
204 | {"signed", SIGNED_KEYW} | 204 | {"signed", SIGNED_KEYW} |
205 | }; | 205 | }; |
206 | 206 | ||
diff --git a/scripts/genksyms/lex.l b/scripts/genksyms/lex.l index e4ddd493fec..f770071719c 100644 --- a/scripts/genksyms/lex.l +++ b/scripts/genksyms/lex.l | |||
@@ -29,7 +29,7 @@ | |||
29 | #include <ctype.h> | 29 | #include <ctype.h> |
30 | 30 | ||
31 | #include "genksyms.h" | 31 | #include "genksyms.h" |
32 | #include "parse.h" | 32 | #include "parse.tab.h" |
33 | 33 | ||
34 | /* We've got a two-level lexer here. We let flex do basic tokenization | 34 | /* We've got a two-level lexer here. We let flex do basic tokenization |
35 | and then we categorize those basic tokens in the second stage. */ | 35 | and then we categorize those basic tokens in the second stage. */ |
@@ -94,7 +94,7 @@ MC_TOKEN ([~%^&*+=|<>/-]=)|(&&)|("||")|(->)|(<<)|(>>) | |||
94 | 94 | ||
95 | /* Bring in the keyword recognizer. */ | 95 | /* Bring in the keyword recognizer. */ |
96 | 96 | ||
97 | #include "keywords.c" | 97 | #include "keywords.hash.c" |
98 | 98 | ||
99 | 99 | ||
100 | /* Macros to append to our phrase collection list. */ | 100 | /* Macros to append to our phrase collection list. */ |
@@ -116,6 +116,7 @@ MC_TOKEN ([~%^&*+=|<>/-]=)|(&&)|("||")|(->)|(<<)|(>>) | |||
116 | cur_node->tag = \ | 116 | cur_node->tag = \ |
117 | find_symbol(cur_node->string, SYM_ENUM_CONST, 1)?\ | 117 | find_symbol(cur_node->string, SYM_ENUM_CONST, 1)?\ |
118 | SYM_ENUM_CONST : SYM_NORMAL ; \ | 118 | SYM_ENUM_CONST : SYM_NORMAL ; \ |
119 | cur_node->in_source_file = in_source_file; \ | ||
119 | } while (0) | 120 | } while (0) |
120 | 121 | ||
121 | #define APP _APP(yytext, yyleng) | 122 | #define APP _APP(yytext, yyleng) |
@@ -166,6 +167,13 @@ repeat: | |||
166 | cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1); | 167 | cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1); |
167 | cur_line = atoi(yytext+2); | 168 | cur_line = atoi(yytext+2); |
168 | 169 | ||
170 | if (!source_file) { | ||
171 | source_file = xstrdup(cur_filename); | ||
172 | in_source_file = 1; | ||
173 | } else { | ||
174 | in_source_file = (strcmp(cur_filename, source_file) == 0); | ||
175 | } | ||
176 | |||
169 | goto repeat; | 177 | goto repeat; |
170 | } | 178 | } |
171 | 179 | ||
diff --git a/scripts/genksyms/lex.c_shipped b/scripts/genksyms/lex.lex.c_shipped index af4939041e4..0bf4157e616 100644 --- a/scripts/genksyms/lex.c_shipped +++ b/scripts/genksyms/lex.lex.c_shipped | |||
@@ -1,20 +1,10 @@ | |||
1 | #line 2 "scripts/genksyms/lex.c" | ||
2 | 1 | ||
3 | #line 4 "scripts/genksyms/lex.c" | 2 | #line 3 "scripts/genksyms/lex.lex.c_shipped" |
4 | 3 | ||
5 | #define YY_INT_ALIGNED short int | 4 | #define YY_INT_ALIGNED short int |
6 | 5 | ||
7 | /* A lexical scanner generated by flex */ | 6 | /* A lexical scanner generated by flex */ |
8 | 7 | ||
9 | /* %not-for-header */ | ||
10 | |||
11 | /* %if-c-only */ | ||
12 | /* %if-not-reentrant */ | ||
13 | |||
14 | /* %endif */ | ||
15 | /* %endif */ | ||
16 | /* %ok-for-header */ | ||
17 | |||
18 | #define FLEX_SCANNER | 8 | #define FLEX_SCANNER |
19 | #define YY_FLEX_MAJOR_VERSION 2 | 9 | #define YY_FLEX_MAJOR_VERSION 2 |
20 | #define YY_FLEX_MINOR_VERSION 5 | 10 | #define YY_FLEX_MINOR_VERSION 5 |
@@ -23,32 +13,16 @@ | |||
23 | #define FLEX_BETA | 13 | #define FLEX_BETA |
24 | #endif | 14 | #endif |
25 | 15 | ||
26 | /* %if-c++-only */ | ||
27 | /* %endif */ | ||
28 | |||
29 | /* %if-c-only */ | ||
30 | |||
31 | /* %endif */ | ||
32 | |||
33 | /* %if-c-only */ | ||
34 | |||
35 | /* %endif */ | ||
36 | |||
37 | /* First, we deal with platform-specific or compiler-specific issues. */ | 16 | /* First, we deal with platform-specific or compiler-specific issues. */ |
38 | 17 | ||
39 | /* begin standard C headers. */ | 18 | /* begin standard C headers. */ |
40 | /* %if-c-only */ | ||
41 | #include <stdio.h> | 19 | #include <stdio.h> |
42 | #include <string.h> | 20 | #include <string.h> |
43 | #include <errno.h> | 21 | #include <errno.h> |
44 | #include <stdlib.h> | 22 | #include <stdlib.h> |
45 | /* %endif */ | ||
46 | 23 | ||
47 | /* %if-tables-serialization */ | ||
48 | /* %endif */ | ||
49 | /* end standard C headers. */ | 24 | /* end standard C headers. */ |
50 | 25 | ||
51 | /* %if-c-or-c++ */ | ||
52 | /* flex integer type definitions */ | 26 | /* flex integer type definitions */ |
53 | 27 | ||
54 | #ifndef FLEXINT_H | 28 | #ifndef FLEXINT_H |
@@ -112,11 +86,6 @@ typedef unsigned int flex_uint32_t; | |||
112 | 86 | ||
113 | #endif /* ! FLEXINT_H */ | 87 | #endif /* ! FLEXINT_H */ |
114 | 88 | ||
115 | /* %endif */ | ||
116 | |||
117 | /* %if-c++-only */ | ||
118 | /* %endif */ | ||
119 | |||
120 | #ifdef __cplusplus | 89 | #ifdef __cplusplus |
121 | 90 | ||
122 | /* The "const" storage-class-modifier is valid. */ | 91 | /* The "const" storage-class-modifier is valid. */ |
@@ -138,13 +107,8 @@ typedef unsigned int flex_uint32_t; | |||
138 | #define yyconst | 107 | #define yyconst |
139 | #endif | 108 | #endif |
140 | 109 | ||
141 | /* %not-for-header */ | ||
142 | |||
143 | /* Returned upon end-of-file. */ | 110 | /* Returned upon end-of-file. */ |
144 | #define YY_NULL 0 | 111 | #define YY_NULL 0 |
145 | /* %ok-for-header */ | ||
146 | |||
147 | /* %not-for-header */ | ||
148 | 112 | ||
149 | /* Promotes a possibly negative, possibly signed char to an unsigned | 113 | /* Promotes a possibly negative, possibly signed char to an unsigned |
150 | * integer for use as an array index. If the signed char is negative, | 114 | * integer for use as an array index. If the signed char is negative, |
@@ -152,14 +116,6 @@ typedef unsigned int flex_uint32_t; | |||
152 | * double cast. | 116 | * double cast. |
153 | */ | 117 | */ |
154 | #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) | 118 | #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) |
155 | /* %ok-for-header */ | ||
156 | |||
157 | /* %if-reentrant */ | ||
158 | /* %endif */ | ||
159 | |||
160 | /* %if-not-reentrant */ | ||
161 | |||
162 | /* %endif */ | ||
163 | 119 | ||
164 | /* Enter a start condition. This macro really ought to take a parameter, | 120 | /* Enter a start condition. This macro really ought to take a parameter, |
165 | * but we do it the disgusting crufty way forced on us by the ()-less | 121 | * but we do it the disgusting crufty way forced on us by the ()-less |
@@ -196,15 +152,9 @@ typedef unsigned int flex_uint32_t; | |||
196 | typedef struct yy_buffer_state *YY_BUFFER_STATE; | 152 | typedef struct yy_buffer_state *YY_BUFFER_STATE; |
197 | #endif | 153 | #endif |
198 | 154 | ||
199 | /* %if-not-reentrant */ | ||
200 | extern int yyleng; | 155 | extern int yyleng; |
201 | /* %endif */ | ||
202 | 156 | ||
203 | /* %if-c-only */ | ||
204 | /* %if-not-reentrant */ | ||
205 | extern FILE *yyin, *yyout; | 157 | extern FILE *yyin, *yyout; |
206 | /* %endif */ | ||
207 | /* %endif */ | ||
208 | 158 | ||
209 | #define EOB_ACT_CONTINUE_SCAN 0 | 159 | #define EOB_ACT_CONTINUE_SCAN 0 |
210 | #define EOB_ACT_END_OF_FILE 1 | 160 | #define EOB_ACT_END_OF_FILE 1 |
@@ -237,12 +187,7 @@ typedef size_t yy_size_t; | |||
237 | #define YY_STRUCT_YY_BUFFER_STATE | 187 | #define YY_STRUCT_YY_BUFFER_STATE |
238 | struct yy_buffer_state | 188 | struct yy_buffer_state |
239 | { | 189 | { |
240 | /* %if-c-only */ | ||
241 | FILE *yy_input_file; | 190 | FILE *yy_input_file; |
242 | /* %endif */ | ||
243 | |||
244 | /* %if-c++-only */ | ||
245 | /* %endif */ | ||
246 | 191 | ||
247 | char *yy_ch_buf; /* input buffer */ | 192 | char *yy_ch_buf; /* input buffer */ |
248 | char *yy_buf_pos; /* current position in input buffer */ | 193 | char *yy_buf_pos; /* current position in input buffer */ |
@@ -303,19 +248,10 @@ struct yy_buffer_state | |||
303 | }; | 248 | }; |
304 | #endif /* !YY_STRUCT_YY_BUFFER_STATE */ | 249 | #endif /* !YY_STRUCT_YY_BUFFER_STATE */ |
305 | 250 | ||
306 | /* %if-c-only Standard (non-C++) definition */ | ||
307 | /* %not-for-header */ | ||
308 | |||
309 | /* %if-not-reentrant */ | ||
310 | |||
311 | /* Stack of input buffers. */ | 251 | /* Stack of input buffers. */ |
312 | static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ | 252 | static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ |
313 | static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ | 253 | static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ |
314 | static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ | 254 | static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ |
315 | /* %endif */ | ||
316 | /* %ok-for-header */ | ||
317 | |||
318 | /* %endif */ | ||
319 | 255 | ||
320 | /* We provide macros for accessing buffer states in case in the | 256 | /* We provide macros for accessing buffer states in case in the |
321 | * future we want to put the buffer states in a more general | 257 | * future we want to put the buffer states in a more general |
@@ -332,11 +268,6 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ | |||
332 | */ | 268 | */ |
333 | #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] | 269 | #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] |
334 | 270 | ||
335 | /* %if-c-only Standard (non-C++) definition */ | ||
336 | |||
337 | /* %if-not-reentrant */ | ||
338 | /* %not-for-header */ | ||
339 | |||
340 | /* yy_hold_char holds the character lost when yytext is formed. */ | 271 | /* yy_hold_char holds the character lost when yytext is formed. */ |
341 | static char yy_hold_char; | 272 | static char yy_hold_char; |
342 | static int yy_n_chars; /* number of characters read into yy_ch_buf */ | 273 | static int yy_n_chars; /* number of characters read into yy_ch_buf */ |
@@ -351,9 +282,6 @@ static int yy_start = 0; /* start state number */ | |||
351 | * instead of setting up a fresh yyin. A bit of a hack ... | 282 | * instead of setting up a fresh yyin. A bit of a hack ... |
352 | */ | 283 | */ |
353 | static int yy_did_buffer_switch_on_eof; | 284 | static int yy_did_buffer_switch_on_eof; |
354 | /* %ok-for-header */ | ||
355 | |||
356 | /* %endif */ | ||
357 | 285 | ||
358 | void yyrestart (FILE *input_file ); | 286 | void yyrestart (FILE *input_file ); |
359 | void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); | 287 | void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); |
@@ -373,8 +301,6 @@ YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); | |||
373 | YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); | 301 | YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); |
374 | YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); | 302 | YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); |
375 | 303 | ||
376 | /* %endif */ | ||
377 | |||
378 | void *yyalloc (yy_size_t ); | 304 | void *yyalloc (yy_size_t ); |
379 | void *yyrealloc (void *,yy_size_t ); | 305 | void *yyrealloc (void *,yy_size_t ); |
380 | void yyfree (void * ); | 306 | void yyfree (void * ); |
@@ -403,14 +329,11 @@ void yyfree (void * ); | |||
403 | 329 | ||
404 | #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) | 330 | #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) |
405 | 331 | ||
406 | /* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */ | ||
407 | /* Begin user sect3 */ | 332 | /* Begin user sect3 */ |
408 | 333 | ||
409 | #define yywrap(n) 1 | 334 | #define yywrap(n) 1 |
410 | #define YY_SKIP_YYWRAP | 335 | #define YY_SKIP_YYWRAP |
411 | 336 | ||
412 | #define FLEX_DEBUG | ||
413 | |||
414 | typedef unsigned char YY_CHAR; | 337 | typedef unsigned char YY_CHAR; |
415 | 338 | ||
416 | FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; | 339 | FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; |
@@ -424,28 +347,21 @@ int yylineno = 1; | |||
424 | extern char *yytext; | 347 | extern char *yytext; |
425 | #define yytext_ptr yytext | 348 | #define yytext_ptr yytext |
426 | 349 | ||
427 | /* %if-c-only Standard (non-C++) definition */ | ||
428 | |||
429 | static yy_state_type yy_get_previous_state (void ); | 350 | static yy_state_type yy_get_previous_state (void ); |
430 | static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); | 351 | static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); |
431 | static int yy_get_next_buffer (void ); | 352 | static int yy_get_next_buffer (void ); |
432 | static void yy_fatal_error (yyconst char msg[] ); | 353 | static void yy_fatal_error (yyconst char msg[] ); |
433 | 354 | ||
434 | /* %endif */ | ||
435 | |||
436 | /* Done after the current pattern has been matched and before the | 355 | /* Done after the current pattern has been matched and before the |
437 | * corresponding action - sets up yytext. | 356 | * corresponding action - sets up yytext. |
438 | */ | 357 | */ |
439 | #define YY_DO_BEFORE_ACTION \ | 358 | #define YY_DO_BEFORE_ACTION \ |
440 | (yytext_ptr) = yy_bp; \ | 359 | (yytext_ptr) = yy_bp; \ |
441 | /* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\ | ||
442 | yyleng = (size_t) (yy_cp - yy_bp); \ | 360 | yyleng = (size_t) (yy_cp - yy_bp); \ |
443 | (yy_hold_char) = *yy_cp; \ | 361 | (yy_hold_char) = *yy_cp; \ |
444 | *yy_cp = '\0'; \ | 362 | *yy_cp = '\0'; \ |
445 | /* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\ | ||
446 | (yy_c_buf_p) = yy_cp; | 363 | (yy_c_buf_p) = yy_cp; |
447 | 364 | ||
448 | /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */ | ||
449 | #define YY_NUM_RULES 13 | 365 | #define YY_NUM_RULES 13 |
450 | #define YY_END_OF_BUFFER 14 | 366 | #define YY_END_OF_BUFFER 14 |
451 | /* This struct is not used in this scanner, | 367 | /* This struct is not used in this scanner, |
@@ -610,13 +526,7 @@ static yy_state_type yy_last_accepting_state; | |||
610 | static char *yy_last_accepting_cpos; | 526 | static char *yy_last_accepting_cpos; |
611 | 527 | ||
612 | extern int yy_flex_debug; | 528 | extern int yy_flex_debug; |
613 | int yy_flex_debug = 1; | 529 | int yy_flex_debug = 0; |
614 | |||
615 | static yyconst flex_int16_t yy_rule_linenum[13] = | ||
616 | { 0, | ||
617 | 67, 68, 69, 72, 75, 76, 77, 83, 84, 85, | ||
618 | 87, 90 | ||
619 | } ; | ||
620 | 530 | ||
621 | /* The intent behind this definition is that it'll catch | 531 | /* The intent behind this definition is that it'll catch |
622 | * any uses of REJECT which flex missed. | 532 | * any uses of REJECT which flex missed. |
@@ -626,7 +536,6 @@ static yyconst flex_int16_t yy_rule_linenum[13] = | |||
626 | #define YY_MORE_ADJ 0 | 536 | #define YY_MORE_ADJ 0 |
627 | #define YY_RESTORE_YY_MORE_OFFSET | 537 | #define YY_RESTORE_YY_MORE_OFFSET |
628 | char *yytext; | 538 | char *yytext; |
629 | #line 1 "scripts/genksyms/lex.l" | ||
630 | /* Lexical analysis for genksyms. | 539 | /* Lexical analysis for genksyms. |
631 | Copyright 1996, 1997 Linux International. | 540 | Copyright 1996, 1997 Linux International. |
632 | 541 | ||
@@ -648,7 +557,6 @@ char *yytext; | |||
648 | You should have received a copy of the GNU General Public License | 557 | You should have received a copy of the GNU General Public License |
649 | along with this program; if not, write to the Free Software Foundation, | 558 | along with this program; if not, write to the Free Software Foundation, |
650 | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | 559 | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
651 | #line 25 "scripts/genksyms/lex.l" | ||
652 | 560 | ||
653 | #include <limits.h> | 561 | #include <limits.h> |
654 | #include <stdlib.h> | 562 | #include <stdlib.h> |
@@ -656,7 +564,7 @@ char *yytext; | |||
656 | #include <ctype.h> | 564 | #include <ctype.h> |
657 | 565 | ||
658 | #include "genksyms.h" | 566 | #include "genksyms.h" |
659 | #include "parse.h" | 567 | #include "parse.tab.h" |
660 | 568 | ||
661 | /* We've got a two-level lexer here. We let flex do basic tokenization | 569 | /* We've got a two-level lexer here. We let flex do basic tokenization |
662 | and then we categorize those basic tokens in the second stage. */ | 570 | and then we categorize those basic tokens in the second stage. */ |
@@ -664,7 +572,6 @@ char *yytext; | |||
664 | 572 | ||
665 | /* We don't do multiple input files. */ | 573 | /* We don't do multiple input files. */ |
666 | #define YY_NO_INPUT 1 | 574 | #define YY_NO_INPUT 1 |
667 | #line 668 "scripts/genksyms/lex.c" | ||
668 | 575 | ||
669 | #define INITIAL 0 | 576 | #define INITIAL 0 |
670 | 577 | ||
@@ -673,28 +580,15 @@ char *yytext; | |||
673 | * down here because we want the user's section 1 to have been scanned first. | 580 | * down here because we want the user's section 1 to have been scanned first. |
674 | * The user has a chance to override it with an option. | 581 | * The user has a chance to override it with an option. |
675 | */ | 582 | */ |
676 | /* %if-c-only */ | ||
677 | #include <unistd.h> | 583 | #include <unistd.h> |
678 | /* %endif */ | ||
679 | /* %if-c++-only */ | ||
680 | /* %endif */ | ||
681 | #endif | 584 | #endif |
682 | 585 | ||
683 | #ifndef YY_EXTRA_TYPE | 586 | #ifndef YY_EXTRA_TYPE |
684 | #define YY_EXTRA_TYPE void * | 587 | #define YY_EXTRA_TYPE void * |
685 | #endif | 588 | #endif |
686 | 589 | ||
687 | /* %if-c-only Reentrant structure and macros (non-C++). */ | ||
688 | /* %if-reentrant */ | ||
689 | /* %if-c-only */ | ||
690 | |||
691 | static int yy_init_globals (void ); | 590 | static int yy_init_globals (void ); |
692 | 591 | ||
693 | /* %endif */ | ||
694 | /* %if-reentrant */ | ||
695 | /* %endif */ | ||
696 | /* %endif End reentrant structures and macros. */ | ||
697 | |||
698 | /* Accessor methods to globals. | 592 | /* Accessor methods to globals. |
699 | These are made visible to non-reentrant scanners for convenience. */ | 593 | These are made visible to non-reentrant scanners for convenience. */ |
700 | 594 | ||
@@ -724,9 +618,6 @@ int yyget_lineno (void ); | |||
724 | 618 | ||
725 | void yyset_lineno (int line_number ); | 619 | void yyset_lineno (int line_number ); |
726 | 620 | ||
727 | /* %if-bison-bridge */ | ||
728 | /* %endif */ | ||
729 | |||
730 | /* Macros after this point can all be overridden by user definitions in | 621 | /* Macros after this point can all be overridden by user definitions in |
731 | * section 1. | 622 | * section 1. |
732 | */ | 623 | */ |
@@ -739,14 +630,8 @@ extern int yywrap (void ); | |||
739 | #endif | 630 | #endif |
740 | #endif | 631 | #endif |
741 | 632 | ||
742 | /* %not-for-header */ | ||
743 | |||
744 | static void yyunput (int c,char *buf_ptr ); | 633 | static void yyunput (int c,char *buf_ptr ); |
745 | 634 | ||
746 | /* %ok-for-header */ | ||
747 | |||
748 | /* %endif */ | ||
749 | |||
750 | #ifndef yytext_ptr | 635 | #ifndef yytext_ptr |
751 | static void yy_flex_strncpy (char *,yyconst char *,int ); | 636 | static void yy_flex_strncpy (char *,yyconst char *,int ); |
752 | #endif | 637 | #endif |
@@ -756,23 +641,15 @@ static int yy_flex_strlen (yyconst char * ); | |||
756 | #endif | 641 | #endif |
757 | 642 | ||
758 | #ifndef YY_NO_INPUT | 643 | #ifndef YY_NO_INPUT |
759 | /* %if-c-only Standard (non-C++) definition */ | ||
760 | /* %not-for-header */ | ||
761 | 644 | ||
762 | #ifdef __cplusplus | 645 | #ifdef __cplusplus |
763 | static int yyinput (void ); | 646 | static int yyinput (void ); |
764 | #else | 647 | #else |
765 | static int input (void ); | 648 | static int input (void ); |
766 | #endif | 649 | #endif |
767 | /* %ok-for-header */ | ||
768 | 650 | ||
769 | /* %endif */ | ||
770 | #endif | 651 | #endif |
771 | 652 | ||
772 | /* %if-c-only */ | ||
773 | |||
774 | /* %endif */ | ||
775 | |||
776 | /* Amount of stuff to slurp up with each read. */ | 653 | /* Amount of stuff to slurp up with each read. */ |
777 | #ifndef YY_READ_BUF_SIZE | 654 | #ifndef YY_READ_BUF_SIZE |
778 | #define YY_READ_BUF_SIZE 8192 | 655 | #define YY_READ_BUF_SIZE 8192 |
@@ -780,14 +657,10 @@ static int input (void ); | |||
780 | 657 | ||
781 | /* Copy whatever the last rule matched to the standard output. */ | 658 | /* Copy whatever the last rule matched to the standard output. */ |
782 | #ifndef ECHO | 659 | #ifndef ECHO |
783 | /* %if-c-only Standard (non-C++) definition */ | ||
784 | /* This used to be an fputs(), but since the string might contain NUL's, | 660 | /* This used to be an fputs(), but since the string might contain NUL's, |
785 | * we now use fwrite(). | 661 | * we now use fwrite(). |
786 | */ | 662 | */ |
787 | #define ECHO fwrite( yytext, yyleng, 1, yyout ) | 663 | #define ECHO fwrite( yytext, yyleng, 1, yyout ) |
788 | /* %endif */ | ||
789 | /* %if-c++-only C++ definition */ | ||
790 | /* %endif */ | ||
791 | #endif | 664 | #endif |
792 | 665 | ||
793 | /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, | 666 | /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, |
@@ -795,7 +668,6 @@ static int input (void ); | |||
795 | */ | 668 | */ |
796 | #ifndef YY_INPUT | 669 | #ifndef YY_INPUT |
797 | #define YY_INPUT(buf,result,max_size) \ | 670 | #define YY_INPUT(buf,result,max_size) \ |
798 | /* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\ | ||
799 | if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ | 671 | if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ |
800 | { \ | 672 | { \ |
801 | int c = '*'; \ | 673 | int c = '*'; \ |
@@ -824,8 +696,6 @@ static int input (void ); | |||
824 | } \ | 696 | } \ |
825 | }\ | 697 | }\ |
826 | \ | 698 | \ |
827 | /* %if-c++-only C++ definition \ */\ | ||
828 | /* %endif */ | ||
829 | 699 | ||
830 | #endif | 700 | #endif |
831 | 701 | ||
@@ -844,39 +714,20 @@ static int input (void ); | |||
844 | 714 | ||
845 | /* Report a fatal error. */ | 715 | /* Report a fatal error. */ |
846 | #ifndef YY_FATAL_ERROR | 716 | #ifndef YY_FATAL_ERROR |
847 | /* %if-c-only */ | ||
848 | #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) | 717 | #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) |
849 | /* %endif */ | ||
850 | /* %if-c++-only */ | ||
851 | /* %endif */ | ||
852 | #endif | 718 | #endif |
853 | 719 | ||
854 | /* %if-tables-serialization structures and prototypes */ | ||
855 | /* %not-for-header */ | ||
856 | |||
857 | /* %ok-for-header */ | ||
858 | |||
859 | /* %not-for-header */ | ||
860 | |||
861 | /* %tables-yydmap generated elements */ | ||
862 | /* %endif */ | ||
863 | /* end tables serialization structures and prototypes */ | 720 | /* end tables serialization structures and prototypes */ |
864 | 721 | ||
865 | /* %ok-for-header */ | ||
866 | |||
867 | /* Default declaration of generated scanner - a define so the user can | 722 | /* Default declaration of generated scanner - a define so the user can |
868 | * easily add parameters. | 723 | * easily add parameters. |
869 | */ | 724 | */ |
870 | #ifndef YY_DECL | 725 | #ifndef YY_DECL |
871 | #define YY_DECL_IS_OURS 1 | 726 | #define YY_DECL_IS_OURS 1 |
872 | /* %if-c-only Standard (non-C++) definition */ | ||
873 | 727 | ||
874 | extern int yylex (void); | 728 | extern int yylex (void); |
875 | 729 | ||
876 | #define YY_DECL int yylex (void) | 730 | #define YY_DECL int yylex (void) |
877 | /* %endif */ | ||
878 | /* %if-c++-only C++ definition */ | ||
879 | /* %endif */ | ||
880 | #endif /* !YY_DECL */ | 731 | #endif /* !YY_DECL */ |
881 | 732 | ||
882 | /* Code executed at the beginning of each rule, after yytext and yyleng | 733 | /* Code executed at the beginning of each rule, after yytext and yyleng |
@@ -891,15 +742,12 @@ extern int yylex (void); | |||
891 | #define YY_BREAK break; | 742 | #define YY_BREAK break; |
892 | #endif | 743 | #endif |
893 | 744 | ||
894 | /* %% [6.0] YY_RULE_SETUP definition goes here */ | ||
895 | #define YY_RULE_SETUP \ | 745 | #define YY_RULE_SETUP \ |
896 | if ( yyleng > 0 ) \ | 746 | if ( yyleng > 0 ) \ |
897 | YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | 747 | YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ |
898 | (yytext[yyleng - 1] == '\n'); \ | 748 | (yytext[yyleng - 1] == '\n'); \ |
899 | YY_USER_ACTION | 749 | YY_USER_ACTION |
900 | 750 | ||
901 | /* %not-for-header */ | ||
902 | |||
903 | /** The main scanner function which does all the work. | 751 | /** The main scanner function which does all the work. |
904 | */ | 752 | */ |
905 | YY_DECL | 753 | YY_DECL |
@@ -908,13 +756,7 @@ YY_DECL | |||
908 | register char *yy_cp, *yy_bp; | 756 | register char *yy_cp, *yy_bp; |
909 | register int yy_act; | 757 | register int yy_act; |
910 | 758 | ||
911 | /* %% [7.0] user's declarations go here */ | ||
912 | #line 63 "scripts/genksyms/lex.l" | ||
913 | |||
914 | |||
915 | |||
916 | /* Keep track of our location in the original source files. */ | 759 | /* Keep track of our location in the original source files. */ |
917 | #line 918 "scripts/genksyms/lex.c" | ||
918 | 760 | ||
919 | if ( !(yy_init) ) | 761 | if ( !(yy_init) ) |
920 | { | 762 | { |
@@ -928,18 +770,10 @@ YY_DECL | |||
928 | (yy_start) = 1; /* first start state */ | 770 | (yy_start) = 1; /* first start state */ |
929 | 771 | ||
930 | if ( ! yyin ) | 772 | if ( ! yyin ) |
931 | /* %if-c-only */ | ||
932 | yyin = stdin; | 773 | yyin = stdin; |
933 | /* %endif */ | ||
934 | /* %if-c++-only */ | ||
935 | /* %endif */ | ||
936 | 774 | ||
937 | if ( ! yyout ) | 775 | if ( ! yyout ) |
938 | /* %if-c-only */ | ||
939 | yyout = stdout; | 776 | yyout = stdout; |
940 | /* %endif */ | ||
941 | /* %if-c++-only */ | ||
942 | /* %endif */ | ||
943 | 777 | ||
944 | if ( ! YY_CURRENT_BUFFER ) { | 778 | if ( ! YY_CURRENT_BUFFER ) { |
945 | yyensure_buffer_stack (); | 779 | yyensure_buffer_stack (); |
@@ -952,7 +786,6 @@ YY_DECL | |||
952 | 786 | ||
953 | while ( 1 ) /* loops until end-of-file is reached */ | 787 | while ( 1 ) /* loops until end-of-file is reached */ |
954 | { | 788 | { |
955 | /* %% [8.0] yymore()-related code goes here */ | ||
956 | yy_cp = (yy_c_buf_p); | 789 | yy_cp = (yy_c_buf_p); |
957 | 790 | ||
958 | /* Support of yytext. */ | 791 | /* Support of yytext. */ |
@@ -963,7 +796,6 @@ YY_DECL | |||
963 | */ | 796 | */ |
964 | yy_bp = yy_cp; | 797 | yy_bp = yy_cp; |
965 | 798 | ||
966 | /* %% [9.0] code to set up and find next match goes here */ | ||
967 | yy_current_state = (yy_start); | 799 | yy_current_state = (yy_start); |
968 | yy_current_state += YY_AT_BOL(); | 800 | yy_current_state += YY_AT_BOL(); |
969 | yy_match: | 801 | yy_match: |
@@ -987,7 +819,6 @@ yy_match: | |||
987 | while ( yy_base[yy_current_state] != 266 ); | 819 | while ( yy_base[yy_current_state] != 266 ); |
988 | 820 | ||
989 | yy_find_action: | 821 | yy_find_action: |
990 | /* %% [10.0] code to find the action number goes here */ | ||
991 | yy_act = yy_accept[yy_current_state]; | 822 | yy_act = yy_accept[yy_current_state]; |
992 | if ( yy_act == 0 ) | 823 | if ( yy_act == 0 ) |
993 | { /* have to back up */ | 824 | { /* have to back up */ |
@@ -998,30 +829,10 @@ yy_find_action: | |||
998 | 829 | ||
999 | YY_DO_BEFORE_ACTION; | 830 | YY_DO_BEFORE_ACTION; |
1000 | 831 | ||
1001 | /* %% [11.0] code for yylineno update goes here */ | ||
1002 | |||
1003 | do_action: /* This label is used only to access EOF actions. */ | 832 | do_action: /* This label is used only to access EOF actions. */ |
1004 | 833 | ||
1005 | /* %% [12.0] debug code goes here */ | ||
1006 | if ( yy_flex_debug ) | ||
1007 | { | ||
1008 | if ( yy_act == 0 ) | ||
1009 | fprintf( stderr, "--scanner backing up\n" ); | ||
1010 | else if ( yy_act < 13 ) | ||
1011 | fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n", | ||
1012 | (long)yy_rule_linenum[yy_act], yytext ); | ||
1013 | else if ( yy_act == 13 ) | ||
1014 | fprintf( stderr, "--accepting default rule (\"%s\")\n", | ||
1015 | yytext ); | ||
1016 | else if ( yy_act == 14 ) | ||
1017 | fprintf( stderr, "--(end of buffer or a NUL)\n" ); | ||
1018 | else | ||
1019 | fprintf( stderr, "--EOF (start condition %d)\n", YY_START ); | ||
1020 | } | ||
1021 | |||
1022 | switch ( yy_act ) | 834 | switch ( yy_act ) |
1023 | { /* beginning of action switch */ | 835 | { /* beginning of action switch */ |
1024 | /* %% [13.0] actions go here */ | ||
1025 | case 0: /* must back up */ | 836 | case 0: /* must back up */ |
1026 | /* undo the effects of YY_DO_BEFORE_ACTION */ | 837 | /* undo the effects of YY_DO_BEFORE_ACTION */ |
1027 | *yy_cp = (yy_hold_char); | 838 | *yy_cp = (yy_hold_char); |
@@ -1032,42 +843,35 @@ do_action: /* This label is used only to access EOF actions. */ | |||
1032 | case 1: | 843 | case 1: |
1033 | /* rule 1 can match eol */ | 844 | /* rule 1 can match eol */ |
1034 | YY_RULE_SETUP | 845 | YY_RULE_SETUP |
1035 | #line 67 "scripts/genksyms/lex.l" | ||
1036 | return FILENAME; | 846 | return FILENAME; |
1037 | YY_BREAK | 847 | YY_BREAK |
1038 | case 2: | 848 | case 2: |
1039 | /* rule 2 can match eol */ | 849 | /* rule 2 can match eol */ |
1040 | YY_RULE_SETUP | 850 | YY_RULE_SETUP |
1041 | #line 68 "scripts/genksyms/lex.l" | ||
1042 | cur_line++; | 851 | cur_line++; |
1043 | YY_BREAK | 852 | YY_BREAK |
1044 | case 3: | 853 | case 3: |
1045 | /* rule 3 can match eol */ | 854 | /* rule 3 can match eol */ |
1046 | YY_RULE_SETUP | 855 | YY_RULE_SETUP |
1047 | #line 69 "scripts/genksyms/lex.l" | ||
1048 | cur_line++; | 856 | cur_line++; |
1049 | YY_BREAK | 857 | YY_BREAK |
1050 | /* Ignore all other whitespace. */ | 858 | /* Ignore all other whitespace. */ |
1051 | case 4: | 859 | case 4: |
1052 | YY_RULE_SETUP | 860 | YY_RULE_SETUP |
1053 | #line 72 "scripts/genksyms/lex.l" | ||
1054 | ; | 861 | ; |
1055 | YY_BREAK | 862 | YY_BREAK |
1056 | case 5: | 863 | case 5: |
1057 | /* rule 5 can match eol */ | 864 | /* rule 5 can match eol */ |
1058 | YY_RULE_SETUP | 865 | YY_RULE_SETUP |
1059 | #line 75 "scripts/genksyms/lex.l" | ||
1060 | return STRING; | 866 | return STRING; |
1061 | YY_BREAK | 867 | YY_BREAK |
1062 | case 6: | 868 | case 6: |
1063 | /* rule 6 can match eol */ | 869 | /* rule 6 can match eol */ |
1064 | YY_RULE_SETUP | 870 | YY_RULE_SETUP |
1065 | #line 76 "scripts/genksyms/lex.l" | ||
1066 | return CHAR; | 871 | return CHAR; |
1067 | YY_BREAK | 872 | YY_BREAK |
1068 | case 7: | 873 | case 7: |
1069 | YY_RULE_SETUP | 874 | YY_RULE_SETUP |
1070 | #line 77 "scripts/genksyms/lex.l" | ||
1071 | return IDENT; | 875 | return IDENT; |
1072 | YY_BREAK | 876 | YY_BREAK |
1073 | /* The Pedant requires that the other C multi-character tokens be | 877 | /* The Pedant requires that the other C multi-character tokens be |
@@ -1076,36 +880,29 @@ return IDENT; | |||
1076 | around them properly. */ | 880 | around them properly. */ |
1077 | case 8: | 881 | case 8: |
1078 | YY_RULE_SETUP | 882 | YY_RULE_SETUP |
1079 | #line 83 "scripts/genksyms/lex.l" | ||
1080 | return OTHER; | 883 | return OTHER; |
1081 | YY_BREAK | 884 | YY_BREAK |
1082 | case 9: | 885 | case 9: |
1083 | YY_RULE_SETUP | 886 | YY_RULE_SETUP |
1084 | #line 84 "scripts/genksyms/lex.l" | ||
1085 | return INT; | 887 | return INT; |
1086 | YY_BREAK | 888 | YY_BREAK |
1087 | case 10: | 889 | case 10: |
1088 | YY_RULE_SETUP | 890 | YY_RULE_SETUP |
1089 | #line 85 "scripts/genksyms/lex.l" | ||
1090 | return REAL; | 891 | return REAL; |
1091 | YY_BREAK | 892 | YY_BREAK |
1092 | case 11: | 893 | case 11: |
1093 | YY_RULE_SETUP | 894 | YY_RULE_SETUP |
1094 | #line 87 "scripts/genksyms/lex.l" | ||
1095 | return DOTS; | 895 | return DOTS; |
1096 | YY_BREAK | 896 | YY_BREAK |
1097 | /* All other tokens are single characters. */ | 897 | /* All other tokens are single characters. */ |
1098 | case 12: | 898 | case 12: |
1099 | YY_RULE_SETUP | 899 | YY_RULE_SETUP |
1100 | #line 90 "scripts/genksyms/lex.l" | ||
1101 | return yytext[0]; | 900 | return yytext[0]; |
1102 | YY_BREAK | 901 | YY_BREAK |
1103 | case 13: | 902 | case 13: |
1104 | YY_RULE_SETUP | 903 | YY_RULE_SETUP |
1105 | #line 93 "scripts/genksyms/lex.l" | ||
1106 | ECHO; | 904 | ECHO; |
1107 | YY_BREAK | 905 | YY_BREAK |
1108 | #line 1109 "scripts/genksyms/lex.c" | ||
1109 | case YY_STATE_EOF(INITIAL): | 906 | case YY_STATE_EOF(INITIAL): |
1110 | yyterminate(); | 907 | yyterminate(); |
1111 | 908 | ||
@@ -1172,7 +969,6 @@ case YY_STATE_EOF(INITIAL): | |||
1172 | 969 | ||
1173 | else | 970 | else |
1174 | { | 971 | { |
1175 | /* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */ | ||
1176 | yy_cp = (yy_c_buf_p); | 972 | yy_cp = (yy_c_buf_p); |
1177 | goto yy_find_action; | 973 | goto yy_find_action; |
1178 | } | 974 | } |
@@ -1238,14 +1034,6 @@ case YY_STATE_EOF(INITIAL): | |||
1238 | } /* end of action switch */ | 1034 | } /* end of action switch */ |
1239 | } /* end of scanning one token */ | 1035 | } /* end of scanning one token */ |
1240 | } /* end of yylex */ | 1036 | } /* end of yylex */ |
1241 | /* %ok-for-header */ | ||
1242 | |||
1243 | /* %if-c++-only */ | ||
1244 | /* %not-for-header */ | ||
1245 | |||
1246 | /* %ok-for-header */ | ||
1247 | |||
1248 | /* %endif */ | ||
1249 | 1037 | ||
1250 | /* yy_get_next_buffer - try to read in a new buffer | 1038 | /* yy_get_next_buffer - try to read in a new buffer |
1251 | * | 1039 | * |
@@ -1254,11 +1042,7 @@ case YY_STATE_EOF(INITIAL): | |||
1254 | * EOB_ACT_CONTINUE_SCAN - continue scanning from current position | 1042 | * EOB_ACT_CONTINUE_SCAN - continue scanning from current position |
1255 | * EOB_ACT_END_OF_FILE - end of file | 1043 | * EOB_ACT_END_OF_FILE - end of file |
1256 | */ | 1044 | */ |
1257 | /* %if-c-only */ | ||
1258 | static int yy_get_next_buffer (void) | 1045 | static int yy_get_next_buffer (void) |
1259 | /* %endif */ | ||
1260 | /* %if-c++-only */ | ||
1261 | /* %endif */ | ||
1262 | { | 1046 | { |
1263 | register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; | 1047 | register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; |
1264 | register char *source = (yytext_ptr); | 1048 | register char *source = (yytext_ptr); |
@@ -1392,24 +1176,16 @@ static int yy_get_next_buffer (void) | |||
1392 | 1176 | ||
1393 | /* yy_get_previous_state - get the state just before the EOB char was reached */ | 1177 | /* yy_get_previous_state - get the state just before the EOB char was reached */ |
1394 | 1178 | ||
1395 | /* %if-c-only */ | ||
1396 | /* %not-for-header */ | ||
1397 | |||
1398 | static yy_state_type yy_get_previous_state (void) | 1179 | static yy_state_type yy_get_previous_state (void) |
1399 | /* %endif */ | ||
1400 | /* %if-c++-only */ | ||
1401 | /* %endif */ | ||
1402 | { | 1180 | { |
1403 | register yy_state_type yy_current_state; | 1181 | register yy_state_type yy_current_state; |
1404 | register char *yy_cp; | 1182 | register char *yy_cp; |
1405 | 1183 | ||
1406 | /* %% [15.0] code to get the start state into yy_current_state goes here */ | ||
1407 | yy_current_state = (yy_start); | 1184 | yy_current_state = (yy_start); |
1408 | yy_current_state += YY_AT_BOL(); | 1185 | yy_current_state += YY_AT_BOL(); |
1409 | 1186 | ||
1410 | for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) | 1187 | for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) |
1411 | { | 1188 | { |
1412 | /* %% [16.0] code to find the next state goes here */ | ||
1413 | register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); | 1189 | register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); |
1414 | if ( yy_accept[yy_current_state] ) | 1190 | if ( yy_accept[yy_current_state] ) |
1415 | { | 1191 | { |
@@ -1433,15 +1209,10 @@ static int yy_get_next_buffer (void) | |||
1433 | * synopsis | 1209 | * synopsis |
1434 | * next_state = yy_try_NUL_trans( current_state ); | 1210 | * next_state = yy_try_NUL_trans( current_state ); |
1435 | */ | 1211 | */ |
1436 | /* %if-c-only */ | ||
1437 | static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) | 1212 | static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) |
1438 | /* %endif */ | ||
1439 | /* %if-c++-only */ | ||
1440 | /* %endif */ | ||
1441 | { | 1213 | { |
1442 | register int yy_is_jam; | 1214 | register int yy_is_jam; |
1443 | /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */ | 1215 | register char *yy_cp = (yy_c_buf_p); |
1444 | register char *yy_cp = (yy_c_buf_p); | ||
1445 | 1216 | ||
1446 | register YY_CHAR yy_c = 1; | 1217 | register YY_CHAR yy_c = 1; |
1447 | if ( yy_accept[yy_current_state] ) | 1218 | if ( yy_accept[yy_current_state] ) |
@@ -1461,12 +1232,7 @@ static int yy_get_next_buffer (void) | |||
1461 | return yy_is_jam ? 0 : yy_current_state; | 1232 | return yy_is_jam ? 0 : yy_current_state; |
1462 | } | 1233 | } |
1463 | 1234 | ||
1464 | /* %if-c-only */ | ||
1465 | |||
1466 | static void yyunput (int c, register char * yy_bp ) | 1235 | static void yyunput (int c, register char * yy_bp ) |
1467 | /* %endif */ | ||
1468 | /* %if-c++-only */ | ||
1469 | /* %endif */ | ||
1470 | { | 1236 | { |
1471 | register char *yy_cp; | 1237 | register char *yy_cp; |
1472 | 1238 | ||
@@ -1498,17 +1264,11 @@ static int yy_get_next_buffer (void) | |||
1498 | 1264 | ||
1499 | *--yy_cp = (char) c; | 1265 | *--yy_cp = (char) c; |
1500 | 1266 | ||
1501 | /* %% [18.0] update yylineno here */ | ||
1502 | |||
1503 | (yytext_ptr) = yy_bp; | 1267 | (yytext_ptr) = yy_bp; |
1504 | (yy_hold_char) = *yy_cp; | 1268 | (yy_hold_char) = *yy_cp; |
1505 | (yy_c_buf_p) = yy_cp; | 1269 | (yy_c_buf_p) = yy_cp; |
1506 | } | 1270 | } |
1507 | /* %if-c-only */ | ||
1508 | |||
1509 | /* %endif */ | ||
1510 | 1271 | ||
1511 | /* %if-c-only */ | ||
1512 | #ifndef YY_NO_INPUT | 1272 | #ifndef YY_NO_INPUT |
1513 | #ifdef __cplusplus | 1273 | #ifdef __cplusplus |
1514 | static int yyinput (void) | 1274 | static int yyinput (void) |
@@ -1516,9 +1276,6 @@ static int yy_get_next_buffer (void) | |||
1516 | static int input (void) | 1276 | static int input (void) |
1517 | #endif | 1277 | #endif |
1518 | 1278 | ||
1519 | /* %endif */ | ||
1520 | /* %if-c++-only */ | ||
1521 | /* %endif */ | ||
1522 | { | 1279 | { |
1523 | int c; | 1280 | int c; |
1524 | 1281 | ||
@@ -1582,25 +1339,18 @@ static int yy_get_next_buffer (void) | |||
1582 | *(yy_c_buf_p) = '\0'; /* preserve yytext */ | 1339 | *(yy_c_buf_p) = '\0'; /* preserve yytext */ |
1583 | (yy_hold_char) = *++(yy_c_buf_p); | 1340 | (yy_hold_char) = *++(yy_c_buf_p); |
1584 | 1341 | ||
1585 | /* %% [19.0] update BOL and yylineno */ | ||
1586 | YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); | 1342 | YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); |
1587 | 1343 | ||
1588 | return c; | 1344 | return c; |
1589 | } | 1345 | } |
1590 | /* %if-c-only */ | ||
1591 | #endif /* ifndef YY_NO_INPUT */ | 1346 | #endif /* ifndef YY_NO_INPUT */ |
1592 | /* %endif */ | ||
1593 | 1347 | ||
1594 | /** Immediately switch to a different input stream. | 1348 | /** Immediately switch to a different input stream. |
1595 | * @param input_file A readable stream. | 1349 | * @param input_file A readable stream. |
1596 | * | 1350 | * |
1597 | * @note This function does not reset the start condition to @c INITIAL . | 1351 | * @note This function does not reset the start condition to @c INITIAL . |
1598 | */ | 1352 | */ |
1599 | /* %if-c-only */ | ||
1600 | void yyrestart (FILE * input_file ) | 1353 | void yyrestart (FILE * input_file ) |
1601 | /* %endif */ | ||
1602 | /* %if-c++-only */ | ||
1603 | /* %endif */ | ||
1604 | { | 1354 | { |
1605 | 1355 | ||
1606 | if ( ! YY_CURRENT_BUFFER ){ | 1356 | if ( ! YY_CURRENT_BUFFER ){ |
@@ -1617,11 +1367,7 @@ static int yy_get_next_buffer (void) | |||
1617 | * @param new_buffer The new input buffer. | 1367 | * @param new_buffer The new input buffer. |
1618 | * | 1368 | * |
1619 | */ | 1369 | */ |
1620 | /* %if-c-only */ | ||
1621 | void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) | 1370 | void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) |
1622 | /* %endif */ | ||
1623 | /* %if-c++-only */ | ||
1624 | /* %endif */ | ||
1625 | { | 1371 | { |
1626 | 1372 | ||
1627 | /* TODO. We should be able to replace this entire function body | 1373 | /* TODO. We should be able to replace this entire function body |
@@ -1652,11 +1398,7 @@ static int yy_get_next_buffer (void) | |||
1652 | (yy_did_buffer_switch_on_eof) = 1; | 1398 | (yy_did_buffer_switch_on_eof) = 1; |
1653 | } | 1399 | } |
1654 | 1400 | ||
1655 | /* %if-c-only */ | ||
1656 | static void yy_load_buffer_state (void) | 1401 | static void yy_load_buffer_state (void) |
1657 | /* %endif */ | ||
1658 | /* %if-c++-only */ | ||
1659 | /* %endif */ | ||
1660 | { | 1402 | { |
1661 | (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; | 1403 | (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; |
1662 | (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; | 1404 | (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; |
@@ -1670,11 +1412,7 @@ static void yy_load_buffer_state (void) | |||
1670 | * | 1412 | * |
1671 | * @return the allocated buffer state. | 1413 | * @return the allocated buffer state. |
1672 | */ | 1414 | */ |
1673 | /* %if-c-only */ | ||
1674 | YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) | 1415 | YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) |
1675 | /* %endif */ | ||
1676 | /* %if-c++-only */ | ||
1677 | /* %endif */ | ||
1678 | { | 1416 | { |
1679 | YY_BUFFER_STATE b; | 1417 | YY_BUFFER_STATE b; |
1680 | 1418 | ||
@@ -1702,11 +1440,7 @@ static void yy_load_buffer_state (void) | |||
1702 | * @param b a buffer created with yy_create_buffer() | 1440 | * @param b a buffer created with yy_create_buffer() |
1703 | * | 1441 | * |
1704 | */ | 1442 | */ |
1705 | /* %if-c-only */ | ||
1706 | void yy_delete_buffer (YY_BUFFER_STATE b ) | 1443 | void yy_delete_buffer (YY_BUFFER_STATE b ) |
1707 | /* %endif */ | ||
1708 | /* %if-c++-only */ | ||
1709 | /* %endif */ | ||
1710 | { | 1444 | { |
1711 | 1445 | ||
1712 | if ( ! b ) | 1446 | if ( ! b ) |
@@ -1721,26 +1455,15 @@ static void yy_load_buffer_state (void) | |||
1721 | yyfree((void *) b ); | 1455 | yyfree((void *) b ); |
1722 | } | 1456 | } |
1723 | 1457 | ||
1724 | /* %if-c-only */ | ||
1725 | |||
1726 | #ifndef __cplusplus | 1458 | #ifndef __cplusplus |
1727 | extern int isatty (int ); | 1459 | extern int isatty (int ); |
1728 | #endif /* __cplusplus */ | 1460 | #endif /* __cplusplus */ |
1729 | 1461 | ||
1730 | /* %endif */ | ||
1731 | |||
1732 | /* %if-c++-only */ | ||
1733 | /* %endif */ | ||
1734 | |||
1735 | /* Initializes or reinitializes a buffer. | 1462 | /* Initializes or reinitializes a buffer. |
1736 | * This function is sometimes called more than once on the same buffer, | 1463 | * This function is sometimes called more than once on the same buffer, |
1737 | * such as during a yyrestart() or at EOF. | 1464 | * such as during a yyrestart() or at EOF. |
1738 | */ | 1465 | */ |
1739 | /* %if-c-only */ | ||
1740 | static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) | 1466 | static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) |
1741 | /* %endif */ | ||
1742 | /* %if-c++-only */ | ||
1743 | /* %endif */ | ||
1744 | 1467 | ||
1745 | { | 1468 | { |
1746 | int oerrno = errno; | 1469 | int oerrno = errno; |
@@ -1759,13 +1482,8 @@ extern int isatty (int ); | |||
1759 | b->yy_bs_column = 0; | 1482 | b->yy_bs_column = 0; |
1760 | } | 1483 | } |
1761 | 1484 | ||
1762 | /* %if-c-only */ | ||
1763 | |||
1764 | b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; | 1485 | b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; |
1765 | 1486 | ||
1766 | /* %endif */ | ||
1767 | /* %if-c++-only */ | ||
1768 | /* %endif */ | ||
1769 | errno = oerrno; | 1487 | errno = oerrno; |
1770 | } | 1488 | } |
1771 | 1489 | ||
@@ -1773,11 +1491,7 @@ extern int isatty (int ); | |||
1773 | * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. | 1491 | * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. |
1774 | * | 1492 | * |
1775 | */ | 1493 | */ |
1776 | /* %if-c-only */ | ||
1777 | void yy_flush_buffer (YY_BUFFER_STATE b ) | 1494 | void yy_flush_buffer (YY_BUFFER_STATE b ) |
1778 | /* %endif */ | ||
1779 | /* %if-c++-only */ | ||
1780 | /* %endif */ | ||
1781 | { | 1495 | { |
1782 | if ( ! b ) | 1496 | if ( ! b ) |
1783 | return; | 1497 | return; |
@@ -1800,18 +1514,13 @@ extern int isatty (int ); | |||
1800 | yy_load_buffer_state( ); | 1514 | yy_load_buffer_state( ); |
1801 | } | 1515 | } |
1802 | 1516 | ||
1803 | /* %if-c-or-c++ */ | ||
1804 | /** Pushes the new state onto the stack. The new state becomes | 1517 | /** Pushes the new state onto the stack. The new state becomes |
1805 | * the current state. This function will allocate the stack | 1518 | * the current state. This function will allocate the stack |
1806 | * if necessary. | 1519 | * if necessary. |
1807 | * @param new_buffer The new state. | 1520 | * @param new_buffer The new state. |
1808 | * | 1521 | * |
1809 | */ | 1522 | */ |
1810 | /* %if-c-only */ | ||
1811 | void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) | 1523 | void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) |
1812 | /* %endif */ | ||
1813 | /* %if-c++-only */ | ||
1814 | /* %endif */ | ||
1815 | { | 1524 | { |
1816 | if (new_buffer == NULL) | 1525 | if (new_buffer == NULL) |
1817 | return; | 1526 | return; |
@@ -1836,18 +1545,12 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) | |||
1836 | yy_load_buffer_state( ); | 1545 | yy_load_buffer_state( ); |
1837 | (yy_did_buffer_switch_on_eof) = 1; | 1546 | (yy_did_buffer_switch_on_eof) = 1; |
1838 | } | 1547 | } |
1839 | /* %endif */ | ||
1840 | 1548 | ||
1841 | /* %if-c-or-c++ */ | ||
1842 | /** Removes and deletes the top of the stack, if present. | 1549 | /** Removes and deletes the top of the stack, if present. |
1843 | * The next element becomes the new top. | 1550 | * The next element becomes the new top. |
1844 | * | 1551 | * |
1845 | */ | 1552 | */ |
1846 | /* %if-c-only */ | ||
1847 | void yypop_buffer_state (void) | 1553 | void yypop_buffer_state (void) |
1848 | /* %endif */ | ||
1849 | /* %if-c++-only */ | ||
1850 | /* %endif */ | ||
1851 | { | 1554 | { |
1852 | if (!YY_CURRENT_BUFFER) | 1555 | if (!YY_CURRENT_BUFFER) |
1853 | return; | 1556 | return; |
@@ -1862,17 +1565,11 @@ void yypop_buffer_state (void) | |||
1862 | (yy_did_buffer_switch_on_eof) = 1; | 1565 | (yy_did_buffer_switch_on_eof) = 1; |
1863 | } | 1566 | } |
1864 | } | 1567 | } |
1865 | /* %endif */ | ||
1866 | 1568 | ||
1867 | /* %if-c-or-c++ */ | ||
1868 | /* Allocates the stack if it does not exist. | 1569 | /* Allocates the stack if it does not exist. |
1869 | * Guarantees space for at least one push. | 1570 | * Guarantees space for at least one push. |
1870 | */ | 1571 | */ |
1871 | /* %if-c-only */ | ||
1872 | static void yyensure_buffer_stack (void) | 1572 | static void yyensure_buffer_stack (void) |
1873 | /* %endif */ | ||
1874 | /* %if-c++-only */ | ||
1875 | /* %endif */ | ||
1876 | { | 1573 | { |
1877 | int num_to_alloc; | 1574 | int num_to_alloc; |
1878 | 1575 | ||
@@ -1914,9 +1611,7 @@ static void yyensure_buffer_stack (void) | |||
1914 | (yy_buffer_stack_max) = num_to_alloc; | 1611 | (yy_buffer_stack_max) = num_to_alloc; |
1915 | } | 1612 | } |
1916 | } | 1613 | } |
1917 | /* %endif */ | ||
1918 | 1614 | ||
1919 | /* %if-c-only */ | ||
1920 | /** Setup the input buffer state to scan directly from a user-specified character buffer. | 1615 | /** Setup the input buffer state to scan directly from a user-specified character buffer. |
1921 | * @param base the character buffer | 1616 | * @param base the character buffer |
1922 | * @param size the size in bytes of the character buffer | 1617 | * @param size the size in bytes of the character buffer |
@@ -1951,9 +1646,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) | |||
1951 | 1646 | ||
1952 | return b; | 1647 | return b; |
1953 | } | 1648 | } |
1954 | /* %endif */ | ||
1955 | 1649 | ||
1956 | /* %if-c-only */ | ||
1957 | /** Setup the input buffer state to scan a string. The next call to yylex() will | 1650 | /** Setup the input buffer state to scan a string. The next call to yylex() will |
1958 | * scan from a @e copy of @a str. | 1651 | * scan from a @e copy of @a str. |
1959 | * @param yystr a NUL-terminated string to scan | 1652 | * @param yystr a NUL-terminated string to scan |
@@ -1967,9 +1660,7 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) | |||
1967 | 1660 | ||
1968 | return yy_scan_bytes(yystr,strlen(yystr) ); | 1661 | return yy_scan_bytes(yystr,strlen(yystr) ); |
1969 | } | 1662 | } |
1970 | /* %endif */ | ||
1971 | 1663 | ||
1972 | /* %if-c-only */ | ||
1973 | /** Setup the input buffer state to scan the given bytes. The next call to yylex() will | 1664 | /** Setup the input buffer state to scan the given bytes. The next call to yylex() will |
1974 | * scan from a @e copy of @a bytes. | 1665 | * scan from a @e copy of @a bytes. |
1975 | * @param bytes the byte buffer to scan | 1666 | * @param bytes the byte buffer to scan |
@@ -2006,21 +1697,16 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) | |||
2006 | 1697 | ||
2007 | return b; | 1698 | return b; |
2008 | } | 1699 | } |
2009 | /* %endif */ | ||
2010 | 1700 | ||
2011 | #ifndef YY_EXIT_FAILURE | 1701 | #ifndef YY_EXIT_FAILURE |
2012 | #define YY_EXIT_FAILURE 2 | 1702 | #define YY_EXIT_FAILURE 2 |
2013 | #endif | 1703 | #endif |
2014 | 1704 | ||
2015 | /* %if-c-only */ | ||
2016 | static void yy_fatal_error (yyconst char* msg ) | 1705 | static void yy_fatal_error (yyconst char* msg ) |
2017 | { | 1706 | { |
2018 | (void) fprintf( stderr, "%s\n", msg ); | 1707 | (void) fprintf( stderr, "%s\n", msg ); |
2019 | exit( YY_EXIT_FAILURE ); | 1708 | exit( YY_EXIT_FAILURE ); |
2020 | } | 1709 | } |
2021 | /* %endif */ | ||
2022 | /* %if-c++-only */ | ||
2023 | /* %endif */ | ||
2024 | 1710 | ||
2025 | /* Redefine yyless() so it works in section 3 code. */ | 1711 | /* Redefine yyless() so it works in section 3 code. */ |
2026 | 1712 | ||
@@ -2041,10 +1727,6 @@ static void yy_fatal_error (yyconst char* msg ) | |||
2041 | 1727 | ||
2042 | /* Accessor methods (get/set functions) to struct members. */ | 1728 | /* Accessor methods (get/set functions) to struct members. */ |
2043 | 1729 | ||
2044 | /* %if-c-only */ | ||
2045 | /* %if-reentrant */ | ||
2046 | /* %endif */ | ||
2047 | |||
2048 | /** Get the current line number. | 1730 | /** Get the current line number. |
2049 | * | 1731 | * |
2050 | */ | 1732 | */ |
@@ -2087,9 +1769,6 @@ char *yyget_text (void) | |||
2087 | return yytext; | 1769 | return yytext; |
2088 | } | 1770 | } |
2089 | 1771 | ||
2090 | /* %if-reentrant */ | ||
2091 | /* %endif */ | ||
2092 | |||
2093 | /** Set the current line number. | 1772 | /** Set the current line number. |
2094 | * @param line_number | 1773 | * @param line_number |
2095 | * | 1774 | * |
@@ -2126,14 +1805,6 @@ void yyset_debug (int bdebug ) | |||
2126 | yy_flex_debug = bdebug ; | 1805 | yy_flex_debug = bdebug ; |
2127 | } | 1806 | } |
2128 | 1807 | ||
2129 | /* %endif */ | ||
2130 | |||
2131 | /* %if-reentrant */ | ||
2132 | /* %if-bison-bridge */ | ||
2133 | /* %endif */ | ||
2134 | /* %endif if-c-only */ | ||
2135 | |||
2136 | /* %if-c-only */ | ||
2137 | static int yy_init_globals (void) | 1808 | static int yy_init_globals (void) |
2138 | { | 1809 | { |
2139 | /* Initialization is the same as for the non-reentrant scanner. | 1810 | /* Initialization is the same as for the non-reentrant scanner. |
@@ -2161,9 +1832,7 @@ static int yy_init_globals (void) | |||
2161 | */ | 1832 | */ |
2162 | return 0; | 1833 | return 0; |
2163 | } | 1834 | } |
2164 | /* %endif */ | ||
2165 | 1835 | ||
2166 | /* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */ | ||
2167 | /* yylex_destroy is for both reentrant and non-reentrant scanners. */ | 1836 | /* yylex_destroy is for both reentrant and non-reentrant scanners. */ |
2168 | int yylex_destroy (void) | 1837 | int yylex_destroy (void) |
2169 | { | 1838 | { |
@@ -2183,11 +1852,8 @@ int yylex_destroy (void) | |||
2183 | * yylex() is called, initialization will occur. */ | 1852 | * yylex() is called, initialization will occur. */ |
2184 | yy_init_globals( ); | 1853 | yy_init_globals( ); |
2185 | 1854 | ||
2186 | /* %if-reentrant */ | ||
2187 | /* %endif */ | ||
2188 | return 0; | 1855 | return 0; |
2189 | } | 1856 | } |
2190 | /* %endif */ | ||
2191 | 1857 | ||
2192 | /* | 1858 | /* |
2193 | * Internal utility routines. | 1859 | * Internal utility routines. |
@@ -2235,21 +1901,11 @@ void yyfree (void * ptr ) | |||
2235 | free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ | 1901 | free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ |
2236 | } | 1902 | } |
2237 | 1903 | ||
2238 | /* %if-tables-serialization definitions */ | ||
2239 | /* %define-yytables The name for this specific scanner's tables. */ | ||
2240 | #define YYTABLES_NAME "yytables" | 1904 | #define YYTABLES_NAME "yytables" |
2241 | /* %endif */ | ||
2242 | |||
2243 | /* %ok-for-header */ | ||
2244 | |||
2245 | #line 93 "scripts/genksyms/lex.l" | ||
2246 | |||
2247 | |||
2248 | 1905 | ||
2249 | /* Bring in the keyword recognizer. */ | 1906 | /* Bring in the keyword recognizer. */ |
2250 | 1907 | ||
2251 | #include "keywords.c" | 1908 | #include "keywords.hash.c" |
2252 | |||
2253 | 1909 | ||
2254 | /* Macros to append to our phrase collection list. */ | 1910 | /* Macros to append to our phrase collection list. */ |
2255 | 1911 | ||
@@ -2270,11 +1926,11 @@ void yyfree (void * ptr ) | |||
2270 | cur_node->tag = \ | 1926 | cur_node->tag = \ |
2271 | find_symbol(cur_node->string, SYM_ENUM_CONST, 1)?\ | 1927 | find_symbol(cur_node->string, SYM_ENUM_CONST, 1)?\ |
2272 | SYM_ENUM_CONST : SYM_NORMAL ; \ | 1928 | SYM_ENUM_CONST : SYM_NORMAL ; \ |
1929 | cur_node->in_source_file = in_source_file; \ | ||
2273 | } while (0) | 1930 | } while (0) |
2274 | 1931 | ||
2275 | #define APP _APP(yytext, yyleng) | 1932 | #define APP _APP(yytext, yyleng) |
2276 | 1933 | ||
2277 | |||
2278 | /* The second stage lexer. Here we incorporate knowledge of the state | 1934 | /* The second stage lexer. Here we incorporate knowledge of the state |
2279 | of the parser to tailor the tokens that are returned. */ | 1935 | of the parser to tailor the tokens that are returned. */ |
2280 | 1936 | ||
@@ -2320,6 +1976,13 @@ repeat: | |||
2320 | cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1); | 1976 | cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1); |
2321 | cur_line = atoi(yytext+2); | 1977 | cur_line = atoi(yytext+2); |
2322 | 1978 | ||
1979 | if (!source_file) { | ||
1980 | source_file = xstrdup(cur_filename); | ||
1981 | in_source_file = 1; | ||
1982 | } else { | ||
1983 | in_source_file = (strcmp(cur_filename, source_file) == 0); | ||
1984 | } | ||
1985 | |||
2323 | goto repeat; | 1986 | goto repeat; |
2324 | } | 1987 | } |
2325 | 1988 | ||
diff --git a/scripts/genksyms/parse.c_shipped b/scripts/genksyms/parse.tab.c_shipped index 1a0b8607fb0..ece53c79bb5 100644 --- a/scripts/genksyms/parse.c_shipped +++ b/scripts/genksyms/parse.tab.c_shipped | |||
@@ -1,10 +1,8 @@ | |||
1 | /* A Bison parser, made by GNU Bison 2.5. */ | ||
1 | 2 | ||
2 | /* A Bison parser, made by GNU Bison 2.4.1. */ | 3 | /* Bison implementation for Yacc-like parsers in C |
3 | |||
4 | /* Skeleton implementation for Bison's Yacc-like parsers in C | ||
5 | 4 | ||
6 | Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 | 5 | Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. |
7 | Free Software Foundation, Inc. | ||
8 | 6 | ||
9 | This program is free software: you can redistribute it and/or modify | 7 | This program is free software: you can redistribute it and/or modify |
10 | it under the terms of the GNU General Public License as published by | 8 | it under the terms of the GNU General Public License as published by |
@@ -46,7 +44,7 @@ | |||
46 | #define YYBISON 1 | 44 | #define YYBISON 1 |
47 | 45 | ||
48 | /* Bison version. */ | 46 | /* Bison version. */ |
49 | #define YYBISON_VERSION "2.4.1" | 47 | #define YYBISON_VERSION "2.5" |
50 | 48 | ||
51 | /* Skeleton name. */ | 49 | /* Skeleton name. */ |
52 | #define YYSKELETON_NAME "yacc.c" | 50 | #define YYSKELETON_NAME "yacc.c" |
@@ -67,8 +65,6 @@ | |||
67 | 65 | ||
68 | /* Copy the first part of user declarations. */ | 66 | /* Copy the first part of user declarations. */ |
69 | 67 | ||
70 | /* Line 189 of yacc.c */ | ||
71 | #line 24 "scripts/genksyms/parse.y" | ||
72 | 68 | ||
73 | 69 | ||
74 | #include <assert.h> | 70 | #include <assert.h> |
@@ -99,10 +95,27 @@ remove_list(struct string_list **pb, struct string_list **pe) | |||
99 | free_list(b, e); | 95 | free_list(b, e); |
100 | } | 96 | } |
101 | 97 | ||
98 | /* Record definition of a struct/union/enum */ | ||
99 | static void record_compound(struct string_list **keyw, | ||
100 | struct string_list **ident, | ||
101 | struct string_list **body, | ||
102 | enum symbol_type type) | ||
103 | { | ||
104 | struct string_list *b = *body, *i = *ident, *r; | ||
105 | |||
106 | if (i->in_source_file) { | ||
107 | remove_node(keyw); | ||
108 | (*ident)->tag = type; | ||
109 | remove_list(body, ident); | ||
110 | return; | ||
111 | } | ||
112 | r = copy_node(i); r->tag = type; | ||
113 | r->next = (*keyw)->next; *body = r; (*keyw)->next = NULL; | ||
114 | add_symbol(i->string, type, b, is_extern); | ||
115 | } | ||
116 | |||
102 | 117 | ||
103 | 118 | ||
104 | /* Line 189 of yacc.c */ | ||
105 | #line 106 "scripts/genksyms/parse.c" | ||
106 | 119 | ||
107 | /* Enabling traces. */ | 120 | /* Enabling traces. */ |
108 | #ifndef YYDEBUG | 121 | #ifndef YYDEBUG |
@@ -186,8 +199,6 @@ typedef int YYSTYPE; | |||
186 | /* Copy the second part of user declarations. */ | 199 | /* Copy the second part of user declarations. */ |
187 | 200 | ||
188 | 201 | ||
189 | /* Line 264 of yacc.c */ | ||
190 | #line 191 "scripts/genksyms/parse.c" | ||
191 | 202 | ||
192 | #ifdef short | 203 | #ifdef short |
193 | # undef short | 204 | # undef short |
@@ -237,7 +248,7 @@ typedef short int yytype_int16; | |||
237 | #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) | 248 | #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) |
238 | 249 | ||
239 | #ifndef YY_ | 250 | #ifndef YY_ |
240 | # if YYENABLE_NLS | 251 | # if defined YYENABLE_NLS && YYENABLE_NLS |
241 | # if ENABLE_NLS | 252 | # if ENABLE_NLS |
242 | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ | 253 | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ |
243 | # define YY_(msgid) dgettext ("bison-runtime", msgid) | 254 | # define YY_(msgid) dgettext ("bison-runtime", msgid) |
@@ -290,11 +301,11 @@ YYID (yyi) | |||
290 | # define alloca _alloca | 301 | # define alloca _alloca |
291 | # else | 302 | # else |
292 | # define YYSTACK_ALLOC alloca | 303 | # define YYSTACK_ALLOC alloca |
293 | # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ | 304 | # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ |
294 | || defined __cplusplus || defined _MSC_VER) | 305 | || defined __cplusplus || defined _MSC_VER) |
295 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ | 306 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
296 | # ifndef _STDLIB_H | 307 | # ifndef EXIT_SUCCESS |
297 | # define _STDLIB_H 1 | 308 | # define EXIT_SUCCESS 0 |
298 | # endif | 309 | # endif |
299 | # endif | 310 | # endif |
300 | # endif | 311 | # endif |
@@ -317,24 +328,24 @@ YYID (yyi) | |||
317 | # ifndef YYSTACK_ALLOC_MAXIMUM | 328 | # ifndef YYSTACK_ALLOC_MAXIMUM |
318 | # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM | 329 | # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
319 | # endif | 330 | # endif |
320 | # if (defined __cplusplus && ! defined _STDLIB_H \ | 331 | # if (defined __cplusplus && ! defined EXIT_SUCCESS \ |
321 | && ! ((defined YYMALLOC || defined malloc) \ | 332 | && ! ((defined YYMALLOC || defined malloc) \ |
322 | && (defined YYFREE || defined free))) | 333 | && (defined YYFREE || defined free))) |
323 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ | 334 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
324 | # ifndef _STDLIB_H | 335 | # ifndef EXIT_SUCCESS |
325 | # define _STDLIB_H 1 | 336 | # define EXIT_SUCCESS 0 |
326 | # endif | 337 | # endif |
327 | # endif | 338 | # endif |
328 | # ifndef YYMALLOC | 339 | # ifndef YYMALLOC |
329 | # define YYMALLOC malloc | 340 | # define YYMALLOC malloc |
330 | # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ | 341 | # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ |
331 | || defined __cplusplus || defined _MSC_VER) | 342 | || defined __cplusplus || defined _MSC_VER) |
332 | void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ | 343 | void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ |
333 | # endif | 344 | # endif |
334 | # endif | 345 | # endif |
335 | # ifndef YYFREE | 346 | # ifndef YYFREE |
336 | # define YYFREE free | 347 | # define YYFREE free |
337 | # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ | 348 | # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ |
338 | || defined __cplusplus || defined _MSC_VER) | 349 | || defined __cplusplus || defined _MSC_VER) |
339 | void free (void *); /* INFRINGES ON USER NAME SPACE */ | 350 | void free (void *); /* INFRINGES ON USER NAME SPACE */ |
340 | # endif | 351 | # endif |
@@ -363,23 +374,7 @@ union yyalloc | |||
363 | ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ | 374 | ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ |
364 | + YYSTACK_GAP_MAXIMUM) | 375 | + YYSTACK_GAP_MAXIMUM) |
365 | 376 | ||
366 | /* Copy COUNT objects from FROM to TO. The source and destination do | 377 | # define YYCOPY_NEEDED 1 |
367 | not overlap. */ | ||
368 | # ifndef YYCOPY | ||
369 | # if defined __GNUC__ && 1 < __GNUC__ | ||
370 | # define YYCOPY(To, From, Count) \ | ||
371 | __builtin_memcpy (To, From, (Count) * sizeof (*(From))) | ||
372 | # else | ||
373 | # define YYCOPY(To, From, Count) \ | ||
374 | do \ | ||
375 | { \ | ||
376 | YYSIZE_T yyi; \ | ||
377 | for (yyi = 0; yyi < (Count); yyi++) \ | ||
378 | (To)[yyi] = (From)[yyi]; \ | ||
379 | } \ | ||
380 | while (YYID (0)) | ||
381 | # endif | ||
382 | # endif | ||
383 | 378 | ||
384 | /* Relocate STACK from its old location to the new one. The | 379 | /* Relocate STACK from its old location to the new one. The |
385 | local variables YYSIZE and YYSTACKSIZE give the old and new number of | 380 | local variables YYSIZE and YYSTACKSIZE give the old and new number of |
@@ -399,6 +394,26 @@ union yyalloc | |||
399 | 394 | ||
400 | #endif | 395 | #endif |
401 | 396 | ||
397 | #if defined YYCOPY_NEEDED && YYCOPY_NEEDED | ||
398 | /* Copy COUNT objects from FROM to TO. The source and destination do | ||
399 | not overlap. */ | ||
400 | # ifndef YYCOPY | ||
401 | # if defined __GNUC__ && 1 < __GNUC__ | ||
402 | # define YYCOPY(To, From, Count) \ | ||
403 | __builtin_memcpy (To, From, (Count) * sizeof (*(From))) | ||
404 | # else | ||
405 | # define YYCOPY(To, From, Count) \ | ||
406 | do \ | ||
407 | { \ | ||
408 | YYSIZE_T yyi; \ | ||
409 | for (yyi = 0; yyi < (Count); yyi++) \ | ||
410 | (To)[yyi] = (From)[yyi]; \ | ||
411 | } \ | ||
412 | while (YYID (0)) | ||
413 | # endif | ||
414 | # endif | ||
415 | #endif /* !YYCOPY_NEEDED */ | ||
416 | |||
402 | /* YYFINAL -- State number of the termination state. */ | 417 | /* YYFINAL -- State number of the termination state. */ |
403 | #define YYFINAL 4 | 418 | #define YYFINAL 4 |
404 | /* YYLAST -- Last index in YYTABLE. */ | 419 | /* YYLAST -- Last index in YYTABLE. */ |
@@ -521,20 +536,20 @@ static const yytype_int8 yyrhs[] = | |||
521 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ | 536 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ |
522 | static const yytype_uint16 yyrline[] = | 537 | static const yytype_uint16 yyrline[] = |
523 | { | 538 | { |
524 | 0, 104, 104, 105, 109, 109, 115, 115, 117, 117, | 539 | 0, 123, 123, 124, 128, 128, 134, 134, 136, 136, |
525 | 119, 120, 121, 122, 123, 124, 128, 142, 143, 147, | 540 | 138, 139, 140, 141, 142, 143, 147, 161, 162, 166, |
526 | 155, 168, 174, 175, 179, 180, 184, 190, 194, 195, | 541 | 174, 187, 193, 194, 198, 199, 203, 209, 213, 214, |
527 | 196, 197, 198, 202, 203, 204, 205, 209, 211, 213, | 542 | 215, 216, 217, 221, 222, 223, 224, 228, 230, 232, |
528 | 217, 224, 231, 241, 244, 245, 249, 250, 251, 252, | 543 | 236, 238, 240, 245, 248, 249, 253, 254, 255, 256, |
529 | 253, 254, 255, 256, 257, 258, 259, 263, 268, 269, | 544 | 257, 258, 259, 260, 261, 262, 263, 267, 272, 273, |
530 | 273, 274, 278, 278, 278, 279, 287, 288, 292, 301, | 545 | 277, 278, 282, 282, 282, 283, 291, 292, 296, 305, |
531 | 303, 305, 307, 309, 316, 317, 321, 322, 323, 325, | 546 | 307, 309, 311, 313, 320, 321, 325, 326, 327, 329, |
532 | 327, 329, 331, 336, 337, 338, 342, 343, 347, 348, | 547 | 331, 333, 335, 340, 341, 342, 346, 347, 351, 352, |
533 | 353, 358, 360, 364, 365, 373, 377, 379, 381, 383, | 548 | 357, 362, 364, 368, 369, 377, 381, 383, 385, 387, |
534 | 385, 390, 399, 400, 405, 410, 411, 415, 416, 420, | 549 | 389, 394, 403, 404, 409, 414, 415, 419, 420, 424, |
535 | 421, 425, 427, 432, 433, 437, 438, 442, 443, 444, | 550 | 425, 429, 431, 436, 437, 441, 442, 446, 447, 448, |
536 | 448, 452, 453, 457, 458, 462, 463, 466, 471, 479, | 551 | 452, 456, 457, 461, 462, 466, 467, 470, 475, 483, |
537 | 483, 484, 488 | 552 | 487, 488, 492 |
538 | }; | 553 | }; |
539 | #endif | 554 | #endif |
540 | 555 | ||
@@ -625,8 +640,8 @@ static const yytype_uint8 yyr2[] = | |||
625 | 0, 1, 5 | 640 | 0, 1, 5 |
626 | }; | 641 | }; |
627 | 642 | ||
628 | /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state | 643 | /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. |
629 | STATE-NUM when YYTABLE doesn't specify something else to do. Zero | 644 | Performed when YYTABLE doesn't specify something else to do. Zero |
630 | means the default is an error. */ | 645 | means the default is an error. */ |
631 | static const yytype_uint8 yydefact[] = | 646 | static const yytype_uint8 yydefact[] = |
632 | { | 647 | { |
@@ -699,8 +714,7 @@ static const yytype_int16 yypgoto[] = | |||
699 | 714 | ||
700 | /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If | 715 | /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If |
701 | positive, shift that token. If negative, reduce the rule which | 716 | positive, shift that token. If negative, reduce the rule which |
702 | number is the opposite. If zero, do what YYDEFACT says. | 717 | number is the opposite. If YYTABLE_NINF, syntax error. */ |
703 | If YYTABLE_NINF, syntax error. */ | ||
704 | #define YYTABLE_NINF -109 | 718 | #define YYTABLE_NINF -109 |
705 | static const yytype_int16 yytable[] = | 719 | static const yytype_int16 yytable[] = |
706 | { | 720 | { |
@@ -760,6 +774,12 @@ static const yytype_int16 yytable[] = | |||
760 | 0, 0, 34 | 774 | 0, 0, 34 |
761 | }; | 775 | }; |
762 | 776 | ||
777 | #define yypact_value_is_default(yystate) \ | ||
778 | ((yystate) == (-135)) | ||
779 | |||
780 | #define yytable_value_is_error(yytable_value) \ | ||
781 | YYID (0) | ||
782 | |||
763 | static const yytype_int16 yycheck[] = | 783 | static const yytype_int16 yycheck[] = |
764 | { | 784 | { |
765 | 59, 38, 79, 3, 1, 8, 56, 37, 26, 37, | 785 | 59, 38, 79, 3, 1, 8, 56, 37, 26, 37, |
@@ -855,9 +875,18 @@ static const yytype_uint8 yystos[] = | |||
855 | 875 | ||
856 | /* Like YYERROR except do call yyerror. This remains here temporarily | 876 | /* Like YYERROR except do call yyerror. This remains here temporarily |
857 | to ease the transition to the new meaning of YYERROR, for GCC. | 877 | to ease the transition to the new meaning of YYERROR, for GCC. |
858 | Once GCC version 2 has supplanted version 1, this can go. */ | 878 | Once GCC version 2 has supplanted version 1, this can go. However, |
879 | YYFAIL appears to be in use. Nevertheless, it is formally deprecated | ||
880 | in Bison 2.4.2's NEWS entry, where a plan to phase it out is | ||
881 | discussed. */ | ||
859 | 882 | ||
860 | #define YYFAIL goto yyerrlab | 883 | #define YYFAIL goto yyerrlab |
884 | #if defined YYFAIL | ||
885 | /* This is here to suppress warnings from the GCC cpp's | ||
886 | -Wunused-macros. Normally we don't worry about that warning, but | ||
887 | some users do, and we want to make it easy for users to remove | ||
888 | YYFAIL uses, which will produce warnings from Bison 2.5. */ | ||
889 | #endif | ||
861 | 890 | ||
862 | #define YYRECOVERING() (!!yyerrstatus) | 891 | #define YYRECOVERING() (!!yyerrstatus) |
863 | 892 | ||
@@ -867,7 +896,6 @@ do \ | |||
867 | { \ | 896 | { \ |
868 | yychar = (Token); \ | 897 | yychar = (Token); \ |
869 | yylval = (Value); \ | 898 | yylval = (Value); \ |
870 | yytoken = YYTRANSLATE (yychar); \ | ||
871 | YYPOPSTACK (1); \ | 899 | YYPOPSTACK (1); \ |
872 | goto yybackup; \ | 900 | goto yybackup; \ |
873 | } \ | 901 | } \ |
@@ -909,19 +937,10 @@ while (YYID (0)) | |||
909 | #endif | 937 | #endif |
910 | 938 | ||
911 | 939 | ||
912 | /* YY_LOCATION_PRINT -- Print the location on the stream. | 940 | /* This macro is provided for backward compatibility. */ |
913 | This macro was not mandated originally: define only if we know | ||
914 | we won't break user code: when these are the locations we know. */ | ||
915 | 941 | ||
916 | #ifndef YY_LOCATION_PRINT | 942 | #ifndef YY_LOCATION_PRINT |
917 | # if YYLTYPE_IS_TRIVIAL | 943 | # define YY_LOCATION_PRINT(File, Loc) ((void) 0) |
918 | # define YY_LOCATION_PRINT(File, Loc) \ | ||
919 | fprintf (File, "%d.%d-%d.%d", \ | ||
920 | (Loc).first_line, (Loc).first_column, \ | ||
921 | (Loc).last_line, (Loc).last_column) | ||
922 | # else | ||
923 | # define YY_LOCATION_PRINT(File, Loc) ((void) 0) | ||
924 | # endif | ||
925 | #endif | 944 | #endif |
926 | 945 | ||
927 | 946 | ||
@@ -1113,7 +1132,6 @@ int yydebug; | |||
1113 | # define YYMAXDEPTH 10000 | 1132 | # define YYMAXDEPTH 10000 |
1114 | #endif | 1133 | #endif |
1115 | 1134 | ||
1116 | |||
1117 | 1135 | ||
1118 | #if YYERROR_VERBOSE | 1136 | #if YYERROR_VERBOSE |
1119 | 1137 | ||
@@ -1216,115 +1234,142 @@ yytnamerr (char *yyres, const char *yystr) | |||
1216 | } | 1234 | } |
1217 | # endif | 1235 | # endif |
1218 | 1236 | ||
1219 | /* Copy into YYRESULT an error message about the unexpected token | 1237 | /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message |
1220 | YYCHAR while in state YYSTATE. Return the number of bytes copied, | 1238 | about the unexpected token YYTOKEN for the state stack whose top is |
1221 | including the terminating null byte. If YYRESULT is null, do not | 1239 | YYSSP. |
1222 | copy anything; just return the number of bytes that would be | ||
1223 | copied. As a special case, return 0 if an ordinary "syntax error" | ||
1224 | message will do. Return YYSIZE_MAXIMUM if overflow occurs during | ||
1225 | size calculation. */ | ||
1226 | static YYSIZE_T | ||
1227 | yysyntax_error (char *yyresult, int yystate, int yychar) | ||
1228 | { | ||
1229 | int yyn = yypact[yystate]; | ||
1230 | 1240 | ||
1231 | if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) | 1241 | Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is |
1232 | return 0; | 1242 | not large enough to hold the message. In that case, also set |
1233 | else | 1243 | *YYMSG_ALLOC to the required number of bytes. Return 2 if the |
1244 | required number of bytes is too large to store. */ | ||
1245 | static int | ||
1246 | yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | ||
1247 | yytype_int16 *yyssp, int yytoken) | ||
1248 | { | ||
1249 | YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); | ||
1250 | YYSIZE_T yysize = yysize0; | ||
1251 | YYSIZE_T yysize1; | ||
1252 | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; | ||
1253 | /* Internationalized format string. */ | ||
1254 | const char *yyformat = 0; | ||
1255 | /* Arguments of yyformat. */ | ||
1256 | char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; | ||
1257 | /* Number of reported tokens (one for the "unexpected", one per | ||
1258 | "expected"). */ | ||
1259 | int yycount = 0; | ||
1260 | |||
1261 | /* There are many possibilities here to consider: | ||
1262 | - Assume YYFAIL is not used. It's too flawed to consider. See | ||
1263 | <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> | ||
1264 | for details. YYERROR is fine as it does not invoke this | ||
1265 | function. | ||
1266 | - If this state is a consistent state with a default action, then | ||
1267 | the only way this function was invoked is if the default action | ||
1268 | is an error action. In that case, don't check for expected | ||
1269 | tokens because there are none. | ||
1270 | - The only way there can be no lookahead present (in yychar) is if | ||
1271 | this state is a consistent state with a default action. Thus, | ||
1272 | detecting the absence of a lookahead is sufficient to determine | ||
1273 | that there is no unexpected or expected token to report. In that | ||
1274 | case, just report a simple "syntax error". | ||
1275 | - Don't assume there isn't a lookahead just because this state is a | ||
1276 | consistent state with a default action. There might have been a | ||
1277 | previous inconsistent state, consistent state with a non-default | ||
1278 | action, or user semantic action that manipulated yychar. | ||
1279 | - Of course, the expected token list depends on states to have | ||
1280 | correct lookahead information, and it depends on the parser not | ||
1281 | to perform extra reductions after fetching a lookahead from the | ||
1282 | scanner and before detecting a syntax error. Thus, state merging | ||
1283 | (from LALR or IELR) and default reductions corrupt the expected | ||
1284 | token list. However, the list is correct for canonical LR with | ||
1285 | one exception: it will still contain any token that will not be | ||
1286 | accepted due to an error action in a later state. | ||
1287 | */ | ||
1288 | if (yytoken != YYEMPTY) | ||
1234 | { | 1289 | { |
1235 | int yytype = YYTRANSLATE (yychar); | 1290 | int yyn = yypact[*yyssp]; |
1236 | YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); | 1291 | yyarg[yycount++] = yytname[yytoken]; |
1237 | YYSIZE_T yysize = yysize0; | 1292 | if (!yypact_value_is_default (yyn)) |
1238 | YYSIZE_T yysize1; | 1293 | { |
1239 | int yysize_overflow = 0; | 1294 | /* Start YYX at -YYN if negative to avoid negative indexes in |
1240 | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; | 1295 | YYCHECK. In other words, skip the first -YYN actions for |
1241 | char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; | 1296 | this state because they are default actions. */ |
1242 | int yyx; | 1297 | int yyxbegin = yyn < 0 ? -yyn : 0; |
1243 | 1298 | /* Stay within bounds of both yycheck and yytname. */ | |
1244 | # if 0 | 1299 | int yychecklim = YYLAST - yyn + 1; |
1245 | /* This is so xgettext sees the translatable formats that are | 1300 | int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; |
1246 | constructed on the fly. */ | 1301 | int yyx; |
1247 | YY_("syntax error, unexpected %s"); | 1302 | |
1248 | YY_("syntax error, unexpected %s, expecting %s"); | 1303 | for (yyx = yyxbegin; yyx < yyxend; ++yyx) |
1249 | YY_("syntax error, unexpected %s, expecting %s or %s"); | 1304 | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR |
1250 | YY_("syntax error, unexpected %s, expecting %s or %s or %s"); | 1305 | && !yytable_value_is_error (yytable[yyx + yyn])) |
1251 | YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); | 1306 | { |
1252 | # endif | 1307 | if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) |
1253 | char *yyfmt; | 1308 | { |
1254 | char const *yyf; | 1309 | yycount = 1; |
1255 | static char const yyunexpected[] = "syntax error, unexpected %s"; | 1310 | yysize = yysize0; |
1256 | static char const yyexpecting[] = ", expecting %s"; | 1311 | break; |
1257 | static char const yyor[] = " or %s"; | 1312 | } |
1258 | char yyformat[sizeof yyunexpected | 1313 | yyarg[yycount++] = yytname[yyx]; |
1259 | + sizeof yyexpecting - 1 | 1314 | yysize1 = yysize + yytnamerr (0, yytname[yyx]); |
1260 | + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) | 1315 | if (! (yysize <= yysize1 |
1261 | * (sizeof yyor - 1))]; | 1316 | && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) |
1262 | char const *yyprefix = yyexpecting; | 1317 | return 2; |
1263 | 1318 | yysize = yysize1; | |
1264 | /* Start YYX at -YYN if negative to avoid negative indexes in | 1319 | } |
1265 | YYCHECK. */ | 1320 | } |
1266 | int yyxbegin = yyn < 0 ? -yyn : 0; | 1321 | } |
1267 | |||
1268 | /* Stay within bounds of both yycheck and yytname. */ | ||
1269 | int yychecklim = YYLAST - yyn + 1; | ||
1270 | int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; | ||
1271 | int yycount = 1; | ||
1272 | |||
1273 | yyarg[0] = yytname[yytype]; | ||
1274 | yyfmt = yystpcpy (yyformat, yyunexpected); | ||
1275 | |||
1276 | for (yyx = yyxbegin; yyx < yyxend; ++yyx) | ||
1277 | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) | ||
1278 | { | ||
1279 | if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) | ||
1280 | { | ||
1281 | yycount = 1; | ||
1282 | yysize = yysize0; | ||
1283 | yyformat[sizeof yyunexpected - 1] = '\0'; | ||
1284 | break; | ||
1285 | } | ||
1286 | yyarg[yycount++] = yytname[yyx]; | ||
1287 | yysize1 = yysize + yytnamerr (0, yytname[yyx]); | ||
1288 | yysize_overflow |= (yysize1 < yysize); | ||
1289 | yysize = yysize1; | ||
1290 | yyfmt = yystpcpy (yyfmt, yyprefix); | ||
1291 | yyprefix = yyor; | ||
1292 | } | ||
1293 | 1322 | ||
1294 | yyf = YY_(yyformat); | 1323 | switch (yycount) |
1295 | yysize1 = yysize + yystrlen (yyf); | 1324 | { |
1296 | yysize_overflow |= (yysize1 < yysize); | 1325 | # define YYCASE_(N, S) \ |
1297 | yysize = yysize1; | 1326 | case N: \ |
1327 | yyformat = S; \ | ||
1328 | break | ||
1329 | YYCASE_(0, YY_("syntax error")); | ||
1330 | YYCASE_(1, YY_("syntax error, unexpected %s")); | ||
1331 | YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); | ||
1332 | YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); | ||
1333 | YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); | ||
1334 | YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); | ||
1335 | # undef YYCASE_ | ||
1336 | } | ||
1298 | 1337 | ||
1299 | if (yysize_overflow) | 1338 | yysize1 = yysize + yystrlen (yyformat); |
1300 | return YYSIZE_MAXIMUM; | 1339 | if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) |
1340 | return 2; | ||
1341 | yysize = yysize1; | ||
1301 | 1342 | ||
1302 | if (yyresult) | 1343 | if (*yymsg_alloc < yysize) |
1303 | { | 1344 | { |
1304 | /* Avoid sprintf, as that infringes on the user's name space. | 1345 | *yymsg_alloc = 2 * yysize; |
1305 | Don't have undefined behavior even if the translation | 1346 | if (! (yysize <= *yymsg_alloc |
1306 | produced a string with the wrong number of "%s"s. */ | 1347 | && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) |
1307 | char *yyp = yyresult; | 1348 | *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; |
1308 | int yyi = 0; | 1349 | return 1; |
1309 | while ((*yyp = *yyf) != '\0') | ||
1310 | { | ||
1311 | if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) | ||
1312 | { | ||
1313 | yyp += yytnamerr (yyp, yyarg[yyi++]); | ||
1314 | yyf += 2; | ||
1315 | } | ||
1316 | else | ||
1317 | { | ||
1318 | yyp++; | ||
1319 | yyf++; | ||
1320 | } | ||
1321 | } | ||
1322 | } | ||
1323 | return yysize; | ||
1324 | } | 1350 | } |
1351 | |||
1352 | /* Avoid sprintf, as that infringes on the user's name space. | ||
1353 | Don't have undefined behavior even if the translation | ||
1354 | produced a string with the wrong number of "%s"s. */ | ||
1355 | { | ||
1356 | char *yyp = *yymsg; | ||
1357 | int yyi = 0; | ||
1358 | while ((*yyp = *yyformat) != '\0') | ||
1359 | if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) | ||
1360 | { | ||
1361 | yyp += yytnamerr (yyp, yyarg[yyi++]); | ||
1362 | yyformat += 2; | ||
1363 | } | ||
1364 | else | ||
1365 | { | ||
1366 | yyp++; | ||
1367 | yyformat++; | ||
1368 | } | ||
1369 | } | ||
1370 | return 0; | ||
1325 | } | 1371 | } |
1326 | #endif /* YYERROR_VERBOSE */ | 1372 | #endif /* YYERROR_VERBOSE */ |
1327 | |||
1328 | 1373 | ||
1329 | /*-----------------------------------------------. | 1374 | /*-----------------------------------------------. |
1330 | | Release the memory associated to this symbol. | | 1375 | | Release the memory associated to this symbol. | |
@@ -1357,6 +1402,7 @@ yydestruct (yymsg, yytype, yyvaluep) | |||
1357 | } | 1402 | } |
1358 | } | 1403 | } |
1359 | 1404 | ||
1405 | |||
1360 | /* Prevent warnings from -Wmissing-prototypes. */ | 1406 | /* Prevent warnings from -Wmissing-prototypes. */ |
1361 | #ifdef YYPARSE_PARAM | 1407 | #ifdef YYPARSE_PARAM |
1362 | #if defined __STDC__ || defined __cplusplus | 1408 | #if defined __STDC__ || defined __cplusplus |
@@ -1383,10 +1429,9 @@ YYSTYPE yylval; | |||
1383 | int yynerrs; | 1429 | int yynerrs; |
1384 | 1430 | ||
1385 | 1431 | ||
1386 | 1432 | /*----------. | |
1387 | /*-------------------------. | 1433 | | yyparse. | |
1388 | | yyparse or yypush_parse. | | 1434 | `----------*/ |
1389 | `-------------------------*/ | ||
1390 | 1435 | ||
1391 | #ifdef YYPARSE_PARAM | 1436 | #ifdef YYPARSE_PARAM |
1392 | #if (defined __STDC__ || defined __C99__FUNC__ \ | 1437 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
@@ -1410,8 +1455,6 @@ yyparse () | |||
1410 | #endif | 1455 | #endif |
1411 | #endif | 1456 | #endif |
1412 | { | 1457 | { |
1413 | |||
1414 | |||
1415 | int yystate; | 1458 | int yystate; |
1416 | /* Number of tokens to shift before error messages enabled. */ | 1459 | /* Number of tokens to shift before error messages enabled. */ |
1417 | int yyerrstatus; | 1460 | int yyerrstatus; |
@@ -1566,7 +1609,7 @@ yybackup: | |||
1566 | 1609 | ||
1567 | /* First try to decide what to do without reference to lookahead token. */ | 1610 | /* First try to decide what to do without reference to lookahead token. */ |
1568 | yyn = yypact[yystate]; | 1611 | yyn = yypact[yystate]; |
1569 | if (yyn == YYPACT_NINF) | 1612 | if (yypact_value_is_default (yyn)) |
1570 | goto yydefault; | 1613 | goto yydefault; |
1571 | 1614 | ||
1572 | /* Not known => get a lookahead token if don't already have one. */ | 1615 | /* Not known => get a lookahead token if don't already have one. */ |
@@ -1597,8 +1640,8 @@ yybackup: | |||
1597 | yyn = yytable[yyn]; | 1640 | yyn = yytable[yyn]; |
1598 | if (yyn <= 0) | 1641 | if (yyn <= 0) |
1599 | { | 1642 | { |
1600 | if (yyn == 0 || yyn == YYTABLE_NINF) | 1643 | if (yytable_value_is_error (yyn)) |
1601 | goto yyerrlab; | 1644 | goto yyerrlab; |
1602 | yyn = -yyn; | 1645 | yyn = -yyn; |
1603 | goto yyreduce; | 1646 | goto yyreduce; |
1604 | } | 1647 | } |
@@ -1653,64 +1696,46 @@ yyreduce: | |||
1653 | { | 1696 | { |
1654 | case 4: | 1697 | case 4: |
1655 | 1698 | ||
1656 | /* Line 1455 of yacc.c */ | 1699 | { is_typedef = 0; is_extern = 0; current_name = NULL; decl_spec = NULL; } |
1657 | #line 109 "scripts/genksyms/parse.y" | ||
1658 | { is_typedef = 0; is_extern = 0; current_name = NULL; decl_spec = NULL; ;} | ||
1659 | break; | 1700 | break; |
1660 | 1701 | ||
1661 | case 5: | 1702 | case 5: |
1662 | 1703 | ||
1663 | /* Line 1455 of yacc.c */ | 1704 | { free_list(*(yyvsp[(2) - (2)]), NULL); *(yyvsp[(2) - (2)]) = NULL; } |
1664 | #line 111 "scripts/genksyms/parse.y" | ||
1665 | { free_list(*(yyvsp[(2) - (2)]), NULL); *(yyvsp[(2) - (2)]) = NULL; ;} | ||
1666 | break; | 1705 | break; |
1667 | 1706 | ||
1668 | case 6: | 1707 | case 6: |
1669 | 1708 | ||
1670 | /* Line 1455 of yacc.c */ | 1709 | { is_typedef = 1; } |
1671 | #line 115 "scripts/genksyms/parse.y" | ||
1672 | { is_typedef = 1; ;} | ||
1673 | break; | 1710 | break; |
1674 | 1711 | ||
1675 | case 7: | 1712 | case 7: |
1676 | 1713 | ||
1677 | /* Line 1455 of yacc.c */ | 1714 | { (yyval) = (yyvsp[(4) - (4)]); } |
1678 | #line 116 "scripts/genksyms/parse.y" | ||
1679 | { (yyval) = (yyvsp[(4) - (4)]); ;} | ||
1680 | break; | 1715 | break; |
1681 | 1716 | ||
1682 | case 8: | 1717 | case 8: |
1683 | 1718 | ||
1684 | /* Line 1455 of yacc.c */ | 1719 | { is_typedef = 1; } |
1685 | #line 117 "scripts/genksyms/parse.y" | ||
1686 | { is_typedef = 1; ;} | ||
1687 | break; | 1720 | break; |
1688 | 1721 | ||
1689 | case 9: | 1722 | case 9: |
1690 | 1723 | ||
1691 | /* Line 1455 of yacc.c */ | 1724 | { (yyval) = (yyvsp[(3) - (3)]); } |
1692 | #line 118 "scripts/genksyms/parse.y" | ||
1693 | { (yyval) = (yyvsp[(3) - (3)]); ;} | ||
1694 | break; | 1725 | break; |
1695 | 1726 | ||
1696 | case 14: | 1727 | case 14: |
1697 | 1728 | ||
1698 | /* Line 1455 of yacc.c */ | 1729 | { (yyval) = (yyvsp[(2) - (2)]); } |
1699 | #line 123 "scripts/genksyms/parse.y" | ||
1700 | { (yyval) = (yyvsp[(2) - (2)]); ;} | ||
1701 | break; | 1730 | break; |
1702 | 1731 | ||
1703 | case 15: | 1732 | case 15: |
1704 | 1733 | ||
1705 | /* Line 1455 of yacc.c */ | 1734 | { (yyval) = (yyvsp[(2) - (2)]); } |
1706 | #line 124 "scripts/genksyms/parse.y" | ||
1707 | { (yyval) = (yyvsp[(2) - (2)]); ;} | ||
1708 | break; | 1735 | break; |
1709 | 1736 | ||
1710 | case 16: | 1737 | case 16: |
1711 | 1738 | ||
1712 | /* Line 1455 of yacc.c */ | ||
1713 | #line 129 "scripts/genksyms/parse.y" | ||
1714 | { if (current_name) { | 1739 | { if (current_name) { |
1715 | struct string_list *decl = (*(yyvsp[(3) - (3)]))->next; | 1740 | struct string_list *decl = (*(yyvsp[(3) - (3)]))->next; |
1716 | (*(yyvsp[(3) - (3)]))->next = NULL; | 1741 | (*(yyvsp[(3) - (3)]))->next = NULL; |
@@ -1720,33 +1745,27 @@ yyreduce: | |||
1720 | current_name = NULL; | 1745 | current_name = NULL; |
1721 | } | 1746 | } |
1722 | (yyval) = (yyvsp[(3) - (3)]); | 1747 | (yyval) = (yyvsp[(3) - (3)]); |
1723 | ;} | 1748 | } |
1724 | break; | 1749 | break; |
1725 | 1750 | ||
1726 | case 17: | 1751 | case 17: |
1727 | 1752 | ||
1728 | /* Line 1455 of yacc.c */ | 1753 | { (yyval) = NULL; } |
1729 | #line 142 "scripts/genksyms/parse.y" | ||
1730 | { (yyval) = NULL; ;} | ||
1731 | break; | 1754 | break; |
1732 | 1755 | ||
1733 | case 19: | 1756 | case 19: |
1734 | 1757 | ||
1735 | /* Line 1455 of yacc.c */ | ||
1736 | #line 148 "scripts/genksyms/parse.y" | ||
1737 | { struct string_list *decl = *(yyvsp[(1) - (1)]); | 1758 | { struct string_list *decl = *(yyvsp[(1) - (1)]); |
1738 | *(yyvsp[(1) - (1)]) = NULL; | 1759 | *(yyvsp[(1) - (1)]) = NULL; |
1739 | add_symbol(current_name, | 1760 | add_symbol(current_name, |
1740 | is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern); | 1761 | is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern); |
1741 | current_name = NULL; | 1762 | current_name = NULL; |
1742 | (yyval) = (yyvsp[(1) - (1)]); | 1763 | (yyval) = (yyvsp[(1) - (1)]); |
1743 | ;} | 1764 | } |
1744 | break; | 1765 | break; |
1745 | 1766 | ||
1746 | case 20: | 1767 | case 20: |
1747 | 1768 | ||
1748 | /* Line 1455 of yacc.c */ | ||
1749 | #line 156 "scripts/genksyms/parse.y" | ||
1750 | { struct string_list *decl = *(yyvsp[(3) - (3)]); | 1769 | { struct string_list *decl = *(yyvsp[(3) - (3)]); |
1751 | *(yyvsp[(3) - (3)]) = NULL; | 1770 | *(yyvsp[(3) - (3)]) = NULL; |
1752 | free_list(*(yyvsp[(2) - (3)]), NULL); | 1771 | free_list(*(yyvsp[(2) - (3)]), NULL); |
@@ -1755,189 +1774,128 @@ yyreduce: | |||
1755 | is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern); | 1774 | is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern); |
1756 | current_name = NULL; | 1775 | current_name = NULL; |
1757 | (yyval) = (yyvsp[(3) - (3)]); | 1776 | (yyval) = (yyvsp[(3) - (3)]); |
1758 | ;} | 1777 | } |
1759 | break; | 1778 | break; |
1760 | 1779 | ||
1761 | case 21: | 1780 | case 21: |
1762 | 1781 | ||
1763 | /* Line 1455 of yacc.c */ | 1782 | { (yyval) = (yyvsp[(4) - (4)]) ? (yyvsp[(4) - (4)]) : (yyvsp[(3) - (4)]) ? (yyvsp[(3) - (4)]) : (yyvsp[(2) - (4)]) ? (yyvsp[(2) - (4)]) : (yyvsp[(1) - (4)]); } |
1764 | #line 169 "scripts/genksyms/parse.y" | ||
1765 | { (yyval) = (yyvsp[(4) - (4)]) ? (yyvsp[(4) - (4)]) : (yyvsp[(3) - (4)]) ? (yyvsp[(3) - (4)]) : (yyvsp[(2) - (4)]) ? (yyvsp[(2) - (4)]) : (yyvsp[(1) - (4)]); ;} | ||
1766 | break; | 1783 | break; |
1767 | 1784 | ||
1768 | case 22: | 1785 | case 22: |
1769 | 1786 | ||
1770 | /* Line 1455 of yacc.c */ | 1787 | { decl_spec = NULL; } |
1771 | #line 174 "scripts/genksyms/parse.y" | ||
1772 | { decl_spec = NULL; ;} | ||
1773 | break; | 1788 | break; |
1774 | 1789 | ||
1775 | case 24: | 1790 | case 24: |
1776 | 1791 | ||
1777 | /* Line 1455 of yacc.c */ | 1792 | { decl_spec = *(yyvsp[(1) - (1)]); } |
1778 | #line 179 "scripts/genksyms/parse.y" | ||
1779 | { decl_spec = *(yyvsp[(1) - (1)]); ;} | ||
1780 | break; | 1793 | break; |
1781 | 1794 | ||
1782 | case 25: | 1795 | case 25: |
1783 | 1796 | ||
1784 | /* Line 1455 of yacc.c */ | 1797 | { decl_spec = *(yyvsp[(2) - (2)]); } |
1785 | #line 180 "scripts/genksyms/parse.y" | ||
1786 | { decl_spec = *(yyvsp[(2) - (2)]); ;} | ||
1787 | break; | 1798 | break; |
1788 | 1799 | ||
1789 | case 26: | 1800 | case 26: |
1790 | 1801 | ||
1791 | /* Line 1455 of yacc.c */ | ||
1792 | #line 185 "scripts/genksyms/parse.y" | ||
1793 | { /* Version 2 checksumming ignores storage class, as that | 1802 | { /* Version 2 checksumming ignores storage class, as that |
1794 | is really irrelevant to the linkage. */ | 1803 | is really irrelevant to the linkage. */ |
1795 | remove_node((yyvsp[(1) - (1)])); | 1804 | remove_node((yyvsp[(1) - (1)])); |
1796 | (yyval) = (yyvsp[(1) - (1)]); | 1805 | (yyval) = (yyvsp[(1) - (1)]); |
1797 | ;} | 1806 | } |
1798 | break; | 1807 | break; |
1799 | 1808 | ||
1800 | case 31: | 1809 | case 31: |
1801 | 1810 | ||
1802 | /* Line 1455 of yacc.c */ | 1811 | { is_extern = 1; (yyval) = (yyvsp[(1) - (1)]); } |
1803 | #line 197 "scripts/genksyms/parse.y" | ||
1804 | { is_extern = 1; (yyval) = (yyvsp[(1) - (1)]); ;} | ||
1805 | break; | 1812 | break; |
1806 | 1813 | ||
1807 | case 32: | 1814 | case 32: |
1808 | 1815 | ||
1809 | /* Line 1455 of yacc.c */ | 1816 | { is_extern = 0; (yyval) = (yyvsp[(1) - (1)]); } |
1810 | #line 198 "scripts/genksyms/parse.y" | ||
1811 | { is_extern = 0; (yyval) = (yyvsp[(1) - (1)]); ;} | ||
1812 | break; | 1817 | break; |
1813 | 1818 | ||
1814 | case 37: | 1819 | case 37: |
1815 | 1820 | ||
1816 | /* Line 1455 of yacc.c */ | 1821 | { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_STRUCT; (yyval) = (yyvsp[(2) - (2)]); } |
1817 | #line 210 "scripts/genksyms/parse.y" | ||
1818 | { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_STRUCT; (yyval) = (yyvsp[(2) - (2)]); ;} | ||
1819 | break; | 1822 | break; |
1820 | 1823 | ||
1821 | case 38: | 1824 | case 38: |
1822 | 1825 | ||
1823 | /* Line 1455 of yacc.c */ | 1826 | { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_UNION; (yyval) = (yyvsp[(2) - (2)]); } |
1824 | #line 212 "scripts/genksyms/parse.y" | ||
1825 | { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_UNION; (yyval) = (yyvsp[(2) - (2)]); ;} | ||
1826 | break; | 1827 | break; |
1827 | 1828 | ||
1828 | case 39: | 1829 | case 39: |
1829 | 1830 | ||
1830 | /* Line 1455 of yacc.c */ | 1831 | { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_ENUM; (yyval) = (yyvsp[(2) - (2)]); } |
1831 | #line 214 "scripts/genksyms/parse.y" | ||
1832 | { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_ENUM; (yyval) = (yyvsp[(2) - (2)]); ;} | ||
1833 | break; | 1832 | break; |
1834 | 1833 | ||
1835 | case 40: | 1834 | case 40: |
1836 | 1835 | ||
1837 | /* Line 1455 of yacc.c */ | 1836 | { record_compound((yyvsp[(1) - (3)]), (yyvsp[(2) - (3)]), (yyvsp[(3) - (3)]), SYM_STRUCT); (yyval) = (yyvsp[(3) - (3)]); } |
1838 | #line 218 "scripts/genksyms/parse.y" | ||
1839 | { struct string_list *s = *(yyvsp[(3) - (3)]), *i = *(yyvsp[(2) - (3)]), *r; | ||
1840 | r = copy_node(i); r->tag = SYM_STRUCT; | ||
1841 | r->next = (*(yyvsp[(1) - (3)]))->next; *(yyvsp[(3) - (3)]) = r; (*(yyvsp[(1) - (3)]))->next = NULL; | ||
1842 | add_symbol(i->string, SYM_STRUCT, s, is_extern); | ||
1843 | (yyval) = (yyvsp[(3) - (3)]); | ||
1844 | ;} | ||
1845 | break; | 1837 | break; |
1846 | 1838 | ||
1847 | case 41: | 1839 | case 41: |
1848 | 1840 | ||
1849 | /* Line 1455 of yacc.c */ | 1841 | { record_compound((yyvsp[(1) - (3)]), (yyvsp[(2) - (3)]), (yyvsp[(3) - (3)]), SYM_UNION); (yyval) = (yyvsp[(3) - (3)]); } |
1850 | #line 225 "scripts/genksyms/parse.y" | ||
1851 | { struct string_list *s = *(yyvsp[(3) - (3)]), *i = *(yyvsp[(2) - (3)]), *r; | ||
1852 | r = copy_node(i); r->tag = SYM_UNION; | ||
1853 | r->next = (*(yyvsp[(1) - (3)]))->next; *(yyvsp[(3) - (3)]) = r; (*(yyvsp[(1) - (3)]))->next = NULL; | ||
1854 | add_symbol(i->string, SYM_UNION, s, is_extern); | ||
1855 | (yyval) = (yyvsp[(3) - (3)]); | ||
1856 | ;} | ||
1857 | break; | 1842 | break; |
1858 | 1843 | ||
1859 | case 42: | 1844 | case 42: |
1860 | 1845 | ||
1861 | /* Line 1455 of yacc.c */ | 1846 | { record_compound((yyvsp[(1) - (3)]), (yyvsp[(2) - (3)]), (yyvsp[(3) - (3)]), SYM_ENUM); (yyval) = (yyvsp[(3) - (3)]); } |
1862 | #line 232 "scripts/genksyms/parse.y" | ||
1863 | { struct string_list *s = *(yyvsp[(3) - (3)]), *i = *(yyvsp[(2) - (3)]), *r; | ||
1864 | r = copy_node(i); r->tag = SYM_ENUM; | ||
1865 | r->next = (*(yyvsp[(1) - (3)]))->next; *(yyvsp[(3) - (3)]) = r; (*(yyvsp[(1) - (3)]))->next = NULL; | ||
1866 | add_symbol(i->string, SYM_ENUM, s, is_extern); | ||
1867 | (yyval) = (yyvsp[(3) - (3)]); | ||
1868 | ;} | ||
1869 | break; | 1847 | break; |
1870 | 1848 | ||
1871 | case 43: | 1849 | case 43: |
1872 | 1850 | ||
1873 | /* Line 1455 of yacc.c */ | 1851 | { add_symbol(NULL, SYM_ENUM, NULL, 0); (yyval) = (yyvsp[(2) - (2)]); } |
1874 | #line 242 "scripts/genksyms/parse.y" | ||
1875 | { add_symbol(NULL, SYM_ENUM, NULL, 0); (yyval) = (yyvsp[(2) - (2)]); ;} | ||
1876 | break; | 1852 | break; |
1877 | 1853 | ||
1878 | case 44: | 1854 | case 44: |
1879 | 1855 | ||
1880 | /* Line 1455 of yacc.c */ | 1856 | { (yyval) = (yyvsp[(2) - (2)]); } |
1881 | #line 244 "scripts/genksyms/parse.y" | ||
1882 | { (yyval) = (yyvsp[(2) - (2)]); ;} | ||
1883 | break; | 1857 | break; |
1884 | 1858 | ||
1885 | case 45: | 1859 | case 45: |
1886 | 1860 | ||
1887 | /* Line 1455 of yacc.c */ | 1861 | { (yyval) = (yyvsp[(2) - (2)]); } |
1888 | #line 245 "scripts/genksyms/parse.y" | ||
1889 | { (yyval) = (yyvsp[(2) - (2)]); ;} | ||
1890 | break; | 1862 | break; |
1891 | 1863 | ||
1892 | case 56: | 1864 | case 56: |
1893 | 1865 | ||
1894 | /* Line 1455 of yacc.c */ | 1866 | { (*(yyvsp[(1) - (1)]))->tag = SYM_TYPEDEF; (yyval) = (yyvsp[(1) - (1)]); } |
1895 | #line 259 "scripts/genksyms/parse.y" | ||
1896 | { (*(yyvsp[(1) - (1)]))->tag = SYM_TYPEDEF; (yyval) = (yyvsp[(1) - (1)]); ;} | ||
1897 | break; | 1867 | break; |
1898 | 1868 | ||
1899 | case 57: | 1869 | case 57: |
1900 | 1870 | ||
1901 | /* Line 1455 of yacc.c */ | 1871 | { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); } |
1902 | #line 264 "scripts/genksyms/parse.y" | ||
1903 | { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;} | ||
1904 | break; | 1872 | break; |
1905 | 1873 | ||
1906 | case 58: | 1874 | case 58: |
1907 | 1875 | ||
1908 | /* Line 1455 of yacc.c */ | 1876 | { (yyval) = NULL; } |
1909 | #line 268 "scripts/genksyms/parse.y" | ||
1910 | { (yyval) = NULL; ;} | ||
1911 | break; | 1877 | break; |
1912 | 1878 | ||
1913 | case 61: | 1879 | case 61: |
1914 | 1880 | ||
1915 | /* Line 1455 of yacc.c */ | 1881 | { (yyval) = (yyvsp[(2) - (2)]); } |
1916 | #line 274 "scripts/genksyms/parse.y" | ||
1917 | { (yyval) = (yyvsp[(2) - (2)]); ;} | ||
1918 | break; | 1882 | break; |
1919 | 1883 | ||
1920 | case 65: | 1884 | case 65: |
1921 | 1885 | ||
1922 | /* Line 1455 of yacc.c */ | ||
1923 | #line 280 "scripts/genksyms/parse.y" | ||
1924 | { /* restrict has no effect in prototypes so ignore it */ | 1886 | { /* restrict has no effect in prototypes so ignore it */ |
1925 | remove_node((yyvsp[(1) - (1)])); | 1887 | remove_node((yyvsp[(1) - (1)])); |
1926 | (yyval) = (yyvsp[(1) - (1)]); | 1888 | (yyval) = (yyvsp[(1) - (1)]); |
1927 | ;} | 1889 | } |
1928 | break; | 1890 | break; |
1929 | 1891 | ||
1930 | case 66: | 1892 | case 66: |
1931 | 1893 | ||
1932 | /* Line 1455 of yacc.c */ | 1894 | { (yyval) = (yyvsp[(2) - (2)]); } |
1933 | #line 287 "scripts/genksyms/parse.y" | ||
1934 | { (yyval) = (yyvsp[(2) - (2)]); ;} | ||
1935 | break; | 1895 | break; |
1936 | 1896 | ||
1937 | case 68: | 1897 | case 68: |
1938 | 1898 | ||
1939 | /* Line 1455 of yacc.c */ | ||
1940 | #line 293 "scripts/genksyms/parse.y" | ||
1941 | { if (current_name != NULL) { | 1899 | { if (current_name != NULL) { |
1942 | error_with_pos("unexpected second declaration name"); | 1900 | error_with_pos("unexpected second declaration name"); |
1943 | YYERROR; | 1901 | YYERROR; |
@@ -1945,361 +1903,276 @@ yyreduce: | |||
1945 | current_name = (*(yyvsp[(1) - (1)]))->string; | 1903 | current_name = (*(yyvsp[(1) - (1)]))->string; |
1946 | (yyval) = (yyvsp[(1) - (1)]); | 1904 | (yyval) = (yyvsp[(1) - (1)]); |
1947 | } | 1905 | } |
1948 | ;} | 1906 | } |
1949 | break; | 1907 | break; |
1950 | 1908 | ||
1951 | case 69: | 1909 | case 69: |
1952 | 1910 | ||
1953 | /* Line 1455 of yacc.c */ | 1911 | { (yyval) = (yyvsp[(4) - (4)]); } |
1954 | #line 302 "scripts/genksyms/parse.y" | ||
1955 | { (yyval) = (yyvsp[(4) - (4)]); ;} | ||
1956 | break; | 1912 | break; |
1957 | 1913 | ||
1958 | case 70: | 1914 | case 70: |
1959 | 1915 | ||
1960 | /* Line 1455 of yacc.c */ | 1916 | { (yyval) = (yyvsp[(4) - (4)]); } |
1961 | #line 304 "scripts/genksyms/parse.y" | ||
1962 | { (yyval) = (yyvsp[(4) - (4)]); ;} | ||
1963 | break; | 1917 | break; |
1964 | 1918 | ||
1965 | case 71: | 1919 | case 71: |
1966 | 1920 | ||
1967 | /* Line 1455 of yacc.c */ | 1921 | { (yyval) = (yyvsp[(2) - (2)]); } |
1968 | #line 306 "scripts/genksyms/parse.y" | ||
1969 | { (yyval) = (yyvsp[(2) - (2)]); ;} | ||
1970 | break; | 1922 | break; |
1971 | 1923 | ||
1972 | case 72: | 1924 | case 72: |
1973 | 1925 | ||
1974 | /* Line 1455 of yacc.c */ | 1926 | { (yyval) = (yyvsp[(3) - (3)]); } |
1975 | #line 308 "scripts/genksyms/parse.y" | ||
1976 | { (yyval) = (yyvsp[(3) - (3)]); ;} | ||
1977 | break; | 1927 | break; |
1978 | 1928 | ||
1979 | case 73: | 1929 | case 73: |
1980 | 1930 | ||
1981 | /* Line 1455 of yacc.c */ | 1931 | { (yyval) = (yyvsp[(3) - (3)]); } |
1982 | #line 310 "scripts/genksyms/parse.y" | ||
1983 | { (yyval) = (yyvsp[(3) - (3)]); ;} | ||
1984 | break; | 1932 | break; |
1985 | 1933 | ||
1986 | case 74: | 1934 | case 74: |
1987 | 1935 | ||
1988 | /* Line 1455 of yacc.c */ | 1936 | { (yyval) = (yyvsp[(2) - (2)]); } |
1989 | #line 316 "scripts/genksyms/parse.y" | ||
1990 | { (yyval) = (yyvsp[(2) - (2)]); ;} | ||
1991 | break; | 1937 | break; |
1992 | 1938 | ||
1993 | case 78: | 1939 | case 78: |
1994 | 1940 | ||
1995 | /* Line 1455 of yacc.c */ | 1941 | { (yyval) = (yyvsp[(4) - (4)]); } |
1996 | #line 324 "scripts/genksyms/parse.y" | ||
1997 | { (yyval) = (yyvsp[(4) - (4)]); ;} | ||
1998 | break; | 1942 | break; |
1999 | 1943 | ||
2000 | case 79: | 1944 | case 79: |
2001 | 1945 | ||
2002 | /* Line 1455 of yacc.c */ | 1946 | { (yyval) = (yyvsp[(4) - (4)]); } |
2003 | #line 326 "scripts/genksyms/parse.y" | ||
2004 | { (yyval) = (yyvsp[(4) - (4)]); ;} | ||
2005 | break; | 1947 | break; |
2006 | 1948 | ||
2007 | case 80: | 1949 | case 80: |
2008 | 1950 | ||
2009 | /* Line 1455 of yacc.c */ | 1951 | { (yyval) = (yyvsp[(2) - (2)]); } |
2010 | #line 328 "scripts/genksyms/parse.y" | ||
2011 | { (yyval) = (yyvsp[(2) - (2)]); ;} | ||
2012 | break; | 1952 | break; |
2013 | 1953 | ||
2014 | case 81: | 1954 | case 81: |
2015 | 1955 | ||
2016 | /* Line 1455 of yacc.c */ | 1956 | { (yyval) = (yyvsp[(3) - (3)]); } |
2017 | #line 330 "scripts/genksyms/parse.y" | ||
2018 | { (yyval) = (yyvsp[(3) - (3)]); ;} | ||
2019 | break; | 1957 | break; |
2020 | 1958 | ||
2021 | case 82: | 1959 | case 82: |
2022 | 1960 | ||
2023 | /* Line 1455 of yacc.c */ | 1961 | { (yyval) = (yyvsp[(3) - (3)]); } |
2024 | #line 332 "scripts/genksyms/parse.y" | ||
2025 | { (yyval) = (yyvsp[(3) - (3)]); ;} | ||
2026 | break; | 1962 | break; |
2027 | 1963 | ||
2028 | case 83: | 1964 | case 83: |
2029 | 1965 | ||
2030 | /* Line 1455 of yacc.c */ | 1966 | { (yyval) = (yyvsp[(2) - (2)]); } |
2031 | #line 336 "scripts/genksyms/parse.y" | ||
2032 | { (yyval) = (yyvsp[(2) - (2)]); ;} | ||
2033 | break; | 1967 | break; |
2034 | 1968 | ||
2035 | case 85: | 1969 | case 85: |
2036 | 1970 | ||
2037 | /* Line 1455 of yacc.c */ | 1971 | { (yyval) = (yyvsp[(3) - (3)]); } |
2038 | #line 338 "scripts/genksyms/parse.y" | ||
2039 | { (yyval) = (yyvsp[(3) - (3)]); ;} | ||
2040 | break; | 1972 | break; |
2041 | 1973 | ||
2042 | case 86: | 1974 | case 86: |
2043 | 1975 | ||
2044 | /* Line 1455 of yacc.c */ | 1976 | { (yyval) = NULL; } |
2045 | #line 342 "scripts/genksyms/parse.y" | ||
2046 | { (yyval) = NULL; ;} | ||
2047 | break; | 1977 | break; |
2048 | 1978 | ||
2049 | case 89: | 1979 | case 89: |
2050 | 1980 | ||
2051 | /* Line 1455 of yacc.c */ | 1981 | { (yyval) = (yyvsp[(3) - (3)]); } |
2052 | #line 349 "scripts/genksyms/parse.y" | ||
2053 | { (yyval) = (yyvsp[(3) - (3)]); ;} | ||
2054 | break; | 1982 | break; |
2055 | 1983 | ||
2056 | case 90: | 1984 | case 90: |
2057 | 1985 | ||
2058 | /* Line 1455 of yacc.c */ | 1986 | { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); } |
2059 | #line 354 "scripts/genksyms/parse.y" | ||
2060 | { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;} | ||
2061 | break; | 1987 | break; |
2062 | 1988 | ||
2063 | case 91: | 1989 | case 91: |
2064 | 1990 | ||
2065 | /* Line 1455 of yacc.c */ | 1991 | { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); } |
2066 | #line 359 "scripts/genksyms/parse.y" | ||
2067 | { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;} | ||
2068 | break; | 1992 | break; |
2069 | 1993 | ||
2070 | case 93: | 1994 | case 93: |
2071 | 1995 | ||
2072 | /* Line 1455 of yacc.c */ | 1996 | { (yyval) = NULL; } |
2073 | #line 364 "scripts/genksyms/parse.y" | ||
2074 | { (yyval) = NULL; ;} | ||
2075 | break; | 1997 | break; |
2076 | 1998 | ||
2077 | case 94: | 1999 | case 94: |
2078 | 2000 | ||
2079 | /* Line 1455 of yacc.c */ | ||
2080 | #line 366 "scripts/genksyms/parse.y" | ||
2081 | { /* For version 2 checksums, we don't want to remember | 2001 | { /* For version 2 checksums, we don't want to remember |
2082 | private parameter names. */ | 2002 | private parameter names. */ |
2083 | remove_node((yyvsp[(1) - (1)])); | 2003 | remove_node((yyvsp[(1) - (1)])); |
2084 | (yyval) = (yyvsp[(1) - (1)]); | 2004 | (yyval) = (yyvsp[(1) - (1)]); |
2085 | ;} | 2005 | } |
2086 | break; | 2006 | break; |
2087 | 2007 | ||
2088 | case 95: | 2008 | case 95: |
2089 | 2009 | ||
2090 | /* Line 1455 of yacc.c */ | ||
2091 | #line 374 "scripts/genksyms/parse.y" | ||
2092 | { remove_node((yyvsp[(1) - (1)])); | 2010 | { remove_node((yyvsp[(1) - (1)])); |
2093 | (yyval) = (yyvsp[(1) - (1)]); | 2011 | (yyval) = (yyvsp[(1) - (1)]); |
2094 | ;} | 2012 | } |
2095 | break; | 2013 | break; |
2096 | 2014 | ||
2097 | case 96: | 2015 | case 96: |
2098 | 2016 | ||
2099 | /* Line 1455 of yacc.c */ | 2017 | { (yyval) = (yyvsp[(4) - (4)]); } |
2100 | #line 378 "scripts/genksyms/parse.y" | ||
2101 | { (yyval) = (yyvsp[(4) - (4)]); ;} | ||
2102 | break; | 2018 | break; |
2103 | 2019 | ||
2104 | case 97: | 2020 | case 97: |
2105 | 2021 | ||
2106 | /* Line 1455 of yacc.c */ | 2022 | { (yyval) = (yyvsp[(4) - (4)]); } |
2107 | #line 380 "scripts/genksyms/parse.y" | ||
2108 | { (yyval) = (yyvsp[(4) - (4)]); ;} | ||
2109 | break; | 2023 | break; |
2110 | 2024 | ||
2111 | case 98: | 2025 | case 98: |
2112 | 2026 | ||
2113 | /* Line 1455 of yacc.c */ | 2027 | { (yyval) = (yyvsp[(2) - (2)]); } |
2114 | #line 382 "scripts/genksyms/parse.y" | ||
2115 | { (yyval) = (yyvsp[(2) - (2)]); ;} | ||
2116 | break; | 2028 | break; |
2117 | 2029 | ||
2118 | case 99: | 2030 | case 99: |
2119 | 2031 | ||
2120 | /* Line 1455 of yacc.c */ | 2032 | { (yyval) = (yyvsp[(3) - (3)]); } |
2121 | #line 384 "scripts/genksyms/parse.y" | ||
2122 | { (yyval) = (yyvsp[(3) - (3)]); ;} | ||
2123 | break; | 2033 | break; |
2124 | 2034 | ||
2125 | case 100: | 2035 | case 100: |
2126 | 2036 | ||
2127 | /* Line 1455 of yacc.c */ | 2037 | { (yyval) = (yyvsp[(3) - (3)]); } |
2128 | #line 386 "scripts/genksyms/parse.y" | ||
2129 | { (yyval) = (yyvsp[(3) - (3)]); ;} | ||
2130 | break; | 2038 | break; |
2131 | 2039 | ||
2132 | case 101: | 2040 | case 101: |
2133 | 2041 | ||
2134 | /* Line 1455 of yacc.c */ | ||
2135 | #line 391 "scripts/genksyms/parse.y" | ||
2136 | { struct string_list *decl = *(yyvsp[(2) - (3)]); | 2042 | { struct string_list *decl = *(yyvsp[(2) - (3)]); |
2137 | *(yyvsp[(2) - (3)]) = NULL; | 2043 | *(yyvsp[(2) - (3)]) = NULL; |
2138 | add_symbol(current_name, SYM_NORMAL, decl, is_extern); | 2044 | add_symbol(current_name, SYM_NORMAL, decl, is_extern); |
2139 | (yyval) = (yyvsp[(3) - (3)]); | 2045 | (yyval) = (yyvsp[(3) - (3)]); |
2140 | ;} | 2046 | } |
2141 | break; | 2047 | break; |
2142 | 2048 | ||
2143 | case 102: | 2049 | case 102: |
2144 | 2050 | ||
2145 | /* Line 1455 of yacc.c */ | 2051 | { (yyval) = NULL; } |
2146 | #line 399 "scripts/genksyms/parse.y" | ||
2147 | { (yyval) = NULL; ;} | ||
2148 | break; | 2052 | break; |
2149 | 2053 | ||
2150 | case 104: | 2054 | case 104: |
2151 | 2055 | ||
2152 | /* Line 1455 of yacc.c */ | 2056 | { remove_list((yyvsp[(2) - (2)]), &(*(yyvsp[(1) - (2)]))->next); (yyval) = (yyvsp[(2) - (2)]); } |
2153 | #line 406 "scripts/genksyms/parse.y" | ||
2154 | { remove_list((yyvsp[(2) - (2)]), &(*(yyvsp[(1) - (2)]))->next); (yyval) = (yyvsp[(2) - (2)]); ;} | ||
2155 | break; | 2057 | break; |
2156 | 2058 | ||
2157 | case 105: | 2059 | case 105: |
2158 | 2060 | ||
2159 | /* Line 1455 of yacc.c */ | 2061 | { (yyval) = (yyvsp[(3) - (3)]); } |
2160 | #line 410 "scripts/genksyms/parse.y" | ||
2161 | { (yyval) = (yyvsp[(3) - (3)]); ;} | ||
2162 | break; | 2062 | break; |
2163 | 2063 | ||
2164 | case 106: | 2064 | case 106: |
2165 | 2065 | ||
2166 | /* Line 1455 of yacc.c */ | 2066 | { (yyval) = (yyvsp[(3) - (3)]); } |
2167 | #line 411 "scripts/genksyms/parse.y" | ||
2168 | { (yyval) = (yyvsp[(3) - (3)]); ;} | ||
2169 | break; | 2067 | break; |
2170 | 2068 | ||
2171 | case 107: | 2069 | case 107: |
2172 | 2070 | ||
2173 | /* Line 1455 of yacc.c */ | 2071 | { (yyval) = NULL; } |
2174 | #line 415 "scripts/genksyms/parse.y" | ||
2175 | { (yyval) = NULL; ;} | ||
2176 | break; | 2072 | break; |
2177 | 2073 | ||
2178 | case 110: | 2074 | case 110: |
2179 | 2075 | ||
2180 | /* Line 1455 of yacc.c */ | 2076 | { (yyval) = (yyvsp[(2) - (2)]); } |
2181 | #line 421 "scripts/genksyms/parse.y" | ||
2182 | { (yyval) = (yyvsp[(2) - (2)]); ;} | ||
2183 | break; | 2077 | break; |
2184 | 2078 | ||
2185 | case 111: | 2079 | case 111: |
2186 | 2080 | ||
2187 | /* Line 1455 of yacc.c */ | 2081 | { (yyval) = (yyvsp[(3) - (3)]); } |
2188 | #line 426 "scripts/genksyms/parse.y" | ||
2189 | { (yyval) = (yyvsp[(3) - (3)]); ;} | ||
2190 | break; | 2082 | break; |
2191 | 2083 | ||
2192 | case 112: | 2084 | case 112: |
2193 | 2085 | ||
2194 | /* Line 1455 of yacc.c */ | 2086 | { (yyval) = (yyvsp[(2) - (2)]); } |
2195 | #line 428 "scripts/genksyms/parse.y" | ||
2196 | { (yyval) = (yyvsp[(2) - (2)]); ;} | ||
2197 | break; | 2087 | break; |
2198 | 2088 | ||
2199 | case 113: | 2089 | case 113: |
2200 | 2090 | ||
2201 | /* Line 1455 of yacc.c */ | 2091 | { (yyval) = NULL; } |
2202 | #line 432 "scripts/genksyms/parse.y" | ||
2203 | { (yyval) = NULL; ;} | ||
2204 | break; | 2092 | break; |
2205 | 2093 | ||
2206 | case 116: | 2094 | case 116: |
2207 | 2095 | ||
2208 | /* Line 1455 of yacc.c */ | 2096 | { (yyval) = (yyvsp[(3) - (3)]); } |
2209 | #line 438 "scripts/genksyms/parse.y" | ||
2210 | { (yyval) = (yyvsp[(3) - (3)]); ;} | ||
2211 | break; | 2097 | break; |
2212 | 2098 | ||
2213 | case 117: | 2099 | case 117: |
2214 | 2100 | ||
2215 | /* Line 1455 of yacc.c */ | 2101 | { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); } |
2216 | #line 442 "scripts/genksyms/parse.y" | ||
2217 | { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;} | ||
2218 | break; | 2102 | break; |
2219 | 2103 | ||
2220 | case 118: | 2104 | case 118: |
2221 | 2105 | ||
2222 | /* Line 1455 of yacc.c */ | 2106 | { (yyval) = (yyvsp[(2) - (2)]); } |
2223 | #line 443 "scripts/genksyms/parse.y" | ||
2224 | { (yyval) = (yyvsp[(2) - (2)]); ;} | ||
2225 | break; | 2107 | break; |
2226 | 2108 | ||
2227 | case 120: | 2109 | case 120: |
2228 | 2110 | ||
2229 | /* Line 1455 of yacc.c */ | 2111 | { (yyval) = (yyvsp[(2) - (2)]); } |
2230 | #line 448 "scripts/genksyms/parse.y" | ||
2231 | { (yyval) = (yyvsp[(2) - (2)]); ;} | ||
2232 | break; | 2112 | break; |
2233 | 2113 | ||
2234 | case 121: | 2114 | case 121: |
2235 | 2115 | ||
2236 | /* Line 1455 of yacc.c */ | 2116 | { (yyval) = NULL; } |
2237 | #line 452 "scripts/genksyms/parse.y" | ||
2238 | { (yyval) = NULL; ;} | ||
2239 | break; | 2117 | break; |
2240 | 2118 | ||
2241 | case 123: | 2119 | case 123: |
2242 | 2120 | ||
2243 | /* Line 1455 of yacc.c */ | 2121 | { (yyval) = (yyvsp[(3) - (3)]); } |
2244 | #line 457 "scripts/genksyms/parse.y" | ||
2245 | { (yyval) = (yyvsp[(3) - (3)]); ;} | ||
2246 | break; | 2122 | break; |
2247 | 2123 | ||
2248 | case 124: | 2124 | case 124: |
2249 | 2125 | ||
2250 | /* Line 1455 of yacc.c */ | 2126 | { (yyval) = (yyvsp[(4) - (4)]); } |
2251 | #line 458 "scripts/genksyms/parse.y" | ||
2252 | { (yyval) = (yyvsp[(4) - (4)]); ;} | ||
2253 | break; | 2127 | break; |
2254 | 2128 | ||
2255 | case 127: | 2129 | case 127: |
2256 | 2130 | ||
2257 | /* Line 1455 of yacc.c */ | ||
2258 | #line 467 "scripts/genksyms/parse.y" | ||
2259 | { | 2131 | { |
2260 | const char *name = strdup((*(yyvsp[(1) - (1)]))->string); | 2132 | const char *name = strdup((*(yyvsp[(1) - (1)]))->string); |
2261 | add_symbol(name, SYM_ENUM_CONST, NULL, 0); | 2133 | add_symbol(name, SYM_ENUM_CONST, NULL, 0); |
2262 | ;} | 2134 | } |
2263 | break; | 2135 | break; |
2264 | 2136 | ||
2265 | case 128: | 2137 | case 128: |
2266 | 2138 | ||
2267 | /* Line 1455 of yacc.c */ | ||
2268 | #line 472 "scripts/genksyms/parse.y" | ||
2269 | { | 2139 | { |
2270 | const char *name = strdup((*(yyvsp[(1) - (3)]))->string); | 2140 | const char *name = strdup((*(yyvsp[(1) - (3)]))->string); |
2271 | struct string_list *expr = copy_list_range(*(yyvsp[(3) - (3)]), *(yyvsp[(2) - (3)])); | 2141 | struct string_list *expr = copy_list_range(*(yyvsp[(3) - (3)]), *(yyvsp[(2) - (3)])); |
2272 | add_symbol(name, SYM_ENUM_CONST, expr, 0); | 2142 | add_symbol(name, SYM_ENUM_CONST, expr, 0); |
2273 | ;} | 2143 | } |
2274 | break; | 2144 | break; |
2275 | 2145 | ||
2276 | case 129: | 2146 | case 129: |
2277 | 2147 | ||
2278 | /* Line 1455 of yacc.c */ | 2148 | { (yyval) = (yyvsp[(2) - (2)]); } |
2279 | #line 479 "scripts/genksyms/parse.y" | ||
2280 | { (yyval) = (yyvsp[(2) - (2)]); ;} | ||
2281 | break; | 2149 | break; |
2282 | 2150 | ||
2283 | case 130: | 2151 | case 130: |
2284 | 2152 | ||
2285 | /* Line 1455 of yacc.c */ | 2153 | { (yyval) = NULL; } |
2286 | #line 483 "scripts/genksyms/parse.y" | ||
2287 | { (yyval) = NULL; ;} | ||
2288 | break; | 2154 | break; |
2289 | 2155 | ||
2290 | case 132: | 2156 | case 132: |
2291 | 2157 | ||
2292 | /* Line 1455 of yacc.c */ | 2158 | { export_symbol((*(yyvsp[(3) - (5)]))->string); (yyval) = (yyvsp[(5) - (5)]); } |
2293 | #line 489 "scripts/genksyms/parse.y" | ||
2294 | { export_symbol((*(yyvsp[(3) - (5)]))->string); (yyval) = (yyvsp[(5) - (5)]); ;} | ||
2295 | break; | 2159 | break; |
2296 | 2160 | ||
2297 | 2161 | ||
2298 | 2162 | ||
2299 | /* Line 1455 of yacc.c */ | ||
2300 | #line 2301 "scripts/genksyms/parse.c" | ||
2301 | default: break; | 2163 | default: break; |
2302 | } | 2164 | } |
2165 | /* User semantic actions sometimes alter yychar, and that requires | ||
2166 | that yytoken be updated with the new translation. We take the | ||
2167 | approach of translating immediately before every use of yytoken. | ||
2168 | One alternative is translating here after every semantic action, | ||
2169 | but that translation would be missed if the semantic action invokes | ||
2170 | YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or | ||
2171 | if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an | ||
2172 | incorrect destructor might then be invoked immediately. In the | ||
2173 | case of YYERROR or YYBACKUP, subsequent parser actions might lead | ||
2174 | to an incorrect destructor call or verbose syntax error message | ||
2175 | before the lookahead is translated. */ | ||
2303 | YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); | 2176 | YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); |
2304 | 2177 | ||
2305 | YYPOPSTACK (yylen); | 2178 | YYPOPSTACK (yylen); |
@@ -2327,6 +2200,10 @@ yyreduce: | |||
2327 | | yyerrlab -- here on detecting error | | 2200 | | yyerrlab -- here on detecting error | |
2328 | `------------------------------------*/ | 2201 | `------------------------------------*/ |
2329 | yyerrlab: | 2202 | yyerrlab: |
2203 | /* Make sure we have latest lookahead translation. See comments at | ||
2204 | user semantic actions for why this is necessary. */ | ||
2205 | yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); | ||
2206 | |||
2330 | /* If not already recovering from an error, report this error. */ | 2207 | /* If not already recovering from an error, report this error. */ |
2331 | if (!yyerrstatus) | 2208 | if (!yyerrstatus) |
2332 | { | 2209 | { |
@@ -2334,37 +2211,36 @@ yyerrlab: | |||
2334 | #if ! YYERROR_VERBOSE | 2211 | #if ! YYERROR_VERBOSE |
2335 | yyerror (YY_("syntax error")); | 2212 | yyerror (YY_("syntax error")); |
2336 | #else | 2213 | #else |
2214 | # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ | ||
2215 | yyssp, yytoken) | ||
2337 | { | 2216 | { |
2338 | YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); | 2217 | char const *yymsgp = YY_("syntax error"); |
2339 | if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) | 2218 | int yysyntax_error_status; |
2340 | { | 2219 | yysyntax_error_status = YYSYNTAX_ERROR; |
2341 | YYSIZE_T yyalloc = 2 * yysize; | 2220 | if (yysyntax_error_status == 0) |
2342 | if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) | 2221 | yymsgp = yymsg; |
2343 | yyalloc = YYSTACK_ALLOC_MAXIMUM; | 2222 | else if (yysyntax_error_status == 1) |
2344 | if (yymsg != yymsgbuf) | 2223 | { |
2345 | YYSTACK_FREE (yymsg); | 2224 | if (yymsg != yymsgbuf) |
2346 | yymsg = (char *) YYSTACK_ALLOC (yyalloc); | 2225 | YYSTACK_FREE (yymsg); |
2347 | if (yymsg) | 2226 | yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); |
2348 | yymsg_alloc = yyalloc; | 2227 | if (!yymsg) |
2349 | else | 2228 | { |
2350 | { | 2229 | yymsg = yymsgbuf; |
2351 | yymsg = yymsgbuf; | 2230 | yymsg_alloc = sizeof yymsgbuf; |
2352 | yymsg_alloc = sizeof yymsgbuf; | 2231 | yysyntax_error_status = 2; |
2353 | } | 2232 | } |
2354 | } | 2233 | else |
2355 | 2234 | { | |
2356 | if (0 < yysize && yysize <= yymsg_alloc) | 2235 | yysyntax_error_status = YYSYNTAX_ERROR; |
2357 | { | 2236 | yymsgp = yymsg; |
2358 | (void) yysyntax_error (yymsg, yystate, yychar); | 2237 | } |
2359 | yyerror (yymsg); | 2238 | } |
2360 | } | 2239 | yyerror (yymsgp); |
2361 | else | 2240 | if (yysyntax_error_status == 2) |
2362 | { | 2241 | goto yyexhaustedlab; |
2363 | yyerror (YY_("syntax error")); | ||
2364 | if (yysize != 0) | ||
2365 | goto yyexhaustedlab; | ||
2366 | } | ||
2367 | } | 2242 | } |
2243 | # undef YYSYNTAX_ERROR | ||
2368 | #endif | 2244 | #endif |
2369 | } | 2245 | } |
2370 | 2246 | ||
@@ -2423,7 +2299,7 @@ yyerrlab1: | |||
2423 | for (;;) | 2299 | for (;;) |
2424 | { | 2300 | { |
2425 | yyn = yypact[yystate]; | 2301 | yyn = yypact[yystate]; |
2426 | if (yyn != YYPACT_NINF) | 2302 | if (!yypact_value_is_default (yyn)) |
2427 | { | 2303 | { |
2428 | yyn += YYTERROR; | 2304 | yyn += YYTERROR; |
2429 | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) | 2305 | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) |
@@ -2482,8 +2358,13 @@ yyexhaustedlab: | |||
2482 | 2358 | ||
2483 | yyreturn: | 2359 | yyreturn: |
2484 | if (yychar != YYEMPTY) | 2360 | if (yychar != YYEMPTY) |
2485 | yydestruct ("Cleanup: discarding lookahead", | 2361 | { |
2486 | yytoken, &yylval); | 2362 | /* Make sure we have latest lookahead translation. See comments at |
2363 | user semantic actions for why this is necessary. */ | ||
2364 | yytoken = YYTRANSLATE (yychar); | ||
2365 | yydestruct ("Cleanup: discarding lookahead", | ||
2366 | yytoken, &yylval); | ||
2367 | } | ||
2487 | /* Do not reclaim the symbols of the rule which action triggered | 2368 | /* Do not reclaim the symbols of the rule which action triggered |
2488 | this YYABORT or YYACCEPT. */ | 2369 | this YYABORT or YYACCEPT. */ |
2489 | YYPOPSTACK (yylen); | 2370 | YYPOPSTACK (yylen); |
@@ -2508,8 +2389,6 @@ yyreturn: | |||
2508 | 2389 | ||
2509 | 2390 | ||
2510 | 2391 | ||
2511 | /* Line 1675 of yacc.c */ | ||
2512 | #line 493 "scripts/genksyms/parse.y" | ||
2513 | 2392 | ||
2514 | 2393 | ||
2515 | static void | 2394 | static void |
diff --git a/scripts/genksyms/parse.h_shipped b/scripts/genksyms/parse.tab.h_shipped index 51752366925..93240a3cdec 100644 --- a/scripts/genksyms/parse.h_shipped +++ b/scripts/genksyms/parse.tab.h_shipped | |||
@@ -1,10 +1,8 @@ | |||
1 | /* A Bison parser, made by GNU Bison 2.5. */ | ||
1 | 2 | ||
2 | /* A Bison parser, made by GNU Bison 2.4.1. */ | 3 | /* Bison interface for Yacc-like parsers in C |
3 | |||
4 | /* Skeleton interface for Bison's Yacc-like parsers in C | ||
5 | 4 | ||
6 | Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 | 5 | Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. |
7 | Free Software Foundation, Inc. | ||
8 | 6 | ||
9 | This program is free software: you can redistribute it and/or modify | 7 | This program is free software: you can redistribute it and/or modify |
10 | it under the terms of the GNU General Public License as published by | 8 | it under the terms of the GNU General Public License as published by |
diff --git a/scripts/genksyms/parse.y b/scripts/genksyms/parse.y index ba5c242866c..23c39998ad8 100644 --- a/scripts/genksyms/parse.y +++ b/scripts/genksyms/parse.y | |||
@@ -51,6 +51,25 @@ remove_list(struct string_list **pb, struct string_list **pe) | |||
51 | free_list(b, e); | 51 | free_list(b, e); |
52 | } | 52 | } |
53 | 53 | ||
54 | /* Record definition of a struct/union/enum */ | ||
55 | static void record_compound(struct string_list **keyw, | ||
56 | struct string_list **ident, | ||
57 | struct string_list **body, | ||
58 | enum symbol_type type) | ||
59 | { | ||
60 | struct string_list *b = *body, *i = *ident, *r; | ||
61 | |||
62 | if (i->in_source_file) { | ||
63 | remove_node(keyw); | ||
64 | (*ident)->tag = type; | ||
65 | remove_list(body, ident); | ||
66 | return; | ||
67 | } | ||
68 | r = copy_node(i); r->tag = type; | ||
69 | r->next = (*keyw)->next; *body = r; (*keyw)->next = NULL; | ||
70 | add_symbol(i->string, type, b, is_extern); | ||
71 | } | ||
72 | |||
54 | %} | 73 | %} |
55 | 74 | ||
56 | %token ASM_KEYW | 75 | %token ASM_KEYW |
@@ -215,26 +234,11 @@ type_specifier: | |||
215 | 234 | ||
216 | /* Full definitions of an s/u/e. Record it. */ | 235 | /* Full definitions of an s/u/e. Record it. */ |
217 | | STRUCT_KEYW IDENT class_body | 236 | | STRUCT_KEYW IDENT class_body |
218 | { struct string_list *s = *$3, *i = *$2, *r; | 237 | { record_compound($1, $2, $3, SYM_STRUCT); $$ = $3; } |
219 | r = copy_node(i); r->tag = SYM_STRUCT; | ||
220 | r->next = (*$1)->next; *$3 = r; (*$1)->next = NULL; | ||
221 | add_symbol(i->string, SYM_STRUCT, s, is_extern); | ||
222 | $$ = $3; | ||
223 | } | ||
224 | | UNION_KEYW IDENT class_body | 238 | | UNION_KEYW IDENT class_body |
225 | { struct string_list *s = *$3, *i = *$2, *r; | 239 | { record_compound($1, $2, $3, SYM_UNION); $$ = $3; } |
226 | r = copy_node(i); r->tag = SYM_UNION; | ||
227 | r->next = (*$1)->next; *$3 = r; (*$1)->next = NULL; | ||
228 | add_symbol(i->string, SYM_UNION, s, is_extern); | ||
229 | $$ = $3; | ||
230 | } | ||
231 | | ENUM_KEYW IDENT enum_body | 240 | | ENUM_KEYW IDENT enum_body |
232 | { struct string_list *s = *$3, *i = *$2, *r; | 241 | { record_compound($1, $2, $3, SYM_ENUM); $$ = $3; } |
233 | r = copy_node(i); r->tag = SYM_ENUM; | ||
234 | r->next = (*$1)->next; *$3 = r; (*$1)->next = NULL; | ||
235 | add_symbol(i->string, SYM_ENUM, s, is_extern); | ||
236 | $$ = $3; | ||
237 | } | ||
238 | /* | 242 | /* |
239 | * Anonymous enum definition. Tell add_symbol() to restart its counter. | 243 | * Anonymous enum definition. Tell add_symbol() to restart its counter. |
240 | */ | 244 | */ |