#include "system.h"
#include "gram.h"
+#include "symtab.h"
#include "reader.h"
/* comments for these variables are in gram.h */
short *ritem = NULL;
int nritems;
-rule_t *rule_table = NULL;
-short *rprec = NULL;
-short *rprecsym = NULL;
-short *sprec = NULL;
-short *rassoc = NULL;
-short *sassoc = NULL;
+rule_t *rules = NULL;
+
+struct bucket **symbols = NULL;
short *token_translations = NULL;
int start_symbol;
fputs ("RITEM\n", out);
for (i = 0; i < nritems; ++i)
if (ritem[i] >= 0)
- fprintf (out, " %s", tags[ritem[i]]);
+ fprintf (out, " %s", symbols[ritem[i]]->tag);
else
- fprintf (out, " (rule %d)\n", -ritem[i]);
+ fprintf (out, " (rule %d)\n", -ritem[i] - 1);
fputs ("\n\n", out);
}
size_t
ritem_longest_rhs (void)
{
- short *itemp;
int length;
int max;
+ int i;
length = 0;
max = 0;
- for (itemp = ritem; *itemp; itemp++)
- if (*itemp > 0)
+ for (i = 0; i < nritems; ++i)
+ if (ritem[i] >= 0)
{
length++;
}