aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_LSL_tree.h
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-17 19:52:21 +1000
committerDavid Walter Seikel2012-01-17 19:52:21 +1000
commit36f91bf237a2d48e27171c6661eff9cc255214d0 (patch)
tree9991a29a402c321ab1d83f00cb3a81e3cf8ba5a6 /LuaSL/src/LuaSL_LSL_tree.h
parentChange to the stringshared hash, it's way faster. (diff)
downloadSledjHamr-36f91bf237a2d48e27171c6661eff9cc255214d0.zip
SledjHamr-36f91bf237a2d48e27171c6661eff9cc255214d0.tar.gz
SledjHamr-36f91bf237a2d48e27171c6661eff9cc255214d0.tar.bz2
SledjHamr-36f91bf237a2d48e27171c6661eff9cc255214d0.tar.xz
Add function parameters to the search list.
Diffstat (limited to '')
-rw-r--r--LuaSL/src/LuaSL_LSL_tree.h33
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
230struct _LSL_Function 231struct _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
256typedef struct 258typedef 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
278void burnLeaf(void *data); 280void burnLeaf(void *data);
279LSL_Leaf *addFunction(LuaSL_compiler *compiler, LSL_Leaf *type, LSL_Leaf *identifier, LSL_Leaf *open, LSL_Leaf *params, LSL_Leaf *close, LSL_Leaf *block); 281LSL_Leaf *addFunction(LuaSL_compiler *compiler, LSL_Leaf *type, LSL_Leaf *identifier, LSL_Leaf *open, LSL_Leaf *params, LSL_Leaf *close);
282LSL_Leaf *addFunctionBody(LuaSL_compiler *compiler, LSL_Leaf *function, LSL_Leaf *block);
280LSL_Leaf *addOperation(LuaSL_compiler *compiler, LSL_Leaf *left, LSL_Leaf *lval, LSL_Leaf *right); 283LSL_Leaf *addOperation(LuaSL_compiler *compiler, LSL_Leaf *left, LSL_Leaf *lval, LSL_Leaf *right);
281LSL_Leaf *addParameter(LSL_Leaf *type, LSL_Leaf *newParam); 284LSL_Leaf *addParameter(LuaSL_compiler *compiler, LSL_Leaf *type, LSL_Leaf *newParam);
282LSL_Leaf *addParenthesis(LSL_Leaf *lval, LSL_Leaf *expr, LSL_Type type, LSL_Leaf *rval); 285LSL_Leaf *addParenthesis(LSL_Leaf *lval, LSL_Leaf *expr, LSL_Type type, LSL_Leaf *rval);
283LSL_Leaf *addState(LuaSL_compiler *compiler, LSL_Leaf *identifier, LSL_Leaf *block); 286LSL_Leaf *addState(LuaSL_compiler *compiler, LSL_Leaf *identifier, LSL_Leaf *block);
284LSL_Leaf *addStatement(LSL_Leaf *lval, LSL_Type type, LSL_Leaf *expr); 287LSL_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
288void beginBlock(LuaSL_compiler *compiler, LSL_Leaf *block); 291void beginBlock(LuaSL_compiler *compiler, LSL_Leaf *block);
289LSL_Leaf *checkVariable(LuaSL_compiler *compiler, LSL_Leaf *identifier); 292LSL_Leaf *checkVariable(LuaSL_compiler *compiler, LSL_Leaf *identifier);
290LSL_Leaf *collectParameters(LSL_Leaf *list, LSL_Leaf *comma, LSL_Leaf *newParam); 293LSL_Leaf *collectParameters(LuaSL_compiler *compiler, LSL_Leaf *list, LSL_Leaf *comma, LSL_Leaf *newParam);
291void endBlock(LuaSL_compiler *compiler, LSL_Leaf *block); 294void endBlock(LuaSL_compiler *compiler, LSL_Leaf *block);
292 295
293void *ParseAlloc(void *(*mallocProc)(size_t)); 296void *ParseAlloc(void *(*mallocProc)(size_t));