X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/affac6132ae6ee354e1497e456b5c81a0c84334f..47aee066ccabdb3aeb96735532167c551f8e7194:/src/symlist.c diff --git a/src/symlist.c b/src/symlist.c index ed42ce1e..e00814ed 100644 --- a/src/symlist.c +++ b/src/symlist.c @@ -1,6 +1,6 @@ /* Lists of symbols for Bison - Copyright (C) 2002, 2005 Free Software Foundation, Inc. + Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. @@ -38,6 +38,10 @@ symbol_list_new (symbol *sym, location loc) res->sym = sym; res->location = loc; + res->midrule = NULL; + res->midrule_parent_rule = NULL; + res->midrule_parent_rhs_index = 0; + res->action = NULL; res->used = false; @@ -56,11 +60,12 @@ symbol_list_new (symbol *sym, location loc) `------------------*/ void -symbol_list_print (symbol_list *l, FILE *f) +symbol_list_print (const symbol_list *l, FILE *f) { for (/* Nothing. */; l && l->sym; l = l->next) { symbol_print (l->sym, f); + fprintf (stderr, l->used ? " used" : " unused"); if (l && l->sym) fprintf (f, ", "); } @@ -95,11 +100,11 @@ symbol_list_free (symbol_list *list) | Return its length. | `--------------------*/ -unsigned int -symbol_list_length (symbol_list *l) +int +symbol_list_length (symbol_list const *l) { int res = 0; - for (/* Nothing. */; l; l = l->next) + for (/* Nothing. */; l && l->sym; l = l->next) ++res; return res; }