top | up | prev | next

JsonAttributeProcessor Class

Definition at line 17 of JsonAttributeProcessor.hpp

Constructors

JsonAttributeProcessor(Module* module_)

Member Functions

void CheckMemberVariableJsonFieldNames(ClassTypeSymbol* classTypeSymbol, std::map<std::u32string, AttributeNode*>& memberVariableFieldNames)
void GenerateImplementation(AttributeNode* attribute, Symbol* symbol, StatementBinder* statementBinder) override
void GenerateJsonConstructorImplementation(AttributeNode* attribute, ClassTypeSymbol* classTypeSymbol, ConstructorSymbol* jsonConstructorSymbol, StatementBinder* statementBinder)
void GenerateJsonConstructorSymbol(AttributeNode* attribute, ClassTypeSymbol* classTypeSymbol)
void GenerateJsonCreatorFunctionSymbol(AttributeNode* attribute, ClassTypeSymbol* classTypeSymbol)
void GenerateJsonCreatorImplementation(AttributeNode* attribute, ClassTypeSymbol* classTypeSymbol, MemberFunctionSymbol* jsonCreatorFunctionSymbol, StatementBinder* statementBinder)
void GenerateMemberVariableJsonFieldNames(ClassTypeSymbol* classTypeSymbol)
void GenerateSymbols(AttributeNode* attribute, Symbol* symbol, BoundCompileUnit& boundCompileUnit, ContainerScope* containerScope) override
void GenerateToJsonImplementation(AttributeNode* attribute, ClassTypeSymbol* classTypeSymbol, MemberFunctionSymbol* toJsonMemberFunctionSymbol, StatementBinder* statementBinder)
void GenerateToJsonJsonObjectImplementation(AttributeNode* attribute, ClassTypeSymbol* classTypeSymbol, MemberFunctionSymbol* toJsonJsonObjectMemberFunctionSymbol, StatementBinder* statementBinder)
void GenerateToJsonJsonObjectSymbol(AttributeNode* attribute, ClassTypeSymbol* classTypeSymbol)
void GenerateToJsonSymbol(AttributeNode* attribute, ClassTypeSymbol* classTypeSymbol, BoundCompileUnit& boundCompileUnit, ContainerScope* containerScope)
void TypeCheck(AttributeNode* attribute, Symbol* symbol) override

Member Variables

std::unordered_map<Symbol*, ConstructorSymbol*> jsonConstructorMap
std::unordered_map<Symbol*, MemberFunctionSymbol*> jsonCreatorMap
Module* module
std::unordered_map<Symbol*, MemberFunctionSymbol*> toJsonJsonObjectMemberFunctionSymbolMap
std::unordered_map<Symbol*, MemberFunctionSymbol*> toJsonObjectMemberFunctionSymbolMap

Constructor Details

JsonAttributeProcessor Constructor

cmajor::binder::JsonAttributeProcessor::JsonAttributeProcessor(Module * module_)

Definition at line 30 of JsonAttributeProcessor.cpp :
 30 : AttributeProcessor(U"json")module(module_)
 31 {
 32 }


Declaration at line 20 of JsonAttributeProcessor.hpp


Member Function Details

CheckMemberVariableJsonFieldNames Member Function

void cmajor::binder::JsonAttributeProcessor::CheckMemberVariableJsonFieldNames(ClassTypeSymbol * classTypeSymbol, std::map<std::u32string, AttributeNode*>& memberVariableFieldNames)

Definition at line 99 of JsonAttributeProcessor.cpp
Declaration at line 31 of JsonAttributeProcessor.hpp

Calls: cmajor::binder::JsonAttributeProcessor::CheckMemberVariableJsonFieldNames , cmajor::symbols::ClassTypeSymbol::BaseClass , cmajor::symbols::ClassTypeSymbol::MemberVariables , cmajor::symbols::Symbol::GetAttributes , cmajor::symbols::Symbol::GetSpan , cmajor::symbols::Symbol::SourceModuleId

