top | up | prev | next

NodeList<T> Class

Definition at line 16 of NodeList.hpp

Member Functions

void Add(T* node)
void Clear()
std::vector<std::unique_ptr<T>> Content()
int Count() const
void Insert(int index, T* node)
std::vector<std::unique_ptr<T>>& Nodes()
void Read(AstReader& reader)
T* Release(int index)
void RemoveEmpty()
void SetContent(std::vector<std::unique_ptr<T>>&& content)
void SetParent(Node* parent)
void Write(AstWriter& writer)
T* operator[](int index) const

Member Variables

std::vector<std::unique_ptr<T>> nodes

Member Function Details

Add Member Function

void sngcm::ast::NodeList::Add(T * node)

Definition at line 27 of NodeList.hpp :
 28 {
 29     nodes.push_back(std::unique_ptr<T>(node));
 30 }


Called by: sngcm::ast::ArrayLiteralNode::AddValue , sngcm::ast::AxiomNode::AddParameter , sngcm::ast::AxiomNode::AddStatement , sngcm::ast::CaseStatementNode::AddCaseExpr , sngcm::ast::CaseStatementNode::AddStatement , sngcm::ast::ClassDelegateNode::AddParameter , sngcm::ast::ClassNode::AddBaseClassOrInterface , sngcm::ast::ClassNode::AddMember , sngcm::ast::ClassNode::AddTemplateParameter , sngcm::ast::ClassNode::ArrangeMembers , sngcm::ast::CompoundStatementNode::AddStatement , sngcm::ast::ConceptIdNode::AddTypeParameter , sngcm::ast::ConceptNode::AddAxiom , sngcm::ast::ConceptNode::AddConstraint , sngcm::ast::ConceptNode::AddTypeParameter , sngcm::ast::ConditionalCompilationPartNode::AddStatement , sngcm::ast::ConditionalCompilationStatementNode::AddElifExpr , sngcm::ast::ConditionalCompilationStatementNode::AddElifPart , sngcm::ast::ConditionalCompilationStatementNode::Clone , sngcm::ast::ConstructNode::AddArgument , sngcm::ast::ConstructionStatementNode::AddArgument , sngcm::ast::ConstructorConstraintNode::AddParameter , sngcm::ast::ConstructorNode::AddInitializer , sngcm::ast::DefaultStatementNode::AddStatement , sngcm::ast::DelegateNode::AddParameter , sngcm::ast::EnumTypeNode::AddConstant , sngcm::ast::FunctionConstraintNode::AddParameter , sngcm::ast::FunctionNode::AddParameter , sngcm::ast::FunctionNode::AddTemplateParameter , sngcm::ast::InitializerNode::AddArgument , sngcm::ast::InterfaceNode::AddMember , sngcm::ast::InvokeNode::AddArgument , sngcm::ast::MemberFunctionConstraintNode::AddParameter , sngcm::ast::MultiParamConstraintNode::AddTypeExpr , sngcm::ast::NamespaceNode::AddMember , sngcm::ast::NewNode::AddArgument , sngcm::ast::NodeList::Insert , sngcm::ast::StaticConstructorNode::AddInitializer , sngcm::ast::StructuredLiteralNode::AddMember , sngcm::ast::SwitchStatementNode::AddCase , sngcm::ast::TemplateIdNode::AddTemplateArgument , sngcm::ast::TryStatementNode::AddCatch


Clear Member Function

void sngcm::ast::NodeList::Clear()

Definition at line 46 of NodeList.hpp :
 47 {
 48     nodes.clear();
 49 }


Called by: sngcm::ast::NamespaceCombiner::Visit


Content Member Function

std::vector<std::unique_ptr<T >> sngcm::ast::NodeList::Content()

Definition at line 98 of NodeList.hpp :
 98 { return std::move(nodes); }


Count Member Function

int sngcm::ast::NodeList::Count() const

