Don't depend on C99 features.

* src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
* src/lalr.c (lalr_update_state_numbers): Fix for-loop.
* src/reader.c (check_and_convert_grammar): Fix for-loop.
* src/state.c (state_mark_reachable_states): Fix for-loop.
(state_remove_unreachable_states): Fix for-loop.

Don't widen struct state with member reachable just to temporarily
record reachability.  Instead, use a local bitset.
* src/state.h (struct state): Remove member.
* src/state.c (state_new): Don't initialize it.
(state_mark_reachable_states): Rename to...
(state_record_reachable_states): ... this, and use bitset.
(state_remove_unreachable_states): Use bitset.
This commit is contained in:
Joel E. Denny
2007-05-28 01:09:11 +00:00
parent efa02545e0
commit 14462c2b1b
6 changed files with 75 additions and 49 deletions

View File

@@ -640,8 +640,11 @@ check_and_convert_grammar (void)
rule. For the same reason, all the `used' flags must be set before
checking whether to remove `$' from any midrule symbol name (also in
packgram). */
for (symbol_list *sym = grammar; sym; sym = sym->next)
code_props_translate_code (&sym->action_props);
{
symbol_list *sym;
for (sym = grammar; sym; sym = sym->next)
code_props_translate_code (&sym->action_props);
}
/* Convert the grammar into the format described in gram.h. */
packgram ();