Called by: cmajor::binder::JsonAttributeProcessor::CheckMemberVariableJsonFieldNames , cmajor::binder::JsonAttributeProcessor::GenerateSymbols


GenerateImplementation Member Function

void cmajor::binder::JsonAttributeProcessor::GenerateImplementation(AttributeNode* attribute, Symbol * symbol, StatementBinder * statementBinder) override

Definition at line 341 of JsonAttributeProcessor.cpp
Declaration at line 23 of JsonAttributeProcessor.hpp

Calls: cmajor::binder::JsonAttributeProcessor::GenerateJsonConstructorImplementation , cmajor::binder::JsonAttributeProcessor::GenerateJsonCreatorImplementation , cmajor::binder::JsonAttributeProcessor::GenerateToJsonImplementation , cmajor::binder::JsonAttributeProcessor::GenerateToJsonJsonObjectImplementation , cmajor::symbols::Module::GetSymbolTable , cmajor::symbols::Symbol::FullName , cmajor::symbols::Symbol::IsClassTypeSymbol , cmajor::symbols::SymbolTable::AddJsonClass


GenerateJsonConstructorImplementation Member Function

void cmajor::binder::JsonAttributeProcessor::GenerateJsonConstructorImplementation(AttributeNode* attribute, ClassTypeSymbol * classTypeSymbol, ConstructorSymbol * jsonConstructorSymbol, StatementBinder * statementBinder)

Definition at line 444 of JsonAttributeProcessor.cpp
Declaration at line 36 of JsonAttributeProcessor.hpp

Calls: cmajor::binder::BoundClass::AddMember , cmajor::binder::BoundCompileUnit::AddFileScope , cmajor::binder::BoundCompileUnit::GetSymbolTable , cmajor::binder::BoundCompileUnit::RemoveLastFileScope , cmajor::binder::BoundNode::GetBoundNodeType , cmajor::binder::StatementBinder::CurrentClass , cmajor::binder::StatementBinder::CurrentConstructorNode , cmajor::binder::StatementBinder::CurrentConstructorSymbol , cmajor::binder::StatementBinder::CurrentFunction , cmajor::binder::StatementBinder::GetBoundCompileUnit , cmajor::binder::StatementBinder::GetContainerScope , cmajor::binder::StatementBinder::ReleaseStatement , cmajor::binder::StatementBinder::SetContainerScope , cmajor::binder::StatementBinder::SetCurrentConstructor , cmajor::binder::StatementBinder::SetCurrentFunction , cmajor::binder::TypeBinder::SetContainerScope , cmajor::binder::TypeBinder::SetCurrentFunctionSymbol , cmajor::symbols::ClassTypeSymbol::BaseClass , cmajor::symbols::ClassTypeSymbol::MemberVariables , cmajor::symbols::ContainerScope::Lookup , cmajor::symbols::ContainerSymbol::GetContainerScope , cmajor::symbols::Exception::Defined , cmajor::symbols::Exception::DefinedModuleId , cmajor::symbols::Exception::Message , cmajor::symbols::Exception::References , cmajor::symbols::FileScope::AddContainerScope , cmajor::symbols::Module::GetSymbolTable , cmajor::symbols::Symbol::FullName , cmajor::symbols::Symbol::GetAttributes , cmajor::symbols::Symbol::GetModule , cmajor::symbols::Symbol::GetSpan , cmajor::symbols::Symbol::Name , cmajor::symbols::Symbol::Ns , cmajor::symbols::Symbol::SourceModuleId , cmajor::symbols::SymbolTable::BeginContainer , cmajor::symbols::SymbolTable::EndContainer , cmajor::symbols::SymbolTable::GlobalNs

Called by: cmajor::binder::JsonAttributeProcessor::GenerateImplementation


GenerateJsonConstructorSymbol Member Function

void cmajor::binder::JsonAttributeProcessor::GenerateJsonConstructorSymbol(AttributeNode* attribute, ClassTypeSymbol * classTypeSymbol)

