-rw-r--r-- | include/sitecing/sitecing_enflesher.h | 18 | ||||
-rw-r--r-- | include/sitecing/sitecing_parser.h | 16 |
2 files changed, 29 insertions, 5 deletions
diff --git a/include/sitecing/sitecing_enflesher.h b/include/sitecing/sitecing_enflesher.h index db15bc3..9eefdcc 100644 --- a/include/sitecing/sitecing_enflesher.h +++ b/include/sitecing/sitecing_enflesher.h @@ -1,88 +1,100 @@ #ifndef __SITECING_SITECING_ENFLESHER_H #define __SITECING_SITECING_ENFLESHER_H #include <fstream> #include <string> using namespace std; /** * @file * @brief The preprocessed source builder. */ #ifndef sitecing_enflesher_flexlexer_once #define sitecing_enflesher_flexlexer_once #undef yyFlexLexer +/** + * nevermind me + */ #define yyFlexLexer sitecing_enflesherFlexLexer #include <FlexLexer.h> #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. + * It is time to anchor output with the \#line directive. */ bool anchor_time; /** - * The file currently being written is supposed to have #line + * The file currently being written is supposed to have \#line * directives all around the place. */ bool anchoraged; /** * The reference to the parser object containg the parsed source. */ sitecing_parser& parser; /** * The output stream. */ ofstream outs; /** * the outs stream destination file. * @see outs */ string outs_filename; /** * @param p The parser object containing preparsed data. */ sitecing_enflesher(sitecing_parser& p) : parser(p), anchor_time(true) { } /** * Do the job. */ void enflesh(); + /** + * Output parsed data + * @param buf pointer to the data + * @param size length of the buffer pointed by buf + */ virtual void LexerOutput(const char *buf,int size); + /** + * Lexer generated by flex + * @return zero on success + */ virtual int yylex(); /** - * Put a #line anchor into output. + * Put a \#line anchor into output. */ void anchor(); /** * Close previously opened output stream, rename to the 'correct' * destination filename, if needed, and open new file. * @see outs * @see outs_filename * @see outs_close */ void outs_open(const string& nfile); /** * Close previously opened output stream, and rename to the 'correct' * destination filename, if needed. * @see outs_open * @see outs * @see outs_filename */ void outs_close(); }; #endif /* __SITECING_SITECING_ENFLESHER_H */ diff --git a/include/sitecing/sitecing_parser.h b/include/sitecing/sitecing_parser.h index a53ef22..bcabc5c 100644 --- a/include/sitecing/sitecing_parser.h +++ b/include/sitecing/sitecing_parser.h @@ -1,68 +1,71 @@ #ifndef __SITECING_SITECING_PARSER_H #define __SITECING_SITECING_PARSER_H #include <string> #include <list> #include <map> #include <stdexcept> using namespace std; #include "sitecing/component_factory.h" using namespace sitecing; /** * @file * @brief The component source parser. */ #ifndef sitecing_parser_flexlexer_once #define sitecing_parser_flexlexer_once #undef yyFlexLexer +/** + * nevermind me + */ #define yyFlexLexer sitecing_parserFlexLexer #include <FlexLexer.h> #undef yyFlexLexerOnce #endif /** * The component source parser. */ class sitecing_parser : public sitecing_parserFlexLexer { public: /** * The ancestor class definition. */ class ancestor_class { public: /** * The class name. */ string name; /** * The source component path. */ string path; /** * @param n the class name. * @param p the component path. */ ancestor_class(const string& n,const string& p) : name(n), path(p) { } }; /** * The list of ancestor classes. */ typedef list<ancestor_class> ancestor_classes_t; /** * The ancestor classes. */ ancestor_classes_t ancestor_classes; /** * The member variable definition. */ class member_variable { public: /** * The member variable type. */ string type; @@ -266,69 +269,78 @@ class sitecing_parser : public sitecing_parserFlexLexer { * @todo TODO: wish I could remember the details -- document me. */ string component_basename; /** * The skeleton file name. */ string skeleton; /** * The component class name. */ string class_name; /** * Output basename. * @todo TODO: wish I could remember the details -- document me. */ string output_basename; /** * Verbatim declaration part. */ string decl; /** * Verbatim implementation part. */ string impl; /** * The reference to the component factory object. */ component_factory& factory; /** * Pragma map type. */ typedef map<string,string> pragmas_t; /** * Pragma's found in the component. */ pragmas_t pragmas; /** * @param f the component factory. */ sitecing_parser(component_factory& f); /** * Preprocess file. * @param in input file name. */ void preprocess(const string& in); + /** + * Output parsed data + * @param buf pointer to the data + * @param size length of the buffer pointed by buf + */ virtual void LexerOutput(const char *buf,int size); + /** + * Lexer generated by flex + * @return zero on success + */ virtual int yylex(); /** * Retrieve reference to the to of the modes stack. * @return the reference in question. */ modus_operandi& M() { return modi.front(); } /** - * Anchor the output with the #line, if we're not in the text output mode. + * Anchor the output with the \#line, if we're not in the text output mode. */ void soft_anchor(); /** - * Anchor the output with the #line directive, changing to the appropriate output mode if needed. + * Anchor the output with the \#line directive, changing to the appropriate output mode if needed. */ void anchor(); }; #endif /* __SITECING_SITECING_PARSER_H */ |