1
2
3
4
5
6 #include <sngcpp/symbols/RuleSymbol.hpp>
7
8 namespace sngcpp { namespace symbols {
9
10 RuleSymbol::RuleSymbol(const Span& span_, const std::u32string& name_) : Symbol(span_, name_)
11 {
12 SetAccess(Specifier::public_);
13 ruleBody.reset(new sngxml::dom::Element(U"span"));
14 ruleBody->SetAttribute(U"xml:space", U"preserve");
15 }
16
17 std::u32string RuleSymbol::KindStr()
18 {
19 return U"rule";
20 }
21
22 std::std::unique_ptr<sngxml::dom::Element>RuleSymbol::CreateElement()
23 {
24 std::unique_ptr<sngxml::dom::Element> ruleElement(new sngxml::dom::Element(U"rule"));
25 ruleElement->AppendChild(std::unique_ptr<sngxml::dom::Node>(ruleBody.release()));
26 return ruleElement;
27 }
28
29 } }