Definition at line 209 of JsonAttributeProcessor.cpp
Declaration at line 33 of JsonAttributeProcessor.hpp

Calls: cmajor::symbols::ClassGroupTypeSymbol::GetClass , cmajor::symbols::ClassTypeSymbol::AddMember , cmajor::symbols::ContainerScope::Lookup , cmajor::symbols::ContainerSymbol::GetContainerScope , cmajor::symbols::FunctionSymbol::AddMember , cmajor::symbols::FunctionSymbol::ComputeName , cmajor::symbols::FunctionSymbol::SetExplicit , cmajor::symbols::Module::GetSymbolTable , cmajor::symbols::Symbol::GetModule , cmajor::symbols::Symbol::GetSpan , cmajor::symbols::Symbol::GetSymbolType , cmajor::symbols::Symbol::SetAccess , cmajor::symbols::Symbol::SetModule , cmajor::symbols::Symbol::SourceModuleId , cmajor::symbols::SymbolTable::GlobalNs , cmajor::symbols::SymbolTable::SetFunctionIdFor , cmajor::symbols::TypeSymbol::AddPointer , cmajor::symbols::VariableSymbol::SetType

Called by: cmajor::binder::JsonAttributeProcessor::GenerateSymbols


GenerateJsonCreatorFunctionSymbol Member Function

void cmajor::binder::JsonAttributeProcessor::GenerateJsonCreatorFunctionSymbol(AttributeNode* attribute, ClassTypeSymbol * classTypeSymbol)

Definition at line 181 of JsonAttributeProcessor.cpp
Declaration at line 32 of JsonAttributeProcessor.hpp

Calls: cmajor::symbols::ClassGroupTypeSymbol::GetClass , cmajor::symbols::ClassTypeSymbol::AddMember , cmajor::symbols::ContainerScope::Lookup , cmajor::symbols::ContainerSymbol::GetContainerScope , cmajor::symbols::FunctionSymbol::AddMember , cmajor::symbols::FunctionSymbol::ComputeName , cmajor::symbols::FunctionSymbol::SetGroupName , cmajor::symbols::FunctionSymbol::SetReturnType , cmajor::symbols::Module::GetSymbolTable , cmajor::symbols::Symbol::GetModule , cmajor::symbols::Symbol::GetSpan , cmajor::symbols::Symbol::GetSymbolType , cmajor::symbols::Symbol::SetAccess , cmajor::symbols::Symbol::SetModule , cmajor::symbols::Symbol::SetStatic , cmajor::symbols::Symbol::SourceModuleId , cmajor::symbols::SymbolTable::GetTypeByName , cmajor::symbols::SymbolTable::GlobalNs , cmajor::symbols::SymbolTable::SetFunctionIdFor , cmajor::symbols::TypeSymbol::AddPointer , cmajor::symbols::VariableSymbol::SetType

Called by: cmajor::binder::JsonAttributeProcessor::GenerateSymbols


GenerateJsonCreatorImplementation Member Function

void cmajor::binder::JsonAttributeProcessor::GenerateJsonCreatorImplementation(AttributeNode* attribute, ClassTypeSymbol * classTypeSymbol, MemberFunctionSymbol * jsonCreatorFunctionSymbol, StatementBinder * statementBinder)

Definition at line 391 of JsonAttributeProcessor.cpp
Declaration at line 37 of JsonAttributeProcessor.hpp