Definition at line 19 of NodeList.hpp :
 20 {
 21     return static_cast<int>(nodes.size());
 22 }


Called by: sngcm::ast::ArrayLiteralNode::Clone , sngcm::ast::AxiomNode::Clone , sngcm::ast::BaseInitializerNode::Clone , sngcm::ast::CaseStatementNode::Clone , sngcm::ast::ClassDelegateNode::Clone , sngcm::ast::ClassMemberArranger::Visit , sngcm::ast::ClassMemberArranger::Visit , sngcm::ast::ClassNode::ArrangeMembers , sngcm::ast::ClassNode::Clone , sngcm::ast::CompoundStatementNode::Clone , sngcm::ast::ConceptIdNode::Arity , sngcm::ast::ConceptIdNode::Clone , sngcm::ast::ConceptIdNode::ToString , sngcm::ast::ConceptNode::Arity , sngcm::ast::ConceptNode::Clone , sngcm::ast::ConditionalCompilationPartNode::Clone , sngcm::ast::ConditionalCompilationStatementNode::AddElifStatement , sngcm::ast::ConditionalCompilationStatementNode::Clone , sngcm::ast::ConditionalCompilationStatementNode::SetElifKeywordSpan , sngcm::ast::ConditionalCompilationStatementNode::SetElifLeftParenSpan , sngcm::ast::ConditionalCompilationStatementNode::SetElifRightParenSpan , sngcm::ast::ConstructNode::Clone , sngcm::ast::ConstructNode::ToString , sngcm::ast::ConstructionStatementNode::Clone , sngcm::ast::ConstructorConstraintNode::Clone , sngcm::ast::ConstructorConstraintNode::ToString , sngcm::ast::ConstructorNode::Clone , sngcm::ast::DefaultStatementNode::Clone , sngcm::ast::DelegateNode::Clone , sngcm::ast::EnumTypeNode::Clone , sngcm::ast::EnumTypeNode::GetLastConstant , sngcm::ast::FunctionConstraintNode::Clone , sngcm::ast::FunctionConstraintNode::ToString , sngcm::ast::FunctionNode::Clone , sngcm::ast::FunctionNode::CloneContent , sngcm::ast::InterfaceNode::Clone , sngcm::ast::InvokeNode::Clone , sngcm::ast::InvokeNode::ToString , sngcm::ast::MemberFunctionConstraintNode::Clone , sngcm::ast::MemberFunctionConstraintNode::ToString , sngcm::ast::MemberInitializerNode::Clone , sngcm::ast::MergeVisitor::Visit , sngcm::ast::MergeVisitor::Visit , sngcm::ast::MultiParamConstraintNode::Clone , sngcm::ast::MultiParamConstraintNode::ToString , sngcm::ast::NamespaceCombiner::Visit , sngcm::ast::NamespaceNode::Clone , sngcm::ast::NewNode::Clone , sngcm::ast::NewNode::ToString , sngcm::ast::NodeSelectorVisitor::Visit , sngcm::ast::NodeSelectorVisitor::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::StaticConstructorNode::Clone , sngcm::ast::StructuredLiteralNode::Clone , sngcm::ast::SwitchStatementNode::Clone , sngcm::ast::TemplateIdNode::Clone , sngcm::ast::TemplateIdNode::ToString , sngcm::ast::ThisInitializerNode::Clone , sngcm::ast::TryStatementNode::Clone , sngcm::ast::UnnamedNamespaceProcessor::Visit


Insert Member Function

void sngcm::ast::NodeList::Insert(int index, T * node)

Definition at line 35 of NodeList.hpp :
 36 {
 37     if (index >= static_cast<int>(nodes.size()))
 38     {
 39         Add(node);
 40     }
 41     else
 42     {
 43         nodes.insert(nodes.begin() + indexstd::unique_ptr<T>(node));
 44     }
 45 }


Calls: sngcm::ast::NodeList::Add

