Diffstat (limited to 'include/sitecing/sitecing_enflesher.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | include/sitecing/sitecing_enflesher.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/include/sitecing/sitecing_enflesher.h b/include/sitecing/sitecing_enflesher.h new file mode 100644 index 0000000..ad57fb5 --- a/dev/null +++ b/include/sitecing/sitecing_enflesher.h | |||
@@ -0,0 +1,65 @@ | |||
1 | #ifndef __SITECING_SITECING_ENFLESHER_H | ||
2 | #define __SITECING_SITECING_ENFLESHER_H | ||
3 | |||
4 | #include <fstream> | ||
5 | #include <string> | ||
6 | using namespace std; | ||
7 | |||
8 | /** | ||
9 | * @file | ||
10 | * @brief The preprocessed source builder. | ||
11 | */ | ||
12 | |||
13 | #ifndef sitecing_enflesher_flexlexer_once | ||
14 | #define sitecing_enflesher_flexlexer_once | ||
15 | #undef yyFlexLexer | ||
16 | #define yyFlexLexer sitecing_enflesherFlexLexer | ||
17 | #include <FlexLexer.h> | ||
18 | #undef yyFlexLexerOnce | ||
19 | #endif | ||
20 | |||
21 | class sitecing_parser; | ||
22 | /** | ||
23 | * The enfleshing of the skeleton file according to the in-memory parsed | ||
24 | * component source. | ||
25 | */ | ||
26 | class sitecing_enflesher : public sitecing_enflesherFlexLexer { | ||
27 | public: | ||
28 | /** | ||
29 | * It is time to anchor output with the #line directive. | ||
30 | */ | ||
31 | bool anchor_time; | ||
32 | /** | ||
33 | * @todo TODO: wish I could remember -- document me. | ||
34 | */ | ||
35 | bool anchoraged; | ||
36 | /** | ||
37 | * The reference to the parser object containg the parsed source. | ||
38 | */ | ||
39 | sitecing_parser& parser; | ||
40 | /** | ||
41 | * The output stream. | ||
42 | */ | ||
43 | ofstream outs; | ||
44 | |||
45 | /** | ||
46 | * @param p The parser object containing preparsed data. | ||
47 | */ | ||
48 | sitecing_enflesher(sitecing_parser& p) | ||
49 | : parser(p), anchor_time(true) { } | ||
50 | |||
51 | /** | ||
52 | * Do the job. | ||
53 | */ | ||
54 | void enflesh(); | ||
55 | |||
56 | virtual void LexerOutput(const char *buf,int size); | ||
57 | virtual int yylex(); | ||
58 | |||
59 | /** | ||
60 | * Put a #line anchor into output. | ||
61 | */ | ||
62 | void anchor(); | ||
63 | }; | ||
64 | |||
65 | #endif /* __SITECING_SITECING_ENFLESHER_H */ | ||