aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2011-10-11 06:07:05 -0400
committerMichal Marek <mmarek@suse.cz>2011-10-11 06:07:05 -0400
commit0359de7dd501f694f01b61364c9b633eab41f494 (patch)
tree9c52b92a50c413a7453a8861fcf17d54f3214682
parent2c5925d6b7fedc8f1c325f4f85451f505ec69aca (diff)
genksyms: Regenerate lexer and parser
-rw-r--r--scripts/genksyms/lex.lex.c_shipped12
-rw-r--r--scripts/genksyms/parse.tab.c_shipped645
-rw-r--r--scripts/genksyms/parse.tab.h_shipped7
3 files changed, 358 insertions, 306 deletions
diff --git a/scripts/genksyms/lex.lex.c_shipped b/scripts/genksyms/lex.lex.c_shipped
index c83cf60410be..0bf4157e6161 100644
--- a/scripts/genksyms/lex.lex.c_shipped
+++ b/scripts/genksyms/lex.lex.c_shipped
@@ -660,7 +660,7 @@ static int input (void );
660/* 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,
661 * we now use fwrite(). 661 * we now use fwrite().
662 */ 662 */
663#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) 663#define ECHO fwrite( yytext, yyleng, 1, yyout )
664#endif 664#endif
665 665
666/* 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,
@@ -671,7 +671,7 @@ static int input (void );
671 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ 671 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
672 { \ 672 { \
673 int c = '*'; \ 673 int c = '*'; \
674 unsigned n; \ 674 int n; \
675 for ( n = 0; n < max_size && \ 675 for ( n = 0; n < max_size && \
676 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 676 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
677 buf[n] = (char) c; \ 677 buf[n] = (char) c; \
@@ -1926,6 +1926,7 @@ void yyfree (void * ptr )
1926 cur_node->tag = \ 1926 cur_node->tag = \
1927 find_symbol(cur_node->string, SYM_ENUM_CONST, 1)?\ 1927 find_symbol(cur_node->string, SYM_ENUM_CONST, 1)?\
1928 SYM_ENUM_CONST : SYM_NORMAL ; \ 1928 SYM_ENUM_CONST : SYM_NORMAL ; \
1929 cur_node->in_source_file = in_source_file; \
1929 } while (0) 1930 } while (0)
1930 1931
1931#define APP _APP(yytext, yyleng) 1932#define APP _APP(yytext, yyleng)
@@ -1975,6 +1976,13 @@ repeat:
1975 cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1); 1976 cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1);
1976 cur_line = atoi(yytext+2); 1977 cur_line = atoi(yytext+2);
1977 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
1978 goto repeat; 1986 goto repeat;
1979 } 1987 }
1980 1988
diff --git a/scripts/genksyms/parse.tab.c_shipped b/scripts/genksyms/parse.tab.c_shipped
index 61d4a5d09856..ece53c79bb59 100644
--- a/scripts/genksyms/parse.tab.c_shipped
+++ b/scripts/genksyms/parse.tab.c_shipped
@@ -1,9 +1,8 @@
1/* A Bison parser, made by GNU Bison 2.4.3. */ 1/* A Bison parser, made by GNU Bison 2.5. */
2 2
3/* Skeleton implementation for Bison's Yacc-like parsers in C 3/* Bison implementation for Yacc-like parsers in C
4 4
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 5 Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
6 2009, 2010 Free Software Foundation, Inc.
7 6
8 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
9 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
@@ -45,7 +44,7 @@
45#define YYBISON 1 44#define YYBISON 1
46 45
47/* Bison version. */ 46/* Bison version. */
48#define YYBISON_VERSION "2.4.3" 47#define YYBISON_VERSION "2.5"
49 48
50/* Skeleton name. */ 49/* Skeleton name. */
51#define YYSKELETON_NAME "yacc.c" 50#define YYSKELETON_NAME "yacc.c"
@@ -96,6 +95,25 @@ remove_list(struct string_list **pb, struct string_list **pe)
96 free_list(b, e); 95 free_list(b, e);
97} 96}
98 97
98/* Record definition of a struct/union/enum */
99static 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
99 117
100 118
101 119
@@ -283,11 +301,11 @@ YYID (yyi)
283# define alloca _alloca 301# define alloca _alloca
284# else 302# else
285# define YYSTACK_ALLOC alloca 303# define YYSTACK_ALLOC alloca
286# 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__ \
287 || defined __cplusplus || defined _MSC_VER) 305 || defined __cplusplus || defined _MSC_VER)
288# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 306# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
289# ifndef _STDLIB_H 307# ifndef EXIT_SUCCESS
290# define _STDLIB_H 1 308# define EXIT_SUCCESS 0
291# endif 309# endif
292# endif 310# endif
293# endif 311# endif
@@ -310,24 +328,24 @@ YYID (yyi)
310# ifndef YYSTACK_ALLOC_MAXIMUM 328# ifndef YYSTACK_ALLOC_MAXIMUM
311# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 329# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
312# endif 330# endif
313# if (defined __cplusplus && ! defined _STDLIB_H \ 331# if (defined __cplusplus && ! defined EXIT_SUCCESS \
314 && ! ((defined YYMALLOC || defined malloc) \ 332 && ! ((defined YYMALLOC || defined malloc) \
315 && (defined YYFREE || defined free))) 333 && (defined YYFREE || defined free)))
316# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 334# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
317# ifndef _STDLIB_H 335# ifndef EXIT_SUCCESS
318# define _STDLIB_H 1 336# define EXIT_SUCCESS 0
319# endif 337# endif
320# endif 338# endif
321# ifndef YYMALLOC 339# ifndef YYMALLOC
322# define YYMALLOC malloc 340# define YYMALLOC malloc
323# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ 341# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
324 || defined __cplusplus || defined _MSC_VER) 342 || defined __cplusplus || defined _MSC_VER)
325void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 343void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
326# endif 344# endif
327# endif 345# endif
328# ifndef YYFREE 346# ifndef YYFREE
329# define YYFREE free 347# define YYFREE free
330# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ 348# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
331 || defined __cplusplus || defined _MSC_VER) 349 || defined __cplusplus || defined _MSC_VER)
332void free (void *); /* INFRINGES ON USER NAME SPACE */ 350void free (void *); /* INFRINGES ON USER NAME SPACE */
333# endif 351# endif
@@ -356,23 +374,7 @@ union yyalloc
356 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 374 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
357 + YYSTACK_GAP_MAXIMUM) 375 + YYSTACK_GAP_MAXIMUM)
358 376
359/* Copy COUNT objects from FROM to TO. The source and destination do 377# define YYCOPY_NEEDED 1
360 not overlap. */
361# ifndef YYCOPY
362# if defined __GNUC__ && 1 < __GNUC__
363# define YYCOPY(To, From, Count) \
364 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
365# else
366# define YYCOPY(To, From, Count) \
367 do \
368 { \
369 YYSIZE_T yyi; \
370 for (yyi = 0; yyi < (Count); yyi++) \
371 (To)[yyi] = (From)[yyi]; \
372 } \
373 while (YYID (0))
374# endif
375# endif
376 378
377/* Relocate STACK from its old location to the new one. The 379/* Relocate STACK from its old location to the new one. The
378 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
@@ -392,6 +394,26 @@ union yyalloc
392 394
393#endif 395#endif
394 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
395/* YYFINAL -- State number of the termination state. */ 417/* YYFINAL -- State number of the termination state. */
396#define YYFINAL 4 418#define YYFINAL 4
397/* YYLAST -- Last index in YYTABLE. */ 419/* YYLAST -- Last index in YYTABLE. */
@@ -514,20 +536,20 @@ static const yytype_int8 yyrhs[] =
514/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 536/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
515static const yytype_uint16 yyrline[] = 537static const yytype_uint16 yyrline[] =
516{ 538{
517 0, 104, 104, 105, 109, 109, 115, 115, 117, 117, 539 0, 123, 123, 124, 128, 128, 134, 134, 136, 136,
518 119, 120, 121, 122, 123, 124, 128, 142, 143, 147, 540 138, 139, 140, 141, 142, 143, 147, 161, 162, 166,
519 155, 168, 174, 175, 179, 180, 184, 190, 194, 195, 541 174, 187, 193, 194, 198, 199, 203, 209, 213, 214,
520 196, 197, 198, 202, 203, 204, 205, 209, 211, 213, 542 215, 216, 217, 221, 222, 223, 224, 228, 230, 232,
521 217, 224, 231, 241, 244, 245, 249, 250, 251, 252, 543 236, 238, 240, 245, 248, 249, 253, 254, 255, 256,
522 253, 254, 255, 256, 257, 258, 259, 263, 268, 269, 544 257, 258, 259, 260, 261, 262, 263, 267, 272, 273,
523 273, 274, 278, 278, 278, 279, 287, 288, 292, 301, 545 277, 278, 282, 282, 282, 283, 291, 292, 296, 305,
524 303, 305, 307, 309, 316, 317, 321, 322, 323, 325, 546 307, 309, 311, 313, 320, 321, 325, 326, 327, 329,
525 327, 329, 331, 336, 337, 338, 342, 343, 347, 348, 547 331, 333, 335, 340, 341, 342, 346, 347, 351, 352,
526 353, 358, 360, 364, 365, 373, 377, 379, 381, 383, 548 357, 362, 364, 368, 369, 377, 381, 383, 385, 387,
527 385, 390, 399, 400, 405, 410, 411, 415, 416, 420, 549 389, 394, 403, 404, 409, 414, 415, 419, 420, 424,
528 421, 425, 427, 432, 433, 437, 438, 442, 443, 444, 550 425, 429, 431, 436, 437, 441, 442, 446, 447, 448,
529 448, 452, 453, 457, 458, 462, 463, 466, 471, 479, 551 452, 456, 457, 461, 462, 466, 467, 470, 475, 483,
530 483, 484, 488 552 487, 488, 492
531}; 553};
532#endif 554#endif
533 555
@@ -618,8 +640,8 @@ static const yytype_uint8 yyr2[] =
618 0, 1, 5 640 0, 1, 5
619}; 641};
620 642
621/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state 643/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
622 STATE-NUM when YYTABLE doesn't specify something else to do. Zero 644 Performed when YYTABLE doesn't specify something else to do. Zero
623 means the default is an error. */ 645 means the default is an error. */
624static const yytype_uint8 yydefact[] = 646static const yytype_uint8 yydefact[] =
625{ 647{
@@ -692,8 +714,7 @@ static const yytype_int16 yypgoto[] =
692 714
693/* 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
694 positive, shift that token. If negative, reduce the rule which 716 positive, shift that token. If negative, reduce the rule which
695 number is the opposite. If zero, do what YYDEFACT says. 717 number is the opposite. If YYTABLE_NINF, syntax error. */
696 If YYTABLE_NINF, syntax error. */
697#define YYTABLE_NINF -109 718#define YYTABLE_NINF -109
698static const yytype_int16 yytable[] = 719static const yytype_int16 yytable[] =
699{ 720{
@@ -753,6 +774,12 @@ static const yytype_int16 yytable[] =
753 0, 0, 34 774 0, 0, 34
754}; 775};
755 776
777#define yypact_value_is_default(yystate) \
778 ((yystate) == (-135))
779
780#define yytable_value_is_error(yytable_value) \
781 YYID (0)
782
756static const yytype_int16 yycheck[] = 783static const yytype_int16 yycheck[] =
757{ 784{
758 59, 38, 79, 3, 1, 8, 56, 37, 26, 37, 785 59, 38, 79, 3, 1, 8, 56, 37, 26, 37,
@@ -869,7 +896,6 @@ do \
869 { \ 896 { \
870 yychar = (Token); \ 897 yychar = (Token); \
871 yylval = (Value); \ 898 yylval = (Value); \
872 yytoken = YYTRANSLATE (yychar); \
873 YYPOPSTACK (1); \ 899 YYPOPSTACK (1); \
874 goto yybackup; \ 900 goto yybackup; \
875 } \ 901 } \
@@ -911,19 +937,10 @@ while (YYID (0))
911#endif 937#endif
912 938
913 939
914/* YY_LOCATION_PRINT -- Print the location on the stream. 940/* This macro is provided for backward compatibility. */
915 This macro was not mandated originally: define only if we know
916 we won't break user code: when these are the locations we know. */
917 941
918#ifndef YY_LOCATION_PRINT 942#ifndef YY_LOCATION_PRINT
919# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL 943# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
920# define YY_LOCATION_PRINT(File, Loc) \
921 fprintf (File, "%d.%d-%d.%d", \
922 (Loc).first_line, (Loc).first_column, \
923 (Loc).last_line, (Loc).last_column)
924# else
925# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
926# endif
927#endif 944#endif
928 945
929 946
@@ -1115,7 +1132,6 @@ int yydebug;
1115# define YYMAXDEPTH 10000 1132# define YYMAXDEPTH 10000
1116#endif 1133#endif
1117 1134
1118
1119 1135
1120#if YYERROR_VERBOSE 1136#if YYERROR_VERBOSE
1121 1137
@@ -1218,115 +1234,142 @@ yytnamerr (char *yyres, const char *yystr)
1218} 1234}
1219# endif 1235# endif
1220 1236
1221/* Copy into YYRESULT an error message about the unexpected token 1237/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1222 YYCHAR while in state YYSTATE. Return the number of bytes copied, 1238 about the unexpected token YYTOKEN for the state stack whose top is
1223 including the terminating null byte. If YYRESULT is null, do not 1239 YYSSP.
1224 copy anything; just return the number of bytes that would be
1225 copied. As a special case, return 0 if an ordinary "syntax error"
1226 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1227 size calculation. */
1228static YYSIZE_T
1229yysyntax_error (char *yyresult, int yystate, int yychar)
1230{
1231 int yyn = yypact[yystate];
1232 1240
1233 if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) 1241 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1234 return 0; 1242 not large enough to hold the message. In that case, also set
1235 else 1243 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1244 required number of bytes is too large to store. */
1245static int
1246yysyntax_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)
1236 { 1289 {
1237 int yytype = YYTRANSLATE (yychar); 1290 int yyn = yypact[*yyssp];
1238 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); 1291 yyarg[yycount++] = yytname[yytoken];
1239 YYSIZE_T yysize = yysize0; 1292 if (!yypact_value_is_default (yyn))
1240 YYSIZE_T yysize1; 1293 {
1241 int yysize_overflow = 0; 1294 /* Start YYX at -YYN if negative to avoid negative indexes in
1242 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 1295 YYCHECK. In other words, skip the first -YYN actions for
1243 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 1296 this state because they are default actions. */
1244 int yyx; 1297 int yyxbegin = yyn < 0 ? -yyn : 0;
1245 1298 /* Stay within bounds of both yycheck and yytname. */
1246# if 0 1299 int yychecklim = YYLAST - yyn + 1;
1247 /* This is so xgettext sees the translatable formats that are 1300 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1248 constructed on the fly. */ 1301 int yyx;
1249 YY_("syntax error, unexpected %s"); 1302
1250 YY_("syntax error, unexpected %s, expecting %s"); 1303 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1251 YY_("syntax error, unexpected %s, expecting %s or %s"); 1304 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1252 YY_("syntax error, unexpected %s, expecting %s or %s or %s"); 1305 && !yytable_value_is_error (yytable[yyx + yyn]))
1253 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); 1306 {
1254# endif 1307 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1255 char *yyfmt; 1308 {
1256 char const *yyf; 1309 yycount = 1;
1257 static char const yyunexpected[] = "syntax error, unexpected %s"; 1310 yysize = yysize0;
1258 static char const yyexpecting[] = ", expecting %s"; 1311 break;
1259 static char const yyor[] = " or %s"; 1312 }
1260 char yyformat[sizeof yyunexpected 1313 yyarg[yycount++] = yytname[yyx];
1261 + sizeof yyexpecting - 1 1314 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1262 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) 1315 if (! (yysize <= yysize1
1263 * (sizeof yyor - 1))]; 1316 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1264 char const *yyprefix = yyexpecting; 1317 return 2;
1265 1318 yysize = yysize1;
1266 /* Start YYX at -YYN if negative to avoid negative indexes in 1319 }
1267 YYCHECK. */ 1320 }
1268 int yyxbegin = yyn < 0 ? -yyn : 0; 1321 }
1269
1270 /* Stay within bounds of both yycheck and yytname. */
1271 int yychecklim = YYLAST - yyn + 1;
1272 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1273 int yycount = 1;
1274
1275 yyarg[0] = yytname[yytype];
1276 yyfmt = yystpcpy (yyformat, yyunexpected);
1277
1278 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1279 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1280 {
1281 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1282 {
1283 yycount = 1;
1284 yysize = yysize0;
1285 yyformat[sizeof yyunexpected - 1] = '\0';
1286 break;
1287 }
1288 yyarg[yycount++] = yytname[yyx];
1289 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1290 yysize_overflow |= (yysize1 < yysize);
1291 yysize = yysize1;
1292 yyfmt = yystpcpy (yyfmt, yyprefix);
1293 yyprefix = yyor;
1294 }
1295 1322
1296 yyf = YY_(yyformat); 1323 switch (yycount)
1297 yysize1 = yysize + yystrlen (yyf); 1324 {
1298 yysize_overflow |= (yysize1 < yysize); 1325# define YYCASE_(N, S) \
1299 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 }
1300 1337
1301 if (yysize_overflow) 1338 yysize1 = yysize + yystrlen (yyformat);
1302 return YYSIZE_MAXIMUM; 1339 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1340 return 2;
1341 yysize = yysize1;
1303 1342
1304 if (yyresult) 1343 if (*yymsg_alloc < yysize)
1305 { 1344 {
1306 /* Avoid sprintf, as that infringes on the user's name space. 1345 *yymsg_alloc = 2 * yysize;
1307 Don't have undefined behavior even if the translation 1346 if (! (yysize <= *yymsg_alloc
1308 produced a string with the wrong number of "%s"s. */ 1347 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1309 char *yyp = yyresult; 1348 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1310 int yyi = 0; 1349 return 1;
1311 while ((*yyp = *yyf) != '\0')
1312 {
1313 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1314 {
1315 yyp += yytnamerr (yyp, yyarg[yyi++]);
1316 yyf += 2;
1317 }
1318 else
1319 {
1320 yyp++;
1321 yyf++;
1322 }
1323 }
1324 }
1325 return yysize;
1326 } 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;
1327} 1371}
1328#endif /* YYERROR_VERBOSE */ 1372#endif /* YYERROR_VERBOSE */
1329
1330 1373
1331/*-----------------------------------------------. 1374/*-----------------------------------------------.
1332| Release the memory associated to this symbol. | 1375| Release the memory associated to this symbol. |
@@ -1359,6 +1402,7 @@ yydestruct (yymsg, yytype, yyvaluep)
1359 } 1402 }
1360} 1403}
1361 1404
1405
1362/* Prevent warnings from -Wmissing-prototypes. */ 1406/* Prevent warnings from -Wmissing-prototypes. */
1363#ifdef YYPARSE_PARAM 1407#ifdef YYPARSE_PARAM
1364#if defined __STDC__ || defined __cplusplus 1408#if defined __STDC__ || defined __cplusplus
@@ -1385,10 +1429,9 @@ YYSTYPE yylval;
1385int yynerrs; 1429int yynerrs;
1386 1430
1387 1431
1388 1432/*----------.
1389/*-------------------------. 1433| yyparse. |
1390| yyparse or yypush_parse. | 1434`----------*/
1391`-------------------------*/
1392 1435
1393#ifdef YYPARSE_PARAM 1436#ifdef YYPARSE_PARAM
1394#if (defined __STDC__ || defined __C99__FUNC__ \ 1437#if (defined __STDC__ || defined __C99__FUNC__ \
@@ -1412,8 +1455,6 @@ yyparse ()
1412#endif 1455#endif
1413#endif 1456#endif
1414{ 1457{
1415
1416
1417 int yystate; 1458 int yystate;
1418 /* Number of tokens to shift before error messages enabled. */ 1459 /* Number of tokens to shift before error messages enabled. */
1419 int yyerrstatus; 1460 int yyerrstatus;
@@ -1568,7 +1609,7 @@ yybackup:
1568 1609
1569 /* 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. */
1570 yyn = yypact[yystate]; 1611 yyn = yypact[yystate];
1571 if (yyn == YYPACT_NINF) 1612 if (yypact_value_is_default (yyn))
1572 goto yydefault; 1613 goto yydefault;
1573 1614
1574 /* 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. */
@@ -1599,8 +1640,8 @@ yybackup:
1599 yyn = yytable[yyn]; 1640 yyn = yytable[yyn];
1600 if (yyn <= 0) 1641 if (yyn <= 0)
1601 { 1642 {
1602 if (yyn == 0 || yyn == YYTABLE_NINF) 1643 if (yytable_value_is_error (yyn))
1603 goto yyerrlab; 1644 goto yyerrlab;
1604 yyn = -yyn; 1645 yyn = -yyn;
1605 goto yyreduce; 1646 goto yyreduce;
1606 } 1647 }
@@ -1655,42 +1696,42 @@ yyreduce:
1655 { 1696 {
1656 case 4: 1697 case 4:
1657 1698
1658 { is_typedef = 0; is_extern = 0; current_name = NULL; decl_spec = NULL; ;} 1699 { 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 { free_list(*(yyvsp[(2) - (2)]), NULL); *(yyvsp[(2) - (2)]) = NULL; ;} 1704 { free_list(*(yyvsp[(2) - (2)]), NULL); *(yyvsp[(2) - (2)]) = NULL; }
1664 break; 1705 break;
1665 1706
1666 case 6: 1707 case 6:
1667 1708
1668 { is_typedef = 1; ;} 1709 { is_typedef = 1; }
1669 break; 1710 break;
1670 1711
1671 case 7: 1712 case 7:
1672 1713
1673 { (yyval) = (yyvsp[(4) - (4)]); ;} 1714 { (yyval) = (yyvsp[(4) - (4)]); }
1674 break; 1715 break;
1675 1716
1676 case 8: 1717 case 8:
1677 1718
1678 { is_typedef = 1; ;} 1719 { is_typedef = 1; }
1679 break; 1720 break;
1680 1721
1681 case 9: 1722 case 9:
1682 1723
1683 { (yyval) = (yyvsp[(3) - (3)]); ;} 1724 { (yyval) = (yyvsp[(3) - (3)]); }
1684 break; 1725 break;
1685 1726
1686 case 14: 1727 case 14:
1687 1728
1688 { (yyval) = (yyvsp[(2) - (2)]); ;} 1729 { (yyval) = (yyvsp[(2) - (2)]); }
1689 break; 1730 break;
1690 1731
1691 case 15: 1732 case 15:
1692 1733
1693 { (yyval) = (yyvsp[(2) - (2)]); ;} 1734 { (yyval) = (yyvsp[(2) - (2)]); }
1694 break; 1735 break;
1695 1736
1696 case 16: 1737 case 16:
@@ -1704,12 +1745,12 @@ yyreduce:
1704 current_name = NULL; 1745 current_name = NULL;
1705 } 1746 }
1706 (yyval) = (yyvsp[(3) - (3)]); 1747 (yyval) = (yyvsp[(3) - (3)]);
1707 ;} 1748 }
1708 break; 1749 break;
1709 1750
1710 case 17: 1751 case 17:
1711 1752
1712 { (yyval) = NULL; ;} 1753 { (yyval) = NULL; }
1713 break; 1754 break;
1714 1755
1715 case 19: 1756 case 19:
@@ -1720,7 +1761,7 @@ yyreduce:
1720 is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern); 1761 is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern);
1721 current_name = NULL; 1762 current_name = NULL;
1722 (yyval) = (yyvsp[(1) - (1)]); 1763 (yyval) = (yyvsp[(1) - (1)]);
1723 ;} 1764 }
1724 break; 1765 break;
1725 1766
1726 case 20: 1767 case 20:
@@ -1733,27 +1774,27 @@ yyreduce:
1733 is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern); 1774 is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern);
1734 current_name = NULL; 1775 current_name = NULL;
1735 (yyval) = (yyvsp[(3) - (3)]); 1776 (yyval) = (yyvsp[(3) - (3)]);
1736 ;} 1777 }
1737 break; 1778 break;
1738 1779
1739 case 21: 1780 case 21:
1740 1781
1741 { (yyval) = (yyvsp[(4) - (4)]) ? (yyvsp[(4) - (4)]) : (yyvsp[(3) - (4)]) ? (yyvsp[(3) - (4)]) : (yyvsp[(2) - (4)]) ? (yyvsp[(2) - (4)]) : (yyvsp[(1) - (4)]); ;} 1782 { (yyval) = (yyvsp[(4) - (4)]) ? (yyvsp[(4) - (4)]) : (yyvsp[(3) - (4)]) ? (yyvsp[(3) - (4)]) : (yyvsp[(2) - (4)]) ? (yyvsp[(2) - (4)]) : (yyvsp[(1) - (4)]); }
1742 break; 1783 break;
1743 1784
1744 case 22: 1785 case 22:
1745 1786
1746 { decl_spec = NULL; ;} 1787 { decl_spec = NULL; }
1747 break; 1788 break;
1748 1789
1749 case 24: 1790 case 24:
1750 1791
1751 { decl_spec = *(yyvsp[(1) - (1)]); ;} 1792 { decl_spec = *(yyvsp[(1) - (1)]); }
1752 break; 1793 break;
1753 1794
1754 case 25: 1795 case 25:
1755 1796
1756 { decl_spec = *(yyvsp[(2) - (2)]); ;} 1797 { decl_spec = *(yyvsp[(2) - (2)]); }
1757 break; 1798 break;
1758 1799
1759 case 26: 1800 case 26:
@@ -1762,97 +1803,82 @@ yyreduce:
1762 is really irrelevant to the linkage. */ 1803 is really irrelevant to the linkage. */
1763 remove_node((yyvsp[(1) - (1)])); 1804 remove_node((yyvsp[(1) - (1)]));
1764 (yyval) = (yyvsp[(1) - (1)]); 1805 (yyval) = (yyvsp[(1) - (1)]);
1765 ;} 1806 }
1766 break; 1807 break;
1767 1808
1768 case 31: 1809 case 31:
1769 1810
1770 { is_extern = 1; (yyval) = (yyvsp[(1) - (1)]); ;} 1811 { is_extern = 1; (yyval) = (yyvsp[(1) - (1)]); }
1771 break; 1812 break;
1772 1813
1773 case 32: 1814 case 32:
1774 1815
1775 { is_extern = 0; (yyval) = (yyvsp[(1) - (1)]); ;} 1816 { is_extern = 0; (yyval) = (yyvsp[(1) - (1)]); }
1776 break; 1817 break;
1777 1818
1778 case 37: 1819 case 37:
1779 1820
1780 { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_STRUCT; (yyval) = (yyvsp[(2) - (2)]); ;} 1821 { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_STRUCT; (yyval) = (yyvsp[(2) - (2)]); }
1781 break; 1822 break;
1782 1823
1783 case 38: 1824 case 38:
1784 1825
1785 { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_UNION; (yyval) = (yyvsp[(2) - (2)]); ;} 1826 { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_UNION; (yyval) = (yyvsp[(2) - (2)]); }
1786 break; 1827 break;
1787 1828
1788 case 39: 1829 case 39:
1789 1830
1790 { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_ENUM; (yyval) = (yyvsp[(2) - (2)]); ;} 1831 { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_ENUM; (yyval) = (yyvsp[(2) - (2)]); }
1791 break; 1832 break;
1792 1833
1793 case 40: 1834 case 40:
1794 1835
1795 { struct string_list *s = *(yyvsp[(3) - (3)]), *i = *(yyvsp[(2) - (3)]), *r; 1836 { record_compound((yyvsp[(1) - (3)]), (yyvsp[(2) - (3)]), (yyvsp[(3) - (3)]), SYM_STRUCT); (yyval) = (yyvsp[(3) - (3)]); }
1796 r = copy_node(i); r->tag = SYM_STRUCT;
1797 r->next = (*(yyvsp[(1) - (3)]))->next; *(yyvsp[(3) - (3)]) = r; (*(yyvsp[(1) - (3)]))->next = NULL;
1798 add_symbol(i->string, SYM_STRUCT, s, is_extern);
1799 (yyval) = (yyvsp[(3) - (3)]);
1800 ;}
1801 break; 1837 break;
1802 1838
1803 case 41: 1839 case 41:
1804 1840
1805 { struct string_list *s = *(yyvsp[(3) - (3)]), *i = *(yyvsp[(2) - (3)]), *r; 1841 { record_compound((yyvsp[(1) - (3)]), (yyvsp[(2) - (3)]), (yyvsp[(3) - (3)]), SYM_UNION); (yyval) = (yyvsp[(3) - (3)]); }
1806 r = copy_node(i); r->tag = SYM_UNION;
1807 r->next = (*(yyvsp[(1) - (3)]))->next; *(yyvsp[(3) - (3)]) = r; (*(yyvsp[(1) - (3)]))->next = NULL;
1808 add_symbol(i->string, SYM_UNION, s, is_extern);
1809 (yyval) = (yyvsp[(3) - (3)]);
1810 ;}
1811 break; 1842 break;
1812 1843
1813 case 42: 1844 case 42:
1814 1845
1815 { struct string_list *s = *(yyvsp[(3) - (3)]), *i = *(yyvsp[(2) - (3)]), *r; 1846 { record_compound((yyvsp[(1) - (3)]), (yyvsp[(2) - (3)]), (yyvsp[(3) - (3)]), SYM_ENUM); (yyval) = (yyvsp[(3) - (3)]); }
1816 r = copy_node(i); r->tag = SYM_ENUM;
1817 r->next = (*(yyvsp[(1) - (3)]))->next; *(yyvsp[(3) - (3)]) = r; (*(yyvsp[(1) - (3)]))->next = NULL;
1818 add_symbol(i->string, SYM_ENUM, s, is_extern);
1819 (yyval) = (yyvsp[(3) - (3)]);
1820 ;}
1821 break; 1847 break;
1822 1848
1823 case 43: 1849 case 43:
1824 1850
1825 { add_symbol(NULL, SYM_ENUM, NULL, 0); (yyval) = (yyvsp[(2) - (2)]); ;} 1851 { add_symbol(NULL, SYM_ENUM, NULL, 0); (yyval) = (yyvsp[(2) - (2)]); }
1826 break; 1852 break;
1827 1853
1828 case 44: 1854 case 44:
1829 1855
1830 { (yyval) = (yyvsp[(2) - (2)]); ;} 1856 { (yyval) = (yyvsp[(2) - (2)]); }
1831 break; 1857 break;
1832 1858
1833 case 45: 1859 case 45:
1834 1860
1835 { (yyval) = (yyvsp[(2) - (2)]); ;} 1861 { (yyval) = (yyvsp[(2) - (2)]); }
1836 break; 1862 break;
1837 1863
1838 case 56: 1864 case 56:
1839 1865
1840 { (*(yyvsp[(1) - (1)]))->tag = SYM_TYPEDEF; (yyval) = (yyvsp[(1) - (1)]); ;} 1866 { (*(yyvsp[(1) - (1)]))->tag = SYM_TYPEDEF; (yyval) = (yyvsp[(1) - (1)]); }
1841 break; 1867 break;
1842 1868
1843 case 57: 1869 case 57:
1844 1870
1845 { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;} 1871 { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); }
1846 break; 1872 break;
1847 1873
1848 case 58: 1874 case 58:
1849 1875
1850 { (yyval) = NULL; ;} 1876 { (yyval) = NULL; }
1851 break; 1877 break;
1852 1878
1853 case 61: 1879 case 61:
1854 1880
1855 { (yyval) = (yyvsp[(2) - (2)]); ;} 1881 { (yyval) = (yyvsp[(2) - (2)]); }
1856 break; 1882 break;
1857 1883
1858 case 65: 1884 case 65:
@@ -1860,12 +1886,12 @@ yyreduce:
1860 { /* restrict has no effect in prototypes so ignore it */ 1886 { /* restrict has no effect in prototypes so ignore it */
1861 remove_node((yyvsp[(1) - (1)])); 1887 remove_node((yyvsp[(1) - (1)]));
1862 (yyval) = (yyvsp[(1) - (1)]); 1888 (yyval) = (yyvsp[(1) - (1)]);
1863 ;} 1889 }
1864 break; 1890 break;
1865 1891
1866 case 66: 1892 case 66:
1867 1893
1868 { (yyval) = (yyvsp[(2) - (2)]); ;} 1894 { (yyval) = (yyvsp[(2) - (2)]); }
1869 break; 1895 break;
1870 1896
1871 case 68: 1897 case 68:
@@ -1877,97 +1903,97 @@ yyreduce:
1877 current_name = (*(yyvsp[(1) - (1)]))->string; 1903 current_name = (*(yyvsp[(1) - (1)]))->string;
1878 (yyval) = (yyvsp[(1) - (1)]); 1904 (yyval) = (yyvsp[(1) - (1)]);
1879 } 1905 }
1880 ;} 1906 }
1881 break; 1907 break;
1882 1908
1883 case 69: 1909 case 69:
1884 1910
1885 { (yyval) = (yyvsp[(4) - (4)]); ;} 1911 { (yyval) = (yyvsp[(4) - (4)]); }
1886 break; 1912 break;
1887 1913
1888 case 70: 1914 case 70:
1889 1915
1890 { (yyval) = (yyvsp[(4) - (4)]); ;} 1916 { (yyval) = (yyvsp[(4) - (4)]); }
1891 break; 1917 break;
1892 1918
1893 case 71: 1919 case 71:
1894 1920
1895 { (yyval) = (yyvsp[(2) - (2)]); ;} 1921 { (yyval) = (yyvsp[(2) - (2)]); }
1896 break; 1922 break;
1897 1923
1898 case 72: 1924 case 72:
1899 1925
1900 { (yyval) = (yyvsp[(3) - (3)]); ;} 1926 { (yyval) = (yyvsp[(3) - (3)]); }
1901 break; 1927 break;
1902 1928
1903 case 73: 1929 case 73:
1904 1930
1905 { (yyval) = (yyvsp[(3) - (3)]); ;} 1931 { (yyval) = (yyvsp[(3) - (3)]); }
1906 break; 1932 break;
1907 1933
1908 case 74: 1934 case 74:
1909 1935
1910 { (yyval) = (yyvsp[(2) - (2)]); ;} 1936 { (yyval) = (yyvsp[(2) - (2)]); }
1911 break; 1937 break;
1912 1938
1913 case 78: 1939 case 78:
1914 1940
1915 { (yyval) = (yyvsp[(4) - (4)]); ;} 1941 { (yyval) = (yyvsp[(4) - (4)]); }
1916 break; 1942 break;
1917 1943
1918 case 79: 1944 case 79:
1919 1945
1920 { (yyval) = (yyvsp[(4) - (4)]); ;} 1946 { (yyval) = (yyvsp[(4) - (4)]); }
1921 break; 1947 break;
1922 1948
1923 case 80: 1949 case 80:
1924 1950
1925 { (yyval) = (yyvsp[(2) - (2)]); ;} 1951 { (yyval) = (yyvsp[(2) - (2)]); }
1926 break; 1952 break;
1927 1953
1928 case 81: 1954 case 81:
1929 1955
1930 { (yyval) = (yyvsp[(3) - (3)]); ;} 1956 { (yyval) = (yyvsp[(3) - (3)]); }
1931 break; 1957 break;
1932 1958
1933 case 82: 1959 case 82:
1934 1960
1935 { (yyval) = (yyvsp[(3) - (3)]); ;} 1961 { (yyval) = (yyvsp[(3) - (3)]); }
1936 break; 1962 break;
1937 1963
1938 case 83: 1964 case 83:
1939 1965
1940 { (yyval) = (yyvsp[(2) - (2)]); ;} 1966 { (yyval) = (yyvsp[(2) - (2)]); }
1941 break; 1967 break;
1942 1968
1943 case 85: 1969 case 85:
1944 1970
1945 { (yyval) = (yyvsp[(3) - (3)]); ;} 1971 { (yyval) = (yyvsp[(3) - (3)]); }
1946 break; 1972 break;
1947 1973
1948 case 86: 1974 case 86:
1949 1975
1950 { (yyval) = NULL; ;} 1976 { (yyval) = NULL; }
1951 break; 1977 break;
1952 1978
1953 case 89: 1979 case 89:
1954 1980
1955 { (yyval) = (yyvsp[(3) - (3)]); ;} 1981 { (yyval) = (yyvsp[(3) - (3)]); }
1956 break; 1982 break;
1957 1983
1958 case 90: 1984 case 90:
1959 1985
1960 { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;} 1986 { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); }
1961 break; 1987 break;
1962 1988
1963 case 91: 1989 case 91:
1964 1990
1965 { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;} 1991 { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); }
1966 break; 1992 break;
1967 1993
1968 case 93: 1994 case 93:
1969 1995
1970 { (yyval) = NULL; ;} 1996 { (yyval) = NULL; }
1971 break; 1997 break;
1972 1998
1973 case 94: 1999 case 94:
@@ -1976,39 +2002,39 @@ yyreduce:
1976 private parameter names. */ 2002 private parameter names. */
1977 remove_node((yyvsp[(1) - (1)])); 2003 remove_node((yyvsp[(1) - (1)]));
1978 (yyval) = (yyvsp[(1) - (1)]); 2004 (yyval) = (yyvsp[(1) - (1)]);
1979 ;} 2005 }
1980 break; 2006 break;
1981 2007
1982 case 95: 2008 case 95:
1983 2009
1984 { remove_node((yyvsp[(1) - (1)])); 2010 { remove_node((yyvsp[(1) - (1)]));
1985 (yyval) = (yyvsp[(1) - (1)]); 2011 (yyval) = (yyvsp[(1) - (1)]);
1986 ;} 2012 }
1987 break; 2013 break;
1988 2014
1989 case 96: 2015 case 96:
1990 2016
1991 { (yyval) = (yyvsp[(4) - (4)]); ;} 2017 { (yyval) = (yyvsp[(4) - (4)]); }
1992 break; 2018 break;
1993 2019
1994 case 97: 2020 case 97:
1995 2021
1996 { (yyval) = (yyvsp[(4) - (4)]); ;} 2022 { (yyval) = (yyvsp[(4) - (4)]); }
1997 break; 2023 break;
1998 2024
1999 case 98: 2025 case 98:
2000 2026
2001 { (yyval) = (yyvsp[(2) - (2)]); ;} 2027 { (yyval) = (yyvsp[(2) - (2)]); }
2002 break; 2028 break;
2003 2029
2004 case 99: 2030 case 99:
2005 2031
2006 { (yyval) = (yyvsp[(3) - (3)]); ;} 2032 { (yyval) = (yyvsp[(3) - (3)]); }
2007 break; 2033 break;
2008 2034
2009 case 100: 2035 case 100:
2010 2036
2011 { (yyval) = (yyvsp[(3) - (3)]); ;} 2037 { (yyval) = (yyvsp[(3) - (3)]); }
2012 break; 2038 break;
2013 2039
2014 case 101: 2040 case 101:
@@ -2017,87 +2043,87 @@ yyreduce:
2017 *(yyvsp[(2) - (3)]) = NULL; 2043 *(yyvsp[(2) - (3)]) = NULL;
2018 add_symbol(current_name, SYM_NORMAL, decl, is_extern); 2044 add_symbol(current_name, SYM_NORMAL, decl, is_extern);
2019 (yyval) = (yyvsp[(3) - (3)]); 2045 (yyval) = (yyvsp[(3) - (3)]);
2020 ;} 2046 }
2021 break; 2047 break;
2022 2048
2023 case 102: 2049 case 102:
2024 2050
2025 { (yyval) = NULL; ;} 2051 { (yyval) = NULL; }
2026 break; 2052 break;
2027 2053
2028 case 104: 2054 case 104:
2029 2055
2030 { remove_list((yyvsp[(2) - (2)]), &(*(yyvsp[(1) - (2)]))->next); (yyval) = (yyvsp[(2) - (2)]); ;} 2056 { remove_list((yyvsp[(2) - (2)]), &(*(yyvsp[(1) - (2)]))->next); (yyval) = (yyvsp[(2) - (2)]); }
2031 break; 2057 break;
2032 2058
2033 case 105: 2059 case 105:
2034 2060
2035 { (yyval) = (yyvsp[(3) - (3)]); ;} 2061 { (yyval) = (yyvsp[(3) - (3)]); }
2036 break; 2062 break;
2037 2063
2038 case 106: 2064 case 106:
2039 2065
2040 { (yyval) = (yyvsp[(3) - (3)]); ;} 2066 { (yyval) = (yyvsp[(3) - (3)]); }
2041 break; 2067 break;
2042 2068
2043 case 107: 2069 case 107:
2044 2070
2045 { (yyval) = NULL; ;} 2071 { (yyval) = NULL; }
2046 break; 2072 break;
2047 2073
2048 case 110: 2074 case 110:
2049 2075
2050 { (yyval) = (yyvsp[(2) - (2)]); ;} 2076 { (yyval) = (yyvsp[(2) - (2)]); }
2051 break; 2077 break;
2052 2078
2053 case 111: 2079 case 111:
2054 2080
2055 { (yyval) = (yyvsp[(3) - (3)]); ;} 2081 { (yyval) = (yyvsp[(3) - (3)]); }
2056 break; 2082 break;
2057 2083
2058 case 112: 2084 case 112:
2059 2085
2060 { (yyval) = (yyvsp[(2) - (2)]); ;} 2086 { (yyval) = (yyvsp[(2) - (2)]); }
2061 break; 2087 break;
2062 2088
2063 case 113: 2089 case 113:
2064 2090
2065 { (yyval) = NULL; ;} 2091 { (yyval) = NULL; }
2066 break; 2092 break;
2067 2093
2068 case 116: 2094 case 116:
2069 2095
2070 { (yyval) = (yyvsp[(3) - (3)]); ;} 2096 { (yyval) = (yyvsp[(3) - (3)]); }
2071 break; 2097 break;
2072 2098
2073 case 117: 2099 case 117:
2074 2100
2075 { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;} 2101 { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); }
2076 break; 2102 break;
2077 2103
2078 case 118: 2104 case 118:
2079 2105
2080 { (yyval) = (yyvsp[(2) - (2)]); ;} 2106 { (yyval) = (yyvsp[(2) - (2)]); }
2081 break; 2107 break;
2082 2108
2083 case 120: 2109 case 120:
2084 2110
2085 { (yyval) = (yyvsp[(2) - (2)]); ;} 2111 { (yyval) = (yyvsp[(2) - (2)]); }
2086 break; 2112 break;
2087 2113
2088 case 121: 2114 case 121:
2089 2115
2090 { (yyval) = NULL; ;} 2116 { (yyval) = NULL; }
2091 break; 2117 break;
2092 2118
2093 case 123: 2119 case 123:
2094 2120
2095 { (yyval) = (yyvsp[(3) - (3)]); ;} 2121 { (yyval) = (yyvsp[(3) - (3)]); }
2096 break; 2122 break;
2097 2123
2098 case 124: 2124 case 124:
2099 2125
2100 { (yyval) = (yyvsp[(4) - (4)]); ;} 2126 { (yyval) = (yyvsp[(4) - (4)]); }
2101 break; 2127 break;
2102 2128
2103 case 127: 2129 case 127:
@@ -2105,7 +2131,7 @@ yyreduce:
2105 { 2131 {
2106 const char *name = strdup((*(yyvsp[(1) - (1)]))->string); 2132 const char *name = strdup((*(yyvsp[(1) - (1)]))->string);
2107 add_symbol(name, SYM_ENUM_CONST, NULL, 0); 2133 add_symbol(name, SYM_ENUM_CONST, NULL, 0);
2108 ;} 2134 }
2109 break; 2135 break;
2110 2136
2111 case 128: 2137 case 128:
@@ -2114,28 +2140,39 @@ yyreduce:
2114 const char *name = strdup((*(yyvsp[(1) - (3)]))->string); 2140 const char *name = strdup((*(yyvsp[(1) - (3)]))->string);
2115 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)]));
2116 add_symbol(name, SYM_ENUM_CONST, expr, 0); 2142 add_symbol(name, SYM_ENUM_CONST, expr, 0);
2117 ;} 2143 }
2118 break; 2144 break;
2119 2145
2120 case 129: 2146 case 129:
2121 2147
2122 { (yyval) = (yyvsp[(2) - (2)]); ;} 2148 { (yyval) = (yyvsp[(2) - (2)]); }
2123 break; 2149 break;
2124 2150
2125 case 130: 2151 case 130:
2126 2152
2127 { (yyval) = NULL; ;} 2153 { (yyval) = NULL; }
2128 break; 2154 break;
2129 2155
2130 case 132: 2156 case 132:
2131 2157
2132 { export_symbol((*(yyvsp[(3) - (5)]))->string); (yyval) = (yyvsp[(5) - (5)]); ;} 2158 { export_symbol((*(yyvsp[(3) - (5)]))->string); (yyval) = (yyvsp[(5) - (5)]); }
2133 break; 2159 break;
2134 2160
2135 2161
2136 2162
2137 default: break; 2163 default: break;
2138 } 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. */
2139 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 2176 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2140 2177
2141 YYPOPSTACK (yylen); 2178 YYPOPSTACK (yylen);
@@ -2163,6 +2200,10 @@ yyreduce:
2163| yyerrlab -- here on detecting error | 2200| yyerrlab -- here on detecting error |
2164`------------------------------------*/ 2201`------------------------------------*/
2165yyerrlab: 2202yyerrlab:
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
2166 /* If not already recovering from an error, report this error. */ 2207 /* If not already recovering from an error, report this error. */
2167 if (!yyerrstatus) 2208 if (!yyerrstatus)
2168 { 2209 {
@@ -2170,37 +2211,36 @@ yyerrlab:
2170#if ! YYERROR_VERBOSE 2211#if ! YYERROR_VERBOSE
2171 yyerror (YY_("syntax error")); 2212 yyerror (YY_("syntax error"));
2172#else 2213#else
2214# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2215 yyssp, yytoken)
2173 { 2216 {
2174 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); 2217 char const *yymsgp = YY_("syntax error");
2175 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) 2218 int yysyntax_error_status;
2176 { 2219 yysyntax_error_status = YYSYNTAX_ERROR;
2177 YYSIZE_T yyalloc = 2 * yysize; 2220 if (yysyntax_error_status == 0)
2178 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) 2221 yymsgp = yymsg;
2179 yyalloc = YYSTACK_ALLOC_MAXIMUM; 2222 else if (yysyntax_error_status == 1)
2180 if (yymsg != yymsgbuf) 2223 {
2181 YYSTACK_FREE (yymsg); 2224 if (yymsg != yymsgbuf)
2182 yymsg = (char *) YYSTACK_ALLOC (yyalloc); 2225 YYSTACK_FREE (yymsg);
2183 if (yymsg) 2226 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2184 yymsg_alloc = yyalloc; 2227 if (!yymsg)
2185 else 2228 {
2186 { 2229 yymsg = yymsgbuf;
2187 yymsg = yymsgbuf; 2230 yymsg_alloc = sizeof yymsgbuf;
2188 yymsg_alloc = sizeof yymsgbuf; 2231 yysyntax_error_status = 2;
2189 } 2232 }
2190 } 2233 else
2191 2234 {
2192 if (0 < yysize && yysize <= yymsg_alloc) 2235 yysyntax_error_status = YYSYNTAX_ERROR;
2193 { 2236 yymsgp = yymsg;
2194 (void) yysyntax_error (yymsg, yystate, yychar); 2237 }
2195 yyerror (yymsg); 2238 }
2196 } 2239 yyerror (yymsgp);
2197 else 2240 if (yysyntax_error_status == 2)
2198 { 2241 goto yyexhaustedlab;
2199 yyerror (YY_("syntax error"));
2200 if (yysize != 0)
2201 goto yyexhaustedlab;
2202 }
2203 } 2242 }
2243# undef YYSYNTAX_ERROR
2204#endif 2244#endif
2205 } 2245 }
2206 2246
@@ -2259,7 +2299,7 @@ yyerrlab1:
2259 for (;;) 2299 for (;;)
2260 { 2300 {
2261 yyn = yypact[yystate]; 2301 yyn = yypact[yystate];
2262 if (yyn != YYPACT_NINF) 2302 if (!yypact_value_is_default (yyn))
2263 { 2303 {
2264 yyn += YYTERROR; 2304 yyn += YYTERROR;
2265 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 2305 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
@@ -2318,8 +2358,13 @@ yyexhaustedlab:
2318 2358
2319yyreturn: 2359yyreturn:
2320 if (yychar != YYEMPTY) 2360 if (yychar != YYEMPTY)
2321 yydestruct ("Cleanup: discarding lookahead", 2361 {
2322 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 }
2323 /* Do not reclaim the symbols of the rule which action triggered 2368 /* Do not reclaim the symbols of the rule which action triggered
2324 this YYABORT or YYACCEPT. */ 2369 this YYABORT or YYACCEPT. */
2325 YYPOPSTACK (yylen); 2370 YYPOPSTACK (yylen);
diff --git a/scripts/genksyms/parse.tab.h_shipped b/scripts/genksyms/parse.tab.h_shipped
index 350c2b403e21..93240a3cdecc 100644
--- a/scripts/genksyms/parse.tab.h_shipped
+++ b/scripts/genksyms/parse.tab.h_shipped
@@ -1,9 +1,8 @@
1/* A Bison parser, made by GNU Bison 2.4.3. */ 1/* A Bison parser, made by GNU Bison 2.5. */
2 2
3/* Skeleton interface for Bison's Yacc-like parsers in C 3/* Bison interface for Yacc-like parsers in C
4 4
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 5 Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
6 2009, 2010 Free Software Foundation, Inc.
7 6
8 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
9 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