mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-12 13:53:03 +00:00
grammar: record used associativity and print useless ones
Record which symbol associativity is used, and display useless ones. * src/symtab.h, src/symtab.c (register_assoc, print_assoc_warnings): New * src/symtab.c (init_assoc, is_assoc_used): New * src/main.c: Use print_assoc_warnings * src/conflicts.c: Use register_assoc * tests/conflicts.at (Useless associativity warning): New. Due to the new warning, many tests had to be updated. * tests/conflicts.at tests/existing.at tests/regression.at: Add the associativity warning in the expected results. * tests/java.at: Fix the java calculator's grammar to remove a useless associativity. * doc/bison.texi (mfcalc example): Fix associativity to remove warning.
This commit is contained in:
committed by
Akim Demaille
parent
284bc49c83
commit
e8f7155d98
@@ -303,16 +303,19 @@ resolve_sr_conflict (state *s, int ruleno, symbol **errors, int *nerrs)
|
||||
break;
|
||||
|
||||
case right_assoc:
|
||||
register_assoc (i, redrule->prec->number);
|
||||
log_resolution (redrule, i, right_resolution);
|
||||
flush_reduce (lookahead_tokens, i);
|
||||
break;
|
||||
|
||||
case left_assoc:
|
||||
register_assoc (i, redrule->prec->number);
|
||||
log_resolution (redrule, i, left_resolution);
|
||||
flush_shift (s, i);
|
||||
break;
|
||||
|
||||
case non_assoc:
|
||||
register_assoc (i, redrule->prec->number);
|
||||
log_resolution (redrule, i, nonassoc_resolution);
|
||||
flush_shift (s, i);
|
||||
flush_reduce (lookahead_tokens, i);
|
||||
|
||||
Reference in New Issue
Block a user