+/*
+ * Copyright (C) 2005 Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+
+
#include <grammar.h>
#include <item.h>
#include <lr1.h>
if (item->dot == NULL)
{
#ifdef DEBUG
- printf ("ACCEPT: %x\n", key);
+ printf ("ACCEPT: %p\n", key);
#endif
transition = transition_accept_new ();
lr1_add (data, key, symbol_new (TRUE, 0), transition);
}
else
{
+#ifdef DEBUG
+ printf ("START: %p\n", key);
+#endif
lr1_push (data, key, NULL);
}
}
else if (item->dot == NULL)
{
#ifdef DEBUG
- printf ("REDUCE: %x, %s\n", key,
+ printf ("REDUCE: %p, %s\n", key,
g_quark_to_string (item->lookahead->value));
#endif
transition = transition_reduce_new (item->left, item->right);
l = g_list_next (l);
#ifdef DEBUG
- printf ("SHIFT: %x, %s, %x\n", key,
+ printf ("SHIFT: %p, %s, %p\n", key,
g_quark_to_string (symbol->value), l->data);
#endif
transition = transition_shift_new (l->data);
lr1 = lr1_new (cb, data);
first = grammar_first (grammar);
+#ifdef DEBUG
+ first_print (first);
+#endif
collection = item_set_collection (grammar, first, start);