c, c++: rename yysymbol_type_t as yysymbol_kind_t

See https://lists.gnu.org/r/bison-patches/2020-04/msg00031.html

* data/skeletons/c.m4, data/skeletons/glr.c, data/skeletons/yacc.c
(yysymbol_type_t): Rename as...
(yysymbol_kind_t): this.
Adjust dependencies.
* data/skeletons/c++.m4, data/skeletons/glr.cc, data/skeletons/lalr1.cc
(symbol_type_type): Rename as...
(symbol_kind_type): this.
Adjust dependencies.
This commit is contained in:
Akim Demaille
2020-04-05 11:06:21 +02:00
parent 57bc3c9013
commit 2c05fc750a
12 changed files with 115 additions and 115 deletions

4
NEWS
View File

@@ -45,7 +45,7 @@ GNU Bison NEWS
// Report the tokens expected at this point. // Report the tokens expected at this point.
{ {
enum { TOKENMAX = 10 }; enum { TOKENMAX = 10 };
yysymbol_type_t expected[TOKENMAX]; yysymbol_kind_t expected[TOKENMAX];
int n = yyexpected_tokens (ctx, expected, TOKENMAX); int n = yyexpected_tokens (ctx, expected, TOKENMAX);
if (n < 0) if (n < 0)
// Forward errors to yyparse. // Forward errors to yyparse.
@@ -57,7 +57,7 @@ GNU Bison NEWS
} }
// Report the unexpected token. // Report the unexpected token.
{ {
yysymbol_type_t lookahead = yypcontext_token (ctx); yysymbol_kind_t lookahead = yypcontext_token (ctx);
if (lookahead != YYSYMBOL_YYEMPTY) if (lookahead != YYSYMBOL_YYEMPTY)
fprintf (stderr, " before %s", yysymbol_name (lookahead)); fprintf (stderr, " before %s", yysymbol_name (lookahead));
} }

View File

