diff options
Diffstat (limited to '')
-rw-r--r-- | LuaSL/src/LuaSL_LSL_tree.h | 75 |
1 files changed, 44 insertions, 31 deletions
diff --git a/LuaSL/src/LuaSL_LSL_tree.h b/LuaSL/src/LuaSL_LSL_tree.h index 21fc696..d537948 100644 --- a/LuaSL/src/LuaSL_LSL_tree.h +++ b/LuaSL/src/LuaSL_LSL_tree.h | |||
@@ -29,16 +29,17 @@ | |||
29 | // http://w-hat.com/stackdepth is a useful discussion about some aspects of the LL parser. | 29 | // http://w-hat.com/stackdepth is a useful discussion about some aspects of the LL parser. |
30 | 30 | ||
31 | 31 | ||
32 | typedef struct _allowedTypes allowedTypes; | 32 | typedef struct _allowedTypes allowedTypes; |
33 | typedef struct _LSL_Token LSL_Token; | 33 | typedef struct _LSL_Token LSL_Token; |
34 | typedef struct _LSL_Leaf LSL_Leaf; | 34 | typedef struct _LSL_Leaf LSL_Leaf; |
35 | typedef struct _LSL_Parenthesis LSL_Parenthesis; | 35 | typedef struct _LSL_Parenthesis LSL_Parenthesis; |
36 | typedef struct _LSL_Identifier LSL_Identifier; | 36 | typedef struct _LSL_Identifier LSL_Identifier; |
37 | typedef struct _LSL_Statement LSL_Statement; | 37 | typedef struct _LSL_Statement LSL_Statement; |
38 | typedef struct _LSL_Block LSL_Block; | 38 | typedef struct _LSL_Block LSL_Block; |
39 | typedef struct _LSL_Function LSL_Function; | 39 | typedef struct _LSL_Function LSL_Function; |
40 | typedef struct _LSL_State LSL_State; | 40 | typedef struct _LSL_FunctionCall LSL_FunctionCall; |
41 | typedef struct _LSL_Script LSL_Script; | 41 | typedef struct _LSL_State LSL_State; |
42 | typedef struct _LSL_Script LSL_Script; | ||
42 | 43 | ||
43 | extern LSL_Token **tokens; | 44 | extern LSL_Token **tokens; |
44 | extern int lowestToken; | 45 | extern int lowestToken; |
@@ -108,6 +109,7 @@ typedef enum | |||
108 | OT_vectorRotation, | 109 | OT_vectorRotation, |
109 | OT_rotationRotation, | 110 | OT_rotationRotation, |
110 | OT_otherOther, | 111 | OT_otherOther, |
112 | OT_undeclared, | ||
111 | OT_invalid | 113 | OT_invalid |
112 | } opType; | 114 | } opType; |
113 | 115 | ||
@@ -148,30 +150,31 @@ struct _LSL_Token | |||
148 | 150 | ||
149 | struct _LSL_Leaf | 151 | struct _LSL_Leaf |
150 | { | 152 | { |
151 | LSL_Leaf *left; | 153 | LSL_Leaf *left; |
152 | LSL_Leaf *right; | 154 | LSL_Leaf *right; |
153 | LSL_Token *token; | 155 | LSL_Token *token; |
154 | #ifdef LUASL_DIFF_CHECK | 156 | #ifdef LUASL_DIFF_CHECK |
155 | Eina_Strbuf *ignorableText; | 157 | Eina_Strbuf *ignorableText; |
156 | #endif | 158 | #endif |
157 | int line, column, len; | 159 | int line, column, len; |
158 | opType basicType; | 160 | opType basicType; |
159 | union | 161 | union |
160 | { | 162 | { |
161 | float floatValue; | 163 | float floatValue; |
162 | float vectorValue[3]; | 164 | float vectorValue[3]; |
163 | float rotationValue[4]; | 165 | float rotationValue[4]; |
164 | int integerValue; | 166 | int integerValue; |
165 | LSL_Leaf *listValue; | 167 | LSL_Leaf *listValue; |
166 | const char *stringValue; | 168 | const char *stringValue; |
167 | opType operationValue; | 169 | opType operationValue; |
168 | LSL_Parenthesis *parenthesis; | 170 | LSL_Parenthesis *parenthesis; |
169 | LSL_Identifier *identifierValue; | 171 | LSL_Identifier *identifierValue; |
170 | LSL_Statement *statementValue; | 172 | LSL_Statement *statementValue; |
171 | LSL_Block *blockValue; | 173 | LSL_Block *blockValue; |
172 | LSL_Function *functionValue; | 174 | LSL_Function *functionValue; |
173 | LSL_State *stateValue; | 175 | LSL_FunctionCall *functionCallValue; |
174 | LSL_Script *scriptValue; | 176 | LSL_State *stateValue; |
177 | LSL_Script *scriptValue; | ||
175 | } value; | 178 | } value; |
176 | }; | 179 | }; |
177 | 180 | ||
@@ -216,6 +219,14 @@ struct _LSL_Function | |||
216 | LSL_Leaf *block; | 219 | LSL_Leaf *block; |
217 | }; | 220 | }; |
218 | 221 | ||
222 | struct _LSL_FunctionCall | ||
223 | { | ||
224 | LSL_Function *function; | ||
225 | Eina_Inarray params; // Eina Inarray has not been released yet (Eina 1.2). | ||
226 | Eina_Clist functionCall; | ||
227 | LSL_Leaf *call; | ||
228 | }; | ||
229 | |||
219 | struct _LSL_State | 230 | struct _LSL_State |
220 | { | 231 | { |
221 | const char *name; | 232 | const char *name; |
@@ -312,8 +323,10 @@ typedef struct | |||
312 | Eina_Strbuf *ignorableText; | 323 | Eina_Strbuf *ignorableText; |
313 | #endif | 324 | #endif |
314 | LSL_Leaf *lval; | 325 | LSL_Leaf *lval; |
315 | int column, line; | ||
316 | LSL_Block *currentBlock; | 326 | LSL_Block *currentBlock; |
327 | Eina_Clist danglingCalls; | ||
328 | int column, line; | ||
329 | int undeclared; | ||
317 | } LuaSL_compiler; | 330 | } LuaSL_compiler; |
318 | 331 | ||
319 | 332 | ||