diff options
author | David Walter Seikel | 2012-01-05 04:47:56 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-05 04:47:56 +1000 |
commit | d4b977d0904a1dea37922dac60d3bb37f9769230 (patch) | |
tree | e5f23ddd6a6dd880f770c897fa9c11e67c4c79cf /LuaSL/src/LuaSL_parser_param.h | |
parent | Add a compiler stub. (diff) | |
download | SledjHamr-d4b977d0904a1dea37922dac60d3bb37f9769230.zip SledjHamr-d4b977d0904a1dea37922dac60d3bb37f9769230.tar.gz SledjHamr-d4b977d0904a1dea37922dac60d3bb37f9769230.tar.bz2 SledjHamr-d4b977d0904a1dea37922dac60d3bb37f9769230.tar.xz |
Add a simple flex + btyacc stub.
Will be fleshed out soon with LSL grammer.
Diffstat (limited to 'LuaSL/src/LuaSL_parser_param.h')
-rw-r--r-- | LuaSL/src/LuaSL_parser_param.h | 38 |
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 | */ | ||
23 | typedef 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 | |||