@@ -188,7 +188,7 @@ m4_define([b4_token_enums],
# Defining YYEMPTY here is important: it forces the compiler # Defining YYEMPTY here is important: it forces the compiler
# to use a signed type, which matters for yytoken. # to use a signed type, which matters for yytoken.
m4_define([b4_declare_symbol_enum], m4_define([b4_declare_symbol_enum],
[[enum symbol_type_type [[enum symbol_kind_type
{ {
]m4_join([, ]m4_join([,
], ],
@@ -322,7 +322,7 @@ m4_define([b4_symbol_type_define],
void clear () void clear ()
{]b4_variant_if([[ {]b4_variant_if([[
// User destructor. // User destructor.
symbol_type_type yytype = this->type_get (); symbol_kind_type yytype = this->type_get ();
basic_symbol<Base>& yysym = *this; basic_symbol<Base>& yysym = *this;
(void) yysym; (void) yysym;
switch (yytype) switch (yytype)
@@ -384,11 +384,11 @@ m4_define([b4_symbol_type_define],
/// The (internal) type number (corresponding to \a type). /// The (internal) type number (corresponding to \a type).
/// \a empty when empty. /// \a empty when empty.
symbol_type_type type_get () const YY_NOEXCEPT; symbol_kind_type type_get () const YY_NOEXCEPT;
/// The symbol type. /// The symbol type.
/// \a YYSYMBOL_YYEMPTY when empty. /// \a YYSYMBOL_YYEMPTY when empty.
symbol_type_type type; symbol_kind_type type;
}; };
/// "External" symbols: returned by the scanner. /// "External" symbols: returned by the scanner.
@@ -508,7 +508,7 @@ m4_define([b4_public_types_define],
that.clear (); that.clear ();
} }
]b4_inline([$1])[]b4_parser_class[::symbol_type_type ]b4_inline([$1])[]b4_parser_class[::symbol_kind_type
]b4_parser_class[::by_type::type_get () const YY_NOEXCEPT ]b4_parser_class[::by_type::type_get () const YY_NOEXCEPT
{ {
return type; return type;
@@ -528,11 +528,11 @@ m4_define([b4_token_constructor_define], [])
# Define yytranslate_. Sometimes used in the header file ($1=hh), # Define yytranslate_. Sometimes used in the header file ($1=hh),
# sometimes in the cc file. # sometimes in the cc file.
m4_define([b4_yytranslate_define], m4_define([b4_yytranslate_define],
[ b4_inline([$1])b4_parser_class[::symbol_type_type [ b4_inline([$1])b4_parser_class[::symbol_kind_type
]b4_parser_class[::yytranslate_ (int t) ]b4_parser_class[::yytranslate_ (int t)
{ {
]b4_api_token_raw_if( ]b4_api_token_raw_if(
[[ return static_cast<symbol_type_type> (t);]], [[ return static_cast<symbol_kind_type> (t);]],
[[ // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to [[ // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to
// TOKEN-NUM as returned by yylex. // TOKEN-NUM as returned by yylex.
static static
@@ -546,7 +546,7 @@ m4_define([b4_yytranslate_define],
if (t <= 0) if (t <= 0)
return YYSYMBOL_YYEOF; return YYSYMBOL_YYEOF;
else if (t <= user_token_number_max_) else if (t <= user_token_number_max_)
return YY_CAST (symbol_type_type, translate_table[t]); return YY_CAST (symbol_kind_type, translate_table[t]);
else else
return YYSYMBOL_YYUNDEF;]])[ return YYSYMBOL_YYUNDEF;]])[
} }

View File

@@ -508,14 +508,14 @@ m4_define([b4_symbol_enum],
# to use a signed type, which matters for yytoken. # to use a signed type, which matters for yytoken.
m4_define([b4_declare_symbol_enum], m4_define([b4_declare_symbol_enum],
[[/* Symbol type. */ [[/* Symbol type. */
enum yysymbol_type_t enum yysymbol_kind_t
{ {
]m4_join([, ]m4_join([,
], ],
]b4_symbol_sid([-2])[ = -2, ]b4_symbol_sid([-2])[ = -2,
b4_symbol_map([b4_symbol_enum]))[ b4_symbol_map([b4_symbol_enum]))[
}; };
typedef enum yysymbol_type_t yysymbol_type_t; typedef enum yysymbol_kind_t yysymbol_kind_t;
]])]) ]])])
@@ -620,7 +620,7 @@ m4_define_default([b4_yydestruct_define],
static void static void
yydestruct (const char *yymsg, yydestruct (const char *yymsg,
yysymbol_type_t yytype, YYSTYPE *yyvaluep]b4_locations_if(dnl yysymbol_kind_t yytype, YYSTYPE *yyvaluep]b4_locations_if(dnl
[[, YYLTYPE *yylocationp]])[]b4_user_formals[) [[, YYLTYPE *yylocationp]])[]b4_user_formals[)
{ {
]b4_parse_param_use([yyvaluep], [yylocationp])dnl ]b4_parse_param_use([yyvaluep], [yylocationp])dnl
@@ -646,7 +646,7 @@ m4_define_default([b4_yy_symbol_print_define],
static void static void
yy_symbol_value_print (FILE *yyo, yy_symbol_value_print (FILE *yyo,
yysymbol_type_t yytype, YYSTYPE const * const yyvaluep]b4_locations_if(dnl yysymbol_kind_t yytype, YYSTYPE const * const yyvaluep]b4_locations_if(dnl
[[, YYLTYPE const * const yylocationp]])[]b4_user_formals[) [[, YYLTYPE const * const yylocationp]])[]b4_user_formals[)
{ {
FILE *yyoutput = yyo; FILE *yyoutput = yyo;
@@ -674,7 +674,7 @@ b4_percent_code_get([[post-printer]])dnl
static void static void
yy_symbol_print (FILE *yyo, yy_symbol_print (FILE *yyo,
yysymbol_type_t yytype, YYSTYPE const * const yyvaluep]b4_locations_if(dnl yysymbol_kind_t yytype, YYSTYPE const * const yyvaluep]b4_locations_if(dnl
[[, YYLTYPE const * const yylocationp]])[]b4_user_formals[) [[, YYLTYPE const * const yylocationp]])[]b4_user_formals[)
{ {
YYFPRINTF (yyo, "%s %s (", YYFPRINTF (yyo, "%s %s (",

View File

@@ -337,10 +337,10 @@ static YYLTYPE yyloc_default][]b4_yyloc_default;])[
/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
as returned by yylex, with out-of-bounds checking. */ as returned by yylex, with out-of-bounds checking. */
]b4_api_token_raw_if(dnl ]b4_api_token_raw_if(dnl
[[#define YYTRANSLATE(YYX) YY_CAST (yysymbol_type_t, YYX)]], [[#define YYTRANSLATE(YYX) YY_CAST (yysymbol_kind_t, YYX)]],
[[#define YYTRANSLATE(YYX) \ [[#define YYTRANSLATE(YYX) \
(0 <= (YYX) && (YYX) <= YYMAXUTOK \ (0 <= (YYX) && (YYX) <= YYMAXUTOK \
? YY_CAST (yysymbol_type_t, yytranslate[YYX]) \ ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
: YYSYMBOL_YYUNDEF) : YYSYMBOL_YYUNDEF)
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
@@ -594,16 +594,16 @@ yyMemoryExhausted (yyGLRStack* yystackp)
} }
/** Accessing symbol of state YYSTATE. */ /** Accessing symbol of state YYSTATE. */
static inline yysymbol_type_t static inline yysymbol_kind_t
yy_accessing_symbol (yy_state_t yystate) yy_accessing_symbol (yy_state_t yystate)
{ {
return YY_CAST (yysymbol_type_t, yystos[yystate]); return YY_CAST (yysymbol_kind_t, yystos[yystate]);
} }
#if ]b4_parse_error_case([simple], [b4_api_PREFIX[DEBUG || ]b4_token_table_flag], [[1]])[ #if ]b4_parse_error_case([simple], [b4_api_PREFIX[DEBUG || ]b4_token_table_flag], [[1]])[
/* The user-facing name of the symbol whose (internal) number is /* The user-facing name of the symbol whose (internal) number is
YYSYMBOL. No bounds checking. */ YYSYMBOL. No bounds checking. */
static const char *yysymbol_name (yysymbol_type_t yysymbol) YY_ATTRIBUTE_UNUSED; static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
]b4_parse_error_bmatch([simple\|verbose], ]b4_parse_error_bmatch([simple\|verbose],
[[/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. [[/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
@@ -614,12 +614,12 @@ static const char *const yytname[] =
}; };
static const char * static const char *
yysymbol_name (yysymbol_type_t yysymbol) yysymbol_name (yysymbol_kind_t yysymbol)
{ {
return yytname[yysymbol]; return yytname[yysymbol];
}]], }]],
[[static const char * [[static const char *
yysymbol_name (yysymbol_type_t yysymbol) yysymbol_name (yysymbol_kind_t yysymbol)
{ {
static const char *const yy_sname[] = static const char *const yy_sname[] =
{ {
@@ -805,10 +805,10 @@ yyfillin (yyGLRStackItem *yyvsp, int yylow0, int yylow1)
]m4_define([b4_yygetToken_call], ]m4_define([b4_yygetToken_call],
[[yygetToken (&yychar][]b4_pure_if([, yystackp])[]b4_user_args[)]])[ [[yygetToken (&yychar][]b4_pure_if([, yystackp])[]b4_user_args[)]])[
/** If yychar is empty, fetch the next token. */ /** If yychar is empty, fetch the next token. */
static inline yysymbol_type_t static inline yysymbol_kind_t
yygetToken (int *yycharp][]b4_pure_if([, yyGLRStack* yystackp])[]b4_user_formals[) yygetToken (int *yycharp][]b4_pure_if([, yyGLRStack* yystackp])[]b4_user_formals[)
{ {
yysymbol_type_t yytoken; yysymbol_kind_t yytoken;
]b4_parse_param_use()dnl ]b4_parse_param_use()dnl
[ if (*yycharp == YYEMPTY) [ if (*yycharp == YYEMPTY)
{ {
@@ -994,10 +994,10 @@ yydestroyGLRState (char const *yymsg, yyGLRState *yys]b4_user_formals[)
} }
/** Left-hand-side symbol for rule #YYRULE. */ /** Left-hand-side symbol for rule #YYRULE. */
static inline yysymbol_type_t static inline yysymbol_kind_t
yylhsNonterm (yyRuleNum yyrule) yylhsNonterm (yyRuleNum yyrule)
{ {
return YY_CAST (yysymbol_type_t, yyr1[yyrule]); return YY_CAST (yysymbol_kind_t, yyr1[yyrule]);
} }
#define yypact_value_is_default(Yyn) \ #define yypact_value_is_default(Yyn) \
@@ -1030,7 +1030,7 @@ yydefaultAction (yy_state_t yystate)
* of conflicting reductions. * of conflicting reductions.
*/ */
static inline int static inline int
yygetLRActions (yy_state_t yystate, yysymbol_type_t yytoken, const short** yyconflicts) yygetLRActions (yy_state_t yystate, yysymbol_kind_t yytoken, const short** yyconflicts)
{ {
int yyindex = yypact[yystate] + yytoken; int yyindex = yypact[yystate] + yytoken;
if (yyisDefaultedState (yystate) if (yyisDefaultedState (yystate)
@@ -1056,7 +1056,7 @@ yygetLRActions (yy_state_t yystate, yysymbol_type_t yytoken, const short** yycon
* \param yysym the nonterminal to push on the stack * \param yysym the nonterminal to push on the stack
*/ */
static inline yy_state_t static inline yy_state_t
yyLRgotoState (yy_state_t yystate, yysymbol_type_t yysym) yyLRgotoState (yy_state_t yystate, yysymbol_kind_t yysym)
{ {
int yyr = yypgoto[yysym - YYNTOKENS] + yystate; int yyr = yypgoto[yysym - YYNTOKENS] + yystate;
if (0 <= yyr && yyr <= YYLAST && yycheck[yyr] == yystate) if (0 <= yyr && yyr <= YYLAST && yycheck[yyr] == yystate)
@@ -2027,7 +2027,7 @@ yyprocessOneStack (yyGLRStack* yystackp, ptrdiff_t yyk,
} }
else else
{ {
yysymbol_type_t yytoken = ]b4_yygetToken_call[; yysymbol_kind_t yytoken = ]b4_yygetToken_call[;
const short* yyconflicts; const short* yyconflicts;
const int yyaction = yygetLRActions (yystate, yytoken, &yyconflicts); const int yyaction = yygetLRActions (yystate, yytoken, &yyconflicts);
yystackp->yytops.yylookaheadNeeds[yyk] = yytrue; yystackp->yytops.yylookaheadNeeds[yyk] = yytrue;
@@ -2090,7 +2090,7 @@ yyprocessOneStack (yyGLRStack* yystackp, ptrdiff_t yyk,
be less than YYNTOKENS). */ be less than YYNTOKENS). */
static int static int
yyexpected_tokens (const yyGLRStack* yystackp, yyexpected_tokens (const yyGLRStack* yystackp,
yysymbol_type_t yyarg[], int yyargn) yysymbol_kind_t yyarg[], int yyargn)
{ {
/* Actual size of YYARG. */ /* Actual size of YYARG. */
int yycount = 0; int yycount = 0;
@@ -2114,7 +2114,7 @@ yyexpected_tokens (const yyGLRStack* yystackp,
else if (yycount == yyargn) else if (yycount == yyargn)
return 0; return 0;
else else
yyarg[yycount++] = YY_CAST (yysymbol_type_t, yyx); yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
} }
} }
return yycount; return yycount;
@@ -2128,14 +2128,14 @@ static int
yyreport_syntax_error (const yyGLRStack* yystackp]b4_user_formals[); yyreport_syntax_error (const yyGLRStack* yystackp]b4_user_formals[);
/* The token type of the lookahead of this context. */ /* The token type of the lookahead of this context. */
static yysymbol_type_t static yysymbol_kind_t
yypcontext_token (const yyGLRStack *yystackp) YY_ATTRIBUTE_UNUSED; yypcontext_token (const yyGLRStack *yystackp) YY_ATTRIBUTE_UNUSED;
static yysymbol_type_t static yysymbol_kind_t
yypcontext_token (const yyGLRStack *yystackp) yypcontext_token (const yyGLRStack *yystackp)
{ {
YYUSE (yystackp); YYUSE (yystackp);
yysymbol_type_t yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); yysymbol_kind_t yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
return yytoken; return yytoken;
} }
@@ -2152,9 +2152,9 @@ yypcontext_location (const yyGLRStack *yystackp)
[detailed\|verbose], [detailed\|verbose],
[[static int [[static int
yy_syntax_error_arguments (const yyGLRStack* yystackp, yy_syntax_error_arguments (const yyGLRStack* yystackp,
yysymbol_type_t yyarg[], int yyargn) yysymbol_kind_t yyarg[], int yyargn)
{ {
yysymbol_type_t yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); yysymbol_kind_t yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
/* Actual size of YYARG. */ /* Actual size of YYARG. */
int yycount = 0; int yycount = 0;
/* There are many possibilities here to consider: /* There are many possibilities here to consider:
@@ -2219,7 +2219,7 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
const char *yyformat = YY_NULLPTR; const char *yyformat = YY_NULLPTR;
/* Arguments of yyformat: reported tokens (one for the "unexpected", /* Arguments of yyformat: reported tokens (one for the "unexpected",
one per "expected"). */ one per "expected"). */
yysymbol_type_t yyarg[YYARGS_MAX]; yysymbol_kind_t yyarg[YYARGS_MAX];
/* Cumulated lengths of YYARG. */ /* Cumulated lengths of YYARG. */
ptrdiff_t yysize = 0; ptrdiff_t yysize = 0;
@@ -2307,7 +2307,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
reductions. Skip tokens until we can proceed. */ reductions. Skip tokens until we can proceed. */
while (yytrue) while (yytrue)
{ {
yysymbol_type_t yytoken; yysymbol_kind_t yytoken;
int yyj; int yyj;
if (yychar == YYEOF) if (yychar == YYEOF)
yyFail (yystackp][]b4_lpure_args[, YY_NULLPTR); yyFail (yystackp][]b4_lpure_args[, YY_NULLPTR);
@@ -2465,7 +2465,7 @@ b4_dollar_popdef])[]dnl
} }
else else
{ {
yysymbol_type_t yytoken = ]b4_yygetToken_call;[ yysymbol_kind_t yytoken = ]b4_yygetToken_call;[
const short* yyconflicts; const short* yyconflicts;
int yyaction = yygetLRActions (yystate, yytoken, &yyconflicts); int yyaction = yygetLRActions (yystate, yytoken, &yyconflicts);
if (*yyconflicts != 0) if (*yyconflicts != 0)
@@ -2495,7 +2495,7 @@ b4_dollar_popdef])[]dnl
while (yytrue) while (yytrue)
{ {
yysymbol_type_t yytoken_to_shift; yysymbol_kind_t yytoken_to_shift;
ptrdiff_t yys; ptrdiff_t yys;
for (yys = 0; yys < yystack.yytops.yysize; yys += 1) for (yys = 0; yys < yystack.yytops.yysize; yys += 1)

View File

@@ -69,7 +69,7 @@ m4_defn([b4_parse_param]))],
# b4_declare_symbol_enum # b4_declare_symbol_enum
# ---------------------- # ----------------------
m4_append([b4_declare_symbol_enum], m4_append([b4_declare_symbol_enum],
[[typedef symbol_type_type yysymbol_type_t; [[typedef symbol_kind_type yysymbol_kind_t;
]]) ]])
@@ -83,7 +83,7 @@ m4_define([b4_yy_symbol_print_define],
`--------------------*/ `--------------------*/
static void static void
yy_symbol_print (FILE *, ]b4_namespace_ref::b4_parser_class[::symbol_type_type yytype, yy_symbol_print (FILE *, ]b4_namespace_ref::b4_parser_class[::symbol_kind_type yytype,
const ]b4_namespace_ref::b4_parser_class[::semantic_type *yyvaluep]b4_locations_if([[, const ]b4_namespace_ref::b4_parser_class[::semantic_type *yyvaluep]b4_locations_if([[,
const ]b4_namespace_ref::b4_parser_class[::location_type *yylocationp]])[]b4_user_formals[) const ]b4_namespace_ref::b4_parser_class[::location_type *yylocationp]])[]b4_user_formals[)
{ {
@@ -175,7 +175,7 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
`--------------------*/ `--------------------*/
void void
]b4_parser_class[::yy_symbol_value_print_ (symbol_type_type yytype, ]b4_parser_class[::yy_symbol_value_print_ (symbol_kind_type yytype,
const semantic_type* yyvaluep]b4_locations_if([[, const semantic_type* yyvaluep]b4_locations_if([[,
const location_type* yylocationp]])[) const location_type* yylocationp]])[)
{]b4_locations_if([[ {]b4_locations_if([[
@@ -189,7 +189,7 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
void void
]b4_parser_class[::yy_symbol_print_ (symbol_type_type yytype, ]b4_parser_class[::yy_symbol_print_ (symbol_kind_type yytype,
const semantic_type* yyvaluep]b4_locations_if([[, const semantic_type* yyvaluep]b4_locations_if([[,
const location_type* yylocationp]])[) const location_type* yylocationp]])[)
{ {
@@ -325,14 +325,14 @@ b4_percent_code_get([[requires]])[
/// \param yytype The token type. /// \param yytype The token type.
/// \param yyvaluep Its semantic value.]b4_locations_if([[ /// \param yyvaluep Its semantic value.]b4_locations_if([[
/// \param yylocationp Its location.]])[ /// \param yylocationp Its location.]])[
virtual void yy_symbol_value_print_ (symbol_type_type yytype, virtual void yy_symbol_value_print_ (symbol_kind_type yytype,
const semantic_type* yyvaluep]b4_locations_if([[, const semantic_type* yyvaluep]b4_locations_if([[,
const location_type* yylocationp]])[); const location_type* yylocationp]])[);
/// \brief Report a symbol on the debug stream. /// \brief Report a symbol on the debug stream.
/// \param yytype The token type. /// \param yytype The token type.
/// \param yyvaluep Its semantic value.]b4_locations_if([[ /// \param yyvaluep Its semantic value.]b4_locations_if([[
/// \param yylocationp Its location.]])[ /// \param yylocationp Its location.]])[
virtual void yy_symbol_print_ (symbol_type_type yytype, virtual void yy_symbol_print_ (symbol_kind_type yytype,
const semantic_type* yyvaluep]b4_locations_if([[, const semantic_type* yyvaluep]b4_locations_if([[,
const location_type* yylocationp]])[); const location_type* yylocationp]])[);
private: private:
@@ -356,7 +356,7 @@ b4_percent_define_flag_if([[global_tokens_and_yystype]],
]b4_namespace_close[ ]b4_namespace_close[
]m4_define([b4_declare_symbol_enum], ]m4_define([b4_declare_symbol_enum],
[[typedef ]b4_namespace_ref[::]b4_parser_class[::symbol_type_type yysymbol_type_t; [[typedef ]b4_namespace_ref[::]b4_parser_class[::symbol_kind_type yysymbol_kind_t;
#define YYSYMBOL_YYEMPTY ]b4_namespace_ref[::]b4_parser_class[::YYSYMBOL_YYEMPTY #define YYSYMBOL_YYEMPTY ]b4_namespace_ref[::]b4_parser_class[::YYSYMBOL_YYEMPTY
#define YYSYMBOL_YYERROR ]b4_namespace_ref[::]b4_parser_class[::YYSYMBOL_YYERROR #define YYSYMBOL_YYERROR ]b4_namespace_ref[::]b4_parser_class[::YYSYMBOL_YYERROR
#define YYSYMBOL_YYEOF ]b4_namespace_ref[::]b4_parser_class[::YYSYMBOL_YYEOF #define YYSYMBOL_YYEOF ]b4_namespace_ref[::]b4_parser_class[::YYSYMBOL_YYEOF

View File

@@ -241,13 +241,13 @@ m4_define([b4_shared_declarations],
public: public:
context (const ]b4_parser_class[& yyparser, const symbol_type& yyla); context (const ]b4_parser_class[& yyparser, const symbol_type& yyla);
const symbol_type& lookahead () const { return yyla_; } const symbol_type& lookahead () const { return yyla_; }
symbol_type_type token () const { return yyla_.type_get (); }]b4_locations_if([[ symbol_kind_type token () const { return yyla_.type_get (); }]b4_locations_if([[
const location_type& location () const { return yyla_.location; } const location_type& location () const { return yyla_.location; }
]])[ ]])[
/// Put in YYARG at most YYARGN of the expected tokens, and return the /// Put in YYARG at most YYARGN of the expected tokens, and return the
/// number of tokens stored in YYARG. If YYARG is null, return the /// number of tokens stored in YYARG. If YYARG is null, return the
/// number of expected tokens (guaranteed to be less than YYNTOKENS). /// number of expected tokens (guaranteed to be less than YYNTOKENS).
int yyexpected_tokens (symbol_type_type yyarg[], int yyargn) const; int yyexpected_tokens (symbol_kind_type yyarg[], int yyargn) const;
private: private:
const ]b4_parser_class[& yyparser_; const ]b4_parser_class[& yyparser_;
@@ -261,10 +261,10 @@ m4_define([b4_shared_declarations],
/// Check the lookahead yytoken. /// Check the lookahead yytoken.
/// \returns true iff the token will be eventually shifted. /// \returns true iff the token will be eventually shifted.
bool yy_lac_check_ (symbol_type_type yytoken) const; bool yy_lac_check_ (symbol_kind_type yytoken) const;
/// Establish the initial context if no initial context currently exists. /// Establish the initial context if no initial context currently exists.
/// \returns true iff the token will be eventually shifted. /// \returns true iff the token will be eventually shifted.
bool yy_lac_establish_ (symbol_type_type yytoken); bool yy_lac_establish_ (symbol_kind_type yytoken);
/// Discard any previous initial lookahead context because of event. /// Discard any previous initial lookahead context because of event.
/// \param event the event which caused the lookahead to be discarded. /// \param event the event which caused the lookahead to be discarded.
/// Only used for debbuging output. /// Only used for debbuging output.
@@ -280,7 +280,7 @@ m4_define([b4_shared_declarations],
[detailed\|verbose], [[ [detailed\|verbose], [[
/// The arguments of the error message. /// The arguments of the error message.
int yy_syntax_error_arguments_ (const context& yyctx, int yy_syntax_error_arguments_ (const context& yyctx,
symbol_type_type yyarg[], int yyargn) const; symbol_kind_type yyarg[], int yyargn) const;
/// Generate an error message. /// Generate an error message.
/// \param yyctx the context in which the error occurred. /// \param yyctx the context in which the error occurred.
@@ -304,11 +304,11 @@ m4_define([b4_shared_declarations],
/// Convert a scanner token number \a t to a symbol number. /// Convert a scanner token number \a t to a symbol number.
/// In theory \a t should be a token_type, but character literals /// In theory \a t should be a token_type, but character literals
/// are valid, yet not members of the token_type enum. /// are valid, yet not members of the token_type enum.
static symbol_type_type yytranslate_ (int t); static symbol_kind_type yytranslate_ (int t);
]b4_parse_error_bmatch([custom\|detailed], [[ ]b4_parse_error_bmatch([custom\|detailed], [[
/// The user-facing name of the symbol whose (internal) number is /// The user-facing name of the symbol whose (internal) number is
/// YYSYMBOL. No bounds checking. /// YYSYMBOL. No bounds checking.
static const char *yysymbol_name (symbol_type_type yysymbol); static const char *yysymbol_name (symbol_kind_type yysymbol);
]])[ ]])[
// Tables. // Tables.
@@ -378,7 +378,7 @@ m4_define([b4_shared_declarations],
/// The (internal) type number (corresponding to \a state). /// The (internal) type number (corresponding to \a state).
/// \a YYSYMBOL_YYEMPTY when empty. /// \a YYSYMBOL_YYEMPTY when empty.
symbol_type_type type_get () const YY_NOEXCEPT; symbol_kind_type type_get () const YY_NOEXCEPT;
/// The state number used to denote an empty symbol. /// The state number used to denote an empty symbol.
/// We use the initial state, as it does not have a value. /// We use the initial state, as it does not have a value.
@@ -586,7 +586,7 @@ m4_if(b4_prefix, [yy], [],
/* The user-facing name of the symbol whose (internal) number is /* The user-facing name of the symbol whose (internal) number is
YYSYMBOL. No bounds checking. */ YYSYMBOL. No bounds checking. */
const char * const char *
]b4_parser_class[::yysymbol_name (symbol_type_type yysymbol) ]b4_parser_class[::yysymbol_name (symbol_kind_type yysymbol)
{ {
static const char *const yy_sname[] = static const char *const yy_sname[] =
{ {
@@ -696,13 +696,13 @@ b4_parse_error_case([verbose], [[
: state (s) : state (s)
{} {}
]b4_parser_class[::symbol_type_type ]b4_parser_class[::symbol_kind_type
]b4_parser_class[::by_state::type_get () const YY_NOEXCEPT ]b4_parser_class[::by_state::type_get () const YY_NOEXCEPT
{ {
if (state == empty_state) if (state == empty_state)
return YYSYMBOL_YYEMPTY; return YYSYMBOL_YYEMPTY;
else else
return YY_CAST (symbol_type_type, yystos_[+state]); return YY_CAST (symbol_kind_type, yystos_[+state]);
} }
]b4_parser_class[::stack_symbol_type::stack_symbol_type () ]b4_parser_class[::stack_symbol_type::stack_symbol_type ()
@@ -773,7 +773,7 @@ b4_parse_error_case([verbose], [[
{ {
std::ostream& yyoutput = yyo; std::ostream& yyoutput = yyo;
YYUSE (yyoutput); YYUSE (yyoutput);
symbol_type_type yytype = yysym.type_get (); symbol_kind_type yytype = yysym.type_get ();
#if defined __GNUC__ && ! defined __clang__ && ! defined __ICC && __GNUC__ * 100 + __GNUC_MINOR__ <= 408 #if defined __GNUC__ && ! defined __clang__ && ! defined __ICC && __GNUC__ * 100 + __GNUC_MINOR__ <= 408
// Avoid a (spurious) G++ 4.8 warning about "array subscript is // Avoid a (spurious) G++ 4.8 warning about "array subscript is
// below array bounds". // below array bounds".
@@ -1229,7 +1229,7 @@ b4_dollar_popdef])[]dnl
{} {}
int int
]b4_parser_class[::context::yyexpected_tokens (symbol_type_type yyarg[], int yyargn) const ]b4_parser_class[::context::yyexpected_tokens (symbol_kind_type yyarg[], int yyargn) const
{ {
// Actual number of expected tokens // Actual number of expected tokens
int yycount = 0; int yycount = 0;
@@ -1243,7 +1243,7 @@ b4_dollar_popdef])[]dnl
for (int yyx = 0; yyx < YYNTOKENS; ++yyx) for (int yyx = 0; yyx < YYNTOKENS; ++yyx)
{ {
symbol_type_type yysym = YY_CAST (symbol_type_type, yyx); symbol_kind_type yysym = YY_CAST (symbol_kind_type, yyx);
if (yysym != YYSYMBOL_YYERROR && yysym != YYSYMBOL_YYUNDEF if (yysym != YYSYMBOL_YYERROR && yysym != YYSYMBOL_YYUNDEF
&& yyparser_.yy_lac_check_ (yysym)) && yyparser_.yy_lac_check_ (yysym))
{ {
@@ -1274,7 +1274,7 @@ b4_dollar_popdef])[]dnl
else if (yycount == yyargn) else if (yycount == yyargn)
return 0; return 0;
else else
yyarg[yycount++] = YY_CAST (symbol_type_type, yyx); yyarg[yycount++] = YY_CAST (symbol_kind_type, yyx);
} }
} }
]])[ ]])[
@@ -1283,7 +1283,7 @@ b4_dollar_popdef])[]dnl
]])b4_lac_if([[ ]])b4_lac_if([[
bool bool
]b4_parser_class[::yy_lac_check_ (symbol_type_type yytoken) const ]b4_parser_class[::yy_lac_check_ (symbol_kind_type yytoken) const
{ {
// Logically, the yylac_stack's lifetime is confined to this function. // Logically, the yylac_stack's lifetime is confined to this function.
// Clear it, to get rid of potential left-overs from previous call. // Clear it, to get rid of potential left-overs from previous call.
@@ -1361,7 +1361,7 @@ b4_dollar_popdef])[]dnl
// Establish the initial context if no initial context currently exists. // Establish the initial context if no initial context currently exists.
bool bool
]b4_parser_class[::yy_lac_establish_ (symbol_type_type yytoken) ]b4_parser_class[::yy_lac_establish_ (symbol_kind_type yytoken)
{ {
/* Establish the initial context for the current lookahead if no initial /* Establish the initial context for the current lookahead if no initial
context is currently established. context is currently established.
@@ -1423,7 +1423,7 @@ b4_dollar_popdef])[]dnl
int int
]b4_parser_class[::yy_syntax_error_arguments_ (const context& yyctx, ]b4_parser_class[::yy_syntax_error_arguments_ (const context& yyctx,
symbol_type_type yyarg[], int yyargn) const symbol_kind_type yyarg[], int yyargn) const
{ {
/* There are many possibilities here to consider: /* There are many possibilities here to consider:
- If this state is a consistent state with a default action, then - If this state is a consistent state with a default action, then
@@ -1472,7 +1472,7 @@ b4_dollar_popdef])[]dnl
// Its maximum. // Its maximum.
enum { YYARGS_MAX = 5 }; enum { YYARGS_MAX = 5 };
// Arguments of yyformat. // Arguments of yyformat.
symbol_type_type yyarg[YYARGS_MAX]; symbol_kind_type yyarg[YYARGS_MAX];
int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX);
char const* yyformat = YY_NULLPTR; char const* yyformat = YY_NULLPTR;

View File

@@ -631,10 +631,10 @@ union yyalloc
/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
as returned by yylex, with out-of-bounds checking. */ as returned by yylex, with out-of-bounds checking. */
]b4_api_token_raw_if(dnl ]b4_api_token_raw_if(dnl
[[#define YYTRANSLATE(YYX) YY_CAST (yysymbol_type_t, YYX)]], [[#define YYTRANSLATE(YYX) YY_CAST (yysymbol_kind_t, YYX)]],
[[#define YYTRANSLATE(YYX) \ [[#define YYTRANSLATE(YYX) \
(0 <= (YYX) && (YYX) <= YYMAXUTOK \ (0 <= (YYX) && (YYX) <= YYMAXUTOK \
? YY_CAST (yysymbol_type_t, yytranslate[YYX]) \ ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
: YYSYMBOL_YYUNDEF) : YYSYMBOL_YYUNDEF)
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
@@ -650,12 +650,12 @@ static const ]b4_int_type_for([b4_translate])[ yytranslate[] =
#endif #endif
/** Accessing symbol of state STATE. */ /** Accessing symbol of state STATE. */
#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_type_t, yystos[State]) #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
#if ]b4_parse_error_case([simple], [b4_api_PREFIX[DEBUG || ]b4_token_table_flag], [[1]])[ #if ]b4_parse_error_case([simple], [b4_api_PREFIX[DEBUG || ]b4_token_table_flag], [[1]])[
/* The user-facing name of the symbol whose (internal) number is /* The user-facing name of the symbol whose (internal) number is
YYSYMBOL. No bounds checking. */ YYSYMBOL. No bounds checking. */
static const char *yysymbol_name (yysymbol_type_t yysymbol) YY_ATTRIBUTE_UNUSED; static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
]b4_parse_error_bmatch([simple\|verbose], ]b4_parse_error_bmatch([simple\|verbose],
[[/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. [[/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
@@ -666,12 +666,12 @@ static const char *const yytname[] =
}; };
static const char * static const char *
yysymbol_name (yysymbol_type_t yysymbol) yysymbol_name (yysymbol_kind_t yysymbol)
{ {
return yytname[yysymbol]; return yytname[yysymbol];
}]], }]],
[[static const char * [[static const char *
yysymbol_name (yysymbol_type_t yysymbol) yysymbol_name (yysymbol_kind_t yysymbol)
{ {
static const char *const yy_sname[] = static const char *const yy_sname[] =
{ {
@@ -1018,7 +1018,7 @@ do { \
any old *YYES other than YYESA. */ any old *YYES other than YYESA. */
static int static int
yy_lac (yy_state_t *yyesa, yy_state_t **yyes, yy_lac (yy_state_t *yyesa, yy_state_t **yyes,
YYPTRDIFF_T *yyes_capacity, yy_state_t *yyssp, yysymbol_type_t yytoken) YYPTRDIFF_T *yyes_capacity, yy_state_t *yyssp, yysymbol_kind_t yytoken)
{ {
yy_state_t *yyes_prev = yyssp; yy_state_t *yyes_prev = yyssp;
yy_state_t *yyesp = yyes_prev; yy_state_t *yyesp = yyes_prev;
@@ -1130,7 +1130,7 @@ typedef struct
yy_state_t *yyesa; yy_state_t *yyesa;
yy_state_t **yyes; yy_state_t **yyes;
YYPTRDIFF_T *yyes_capacity;]])])[ YYPTRDIFF_T *yyes_capacity;]])])[
yysymbol_type_t yytoken;]b4_locations_if([[ yysymbol_kind_t yytoken;]b4_locations_if([[
YYLTYPE *yylloc;]])[ YYLTYPE *yylloc;]])[
} yypcontext_t; } yypcontext_t;
@@ -1142,10 +1142,10 @@ typedef struct
YYARG up to YYARGN. */]b4_push_if([[ YYARG up to YYARGN. */]b4_push_if([[
static int static int
yypstate_expected_tokens (yypstate *yyps, yypstate_expected_tokens (yypstate *yyps,
yysymbol_type_t yyarg[], int yyargn)]], [[ yysymbol_kind_t yyarg[], int yyargn)]], [[
static int static int
yyexpected_tokens (const yypcontext_t *yyctx, yyexpected_tokens (const yypcontext_t *yyctx,
yysymbol_type_t yyarg[], int yyargn)]])[ yysymbol_kind_t yyarg[], int yyargn)]])[
{ {
/* Actual size of YYARG. */ /* Actual size of YYARG. */
int yycount = 0; int yycount = 0;
@@ -1153,7 +1153,7 @@ yyexpected_tokens (const yypcontext_t *yyctx,
int yyx; int yyx;
for (yyx = 0; yyx < YYNTOKENS; ++yyx) for (yyx = 0; yyx < YYNTOKENS; ++yyx)
{ {
yysymbol_type_t yysym = YY_CAST (yysymbol_type_t, yyx); yysymbol_kind_t yysym = YY_CAST (yysymbol_kind_t, yyx);
if (yysym != YYSYMBOL_YYERROR && yysym != YYSYMBOL_YYUNDEF) if (yysym != YYSYMBOL_YYERROR && yysym != YYSYMBOL_YYUNDEF)
switch (yy_lac (]b4_push_if([[yyps->yyesa, &yyps->yyes, &yyps->yyes_capacity, yyps->yyssp, yysym]], switch (yy_lac (]b4_push_if([[yyps->yyesa, &yyps->yyes, &yyps->yyes_capacity, yyps->yyssp, yysym]],
[[yyctx->yyesa, yyctx->yyes, yyctx->yyes_capacity, yyctx->yyssp, yysym]])[)) [[yyctx->yyesa, yyctx->yyes, yyctx->yyes_capacity, yyctx->yyssp, yysym]])[))
@@ -1191,7 +1191,7 @@ yyexpected_tokens (const yypcontext_t *yyctx,
else if (yycount == yyargn) else if (yycount == yyargn)
return 0; return 0;
else else
yyarg[yycount++] = YY_CAST (yysymbol_type_t, yyx); yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
} }
}]])[ }]])[
return yycount; return yycount;
@@ -1201,7 +1201,7 @@ yyexpected_tokens (const yypcontext_t *yyctx,
/* Similar to the previous function. */ /* Similar to the previous function. */
static int static int
yyexpected_tokens (const yypcontext_t *yyctx, yyexpected_tokens (const yypcontext_t *yyctx,
yysymbol_type_t yyarg[], int yyargn) yysymbol_kind_t yyarg[], int yyargn)
{ {
return yypstate_expected_tokens (yyctx->yyps, yyarg, yyargn); return yypstate_expected_tokens (yyctx->yyps, yyarg, yyargn);
}]])[ }]])[
@@ -1210,10 +1210,10 @@ yyexpected_tokens (const yypcontext_t *yyctx,
]b4_parse_error_bmatch( ]b4_parse_error_bmatch(
[custom], [custom],
[[/* The token type of the lookahead of this context. */ [[/* The token type of the lookahead of this context. */
static yysymbol_type_t static yysymbol_kind_t
yypcontext_token (const yypcontext_t *yyctx) YY_ATTRIBUTE_UNUSED; yypcontext_token (const yypcontext_t *yyctx) YY_ATTRIBUTE_UNUSED;
static yysymbol_type_t static yysymbol_kind_t
yypcontext_token (const yypcontext_t *yyctx) yypcontext_token (const yypcontext_t *yyctx)
{ {
return yyctx->yytoken; return yyctx->yytoken;
@@ -1324,7 +1324,7 @@ yytnamerr (char *yyres, const char *yystr)
static int static int
yy_syntax_error_arguments (const yypcontext_t *yyctx, yy_syntax_error_arguments (const yypcontext_t *yyctx,
yysymbol_type_t yyarg[], int yyargn) yysymbol_kind_t yyarg[], int yyargn)
{ {
/* Actual size of YYARG. */ /* Actual size of YYARG. */
int yycount = 0; int yycount = 0;
@@ -1391,7 +1391,7 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
const char *yyformat = YY_NULLPTR; const char *yyformat = YY_NULLPTR;
/* Arguments of yyformat: reported tokens (one for the "unexpected", /* Arguments of yyformat: reported tokens (one for the "unexpected",
one per "expected"). */ one per "expected"). */
yysymbol_type_t yyarg[YYARGS_MAX]; yysymbol_kind_t yyarg[YYARGS_MAX];
/* Cumulated lengths of YYARG. */ /* Cumulated lengths of YYARG. */
YYPTRDIFF_T yysize = 0; YYPTRDIFF_T yysize = 0;
@@ -1584,7 +1584,7 @@ yyparse (]m4_ifset([b4_parse_param], [b4_formals(b4_parse_param)], [void])[)]])[
/* The return value of yyparse. */ /* The return value of yyparse. */
int yyresult; int yyresult;
/* Lookahead token as an internal (translated) token number. */ /* Lookahead token as an internal (translated) token number. */
yysymbol_type_t yytoken = YYSYMBOL_YYEMPTY; yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
/* 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;]b4_locations_if([[ YYSTYPE yyval;]b4_locations_if([[
@@ -1869,7 +1869,7 @@ yyreduce:
case of YYERROR or YYBACKUP, subsequent parser actions might lead case of YYERROR or YYBACKUP, subsequent parser actions might lead
to an incorrect destructor call or verbose syntax error message to an incorrect destructor call or verbose syntax error message
before the lookahead is translated. */ before the lookahead is translated. */
YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_type_t, yyr1[yyn]), &yyval, &yyloc); YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
YYPOPSTACK (yylen); YYPOPSTACK (yylen);
yylen = 0; yylen = 0;

View File

@@ -290,7 +290,7 @@ yyreport_syntax_error (const yypcontext_t *ctx)
// Report the tokens expected at this point. // Report the tokens expected at this point.
{ {
enum { TOKENMAX = 10 }; enum { TOKENMAX = 10 };
yysymbol_type_t expected[TOKENMAX]; yysymbol_kind_t expected[TOKENMAX];
int n = yyexpected_tokens (ctx, expected, TOKENMAX); int n = yyexpected_tokens (ctx, expected, TOKENMAX);
if (n < 0) if (n < 0)
// Forward errors to yyparse. // Forward errors to yyparse.
@@ -302,7 +302,7 @@ yyreport_syntax_error (const yypcontext_t *ctx)
} }
// Report the unexpected token. // Report the unexpected token.
{ {
yysymbol_type_t lookahead = yypcontext_token (ctx); yysymbol_kind_t lookahead = yypcontext_token (ctx);
if (lookahead != YYSYMBOL_YYEMPTY) if (lookahead != YYSYMBOL_YYEMPTY)
fprintf (stderr, " before %s", yysymbol_name (lookahead)); fprintf (stderr, " before %s", yysymbol_name (lookahead));
} }

View File

@@ -1,4 +1,4 @@
/* A Bison parser, made by GNU Bison 3.5.3.219-2a6f. */ /* A Bison parser, made by GNU Bison 3.5.4.236-8d75. */
/* Bison implementation for Yacc-like parsers in C /* Bison implementation for Yacc-like parsers in C
@@ -48,7 +48,7 @@
#define YYBISON 1 #define YYBISON 1
/* Bison version. */ /* Bison version. */
#define YYBISON_VERSION "3.5.3.219-2a6f" #define YYBISON_VERSION "3.5.4.236-8d75"
/* Skeleton name. */ /* Skeleton name. */
#define YYSKELETON_NAME "yacc.c" #define YYSKELETON_NAME "yacc.c"
@@ -101,7 +101,7 @@
#include "src/parse-gram.h" #include "src/parse-gram.h"
/* Symbol type. */ /* Symbol type. */
enum yysymbol_type_t enum yysymbol_kind_t
{ {
YYSYMBOL_YYEMPTY = -2, YYSYMBOL_YYEMPTY = -2,
YYSYMBOL_YYEOF = 0, YYSYMBOL_YYEOF = 0,
@@ -208,7 +208,7 @@ enum yysymbol_type_t
YYSYMBOL_string_as_id = 101, YYSYMBOL_string_as_id = 101,
YYSYMBOL_102_epilogue_opt = 102 YYSYMBOL_102_epilogue_opt = 102
}; };
typedef enum yysymbol_type_t yysymbol_type_t; typedef enum yysymbol_kind_t yysymbol_kind_t;
@@ -608,7 +608,7 @@ union yyalloc
/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
as returned by yylex, with out-of-bounds checking. */ as returned by yylex, with out-of-bounds checking. */
#define YYTRANSLATE(YYX) YY_CAST (yysymbol_type_t, YYX) #define YYTRANSLATE(YYX) YY_CAST (yysymbol_kind_t, YYX)
#if GRAM_DEBUG #if GRAM_DEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
@@ -631,15 +631,15 @@ static const yytype_int16 yyrline[] =
#endif #endif
/** Accessing symbol of state STATE. */ /** Accessing symbol of state STATE. */
#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_type_t, yystos[State]) #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
#if 1 #if 1
/* The user-facing name of the symbol whose (internal) number is /* The user-facing name of the symbol whose (internal) number is
YYSYMBOL. No bounds checking. */ YYSYMBOL. No bounds checking. */
static const char *yysymbol_name (yysymbol_type_t yysymbol) YY_ATTRIBUTE_UNUSED; static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
static const char * static const char *
yysymbol_name (yysymbol_type_t yysymbol) yysymbol_name (yysymbol_kind_t yysymbol)
{ {
static const char *const yy_sname[] = static const char *const yy_sname[] =
{ {
@@ -1035,7 +1035,7 @@ do { \
static void static void
yy_symbol_value_print (FILE *yyo, yy_symbol_value_print (FILE *yyo,
yysymbol_type_t yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) yysymbol_kind_t yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
{ {
FILE *yyoutput = yyo; FILE *yyoutput = yyo;
YYUSE (yyoutput); YYUSE (yyoutput);
@@ -1246,7 +1246,7 @@ troff (yyo);
static void static void
yy_symbol_print (FILE *yyo, yy_symbol_print (FILE *yyo,
yysymbol_type_t yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) yysymbol_kind_t yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
{ {
YYFPRINTF (yyo, "%s %s (", YYFPRINTF (yyo, "%s %s (",
yytype < YYNTOKENS ? "token" : "nterm", yysymbol_name (yytype)); yytype < YYNTOKENS ? "token" : "nterm", yysymbol_name (yytype));
@@ -1480,7 +1480,7 @@ do { \
any old *YYES other than YYESA. */ any old *YYES other than YYESA. */
static int static int
yy_lac (yy_state_t *yyesa, yy_state_t **yyes, yy_lac (yy_state_t *yyesa, yy_state_t **yyes,
YYPTRDIFF_T *yyes_capacity, yy_state_t *yyssp, yysymbol_type_t yytoken) YYPTRDIFF_T *yyes_capacity, yy_state_t *yyssp, yysymbol_kind_t yytoken)
{ {
yy_state_t *yyes_prev = yyssp; yy_state_t *yyes_prev = yyssp;
yy_state_t *yyesp = yyes_prev; yy_state_t *yyesp = yyes_prev;
@@ -1590,7 +1590,7 @@ typedef struct
yy_state_t *yyesa; yy_state_t *yyesa;
yy_state_t **yyes; yy_state_t **yyes;
YYPTRDIFF_T *yyes_capacity; YYPTRDIFF_T *yyes_capacity;
yysymbol_type_t yytoken; yysymbol_kind_t yytoken;
YYLTYPE *yylloc; YYLTYPE *yylloc;
} yypcontext_t; } yypcontext_t;
@@ -1602,7 +1602,7 @@ typedef struct
YYARG up to YYARGN. */ YYARG up to YYARGN. */
static int static int
yyexpected_tokens (const yypcontext_t *yyctx, yyexpected_tokens (const yypcontext_t *yyctx,
yysymbol_type_t yyarg[], int yyargn) yysymbol_kind_t yyarg[], int yyargn)
{ {
/* Actual size of YYARG. */ /* Actual size of YYARG. */
int yycount = 0; int yycount = 0;
@@ -1610,7 +1610,7 @@ yyexpected_tokens (const yypcontext_t *yyctx,
int yyx; int yyx;
for (yyx = 0; yyx < YYNTOKENS; ++yyx) for (yyx = 0; yyx < YYNTOKENS; ++yyx)
{ {
yysymbol_type_t yysym = YY_CAST (yysymbol_type_t, yyx); yysymbol_kind_t yysym = YY_CAST (yysymbol_kind_t, yyx);
if (yysym != YYSYMBOL_YYERROR && yysym != YYSYMBOL_YYUNDEF) if (yysym != YYSYMBOL_YYERROR && yysym != YYSYMBOL_YYUNDEF)
switch (yy_lac (yyctx->yyesa, yyctx->yyes, yyctx->yyes_capacity, yyctx->yyssp, yysym)) switch (yy_lac (yyctx->yyesa, yyctx->yyes, yyctx->yyes_capacity, yyctx->yyssp, yysym))
{ {
@@ -1634,10 +1634,10 @@ yyexpected_tokens (const yypcontext_t *yyctx,
/* The token type of the lookahead of this context. */ /* The token type of the lookahead of this context. */
static yysymbol_type_t static yysymbol_kind_t
yypcontext_token (const yypcontext_t *yyctx) YY_ATTRIBUTE_UNUSED; yypcontext_token (const yypcontext_t *yyctx) YY_ATTRIBUTE_UNUSED;
static yysymbol_type_t static yysymbol_kind_t
yypcontext_token (const yypcontext_t *yyctx) yypcontext_token (const yypcontext_t *yyctx)
{ {
return yyctx->yytoken; return yyctx->yytoken;
@@ -1663,7 +1663,7 @@ yyreport_syntax_error (const yypcontext_t *yyctx);
static void static void
yydestruct (const char *yymsg, yydestruct (const char *yymsg,
yysymbol_type_t yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp) yysymbol_kind_t yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
{ {
YYUSE (yyvaluep); YYUSE (yyvaluep);
YYUSE (yylocationp); YYUSE (yylocationp);
@@ -1789,7 +1789,7 @@ YYLTYPE yylloc = yyloc_default;
/* The return value of yyparse. */ /* The return value of yyparse. */
int yyresult; int yyresult;
/* Lookahead token as an internal (translated) token number. */ /* Lookahead token as an internal (translated) token number. */
yysymbol_type_t yytoken = YYSYMBOL_YYEMPTY; yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
/* 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;
@@ -2595,7 +2595,7 @@ yyreduce:
case of YYERROR or YYBACKUP, subsequent parser actions might lead case of YYERROR or YYBACKUP, subsequent parser actions might lead
to an incorrect destructor call or verbose syntax error message to an incorrect destructor call or verbose syntax error message
before the lookahead is translated. */ before the lookahead is translated. */
YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_type_t, yyr1[yyn]), &yyval, &yyloc); YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
YYPOPSTACK (yylen); YYPOPSTACK (yylen);
yylen = 0; yylen = 0;
@@ -2806,11 +2806,11 @@ yyreport_syntax_error (const yypcontext_t *ctx)
enum { ARGS_MAX = 5 }; enum { ARGS_MAX = 5 };
const char *argv[ARGS_MAX]; const char *argv[ARGS_MAX];
int argc = 0; int argc = 0;
yysymbol_type_t unexpected = yypcontext_token (ctx); yysymbol_kind_t unexpected = yypcontext_token (ctx);
if (unexpected != YYSYMBOL_YYEMPTY) if (unexpected != YYSYMBOL_YYEMPTY)
{ {
argv[argc++] = yysymbol_name (unexpected); argv[argc++] = yysymbol_name (unexpected);
yysymbol_type_t expected[ARGS_MAX - 1]; yysymbol_kind_t expected[ARGS_MAX - 1];
int nexpected = yyexpected_tokens (ctx, expected, ARGS_MAX - 1); int nexpected = yyexpected_tokens (ctx, expected, ARGS_MAX - 1);
if (nexpected < 0) if (nexpected < 0)
res = nexpected; res = nexpected;

View File

@@ -1,4 +1,4 @@
/* A Bison parser, made by GNU Bison 3.5.3.219-2a6f. */ /* A Bison parser, made by GNU Bison 3.5.4.236-8d75. */
/* Bison interface for Yacc-like parsers in C /* Bison interface for Yacc-like parsers in C

View File

@@ -807,11 +807,11 @@ yyreport_syntax_error (const yypcontext_t *ctx)
enum { ARGS_MAX = 5 }; enum { ARGS_MAX = 5 };
const char *argv[ARGS_MAX]; const char *argv[ARGS_MAX];
int argc = 0; int argc = 0;
yysymbol_type_t unexpected = yypcontext_token (ctx); yysymbol_kind_t unexpected = yypcontext_token (ctx);
if (unexpected != YYSYMBOL_YYEMPTY) if (unexpected != YYSYMBOL_YYEMPTY)
{ {
argv[argc++] = yysymbol_name (unexpected); argv[argc++] = yysymbol_name (unexpected);
yysymbol_type_t expected[ARGS_MAX - 1]; yysymbol_kind_t expected[ARGS_MAX - 1];
int nexpected = yyexpected_tokens (ctx, expected, ARGS_MAX - 1); int nexpected = yyexpected_tokens (ctx, expected, ARGS_MAX - 1);
if (nexpected < 0) if (nexpected < 0)
res = nexpected; res = nexpected;

View File

@@ -639,13 +639,13 @@ yyreport_syntax_error (const yypcontext_t *ctx]AT_PARAM_IF([, AT_PARSE_PARAMS])[
fprintf (stderr, ": ");]])[ fprintf (stderr, ": ");]])[
fprintf (stderr, "syntax error"); fprintf (stderr, "syntax error");
{ {
yysymbol_type_t la = yypcontext_token (ctx); yysymbol_kind_t la = yypcontext_token (ctx);
if (la != YYSYMBOL_YYEMPTY) if (la != YYSYMBOL_YYEMPTY)
fprintf (stderr, " on token [%s]", yysymbol_name (la)); fprintf (stderr, " on token [%s]", yysymbol_name (la));
} }
{ {
enum { TOKENMAX = 10 }; enum { TOKENMAX = 10 };
yysymbol_type_t expected[TOKENMAX]; yysymbol_kind_t expected[TOKENMAX];
int n = yyexpected_tokens (ctx, expected, TOKENMAX); int n = yyexpected_tokens (ctx, expected, TOKENMAX);
/* Forward errors to yyparse. */ /* Forward errors to yyparse. */
if (n <= 0) if (n <= 0)
@@ -755,13 +755,13 @@ void
std::cerr << ctx.location () << ": ";]])[ std::cerr << ctx.location () << ": ";]])[
std::cerr << "syntax error"; std::cerr << "syntax error";
{ {
symbol_type_type la = ctx.token (); symbol_kind_type la = ctx.token ();
if (la != YYSYMBOL_YYEMPTY) if (la != YYSYMBOL_YYEMPTY)
fprintf (stderr, " on token [%s]", yysymbol_name (la)); fprintf (stderr, " on token [%s]", yysymbol_name (la));
} }
{ {
enum { TOKENMAX = 10 }; enum { TOKENMAX = 10 };
symbol_type_type expected[TOKENMAX]; symbol_kind_type expected[TOKENMAX];
int n = ctx.yyexpected_tokens (expected, TOKENMAX); int n = ctx.yyexpected_tokens (expected, TOKENMAX);
if (0 < n) if (0 < n)
{ {