diff options
Diffstat (limited to '')
-rw-r--r-- | LuaSL/src/LuaSL_LSL_tree.h | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/LuaSL/src/LuaSL_LSL_tree.h b/LuaSL/src/LuaSL_LSL_tree.h index 2c2bfa6..c8d1cc6 100644 --- a/LuaSL/src/LuaSL_LSL_tree.h +++ b/LuaSL/src/LuaSL_LSL_tree.h | |||
@@ -225,6 +225,7 @@ struct _LSL_Block | |||
225 | LSL_Block *outerBlock; | 225 | LSL_Block *outerBlock; |
226 | // Eina_Hash *statements; // Probably should be some sort of eina list. | 226 | // Eina_Hash *statements; // Probably should be some sort of eina list. |
227 | Eina_Hash *variables; // Those variables in this scope. | 227 | Eina_Hash *variables; // Those variables in this scope. |
228 | LSL_Function *function; | ||
228 | }; | 229 | }; |
229 | 230 | ||
230 | struct _LSL_Function | 231 | struct _LSL_Function |
@@ -232,6 +233,7 @@ struct _LSL_Function | |||
232 | const char *name; | 233 | const char *name; |
233 | LSL_Leaf *type; | 234 | LSL_Leaf *type; |
234 | LSL_Leaf *params; | 235 | LSL_Leaf *params; |
236 | Eina_Hash *variables; | ||
235 | LSL_Leaf *block; | 237 | LSL_Leaf *block; |
236 | }; | 238 | }; |
237 | 239 | ||
@@ -255,18 +257,18 @@ struct _LSL_Script | |||
255 | 257 | ||
256 | typedef struct | 258 | typedef struct |
257 | { | 259 | { |
258 | gameGlobals *game; | 260 | gameGlobals *game; |
259 | void *scanner; // This should be of type yyscan_t, which is typedef to void * anyway, but that does not get defined until LuaSL_lexer.h, which depends on this struct being defined first. | 261 | void *scanner; // This should be of type yyscan_t, which is typedef to void * anyway, but that does not get defined until LuaSL_lexer.h, which depends on this struct being defined first. |
260 | int argc; | 262 | int argc; |
261 | char **argv; | 263 | char **argv; |
262 | char fileName[PATH_MAX]; | 264 | char fileName[PATH_MAX]; |
263 | FILE *file; | 265 | FILE *file; |
264 | LSL_Leaf *ast; | 266 | LSL_Leaf *ast; |
265 | LSL_Script script; | 267 | LSL_Script script; |
266 | Eina_Strbuf *ignorableText; | 268 | Eina_Strbuf *ignorableText; |
267 | LSL_Leaf *lval; | 269 | LSL_Leaf *lval; |
268 | int column, line; | 270 | int column, line; |
269 | LSL_Block *currentBlock; | 271 | LSL_Block *currentBlock; |
270 | } LuaSL_compiler; | 272 | } LuaSL_compiler; |
271 | 273 | ||
272 | 274 | ||
@@ -276,9 +278,10 @@ typedef struct | |||
276 | 278 | ||
277 | 279 | ||
278 | void burnLeaf(void *data); | 280 | void burnLeaf(void *data); |
279 | LSL_Leaf *addFunction(LuaSL_compiler *compiler, LSL_Leaf *type, LSL_Leaf *identifier, LSL_Leaf *open, LSL_Leaf *params, LSL_Leaf *close, LSL_Leaf *block); | 281 | LSL_Leaf *addFunction(LuaSL_compiler *compiler, LSL_Leaf *type, LSL_Leaf *identifier, LSL_Leaf *open, LSL_Leaf *params, LSL_Leaf *close); |
282 | LSL_Leaf *addFunctionBody(LuaSL_compiler *compiler, LSL_Leaf *function, LSL_Leaf *block); | ||
280 | LSL_Leaf *addOperation(LuaSL_compiler *compiler, LSL_Leaf *left, LSL_Leaf *lval, LSL_Leaf *right); | 283 | LSL_Leaf *addOperation(LuaSL_compiler *compiler, LSL_Leaf *left, LSL_Leaf *lval, LSL_Leaf *right); |
281 | LSL_Leaf *addParameter(LSL_Leaf *type, LSL_Leaf *newParam); | 284 | LSL_Leaf *addParameter(LuaSL_compiler *compiler, LSL_Leaf *type, LSL_Leaf *newParam); |
282 | LSL_Leaf *addParenthesis(LSL_Leaf *lval, LSL_Leaf *expr, LSL_Type type, LSL_Leaf *rval); | 285 | LSL_Leaf *addParenthesis(LSL_Leaf *lval, LSL_Leaf *expr, LSL_Type type, LSL_Leaf *rval); |
283 | LSL_Leaf *addState(LuaSL_compiler *compiler, LSL_Leaf *identifier, LSL_Leaf *block); | 286 | LSL_Leaf *addState(LuaSL_compiler *compiler, LSL_Leaf *identifier, LSL_Leaf *block); |
284 | LSL_Leaf *addStatement(LSL_Leaf *lval, LSL_Type type, LSL_Leaf *expr); | 287 | LSL_Leaf *addStatement(LSL_Leaf *lval, LSL_Type type, LSL_Leaf *expr); |
@@ -287,7 +290,7 @@ LSL_Leaf *addVariable(LuaSL_compiler *compiler, LSL_Leaf *type, LSL_Leaf *identi | |||
287 | 290 | ||
288 | void beginBlock(LuaSL_compiler *compiler, LSL_Leaf *block); | 291 | void beginBlock(LuaSL_compiler *compiler, LSL_Leaf *block); |
289 | LSL_Leaf *checkVariable(LuaSL_compiler *compiler, LSL_Leaf *identifier); | 292 | LSL_Leaf *checkVariable(LuaSL_compiler *compiler, LSL_Leaf *identifier); |
290 | LSL_Leaf *collectParameters(LSL_Leaf *list, LSL_Leaf *comma, LSL_Leaf *newParam); | 293 | LSL_Leaf *collectParameters(LuaSL_compiler *compiler, LSL_Leaf *list, LSL_Leaf *comma, LSL_Leaf *newParam); |
291 | void endBlock(LuaSL_compiler *compiler, LSL_Leaf *block); | 294 | void endBlock(LuaSL_compiler *compiler, LSL_Leaf *block); |
292 | 295 | ||
293 | void *ParseAlloc(void *(*mallocProc)(size_t)); | 296 | void *ParseAlloc(void *(*mallocProc)(size_t)); |