mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-18 00:33:03 +00:00
symbols: improve symbol aliasing
Rather than having duplicate info in the symbol and the alias that has to be resolved later on, both the symbol and the alias have a common pointer to a separate structure containing this info. * src/symtab.h (sym_content): New structure. * src/symtab.c (sym_content_new, sym_content_free, symbol_free): New * src/AnnotationList.c, src/conflicts.c, src/gram.c, src/gram.h, * src/graphviz.c, src/ielr.c, src/output.c, src/parse-gram.y, src/print.c * src/print-xml.c, src/print_graph.c, src/reader.c, src/reduce.c, * src/state.h, src/symlist.c, src/symtab.c, src/symtab.h, src/tables.c: Adjust. * tests/input.at: Fix expectations (order changes).
This commit is contained in:
committed by
Akim Demaille
parent
c4aa4ff541
commit
a728075710
@@ -260,7 +260,7 @@ print_reductions (FILE *out, int level, state *s)
|
||||
bitset_set (no_reduce_set, TRANSITION_SYMBOL (trans, i));
|
||||
for (i = 0; i < s->errs->num; ++i)
|
||||
if (s->errs->symbols[i])
|
||||
bitset_set (no_reduce_set, s->errs->symbols[i]->number);
|
||||
bitset_set (no_reduce_set, s->errs->symbols[i]->content->number);
|
||||
|
||||
if (default_reduction)
|
||||
report = true;
|
||||
@@ -388,11 +388,11 @@ print_grammar (FILE *out, int level)
|
||||
/* Terminals */
|
||||
xml_puts (out, level + 1, "<terminals>");
|
||||
for (i = 0; i < max_user_token_number + 1; i++)
|
||||
if (token_translations[i] != undeftoken->number)
|
||||
if (token_translations[i] != undeftoken->content->number)
|
||||
{
|
||||
char const *tag = symbols[token_translations[i]]->tag;
|
||||
int precedence = symbols[token_translations[i]]->prec;
|
||||
assoc associativity = symbols[token_translations[i]]->assoc;
|
||||
int precedence = symbols[token_translations[i]]->content->prec;
|
||||
assoc associativity = symbols[token_translations[i]]->content->assoc;
|
||||
xml_indent (out, level + 2);
|
||||
fprintf (out,
|
||||
"<terminal symbol-number=\"%d\" token-number=\"%d\""
|
||||
|
||||
Reference in New Issue
Block a user