diff options
author | David Walter Seikel | 2012-01-05 10:10:50 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-05 10:10:50 +1000 |
commit | 4475fbd8d0c40f42aa7e14ccb5fbec59b31e4b4c (patch) | |
tree | 11d891ba341cf108b1a9d432ec5b2e41b7a3796a /LuaSL/src/LuaSL_LSL_tree.h | |
parent | Bit more cleanup. (diff) | |
download | SledjHamr-4475fbd8d0c40f42aa7e14ccb5fbec59b31e4b4c.zip SledjHamr-4475fbd8d0c40f42aa7e14ccb5fbec59b31e4b4c.tar.gz SledjHamr-4475fbd8d0c40f42aa7e14ccb5fbec59b31e4b4c.tar.bz2 SledjHamr-4475fbd8d0c40f42aa7e14ccb5fbec59b31e4b4c.tar.xz |
Consolidate the parser includes.
Diffstat (limited to '')
-rw-r--r-- | LuaSL/src/LuaSL_LSL_tree.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/LuaSL/src/LuaSL_LSL_tree.h b/LuaSL/src/LuaSL_LSL_tree.h index 71d372e..9c27a8f 100644 --- a/LuaSL/src/LuaSL_LSL_tree.h +++ b/LuaSL/src/LuaSL_LSL_tree.h | |||
@@ -4,6 +4,11 @@ | |||
4 | #ifndef __EXPRESSION_H__ | 4 | #ifndef __EXPRESSION_H__ |
5 | #define __EXPRESSION_H__ | 5 | #define __EXPRESSION_H__ |
6 | 6 | ||
7 | #ifndef YY_NO_UNISTD_H | ||
8 | #define YY_NO_UNISTD_H 1 | ||
9 | #endif // YY_NO_UNISTD_H | ||
10 | |||
11 | |||
7 | /** | 12 | /** |
8 | * @brief The operation type | 13 | * @brief The operation type |
9 | */ | 14 | */ |
@@ -27,6 +32,57 @@ typedef struct tagSExpression | |||
27 | } SExpression; | 32 | } SExpression; |
28 | 33 | ||
29 | /** | 34 | /** |
35 | * @brief The structure used by flex and bison | ||
36 | */ | ||
37 | typedef union tagTypeParser | ||
38 | { | ||
39 | SExpression *expression; | ||
40 | int value; | ||
41 | int ival; | ||
42 | float fval; | ||
43 | char *sval; | ||
44 | // class LLScriptType *type; | ||
45 | // class LLScriptConstant *constant; | ||
46 | // class LLScriptIdentifier *identifier; | ||
47 | // class LLScriptSimpleAssignable *assignable; | ||
48 | // class LLScriptGlobalVariable *global; | ||
49 | // class LLScriptEvent *event; | ||
50 | // class LLScriptEventHandler *handler; | ||
51 | // class LLScriptExpression *expression; | ||
52 | // class LLScriptStatement *statement; | ||
53 | // class LLScriptGlobalFunctions *global_funcs; | ||
54 | // class LLScriptFunctionDec *global_decl; | ||
55 | // class LLScriptState *state; | ||
56 | // class LLScritpGlobalStorage *global_store; | ||
57 | // class LLScriptScript *script; | ||
58 | }STypeParser; | ||
59 | |||
60 | // define the type for flex and bison | ||
61 | #define YYSTYPE STypeParser | ||
62 | |||
63 | |||
64 | #ifndef excludeLexer | ||
65 | #include "LuaSL_lexer.h" | ||
66 | #endif | ||
67 | |||
68 | |||
69 | /** | ||
70 | * @brief structure given as argument to the reentrant 'yyparse' function. | ||
71 | */ | ||
72 | typedef struct tagSParserParam | ||
73 | { | ||
74 | yyscan_t scanner; | ||
75 | SExpression *expression; | ||
76 | }SParserParam; | ||
77 | |||
78 | // the parameter name (of the reentrant 'yyparse' function) | ||
79 | // data is a pointer to a 'SParserParam' structure | ||
80 | #define YYPARSE_PARAM data | ||
81 | |||
82 | // the argument for the 'yylex' function | ||
83 | #define YYLEX_PARAM ((SParserParam*)data)->scanner | ||
84 | |||
85 | /** | ||
30 | * @brief It creates an identifier | 86 | * @brief It creates an identifier |
31 | * @param value The number value | 87 | * @param value The number value |
32 | * @return The expression or NULL in case of no memory | 88 | * @return The expression or NULL in case of no memory |
@@ -55,5 +111,8 @@ int evaluate(SExpression *e); | |||
55 | int yyerror(const char *msg); | 111 | int yyerror(const char *msg); |
56 | int yyparse(void *param); | 112 | int yyparse(void *param); |
57 | 113 | ||
114 | #include "LuaSL_yaccer.tab.h" | ||
115 | |||
116 | |||
58 | #endif // __EXPRESSION_H__ | 117 | #endif // __EXPRESSION_H__ |
59 | 118 | ||