m4_define([b4_sint_type],
[m4_if(m4_eval([$1 <= 127]), [1], [signed char],
m4_eval([$1 <= 32767]), [1], [signed short],
- m4_eval([$1 <= 2147483647]), [1], [signed int],
- [m4_fatal([no signed int type for $1])])])
+ [signed int])])
# b4_uint_type(MAX)
m4_define([b4_uint_type],
[m4_if(m4_eval([$1 <= 255]), [1], [unsigned char],
m4_eval([$1 <= 65535]), [1], [unsigned short],
- m4_eval([$1 <= 4294967295]), [1], [unsigned int],
- [m4_fatal([no unsigned int type for $1])])])
+ [unsigned int])])
# b4_lhs_value([TYPE])
[location_stack_@<:@m4_eval([$1 - $2])@:>@])
-# b4_token_defines(TOKEN-NAME, TOKEN-NUMBER)
-# ------------------------------------------
+# b4_token_define(TOKEN-NAME, TOKEN-NUMBER)
+# -----------------------------------------
# Output the definition of this token as #define.
m4_define([b4_token_define],
[#define $1 $2
template < >
struct Traits< b4_name >
{
- typedef b4_uint_type(b4_token_number_max) TokenNumberType;
- typedef b4_sint_type(b4_rhs_number_max) RhsNumberType;
+ typedef b4_uint_type(b4_translate_max) TokenNumberType;
+ typedef b4_sint_type(b4_rhs_max) RhsNumberType;
typedef int StateType;
typedef yystype SemanticType;
typedef b4_ltype LocationType;
static const short defgoto_[[]];
static const short table_[[]];
static const short check_[[]];
- static const TokenNumberType r1_[[]];
- static const short r2_[[]];
+ static const b4_uint_type(b4_r1_max) r1_[[]];
+ static const b4_uint_type(b4_r2_max) r2_[[]];
#if YYDEBUG || YYERROR_VERBOSE
static const char* const name_[[]];
/* 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. */
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_]]]);
};
/* YYR1[[YYN]] -- Symbol number of symbol that rule YYN derives. */
-const yy::b4_name::TokenNumberType
+const b4_uint_type(b4_r1_max)
yy::b4_name::r1_[[]] =
{
b4_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
/* 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