mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-14 23:03:04 +00:00
Use lib/hash for the symbol table.
* src/gram.c (ntokens): Initialize to 1, to reserve a slot for EOF. * src/lex.c (lex): Set the `number' member of new terminals. * src/reader.c (bucket_check_defined, bucket_make_alias) (bucket_check_alias_consistence, bucket_translation): New. (reader, grammar_free, readgram, token_translations_init) (packsymbols): Adjust. (reader): Number the predefined tokens. * src/reduce.c (inaccessable_symbols): Just use hard coded numbers for predefined tokens. * src/symtab.h (bucket): Remove all the hash table related members. * src/symtab.c (symtab): Replace by... (bucket_table): this. (bucket_new, bucket_free, hash_compare_bucket, hash_bucket) (buckets_new, buckets_do): New.
This commit is contained in:
@@ -199,9 +199,9 @@ inaccessable_symbols (void)
|
||||
V = Vp;
|
||||
|
||||
/* Tokens 0, 1, and 2 are internal to Bison. Consider them useful. */
|
||||
bitset_set (V, 0); /* end-of-input token */
|
||||
bitset_set (V, 1); /* error token */
|
||||
bitset_set (V, 2); /* some undefined token */
|
||||
bitset_set (V, eoftoken->number); /* end-of-input token */
|
||||
bitset_set (V, errtoken->number); /* error token */
|
||||
bitset_set (V, undeftoken->number); /* some undefined token */
|
||||
|
||||
bitset_free (P);
|
||||
P = Pp;
|
||||
|
||||
Reference in New Issue
Block a user