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 | |
| 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')
| -rw-r--r-- | scripts/genksyms/lex.c_shipped | 30 | ||||
| -rw-r--r-- | scripts/genksyms/parse.c_shipped | 1071 | ||||
| -rw-r--r-- | scripts/genksyms/parse.h_shipped | 72 |
3 files changed, 661 insertions, 512 deletions
diff --git a/scripts/genksyms/lex.c_shipped b/scripts/genksyms/lex.c_shipped index f231c0810c6..af4939041e4 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; |
diff --git a/scripts/genksyms/parse.c_shipped b/scripts/genksyms/parse.c_shipped index 809b949e495..1a0b8607fb0 100644 --- a/scripts/genksyms/parse.c_shipped +++ b/scripts/genksyms/parse.c_shipped | |||
| @@ -1,24 +1,23 @@ | |||
| 1 | /* A Bison parser, made by GNU Bison 2.3. */ | ||
| 2 | 1 | ||
| 3 | /* Skeleton implementation for Bison's Yacc-like parsers in C | 2 | /* A Bison parser, made by GNU Bison 2.4.1. */ |
| 4 | 3 | ||
| 5 | Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 | 4 | /* Skeleton implementation for Bison's Yacc-like parsers in C |
| 5 | |||
| 6 | Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 | ||
| 6 | Free Software Foundation, Inc. | 7 | Free Software Foundation, Inc. |
| 7 | 8 | ||
| 8 | This program is free software; you can redistribute it and/or modify | 9 | This program is free software: you can redistribute it and/or modify |
| 9 | it under the terms of the GNU General Public License as published by | 10 | it under the terms of the GNU General Public License as published by |
| 10 | the Free Software Foundation; either version 2, or (at your option) | 11 | the Free Software Foundation, either version 3 of the License, or |
| 11 | any later version. | 12 | (at your option) any later version. |
| 12 | 13 | ||
| 13 | This program is distributed in the hope that it will be useful, | 14 | This program is distributed in the hope that it will be useful, |
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | GNU General Public License for more details. | 17 | GNU General Public License for more details. |
| 17 | 18 | ||
| 18 | You should have received a copy of the GNU General Public License | 19 | You should have received a copy of the GNU General Public License |
| 19 | along with this program; if not, write to the Free Software | 20 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
| 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
| 21 | Boston, MA 02110-1301, USA. */ | ||
| 22 | 21 | ||
| 23 | /* As a special exception, you may create a larger work that contains | 22 | /* As a special exception, you may create a larger work that contains |
| 24 | part or all of the Bison parser skeleton and distribute that work | 23 | part or all of the Bison parser skeleton and distribute that work |
| @@ -29,7 +28,7 @@ | |||
| 29 | special exception, which will cause the skeleton and the resulting | 28 | special exception, which will cause the skeleton and the resulting |
| 30 | Bison output files to be licensed under the GNU General Public | 29 | Bison output files to be licensed under the GNU General Public |
| 31 | License without this special exception. | 30 | License without this special exception. |
| 32 | 31 | ||
| 33 | This special exception was added by the Free Software Foundation in | 32 | This special exception was added by the Free Software Foundation in |
| 34 | version 2.2 of Bison. */ | 33 | version 2.2 of Bison. */ |
| 35 | 34 | ||
| @@ -47,7 +46,7 @@ | |||
| 47 | #define YYBISON 1 | 46 | #define YYBISON 1 |
| 48 | 47 | ||
| 49 | /* Bison version. */ | 48 | /* Bison version. */ |
| 50 | #define YYBISON_VERSION "2.3" | 49 | #define YYBISON_VERSION "2.4.1" |
| 51 | 50 | ||
| 52 | /* Skeleton name. */ | 51 | /* Skeleton name. */ |
| 53 | #define YYSKELETON_NAME "yacc.c" | 52 | #define YYSKELETON_NAME "yacc.c" |
| @@ -55,11 +54,75 @@ | |||
| 55 | /* Pure parsers. */ | 54 | /* Pure parsers. */ |
| 56 | #define YYPURE 0 | 55 | #define YYPURE 0 |
| 57 | 56 | ||
| 57 | /* Push parsers. */ | ||
| 58 | #define YYPUSH 0 | ||
| 59 | |||
| 60 | /* Pull parsers. */ | ||
| 61 | #define YYPULL 1 | ||
| 62 | |||
| 58 | /* Using locations. */ | 63 | /* Using locations. */ |
| 59 | #define YYLSP_NEEDED 0 | 64 | #define YYLSP_NEEDED 0 |
| 60 | 65 | ||
| 61 | 66 | ||
| 62 | 67 | ||
| 68 | /* Copy the first part of user declarations. */ | ||
| 69 | |||
| 70 | /* Line 189 of yacc.c */ | ||
| 71 | #line 24 "scripts/genksyms/parse.y" | ||
| 72 | |||
| 73 | |||
| 74 | #include <assert.h> | ||
| 75 | #include <stdlib.h> | ||
| 76 | #include <string.h> | ||
| 77 | #include "genksyms.h" | ||
| 78 | |||
| 79 | static int is_typedef; | ||
| 80 | static int is_extern; | ||
| 81 | static char *current_name; | ||
| 82 | static struct string_list *decl_spec; | ||
| 83 | |||
| 84 | static void yyerror(const char *); | ||
| 85 | |||
| 86 | static inline void | ||
| 87 | remove_node(struct string_list **p) | ||
| 88 | { | ||
| 89 | struct string_list *node = *p; | ||
| 90 | *p = node->next; | ||
| 91 | free_node(node); | ||
| 92 | } | ||
| 93 | |||
| 94 | static inline void | ||
| 95 | remove_list(struct string_list **pb, struct string_list **pe) | ||
| 96 | { | ||
| 97 | struct string_list *b = *pb, *e = *pe; | ||
| 98 | *pb = e; | ||
| 99 | free_list(b, e); | ||
| 100 | } | ||
| 101 | |||
| 102 | |||
| 103 | |||
| 104 | /* Line 189 of yacc.c */ | ||
| 105 | #line 106 "scripts/genksyms/parse.c" | ||
| 106 | |||
| 107 | /* Enabling traces. */ | ||
| 108 | #ifndef YYDEBUG | ||
| 109 | # define YYDEBUG 1 | ||
| 110 | #endif | ||
| 111 | |||
| 112 | /* Enabling verbose error messages. */ | ||
| 113 | #ifdef YYERROR_VERBOSE | ||
| 114 | # undef YYERROR_VERBOSE | ||
| 115 | # define YYERROR_VERBOSE 1 | ||
| 116 | #else | ||
| 117 | # define YYERROR_VERBOSE 0 | ||
| 118 | #endif | ||
| 119 | |||
