diff options
author | Michal Marek <mmarek@suse.cz> | 2011-02-15 10:04:35 -0500 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2011-03-17 10:13:56 -0400 |
commit | 303fc01fb12d95cf9ab88c496df6651c887cef3c (patch) | |
tree | bbfc1b170233aeac7f1f2b14f435a41c5d2c9959 /scripts/genksyms/lex.c_shipped | |
parent | e37ddb82500393cb417c3ab0fe0726d9a8652372 (diff) |
genksyms: Regenerate lexer and parser
Regenerated the parser after "genksyms: Track changes to enum
constants".
Signed-off-by: Michal Marek <mmarek@suse.cz>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/genksyms/lex.c_shipped')
-rw-r--r-- | scripts/genksyms/lex.c_shipped | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/scripts/genksyms/lex.c_shipped b/scripts/genksyms/lex.c_shipped index f231c0810c60..af4939041e4b 100644 --- a/scripts/genksyms/lex.c_shipped +++ b/scripts/genksyms/lex.c_shipped | |||
@@ -2253,12 +2253,23 @@ void yyfree (void * ptr ) | |||
2253 | 2253 | ||
2254 | /* Macros to append to our phrase collection list. */ | 2254 | /* Macros to append to our phrase collection list. */ |
2255 | 2255 | ||
2256 | /* | ||
2257 | * We mark any token, that that equals to a known enumerator, as | ||
2258 | * SYM_ENUM_CONST. The parser will change this for struct and union tags later, | ||
2259 | * the only problem is struct and union members: | ||
2260 | * enum e { a, b }; struct s { int a, b; } | ||
2261 | * but in this case, the only effect will be, that the ABI checksums become | ||
2262 | * more volatile, which is acceptable. Also, such collisions are quite rare, | ||
2263 | * so far it was only observed in include/linux/telephony.h. | ||
2264 | */ | ||
2256 | #define _APP(T,L) do { \ | 2265 | #define _APP(T,L) do { \ |
2257 | cur_node = next_node; \ | 2266 | cur_node = next_node; \ |
2258 | next_node = xmalloc(sizeof(*next_node)); \ | 2267 | next_node = xmalloc(sizeof(*next_node)); \ |
2259 | next_node->next = cur_node; \ | 2268 | next_node->next = cur_node; \ |
2260 | cur_node->string = memcpy(xmalloc(L+1), T, L+1); \ | 2269 | cur_node->string = memcpy(xmalloc(L+1), T, L+1); \ |
2261 | cur_node->tag = SYM_NORMAL; \ | 2270 | cur_node->tag = \ |
2271 | find_symbol(cur_node->string, SYM_ENUM_CONST, 1)?\ | ||
2272 | SYM_ENUM_CONST : SYM_NORMAL ; \ | ||
2262 | } while (0) | 2273 | } while (0) |
2263 | 2274 | ||
2264 | #define APP _APP(yytext, yyleng) | 2275 | #define APP _APP(yytext, yyleng) |
@@ -2336,8 +2347,8 @@ repeat: | |||
2336 | 2347 | ||
2337 | case STRUCT_KEYW: | 2348 | case STRUCT_KEYW: |
2338 | case UNION_KEYW: | 2349 | case UNION_KEYW: |
2339 | dont_want_brace_phrase = 3; | ||
2340 | case ENUM_KEYW: | 2350 | case ENUM_KEYW: |
2351 | dont_want_brace_phrase = 3; | ||
2341 | suppress_type_lookup = 2; | 2352 | suppress_type_lookup = 2; |
2342 | goto fini; | 2353 | goto fini; |
2343 | 2354 | ||
@@ -2466,7 +2477,20 @@ repeat: | |||
2466 | ++count; | 2477 | ++count; |
2467 | APP; | 2478 | APP; |
2468 | goto repeat; | 2479 | goto repeat; |
2469 | case ')': case ']': case '}': | 2480 | case '}': |
2481 | /* is this the last line of an enum declaration? */ | ||
2482 | if (count == 0) | ||
2483 | { | ||
2484 | /* Put back the token we just read so's we can find it again | ||
2485 | after registering the expression. */ | ||
2486 | unput(token); | ||
2487 | |||
2488 | lexstate = ST_NORMAL; | ||
2489 | token = EXPRESSION_PHRASE; | ||
2490 | break; | ||
2491 | } | ||
2492 | /* FALLTHRU */ | ||
2493 | case ')': case ']': | ||
2470 | --count; | 2494 | --count; |
2471 | APP; | 2495 | APP; |
2472 | goto repeat; | 2496 | goto repeat; |