aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_LSL_tree.h
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-28 14:54:41 +1000
committerDavid Walter Seikel2012-01-28 14:54:41 +1000
commit0d060b7ef6ea3cdd3ae505f41826d96d3ca12070 (patch)
tree32b477bc406dd30ed119e5f1de97ea1750ff4353 /LuaSL/src/LuaSL_LSL_tree.h
parentDocument the other Clist use, and change it's name while I'm at it. (diff)
downloadSledjHamr-0d060b7ef6ea3cdd3ae505f41826d96d3ca12070.zip
SledjHamr-0d060b7ef6ea3cdd3ae505f41826d96d3ca12070.tar.gz
SledjHamr-0d060b7ef6ea3cdd3ae505f41826d96d3ca12070.tar.bz2
SledjHamr-0d060b7ef6ea3cdd3ae505f41826d96d3ca12070.tar.xz
Add some of the flow control stuff, still needs lots of work.
Diffstat (limited to '')
-rw-r--r--LuaSL/src/LuaSL_LSL_tree.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/LuaSL/src/LuaSL_LSL_tree.h b/LuaSL/src/LuaSL_LSL_tree.h
index f2fccd0..349d74f 100644
--- a/LuaSL/src/LuaSL_LSL_tree.h
+++ b/LuaSL/src/LuaSL_LSL_tree.h
@@ -179,7 +179,7 @@ struct _LSL_Leaf
179 LSL_Leaf *listValue; 179 LSL_Leaf *listValue;
180 const char *stringValue; 180 const char *stringValue;
181 opType operationValue; 181 opType operationValue;
182 LSL_Parenthesis *parenthesis; 182 LSL_Parenthesis *parenthesis;
183 LSL_Identifier *identifierValue; 183 LSL_Identifier *identifierValue;
184 LSL_Statement *statementValue; 184 LSL_Statement *statementValue;
185 LSL_Block *blockValue; 185 LSL_Block *blockValue;
@@ -208,17 +208,21 @@ struct _LSL_Identifier // For variables and function parameters.
208struct _LSL_Statement 208struct _LSL_Statement
209{ 209{
210 Eina_Clist statement; // For block statement lists, this is the entry. 210 Eina_Clist statement; // For block statement lists, this is the entry.
211 union 211// union
212 { 212// {
213 LSL_Identifier *identifier; 213 LSL_Identifier *identifier;
214 LSL_Parenthesis *parenthesis; 214 LSL_Parenthesis *parenthesis;
215 } stuff; // Nothing has an identifier AND parenthesis, and there will be LOTS of statements, so save some space. 215// } stuff; // Nothing has an identifier AND parenthesis, and there will be LOTS of statements, so save some space.
216 // Damn, function identifiers do.
216 LSL_Leaf *expressions; // A for statement will have three expressions, everything else has zero or one. 217 LSL_Leaf *expressions; // A for statement will have three expressions, everything else has zero or one.
217 LSL_Block *block; 218 LSL_Leaf *block;
218 LSL_Type type; // Expression type. 219 LSL_Type type; // Expression type.
219/* 220/*
220expr expr 221LSL_Leaf *addStatement(LSL_Leaf *lval, LSL_Type type, LSL_Leaf *left, LSL_Leaf *expr, LSL_Leaf *right, LSL_Leaf *block);
221Variable defines identifier, optional expr 222
223expr expr // Might be bogus,
224Variable defines identifier, optional expr // For these we only store the variable leaf in expressions.
225Function define identifier, block, parens // Also function params, but that's stored in the function anyway.
222state change identifier 226state change identifier
223Labels identifier 227Labels identifier
224goto identifier 228goto identifier
@@ -376,7 +380,7 @@ LSL_Leaf *addOperation(LuaSL_compiler *compiler, LSL_Leaf *left, LSL_Leaf *lval,
376LSL_Leaf *addParameter(LuaSL_compiler *compiler, LSL_Leaf *type, LSL_Leaf *newParam); 380LSL_Leaf *addParameter(LuaSL_compiler *compiler, LSL_Leaf *type, LSL_Leaf *newParam);
377LSL_Leaf *addParenthesis(LSL_Leaf *lval, LSL_Leaf *expr, LSL_Type type, LSL_Leaf *rval); 381LSL_Leaf *addParenthesis(LSL_Leaf *lval, LSL_Leaf *expr, LSL_Type type, LSL_Leaf *rval);
378LSL_Leaf *addState(LuaSL_compiler *compiler, LSL_Leaf *identifier, LSL_Leaf *block); 382LSL_Leaf *addState(LuaSL_compiler *compiler, LSL_Leaf *identifier, LSL_Leaf *block);
379LSL_Leaf *addStatement(LSL_Leaf *lval, LSL_Type type, LSL_Leaf *expr); 383LSL_Leaf *addStatement(LuaSL_compiler *compiler, LSL_Leaf *lval, LSL_Type type, LSL_Leaf *left, LSL_Leaf *expr, LSL_Leaf *right, LSL_Leaf *block, LSL_Leaf *identifier);
380LSL_Leaf *addTypecast(LSL_Leaf *lval, LSL_Leaf *type, LSL_Leaf *rval, LSL_Leaf *expr); 384LSL_Leaf *addTypecast(LSL_Leaf *lval, LSL_Leaf *type, LSL_Leaf *rval, LSL_Leaf *expr);
381LSL_Leaf *addVariable(LuaSL_compiler *compiler, LSL_Leaf *type, LSL_Leaf *identifier, LSL_Leaf *assignment, LSL_Leaf *expr); 385LSL_Leaf *addVariable(LuaSL_compiler *compiler, LSL_Leaf *type, LSL_Leaf *identifier, LSL_Leaf *assignment, LSL_Leaf *expr);
382 386