X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/78ab8f674f0679b38ca8a6353f562c86b1c95055..ec3bc39:/src/gram.c diff --git a/src/gram.c b/src/gram.c index e6fb7089..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; @@ -45,8 +45,6 @@ token_number_t start_symbol = 0; int max_user_token_number = 256; -int semantic_parser = 0; - int pure_parser = 0; @@ -72,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) @@ -161,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 (); +}