From 737e7f59330532755167a222d4d52bb8cc2d6009 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 15 Jan 2012 23:47:53 +1000 Subject: Get multi file parsing working. --- LuaSL/src/LuaSL_LSL_tree.h | 37 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) (limited to 'LuaSL/src/LuaSL_LSL_tree.h') 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 @@ #define __LSL_TREE_H__ #define LUASL_DEBUG -//#define LUASL_FILES #include // So we can have NULL defined. @@ -264,44 +263,30 @@ struct _LSL_Script LSL_Identifier *variables; }; +// Define the type for flex and lemon. +#define YYSTYPE LSL_Leaf + typedef struct { - char *ignorableText; - int column; - int line; + 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. int argc; char **argv; - char *fileName; + char fileName[PATH_MAX]; FILE *file; -} LuaSL_yyparseExtra; - - -// define the type for flex and lemon3 -#define YYSTYPE LSL_Leaf + LSL_Leaf *ast; + char *ignorableText; + LSL_Leaf *lval; + int column; + int line; +} LuaSL_yyparseParam; #ifndef excludeLexer #include "LuaSL_lexer.h" #endif -typedef struct -{ - yyscan_t scanner; - LSL_Leaf *ast; - LSL_Leaf *lval; -} LuaSL_yyparseParam; - -// the parameter name (of the reentrant 'yyparse' function) -// data is a pointer to a 'yyparseParam' structure -//#define YYPARSE_PARAM data - -// the argument for the 'yylex' function -#define YYLEX_PARAM ((LuaSL_yyparseParam*)data)->scanner -//#define ParseTOKENTYPE YYSTYPE * -//#define ParseARG_PDECL , LuaSL_yyparseParam *param void burnLeaf(LSL_Leaf *leaf); -int nextFile(LuaSL_yyparseExtra *extra); LSL_Leaf *addExpression(LSL_Leaf *exp); LSL_Leaf *addOperation(LSL_Leaf *left, LSL_Leaf *lval, LSL_Leaf *right); LSL_Leaf *addParenthesis(LSL_Leaf *lval, LSL_Leaf *expr, LSL_Leaf *rval); -- cgit v1.1