Commit bcdfe725 by Shannon Woods

Updates bison-generated code in preprocessor to 2.7 version

TRAC #23274 Authored-by: Shannon Woods Signed-off-by: Jamie Madill Signed-off-by: Nicolas Capens
parent 5aecab5f
/* A Bison parser, made by GNU Bison 2.4.2. */ /* A Bison parser, made by GNU Bison 2.7. */
/* Skeleton implementation for Bison's Yacc-like parsers in C /* Bison implementation for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 Free Software Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
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.2" #define YYBISON_VERSION "2.7"
/* Skeleton name. */ /* Skeleton name. */
#define YYSKELETON_NAME "yacc.c" #define YYSKELETON_NAME "yacc.c"
...@@ -59,8 +58,6 @@ ...@@ -59,8 +58,6 @@
/* Pull parsers. */ /* Pull parsers. */
#define YYPULL 1 #define YYPULL 1
/* Using locations. */
#define YYLSP_NEEDED 0
/* Substitute the variable and function names. */ /* Substitute the variable and function names. */
#define yyparse ppparse #define yyparse ppparse
...@@ -71,7 +68,6 @@ ...@@ -71,7 +68,6 @@
#define yydebug ppdebug #define yydebug ppdebug
#define yynerrs ppnerrs #define yynerrs ppnerrs
/* Copy the first part of user declarations. */ /* Copy the first part of user declarations. */
...@@ -130,10 +126,13 @@ static void yyerror(Context* context, const char* reason); ...@@ -130,10 +126,13 @@ static void yyerror(Context* context, const char* reason);
/* Enabling traces. */ # ifndef YY_NULL
#ifndef YYDEBUG # if defined __cplusplus && 201103L <= __cplusplus
# define YYDEBUG 0 # define YY_NULL nullptr
#endif # else
# define YY_NULL 0
# endif
# endif
/* Enabling verbose error messages. */ /* Enabling verbose error messages. */
#ifdef YYERROR_VERBOSE #ifdef YYERROR_VERBOSE
...@@ -143,11 +142,14 @@ static void yyerror(Context* context, const char* reason); ...@@ -143,11 +142,14 @@ static void yyerror(Context* context, const char* reason);
# define YYERROR_VERBOSE 0 # define YYERROR_VERBOSE 0
#endif #endif
/* Enabling the token table. */
#ifndef YYTOKEN_TABLE
# define YYTOKEN_TABLE 0
#endif
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int ppdebug;
#endif
/* Tokens. */ /* Tokens. */
#ifndef YYTOKENTYPE #ifndef YYTOKENTYPE
...@@ -169,7 +171,6 @@ static void yyerror(Context* context, const char* reason); ...@@ -169,7 +171,6 @@ static void yyerror(Context* context, const char* reason);
#endif #endif
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef int YYSTYPE; typedef int YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_TRIVIAL 1
...@@ -178,6 +179,22 @@ typedef int YYSTYPE; ...@@ -178,6 +179,22 @@ typedef int YYSTYPE;
#endif #endif
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int ppparse (void *YYPARSE_PARAM);
#else
int ppparse ();
#endif
#else /* ! YYPARSE_PARAM */
#if defined __STDC__ || defined __cplusplus
int ppparse (Context *context);
#else
int ppparse ();
#endif
#endif /* ! YYPARSE_PARAM */
/* Copy the second part of user declarations. */ /* Copy the second part of user declarations. */
...@@ -233,24 +250,24 @@ typedef short int yytype_int16; ...@@ -233,24 +250,24 @@ typedef short int yytype_int16;
# if defined YYENABLE_NLS && YYENABLE_NLS # if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS # if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
# define YY_(msgid) dgettext ("bison-runtime", msgid) # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
# endif # endif
# endif # endif
# ifndef YY_ # ifndef YY_
# define YY_(msgid) msgid # define YY_(Msgid) Msgid
# endif # endif
#endif #endif
/* Suppress unused-variable warnings by "using" E. */ /* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__ #if ! defined lint || defined __GNUC__
# define YYUSE(e) ((void) (e)) # define YYUSE(E) ((void) (E))
#else #else
# define YYUSE(e) /* empty */ # define YYUSE(E) /* empty */
#endif #endif
/* Identity function, used to suppress warnings about constant conditions. */ /* Identity function, used to suppress warnings about constant conditions. */
#ifndef lint #ifndef lint
# define YYID(n) (n) # define YYID(N) (N)
#else #else
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
...@@ -283,11 +300,12 @@ YYID (yyi) ...@@ -283,11 +300,12 @@ 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 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
# define _STDLIB_H 1 # ifndef EXIT_SUCCESS
# 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 SRC to DST. The source and destination do
not overlap. */
# ifndef YYCOPY
# if defined __GNUC__ && 1 < __GNUC__
# define YYCOPY(Dst, Src, Count) \
__builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
# else
# define YYCOPY(Dst, Src, Count) \
do \
{ \
YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(Dst)[yyi] = (Src)[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 14 #define YYFINAL 14
/* YYLAST -- Last index in YYTABLE. */ /* YYLAST -- Last index in YYTABLE. */
...@@ -479,7 +501,7 @@ static const yytype_uint8 yyrline[] = ...@@ -479,7 +501,7 @@ static const yytype_uint8 yyrline[] =
}; };
#endif #endif
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE #if YYDEBUG || YYERROR_VERBOSE || 0
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] = static const char *const yytname[] =
...@@ -488,7 +510,7 @@ static const char *const yytname[] = ...@@ -488,7 +510,7 @@ static const char *const yytname[] =
"TOK_OP_AND", "'|'", "'^'", "'&'", "TOK_OP_NE", "TOK_OP_EQ", "'<'", "TOK_OP_AND", "'|'", "'^'", "'&'", "TOK_OP_NE", "TOK_OP_EQ", "'<'",
"'>'", "TOK_OP_GE", "TOK_OP_LE", "TOK_OP_RIGHT", "TOK_OP_LEFT", "'+'", "'>'", "TOK_OP_GE", "TOK_OP_LE", "TOK_OP_RIGHT", "TOK_OP_LEFT", "'+'",
"'-'", "'*'", "'/'", "'%'", "TOK_UNARY", "'!'", "'~'", "'('", "')'", "'-'", "'*'", "'/'", "'%'", "TOK_UNARY", "'!'", "'~'", "'('", "')'",
"$accept", "input", "expression", 0 "$accept", "input", "expression", YY_NULL
}; };
#endif #endif
...@@ -519,8 +541,8 @@ static const yytype_uint8 yyr2[] = ...@@ -519,8 +541,8 @@ static const yytype_uint8 yyr2[] =
3, 3, 2, 2, 2, 2, 3 3, 3, 2, 2, 2, 2, 3
}; };
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state /* YYDEFACT[STATE-NAME] -- Default reduction 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[] =
{ {
...@@ -559,8 +581,7 @@ static const yytype_int8 yypgoto[] = ...@@ -559,8 +581,7 @@ static const yytype_int8 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 -1 #define YYTABLE_NINF -1
static const yytype_uint8 yytable[] = static const yytype_uint8 yytable[] =
{ {
...@@ -584,6 +605,12 @@ static const yytype_uint8 yytable[] = ...@@ -584,6 +605,12 @@ static const yytype_uint8 yytable[] =
27, 28, 29, 30, 31, 32 27, 28, 29, 30, 31, 32
}; };
#define yypact_value_is_default(Yystate) \
(!!((Yystate) == (-11)))
#define yytable_value_is_error(Yytable_value) \
YYID (0)
static const yytype_int8 yycheck[] = static const yytype_int8 yycheck[] =
{ {
2, 3, 4, 5, 6, 15, 16, 17, 18, 19, 2, 3, 4, 5, 6, 15, 16, 17, 18, 19,
...@@ -645,72 +672,35 @@ static const yytype_uint8 yystos[] = ...@@ -645,72 +672,35 @@ static const yytype_uint8 yystos[] =
#define YYRECOVERING() (!!yyerrstatus) #define YYRECOVERING() (!!yyerrstatus)
#define YYBACKUP(Token, Value) \ #define YYBACKUP(Token, Value) \
do \ do \
if (yychar == YYEMPTY && yylen == 1) \ if (yychar == YYEMPTY) \
{ \ { \
yychar = (Token); \ yychar = (Token); \
yylval = (Value); \ yylval = (Value); \
yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (yylen); \
YYPOPSTACK (1); \ yystate = *yyssp; \
goto yybackup; \ goto yybackup; \
} \ } \
else \ else \
{ \ { \
yyerror (context, YY_("syntax error: cannot back up")); \ yyerror (context, YY_("syntax error: cannot back up")); \
YYERROR; \ YYERROR; \
} \ } \
while (YYID (0)) while (YYID (0))
/* Error token number */
#define YYTERROR 1 #define YYTERROR 1
#define YYERRCODE 256 #define YYERRCODE 256
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. /* This macro is provided for backward compatibility. */
If N is 0, then set CURRENT to the empty location which ends
the previous symbol: RHS[0] (always defined). */
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N) \
do \
if (YYID (N)) \
{ \
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
} \
else \
{ \
(Current).first_line = (Current).last_line = \
YYRHSLOC (Rhs, 0).last_line; \
(Current).first_column = (Current).last_column = \
YYRHSLOC (Rhs, 0).last_column; \
} \
while (YYID (0))
#endif
/* YY_LOCATION_PRINT -- Print the location on the stream.
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
/* YYLEX -- calling `yylex' with the right arguments. */ /* YYLEX -- calling `yylex' with the right arguments. */
#ifdef YYLEX_PARAM #ifdef YYLEX_PARAM
# define YYLEX yylex (&yylval, YYLEX_PARAM) # define YYLEX yylex (&yylval, YYLEX_PARAM)
#else #else
...@@ -761,6 +751,8 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, context) ...@@ -761,6 +751,8 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, context)
Context *context; Context *context;
#endif #endif
{ {
FILE *yyo = yyoutput;
YYUSE (yyo);
if (!yyvaluep) if (!yyvaluep)
return; return;
YYUSE (context); YYUSE (context);
...@@ -773,7 +765,7 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, context) ...@@ -773,7 +765,7 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, context)
switch (yytype) switch (yytype)
{ {
default: default:
break; break;
} }
} }
...@@ -901,7 +893,6 @@ int yydebug; ...@@ -901,7 +893,6 @@ int yydebug;
# define YYMAXDEPTH 10000 # define YYMAXDEPTH 10000
#endif #endif
#if YYERROR_VERBOSE #if YYERROR_VERBOSE
...@@ -1004,115 +995,145 @@ yytnamerr (char *yyres, const char *yystr) ...@@ -1004,115 +995,145 @@ 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 (YY_NULL, yytname[yytoken]);
YYSIZE_T yysize = yysize0;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */
const char *yyformat = YY_NULL;
/* 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 {
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
* (sizeof yyor - 1))]; if (! (yysize <= yysize1
char const *yyprefix = yyexpecting; && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
return 2;
/* Start YYX at -YYN if negative to avoid negative indexes in yysize = yysize1;
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) {
return YYSIZE_MAXIMUM; YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
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. |
...@@ -1143,32 +1164,16 @@ yydestruct (yymsg, yytype, yyvaluep, context) ...@@ -1143,32 +1164,16 @@ yydestruct (yymsg, yytype, yyvaluep, context)
{ {
default: default:
break; break;
} }
} }
/* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
#else
int yyparse ();
#endif
#else /* ! YYPARSE_PARAM */
#if defined __STDC__ || defined __cplusplus
int yyparse (Context *context);
#else
int yyparse ();
#endif
#endif /* ! YYPARSE_PARAM */
/*----------.
/*-------------------------. | yyparse. |
| yyparse or yypush_parse. | `----------*/
`-------------------------*/
#ifdef YYPARSE_PARAM #ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
...@@ -1195,8 +1200,31 @@ yyparse (context) ...@@ -1195,8 +1200,31 @@ yyparse (context)
/* The lookahead symbol. */ /* The lookahead symbol. */
int yychar; int yychar;
#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
_Pragma ("GCC diagnostic pop")
#else
/* Default value used for initialization, for pacifying older GCCs
or non-GCC compilers. */
static YYSTYPE yyval_default;
# define YY_INITIAL_VALUE(Value) = Value
#endif
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
#endif
#ifndef YY_INITIAL_VALUE
# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif
/* The semantic value of the lookahead symbol. */ /* The semantic value of the lookahead symbol. */
YYSTYPE yylval; YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
/* Number of syntax errors so far. */ /* Number of syntax errors so far. */
int yynerrs; int yynerrs;
...@@ -1209,7 +1237,7 @@ YYSTYPE yylval; ...@@ -1209,7 +1237,7 @@ YYSTYPE yylval;
`yyss': related to states. `yyss': related to states.
`yyvs': related to semantic values. `yyvs': related to semantic values.
Refer to the stacks thru separate pointers, to allow yyoverflow Refer to the stacks through separate pointers, to allow yyoverflow
to reallocate them elsewhere. */ to reallocate them elsewhere. */
/* The state stack. */ /* The state stack. */
...@@ -1227,7 +1255,7 @@ YYSTYPE yylval; ...@@ -1227,7 +1255,7 @@ YYSTYPE yylval;
int yyn; int yyn;
int yyresult; int yyresult;
/* Lookahead token as an internal (translated) token number. */ /* Lookahead token as an internal (translated) token number. */
int yytoken; int yytoken = 0;
/* The variables used to return semantic value and location from the /* The variables used to return semantic value and location from the
action routines. */ action routines. */
YYSTYPE yyval; YYSTYPE yyval;
...@@ -1245,9 +1273,8 @@ YYSTYPE yylval; ...@@ -1245,9 +1273,8 @@ YYSTYPE yylval;
Keep to zero when no symbol should be popped. */ Keep to zero when no symbol should be popped. */
int yylen = 0; int yylen = 0;
yytoken = 0; yyssp = yyss = yyssa;
yyss = yyssa; yyvsp = yyvs = yyvsa;
yyvs = yyvsa;
yystacksize = YYINITDEPTH; yystacksize = YYINITDEPTH;
YYDPRINTF ((stderr, "Starting parse\n")); YYDPRINTF ((stderr, "Starting parse\n"));
...@@ -1256,14 +1283,6 @@ YYSTYPE yylval; ...@@ -1256,14 +1283,6 @@ YYSTYPE yylval;
yyerrstatus = 0; yyerrstatus = 0;
yynerrs = 0; yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */ yychar = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers.
Waste one element of value and location stack
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
yyssp = yyss;
yyvsp = yyvs;
goto yysetstate; goto yysetstate;
/*------------------------------------------------------------. /*------------------------------------------------------------.
...@@ -1355,7 +1374,7 @@ yybackup: ...@@ -1355,7 +1374,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 (yyn == YYPACT_NINF) if (yypact_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. */
...@@ -1386,8 +1405,8 @@ yybackup: ...@@ -1386,8 +1405,8 @@ yybackup:
yyn = yytable[yyn]; yyn = yytable[yyn];
if (yyn <= 0) if (yyn <= 0)
{ {
if (yyn == 0 || yyn == YYTABLE_NINF) if (yytable_value_is_error (yyn))
goto yyerrlab; goto yyerrlab;
yyn = -yyn; yyn = -yyn;
goto yyreduce; goto yyreduce;
} }
...@@ -1404,7 +1423,9 @@ yybackup: ...@@ -1404,7 +1423,9 @@ yybackup:
yychar = YYEMPTY; yychar = YYEMPTY;
yystate = yyn; yystate = yyn;
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval; *++yyvsp = yylval;
YY_IGNORE_MAYBE_UNINITIALIZED_END
goto yynewstate; goto yynewstate;
...@@ -1633,6 +1654,17 @@ yyreduce: ...@@ -1633,6 +1654,17 @@ yyreduce:
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);
...@@ -1660,6 +1692,10 @@ yyreduce: ...@@ -1660,6 +1692,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)
{ {
...@@ -1667,37 +1703,36 @@ yyerrlab: ...@@ -1667,37 +1703,36 @@ yyerrlab:
#if ! YYERROR_VERBOSE #if ! YYERROR_VERBOSE
yyerror (context, YY_("syntax error")); yyerror (context, 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 (context, yymsg); }
} yyerror (context, yymsgp);
else if (yysyntax_error_status == 2)
{ goto yyexhaustedlab;
yyerror (context, YY_("syntax error"));
if (yysize != 0)
goto yyexhaustedlab;
}
} }
# undef YYSYNTAX_ERROR
#endif #endif
} }
...@@ -1756,7 +1791,7 @@ yyerrlab1: ...@@ -1756,7 +1791,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)
...@@ -1779,7 +1814,9 @@ yyerrlab1: ...@@ -1779,7 +1814,9 @@ yyerrlab1:
YY_STACK_PRINT (yyss, yyssp); YY_STACK_PRINT (yyss, yyssp);
} }
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval; *++yyvsp = yylval;
YY_IGNORE_MAYBE_UNINITIALIZED_END
/* Shift the error token. */ /* Shift the error token. */
...@@ -1803,7 +1840,7 @@ yyabortlab: ...@@ -1803,7 +1840,7 @@ yyabortlab:
yyresult = 1; yyresult = 1;
goto yyreturn; goto yyreturn;
#if !defined(yyoverflow) || YYERROR_VERBOSE #if !defined yyoverflow || YYERROR_VERBOSE
/*-------------------------------------------------. /*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. | | yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/ `-------------------------------------------------*/
...@@ -1815,8 +1852,13 @@ yyexhaustedlab: ...@@ -1815,8 +1852,13 @@ yyexhaustedlab:
yyreturn: yyreturn:
if (yychar != YYEMPTY) if (yychar != YYEMPTY)
yydestruct ("Cleanup: discarding lookahead", {
yytoken, &yylval, context); /* 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, context);
}
/* 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);
...@@ -1937,4 +1979,3 @@ bool ExpressionParser::parse(Token* token, int* result) ...@@ -1937,4 +1979,3 @@ bool ExpressionParser::parse(Token* token, int* result)
} }
} // namespace pp } // namespace pp
...@@ -1533,7 +1533,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) ...@@ -1533,7 +1533,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
case EOB_ACT_END_OF_FILE: case EOB_ACT_END_OF_FILE:
{ {
if ( ppwrap(yyscanner ) ) if ( ppwrap(yyscanner ) )
return 0; return EOF;
if ( ! yyg->yy_did_buffer_switch_on_eof ) if ( ! yyg->yy_did_buffer_switch_on_eof )
YY_NEW_FILE; YY_NEW_FILE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment