From: Thadeu Lima de Souza Cascardo Date: Thu, 29 Sep 2005 17:51:56 +0000 (+0000) Subject: Fixed code for printing item sets X-Git-Tag: cascardo@tlscascardo--private,libgrammatic--lr1--0.1--base-0~2 X-Git-Url: http://git.cascardo.info/?p=cascardo%2Fgrammar.git;a=commitdiff_plain;h=6b2453c69ff5e471561a72884ae0ac38d9332df0 Fixed code for printing item sets Fixed some littel code for the debugging of the computing of item sets. git-archimport-id: cascardo@tlscascardo--private/libgrammatic--dev--0.1--patch-16 --- diff --git a/item.c b/item.c index fd017e2..a752dbd 100644 --- a/item.c +++ b/item.c @@ -74,7 +74,7 @@ void item_print (item_t* item) { GList* l; fprintf (stdout, "%s -> ", g_quark_to_string (item->left->value)); - l = grammar_rule_get (item->right); + l = grammar_get_rule (item->right); while (l != NULL) { symbol_t* symbol; @@ -84,6 +84,7 @@ void item_print (item_t* item) fprintf (stdout, "."); } fprintf (stdout, " %s ", g_quark_to_string (symbol->value)); + l = g_list_next (l); } if (item->dot == NULL) { @@ -344,7 +345,7 @@ void item_set_print_goto (gpointer key, gpointer val, gpointer data) symbol_t* symbol; gint code; state_t* state; - symbol = (symbol_t*) symbol; + symbol = (symbol_t*) key; code = GINT_TO_POINTER (val); state = (state_t*) data; fprintf (stdout, "GOTO (%d, %s) =\t %d\n", state->code,