int begin, \
int end) \
{ \
- long int max = first; \
+ Type max = first; \
int i; \
int j = 1; \
\
/* Build `NAME_max' in the obstack. */ \
obstack_fgrow1 (&format_obstack, "%s_max", name); \
obstack_1grow (&format_obstack, 0); \
- MUSCLE_INSERT_LONG_INT (obstack_finish (&format_obstack), max); \
+ MUSCLE_INSERT_LONG_INT (obstack_finish (&format_obstack), \
+ (long int) max); \
}
-GENERATE_MUSCLE_INSERT_TABLE(muscle_insert_int_table, int)
GENERATE_MUSCLE_INSERT_TABLE(muscle_insert_unsigned_int_table, unsigned int)
GENERATE_MUSCLE_INSERT_TABLE(muscle_insert_short_table, short)
-GENERATE_MUSCLE_INSERT_TABLE(muscle_insert_token_number_table, token_number_t)
+GENERATE_MUSCLE_INSERT_TABLE(muscle_insert_symbol_number_table, symbol_number_t)
GENERATE_MUSCLE_INSERT_TABLE(muscle_insert_item_number_table, item_number_t)
static void
prepare_tokens (void)
{
- muscle_insert_token_number_table ("translate",
+ muscle_insert_symbol_number_table ("translate",
token_translations,
0, 1, max_user_token_number + 1);
static void
prepare_rules (void)
{
- long int max;
int r;
unsigned int i = 0;
item_number_t *rhs = XMALLOC (item_number_t, nritems);
unsigned int *prhs = XMALLOC (unsigned int, nrules + 1);
unsigned int *rline = XMALLOC (unsigned int, nrules + 1);
- token_number_t *r1 = XMALLOC (token_number_t, nrules + 1);
+ symbol_number_t *r1 = XMALLOC (symbol_number_t, nrules + 1);
unsigned int *r2 = XMALLOC (unsigned int, nrules + 1);
for (r = 1; r < nrules + 1; ++r)
muscle_insert_item_number_table ("rhs", rhs, ritem[0], 1, nritems);
muscle_insert_unsigned_int_table ("prhs", prhs, 0, 1, nrules + 1);
muscle_insert_unsigned_int_table ("rline", rline, 0, 1, nrules + 1);
- muscle_insert_token_number_table ("r1", r1, 0, 1, nrules + 1);
+ muscle_insert_symbol_number_table ("r1", r1, 0, 1, nrules + 1);
muscle_insert_unsigned_int_table ("r2", r2, 0, 1, nrules + 1);
free (rhs);
prepare_states (void)
{
size_t i;
- token_number_t *values =
- (token_number_t *) alloca (sizeof (token_number_t) * nstates);
+ symbol_number_t *values =
+ (symbol_number_t *) alloca (sizeof (symbol_number_t) * nstates);
for (i = 0; i < nstates; ++i)
values[i] = states[i]->accessing_symbol;
- muscle_insert_token_number_table ("stos", values,
+ muscle_insert_symbol_number_table ("stos", values,
0, 1, nstates);
}
to reduce. */
for (i = 0; i < shiftp->nshifts; i++)
{
- token_number_t symbol;
+ symbol_number_t symbol;
int shift_state = shiftp->shifts[i];
if (!shift_state)
continue;
{
const char *bison_pkgdatadir = getenv ("BISON_PKGDATADIR");
const char *m4 = getenv ("M4");
+ int pkg_data_len;
+ char *full_skeleton;
+
if (!m4)
m4 = M4;
if (!bison_pkgdatadir)
bison_pkgdatadir = PKGDATADIR;
+ pkg_data_len = strlen (bison_pkgdatadir);
+ full_skeleton = XMALLOC (char, pkg_data_len + strlen (skeleton) + 1);
+ if (bison_pkgdatadir[pkg_data_len-1] == '/')
+ sprintf (full_skeleton, "%s%s", bison_pkgdatadir, skeleton);
+ else
+ sprintf (full_skeleton, "%s/%s", bison_pkgdatadir, skeleton);
if (trace_flag)
fprintf (stderr,
"running: %s -I %s m4sugar/m4sugar.m4 %s %s\n",
- m4, bison_pkgdatadir, tempfile, skeleton);
+ m4, bison_pkgdatadir, tempfile, full_skeleton);
skel_in = readpipe (m4,
"-I", bison_pkgdatadir,
"m4sugar/m4sugar.m4",
tempfile,
- skeleton,
+ full_skeleton,
NULL);
+ XFREE (full_skeleton);
if (!skel_in)
error (EXIT_FAILURE, errno, "cannot run m4");
skel_lex ();