aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_LSL_tree.h
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-30 18:31:40 +1000
committerDavid Walter Seikel2012-01-30 18:31:40 +1000
commitfb7e642c4600f30b30e147eb5b91f0adc1f08f57 (patch)
tree3a025b675a972c3e7663b0fb6273e6c82ec0114a /LuaSL/src/LuaSL_LSL_tree.h
parentRemove the else if stuff, and empty function lists. Add the else precedence ... (diff)
downloadSledjHamr-fb7e642c4600f30b30e147eb5b91f0adc1f08f57.zip
SledjHamr-fb7e642c4600f30b30e147eb5b91f0adc1f08f57.tar.gz
SledjHamr-fb7e642c4600f30b30e147eb5b91f0adc1f08f57.tar.bz2
SledjHamr-fb7e642c4600f30b30e147eb5b91f0adc1f08f57.tar.xz
Add a new struct for tracking bits of text and the attached ignorable, then use it for names.
Diffstat (limited to '')
-rw-r--r--LuaSL/src/LuaSL_LSL_tree.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/LuaSL/src/LuaSL_LSL_tree.h b/LuaSL/src/LuaSL_LSL_tree.h
index 147ca5e..26e7ee8 100644
--- a/LuaSL/src/LuaSL_LSL_tree.h
+++ b/LuaSL/src/LuaSL_LSL_tree.h
@@ -38,6 +38,7 @@
38 38
39typedef struct _allowedTypes allowedTypes; 39typedef struct _allowedTypes allowedTypes;
40typedef struct _LSL_Token LSL_Token; 40typedef struct _LSL_Token LSL_Token;
41typedef struct _LSL_Text LSL_Text;
41typedef struct _LSL_Leaf LSL_Leaf; 42typedef struct _LSL_Leaf LSL_Leaf;
42typedef struct _LSL_Parenthesis LSL_Parenthesis; 43typedef struct _LSL_Parenthesis LSL_Parenthesis;
43typedef struct _LSL_Identifier LSL_Identifier; 44typedef struct _LSL_Identifier LSL_Identifier;
@@ -160,6 +161,14 @@ struct _LSL_Token
160 evaluateToken evaluate; 161 evaluateToken evaluate;
161}; 162};
162 163
164struct _LSL_Text
165{
166 const char *text;
167#if LUASL_DIFF_CHECK
168 Eina_Strbuf *ignorableText;
169#endif
170};
171
163struct _LSL_Leaf 172struct _LSL_Leaf
164{ 173{
165 LSL_Leaf *left; 174 LSL_Leaf *left;
@@ -201,8 +210,8 @@ struct _LSL_Parenthesis
201 210
202struct _LSL_Identifier // For variables and function parameters. 211struct _LSL_Identifier // For variables and function parameters.
203{ 212{
204 const char *name; 213 LSL_Text name;
205 LSL_Leaf value; 214 LSL_Leaf value;
206}; 215};
207 216
208struct _LSL_Statement 217struct _LSL_Statement
@@ -246,10 +255,10 @@ struct _LSL_Block
246 255
247struct _LSL_Function 256struct _LSL_Function
248{ 257{
249 const char *name; 258 LSL_Text name;
250 LSL_Leaf *type; 259 LSL_Leaf *type;
251#if LUASL_DIFF_CHECK 260#if LUASL_DIFF_CHECK
252 LSL_Leaf *params; // So we store the parenthesis, and their ignorables. 261// LSL_Leaf *params; // So we store the parenthesis, and their ignorables.
253 // This points to the params leaf, which is a function, pointing to this structure. The actual params are in vars. 262 // This points to the params leaf, which is a function, pointing to this structure. The actual params are in vars.
254#endif 263#endif
255 Eina_Inarray vars; // Eina Inarray has not been released yet (Eina 1.2). 264 Eina_Inarray vars; // Eina Inarray has not been released yet (Eina 1.2).
@@ -266,7 +275,8 @@ struct _LSL_FunctionCall
266 275
267struct _LSL_State 276struct _LSL_State
268{ 277{
269 const char *name; 278 LSL_Text name;
279 LSL_Text state;
270 LSL_Leaf *block; 280 LSL_Leaf *block;
271 Eina_Hash *handlers; 281 Eina_Hash *handlers;
272}; 282};
@@ -382,7 +392,7 @@ LSL_Leaf *addFunctionCall(LuaSL_compiler *compiler, LSL_Leaf *identifier, LSL_Le
382LSL_Leaf *addOperation(LuaSL_compiler *compiler, LSL_Leaf *left, LSL_Leaf *lval, LSL_Leaf *right); 392LSL_Leaf *addOperation(LuaSL_compiler *compiler, LSL_Leaf *left, LSL_Leaf *lval, LSL_Leaf *right);
383LSL_Leaf *addParameter(LuaSL_compiler *compiler, LSL_Leaf *type, LSL_Leaf *newParam); 393LSL_Leaf *addParameter(LuaSL_compiler *compiler, LSL_Leaf *type, LSL_Leaf *newParam);
384LSL_Leaf *addParenthesis(LSL_Leaf *lval, LSL_Leaf *expr, LSL_Type type, LSL_Leaf *rval); 394LSL_Leaf *addParenthesis(LSL_Leaf *lval, LSL_Leaf *expr, LSL_Type type, LSL_Leaf *rval);
385LSL_Leaf *addState(LuaSL_compiler *compiler, LSL_Leaf *identifier, LSL_Leaf *block); 395LSL_Leaf *addState(LuaSL_compiler *compiler, LSL_Leaf *state, LSL_Leaf *identifier, LSL_Leaf *block);
386LSL_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); 396LSL_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);
387LSL_Leaf *addTypecast(LSL_Leaf *lval, LSL_Leaf *type, LSL_Leaf *rval, LSL_Leaf *expr); 397LSL_Leaf *addTypecast(LSL_Leaf *lval, LSL_Leaf *type, LSL_Leaf *rval, LSL_Leaf *expr);
388LSL_Leaf *addVariable(LuaSL_compiler *compiler, LSL_Leaf *type, LSL_Leaf *identifier, LSL_Leaf *assignment, LSL_Leaf *expr); 398LSL_Leaf *addVariable(LuaSL_compiler *compiler, LSL_Leaf *type, LSL_Leaf *identifier, LSL_Leaf *assignment, LSL_Leaf *expr);