1
2
3
4
5
6 #ifndef CMAJOR_BINDER_XML_ATTRIBUTE_PROCESSOR_INCLUDED
7 #define CMAJOR_BINDER_XML_ATTRIBUTE_PROCESSOR_INCLUDED
8 #include <cmajor/binder/AttributeBinder.hpp>
9 #include <cmajor/symbols/FunctionSymbol.hpp>
10
11 namespace cmajor { namespace binder {
12
13 class XmlAttributeProcessor : public AttributeProcessor
14 {
15 public:
16 XmlAttributeProcessor();
17 void TypeCheck(AttributeNode* attribute, Symbol* symbol) override;
18 void GenerateSymbols(AttributeNode* attribute, Symbol* symbol, BoundCompileUnit& boundCompileUnit, ContainerScope* containerScope) override;
19 void GenerateImplementation(AttributeNode* attribute, Symbol* symbol, StatementBinder* statementBinder) override;
20 private:
21 void GenerateToXmlSymbol(AttributeNode* attribute, ClassTypeSymbol* classTypeSymbol, BoundCompileUnit& boundCompileUnit, ContainerScope* containerScope);
22 void GenerateSystemDomElementConstructorSymbol(AttributeNode* attribute, ClassTypeSymbol* classTypeSymbol, BoundCompileUnit& boundCompileUnit, ContainerScope* containerScope);
23 void GenerateToXmlMemberFunctionImplementation(AttributeNode* attribute, ClassTypeSymbol* classTypeSymbol, MemberFunctionSymbol* toJsonJsonObjectMemberFunctionSymbol, StatementBinder* statementBinder);
24 void GenerateSystemDomElementConstructorImplementation(AttributeNode* attribute, ClassTypeSymbol* classTypeSymbol, ConstructorSymbol* constructorSymbol, StatementBinder* statementBinder);
25 std::unordered_map<Symbol*, MemberFunctionSymbol*> toXmlMemberFunctionSymbolMap;
26 std::unordered_map<Symbol*, ConstructorSymbol*> constructorSymbolMap;
27 };
28
29 } }
30
31 #endif // CMAJOR_BINDER_XML_ATTRIBUTE_PROCESSOR_INCLUDED