* src/output.c (output_unsigned_int_table): New.

(prepare_rules): `i' is unsigned.
`prhs', `rline', `r2' are unsigned int.
Rename muscle `rhs_number_max' as `rhs_max'.
Output muscles `prhs_max', `rline_max', and `r2_max'.
Free rline and r1.
* data/bison.simple, data/bison.c++: Adjust to use these muscles
to compute types instead of constant types.
* tests/regression.at (Web2c Actions): Adjust.
This commit is contained in:
Akim Demaille
2002-05-05 11:56:06 +00:00
parent 77714df234
commit 5df5f6d538
5 changed files with 45 additions and 27 deletions

View File

@@ -203,7 +203,7 @@ namespace yy
struct Traits< b4_name >
{
typedef b4_uint_type(b4_token_number_max) TokenNumberType;
typedef b4_sint_type(b4_rhs_number_max) RhsNumberType;
typedef b4_sint_type(b4_rhs_max) RhsNumberType;
typedef int StateType;
typedef yystype SemanticType;
typedef b4_ltype LocationType;
@@ -263,7 +263,7 @@ namespace yy
static const short table_[[]];
static const short check_[[]];
static const TokenNumberType r1_[[]];
static const short r2_[[]];
static const b4_uint_type(b4_r2_max) r2_[[]];
#if YYDEBUG || YYERROR_VERBOSE
static const char* const name_[[]];
@@ -272,8 +272,8 @@ namespace yy
/* More tables, for debugging. */
#if YYDEBUG
static const RhsNumberType rhs_[[]];
static const short prhs_[[]];
static const short rline_[[]];
static const b4_uint_type(b4_prhs_max) prhs_[[]];
static const b4_uint_type(b4_rline_max) rline_[[]];
#endif
/* Even more tables. */
@@ -466,7 +466,7 @@ yy::b4_name::parse ()
if (debug_)
{
YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", n_ - 1, rline_[[n_]]);
for (unsigned i = prhs_[[n_]];
for (b4_uint_type(b4_prhs_max) i = prhs_[[n_]];
rhs_[[i]] >= 0; ++i)
YYFPRINTF (stderr, "%s ", name_[[rhs_[i]]]);
YYFPRINTF (stderr, "-> %s\n", name_[[r1_[n_]]]);
@@ -696,7 +696,7 @@ yy::b4_name::r1_[[]] =
};
/* YYR2[[YYN]] -- Number of symbols composing right hand side of rule YYN. */
const short
const b4_uint_type(b4_r2_max)
yy::b4_name::r2_[[]] =
{
b4_r2
@@ -722,14 +722,14 @@ yy::b4_name::rhs_[[]] =
/* YYPRHS[[YYN]] -- Index of the first RHS symbol of rule number YYN in
YYRHS. */
const short
const b4_uint_type(b4_prhs_max)
yy::b4_name::prhs_[[]] =
{
b4_prhs
};
/* YYRLINE[[YYN]] -- source line where rule number YYN was defined. */
const short
const b4_uint_type(b4_rline_max)
yy::b4_name::rline_[[]] =
{
b4_rline

View File

@@ -347,20 +347,19 @@ static const yy_token_number_type yytranslate[[]] =
#if YYDEBUG
/* YYPRHS[[YYN]] -- Index of the first RHS symbol of rule number YYN in
YYRHS. */
static const short yyprhs[[]] =
static const b4_uint_type(b4_prhs_max) yyprhs[[]] =
{
b4_prhs
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
typedef b4_sint_type(b4_rhs_number_max) yyrhs_t;
static const yyrhs_t yyrhs[[]] =
static const b4_sint_type(b4_rhs_max) yyrhs[[]] =
{
b4_rhs
};
/* YYRLINE[[YYN]] -- source line where rule number YYN was defined. */
static const short yyrline[[]] =
static const b4_uint_type(b4_rline_max) yyrline[[]] =
{
b4_rline
};
@@ -388,7 +387,7 @@ static const yy_token_number_type yyr1[[]] =
};
/* YYR2[[YYN]] -- Number of symbols composing right hand side of rule YYN. */
static const short yyr2[[]] =
static const b4_uint_type(b4_r2_max) yyr2[[]] =
{
b4_r2
};