1
2
3
4
5
6 #ifndef SOULNG_LEXER_XML_PARSING_LOG_INCLUDED
7 #define SOULNG_LEXER_XML_PARSING_LOG_INCLUDED
8 #include <soulng/lexer/ParsingLog.hpp>
9
10 namespace soulng { namespace lexer {
11
12 class XmlParsingLog : public ParsingLog
13 {
14 public:
15 XmlParsingLog(std::ostream& stream_);
16 XmlParsingLog(std::ostream& stream_, int maxLineLength_);
17 void IncIndent() override;
18 void DecIndent() override;
19 void WriteBeginRule(const std::u32string& ruleName) override;
20 void WriteEndRule(const std::u32string& ruleName) override;
21 void WriteTry(const std::u32string& s) override;
22 void WriteSuccess(const std::u32string& match) override;
23 void WriteFail() override;
24 void WriteElement(const std::u32string& elementName, const std::u32string& elementContent);
25 void Write(const std::u32string& s);
26 soulng::util::CodeFormatter& Formatter() { return formatter; }
27 private:
28 soulng::util::CodeFormatter formatter;
29 };
30
31 std::u32string XmlHexEscape(char32_t c);
32 std::u32string XmlCharStr(char32_t c);
33 std::u32string XmlEscape(const std::u32string& s);
34
35 } }
36
37 #endif // SOULNG_LEXER_XML_PARSING_LOG_INCLUDED