+#ifdef DEBUG
+void item_collection_print_each (gpointer key, gpointer val, gpointer data)
+{
+ GHashTable* item_set;
+ state_t* state;
+ item_set = (GHashTable*) key;
+ state = (state_t*) val;
+ fprintf (stdout, "Item %d:\n", state->code);
+ item_set_print (item_set);
+ fprintf (stdout, "\n");
+}
+
+void item_set_print_goto (gpointer key, gpointer val, gpointer data)
+{
+ symbol_t* symbol;
+ gint code;
+ state_t* state;
+ symbol = (symbol_t*) symbol;
+ code = GINT_TO_POINTER (val);
+ state = (state_t*) data;
+ fprintf (stdout, "GOTO (%d, %s) =\t %d\n", state->code,
+ g_quark_to_string (symbol->value), code);
+}
+
+void item_collection_print_goto (gpointer key, gpointer val, gpointer data)
+{
+ state_t* state;
+ state = (state_t*) val;
+ g_hash_table_foreach (state->symbols, item_set_print_goto, state);
+ fprintf (stdout, "\n");
+}
+
+void item_collection_print (GHashTable* collection)
+{
+ g_hash_table_foreach (collection, item_collection_print_each, NULL);
+ g_hash_table_foreach (collection, item_collection_print_goto, NULL);
+}
+#endif
+