mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
* data/yacc.c: Leave bigger chunks of quoted text.
(YYDSYMPRINTF): New. Use it to report symbol activities. * data/glr.c (YYDSYMPRINTF): New. Use it.
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
2002-11-13 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
|
* data/yacc.c: Leave bigger chunks of quoted text.
|
||||||
|
(YYDSYMPRINTF): New.
|
||||||
|
Use it to report symbol activities.
|
||||||
|
* data/glr.c (YYDSYMPRINTF): New.
|
||||||
|
Use it.
|
||||||
|
|
||||||
2002-11-12 Paul Eggert <eggert@twinsun.com>
|
2002-11-12 Paul Eggert <eggert@twinsun.com>
|
||||||
|
|
||||||
Version 1.75b.
|
Version 1.75b.
|
||||||
|
|||||||
41
data/glr.c
41
data/glr.c
@@ -463,6 +463,17 @@ do { \
|
|||||||
yysymprint Args; \
|
yysymprint Args; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
# define YYDSYMPRINTF(Title, Token, Value, Location) \
|
||||||
|
do { \
|
||||||
|
if (yydebug) \
|
||||||
|
{ \
|
||||||
|
YYFPRINTF (stderr, "%s ", Title); \
|
||||||
|
yysymprint (stderr, \
|
||||||
|
Token, Value]b4_location_if([, Location])[); \
|
||||||
|
YYFPRINTF (stderr, "\n"); \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
/* Nonzero means print parse trace. It is left uninitialized so that
|
/* Nonzero means print parse trace. It is left uninitialized so that
|
||||||
multiple parsers can coexist. */
|
multiple parsers can coexist. */
|
||||||
int yydebug;
|
int yydebug;
|
||||||
@@ -472,6 +483,7 @@ int yydebug;
|
|||||||
/* Avoid empty `if' bodies. */
|
/* Avoid empty `if' bodies. */
|
||||||
# define YYDPRINTF(Args) {}
|
# define YYDPRINTF(Args) {}
|
||||||
# define YYDSYMPRINT(Args) {}
|
# define YYDSYMPRINT(Args) {}
|
||||||
|
# define YYDSYMPRINTF(Title, Token, Value, Location) {}
|
||||||
|
|
||||||
#endif /* !YYDEBUG */
|
#endif /* !YYDEBUG */
|
||||||
|
|
||||||
@@ -1096,12 +1108,12 @@ static inline void
|
|||||||
yy_reduce_print (size_t yyk, yyRuleNum yyrule)
|
yy_reduce_print (size_t yyk, yyRuleNum yyrule)
|
||||||
{
|
{
|
||||||
int yyi;
|
int yyi;
|
||||||
YYDPRINTF ((stderr, "Reducing stack %d by rule %d (line %d),",
|
YYDPRINTF ((stderr, "Reducing stack %d by rule %d (line %d), ",
|
||||||
yyk, yyrule - 1, yyrline[yyrule]));
|
yyk, yyrule - 1, yyrline[yyrule]));
|
||||||
/* Print the symbols being reduced, and their result. */
|
/* Print the symbols being reduced, and their result. */
|
||||||
for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
|
for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
|
||||||
YYFPRINTF (stderr, "%s ", yytokenName (yyrhs[yyi]));
|
YYFPRINTF (stderr, "%s ", yytokenName (yyrhs[yyi]));
|
||||||
YYFPRINTF (stderr, " -> %s\n", yytokenName (yyr1[yyrule]));
|
YYFPRINTF (stderr, "-> %s\n", yytokenName (yyr1[yyrule]));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1522,8 +1534,7 @@ yyprocessOneStack (yyGLRStack* yystack, int yyk,
|
|||||||
YYDPRINTF ((stderr, "Reading a token: "));
|
YYDPRINTF ((stderr, "Reading a token: "));
|
||||||
yychar = YYLEX;
|
yychar = YYLEX;
|
||||||
*yytokenp = YYTRANSLATE (yychar);
|
*yytokenp = YYTRANSLATE (yychar);
|
||||||
YYDPRINTF ((stderr, "Next token is %s\n",
|
YYDSYMPRINTF ("Next token is", *yytokenp, yylvalp, yyllocp);
|
||||||
yytokenName (*yytokenp)));
|
|
||||||
}
|
}
|
||||||
yygetLRActions (yystate, *yytokenp, &yyaction, &yyconflicts);
|
yygetLRActions (yystate, *yytokenp, &yyaction, &yyconflicts);
|
||||||
|
|
||||||
@@ -1642,11 +1653,9 @@ yyrecoverParseError (yyGLRStack* yystack,
|
|||||||
while (yystack->yytops.yystates[0] != NULL)
|
while (yystack->yytops.yystates[0] != NULL)
|
||||||
{
|
{
|
||||||
yyGLRState *yys = yystack->yytops.yystates[0];
|
yyGLRState *yys = yystack->yytops.yystates[0];
|
||||||
YYDPRINTF ((stderr, "Error: popping "));
|
YYDSYMPRINTF ("Error: popping",
|
||||||
YYDSYMPRINT ((stderr,
|
|
||||||
yystos[yys->yylrState],
|
yystos[yys->yylrState],
|
||||||
&yys->yysemantics.yysval]b4_location_if([, &yys->yyloc])[));
|
&yys->yysemantics.yysval, &yys->yyloc);
|
||||||
YYDPRINTF ((stderr, "\n"));
|
|
||||||
yydestruct (yystos[yys->yylrState],
|
yydestruct (yystos[yys->yylrState],
|
||||||
&yys->yysemantics.yysval]b4_location_if([, &yys->yyloc])[);
|
&yys->yysemantics.yysval]b4_location_if([, &yys->yyloc])[);
|
||||||
yystack->yytops.yystates[0] = yys->yypred;
|
yystack->yytops.yystates[0] = yys->yypred;
|
||||||
@@ -1657,14 +1666,13 @@ yyrecoverParseError (yyGLRStack* yystack,
|
|||||||
}
|
}
|
||||||
if (*yytokenp != YYEMPTY)
|
if (*yytokenp != YYEMPTY)
|
||||||
{
|
{
|
||||||
YYDPRINTF ((stderr, "Discarding token %s\n",
|
YYDSYMPRINTF ("Error: discarding", *yytokenp, yylvalp, yyllocp);
|
||||||
yytokenName (*yytokenp)));
|
|
||||||
yydestruct (*yytokenp, yylvalp]b4_location_if([, yyllocp])[);
|
yydestruct (*yytokenp, yylvalp]b4_location_if([, yyllocp])[);
|
||||||
}
|
}
|
||||||
YYDPRINTF ((stderr, "Reading a token: "));
|
YYDPRINTF ((stderr, "Reading a token: "));
|
||||||
yychar = YYLEX;
|
yychar = YYLEX;
|
||||||
*yytokenp = YYTRANSLATE (yychar);
|
*yytokenp = YYTRANSLATE (yychar);
|
||||||
YYDPRINTF ((stderr, "Next token is %s\n", yytokenName (*yytokenp)));
|
YYDSYMPRINTF ("Next token is", *yytokenp, yylvalp, yyllocp);
|
||||||
yyj = yypact[yystack->yytops.yystates[0]->yylrState];
|
yyj = yypact[yystack->yytops.yystates[0]->yylrState];
|
||||||
if (yyis_pact_ninf (yyj))
|
if (yyis_pact_ninf (yyj))
|
||||||
/* Something's not right; we shouldn't be here. */
|
/* Something's not right; we shouldn't be here. */
|
||||||
@@ -1704,14 +1712,14 @@ yyrecoverParseError (yyGLRStack* yystack,
|
|||||||
YYDPRINTF ((stderr, "Shifting error token, "));
|
YYDPRINTF ((stderr, "Shifting error token, "));
|
||||||
yyglrShift (yystack, 0, yytable[yyj],
|
yyglrShift (yystack, 0, yytable[yyj],
|
||||||
yys->yyposn, *yylvalp, yyllocp]b4_user_args[);
|
yys->yyposn, *yylvalp, yyllocp]b4_user_args[);
|
||||||
|
YYDPRINTF ((stderr, "Entering state %d\n",
|
||||||
|
yystack->yytops.yystates[0]->yylrState));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
YYDPRINTF ((stderr, "Error: popping "));
|
YYDSYMPRINTF ("Error: popping",
|
||||||
YYDSYMPRINT ((stderr,
|
|
||||||
yystos[yys->yylrState],
|
yystos[yys->yylrState],
|
||||||
&yys->yysemantics.yysval]b4_location_if([, &yys->yyloc])[));
|
&yys->yysemantics.yysval, &yys->yyloc);
|
||||||
YYDPRINTF ((stderr, "\n"));
|
|
||||||
yydestruct (yystos[yys->yylrState],
|
yydestruct (yystos[yys->yylrState],
|
||||||
&yys->yysemantics.yysval]b4_location_if([, &yys->yyloc])[);
|
&yys->yysemantics.yysval]b4_location_if([, &yys->yyloc])[);
|
||||||
yystack->yytops.yystates[0] = yys->yypred;
|
yystack->yytops.yystates[0] = yys->yypred;
|
||||||
@@ -1804,8 +1812,7 @@ yyrecoverParseError (yyGLRStack* yystack,
|
|||||||
YYDPRINTF ((stderr, "Reading a token: "));
|
YYDPRINTF ((stderr, "Reading a token: "));
|
||||||
yychar = YYLEX;
|
yychar = YYLEX;
|
||||||
yytoken = YYTRANSLATE (yychar);
|
yytoken = YYTRANSLATE (yychar);
|
||||||
YYDPRINTF ((stderr, "Next token is %s\n",
|
YYDSYMPRINTF ("Next token is", yytoken, yylvalp, yyllocp);
|
||||||
yytokenName (yytoken)));
|
|
||||||
}
|
}
|
||||||
yygetLRActions (yystate, yytoken, &yyaction, &yyconflicts);
|
yygetLRActions (yystate, yytoken, &yyaction, &yyconflicts);
|
||||||
if (*yyconflicts != 0)
|
if (*yyconflicts != 0)
|
||||||
|
|||||||
114
data/yacc.c
114
data/yacc.c
@@ -138,7 +138,7 @@ m4_changecom()
|
|||||||
m4_divert(0)dnl
|
m4_divert(0)dnl
|
||||||
@output @output_parser_name@
|
@output @output_parser_name@
|
||||||
b4_copyright([Skeleton parser for Yacc-like parsing with Bison],
|
b4_copyright([Skeleton parser for Yacc-like parsing with Bison],
|
||||||
[1984, 1989, 1990, 2000, 2001, 2002])
|
[1984, 1989, 1990, 2000, 2001, 2002])[
|
||||||
|
|
||||||
/* As a special exception, when this file is copied by Bison into a
|
/* As a special exception, when this file is copied by Bison into a
|
||||||
Bison output file, you may use that output file without restriction.
|
Bison output file, you may use that output file without restriction.
|
||||||
@@ -155,7 +155,7 @@ b4_copyright([Skeleton parser for Yacc-like parsing with Bison],
|
|||||||
define necessary library symbols; they are noted "INFRINGES ON
|
define necessary library symbols; they are noted "INFRINGES ON
|
||||||
USER NAME SPACE" below. */
|
USER NAME SPACE" below. */
|
||||||
|
|
||||||
b4_identification
|
]b4_identification
|
||||||
m4_if(b4_prefix[], [yy], [],
|
m4_if(b4_prefix[], [yy], [],
|
||||||
[/* If NAME_PREFIX is specified substitute the variables and functions
|
[/* If NAME_PREFIX is specified substitute the variables and functions
|
||||||
names. */
|
names. */
|
||||||
@@ -166,16 +166,16 @@ m4_if(b4_prefix[], [yy], [],
|
|||||||
#define yychar b4_prefix[]char
|
#define yychar b4_prefix[]char
|
||||||
#define yydebug b4_prefix[]debug
|
#define yydebug b4_prefix[]debug
|
||||||
#define yynerrs b4_prefix[]nerrs
|
#define yynerrs b4_prefix[]nerrs
|
||||||
b4_location_if([#define yylloc b4_prefix[]lloc])])
|
b4_location_if([#define yylloc b4_prefix[]lloc])])[
|
||||||
|
|
||||||
b4_token_defines(b4_tokens)
|
]b4_token_defines(b4_tokens)[
|
||||||
|
|
||||||
/* Copy the first part of user declarations. */
|
/* Copy the first part of user declarations. */
|
||||||
b4_pre_prologue
|
]b4_pre_prologue[
|
||||||
|
|
||||||
/* Enabling traces. */
|
/* Enabling traces. */
|
||||||
#ifndef YYDEBUG
|
#ifndef YYDEBUG
|
||||||
# define YYDEBUG b4_debug
|
# define YYDEBUG ]b4_debug[
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Enabling verbose error messages. */
|
/* Enabling verbose error messages. */
|
||||||
@@ -183,16 +183,16 @@ b4_pre_prologue
|
|||||||
# undef YYERROR_VERBOSE
|
# undef YYERROR_VERBOSE
|
||||||
# define YYERROR_VERBOSE 1
|
# define YYERROR_VERBOSE 1
|
||||||
#else
|
#else
|
||||||
# define YYERROR_VERBOSE b4_error_verbose
|
# define YYERROR_VERBOSE ]b4_error_verbose[
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef YYSTYPE
|
#ifndef YYSTYPE
|
||||||
m4_ifdef([b4_stype],
|
]m4_ifdef([b4_stype],
|
||||||
[b4_syncline([b4_stype_line], [b4_filename])
|
[b4_syncline([b4_stype_line], [b4_filename])
|
||||||
typedef union b4_stype yystype;
|
typedef union b4_stype yystype;
|
||||||
/* Line __line__ of __file__. */
|
/* Line __line__ of __file__. */
|
||||||
b4_syncline([@oline@], [@ofile@])],
|
b4_syncline([@oline@], [@ofile@])],
|
||||||
[typedef int yystype;])
|
[typedef int yystype;])[
|
||||||
# define YYSTYPE yystype
|
# define YYSTYPE yystype
|
||||||
# define YYSTYPE_IS_TRIVIAL 1
|
# define YYSTYPE_IS_TRIVIAL 1
|
||||||
#endif
|
#endif
|
||||||
@@ -205,15 +205,15 @@ typedef struct yyltype
|
|||||||
int last_line;
|
int last_line;
|
||||||
int last_column;
|
int last_column;
|
||||||
} yyltype;
|
} yyltype;
|
||||||
# define YYLTYPE b4_location_type
|
# define YYLTYPE ]b4_location_type[
|
||||||
# define YYLTYPE_IS_TRIVIAL 1
|
# define YYLTYPE_IS_TRIVIAL 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Copy the second part of user declarations. */
|
/* Copy the second part of user declarations. */
|
||||||
b4_post_prologue
|
]b4_post_prologue[
|
||||||
|
|
||||||
/* Line __line__ of __file__. */
|
/* Line __line__ of __file__. */
|
||||||
b4_syncline([@oline@], [@ofile@])
|
]b4_syncline([@oline@], [@ofile@])[
|
||||||
|
|
||||||
#if ! defined (yyoverflow) || YYERROR_VERBOSE
|
#if ! defined (yyoverflow) || YYERROR_VERBOSE
|
||||||
|
|
||||||
@@ -256,22 +256,22 @@ union yyalloc
|
|||||||
{
|
{
|
||||||
short yyss;
|
short yyss;
|
||||||
YYSTYPE yyvs;
|
YYSTYPE yyvs;
|
||||||
b4_location_if([ YYLTYPE yyls;
|
]b4_location_if([ YYLTYPE yyls;
|
||||||
])dnl
|
])dnl
|
||||||
};
|
[};
|
||||||
|
|
||||||
/* The size of the maximum gap between one aligned stack and the next. */
|
/* The size of the maximum gap between one aligned stack and the next. */
|
||||||
# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
|
# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
|
||||||
|
|
||||||
/* The size of an array large to enough to hold all stacks, each with
|
/* The size of an array large to enough to hold all stacks, each with
|
||||||
N elements. */
|
N elements. */
|
||||||
b4_location_if(
|
]b4_location_if(
|
||||||
[# define YYSTACK_BYTES(N) \
|
[# define YYSTACK_BYTES(N) \
|
||||||
((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
|
((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
|
||||||
+ 2 * YYSTACK_GAP_MAX)],
|
+ 2 * YYSTACK_GAP_MAX)],
|
||||||
[# define YYSTACK_BYTES(N) \
|
[# define YYSTACK_BYTES(N) \
|
||||||
((N) * (sizeof (short) + sizeof (YYSTYPE)) \
|
((N) * (sizeof (short) + sizeof (YYSTYPE)) \
|
||||||
+ YYSTACK_GAP_MAX)])
|
+ YYSTACK_GAP_MAX)])[
|
||||||
|
|
||||||
/* Copy COUNT objects from FROM to TO. The source and destination do
|
/* Copy COUNT objects from FROM to TO. The source and destination do
|
||||||
not overlap. */
|
not overlap. */
|
||||||
@@ -285,7 +285,7 @@ b4_location_if(
|
|||||||
{ \
|
{ \
|
||||||
register YYSIZE_T yyi; \
|
register YYSIZE_T yyi; \
|
||||||
for (yyi = 0; yyi < (Count); yyi++) \
|
for (yyi = 0; yyi < (Count); yyi++) \
|
||||||
(To)[[yyi]] = (From)[[yyi]]; \
|
(To)[yyi] = (From)[yyi]; \
|
||||||
} \
|
} \
|
||||||
while (0)
|
while (0)
|
||||||
# endif
|
# endif
|
||||||
@@ -316,22 +316,22 @@ b4_location_if(
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* YYFINAL -- State number of the termination state. */
|
/* YYFINAL -- State number of the termination state. */
|
||||||
#define YYFINAL b4_final_state_number
|
#define YYFINAL ]b4_final_state_number[
|
||||||
/* YYLAST -- Last index in YYTABLE. */
|
/* YYLAST -- Last index in YYTABLE. */
|
||||||
#define YYLAST b4_last
|
#define YYLAST ]b4_last[
|
||||||
|
|
||||||
/* YYNTOKENS -- Number of terminals. */
|
/* YYNTOKENS -- Number of terminals. */
|
||||||
#define YYNTOKENS b4_tokens_number
|
#define YYNTOKENS ]b4_tokens_number[
|
||||||
/* YYNNTS -- Number of nonterminals. */
|
/* YYNNTS -- Number of nonterminals. */
|
||||||
#define YYNNTS b4_nterms_number
|
#define YYNNTS ]b4_nterms_number[
|
||||||
/* YYNRULES -- Number of rules. */
|
/* YYNRULES -- Number of rules. */
|
||||||
#define YYNRULES b4_rules_number
|
#define YYNRULES ]b4_rules_number[
|
||||||
/* YYNRULES -- Number of states. */
|
/* YYNRULES -- Number of states. */
|
||||||
#define YYNSTATES b4_states_number
|
#define YYNSTATES ]b4_states_number[
|
||||||
|
|
||||||
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
|
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
|
||||||
#define YYUNDEFTOK b4_undef_token_number
|
#define YYUNDEFTOK ]b4_undef_token_number[
|
||||||
#define YYMAXUTOK b4_user_token_number_max[
|
#define YYMAXUTOK ]b4_user_token_number_max[
|
||||||
|
|
||||||
#define YYTRANSLATE(YYX) \
|
#define YYTRANSLATE(YYX) \
|
||||||
((YYX <= 0) ? YYEOF : \
|
((YYX <= 0) ? YYEOF : \
|
||||||
@@ -441,7 +441,7 @@ static const b4_int_type_for([b4_check]) yycheck[[]] =
|
|||||||
symbol of state STATE-NUM. */
|
symbol of state STATE-NUM. */
|
||||||
static const b4_int_type_for([b4_stos]) yystos[[]] =
|
static const b4_int_type_for([b4_stos]) yystos[[]] =
|
||||||
{
|
{
|
||||||
b4_stos
|
b4_stos[
|
||||||
};
|
};
|
||||||
|
|
||||||
#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
|
#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
|
||||||
@@ -489,7 +489,7 @@ do \
|
|||||||
} \
|
} \
|
||||||
else \
|
else \
|
||||||
{ \
|
{ \
|
||||||
yyerror (b4_yyerror_args"syntax error: cannot back up"); \
|
yyerror (]b4_yyerror_args["syntax error: cannot back up");\
|
||||||
YYERROR; \
|
YYERROR; \
|
||||||
} \
|
} \
|
||||||
while (0)
|
while (0)
|
||||||
@@ -501,19 +501,19 @@ while (0)
|
|||||||
are run). */
|
are run). */
|
||||||
|
|
||||||
#ifndef YYLLOC_DEFAULT
|
#ifndef YYLLOC_DEFAULT
|
||||||
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||||||
Current.first_line = Rhs[[1]].first_line; \
|
Current.first_line = Rhs[1].first_line; \
|
||||||
Current.first_column = Rhs[[1]].first_column; \
|
Current.first_column = Rhs[1].first_column; \
|
||||||
Current.last_line = Rhs[[N]].last_line; \
|
Current.last_line = Rhs[N].last_line; \
|
||||||
Current.last_column = Rhs[[N]].last_column;
|
Current.last_column = Rhs[N].last_column;
|
||||||
#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 (b4_pure_if([&yylval[]b4_location_if([, &yylloc]), ])YYLEX_PARAM)
|
# define YYLEX yylex (]b4_pure_if([&yylval[]b4_location_if([, &yylloc]), ])[YYLEX_PARAM)
|
||||||
#else
|
#else
|
||||||
# define YYLEX b4_c_function_call([yylex], [int], b4_lex_param)
|
# define YYLEX ]b4_c_function_call([yylex], [int], b4_lex_param)[
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Enable debugging if requested. */
|
/* Enable debugging if requested. */
|
||||||
@@ -534,17 +534,29 @@ do { \
|
|||||||
if (yydebug) \
|
if (yydebug) \
|
||||||
yysymprint Args; \
|
yysymprint Args; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
# define YYDSYMPRINTF(Title, Token, Value, Location) \
|
||||||
|
do { \
|
||||||
|
if (yydebug) \
|
||||||
|
{ \
|
||||||
|
YYFPRINTF (stderr, "%s ", Title); \
|
||||||
|
yysymprint (stderr, \
|
||||||
|
Token, Value]b4_location_if([, Location])[); \
|
||||||
|
YYFPRINTF (stderr, "\n"); \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
/* Nonzero means print parse trace. It is left uninitialized so that
|
/* Nonzero means print parse trace. It is left uninitialized so that
|
||||||
multiple parsers can coexist. */
|
multiple parsers can coexist. */
|
||||||
int yydebug;
|
int yydebug;
|
||||||
#else /* !YYDEBUG */
|
#else /* !YYDEBUG */
|
||||||
# define YYDPRINTF(Args)
|
# define YYDPRINTF(Args)
|
||||||
# define YYDSYMPRINT(Args)
|
# define YYDSYMPRINT(Args)
|
||||||
|
# define YYDSYMPRINTF(Title, Token, Value, Location)
|
||||||
#endif /* !YYDEBUG */
|
#endif /* !YYDEBUG */
|
||||||
|
|
||||||
/* YYINITDEPTH -- initial size of the parser's stacks. */
|
/* YYINITDEPTH -- initial size of the parser's stacks. */
|
||||||
#ifndef YYINITDEPTH
|
#ifndef YYINITDEPTH
|
||||||
# define YYINITDEPTH b4_stack_depth_init
|
# define YYINITDEPTH ]b4_stack_depth_init[
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
|
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
|
||||||
@@ -559,7 +571,7 @@ int yydebug;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef YYMAXDEPTH
|
#ifndef YYMAXDEPTH
|
||||||
# define YYMAXDEPTH b4_stack_depth_max
|
# define YYMAXDEPTH ]b4_stack_depth_max[
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -620,9 +632,9 @@ yystpcpy (yydest, yysrc)
|
|||||||
|
|
||||||
|
|
||||||
#if YYDEBUG
|
#if YYDEBUG
|
||||||
b4_yysymprint_generate([b4_c_function_def])
|
]b4_yysymprint_generate([b4_c_function_def])[
|
||||||
#endif /* YYDEBUG. */
|
#endif /* YYDEBUG. */
|
||||||
b4_yydestruct_generate([b4_c_function_def])
|
]b4_yydestruct_generate([b4_c_function_def])
|
||||||
|
|
||||||
|
|
||||||
/* Prevent warnings from -Wmissing-prototypes. */
|
/* Prevent warnings from -Wmissing-prototypes. */
|
||||||
@@ -853,9 +865,7 @@ yybackup:
|
|||||||
{
|
{
|
||||||
/* We have to keep this `#if YYDEBUG', since we use variables
|
/* We have to keep this `#if YYDEBUG', since we use variables
|
||||||
which are defined only if `YYDEBUG' is set. */
|
which are defined only if `YYDEBUG' is set. */
|
||||||
YYDPRINTF ((stderr, "Next token is "));
|
YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
|
||||||
YYDSYMPRINT ((stderr, yytoken, &yylval]b4_location_if([, &yyloc])[));
|
|
||||||
YYDPRINTF ((stderr, "\n"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If the proper action on seeing token YYTOKEN is to reduce or to
|
/* If the proper action on seeing token YYTOKEN is to reduce or to
|
||||||
@@ -876,8 +886,7 @@ yybackup:
|
|||||||
YYACCEPT;
|
YYACCEPT;
|
||||||
|
|
||||||
/* Shift the lookahead token. */
|
/* Shift the lookahead token. */
|
||||||
YYDPRINTF ((stderr, "Shifting token %d (%s), ",
|
YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
|
||||||
yytoken, yytname[yytoken]));
|
|
||||||
|
|
||||||
/* Discard the token being shifted unless it is eof. */
|
/* Discard the token being shifted unless it is eof. */
|
||||||
if (yytoken != YYEOF)
|
if (yytoken != YYEOF)
|
||||||
@@ -933,13 +942,13 @@ yyreduce:
|
|||||||
{
|
{
|
||||||
int yyi;
|
int yyi;
|
||||||
|
|
||||||
YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
|
YYFPRINTF (stderr, "Reducing by rule %d (line %d), ",
|
||||||
yyn - 1, yyrline[yyn]);
|
yyn - 1, yyrline[yyn]);
|
||||||
|
|
||||||
/* Print the symbols being reduced, and their result. */
|
/* Print the symbols being reduced, and their result. */
|
||||||
for (yyi = yyprhs[yyn]; 0 <= yyrhs[yyi]; yyi++)
|
for (yyi = yyprhs[yyn]; 0 <= yyrhs[yyi]; yyi++)
|
||||||
YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
|
YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
|
||||||
YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
|
YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyn]]);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
switch (yyn)
|
switch (yyn)
|
||||||
@@ -1060,19 +1069,14 @@ yyerrlab1:
|
|||||||
/* Pop the rest of the stack. */
|
/* Pop the rest of the stack. */
|
||||||
while (yyss < yyssp)
|
while (yyss < yyssp)
|
||||||
{
|
{
|
||||||
YYDPRINTF ((stderr, "Error: popping "));
|
YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
|
||||||
YYDSYMPRINT ((stderr,
|
|
||||||
yystos[*yyssp],
|
|
||||||
yyvsp]b4_location_if([, yylsp])[));
|
|
||||||
YYDPRINTF ((stderr, "\n"));
|
|
||||||
yydestruct (yystos[*yyssp], yyvsp]b4_location_if([, yylsp])[);
|
yydestruct (yystos[*yyssp], yyvsp]b4_location_if([, yylsp])[);
|
||||||
YYPOPSTACK;
|
YYPOPSTACK;
|
||||||
}
|
}
|
||||||
YYABORT;
|
YYABORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
|
YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
|
||||||
yytoken, yytname[yytoken]));
|
|
||||||
yydestruct (yytoken, &yylval]b4_location_if([, &yylloc])[);
|
yydestruct (yytoken, &yylval]b4_location_if([, &yylloc])[);
|
||||||
yytoken = YYEMPTY;
|
yytoken = YYEMPTY;
|
||||||
}
|
}
|
||||||
@@ -1100,11 +1104,7 @@ yyerrlab1:
|
|||||||
if (yyssp == yyss)
|
if (yyssp == yyss)
|
||||||
YYABORT;
|
YYABORT;
|
||||||
|
|
||||||
YYDPRINTF ((stderr, "Error: popping "));
|
YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
|
||||||
YYDSYMPRINT ((stderr,
|
|
||||||
yystos[*yyssp], yyvsp]b4_location_if([, yylsp])[));
|
|
||||||
YYDPRINTF ((stderr, "\n"));
|
|
||||||
|
|
||||||
yydestruct (yystos[yystate], yyvsp]b4_location_if([, yylsp])[);
|
yydestruct (yystos[yystate], yyvsp]b4_location_if([, yylsp])[);
|
||||||
yyvsp--;
|
yyvsp--;
|
||||||
yystate = *--yyssp;
|
yystate = *--yyssp;
|
||||||
|
|||||||
Reference in New Issue
Block a user