diff options
Diffstat (limited to '')
-rw-r--r-- | LuaSL/src/LuaSL_LSL_tree.h | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/LuaSL/src/LuaSL_LSL_tree.h b/LuaSL/src/LuaSL_LSL_tree.h index 2ef48ee..b87e7d2 100644 --- a/LuaSL/src/LuaSL_LSL_tree.h +++ b/LuaSL/src/LuaSL_LSL_tree.h | |||
@@ -3,7 +3,6 @@ | |||
3 | #define __LSL_TREE_H__ | 3 | #define __LSL_TREE_H__ |
4 | 4 | ||
5 | #define LUASL_DEBUG | 5 | #define LUASL_DEBUG |
6 | //#define LUASL_FILES | ||
7 | 6 | ||
8 | 7 | ||
9 | #include <stddef.h> // So we can have NULL defined. | 8 | #include <stddef.h> // So we can have NULL defined. |
@@ -264,44 +263,30 @@ struct _LSL_Script | |||
264 | LSL_Identifier *variables; | 263 | LSL_Identifier *variables; |
265 | }; | 264 | }; |
266 | 265 | ||
266 | // Define the type for flex and lemon. | ||
267 | #define YYSTYPE LSL_Leaf | ||
268 | |||
267 | typedef struct | 269 | typedef struct |
268 | { | 270 | { |
269 | char *ignorableText; | 271 | void *scanner; // This should be of type yyscan_t, which is typedef to void * anyway, but that does not get defined until LuaSL_lexer.h, which depends on this struct being defined first. |
270 | int column; | ||
271 | int line; | ||
272 | int argc; | 272 | int argc; |
273 | char **argv; | 273 | char **argv; |
274 | char *fileName; | 274 | char fileName[PATH_MAX]; |
275 | FILE *file; | 275 | FILE *file; |
276 | } LuaSL_yyparseExtra; | 276 | LSL_Leaf *ast; |
277 | 277 | char *ignorableText; | |
278 | 278 | LSL_Leaf *lval; | |
279 | // define the type for flex and lemon3 | 279 | int column; |
280 | #define YYSTYPE LSL_Leaf | 280 | int line; |
281 | } LuaSL_yyparseParam; | ||
281 | 282 | ||
282 | 283 | ||
283 | #ifndef excludeLexer | 284 | #ifndef excludeLexer |
284 | #include "LuaSL_lexer.h" | 285 | #include "LuaSL_lexer.h" |
285 | #endif | 286 | #endif |
286 | 287 | ||
287 | typedef struct | ||
288 | { | ||
289 | yyscan_t scanner; | ||
290 | LSL_Leaf *ast; | ||
291 | LSL_Leaf *lval; | ||
292 | } LuaSL_yyparseParam; | ||
293 | |||
294 | // the parameter name (of the reentrant 'yyparse' function) | ||
295 | // data is a pointer to a 'yyparseParam' structure | ||
296 | //#define YYPARSE_PARAM data | ||
297 | |||
298 | // the argument for the 'yylex' function | ||
299 | #define YYLEX_PARAM ((LuaSL_yyparseParam*)data)->scanner | ||
300 | //#define ParseTOKENTYPE YYSTYPE * | ||
301 | //#define ParseARG_PDECL , LuaSL_yyparseParam *param | ||
302 | 288 | ||
303 | void burnLeaf(LSL_Leaf *leaf); | 289 | void burnLeaf(LSL_Leaf *leaf); |
304 | int nextFile(LuaSL_yyparseExtra *extra); | ||
305 | LSL_Leaf *addExpression(LSL_Leaf *exp); | 290 | LSL_Leaf *addExpression(LSL_Leaf *exp); |
306 | LSL_Leaf *addOperation(LSL_Leaf *left, LSL_Leaf *lval, LSL_Leaf *right); | 291 | LSL_Leaf *addOperation(LSL_Leaf *left, LSL_Leaf *lval, LSL_Leaf *right); |
307 | LSL_Leaf *addParenthesis(LSL_Leaf *lval, LSL_Leaf *expr, LSL_Leaf *rval); | 292 | LSL_Leaf *addParenthesis(LSL_Leaf *lval, LSL_Leaf *expr, LSL_Leaf *rval); |