X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/6d58c632025cb6928a90e4176577982bfb9c3981..89ff1b5e71a6d8aa34b3578282528adb43b198cd:/src/conflicts.c?ds=inline diff --git a/src/conflicts.c b/src/conflicts.c index f8ed1772..18404736 100644 --- a/src/conflicts.c +++ b/src/conflicts.c @@ -1,6 +1,6 @@ /* Find and resolve or report lookahead conflicts for bison, - Copyright (C) 1984, 1989, 1992, 2000-2012 Free Software Foundation, + Copyright (C) 1984, 1989, 1992, 2000-2013 Free Software Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. @@ -276,11 +276,13 @@ resolve_sr_conflict (state *s, int ruleno, symbol **errors, int *nerrs) The precedence of shifting is that of token i. */ if (symbols[i]->prec < redprec) { + register_precedence (redrule->prec->number, i); log_resolution (redrule, i, reduce_resolution); flush_shift (s, i); } else if (symbols[i]->prec > redprec) { + register_precedence (i, redrule->prec->number); log_resolution (redrule, i, shift_resolution); flush_reduce (lookahead_tokens, i); } @@ -301,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); @@ -398,7 +403,7 @@ conflicts_solve (void) set_conflicts (states[i], errors); /* For uniformity of the code, make sure all the states have a valid - `errs' member. */ + 'errs' member. */ if (!states[i]->errs) states[i]->errs = errs_new (0, 0); } @@ -569,7 +574,7 @@ conflicts_print (void) different strings to translate. */ { int total = count_sr_conflicts (); - // If %expect is not used, but %expect-rr is, then expect 0 sr. + /* If %expect is not used, but %expect-rr is, then expect 0 sr. */ int expected = (expected_sr_conflicts == -1 && expected_rr_conflicts != -1) ? 0 @@ -591,7 +596,7 @@ conflicts_print (void) { int total = count_rr_conflicts (true); - // If %expect-rr is not used, but %expect is, then expect 0 rr. + /* If %expect-rr is not used, but %expect is, then expect 0 rr. */ int expected = (expected_rr_conflicts == -1 && expected_sr_conflicts != -1) ? 0