Update to branch lr1
authorThadeu Lima de Souza Cascardo <cascardo@dcc.ufmg.br>
Wed, 26 Oct 2005 12:28:51 +0000 (12:28 +0000)
committerThadeu Lima de Souza Cascardo <cascardo@dcc.ufmg.br>
Wed, 26 Oct 2005 12:28:51 +0000 (12:28 +0000)
Patches applied:

 * cascardo@tlscascardo--private/libgrammatic--lr1--0.1--patch-6
   Fixed some building issues

git-archimport-id: cascardo@tlscascardo--private/libgrammatic--nogobject-lr1--0.1--patch-7

1  2 
item.h
lr1.c
lr1.h

diff --combined item.h
--- 1/item.h
--- 2/item.h
+++ b/item.h
@@@ -1,6 -1,9 +1,9 @@@
  #ifndef ITEM_H
  #define ITEM_H
  
+ #include <grammar.h>
+ #include <glib.h>
  typedef struct
  {
    symbol_t* left;
@@@ -9,6 -12,6 +12,6 @@@
    symbol_t* lookahead;
  } item_t;
  
--GHashTable* item_set_collection (Grammar*, GHashTable*, symbol_t*);
++GHashTable* item_set_collection (grammar_t*, GHashTable*, symbol_t*);
  
  #endif
diff --combined lr1.c
--- 1/lr1.c
--- 2/lr1.c
+++ b/lr1.c
@@@ -1,5 -1,6 +1,6 @@@
  #include <grammar.h>
  #include <stdlib.h>
+ #include <lr1.h>
  
  enum { PARSER_SHIFT, PARSER_REDUCE, PARSER_ACCEPT };
  
@@@ -67,7 -68,7 +68,7 @@@ void transition_delete (transition_t* t
    g_free (transition);
  }
  
 -static void lr1_push (lr1_t* parser, gint st, gpointer attrib)
 +void lr1_push (lr1_t* parser, gint st, gpointer attrib)
  {
    state_t* state;
    state = g_malloc (sizeof (state_t));
@@@ -103,6 -104,7 +104,6 @@@ lr1_t* lr1_new (nextcb cb, gpointer dat
    parser->data = data;
  
    parser->stack = NULL;
 -  lr1_push (parser, 0, NULL);
    parser->table = g_hash_table_new_full (g_direct_hash, g_direct_equal,
                                         NULL, g_hash_table_destroy);
  
@@@ -235,7 -237,7 +236,7 @@@ gpointer lr1_build (lr1_t* parser
  
          for (l = grammar_get_rule (transition->right);
               l != NULL;
-              l = g_list_previous (l))
+              l = g_list_next (l))
            {
              gpointer attr;
              if (!lr1_pop (parser, &attr))
diff --combined lr1.h
--- 1/lr1.h
--- 2/lr1.h
+++ b/lr1.h
@@@ -12,8 -12,7 +12,8 @@@ transition_t* transition_accept_new ()
  void transition_delete (transition_t*);
  lr1_t* lr1_new (nextcb, gpointer);
  void lr1_delete (lr1_t*);
- void lr1_add (lr1_t*, gint, symbol_t*, transition_t*);
+ gboolean lr1_add (lr1_t*, gint, symbol_t*, transition_t*);
 +void lr1_push (lr1_t*, gint, gpointer);
  gpointer lr1_build (lr1_t*);
  
  #endif