Calls: cmajor::binder::BoundClass::AddMember , cmajor::binder::BoundCompileUnit::AddFileScope , cmajor::binder::BoundCompileUnit::GetSymbolTable , cmajor::binder::BoundCompileUnit::RemoveLastFileScope , cmajor::binder::BoundNode::GetBoundNodeType , cmajor::binder::StatementBinder::CurrentClass , cmajor::binder::StatementBinder::CurrentFunction , cmajor::binder::StatementBinder::GetBoundCompileUnit , cmajor::binder::StatementBinder::GetContainerScope , cmajor::binder::StatementBinder::ReleaseStatement , cmajor::binder::StatementBinder::SetContainerScope , cmajor::binder::StatementBinder::SetCurrentFunction , cmajor::binder::TypeBinder::SetContainerScope , cmajor::binder::TypeBinder::SetCurrentFunctionSymbol , cmajor::symbols::ContainerScope::Lookup , cmajor::symbols::ContainerSymbol::GetContainerScope , cmajor::symbols::Exception::Defined , cmajor::symbols::Exception::DefinedModuleId , cmajor::symbols::Exception::Message , cmajor::symbols::Exception::References , cmajor::symbols::FileScope::AddContainerScope , cmajor::symbols::Module::GetSymbolTable , cmajor::symbols::Symbol::FullName , cmajor::symbols::Symbol::GetModule , cmajor::symbols::Symbol::GetSpan , cmajor::symbols::Symbol::Ns , cmajor::symbols::Symbol::SourceModuleId , cmajor::symbols::SymbolTable::BeginContainer , cmajor::symbols::SymbolTable::EndContainer , cmajor::symbols::SymbolTable::GlobalNs

Called by: cmajor::binder::JsonAttributeProcessor::GenerateImplementation


GenerateMemberVariableJsonFieldNames Member Function

void cmajor::binder::JsonAttributeProcessor::GenerateMemberVariableJsonFieldNames(ClassTypeSymbol * classTypeSymbol)

Definition at line 147 of JsonAttributeProcessor.cpp
Declaration at line 30 of JsonAttributeProcessor.hpp

Calls: cmajor::symbols::ClassTypeSymbol::MemberVariables , cmajor::symbols::Symbol::GetAttributes , cmajor::symbols::Symbol::GetSpan , cmajor::symbols::Symbol::Name , cmajor::symbols::Symbol::SetAttributes , cmajor::symbols::Symbol::SourceModuleId

Called by: cmajor::binder::JsonAttributeProcessor::GenerateSymbols


GenerateSymbols Member Function

void cmajor::binder::JsonAttributeProcessor::GenerateSymbols(AttributeNode* attribute, Symbol * symbol, BoundCompileUnit & boundCompileUnit, ContainerScope * containerScope) override

Definition at line 81 of JsonAttributeProcessor.cpp
Declaration at line 22 of JsonAttributeProcessor.hpp

Calls: cmajor::binder::JsonAttributeProcessor::CheckMemberVariableJsonFieldNames , cmajor::binder::JsonAttributeProcessor::GenerateJsonConstructorSymbol , cmajor::binder::JsonAttributeProcessor::GenerateJsonCreatorFunctionSymbol , cmajor::binder::JsonAttributeProcessor::GenerateMemberVariableJsonFieldNames , cmajor::binder::JsonAttributeProcessor::GenerateToJsonJsonObjectSymbol , cmajor::binder::JsonAttributeProcessor::GenerateToJsonSymbol , cmajor::symbols::Symbol::IsClassTypeSymbol


GenerateToJsonImplementation Member Function

void cmajor::binder::JsonAttributeProcessor::GenerateToJsonImplementation(AttributeNode* attribute, ClassTypeSymbol * classTypeSymbol, MemberFunctionSymbol * toJsonMemberFunctionSymbol, StatementBinder * statementBinder)

Definition at line 642 of JsonAttributeProcessor.cpp
Declaration at line 39 of JsonAttributeProcessor.hpp

