02111-1307, USA. */
#include "system.h"
-#include "alloc.h"
+#include "xalloc.h"
#include "gram.h"
#include "closure.h"
#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);
}