diff options
Diffstat (limited to '')
-rw-r--r-- | LuaSL/src/LuaSL_LSL_tree.h | 20 |
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. | |||
208 | struct _LSL_Statement | 208 | struct _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 | /* |
220 | expr expr | 221 | LSL_Leaf *addStatement(LSL_Leaf *lval, LSL_Type type, LSL_Leaf *left, LSL_Leaf *expr, LSL_Leaf *right, LSL_Leaf *block); |
221 | Variable defines identifier, optional expr | 222 | |
223 | expr expr // Might be bogus, | ||
224 | Variable defines identifier, optional expr // For these we only store the variable leaf in expressions. | ||
225 | Function define identifier, block, parens // Also function params, but that's stored in the function anyway. | ||
222 | state change identifier | 226 | state change identifier |
223 | Labels identifier | 227 | Labels identifier |
224 | goto identifier | 228 | goto identifier |
@@ -376,7 +380,7 @@ LSL_Leaf *addOperation(LuaSL_compiler *compiler, LSL_Leaf *left, LSL_Leaf *lval, | |||
376 | LSL_Leaf *addParameter(LuaSL_compiler *compiler, LSL_Leaf *type, LSL_Leaf *newParam); | 380 | LSL_Leaf *addParameter(LuaSL_compiler *compiler, LSL_Leaf *type, LSL_Leaf *newParam); |
377 | LSL_Leaf *addParenthesis(LSL_Leaf *lval, LSL_Leaf *expr, LSL_Type type, LSL_Leaf *rval); | 381 | LSL_Leaf *addParenthesis(LSL_Leaf *lval, LSL_Leaf *expr, LSL_Type type, LSL_Leaf *rval); |
378 | LSL_Leaf *addState(LuaSL_compiler *compiler, LSL_Leaf *identifier, LSL_Leaf *block); | 382 | LSL_Leaf *addState(LuaSL_compiler *compiler, LSL_Leaf *identifier, LSL_Leaf *block); |
379 | LSL_Leaf *addStatement(LSL_Leaf *lval, LSL_Type type, LSL_Leaf *expr); | 383 | LSL_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); |
380 | LSL_Leaf *addTypecast(LSL_Leaf *lval, LSL_Leaf *type, LSL_Leaf *rval, LSL_Leaf *expr); | 384 | LSL_Leaf *addTypecast(LSL_Leaf *lval, LSL_Leaf *type, LSL_Leaf *rval, LSL_Leaf *expr); |
381 | LSL_Leaf *addVariable(LuaSL_compiler *compiler, LSL_Leaf *type, LSL_Leaf *identifier, LSL_Leaf *assignment, LSL_Leaf *expr); | 385 | LSL_Leaf *addVariable(LuaSL_compiler *compiler, LSL_Leaf *type, LSL_Leaf *identifier, LSL_Leaf *assignment, LSL_Leaf *expr); |
382 | 386 | ||