aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_LSL_tree.h
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-21 18:50:51 +1000
committerDavid Walter Seikel2012-01-21 18:50:51 +1000
commit4ef9d7848f126f1c982a5aae7cb27e18ab2b8aa3 (patch)
treee987c5bcc2e5b7f639aea24d1e4f60511c3afd02 /LuaSL/src/LuaSL_LSL_tree.h
parentStandardise error messages. (diff)
downloadSledjHamr-4ef9d7848f126f1c982a5aae7cb27e18ab2b8aa3.zip
SledjHamr-4ef9d7848f126f1c982a5aae7cb27e18ab2b8aa3.tar.gz
SledjHamr-4ef9d7848f126f1c982a5aae7cb27e18ab2b8aa3.tar.bz2
SledjHamr-4ef9d7848f126f1c982a5aae7cb27e18ab2b8aa3.tar.xz
More function call, and first part of dealing with using functions before declaring them.
Diffstat (limited to '')
-rw-r--r--LuaSL/src/LuaSL_LSL_tree.h75
1 files changed, 44 insertions, 31 deletions
diff --git a/LuaSL/src/LuaSL_LSL_tree.h b/LuaSL/src/LuaSL_LSL_tree.h
index 21fc696..d537948 100644
--- a/LuaSL/src/LuaSL_LSL_tree.h
+++ b/LuaSL/src/LuaSL_LSL_tree.h
@@ -29,16 +29,17 @@
29// http://w-hat.com/stackdepth is a useful discussion about some aspects of the LL parser. 29// http://w-hat.com/stackdepth is a useful discussion about some aspects of the LL parser.
30 30
31 31
32typedef struct _allowedTypes allowedTypes; 32typedef struct _allowedTypes allowedTypes;
33typedef struct _LSL_Token LSL_Token; 33typedef struct _LSL_Token LSL_Token;
34typedef struct _LSL_Leaf LSL_Leaf; 34typedef struct _LSL_Leaf LSL_Leaf;
35typedef struct _LSL_Parenthesis LSL_Parenthesis; 35typedef struct _LSL_Parenthesis LSL_Parenthesis;
36typedef struct _LSL_Identifier LSL_Identifier; 36typedef struct _LSL_Identifier LSL_Identifier;
37typedef struct _LSL_Statement LSL_Statement; 37typedef struct _LSL_Statement LSL_Statement;
38typedef struct _LSL_Block LSL_Block; 38typedef struct _LSL_Block LSL_Block;
39typedef struct _LSL_Function LSL_Function; 39typedef struct _LSL_Function LSL_Function;
40typedef struct _LSL_State LSL_State; 40typedef struct _LSL_FunctionCall LSL_FunctionCall;
41typedef struct _LSL_Script LSL_Script; 41typedef struct _LSL_State LSL_State;
42typedef struct _LSL_Script LSL_Script;
42 43
43extern LSL_Token **tokens; 44extern LSL_Token **tokens;
44extern int lowestToken; 45extern int lowestToken;
@@ -108,6 +109,7 @@ typedef enum
108 OT_vectorRotation, 109 OT_vectorRotation,
109 OT_rotationRotation, 110 OT_rotationRotation,
110 OT_otherOther, 111 OT_otherOther,
112 OT_undeclared,
111 OT_invalid 113 OT_invalid
112} opType; 114} opType;
113 115
@@ -148,30 +150,31 @@ struct _LSL_Token
148 150
149struct _LSL_Leaf 151struct _LSL_Leaf
150{ 152{
151 LSL_Leaf *left; 153 LSL_Leaf *left;
152 LSL_Leaf *right; 154 LSL_Leaf *right;
153 LSL_Token *token; 155 LSL_Token *token;
154#ifdef LUASL_DIFF_CHECK 156#ifdef LUASL_DIFF_CHECK
155 Eina_Strbuf *ignorableText; 157 Eina_Strbuf *ignorableText;
156#endif 158#endif
157 int line, column, len; 159 int line, column, len;
158 opType basicType; 160 opType basicType;
159 union 161 union
160 { 162 {
161 float floatValue; 163 float floatValue;
162 float vectorValue[3]; 164 float vectorValue[3];
163 float rotationValue[4]; 165 float rotationValue[4];
164 int integerValue; 166 int integerValue;
165 LSL_Leaf *listValue; 167 LSL_Leaf *listValue;
166 const char *stringValue; 168 const char *stringValue;
167 opType operationValue; 169 opType operationValue;
168 LSL_Parenthesis *parenthesis; 170 LSL_Parenthesis *parenthesis;
169 LSL_Identifier *identifierValue; 171 LSL_Identifier *identifierValue;
170 LSL_Statement *statementValue; 172 LSL_Statement *statementValue;
171 LSL_Block *blockValue; 173 LSL_Block *blockValue;
172 LSL_Function *functionValue; 174 LSL_Function *functionValue;
173 LSL_State *stateValue; 175 LSL_FunctionCall *functionCallValue;
174 LSL_Script *scriptValue; 176 LSL_State *stateValue;
177 LSL_Script *scriptValue;
175 } value; 178 } value;
176}; 179};
177 180
@@ -216,6 +219,14 @@ struct _LSL_Function
216 LSL_Leaf *block; 219 LSL_Leaf *block;
217}; 220};
218 221
222struct _LSL_FunctionCall
223{
224 LSL_Function *function;
225 Eina_Inarray params; // Eina Inarray has not been released yet (Eina 1.2).
226 Eina_Clist functionCall;
227 LSL_Leaf *call;
228};
229
219struct _LSL_State 230struct _LSL_State
220{ 231{
221 const char *name; 232 const char *name;
@@ -312,8 +323,10 @@ typedef struct
312 Eina_Strbuf *ignorableText; 323 Eina_Strbuf *ignorableText;
313#endif 324#endif
314 LSL_Leaf *lval; 325 LSL_Leaf *lval;
315 int column, line;
316 LSL_Block *currentBlock; 326 LSL_Block *currentBlock;
327 Eina_Clist danglingCalls;
328 int column, line;
329 int undeclared;
317} LuaSL_compiler; 330} LuaSL_compiler;
318 331
319 332