aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_parser_param.h
diff options
context:
space:
mode:
Diffstat (limited to 'LuaSL/src/LuaSL_parser_param.h')
-rw-r--r--LuaSL/src/LuaSL_parser_param.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/LuaSL/src/LuaSL_parser_param.h b/LuaSL/src/LuaSL_parser_param.h
new file mode 100644
index 0000000..944a671
--- /dev/null
+++ b/LuaSL/src/LuaSL_parser_param.h
@@ -0,0 +1,38 @@
1/*
2 * ParserParam.h
3 * Definitions of the parameters for the reentrant functions
4 * of flex (yylex) and bison (yyparse)
5 */
6
7// Since in this sample we use the reentrant version of both flex and yacc we are forced to provide parameters for the yylex function, when called from yyparse.
8
9#ifndef __PARSERPARAM_H__
10#define __PARSERPARAM_H__
11
12#ifndef YY_NO_UNISTD_H
13#define YY_NO_UNISTD_H 1
14#endif // YY_NO_UNISTD_H
15
16#include "LuaSL_type_parser.h"
17#include "LuaSL_lexer.h"
18#include "LuaSL_LSL_tree.h"
19
20/**
21 * @brief structure given as argument to the reentrant 'yyparse' function.
22 */
23typedef struct tagSParserParam
24{
25 yyscan_t scanner;
26 SExpression *expression;
27}SParserParam;
28
29// the parameter name (of the reentrant 'yyparse' function)
30// data is a pointer to a 'SParserParam' structure
31#define YYPARSE_PARAM data
32
33// the argument for the 'yylex' function
34#define YYLEX_PARAM ((SParserParam*)data)->scanner
35
36#endif // __PARSERPARAM_H__
37
38