aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_LSL_tree.h
diff options
context:
space:
mode:
Diffstat (limited to 'LuaSL/src/LuaSL_LSL_tree.h')
-rw-r--r--LuaSL/src/LuaSL_LSL_tree.h50
1 files changed, 24 insertions, 26 deletions
diff --git a/LuaSL/src/LuaSL_LSL_tree.h b/LuaSL/src/LuaSL_LSL_tree.h
index a5d090e..7973509 100644
--- a/LuaSL/src/LuaSL_LSL_tree.h
+++ b/LuaSL/src/LuaSL_LSL_tree.h
@@ -8,6 +8,8 @@
8#define YY_NO_UNISTD_H 1 8#define YY_NO_UNISTD_H 1
9#endif // YY_NO_UNISTD_H 9#endif // YY_NO_UNISTD_H
10 10
11#include "LuaSL_yaccer.tab.h"
12
11// http://w-hat.com/stackdepth is a useful discussion about some aspects of the LL parser. 13// http://w-hat.com/stackdepth is a useful discussion about some aspects of the LL parser.
12 14
13typedef enum 15typedef enum
@@ -20,6 +22,7 @@ typedef enum
20 LSL_CREATION = 16 22 LSL_CREATION = 16
21} LSL_Flags; 23} LSL_Flags;
22 24
25/*
23typedef enum // In order of precedence, high to low. 26typedef enum // In order of precedence, high to low.
24 // Left to right, unless oterwise stated. 27 // Left to right, unless oterwise stated.
25 // According to http://wiki.secondlife.com/wiki/Category:LSL_Operators 28 // According to http://wiki.secondlife.com/wiki/Category:LSL_Operators
@@ -69,6 +72,9 @@ typedef enum // In order of precedence, high to low.
69 LSL_BOOL_OR, 72 LSL_BOOL_OR,
70 LSL_BOOL_AND 73 LSL_BOOL_AND
71} LSL_Operation; 74} LSL_Operation;
75*/
76
77typedef int LSL_Operation;
72 78
73typedef struct 79typedef struct
74{ 80{
@@ -131,6 +137,7 @@ LSL_Operator LSL_Tokens[] =
131}; 137};
132#endif 138#endif
133 139
140/*
134typedef enum 141typedef enum
135{ 142{
136 LSL_COMMENT, 143 LSL_COMMENT,
@@ -162,6 +169,11 @@ typedef enum
162 LSL_STATE, 169 LSL_STATE,
163 LSL_SCRIPT 170 LSL_SCRIPT
164} LSL_Type; 171} LSL_Type;
172*/
173
174typedef int LSL_Type;
175#define LSL_EXPRESSION 1
176
165 177
166#ifdef LSL_Keywords_define 178#ifdef LSL_Keywords_define
167char *LSL_Keywords[] = 179char *LSL_Keywords[] =
@@ -285,29 +297,6 @@ typedef union LSL_Leaf
285 LSL_Function *functionValue; 297 LSL_Function *functionValue;
286 LSL_State *stateValue; 298 LSL_State *stateValue;
287 LSL_Script *scriptValue; 299 LSL_Script *scriptValue;
288} LSL_Leaf;
289
290typedef struct LSL_AST
291{
292 struct LSL_AST *left;
293 struct LSL_AST *right;
294 int line;
295 int character;
296 LSL_Type type;
297 LSL_Leaf content;
298} LSL_AST;
299
300
301/**
302 * @brief The structure used by flex and bison
303 */
304//typedef union tagTypeParser
305//{
306// SExpression *expression;
307// int value;
308// int ival;
309// float fval;
310// char *sval;
311// class LLScriptType *type; 300// class LLScriptType *type;
312// class LLScriptConstant *constant; 301// class LLScriptConstant *constant;
313// class LLScriptIdentifier *identifier; 302// class LLScriptIdentifier *identifier;
@@ -322,7 +311,18 @@ typedef struct LSL_AST
322// class LLScriptState *state; 311// class LLScriptState *state;
323// class LLScritpGlobalStorage *global_store; 312// class LLScritpGlobalStorage *global_store;
324// class LLScriptScript *script; 313// class LLScriptScript *script;
325//}STypeParser; 314} LSL_Leaf;
315
316typedef struct LSL_AST
317{
318 struct LSL_AST *left;
319 struct LSL_AST *right;
320 int line;
321 int character;
322 LSL_Type type;
323 LSL_Leaf content;
324} LSL_AST;
325
326 326
327// define the type for flex and bison 327// define the type for flex and bison
328#define YYSTYPE LSL_Leaf 328#define YYSTYPE LSL_Leaf
@@ -359,8 +359,6 @@ void convertExpression2Lua(LSL_Expression *exp);
359int yyerror(const char *msg); 359int yyerror(const char *msg);
360int yyparse(void *param); 360int yyparse(void *param);
361 361
362#include "LuaSL_yaccer.tab.h"
363
364 362
365#endif // __EXPRESSION_H__ 363#endif // __EXPRESSION_H__
366 364