Called by: sngcm::ast::ClassNode::ArrangeMembers , sngcm::ast::UnnamedNamespaceProcessor::Visit


Nodes Member Function

std::vector<std::unique_ptr<T >>& sngcm::ast::NodeList::Nodes()

Definition at line 97 of NodeList.hpp :
 97 { return nodes; }


Read Member Function

void sngcm::ast::NodeList::Read(AstReader & reader)

Definition at line 86 of NodeList.hpp :
 87 {
 88     uint32_t n = reader.GetBinaryReader().ReadULEB128UInt();
 89     for (uint32_t i = 0u; i < n; ++i)
 90     {
 91         Node* node = reader.ReadNode();
 92         T* asTPtrNode = dynamic_cast<T*>(node);
 93         Assert(asTPtrNode"wrong node type");
 94         nodes.push_back(std::unique_ptr<T>(asTPtrNode));
 95     }
 96 }


Calls: sngcm::ast::AstReader::GetBinaryReader , sngcm::ast::AstReader::ReadNode , soulng::util::BinaryReader::ReadULEB128UInt

Called by: sngcm::ast::ArrayLiteralNode::Read , sngcm::ast::AxiomNode::Read , sngcm::ast::CaseStatementNode::Read , sngcm::ast::ClassDelegateNode::Read , sngcm::ast::ClassNode::Read , sngcm::ast::CompoundStatementNode::Read , sngcm::ast::ConceptIdNode::Read , sngcm::ast::ConceptNode::Read , sngcm::ast::ConditionalCompilationPartNode::Read , sngcm::ast::ConditionalCompilationStatementNode::Read , sngcm::ast::ConstructNode::Read , sngcm::ast::ConstructionStatementNode::Read , sngcm::ast::ConstructorConstraintNode::Read , sngcm::ast::ConstructorNode::Read , sngcm::ast::DefaultStatementNode::Read , sngcm::ast::DelegateNode::Read , sngcm::ast::EnumTypeNode::Read , sngcm::ast::FunctionConstraintNode::Read , sngcm::ast::FunctionNode::Read , sngcm::ast::InitializerNode::Read , sngcm::ast::InterfaceNode::Read , sngcm::ast::InvokeNode::Read , sngcm::ast::MemberFunctionConstraintNode::Read , sngcm::ast::MultiParamConstraintNode::Read , sngcm::ast::NamespaceNode::Read , sngcm::ast::NewNode::Read , sngcm::ast::StaticConstructorNode::Read , sngcm::ast::StructuredLiteralNode::Read , sngcm::ast::SwitchStatementNode::Read , sngcm::ast::TemplateIdNode::Read , sngcm::ast::TryStatementNode::Read


Release Member Function

T * sngcm::ast::NodeList::Release(int index)

Definition at line 31 of NodeList.hpp :
 32 {
 33     return nodes[index].release();
 34 }


Called by: sngcm::ast::ClassNode::ArrangeMembers , sngcm::ast::NamespaceCombiner::Visit


RemoveEmpty Member Function

void sngcm::ast::NodeList::RemoveEmpty()

Definition at line 50 of NodeList.hpp

Called by: sngcm::ast::ClassNode::ArrangeMembers


SetContent Member Function

void sngcm::ast::NodeList::SetContent(std::vector<std::unique_ptr<T >>&& content)

Definition at line 99 of NodeList.hpp :
 99 { nodes = std::move(content); }

Called by: sngcm::ast::NamespaceCombiner::Visit


SetParent Member Function

void sngcm::ast::NodeList::SetParent(Node * parent)

Definition at line 70 of NodeList.hpp :
 71 {
 72     for (const std::std::unique_ptr<T>&node : nodes)
 73     {
 74         node->SetParent(parent);
 75     }
 76 }


Calls: sngcm::ast::NodeList::SetParent

