X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/fdbcd8e28930c6a1e6d4f80636c7b4e21a575489..ec3bc39:/src/gram.c?ds=inline diff --git a/src/gram.c b/src/gram.c index 75546603..de5a217c 100644 --- a/src/gram.c +++ b/src/gram.c @@ -29,7 +29,7 @@ /* comments for these variables are in gram.h */ item_number_t *ritem = NULL; -int nritems = 0; +unsigned int nritems = 0; rule_t *rules = NULL; int nrules = 0; @@ -70,7 +70,7 @@ rule_rhs_length (rule_t *rule) void ritem_print (FILE *out) { - int i; + unsigned int i; fputs ("RITEM\n", out); for (i = 0; i < nritems; ++i) if (ritem[i] >= 0) @@ -159,3 +159,14 @@ grammar_dump (FILE *out, const char *title) } fprintf (out, "\n\n"); } + + +void +grammar_free (void) +{ + XFREE (ritem); + free (rules + 1); + XFREE (token_translations); + /* Free the symbol table data structure. */ + symbols_free (); +}