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.h59
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 */
37typedef 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 */
72typedef 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);
55int yyerror(const char *msg); 111int yyerror(const char *msg);
56int yyparse(void *param); 112int yyparse(void *param);
57 113
114#include "LuaSL_yaccer.tab.h"
115
116
58#endif // __EXPRESSION_H__ 117#endif // __EXPRESSION_H__
59 118