/* Subroutines for bison
- Copyright (C) 1984, 1989, 2000 Free Software Foundation, Inc.
+ Copyright 1984, 1989, 2000 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
-
#include "system.h"
-#include "alloc.h"
#include "gram.h"
#include "closure.h"
-
-extern short **derives;
-
-extern void RTC PARAMS ((unsigned *, int));
+#include "derives.h"
+#include "warshall.h"
short *itemset;
short *itemsetend;
varsetsize = rowsize = WORDSIZE (nvars);
- firsts = NEW2 (nvars * rowsize, unsigned);
+ firsts = XCALLOC (unsigned, nvars * rowsize);
row = firsts;
for (i = ntokens; i < nsyms; i++)
int ruleno;
int i;
- fderives = NEW2 (nvars * rulesetsize, unsigned) - ntokens * rulesetsize;
+ fderives = XCALLOC (unsigned, nvars * rulesetsize) - ntokens * rulesetsize;
set_firsts ();
print_fderives ();
#endif
- FREE (firsts);
+ XFREE (firsts);
}
\f
void
new_closure (int n)
{
- itemset = NEW2 (n, short);
+ itemset = XCALLOC (short, n);
rulesetsize = WORDSIZE (nrules + 1);
- ruleset = NEW2 (rulesetsize, unsigned);
+ ruleset = XCALLOC (unsigned, rulesetsize);
set_fderives ();
}
void
free_closure (void)
{
- FREE (itemset);
- FREE (ruleset);
- FREE (fderives + ntokens * rulesetsize);
+ XFREE (itemset);
+ XFREE (ruleset);
+ XFREE (fderives + ntokens * rulesetsize);
}