diff options
-rw-r--r-- | .gitignore | 8 | ||||
-rwxr-xr-x | LuaSL/build.sh | 7 | ||||
-rw-r--r-- | libraries/lemon/lemon.c | 11 |
3 files changed, 10 insertions, 16 deletions
@@ -6,6 +6,10 @@ | |||
6 | *.diff | 6 | *.diff |
7 | *.lsl.lua | 7 | *.lsl.lua |
8 | *.lsl2 | 8 | *.lsl2 |
9 | libraries/LuaJIT-1.1.7/src/liblua.a | ||
10 | libraries/LuaJIT-1.1.7/src/luajit | ||
11 | libraries/luaproc/luaproc.so | ||
12 | libraries/lemon/lemon | ||
9 | LuaSL/LuaSL | 13 | LuaSL/LuaSL |
10 | LuaSL/LuaSL_parser | 14 | LuaSL/LuaSL_parser |
11 | LuaSL/src/LuaSL_lemon_yaccer.c | 15 | LuaSL/src/LuaSL_lemon_yaccer.c |
@@ -16,6 +20,4 @@ LuaSL/src/LuaSL_lexer.c | |||
16 | LuaSL/src/LuaSL_lexer.h | 20 | LuaSL/src/LuaSL_lexer.h |
17 | LuaSL/src/LuaSL_LSL_lexer.c | 21 | LuaSL/src/LuaSL_LSL_lexer.c |
18 | LuaSL/src/LuaSL_LSL_lexer.h | 22 | LuaSL/src/LuaSL_LSL_lexer.h |
19 | libraries/LuaJIT-1.1.7/src/liblua.a | 23 | |
20 | libraries/LuaJIT-1.1.7/src/luajit | ||
21 | 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" | |||
54 | EDJE_FLAGS="-id images -fd fonts" | 54 | EDJE_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. |
60 | command="lemon -s LuaSL_lemon_yaccer.y" | 58 | command="../../libraries/lemon/lemon -s -T../../libraries/lemon/lempar.c LuaSL_lemon_yaccer.y" |
61 | echo $command | 59 | echo $command |
62 | $command | 60 | $command |
63 | 61 | ||
64 | |||
65 | command="flex -C --outfile=LuaSL_lexer.c --header-file=LuaSL_lexer.h LuaSL_lexer.l" | 62 | command="flex -C --outfile=LuaSL_lexer.c --header-file=LuaSL_lexer.h LuaSL_lexer.l" |
66 | echo $command | 63 | echo $command |
67 | $command | 64 | $command |
68 | 65 | ||
69 | |||
70 | command="edje_cc $EDJE_FLAGS LuaSL.edc ../LuaSL.edj" | 66 | command="edje_cc $EDJE_FLAGS LuaSL.edc ../LuaSL.edj" |
71 | echo $command | 67 | echo $command |
72 | $command | 68 | $command |
73 | 69 | ||
74 | |||
75 | names="LuaSL_main LuaSL_compile LuaSL_utilities LuaSL_lexer LuaSL_lemon_yaccer" | 70 | names="LuaSL_main LuaSL_compile LuaSL_utilities LuaSL_lexer LuaSL_lemon_yaccer" |
76 | objects="" | 71 | objects="" |
77 | for i in $names | 72 | 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 *); | |||
117 | void SetSize(int); /* All sets will be of size N */ | 117 | void SetSize(int); /* All sets will be of size N */ |
118 | char *SetNew(void); /* A new set for element 0..N */ | 118 | char *SetNew(void); /* A new set for element 0..N */ |
119 | void SetFree(char*); /* Deallocate a set */ | 119 | void SetFree(char*); /* Deallocate a set */ |
120 | |||
121 | char *SetNew(void); /* A new set for element 0..N */ | ||
122 | int SetAdd(char*,int); /* Add element to a set */ | 120 | int SetAdd(char*,int); /* Add element to a set */ |
123 | int SetUnion(char *,char *); /* A <- A U B, thru element N */ | 121 | int 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 | ||
972 | static int resolve_conflict(struct action *,struct action *, struct symbol *); | 970 | static 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 | */ |
1059 | static int resolve_conflict( | 1057 | static 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 \ |
2000 | fragment which begins on this line."); | 1997 | fragment 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 ){ |