X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/640748eecf67130c80b5fd5f5cca19630eddf2b3..b25d88f6d2e2f4b59927aacecdc0a9e44a34b5d9:/src/LR0.c?ds=sidebyside diff --git a/src/LR0.c b/src/LR0.c index 00ff736c..7dd7b441 100644 --- a/src/LR0.c +++ b/src/LR0.c @@ -1,5 +1,7 @@ /* Generate the nondeterministic finite state machine for bison, - Copyright 1984, 1986, 1989, 2000, 2001, 2002 Free Software Foundation, Inc. + + Copyright (C) 1984, 1986, 1989, 2000, 2001, 2002 Free Software + Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. @@ -59,7 +61,7 @@ state_list_append (symbol_number_t symbol, state_list_t *node = XMALLOC (state_list_t, 1); state_t *state = state_new (symbol, core_size, core); - if (trace_flag) + if (trace_flag & trace_automaton) fprintf (stderr, "state_list_append (state = %d, symbol = %d (%s))\n", nstates, symbol, symbols[symbol]->tag); @@ -177,7 +179,7 @@ new_itemsets (state_t *state) { int i; - if (trace_flag) + if (trace_flag & trace_automaton) fprintf (stderr, "Entering new_itemsets, state = %d\n", state->number); @@ -215,7 +217,7 @@ get_state (symbol_number_t symbol, size_t core_size, item_number_t *core) { state_t *sp; - if (trace_flag) + if (trace_flag & trace_automaton) fprintf (stderr, "Entering get_state, symbol = %d (%s)\n", symbol, symbols[symbol]->tag); @@ -223,7 +225,7 @@ get_state (symbol_number_t symbol, size_t core_size, item_number_t *core) if (!sp) sp = state_list_append (symbol, core_size, core); - if (trace_flag) + if (trace_flag & trace_automaton) fprintf (stderr, "Exiting get_state => %d\n", sp->number); return sp; @@ -243,7 +245,7 @@ append_states (state_t *state) int j; symbol_number_t symbol; - if (trace_flag) + if (trace_flag & trace_automaton) fprintf (stderr, "Entering append_states, state = %d\n", state->number); @@ -282,11 +284,6 @@ save_reductions (state_t *state) int count = 0; int i; - /* If this is the final state, we want it to have no reductions at - all, although it has one for `START_SYMBOL $end .'. */ - if (final_state && state->number == final_state->number) - return; - /* Find and count the active items that represent ends of rules. */ for (i = 0; i < nritemset; ++i) { @@ -356,7 +353,7 @@ generate_states (void) while (list) { state_t *state = list->state; - if (trace_flag) + if (trace_flag & trace_automaton) fprintf (stderr, "Processing state %d (reached by %s)\n", state->number, symbols[state->accessing_symbol]->tag);