Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
0359de7d
Commit
0359de7d
authored
Oct 11, 2011
by
Michal Marek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
genksyms: Regenerate lexer and parser
parent
2c5925d6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
358 additions
and
306 deletions
+358
-306
scripts/genksyms/lex.lex.c_shipped
scripts/genksyms/lex.lex.c_shipped
+10
-2
scripts/genksyms/parse.tab.c_shipped
scripts/genksyms/parse.tab.c_shipped
+345
-300
scripts/genksyms/parse.tab.h_shipped
scripts/genksyms/parse.tab.h_shipped
+3
-4
No files found.
scripts/genksyms/lex.lex.c_shipped
View file @
0359de7d
...
@@ -660,7 +660,7 @@ static int input (void );
...
@@ -660,7 +660,7 @@ static int input (void );
/* This used to be an fputs(), but since the string might contain NUL's,
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
* we now use fwrite().
*/
*/
#define ECHO
do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0
)
#define ECHO
fwrite( yytext, yyleng, 1, yyout
)
#endif
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
...
@@ -671,7 +671,7 @@ static int input (void );
...
@@ -671,7 +671,7 @@ static int input (void );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
{ \
int c = '*'; \
int c = '*'; \
unsigned
n; \
int
n; \
for ( n = 0; n < max_size && \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
buf[n] = (char) c; \
...
@@ -1926,6 +1926,7 @@ void yyfree (void * ptr )
...
@@ -1926,6 +1926,7 @@ void yyfree (void * ptr )
cur_node->tag = \
cur_node->tag = \
find_symbol(cur_node->string, SYM_ENUM_CONST, 1)?\
find_symbol(cur_node->string, SYM_ENUM_CONST, 1)?\
SYM_ENUM_CONST : SYM_NORMAL ; \
SYM_ENUM_CONST : SYM_NORMAL ; \
cur_node->in_source_file = in_source_file; \
} while (0)
} while (0)
#define APP _APP(yytext, yyleng)
#define APP _APP(yytext, yyleng)
...
@@ -1975,6 +1976,13 @@ repeat:
...
@@ -1975,6 +1976,13 @@ repeat:
cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1);
cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1);
cur_line = atoi(yytext+2);
cur_line = atoi(yytext+2);
if (!source_file) {
source_file = xstrdup(cur_filename);
in_source_file = 1;
} else {
in_source_file = (strcmp(cur_filename, source_file) == 0);
}
goto repeat;
goto repeat;
}
}
...
...
scripts/genksyms/parse.tab.c_shipped
View file @
0359de7d
/* A Bison parser, made by GNU Bison 2.
4.3
. */
/* A Bison parser, made by GNU Bison 2.
5
. */
/*
Skeleton implementation for Bison's
Yacc-like parsers in C
/*
Bison implementation for
Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
2009, 2010 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
...
@@ -45,7 +44,7 @@
...
@@ -45,7 +44,7 @@
#define YYBISON 1
#define YYBISON 1
/* Bison version. */
/* Bison version. */
#define YYBISON_VERSION "2.
4.3
"
#define YYBISON_VERSION "2.
5
"
/* Skeleton name. */
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
#define YYSKELETON_NAME "yacc.c"
...
@@ -96,6 +95,25 @@ remove_list(struct string_list **pb, struct string_list **pe)
...
@@ -96,6 +95,25 @@ remove_list(struct string_list **pb, struct string_list **pe)
free_list(b, e);
free_list(b, e);
}
}
/* Record definition of a struct/union/enum */
static void record_compound(struct string_list **keyw,
struct string_list **ident,
struct string_list **body,
enum symbol_type type)
{
struct string_list *b = *body, *i = *ident, *r;
if (i->in_source_file) {
remove_node(keyw);
(*ident)->tag = type;
remove_list(body, ident);
return;
}
r = copy_node(i); r->tag = type;
r->next = (*keyw)->next; *body = r; (*keyw)->next = NULL;
add_symbol(i->string, type, b, is_extern);
}
...
@@ -283,11 +301,11 @@ YYID (yyi)
...
@@ -283,11 +301,11 @@ YYID (yyi)
# define alloca _alloca
# define alloca _alloca
# else
# else
# define YYSTACK_ALLOC alloca
# define YYSTACK_ALLOC alloca
# if ! defined _ALLOCA_H && ! defined
_STDLIB_H
&& (defined __STDC__ || defined __C99__FUNC__ \
# if ! defined _ALLOCA_H && ! defined
EXIT_SUCCESS
&& (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
|| defined __cplusplus || defined _MSC_VER)
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# ifndef
_STDLIB_H
# ifndef
EXIT_SUCCESS
# define
_STDLIB_H 1
# define
EXIT_SUCCESS 0
# endif
# endif
# endif
# endif
# endif
# endif
...
@@ -310,24 +328,24 @@ YYID (yyi)
...
@@ -310,24 +328,24 @@ YYID (yyi)
# ifndef YYSTACK_ALLOC_MAXIMUM
# ifndef YYSTACK_ALLOC_MAXIMUM
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
# endif
# endif
# if (defined __cplusplus && ! defined
_STDLIB_H
\
# if (defined __cplusplus && ! defined
EXIT_SUCCESS
\
&& ! ((defined YYMALLOC || defined malloc) \
&& ! ((defined YYMALLOC || defined malloc) \
&& (defined YYFREE || defined free)))
&& (defined YYFREE || defined free)))
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# ifndef
_STDLIB_H
# ifndef
EXIT_SUCCESS
# define
_STDLIB_H 1
# define
EXIT_SUCCESS 0
# endif
# endif
# endif
# endif
# ifndef YYMALLOC
# ifndef YYMALLOC
# define YYMALLOC malloc
# define YYMALLOC malloc
# if ! defined malloc && ! defined
_STDLIB_H
&& (defined __STDC__ || defined __C99__FUNC__ \
# if ! defined malloc && ! defined
EXIT_SUCCESS
&& (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
|| defined __cplusplus || defined _MSC_VER)
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# endif
# endif
# ifndef YYFREE
# ifndef YYFREE
# define YYFREE free
# define YYFREE free
# if ! defined free && ! defined
_STDLIB_H
&& (defined __STDC__ || defined __C99__FUNC__ \
# if ! defined free && ! defined
EXIT_SUCCESS
&& (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
|| defined __cplusplus || defined _MSC_VER)
void free (void *); /* INFRINGES ON USER NAME SPACE */
void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
...
@@ -356,23 +374,7 @@ union yyalloc
...
@@ -356,23 +374,7 @@ union yyalloc
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
+ YYSTACK_GAP_MAXIMUM)
/* Copy COUNT objects from FROM to TO. The source and destination do
# define YYCOPY_NEEDED 1
not overlap. */
# ifndef YYCOPY
# if defined __GNUC__ && 1 < __GNUC__
# define YYCOPY(To, From, Count) \
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
# else
# define YYCOPY(To, From, Count) \
do \
{ \
YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(To)[yyi] = (From)[yyi]; \
} \
while (YYID (0))
# endif
# endif
/* Relocate STACK from its old location to the new one. The
/* Relocate STACK from its old location to the new one. The
local variables YYSIZE and YYSTACKSIZE give the old and new number of
local variables YYSIZE and YYSTACKSIZE give the old and new number of
...
@@ -392,6 +394,26 @@ union yyalloc
...
@@ -392,6 +394,26 @@ union yyalloc
#endif
#endif
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
/* Copy COUNT objects from FROM to TO. The source and destination do
not overlap. */
# ifndef YYCOPY
# if defined __GNUC__ && 1 < __GNUC__
# define YYCOPY(To, From, Count) \
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
# else
# define YYCOPY(To, From, Count) \
do \
{ \
YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(To)[yyi] = (From)[yyi]; \
} \
while (YYID (0))
# endif
# endif
#endif /* !YYCOPY_NEEDED */
/* YYFINAL -- State number of the termination state. */
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 4
#define YYFINAL 4
/* YYLAST -- Last index in YYTABLE. */
/* YYLAST -- Last index in YYTABLE. */
...
@@ -514,20 +536,20 @@ static const yytype_int8 yyrhs[] =
...
@@ -514,20 +536,20 @@ static const yytype_int8 yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
static const yytype_uint16 yyrline[] =
{
{
0, 1
04, 104, 105, 109, 109, 115, 115, 117, 117
,
0, 1
23, 123, 124, 128, 128, 134, 134, 136, 136
,
1
19, 120, 121, 122, 123, 124, 128, 142, 143, 147
,
1
38, 139, 140, 141, 142, 143, 147, 161, 162, 166
,
1
55, 168, 174, 175, 179, 180, 184, 190, 194, 195
,
1
74, 187, 193, 194, 198, 199, 203, 209, 213, 214
,
196, 197, 198, 202, 203, 204, 205, 209, 211, 213
,
215, 216, 217, 221, 222, 223, 224, 228, 230, 232
,
2
17, 224, 231, 241, 244, 245, 249, 250, 251, 252
,
2
36, 238, 240, 245, 248, 249, 253, 254, 255, 256
,
25
3, 254, 255, 256, 257, 258, 259, 263, 268, 269
,
25
7, 258, 259, 260, 261, 262, 263, 267, 272, 273
,
27
3, 274, 278, 278, 278, 279, 287, 288, 292, 301
,
27
7, 278, 282, 282, 282, 283, 291, 292, 296, 305
,
30
3, 305, 307, 309, 316, 317, 321, 322, 323, 325
,
30
7, 309, 311, 313, 320, 321, 325, 326, 327, 329
,
3
27, 329, 331, 336, 337, 338, 342, 343, 347, 348
,
3
31, 333, 335, 340, 341, 342, 346, 347, 351, 352
,
35
3, 358, 360, 364, 365, 373, 377, 379, 381, 383
,
35
7, 362, 364, 368, 369, 377, 381, 383, 385, 387
,
38
5, 390, 399, 400, 405, 410, 411, 415, 416, 420
,
38
9, 394, 403, 404, 409, 414, 415, 419, 420, 424
,
42
1, 425, 427, 432, 433, 437, 438, 442, 443, 444
,
42
5, 429, 431, 436, 437, 441, 442, 446, 447, 448
,
4
48, 452, 453, 457, 458, 462, 463, 466, 471, 479
,
4
52, 456, 457, 461, 462, 466, 467, 470, 475, 483
,
48
3, 484, 488
48
7, 488, 492
};
};
#endif
#endif
...
@@ -618,8 +640,8 @@ static const yytype_uint8 yyr2[] =
...
@@ -618,8 +640,8 @@ static const yytype_uint8 yyr2[] =
0, 1, 5
0, 1, 5
};
};
/* YYDEFACT[STATE-NAME] -- Default r
ule to reduce with in state
/* YYDEFACT[STATE-NAME] -- Default r
eduction number in state STATE-NUM.
STATE-NUM
when YYTABLE doesn't specify something else to do. Zero
Performed
when YYTABLE doesn't specify something else to do. Zero
means the default is an error. */
means the default is an error. */
static const yytype_uint8 yydefact[] =
static const yytype_uint8 yydefact[] =
{
{
...
@@ -692,8 +714,7 @@ static const yytype_int16 yypgoto[] =
...
@@ -692,8 +714,7 @@ static const yytype_int16 yypgoto[] =
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
positive, shift that token. If negative, reduce the rule which
number is the opposite. If zero, do what YYDEFACT says.
number is the opposite. If YYTABLE_NINF, syntax error. */
If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF -109
#define YYTABLE_NINF -109
static const yytype_int16 yytable[] =
static const yytype_int16 yytable[] =
{
{
...
@@ -753,6 +774,12 @@ static const yytype_int16 yytable[] =
...
@@ -753,6 +774,12 @@ static const yytype_int16 yytable[] =
0, 0, 34
0, 0, 34
};
};
#define yypact_value_is_default(yystate) \
((yystate) == (-135))
#define yytable_value_is_error(yytable_value) \
YYID (0)
static const yytype_int16 yycheck[] =
static const yytype_int16 yycheck[] =
{
{
59, 38, 79, 3, 1, 8, 56, 37, 26, 37,
59, 38, 79, 3, 1, 8, 56, 37, 26, 37,
...
@@ -869,7 +896,6 @@ do \
...
@@ -869,7 +896,6 @@ do \
{ \
{ \
yychar = (Token); \
yychar = (Token); \
yylval = (Value); \
yylval = (Value); \
yytoken = YYTRANSLATE (yychar); \
YYPOPSTACK (1); \
YYPOPSTACK (1); \
goto yybackup; \
goto yybackup; \
} \
} \
...
@@ -911,19 +937,10 @@ while (YYID (0))
...
@@ -911,19 +937,10 @@ while (YYID (0))
#endif
#endif
/* YY_LOCATION_PRINT -- Print the location on the stream.
/* This macro is provided for backward compatibility. */
This macro was not mandated originally: define only if we know
we won't break user code: when these are the locations we know. */
#ifndef YY_LOCATION_PRINT
#ifndef YY_LOCATION_PRINT
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
# define YY_LOCATION_PRINT(File, Loc) \
fprintf (File, "%d.%d-%d.%d", \
(Loc).first_line, (Loc).first_column, \
(Loc).last_line, (Loc).last_column)
# else
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
# endif
#endif
#endif
...
@@ -1115,7 +1132,6 @@ int yydebug;
...
@@ -1115,7 +1132,6 @@ int yydebug;
# define YYMAXDEPTH 10000
# define YYMAXDEPTH 10000
#endif
#endif
#if YYERROR_VERBOSE
#if YYERROR_VERBOSE
...
@@ -1218,115 +1234,142 @@ yytnamerr (char *yyres, const char *yystr)
...
@@ -1218,115 +1234,142 @@ yytnamerr (char *yyres, const char *yystr)
}
}
# endif
# endif
/* Copy into YYRESULT an error message about the unexpected token
/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
YYCHAR while in state YYSTATE. Return the number of bytes copied,
about the unexpected token YYTOKEN for the state stack whose top is
including the terminating null byte. If YYRESULT is null, do not
YYSSP.
copy anything; just return the number of bytes that would be
copied. As a special case, return 0 if an ordinary "syntax error"
message will do. Return YYSIZE_MAXIMUM if overflow occurs during
size calculation. */
static YYSIZE_T
yysyntax_error (char *yyresult, int yystate, int yychar)
{
int yyn = yypact[yystate];
if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
return 0;
not large enough to hold the message. In that case, also set
else
*YYMSG_ALLOC to the required number of bytes. Return 2 if the
required number of bytes is too large to store. */
static int
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
yytype_int16 *yyssp, int yytoken)
{
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
YYSIZE_T yysize = yysize0;
YYSIZE_T yysize1;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */
const char *yyformat = 0;
/* Arguments of yyformat. */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
/* Number of reported tokens (one for the "unexpected", one per
"expected"). */
int yycount = 0;
/* There are many possibilities here to consider:
- Assume YYFAIL is not used. It's too flawed to consider. See
<http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
for details. YYERROR is fine as it does not invoke this
function.
- If this state is a consistent state with a default action, then
the only way this function was invoked is if the default action
is an error action. In that case, don't check for expected
tokens because there are none.
- The only way there can be no lookahead present (in yychar) is if
this state is a consistent state with a default action. Thus,
detecting the absence of a lookahead is sufficient to determine
that there is no unexpected or expected token to report. In that
case, just report a simple "syntax error".
- Don't assume there isn't a lookahead just because this state is a
consistent state with a default action. There might have been a
previous inconsistent state, consistent state with a non-default
action, or user semantic action that manipulated yychar.
- Of course, the expected token list depends on states to have
correct lookahead information, and it depends on the parser not
to perform extra reductions after fetching a lookahead from the
scanner and before detecting a syntax error. Thus, state merging
(from LALR or IELR) and default reductions corrupt the expected
token list. However, the list is correct for canonical LR with
one exception: it will still contain any token that will not be
accepted due to an error action in a later state.
*/
if (yytoken != YYEMPTY)
{
{
int yytype = YYTRANSLATE (yychar);
int yyn = yypact[*yyssp];
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
yyarg[yycount++] = yytname[yytoken];
YYSIZE_T yysize = yysize0;
if (!yypact_value_is_default (yyn))
YYSIZE_T yysize1;
{
int yysize_overflow = 0;
/* Start YYX at -YYN if negative to avoid negative indexes in
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
YYCHECK. In other words, skip the first -YYN actions for
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
this state because they are default actions. */
int yyx;
int yyxbegin = yyn < 0 ? -yyn : 0;
/* Stay within bounds of both yycheck and yytname. */
# if 0
int yychecklim = YYLAST - yyn + 1;
/* This is so xgettext sees the translatable formats that are
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
constructed on the fly. */
int yyx;
YY_("syntax error, unexpected %s");
YY_("syntax error, unexpected %s, expecting %s");
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
YY_("syntax error, unexpected %s, expecting %s or %s");
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
YY_("syntax error, unexpected %s, expecting %s or %s or %s");
&& !yytable_value_is_error (yytable[yyx + yyn]))
YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
{
# endif
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
char *yyfmt;
{
char const *yyf;
yycount = 1;
static char const yyunexpected[] = "syntax error, unexpected %s";
yysize = yysize0;
static char const yyexpecting[] = ", expecting %s";
break;
static char const yyor[] = " or %s";
}
char yyformat[sizeof yyunexpected
yyarg[yycount++] = yytname[yyx];
+ sizeof yyexpecting - 1
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
if (! (yysize <= yysize1
* (sizeof yyor - 1))];
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
char const *yyprefix = yyexpecting;
return 2;
yysize = yysize1;
/* Start YYX at -YYN if negative to avoid negative indexes in
}
YYCHECK. */
}
int yyxbegin = yyn < 0 ? -yyn : 0;
}
/* Stay within bounds of both yycheck and yytname. */
int yychecklim = YYLAST - yyn + 1;
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
int yycount = 1;
yyarg[0] = yytname[yytype];
yyfmt = yystpcpy (yyformat, yyunexpected);
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
{
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
{
yycount = 1;
yysize = yysize0;
yyformat[sizeof yyunexpected - 1] = '\0';
break;
}
yyarg[yycount++] = yytname[yyx];
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
yysize_overflow |= (yysize1 < yysize);
yysize = yysize1;
yyfmt = yystpcpy (yyfmt, yyprefix);
yyprefix = yyor;
}
yyf = YY_(yyformat);
switch (yycount)
yysize1 = yysize + yystrlen (yyf);
{
yysize_overflow |= (yysize1 < yysize);
# define YYCASE_(N, S) \
yysize = yysize1;
case N: \
yyformat = S; \
break
YYCASE_(0, YY_("syntax error"));
YYCASE_(1, YY_("syntax error, unexpected %s"));
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
# undef YYCASE_
}
if (yysize_overflow)
yysize1 = yysize + yystrlen (yyformat);
return YYSIZE_MAXIMUM;
if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
return 2;
yysize = yysize1;
if (yyresult)
if (*yymsg_alloc < yysize)
{
{
/* Avoid sprintf, as that infringes on the user's name space.
*yymsg_alloc = 2 * yysize;
Don't have undefined behavior even if the translation
if (! (yysize <= *yymsg_alloc
produced a string with the wrong number of "%s"s. */
&& *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
char *yyp = yyresult;
*yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
int yyi = 0;
return 1;
while ((*yyp = *yyf) != '\0')
{
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
{
yyp += yytnamerr (yyp, yyarg[yyi++]);
yyf += 2;
}
else
{
yyp++;
yyf++;
}
}
}
return yysize;
}
}
/* Avoid sprintf, as that infringes on the user's name space.
Don't have undefined behavior even if the translation
produced a string with the wrong number of "%s"s. */
{
char *yyp = *yymsg;
int yyi = 0;
while ((*yyp = *yyformat) != '\0')
if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
{
yyp += yytnamerr (yyp, yyarg[yyi++]);
yyformat += 2;
}
else
{
yyp++;
yyformat++;
}
}
return 0;
}
}
#endif /* YYERROR_VERBOSE */
#endif /* YYERROR_VERBOSE */
/*-----------------------------------------------.
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
| Release the memory associated to this symbol. |
...
@@ -1359,6 +1402,7 @@ yydestruct (yymsg, yytype, yyvaluep)
...
@@ -1359,6 +1402,7 @@ yydestruct (yymsg, yytype, yyvaluep)
}
}
}
}
/* Prevent warnings from -Wmissing-prototypes. */
/* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
#if defined __STDC__ || defined __cplusplus
...
@@ -1385,10 +1429,9 @@ YYSTYPE yylval;
...
@@ -1385,10 +1429,9 @@ YYSTYPE yylval;
int yynerrs;
int yynerrs;
/*----------.
/*-------------------------.
| yyparse. |
| yyparse or yypush_parse. |
`----------*/
`-------------------------*/
#ifdef YYPARSE_PARAM
#ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \
#if (defined __STDC__ || defined __C99__FUNC__ \
...
@@ -1412,8 +1455,6 @@ yyparse ()
...
@@ -1412,8 +1455,6 @@ yyparse ()
#endif
#endif
#endif
#endif
{
{
int yystate;
int yystate;
/* Number of tokens to shift before error messages enabled. */
/* Number of tokens to shift before error messages enabled. */
int yyerrstatus;
int yyerrstatus;
...
@@ -1568,7 +1609,7 @@ yybackup:
...
@@ -1568,7 +1609,7 @@ yybackup:
/* First try to decide what to do without reference to lookahead token. */
/* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
yyn = yypact[yystate];
if (yy
n == YYPACT_NINF
)
if (yy
pact_value_is_default (yyn)
)
goto yydefault;
goto yydefault;
/* Not known => get a lookahead token if don't already have one. */
/* Not known => get a lookahead token if don't already have one. */
...
@@ -1599,8 +1640,8 @@ yybackup:
...
@@ -1599,8 +1640,8 @@ yybackup:
yyn = yytable[yyn];
yyn = yytable[yyn];
if (yyn <= 0)
if (yyn <= 0)
{
{
if (yy
n == 0 || yyn == YYTABLE_NINF
)
if (yy
table_value_is_error (yyn)
)
goto yyerrlab;
goto yyerrlab;
yyn = -yyn;
yyn = -yyn;
goto yyreduce;
goto yyreduce;
}
}
...
@@ -1655,42 +1696,42 @@ yyreduce:
...
@@ -1655,42 +1696,42 @@ yyreduce:
{
{
case 4:
case 4:
{ is_typedef = 0; is_extern = 0; current_name = NULL; decl_spec = NULL;
;
}
{ is_typedef = 0; is_extern = 0; current_name = NULL; decl_spec = NULL; }
break;
break;
case 5:
case 5:
{ free_list(*(yyvsp[(2) - (2)]), NULL); *(yyvsp[(2) - (2)]) = NULL;
;
}
{ free_list(*(yyvsp[(2) - (2)]), NULL); *(yyvsp[(2) - (2)]) = NULL; }
break;
break;
case 6:
case 6:
{ is_typedef = 1;
;
}
{ is_typedef = 1; }
break;
break;
case 7:
case 7:
{ (yyval) = (yyvsp[(4) - (4)]);
;
}
{ (yyval) = (yyvsp[(4) - (4)]); }
break;
break;
case 8:
case 8:
{ is_typedef = 1;
;
}
{ is_typedef = 1; }
break;
break;
case 9:
case 9:
{ (yyval) = (yyvsp[(3) - (3)]);
;
}
{ (yyval) = (yyvsp[(3) - (3)]); }
break;
break;
case 14:
case 14:
{ (yyval) = (yyvsp[(2) - (2)]);
;
}
{ (yyval) = (yyvsp[(2) - (2)]); }
break;
break;
case 15:
case 15:
{ (yyval) = (yyvsp[(2) - (2)]);
;
}
{ (yyval) = (yyvsp[(2) - (2)]); }
break;
break;
case 16:
case 16:
...
@@ -1704,12 +1745,12 @@ yyreduce:
...
@@ -1704,12 +1745,12 @@ yyreduce:
current_name = NULL;
current_name = NULL;
}
}
(yyval) = (yyvsp[(3) - (3)]);
(yyval) = (yyvsp[(3) - (3)]);
;
}
}
break;
break;
case 17:
case 17:
{ (yyval) = NULL;
;
}
{ (yyval) = NULL; }
break;
break;
case 19:
case 19:
...
@@ -1720,7 +1761,7 @@ yyreduce:
...
@@ -1720,7 +1761,7 @@ yyreduce:
is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern);
is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern);
current_name = NULL;
current_name = NULL;
(yyval) = (yyvsp[(1) - (1)]);
(yyval) = (yyvsp[(1) - (1)]);
;
}
}
break;
break;
case 20:
case 20:
...
@@ -1733,27 +1774,27 @@ yyreduce:
...
@@ -1733,27 +1774,27 @@ yyreduce:
is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern);
is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern);
current_name = NULL;
current_name = NULL;
(yyval) = (yyvsp[(3) - (3)]);
(yyval) = (yyvsp[(3) - (3)]);
;
}
}
break;
break;
case 21:
case 21:
{ (yyval) = (yyvsp[(4) - (4)]) ? (yyvsp[(4) - (4)]) : (yyvsp[(3) - (4)]) ? (yyvsp[(3) - (4)]) : (yyvsp[(2) - (4)]) ? (yyvsp[(2) - (4)]) : (yyvsp[(1) - (4)]);
;
}
{ (yyval) = (yyvsp[(4) - (4)]) ? (yyvsp[(4) - (4)]) : (yyvsp[(3) - (4)]) ? (yyvsp[(3) - (4)]) : (yyvsp[(2) - (4)]) ? (yyvsp[(2) - (4)]) : (yyvsp[(1) - (4)]); }
break;
break;
case 22:
case 22:
{ decl_spec = NULL;
;
}
{ decl_spec = NULL; }
break;
break;
case 24:
case 24:
{ decl_spec = *(yyvsp[(1) - (1)]);
;
}
{ decl_spec = *(yyvsp[(1) - (1)]); }
break;
break;
case 25:
case 25:
{ decl_spec = *(yyvsp[(2) - (2)]);
;
}
{ decl_spec = *(yyvsp[(2) - (2)]); }
break;
break;
case 26:
case 26:
...
@@ -1762,97 +1803,82 @@ yyreduce:
...
@@ -1762,97 +1803,82 @@ yyreduce:
is really irrelevant to the linkage. */
is really irrelevant to the linkage. */
remove_node((yyvsp[(1) - (1)]));
remove_node((yyvsp[(1) - (1)]));
(yyval) = (yyvsp[(1) - (1)]);
(yyval) = (yyvsp[(1) - (1)]);
;
}
}
break;
break;
case 31:
case 31:
{ is_extern = 1; (yyval) = (yyvsp[(1) - (1)]);
;
}
{ is_extern = 1; (yyval) = (yyvsp[(1) - (1)]); }
break;
break;
case 32:
case 32:
{ is_extern = 0; (yyval) = (yyvsp[(1) - (1)]);
;
}
{ is_extern = 0; (yyval) = (yyvsp[(1) - (1)]); }
break;
break;
case 37:
case 37:
{ remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_STRUCT; (yyval) = (yyvsp[(2) - (2)]);
;
}
{ remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_STRUCT; (yyval) = (yyvsp[(2) - (2)]); }
break;
break;
case 38:
case 38:
{ remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_UNION; (yyval) = (yyvsp[(2) - (2)]);
;
}
{ remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_UNION; (yyval) = (yyvsp[(2) - (2)]); }
break;
break;
case 39:
case 39:
{ remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_ENUM; (yyval) = (yyvsp[(2) - (2)]);
;
}
{ remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_ENUM; (yyval) = (yyvsp[(2) - (2)]); }
break;
break;
case 40:
case 40:
{ struct string_list *s = *(yyvsp[(3) - (3)]), *i = *(yyvsp[(2) - (3)]), *r;
{ record_compound((yyvsp[(1) - (3)]), (yyvsp[(2) - (3)]), (yyvsp[(3) - (3)]), SYM_STRUCT); (yyval) = (yyvsp[(3) - (3)]); }
r = copy_node(i); r->tag = SYM_STRUCT;
r->next = (*(yyvsp[(1) - (3)]))->next; *(yyvsp[(3) - (3)]) = r; (*(yyvsp[(1) - (3)]))->next = NULL;
add_symbol(i->string, SYM_STRUCT, s, is_extern);
(yyval) = (yyvsp[(3) - (3)]);
;}
break;
break;
case 41:
case 41:
{ struct string_list *s = *(yyvsp[(3) - (3)]), *i = *(yyvsp[(2) - (3)]), *r;
{ record_compound((yyvsp[(1) - (3)]), (yyvsp[(2) - (3)]), (yyvsp[(3) - (3)]), SYM_UNION); (yyval) = (yyvsp[(3) - (3)]); }
r = copy_node(i); r->tag = SYM_UNION;
r->next = (*(yyvsp[(1) - (3)]))->next; *(yyvsp[(3) - (3)]) = r; (*(yyvsp[(1) - (3)]))->next = NULL;
add_symbol(i->string, SYM_UNION, s, is_extern);
(yyval) = (yyvsp[(3) - (3)]);
;}
break;
break;
case 42:
case 42:
{ struct string_list *s = *(yyvsp[(3) - (3)]), *i = *(yyvsp[(2) - (3)]), *r;
{ record_compound((yyvsp[(1) - (3)]), (yyvsp[(2) - (3)]), (yyvsp[(3) - (3)]), SYM_ENUM); (yyval) = (yyvsp[(3) - (3)]); }
r = copy_node(i); r->tag = SYM_ENUM;
r->next = (*(yyvsp[(1) - (3)]))->next; *(yyvsp[(3) - (3)]) = r; (*(yyvsp[(1) - (3)]))->next = NULL;
add_symbol(i->string, SYM_ENUM, s, is_extern);
(yyval) = (yyvsp[(3) - (3)]);
;}
break;
break;
case 43:
case 43:
{ add_symbol(NULL, SYM_ENUM, NULL, 0); (yyval) = (yyvsp[(2) - (2)]);
;
}
{ add_symbol(NULL, SYM_ENUM, NULL, 0); (yyval) = (yyvsp[(2) - (2)]); }
break;
break;
case 44:
case 44:
{ (yyval) = (yyvsp[(2) - (2)]);
;
}
{ (yyval) = (yyvsp[(2) - (2)]); }
break;
break;
case 45:
case 45:
{ (yyval) = (yyvsp[(2) - (2)]);
;
}
{ (yyval) = (yyvsp[(2) - (2)]); }
break;
break;
case 56:
case 56:
{ (*(yyvsp[(1) - (1)]))->tag = SYM_TYPEDEF; (yyval) = (yyvsp[(1) - (1)]);
;
}
{ (*(yyvsp[(1) - (1)]))->tag = SYM_TYPEDEF; (yyval) = (yyvsp[(1) - (1)]); }
break;
break;
case 57:
case 57:
{ (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]);
;
}
{ (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); }
break;
break;
case 58:
case 58:
{ (yyval) = NULL;
;
}
{ (yyval) = NULL; }
break;
break;
case 61:
case 61:
{ (yyval) = (yyvsp[(2) - (2)]);
;
}
{ (yyval) = (yyvsp[(2) - (2)]); }
break;
break;
case 65:
case 65:
...
@@ -1860,12 +1886,12 @@ yyreduce:
...
@@ -1860,12 +1886,12 @@ yyreduce:
{ /* restrict has no effect in prototypes so ignore it */
{ /* restrict has no effect in prototypes so ignore it */
remove_node((yyvsp[(1) - (1)]));
remove_node((yyvsp[(1) - (1)]));
(yyval) = (yyvsp[(1) - (1)]);
(yyval) = (yyvsp[(1) - (1)]);
;
}
}
break;
break;
case 66:
case 66:
{ (yyval) = (yyvsp[(2) - (2)]);
;
}
{ (yyval) = (yyvsp[(2) - (2)]); }
break;
break;
case 68:
case 68:
...
@@ -1877,97 +1903,97 @@ yyreduce:
...
@@ -1877,97 +1903,97 @@ yyreduce:
current_name = (*(yyvsp[(1) - (1)]))->string;
current_name = (*(yyvsp[(1) - (1)]))->string;
(yyval) = (yyvsp[(1) - (1)]);
(yyval) = (yyvsp[(1) - (1)]);
}
}
;
}
}
break;
break;
case 69:
case 69:
{ (yyval) = (yyvsp[(4) - (4)]);
;
}
{ (yyval) = (yyvsp[(4) - (4)]); }
break;
break;
case 70:
case 70:
{ (yyval) = (yyvsp[(4) - (4)]);
;
}
{ (yyval) = (yyvsp[(4) - (4)]); }
break;
break;
case 71:
case 71:
{ (yyval) = (yyvsp[(2) - (2)]);
;
}
{ (yyval) = (yyvsp[(2) - (2)]); }
break;
break;
case 72:
case 72:
{ (yyval) = (yyvsp[(3) - (3)]);
;
}
{ (yyval) = (yyvsp[(3) - (3)]); }
break;
break;
case 73:
case 73:
{ (yyval) = (yyvsp[(3) - (3)]);
;
}
{ (yyval) = (yyvsp[(3) - (3)]); }
break;
break;
case 74:
case 74:
{ (yyval) = (yyvsp[(2) - (2)]);
;
}
{ (yyval) = (yyvsp[(2) - (2)]); }
break;
break;
case 78:
case 78:
{ (yyval) = (yyvsp[(4) - (4)]);
;
}
{ (yyval) = (yyvsp[(4) - (4)]); }
break;
break;
case 79:
case 79:
{ (yyval) = (yyvsp[(4) - (4)]);
;
}
{ (yyval) = (yyvsp[(4) - (4)]); }
break;
break;
case 80:
case 80:
{ (yyval) = (yyvsp[(2) - (2)]);
;
}
{ (yyval) = (yyvsp[(2) - (2)]); }
break;
break;
case 81:
case 81:
{ (yyval) = (yyvsp[(3) - (3)]);
;
}
{ (yyval) = (yyvsp[(3) - (3)]); }
break;
break;
case 82:
case 82:
{ (yyval) = (yyvsp[(3) - (3)]);
;
}
{ (yyval) = (yyvsp[(3) - (3)]); }
break;
break;
case 83:
case 83:
{ (yyval) = (yyvsp[(2) - (2)]);
;
}
{ (yyval) = (yyvsp[(2) - (2)]); }
break;
break;
case 85:
case 85:
{ (yyval) = (yyvsp[(3) - (3)]);
;
}
{ (yyval) = (yyvsp[(3) - (3)]); }
break;
break;
case 86:
case 86:
{ (yyval) = NULL;
;
}
{ (yyval) = NULL; }
break;
break;
case 89:
case 89:
{ (yyval) = (yyvsp[(3) - (3)]);
;
}
{ (yyval) = (yyvsp[(3) - (3)]); }
break;
break;
case 90:
case 90:
{ (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]);
;
}
{ (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); }
break;
break;
case 91:
case 91:
{ (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]);
;
}
{ (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); }
break;
break;
case 93:
case 93:
{ (yyval) = NULL;
;
}
{ (yyval) = NULL; }
break;
break;
case 94:
case 94:
...
@@ -1976,39 +2002,39 @@ yyreduce:
...
@@ -1976,39 +2002,39 @@ yyreduce:
private parameter names. */
private parameter names. */
remove_node((yyvsp[(1) - (1)]));
remove_node((yyvsp[(1) - (1)]));
(yyval) = (yyvsp[(1) - (1)]);
(yyval) = (yyvsp[(1) - (1)]);
;
}
}
break;
break;
case 95:
case 95:
{ remove_node((yyvsp[(1) - (1)]));
{ remove_node((yyvsp[(1) - (1)]));
(yyval) = (yyvsp[(1) - (1)]);
(yyval) = (yyvsp[(1) - (1)]);
;
}
}
break;
break;
case 96:
case 96:
{ (yyval) = (yyvsp[(4) - (4)]);
;
}
{ (yyval) = (yyvsp[(4) - (4)]); }
break;
break;
case 97:
case 97:
{ (yyval) = (yyvsp[(4) - (4)]);
;
}
{ (yyval) = (yyvsp[(4) - (4)]); }
break;
break;
case 98:
case 98:
{ (yyval) = (yyvsp[(2) - (2)]);
;
}
{ (yyval) = (yyvsp[(2) - (2)]); }
break;
break;
case 99:
case 99:
{ (yyval) = (yyvsp[(3) - (3)]);
;
}
{ (yyval) = (yyvsp[(3) - (3)]); }
break;
break;
case 100:
case 100:
{ (yyval) = (yyvsp[(3) - (3)]);
;
}
{ (yyval) = (yyvsp[(3) - (3)]); }
break;
break;
case 101:
case 101:
...
@@ -2017,87 +2043,87 @@ yyreduce:
...
@@ -2017,87 +2043,87 @@ yyreduce:
*(yyvsp[(2) - (3)]) = NULL;
*(yyvsp[(2) - (3)]) = NULL;
add_symbol(current_name, SYM_NORMAL, decl, is_extern);
add_symbol(current_name, SYM_NORMAL, decl, is_extern);
(yyval) = (yyvsp[(3) - (3)]);
(yyval) = (yyvsp[(3) - (3)]);
;
}
}
break;
break;
case 102:
case 102:
{ (yyval) = NULL;
;
}
{ (yyval) = NULL; }
break;
break;
case 104:
case 104:
{ remove_list((yyvsp[(2) - (2)]), &(*(yyvsp[(1) - (2)]))->next); (yyval) = (yyvsp[(2) - (2)]);
;
}
{ remove_list((yyvsp[(2) - (2)]), &(*(yyvsp[(1) - (2)]))->next); (yyval) = (yyvsp[(2) - (2)]); }
break;
break;
case 105:
case 105:
{ (yyval) = (yyvsp[(3) - (3)]);
;
}
{ (yyval) = (yyvsp[(3) - (3)]); }
break;
break;
case 106:
case 106:
{ (yyval) = (yyvsp[(3) - (3)]);
;
}
{ (yyval) = (yyvsp[(3) - (3)]); }
break;
break;
case 107:
case 107:
{ (yyval) = NULL;
;
}
{ (yyval) = NULL; }
break;
break;
case 110:
case 110:
{ (yyval) = (yyvsp[(2) - (2)]);
;
}
{ (yyval) = (yyvsp[(2) - (2)]); }
break;
break;
case 111:
case 111:
{ (yyval) = (yyvsp[(3) - (3)]);
;
}
{ (yyval) = (yyvsp[(3) - (3)]); }
break;
break;
case 112:
case 112:
{ (yyval) = (yyvsp[(2) - (2)]);
;
}
{ (yyval) = (yyvsp[(2) - (2)]); }
break;
break;
case 113:
case 113:
{ (yyval) = NULL;
;
}
{ (yyval) = NULL; }
break;
break;
case 116:
case 116:
{ (yyval) = (yyvsp[(3) - (3)]);
;
}
{ (yyval) = (yyvsp[(3) - (3)]); }
break;
break;
case 117:
case 117:
{ (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]);
;
}
{ (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); }
break;
break;
case 118:
case 118:
{ (yyval) = (yyvsp[(2) - (2)]);
;
}
{ (yyval) = (yyvsp[(2) - (2)]); }
break;
break;
case 120:
case 120:
{ (yyval) = (yyvsp[(2) - (2)]);
;
}
{ (yyval) = (yyvsp[(2) - (2)]); }
break;
break;
case 121:
case 121:
{ (yyval) = NULL;
;
}
{ (yyval) = NULL; }
break;
break;
case 123:
case 123:
{ (yyval) = (yyvsp[(3) - (3)]);
;
}
{ (yyval) = (yyvsp[(3) - (3)]); }
break;
break;
case 124:
case 124:
{ (yyval) = (yyvsp[(4) - (4)]);
;
}
{ (yyval) = (yyvsp[(4) - (4)]); }
break;
break;
case 127:
case 127:
...
@@ -2105,7 +2131,7 @@ yyreduce:
...
@@ -2105,7 +2131,7 @@ yyreduce:
{
{
const char *name = strdup((*(yyvsp[(1) - (1)]))->string);
const char *name = strdup((*(yyvsp[(1) - (1)]))->string);
add_symbol(name, SYM_ENUM_CONST, NULL, 0);
add_symbol(name, SYM_ENUM_CONST, NULL, 0);
;
}
}
break;
break;
case 128:
case 128:
...
@@ -2114,28 +2140,39 @@ yyreduce:
...
@@ -2114,28 +2140,39 @@ yyreduce:
const char *name = strdup((*(yyvsp[(1) - (3)]))->string);
const char *name = strdup((*(yyvsp[(1) - (3)]))->string);
struct string_list *expr = copy_list_range(*(yyvsp[(3) - (3)]), *(yyvsp[(2) - (3)]));
struct string_list *expr = copy_list_range(*(yyvsp[(3) - (3)]), *(yyvsp[(2) - (3)]));
add_symbol(name, SYM_ENUM_CONST, expr, 0);
add_symbol(name, SYM_ENUM_CONST, expr, 0);
;
}
}
break;
break;
case 129:
case 129:
{ (yyval) = (yyvsp[(2) - (2)]);
;
}
{ (yyval) = (yyvsp[(2) - (2)]); }
break;
break;
case 130:
case 130:
{ (yyval) = NULL;
;
}
{ (yyval) = NULL; }
break;
break;
case 132:
case 132:
{ export_symbol((*(yyvsp[(3) - (5)]))->string); (yyval) = (yyvsp[(5) - (5)]);
;
}
{ export_symbol((*(yyvsp[(3) - (5)]))->string); (yyval) = (yyvsp[(5) - (5)]); }
break;
break;
default: break;
default: break;
}
}
/* User semantic actions sometimes alter yychar, and that requires
that yytoken be updated with the new translation. We take the
approach of translating immediately before every use of yytoken.
One alternative is translating here after every semantic action,
but that translation would be missed if the semantic action invokes
YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
incorrect destructor might then be invoked immediately. In the
case of YYERROR or YYBACKUP, subsequent parser actions might lead
to an incorrect destructor call or verbose syntax error message
before the lookahead is translated. */
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
YYPOPSTACK (yylen);
YYPOPSTACK (yylen);
...
@@ -2163,6 +2200,10 @@ yyreduce:
...
@@ -2163,6 +2200,10 @@ yyreduce:
| yyerrlab -- here on detecting error |
| yyerrlab -- here on detecting error |
`------------------------------------*/
`------------------------------------*/
yyerrlab:
yyerrlab:
/* Make sure we have latest lookahead translation. See comments at
user semantic actions for why this is necessary. */
yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
/* If not already recovering from an error, report this error. */
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
if (!yyerrstatus)
{
{
...
@@ -2170,37 +2211,36 @@ yyerrlab:
...
@@ -2170,37 +2211,36 @@ yyerrlab:
#if ! YYERROR_VERBOSE
#if ! YYERROR_VERBOSE
yyerror (YY_("syntax error"));
yyerror (YY_("syntax error"));
#else
#else
# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
yyssp, yytoken)
{
{
YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
char const *yymsgp = YY_("syntax error");
if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
int yysyntax_error_status;
{
yysyntax_error_status = YYSYNTAX_ERROR;
YYSIZE_T yyalloc = 2 * yysize;
if (yysyntax_error_status == 0)
if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
yymsgp = yymsg;
yyalloc = YYSTACK_ALLOC_MAXIMUM;
else if (yysyntax_error_status == 1)
if (yymsg != yymsgbuf)
{
YYSTACK_FREE (yymsg);
if (yymsg != yymsgbuf)
yymsg = (char *) YYSTACK_ALLOC (yyalloc);
YYSTACK_FREE (yymsg);
if (yymsg)
yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
yymsg_alloc = yyalloc;
if (!yymsg)
else
{
{
yymsg = yymsgbuf;
yymsg = yymsgbuf;
yymsg_alloc = sizeof yymsgbuf;
yymsg_alloc = sizeof yymsgbuf;
yysyntax_error_status = 2;
}
}
}
else
{
if (0 < yysize && yysize <= yymsg_alloc)
yysyntax_error_status = YYSYNTAX_ERROR;
{
yymsgp = yymsg;
(void) yysyntax_error (yymsg, yystate, yychar);
}
yyerror (yymsg);
}
}
yyerror (yymsgp);
else
if (yysyntax_error_status == 2)
{
goto yyexhaustedlab;
yyerror (YY_("syntax error"));
if (yysize != 0)
goto yyexhaustedlab;
}
}
}
# undef YYSYNTAX_ERROR
#endif
#endif
}
}
...
@@ -2259,7 +2299,7 @@ yyerrlab1:
...
@@ -2259,7 +2299,7 @@ yyerrlab1:
for (;;)
for (;;)
{
{
yyn = yypact[yystate];
yyn = yypact[yystate];
if (
yyn != YYPACT_NINF
)
if (
!yypact_value_is_default (yyn)
)
{
{
yyn += YYTERROR;
yyn += YYTERROR;
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
...
@@ -2318,8 +2358,13 @@ yyexhaustedlab:
...
@@ -2318,8 +2358,13 @@ yyexhaustedlab:
yyreturn:
yyreturn:
if (yychar != YYEMPTY)
if (yychar != YYEMPTY)
yydestruct ("Cleanup: discarding lookahead",
{
yytoken, &yylval);
/* Make sure we have latest lookahead translation. See comments at
user semantic actions for why this is necessary. */
yytoken = YYTRANSLATE (yychar);
yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval);
}
/* Do not reclaim the symbols of the rule which action triggered
/* Do not reclaim the symbols of the rule which action triggered
this YYABORT or YYACCEPT. */
this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen);
YYPOPSTACK (yylen);
...
...
scripts/genksyms/parse.tab.h_shipped
View file @
0359de7d
/* A Bison parser, made by GNU Bison 2.
4.3
. */
/* A Bison parser, made by GNU Bison 2.
5
. */
/*
Skeleton interface for Bison's
Yacc-like parsers in C
/*
Bison interface for
Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
2009, 2010 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment