From 5f3188ff6b8c768f1a18e4d238dced35bc4ad811 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Tue, 24 Jan 2012 15:08:57 +1000 Subject: Update to latest lemon, and actually use our local copy. --- .gitignore | 8 +++++--- LuaSL/build.sh | 7 +------ libraries/lemon/lemon.c | 11 ++++------- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 953a9d7..2158a09 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,10 @@ *.diff *.lsl.lua *.lsl2 +libraries/LuaJIT-1.1.7/src/liblua.a +libraries/LuaJIT-1.1.7/src/luajit +libraries/luaproc/luaproc.so +libraries/lemon/lemon LuaSL/LuaSL LuaSL/LuaSL_parser LuaSL/src/LuaSL_lemon_yaccer.c @@ -16,6 +20,4 @@ LuaSL/src/LuaSL_lexer.c LuaSL/src/LuaSL_lexer.h LuaSL/src/LuaSL_LSL_lexer.c LuaSL/src/LuaSL_LSL_lexer.h -libraries/LuaJIT-1.1.7/src/liblua.a -libraries/LuaJIT-1.1.7/src/luajit -libraries/luaproc/luaproc.so + diff --git a/LuaSL/build.sh b/LuaSL/build.sh index 7455847..4f80cb4 100755 --- a/LuaSL/build.sh +++ b/LuaSL/build.sh @@ -54,24 +54,19 @@ LFLAGS="-d" EDJE_FLAGS="-id images -fd fonts" - - # Run lemon first, flex depends on it to define the symbol values. -command="lemon -s LuaSL_lemon_yaccer.y" +command="../../libraries/lemon/lemon -s -T../../libraries/lemon/lempar.c LuaSL_lemon_yaccer.y" echo $command $command - command="flex -C --outfile=LuaSL_lexer.c --header-file=LuaSL_lexer.h LuaSL_lexer.l" echo $command $command - command="edje_cc $EDJE_FLAGS LuaSL.edc ../LuaSL.edj" echo $command $command - names="LuaSL_main LuaSL_compile LuaSL_utilities LuaSL_lexer LuaSL_lemon_yaccer" objects="" for i in $names diff --git a/libraries/lemon/lemon.c b/libraries/lemon/lemon.c index a089bc7..c3e612b 100644 --- a/libraries/lemon/lemon.c +++ b/libraries/lemon/lemon.c @@ -117,8 +117,6 @@ void ResortStates(struct lemon *); void SetSize(int); /* All sets will be of size N */ char *SetNew(void); /* A new set for element 0..N */ void SetFree(char*); /* Deallocate a set */ - -char *SetNew(void); /* A new set for element 0..N */ int SetAdd(char*,int); /* Add element to a set */ int SetUnion(char *,char *); /* A <- A U B, thru element N */ #define SetFind(X,Y) (X[Y]) /* True if Y is in set X */ @@ -969,7 +967,7 @@ void FindFollowSets(struct lemon *lemp) }while( progress ); } -static int resolve_conflict(struct action *,struct action *, struct symbol *); +static int resolve_conflict(struct action *,struct action *); /* Compute the reduce actions, and resolve conflicts. */ @@ -1023,7 +1021,7 @@ void FindActions(struct lemon *lemp) for(nap=ap->next; nap && nap->sp==ap->sp; nap=nap->next){ /* The two actions "ap" and "nap" have the same lookahead. ** Figure out which one should be used */ - lemp->nconflict += resolve_conflict(ap,nap,lemp->errsym); + lemp->nconflict += resolve_conflict(ap,nap); } } } @@ -1058,8 +1056,7 @@ void FindActions(struct lemon *lemp) */ static int resolve_conflict( struct action *apx, - struct action *apy, - struct symbol *errsym /* The error symbol (if defined. NULL otherwise) */ + struct action *apy ){ struct symbol *spx, *spy; int errcnt = 0; @@ -1996,7 +1993,7 @@ static void parseonetoken(struct pstate *psp) }else if( x[0]=='{' ){ if( psp->prevrule==0 ){ ErrorMsg(psp->filename,psp->tokenlineno, -"There is no prior rule opon which to attach the code \ +"There is no prior rule upon which to attach the code \ fragment which begins on this line."); psp->errorcnt++; }else if( psp->prevrule->code!=0 ){ -- cgit v1.1