Calls: cmajor::binder::BoundClass::AddMember , cmajor::binder::BoundCompileUnit::AddFileScope , cmajor::binder::BoundCompileUnit::GetSymbolTable , cmajor::binder::BoundCompileUnit::RemoveLastFileScope , cmajor::binder::BoundNode::GetBoundNodeType , cmajor::binder::StatementBinder::CurrentClass , cmajor::binder::StatementBinder::CurrentFunction , cmajor::binder::StatementBinder::GetBoundCompileUnit , cmajor::binder::StatementBinder::GetContainerScope , cmajor::binder::StatementBinder::ReleaseStatement , cmajor::binder::StatementBinder::SetContainerScope , cmajor::binder::StatementBinder::SetCurrentFunction , cmajor::binder::TypeBinder::SetContainerScope , cmajor::binder::TypeBinder::SetCurrentFunctionSymbol , cmajor::symbols::ContainerScope::Lookup , cmajor::symbols::ContainerSymbol::GetContainerScope , cmajor::symbols::Exception::Defined , cmajor::symbols::Exception::DefinedModuleId , cmajor::symbols::Exception::Message , cmajor::symbols::Exception::References , cmajor::symbols::FileScope::AddContainerScope , cmajor::symbols::Module::GetSymbolTable , cmajor::symbols::Symbol::FullName , cmajor::symbols::Symbol::GetSpan , cmajor::symbols::Symbol::Ns , cmajor::symbols::Symbol::SourceModuleId , cmajor::symbols::SymbolTable::BeginContainer , cmajor::symbols::SymbolTable::EndContainer , cmajor::symbols::SymbolTable::GlobalNs

Called by: cmajor::binder::JsonAttributeProcessor::GenerateImplementation


GenerateToJsonJsonObjectImplementation Member Function

void cmajor::binder::JsonAttributeProcessor::GenerateToJsonJsonObjectImplementation(AttributeNode* attribute, ClassTypeSymbol * classTypeSymbol, MemberFunctionSymbol * toJsonJsonObjectMemberFunctionSymbol, StatementBinder * statementBinder)

Definition at line 543 of JsonAttributeProcessor.cpp
Declaration at line 38 of JsonAttributeProcessor.hpp

Calls: cmajor::binder::BoundClass::AddMember , cmajor::binder::BoundCompileUnit::AddFileScope , cmajor::binder::BoundCompileUnit::GetSymbolTable , cmajor::binder::BoundCompileUnit::RemoveLastFileScope , cmajor::binder::BoundNode::GetBoundNodeType , cmajor::binder::StatementBinder::CurrentClass , cmajor::binder::StatementBinder::CurrentFunction , cmajor::binder::StatementBinder::GetBoundCompileUnit , cmajor::binder::StatementBinder::GetContainerScope , cmajor::binder::StatementBinder::ReleaseStatement , cmajor::binder::StatementBinder::SetContainerScope , cmajor::binder::StatementBinder::SetCurrentFunction , cmajor::binder::TypeBinder::SetContainerScope , cmajor::binder::TypeBinder::SetCurrentFunctionSymbol , cmajor::symbols::ClassTypeSymbol::BaseClass , cmajor::symbols::ClassTypeSymbol::MemberVariables , cmajor::symbols::ContainerScope::Lookup , cmajor::symbols::ContainerSymbol::GetContainerScope , cmajor::symbols::Exception::Defined , cmajor::symbols::Exception::DefinedModuleId , cmajor::symbols::Exception::Message , cmajor::symbols::Exception::References , cmajor::symbols::FileScope::AddContainerScope , cmajor::symbols::Module::GetSymbolTable , cmajor::symbols::Symbol::FullName , cmajor::symbols::Symbol::GetAttributes , cmajor::symbols::Symbol::GetSpan , cmajor::symbols::Symbol::Name , cmajor::symbols::Symbol::Ns , cmajor::symbols::Symbol::SourceModuleId , cmajor::symbols::SymbolTable::BeginContainer , cmajor::symbols::SymbolTable::EndContainer , cmajor::symbols::SymbolTable::GlobalNs

Called by: cmajor::binder::JsonAttributeProcessor::GenerateImplementation


GenerateToJsonJsonObjectSymbol Member Function

void cmajor::binder::JsonAttributeProcessor::GenerateToJsonJsonObjectSymbol(AttributeNode* attribute, ClassTypeSymbol * classTypeSymbol)

Definition at line 238 of JsonAttributeProcessor.cpp
Declaration at line 34 of JsonAttributeProcessor.hpp

