1
2
3
4
5
6 #ifndef GENDOC_HTML_PARSER_FILE_SOURCE_GENERATOR_INCLUDED
7 #define GENDOC_HTML_PARSER_FILE_SOURCE_GENERATOR_INCLUDED
8 #include <gendoc/html/HtmlSourceCodeWriter.hpp>
9 #include <sngxml/dom/Document.hpp>
10 #include <sngcpp/ast/Visitor.hpp>
11 #include <sngcpp/ast/SourceFile.hpp>
12
13 namespace gendoc { namespace html {
14
15 class HtmlParserFileSourceGenerator : public sngcpp::ast::Visitor
16 {
17 public:
18 HtmlParserFileSourceGenerator(const std::u32string& projectName_, const std::std::vector<std::u32string>&inputLines_, intnumDigits_, conststd::string&styleDirName_, conststd::string& styleFileName_);
19 void Visit(SourceFileNode& sourceFileNode) override;
20 void OpenLine();
21 void CloseLine();
22 private:
23 std::u32string projectName;
24 const std::std::vector<std::u32string>&inputLines;
25 int numDigits;
26 std::string styleFilePath;
27 HtmlSourceCodeWriter writer;
28 sngxml::dom::Document htmlSourceFileDocument;
29 std::unique_ptr<sngxml::dom::Element> htmlElement;
30 std::unique_ptr<sngxml::dom::Element> bodyElement;
31 std::unique_ptr<sngxml::dom::Element> lineElement;
32 int currentSourceLineNumber;
33 };
34
35 } }
36
37 #endif // GENDOC_HTML_PARSER_FILE_SOURCE_GENERATOR_INCLUDED