static bool
symbol_pack (symbol_t *this)
{
- if (getenv ("DEBUG"))
- fprintf (stderr, "Packing %s, %s, number = %d\n",
- this->tag,
- this->class == nterm_sym ? "nterm" : "TERM",
- this->number);
if (this->class == nterm_sym)
{
this->number += ntokens;
assert (this->number != -1);
}
- if (getenv ("DEBUG"))
- fprintf (stderr, "Setting %d = %s\n", this->number, this->tag);
symbols[this->number] = this;
return TRUE;
}
static bool
symbol_translation (symbol_t *this)
{
- if (getenv ("DEBUG"))
- fprintf (stderr, "Considering Setting UserVal %s = %d (val = %d)\n",
- this->tag, this->user_token_number, this->number);
-
/* Non-terminal? */
if (this->class == token_sym
&& this->user_token_number != SALIAS)
symbols[token_translations[this->user_token_number]]->tag,
this->tag, this->user_token_number);
- if (getenv ("DEBUG"))
- fprintf (stderr, "Setting UserVal %s = %d (val = %d)\n",
- this->tag, this->user_token_number, this->number);
token_translations[this->user_token_number] = this->number;
}
if (what_is == nterm_sym && oldclass != nterm_sym)
symbol->number = nvars++;
if (what_is == token_sym && symbol->number == -1)
- {
- symbol->number = ntokens++;
- if (getenv ("DEBUG"))
- fprintf (stderr, "Set %s to %d\n",
- symbol->tag, symbol->number);
- }
+ symbol->number = ntokens++;
if (typename)
{
fatal (_("too many symbols (tokens plus nonterminals); maximum %d"),
MAXSHORT);
- if (getenv ("DEBUG"))
- fprintf (stderr, "nsyms == ntokens + nvars: %d == %d + %d\n",
- nsyms, ntokens, nvars);
assert (nsyms == ntokens + nvars);
}
for (i = 0; i < ntokens; ++i)
{
symbol_t *this = symbols[i];
- if (getenv ("DEBUG"))
- fprintf (stderr, "UserVal %s = %d (val = %d)\n",
- this->tag, this->user_token_number, this->number);
if (this->user_token_number == SUNDEF)
this->user_token_number = ++last_user_token_number;
if (this->user_token_number > max_user_token_number)
max_user_token_number = this->user_token_number;
- if (getenv ("DEBUG"))
- fprintf (stderr, "Now: UserVal %s = %d (val = %d)\n",
- this->tag, this->user_token_number, this->number);
}
token_translations = XCALLOC (short, max_user_token_number + 1);