X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/cd08e51edafa326fd8a6327f0b659fdbceb24dda..6ba555928922e7b96b05e0032737f6974ac78702:/src/state.c diff --git a/src/state.c b/src/state.c index 71914025..0fb804e8 100644 --- a/src/state.c +++ b/src/state.c @@ -1,5 +1,5 @@ -/* Type definitions for nondeterministic finite state machine for bison, - Copyright (C) 2001, 2002 Free Software Foundation, Inc. +/* Type definitions for nondeterministic finite state machine for Bison. + Copyright (C) 2001, 2002 Free Software Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. @@ -141,8 +141,8 @@ state_new (symbol_number_t accessing_symbol, { state_t *res; - if (nstates >= STATE_NUMBER_MAX) - fatal (_("too many states (max %d)"), STATE_NUMBER_MAX); + if (STATE_NUMBER_MAX <= nstates) + abort (); res = STATE_ALLOC (core_size); res->accessing_symbol = accessing_symbol; @@ -180,7 +180,8 @@ state_free (state_t *state) void state_transitions_set (state_t *state, int num, state_t **transitions) { - assert (!state->transitions); + if (state->transitions) + abort (); state->transitions = transitions_new (num, transitions); } @@ -192,7 +193,8 @@ state_transitions_set (state_t *state, int num, state_t **transitions) void state_reductions_set (state_t *state, int num, rule_t **reductions) { - assert (!state->reductions); + if (state->reductions) + abort (); state->reductions = reductions_new (num, reductions); } @@ -216,7 +218,8 @@ state_reduction_find (state_t *state, rule_t *rule) void state_errs_set (state_t *state, int num, symbol_t **tokens) { - assert (!state->errs); + if (state->errs) + abort (); state->errs = errs_new (num, tokens); } @@ -266,13 +269,13 @@ state_compare (const state_t *s1, const state_t *s2) int i; if (s1->nitems != s2->nitems) - return FALSE; + return false; for (i = 0; i < s1->nitems; ++i) if (s1->items[i] != s2->items[i]) - return FALSE; + return false; - return TRUE; + return true; } static unsigned int