static struct obstack token_obstack;
const char *token_buffer = NULL;
-bucket *symval = NULL;
+symbol_t *symval = NULL;
int numval;
/* A token to be reread, see unlex and lex. */
static token_t unlexed = tok_undef;
-static bucket *unlexed_symval = NULL;
+static symbol_t *unlexed_symval = NULL;
static const char *unlexed_token_buffer = NULL;
void
obstack_1grow (&token_obstack, '\0');
token_buffer = obstack_finish (&token_obstack);
symval = getsym (token_buffer);
- symval->class = token_sym;
- if (symval->user_token_number == SUNDEF)
- symval->user_token_number = code;
+ if (symval->number == NUMBER_UNDEFINED)
+ {
+ symval->number = ntokens++;
+ symval->class = token_sym;
+ if (symval->user_token_number == SUNDEF)
+ symval->user_token_number = code;
+ }
return tok_identifier;
}
token_buffer = obstack_finish (&token_obstack);
symval = getsym (token_buffer);
- symval->class = token_sym;
+ if (symval->number == NUMBER_UNDEFINED)
+ {
+ symval->number = ntokens++;
+ symval->class = token_sym;
+ }
return tok_identifier;
}