Calls: cmajor::symbols::ClassGroupTypeSymbol::GetClass , cmajor::symbols::ClassTypeSymbol::AddMember , cmajor::symbols::ClassTypeSymbol::BaseClass , cmajor::symbols::ContainerScope::Lookup , cmajor::symbols::ContainerSymbol::GetContainerScope , cmajor::symbols::FunctionSymbol::AddMember , cmajor::symbols::FunctionSymbol::ComputeName , cmajor::symbols::FunctionSymbol::SetGroupName , cmajor::symbols::FunctionSymbol::SetOverride , cmajor::symbols::FunctionSymbol::SetReturnType , cmajor::symbols::FunctionSymbol::SetVirtual , cmajor::symbols::Module::GetSymbolTable , cmajor::symbols::Symbol::GetAttributes , cmajor::symbols::Symbol::GetSpan , cmajor::symbols::Symbol::GetSymbolType , cmajor::symbols::Symbol::SetAccess , cmajor::symbols::Symbol::SetModule , cmajor::symbols::Symbol::SourceModuleId , cmajor::symbols::SymbolTable::GetTypeByName , cmajor::symbols::SymbolTable::GlobalNs , cmajor::symbols::SymbolTable::SetFunctionIdFor , cmajor::symbols::TypeSymbol::AddPointer , cmajor::symbols::VariableSymbol::SetType

Called by: cmajor::binder::JsonAttributeProcessor::GenerateSymbols


GenerateToJsonSymbol Member Function

void cmajor::binder::JsonAttributeProcessor::GenerateToJsonSymbol(AttributeNode* attribute, ClassTypeSymbol * classTypeSymbol, BoundCompileUnit & boundCompileUnit, ContainerScope * containerScope)

Definition at line 293 of JsonAttributeProcessor.cpp
Declaration at line 35 of JsonAttributeProcessor.hpp

Calls: cmajor::symbols::ClassTypeSymbol::AddMember , cmajor::symbols::ClassTypeSymbol::BaseClass , cmajor::symbols::FunctionSymbol::AddMember , cmajor::symbols::FunctionSymbol::ComputeName , cmajor::symbols::FunctionSymbol::SetGroupName , cmajor::symbols::FunctionSymbol::SetOverride , cmajor::symbols::FunctionSymbol::SetReturnParam , cmajor::symbols::FunctionSymbol::SetReturnType , cmajor::symbols::FunctionSymbol::SetVirtual , cmajor::symbols::Module::GetSymbolTable , cmajor::symbols::Symbol::GetAttributes , cmajor::symbols::Symbol::SetAccess , cmajor::symbols::Symbol::SetModule , cmajor::symbols::Symbol::SetParent , cmajor::symbols::SymbolTable::SetFunctionIdFor , cmajor::symbols::TypeSymbol::AddPointer , cmajor::symbols::VariableSymbol::SetType

Called by: cmajor::binder::JsonAttributeProcessor::GenerateSymbols


TypeCheck Member Function

void cmajor::binder::JsonAttributeProcessor::TypeCheck(AttributeNode* attribute, Symbol * symbol) override

Definition at line 34 of JsonAttributeProcessor.cpp
Declaration at line 21 of JsonAttributeProcessor.hpp

Calls: cmajor::binder::AttributeProcessor::TypeCheck , cmajor::symbols::ClassTypeSymbol::BaseClass , cmajor::symbols::CompileWarningCollection::AddWarning , cmajor::symbols::Module::GetCurrentProjectName , cmajor::symbols::Module::WarningCollection , cmajor::symbols::Symbol::FullName , cmajor::symbols::Symbol::GetAttributes , cmajor::symbols::Symbol::GetSpan , cmajor::symbols::Symbol::GetSymbolType , cmajor::symbols::Symbol::IsClassTypeSymbol , cmajor::symbols::Symbol::SourceModuleId , cmajor::symbols::Warning::SetDefined , cmajor::symbols::Warning::SetReferences


top | up | prev | next