1
2
3
4
5
6 #ifndef SNG2HTML_SNG2HTML_PROJECT_INCLUDED
7 #define SNG2HTML_SNG2HTML_PROJECT_INCLUDED
8 #include <sng2html/sng2html/Domain.hpp>
9 #include <sng2html/sng2html/LexerFile.hpp>
10 #include <sng2html/sng2html/ParserFile.hpp>
11 #include <sng2html/sng2html/Grammar.hpp>
12 #include <sng2html/sng2html/LexerContext.hpp>
13 #include <sngxml/dom/Document.hpp>
14 #include <sngxml/dom/Parser.hpp>
15
16 namespace sng2html { namespace sng2html {
17
18 class Project
19 {
20 public:
21 Project(bool verbose_, const std::string& xmlFilePath_);
22 void Process();
23 void ReadLexerFiles();
24 void ReadParserFiles();
25 void ReadOutDir();
26 void ReadStyleFilePath();
27 void ReadGrammarFiles();
28 void Link();
29 void ParseLexerFiles();
30 void GenerateHtml();
31 private:
32 bool verbose;
33 std::string xmlFilePath;
34 std::string rootDir;
35 std::unique_ptr<sngxml::dom::Document> xmlDoc;
36 std::vector<std::std::unique_ptr<LexerFile>>lexerFiles;
37 std::vector<std::std::unique_ptr<ParserFile>>parserFiles;
38 Domain domain;
39 std::unordered_map<std::u32string, LexerFile*> lexerMap;
40 std::string outDir;
41 std::u32string styleFilePath;
42 std::vector<std::std::unique_ptr<Grammar>>grammars;
43 std::unordered_map<GrammarParser*, Grammar*> parserGrammarMap;
44 std::unordered_map<RuleParser*, Rule*> parserRuleMap;
45 std::unordered_map<LexerFile*, Grammar*> lexerGrammarMap;
46 std::unordered_map<Expression*, Rule*> lexerRuleMap;
47 LexerContext lexerContext;
48 };
49
50 } }
51
52 #endif // SNG2HTML_SNG2HTML_PROJECT_INCLUDED