aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--.gitignore8
-rwxr-xr-xLuaSL/build.sh7
-rw-r--r--libraries/lemon/lemon.c11
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 @@
6*.diff 6*.diff
7*.lsl.lua 7*.lsl.lua
8*.lsl2 8*.lsl2
9libraries/LuaJIT-1.1.7/src/liblua.a
10libraries/LuaJIT-1.1.7/src/luajit
11libraries/luaproc/luaproc.so
12libraries/lemon/lemon
9LuaSL/LuaSL 13LuaSL/LuaSL
10LuaSL/LuaSL_parser 14LuaSL/LuaSL_parser
11LuaSL/src/LuaSL_lemon_yaccer.c 15LuaSL/src/LuaSL_lemon_yaccer.c
@@ -16,6 +20,4 @@ LuaSL/src/LuaSL_lexer.c
16LuaSL/src/LuaSL_lexer.h 20LuaSL/src/LuaSL_lexer.h
17LuaSL/src/LuaSL_LSL_lexer.c 21LuaSL/src/LuaSL_LSL_lexer.c
18LuaSL/src/LuaSL_LSL_lexer.h 22LuaSL/src/LuaSL_LSL_lexer.h
19libraries/LuaJIT-1.1.7/src/liblua.a 23
20libraries/LuaJIT-1.1.7/src/luajit
21libraries/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"
54EDJE_FLAGS="-id images -fd fonts" 54EDJE_FLAGS="-id images -fd fonts"
55 55
56 56
57
58
59# Run lemon first, flex depends on it to define the symbol values. 57# Run lemon first, flex depends on it to define the symbol values.
60command="lemon -s LuaSL_lemon_yaccer.y" 58command="../../libraries/lemon/lemon -s -T../../libraries/lemon/lempar.c LuaSL_lemon_yaccer.y"
61echo $command 59echo $command
62$command 60$command
63 61
64
65command="flex -C --outfile=LuaSL_lexer.c --header-file=LuaSL_lexer.h LuaSL_lexer.l" 62command="flex -C --outfile=LuaSL_lexer.c --header-file=LuaSL_lexer.h LuaSL_lexer.l"
66echo $command 63echo $command
67$command 64$command
68 65
69
70command="edje_cc $EDJE_FLAGS LuaSL.edc ../LuaSL.edj" 66command="edje_cc $EDJE_FLAGS LuaSL.edc ../LuaSL.edj"
71echo $command 67echo $command
72$command 68$command
73 69
74
75names="LuaSL_main LuaSL_compile LuaSL_utilities LuaSL_lexer LuaSL_lemon_yaccer" 70names="LuaSL_main LuaSL_compile LuaSL_utilities LuaSL_lexer LuaSL_lemon_yaccer"
76objects="" 71objects=""
77for i in $names 72for 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 *);
117void SetSize(int); /* All sets will be of size N */ 117void SetSize(int); /* All sets will be of size N */
118char *SetNew(void); /* A new set for element 0..N */ 118char *SetNew(void); /* A new set for element 0..N */
119void SetFree(char*); /* Deallocate a set */ 119void SetFree(char*); /* Deallocate a set */
120
121char *SetNew(void); /* A new set for element 0..N */
122int SetAdd(char*,int); /* Add element to a set */ 120int SetAdd(char*,int); /* Add element to a set */
123int SetUnion(char *,char *); /* A <- A U B, thru element N */ 121int SetUnion(char *,char *); /* A <- A U B, thru element N */
124#define SetFind(X,Y) (X[Y]) /* True if Y is in set X */ 122#define SetFind(X,Y) (X[Y]) /* True if Y is in set X */
@@ -969,7 +967,7 @@ void FindFollowSets(struct lemon *lemp)
969 }while( progress ); 967 }while( progress );
970} 968}
971 969
972static int resolve_conflict(struct action *,struct action *, struct symbol *); 970static int resolve_conflict(struct action *,struct action *);
973 971
974/* Compute the reduce actions, and resolve conflicts. 972/* Compute the reduce actions, and resolve conflicts.
975*/ 973*/
@@ -1023,7 +1021,7 @@ void FindActions(struct lemon *lemp)
1023 for(nap=ap->next; nap && nap->sp==ap->sp; nap=nap->next){ 1021 for(nap=ap->next; nap && nap->sp==ap->sp; nap=nap->next){
1024 /* The two actions "ap" and "nap" have the same lookahead. 1022 /* The two actions "ap" and "nap" have the same lookahead.
1025 ** Figure out which one should be used */ 1023 ** Figure out which one should be used */
1026 lemp->nconflict += resolve_conflict(ap,nap,lemp->errsym); 1024 lemp->nconflict += resolve_conflict(ap,nap);
1027 } 1025 }
1028 } 1026 }
1029 } 1027 }
@@ -1058,8 +1056,7 @@ void FindActions(struct lemon *lemp)
1058*/ 1056*/
1059static int resolve_conflict( 1057static int resolve_conflict(
1060 struct action *apx, 1058 struct action *apx,
1061 struct action *apy, 1059 struct action *apy
1062 struct symbol *errsym /* The error symbol (if defined. NULL otherwise) */
1063){ 1060){
1064 struct symbol *spx, *spy; 1061 struct symbol *spx, *spy;
1065 int errcnt = 0; 1062 int errcnt = 0;
@@ -1996,7 +1993,7 @@ static void parseonetoken(struct pstate *psp)
1996 }else if( x[0]=='{' ){ 1993 }else if( x[0]=='{' ){
1997 if( psp->prevrule==0 ){ 1994 if( psp->prevrule==0 ){
1998 ErrorMsg(psp->filename,psp->tokenlineno, 1995 ErrorMsg(psp->filename,psp->tokenlineno,
1999"There is no prior rule opon which to attach the code \ 1996"There is no prior rule upon which to attach the code \
2000fragment which begins on this line."); 1997fragment which begins on this line.");
2001 psp->errorcnt++; 1998 psp->errorcnt++;
2002 }else if( psp->prevrule->code!=0 ){ 1999 }else if( psp->prevrule->code!=0 ){