* src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.

* src/output.c (output_table_data): Return the longest number.
(prepare_tokens): Output `token_number_max').
* data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
New.
Use them to define yy_token_number_type/TokenNumberType.
Use this type for yytranslate.
* tests/torture.at (Big triangle): Push the limit from 124 to
253.
* tests/regression.at (Web2c Actions): Adjust.
This commit is contained in:
Akim Demaille
2002-04-07 17:44:59 +00:00
parent 817e9f41d1
commit 680e8701b5
11 changed files with 95 additions and 26 deletions

View File

@@ -147,15 +147,19 @@ get_lines_number (const char *s)
}
/* FIXME. */
/*----------------------------------------------------------------.
| Format the FIRST and then TABLE_DATA[BEGIN..END[ into OOUT, and |
| return the number of bits needed for its longuest value. |
`----------------------------------------------------------------*/
static inline void
static inline long int
output_table_data (struct obstack *oout,
short *table_data,
short first,
int begin,
int end)
{
long int max = first;
int i;
int j = 1;
@@ -171,8 +175,12 @@ output_table_data (struct obstack *oout,
else
++j;
obstack_fgrow1 (oout, "%6d", table_data[i]);
if (table_data[i] > max)
max = table_data[i];
}
obstack_1grow (oout, 0);
return max;
}
@@ -184,9 +192,10 @@ output_table_data (struct obstack *oout,
static void
prepare_tokens (void)
{
output_table_data (&format_obstack, token_translations,
0, 1, max_user_token_number + 1);
long int max = output_table_data (&format_obstack, token_translations,
0, 1, max_user_token_number + 1);
muscle_insert ("translate", obstack_finish (&format_obstack));
MUSCLE_INSERT_LONG_INT ("token_number_max", max);
XFREE (token_translations);
{