diff options
Diffstat (limited to '')
-rw-r--r-- | LuaSL/src/LuaSL_LSL_tree.h | 88 |
1 files changed, 46 insertions, 42 deletions
diff --git a/LuaSL/src/LuaSL_LSL_tree.h b/LuaSL/src/LuaSL_LSL_tree.h index adefa07..fe56c29 100644 --- a/LuaSL/src/LuaSL_LSL_tree.h +++ b/LuaSL/src/LuaSL_LSL_tree.h | |||
@@ -20,7 +20,7 @@ extern int yydebug; | |||
20 | // http://w-hat.com/stackdepth is a useful discussion about some aspects of the LL parser. | 20 | // http://w-hat.com/stackdepth is a useful discussion about some aspects of the LL parser. |
21 | 21 | ||
22 | 22 | ||
23 | typedef union _LSL_Leaf LSL_Leaf; | 23 | typedef struct _LSL_Leaf LSL_Leaf; |
24 | typedef struct _LSL_Value LSL_Value; | 24 | typedef struct _LSL_Value LSL_Value; |
25 | typedef struct _LSL_Identifier LSL_Identifier; | 25 | typedef struct _LSL_Identifier LSL_Identifier; |
26 | typedef struct _LSL_Statement LSL_Statement; | 26 | typedef struct _LSL_Statement LSL_Statement; |
@@ -65,43 +65,48 @@ typedef struct | |||
65 | evaluateToken evaluate; | 65 | evaluateToken evaluate; |
66 | } LSL_Token; | 66 | } LSL_Token; |
67 | 67 | ||
68 | union _LSL_Leaf | 68 | struct _LSL_Leaf |
69 | { | 69 | { |
70 | char *commentValue; | 70 | union |
71 | char *spaceValue; | 71 | { |
72 | 72 | char *commentValue; | |
73 | LSL_Type operationValue; | 73 | char *spaceValue; |
74 | LSL_AST *expressionValue; | 74 | |
75 | 75 | LSL_Type operationValue; | |
76 | float floatValue; | 76 | LSL_AST *expressionValue; |
77 | int integerValue; | 77 | |
78 | char *keyValue; | 78 | float floatValue; |
79 | LSL_Leaf *listValue; | 79 | int integerValue; |
80 | char *stringValue; | 80 | char *keyValue; |
81 | float vectorValue[3]; | 81 | LSL_Leaf *listValue; |
82 | float rotationValue[4]; | 82 | char *stringValue; |
83 | 83 | float vectorValue[3]; | |
84 | LSL_Identifier *variableValue; | 84 | float rotationValue[4]; |
85 | 85 | ||
86 | char *labelValue; | 86 | LSL_Identifier *variableValue; |
87 | LSL_Statement *doValue; | 87 | |
88 | LSL_Statement *forValue; | 88 | char *labelValue; |
89 | LSL_Statement *elseIfValue; | 89 | LSL_Statement *doValue; |
90 | LSL_Statement *elseValue; | 90 | LSL_Statement *forValue; |
91 | LSL_Statement *ifValue; | 91 | LSL_Statement *elseIfValue; |
92 | char *jumpValue; | 92 | LSL_Statement *elseValue; |
93 | LSL_Statement *returnValue; | 93 | LSL_Statement *ifValue; |
94 | char *stateChangeValue; | 94 | char *jumpValue; |
95 | LSL_Statement *whileValue; | 95 | LSL_Statement *returnValue; |
96 | LSL_Statement *statementValue; | 96 | char *stateChangeValue; |
97 | 97 | LSL_Statement *whileValue; | |
98 | LSL_Block *blockValue; | 98 | LSL_Statement *statementValue; |
99 | LSL_Identifier *parameterValue; | 99 | |
100 | LSL_Function *functionValue; | 100 | LSL_Block *blockValue; |
101 | LSL_State *stateValue; | 101 | LSL_Identifier *parameterValue; |
102 | LSL_Script *scriptValue; | 102 | LSL_Function *functionValue; |
103 | 103 | LSL_State *stateValue; | |
104 | char *unknownValue; | 104 | LSL_Script *scriptValue; |
105 | |||
106 | char *unknownValue; | ||
107 | } value; | ||
108 | char *ignorableText; | ||
109 | int line, column; | ||
105 | }; | 110 | }; |
106 | 111 | ||
107 | struct _LSL_Value | 112 | struct _LSL_Value |
@@ -176,7 +181,7 @@ typedef struct | |||
176 | } LuaSL_yyparseParam; | 181 | } LuaSL_yyparseParam; |
177 | 182 | ||
178 | // the parameter name (of the reentrant 'yyparse' function) | 183 | // the parameter name (of the reentrant 'yyparse' function) |
179 | // data is a pointer to a 'SParserParam' structure | 184 | // data is a pointer to a 'yyparseParam' structure |
180 | #define YYPARSE_PARAM data | 185 | #define YYPARSE_PARAM data |
181 | 186 | ||
182 | // the argument for the 'yylex' function | 187 | // the argument for the 'yylex' function |
@@ -184,12 +189,11 @@ typedef struct | |||
184 | 189 | ||
185 | 190 | ||
186 | LSL_AST *addExpression(LSL_AST *exp); | 191 | LSL_AST *addExpression(LSL_AST *exp); |
187 | LSL_AST *addInteger(int value); | 192 | LSL_AST *addInteger(LSL_Leaf *lval, int value); |
188 | LSL_AST *addOperation(LSL_Type type, LSL_AST *left, LSL_AST *right); | 193 | LSL_AST *addOperation(LSL_Leaf *lval, LSL_Type type, LSL_AST *left, LSL_AST *right); |
189 | LSL_AST *addParenthesis(LSL_AST *expr); | 194 | LSL_AST *addParenthesis(LSL_Leaf *lval, LSL_AST *expr); |
190 | LSL_Statement *createStatement(LSL_Type type, LSL_AST *root); | 195 | LSL_Statement *createStatement(LSL_Type type, LSL_AST *root); |
191 | LSL_AST *addStatement(LSL_Statement *statement, LSL_AST *root); | 196 | LSL_AST *addStatement(LSL_Statement *statement, LSL_AST *root); |
192 | LSL_AST *addSpace(char *text, LSL_AST *root); | ||
193 | 197 | ||
194 | int yyerror(const char *msg); | 198 | int yyerror(const char *msg); |
195 | int yyparse(void *param); | 199 | int yyparse(void *param); |