mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-14 23:03:04 +00:00
reader: let symtab deal with the symbols
* src/reader.c (reader): Move the setting up of the builtin symbols to... * src/symtab.c (symbols_new): here.
This commit is contained in:
17
src/symtab.c
17
src/symtab.c
@@ -805,6 +805,23 @@ symbols_new (void)
|
||||
hash_symbol_hasher,
|
||||
hash_symbol_comparator,
|
||||
symbol_free);
|
||||
|
||||
/* Construct the accept symbol. */
|
||||
accept = symbol_get ("$accept", empty_loc);
|
||||
accept->content->class = nterm_sym;
|
||||
accept->content->number = nvars++;
|
||||
|
||||
/* Construct the error token */
|
||||
errtoken = symbol_get ("error", empty_loc);
|
||||
errtoken->content->class = token_sym;
|
||||
errtoken->content->number = ntokens++;
|
||||
|
||||
/* Construct a token that represents all undefined literal tokens.
|
||||
It is always token number 2. */
|
||||
undeftoken = symbol_get ("$undefined", empty_loc);
|
||||
undeftoken->content->class = token_sym;
|
||||
undeftoken->content->number = ntokens++;
|
||||
|
||||
semantic_type_table = hash_xinitialize (HT_INITIAL_CAPACITY,
|
||||
NULL,
|
||||
hash_semantic_type_hasher,
|
||||
|
||||
Reference in New Issue
Block a user