You should have received a copy of the GNU General Public License
along with Bison; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
/* See comments in state.h for the data structures that represent it.
shifts *first_shift;
reductions *first_reduction;
-int get_state();
-core *new_state();
-
-void new_itemsets();
-void append_states();
-void initialize_states();
-void save_shifts();
-void save_reductions();
-void augment_automaton();
-void insert_start_shift();
-extern void initialize_closure();
-extern void closure();
-extern void finalize_closure();
-extern void toomany();
+int get_state PARAMS((int));
+core *new_state PARAMS((int));
+
+void allocate_itemsets PARAMS((void));
+void allocate_storage PARAMS((void));
+void free_storage PARAMS((void));
+void generate_states PARAMS((void));
+void new_itemsets PARAMS((void));
+void append_states PARAMS((void));
+void initialize_states PARAMS((void));
+void save_shifts PARAMS((void));
+void save_reductions PARAMS((void));
+void augment_automaton PARAMS((void));
+void insert_start_shift PARAMS((void));
+extern void initialize_closure PARAMS((int));
+extern void closure PARAMS((short *, int));
+extern void finalize_closure PARAMS((void));
+extern void toomany PARAMS((char *));
static core *this_state;
static core *last_state;
void
-allocate_itemsets()
+allocate_itemsets (void)
{
register short *itemp;
register int symbol;
void
-allocate_storage()
+allocate_storage (void)
{
allocate_itemsets();
void
-free_storage()
+free_storage (void)
{
FREE(shift_symbol);
FREE(redset);
/* compute the nondeterministic finite state machine (see state.h for details)
from the grammar. */
void
-generate_states()
+generate_states (void)
{
allocate_storage();
initialize_closure(nitems);
a vector of item numbers activated if that symbol is shifted,
and kernel_end[symbol] points after the end of that vector. */
void
-new_itemsets()
+new_itemsets (void)
{
register int i;
register int shiftcount;
shiftset is set up as a vector of state numbers of those states. */
void
-append_states()
+append_states (void)
{
register int i;
register int j;
Used by append_states */
int
-get_state(symbol)
-int symbol;
+get_state (int symbol)
{
register int key;
register short *isp1;
/* subroutine of get_state. create a new state for those items, if necessary. */
core *
-new_state(symbol)
-int symbol;
+new_state (int symbol)
{
register int n;
register core *p;
void
-initialize_states()
+initialize_states (void)
{
register core *p;
/* register unsigned *rp1; JF unused */
void
-save_shifts()
+save_shifts (void)
{
register shifts *p;
register short *sp1;
register short *send;
p = (shifts *) xmalloc((unsigned) (sizeof(shifts) +
- (nshifts - 1) * sizeof(short)));
+ (nshifts - 1) * sizeof(short)));
p->number = this_state->number;
p->nshifts = nshifts;
/* find which rules can be used for reduction transitions from the current state
and make a reductions structure for the state to record their rule numbers. */
void
-save_reductions()
+save_reductions (void)
{
register short *isp;
register short *rp1;
if (count)
{
p = (reductions *) xmalloc((unsigned) (sizeof(reductions) +
- (count - 1) * sizeof(short)));
+ (count - 1) * sizeof(short)));
p->number = this_state->number;
p->nreds = count;
to the termination state.
Create such states and shifts if they don't happen to exist already. */
void
-augment_automaton()
+augment_automaton (void)
{
register int i;
register int k;
register core *statep;
register shifts *sp;
register shifts *sp2;
- register shifts *sp1;
+ register shifts *sp1 = NULL;
sp = first_shift;
if (sp && sp->number == k)
{
sp2 = (shifts *) xmalloc((unsigned) (sizeof(shifts)
- + sp->nshifts * sizeof(short)));
+ + sp->nshifts * sizeof(short)));
sp2->number = k;
sp2->nshifts = sp->nshifts + 1;
sp2->shifts[0] = nstates;
Create the next-to-final state, to which a shift has already been made in
the initial state. */
void
-insert_start_shift()
+insert_start_shift (void)
{
register core *statep;
register shifts *sp;