1 // =================================
 2 // Copyright (c) 2021 Seppo Laakko
 3 // Distributed under the MIT license
 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* attributeSymbol* symbol) override;
18     void GenerateSymbols(AttributeNode* attributeSymbol* symbolBoundCompileUnit& boundCompileUnitContainerScope* containerScope) override;
19     void GenerateImplementation(AttributeNode* attributeSymbol* symbolStatementBinder* statementBinder) override;
20 private:
21     void GenerateToXmlSymbol(AttributeNode* attributeClassTypeSymbol* classTypeSymbolBoundCompileUnit& boundCompileUnitContainerScope* containerScope);
22     void GenerateSystemDomElementConstructorSymbol(AttributeNode* attributeClassTypeSymbol* classTypeSymbolBoundCompileUnit& boundCompileUnitContainerScope* containerScope);
23     void GenerateToXmlMemberFunctionImplementation(AttributeNode* attributeClassTypeSymbol* classTypeSymbolMemberFunctionSymbol* toJsonJsonObjectMemberFunctionSymbolStatementBinder* statementBinder);
24     void GenerateSystemDomElementConstructorImplementation(AttributeNode* attributeClassTypeSymbol* classTypeSymbolConstructorSymbol* constructorSymbolStatementBinder* statementBinder);
25     std::unordered_map<Symbol*MemberFunctionSymbol*> toXmlMemberFunctionSymbolMap;
26     std::unordered_map<Symbol*ConstructorSymbol*> constructorSymbolMap;
27 };
28 
29 } } // namespace cmajor::binder
30 
31 #endif // CMAJOR_BINDER_XML_ATTRIBUTE_PROCESSOR_INCLUDED