return NULL;
}
goto_item_set = item_set_goto (item_set, grammar, first, symbol);
- if (!item_collection_add (collection, goto_item_set))
- return_item_set = NULL;
+ if (!item_collection_add (collection, goto_item_set, &old_item_set))
+ {
+ g_hash_table_insert (symbols, symbol, old_item_set);
+ g_hash_table_destroy (goto_item_set);
+ return NULL;
+ }
else
- return_item_set = goto_item_set;
- goto_state = item_collection_lookup (collection, goto_item_set);
- g_hash_table_insert (state->symbols, symbol,
- GINT_TO_POINTER (goto_state->code));
- return return_item_set;
+ {
+ g_hash_table_insert (symbols, symbol, goto_item_set);
+ return goto_item_set;
+ }
}
- void item_set_collection (grammar_t* grammar, GHashTable* first, symbol_t* start)
-GHashTable* item_set_collection (Grammar* grammar, GHashTable* first,
++GHashTable* item_set_collection (grammar_t* grammar, GHashTable* first,
+ symbol_t* start)
{
GHashTable* collection;
GHashTable* item_set;