From ce1f37aae46ea95020d7b865f7a80e8abdfad0d8 Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Sat, 29 Jan 2005 21:21:05 +0000 Subject: initial commit into repository --- (limited to 'include/sitecing/sitecing_enflesher.h') 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 @@ +#ifndef __SITECING_SITECING_ENFLESHER_H +#define __SITECING_SITECING_ENFLESHER_H + +#include +#include +using namespace std; + +/** + * @file + * @brief The preprocessed source builder. + */ + +#ifndef sitecing_enflesher_flexlexer_once +#define sitecing_enflesher_flexlexer_once +#undef yyFlexLexer +#define yyFlexLexer sitecing_enflesherFlexLexer +#include +#undef yyFlexLexerOnce +#endif + +class sitecing_parser; +/** + * The enfleshing of the skeleton file according to the in-memory parsed + * component source. + */ +class sitecing_enflesher : public sitecing_enflesherFlexLexer { + public: + /** + * It is time to anchor output with the #line directive. + */ + bool anchor_time; + /** + * @todo TODO: wish I could remember -- document me. + */ + bool anchoraged; + /** + * The reference to the parser object containg the parsed source. + */ + sitecing_parser& parser; + /** + * The output stream. + */ + ofstream outs; + + /** + * @param p The parser object containing preparsed data. + */ + sitecing_enflesher(sitecing_parser& p) + : parser(p), anchor_time(true) { } + + /** + * Do the job. + */ + void enflesh(); + + virtual void LexerOutput(const char *buf,int size); + virtual int yylex(); + + /** + * Put a #line anchor into output. + */ + void anchor(); +}; + +#endif /* __SITECING_SITECING_ENFLESHER_H */ -- cgit v0.9.0.2