Called by: sngcm::ast::AxiomNode::Read , sngcm::ast::CaseStatementNode::Read , sngcm::ast::ClassDelegateNode::Read , sngcm::ast::ClassNode::Read , sngcm::ast::CompoundStatementNode::Read , sngcm::ast::ConceptIdNode::Read , sngcm::ast::ConceptNode::Read , sngcm::ast::ConditionalCompilationPartNode::Read , sngcm::ast::ConditionalCompilationStatementNode::Read , sngcm::ast::ConstructNode::Read , sngcm::ast::ConstructionStatementNode::Read , sngcm::ast::ConstructorConstraintNode::Read , sngcm::ast::ConstructorNode::Read , sngcm::ast::DefaultStatementNode::Read , sngcm::ast::DelegateNode::Read , sngcm::ast::EnumTypeNode::Read , sngcm::ast::FunctionConstraintNode::Read , sngcm::ast::FunctionNode::Read , sngcm::ast::InitializerNode::Read , sngcm::ast::InterfaceNode::Read , sngcm::ast::InvokeNode::Read , sngcm::ast::MemberFunctionConstraintNode::Read , sngcm::ast::MultiParamConstraintNode::Read , sngcm::ast::NamespaceCombiner::Visit , sngcm::ast::NamespaceNode::Read , sngcm::ast::NewNode::Read , sngcm::ast::NodeList::SetParent , sngcm::ast::StaticConstructorNode::Read , sngcm::ast::SwitchStatementNode::Read , sngcm::ast::TemplateIdNode::Read , sngcm::ast::TryStatementNode::Read


Write Member Function

void sngcm::ast::NodeList::Write(AstWriter & writer)

Definition at line 77 of NodeList.hpp :
 78 {
 79     uint32_t n = static_cast<uint32_t>(nodes.size());
 80     writer.GetBinaryWriter().WriteULEB128UInt(n);
 81     for (uint32_t i = 0u; i < n; ++i)
 82     {
 83         writer.Write(nodes[i].get());
 84     }
 85 }


Calls: sngcm::ast::AstWriter::GetBinaryWriter , soulng::util::BinaryWriter::WriteULEB128UInt

Called by: sngcm::ast::ArrayLiteralNode::Write , sngcm::ast::AxiomNode::Write , sngcm::ast::CaseStatementNode::Write , sngcm::ast::ClassDelegateNode::Write , sngcm::ast::ClassNode::Write , sngcm::ast::CompoundStatementNode::Write , sngcm::ast::ConceptIdNode::Write , sngcm::ast::ConceptNode::Write , sngcm::ast::ConditionalCompilationPartNode::Write , sngcm::ast::ConditionalCompilationStatementNode::Write , sngcm::ast::ConstructNode::Write , sngcm::ast::ConstructionStatementNode::Write , sngcm::ast::ConstructorConstraintNode::Write , sngcm::ast::ConstructorNode::Write , sngcm::ast::DefaultStatementNode::Write , sngcm::ast::DelegateNode::Write , sngcm::ast::EnumTypeNode::Write , sngcm::ast::FunctionConstraintNode::Write , sngcm::ast::FunctionNode::Write , sngcm::ast::InitializerNode::Write , sngcm::ast::InterfaceNode::Write , sngcm::ast::InvokeNode::Write , sngcm::ast::MemberFunctionConstraintNode::Write , sngcm::ast::MultiParamConstraintNode::Write , sngcm::ast::NamespaceNode::Write , sngcm::ast::NewNode::Write , sngcm::ast::StaticConstructorNode::Write , sngcm::ast::StructuredLiteralNode::Write , sngcm::ast::SwitchStatementNode::Write , sngcm::ast::TemplateIdNode::Write , sngcm::ast::TryStatementNode::Write


operator[] Member Function

T * sngcm::ast::NodeList::operator[](int index) const

Definition at line 23 of NodeList.hpp :
 24 {
 25     return nodes[index].get();
 26 }



top | up | prev | next