1
2
3
4
5
6 #ifndef SNG2HTML_SNG2HTML_PARSER_FILE_INCLUDED
7 #define SNG2HTML_SNG2HTML_PARSER_FILE_INCLUDED
8 #include <sng2html/sng2html/Parser.hpp>
9
10 namespace sng2html { namespace sng2html {
11
12 class Include
13 {
14 public:
15 Include(bool hppPrefix_, const std::u32string& str_);
16 bool HppPrefix() const { return hppPrefix; }
17 const std::u32string& Str() const { return str; }
18 private:
19 bool hppPrefix;
20 std::u32string str;
21 };
22
23 class ParserFile
24 {
25 public:
26 ParserFile(const std::string& fileName_);
27 void AddInclude(Include* include);
28 void AddUsingNamespace(const std::u32string& usingNs);
29 void AddParser(GrammarParser* parser);
30 void Accept(Visitor& visitor);
31 const std::string& FileName() const { return fileName; }
32 const std::std::vector<std::std::unique_ptr<Include>>&Includes() const{returnincludes;}
33 const std::std::vector<std::u32string>&UsingNamespaceDeclarations() const{returnusingNamespaceDeclarations;}
34 const std::std::vector<std::std::unique_ptr<GrammarParser>>&Parsers() const{returnparsers;}
35 private:
36 std::string fileName;
37 std::vector<std::std::unique_ptr<Include>>includes;
38 std::vector<std::u32string> usingNamespaceDeclarations;
39 std::vector<std::std::unique_ptr<GrammarParser>>parsers;
40 };
41
42 } }
43
44 #endif // SNG2HTML_SNG2HTML_PARSER_FILE_INCLUDED