/* Lists of symbols for Bison
- Copyright (C) 2002, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005-2007, 2009-2012 Free Software Foundation,
+ Inc.
This file is part of Bison, the GNU Compiler Compiler.
symbol_print (l->content.sym, f);
fprintf (stderr, l->action_props.is_value_used ? " used" : " unused");
if (l && l->content.sym)
- fprintf (f, ", ");
+ fprintf (f, ", ");
}
}
void
symbol_list_free (symbol_list *list)
{
- LIST_FREE (symbol_list, list);
+ symbol_list *node, *next;
+ for (node = list; node; node = next)
+ {
+ next = node->next;
+ named_ref_free (node->named_ref);
+ free (node);
+ }
}
l = l->next;
if (l == NULL
|| (l->content_type == SYMLIST_SYMBOL && l->content.sym == NULL))
- return NULL;
+ return NULL;
}
return l;
return l->content.sym->type_name;
}
+bool
+symbol_list_null (symbol_list *node)
+{
+ return !node ||
+ (node->content_type == SYMLIST_SYMBOL && !(node->content.sym));
+}
void
symbol_list_destructor_set (symbol_list *node, char const *code, location loc)