mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-20 17:53:02 +00:00
Get rid of yyrhs and yyprhs in glr.c.
* data/glr.c (yyrhs, yyprhs): Remove. Instead, use the state stack and yystos.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2008-11-25 Akim Demaille <demaille@gostai.com>
|
||||||
|
|
||||||
|
Get rid of yyrhs and yyprhs in glr.c.
|
||||||
|
* data/glr.c (yyrhs, yyprhs): Remove.
|
||||||
|
Instead, use the state stack and yystos.
|
||||||
|
|
||||||
2008-11-25 Akim Demaille <demaille@gostai.com>
|
2008-11-25 Akim Demaille <demaille@gostai.com>
|
||||||
|
|
||||||
Flag glr tests.
|
Flag glr tests.
|
||||||
|
|||||||
22
data/glr.c
22
data/glr.c
@@ -367,19 +367,6 @@ static const ]b4_int_type_for([b4_translate])[ yytranslate[] =
|
|||||||
};
|
};
|
||||||
|
|
||||||
#if YYDEBUG
|
#if YYDEBUG
|
||||||
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
|
|
||||||
YYRHS. */
|
|
||||||
static const ]b4_int_type_for([b4_prhs])[ yyprhs[] =
|
|
||||||
{
|
|
||||||
]b4_prhs[
|
|
||||||
};
|
|
||||||
|
|
||||||
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
|
|
||||||
static const ]b4_int_type_for([b4_rhs])[ yyrhs[] =
|
|
||||||
{
|
|
||||||
]b4_rhs[
|
|
||||||
};
|
|
||||||
|
|
||||||
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
|
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
|
||||||
static const ]b4_int_type_for([b4_rline])[ yyrline[] =
|
static const ]b4_int_type_for([b4_rline])[ yyrline[] =
|
||||||
{
|
{
|
||||||
@@ -1453,7 +1440,8 @@ yy_reduce_print (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
|
|||||||
for (yyi = 0; yyi < yynrhs; yyi++)
|
for (yyi = 0; yyi < yynrhs; yyi++)
|
||||||
{
|
{
|
||||||
YYFPRINTF (stderr, " $%d = ", yyi + 1);
|
YYFPRINTF (stderr, " $%d = ", yyi + 1);
|
||||||
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
|
yy_symbol_print (stderr,
|
||||||
|
]yystos@{b4_rhs_data(yynrhs, yyi + 1).yylrState@}[,
|
||||||
&]b4_rhs_value(yynrhs, yyi + 1)[
|
&]b4_rhs_value(yynrhs, yyi + 1)[
|
||||||
]b4_locations_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl
|
]b4_locations_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl
|
||||||
b4_user_args[);
|
b4_user_args[);
|
||||||
@@ -1782,11 +1770,11 @@ yyreportTree (yySemanticOption* yyx, int yyindent)
|
|||||||
{
|
{
|
||||||
if (yystates[yyi-1]->yyposn+1 > yystates[yyi]->yyposn)
|
if (yystates[yyi-1]->yyposn+1 > yystates[yyi]->yyposn)
|
||||||
YYFPRINTF (stderr, "%*s%s <empty>\n", yyindent+2, "",
|
YYFPRINTF (stderr, "%*s%s <empty>\n", yyindent+2, "",
|
||||||
yytokenName (yyrhs[yyprhs[yyx->yyrule]+yyi-1]));
|
yytokenName (yystos[yystates[yyi-1]->yylrState]));
|
||||||
else
|
else
|
||||||
YYFPRINTF (stderr, "%*s%s <tokens %lu .. %lu>\n", yyindent+2, "",
|
YYFPRINTF (stderr, "%*s%s <tokens %lu .. %lu>\n", yyindent+2, "",
|
||||||
yytokenName (yyrhs[yyprhs[yyx->yyrule]+yyi-1]),
|
yytokenName (yystos[yystates[yyi-1]->yylrState]),
|
||||||
(unsigned long int) (yystates[yyi - 1]->yyposn + 1),
|
(unsigned long int) (yystates[yyi-1]->yyposn + 1),
|
||||||
(unsigned long int) yystates[yyi]->yyposn);
|
(unsigned long int) yystates[yyi]->yyposn);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user