top | up | prev | next

TemplateParameterNode Class

Definition at line 33 of Template.hpp

Constructors

TemplateParameterNode(const Span& span_)
TemplateParameterNode(const Span& span_, IdentifierNode* id_, Node* defaultTemplateArgument_)

Member Functions

void Accept(Visitor& visitor) override
Node* Clone(CloneContext& cloneContext) const override
const Node* DefaultTemplateArgument() const
Node* DefaultTemplateArgument()
const IdentifierNode* Id() const
IdentifierNode* Id()
void Read(AstReader& reader) override
void Write(AstWriter& writer) override

Member Variables

std::unique_ptr<Node> defaultTemplateArgument
std::unique_ptr<IdentifierNode> id

Constructor Details

TemplateParameterNode Constructor

sngcm::ast::TemplateParameterNode::TemplateParameterNode(const Span& span_)

Definition at line 77 of Template.cpp :
 77 : Node(NodeType::templateParameterNodespan_)id()
 78 {
 79 }


Declaration at line 36 of Template.hpp


TemplateParameterNode Constructor

sngcm::ast::TemplateParameterNode::TemplateParameterNode(const Span& span_, IdentifierNode * id_, Node * defaultTemplateArgument_)

Definition at line 81 of Template.cpp :
 81 :
 82 Node(NodeType::templateParameterNodespan_)id(id_)defaultTemplateArgument(defaultTemplateArgument_)
 83 {
 84     id->SetParent(this);
 85     if (defaultTemplateArgument)
 86     {
 87         defaultTemplateArgument->SetParent(this);
 88     }
 89 }


Declaration at line 37 of Template.hpp


Member Function Details

Accept Member Function

void sngcm::ast::TemplateParameterNode::Accept(Visitor & visitor) override

Definition at line 101 of Template.cpp :
102 {
103     visitor.Visit(*this);
104 }


Declaration at line 39 of Template.hpp

Base class overridden functions: sngcm::ast::Node::Accept

Calls: sngcm::ast::Visitor::Visit


Clone Member Function

Node * sngcm::ast::TemplateParameterNode::Clone(CloneContext & cloneContext) const override

Definition at line 91 of Template.cpp :
 92 {
 93     Node* clonedDefaultTemplateArgument = nullptr;
 94     if (defaultTemplateArgument)
 95     {
 96         clonedDefaultTemplateArgument = defaultTemplateArgument->Clone(cloneContext);
 97     }
 98     return new TemplateParameterNode(GetSpan()static_cast<IdentifierNode*>(id->Clone(cloneContext))clonedDefaultTemplateArgument);
 99 }


Declaration at line 38 of Template.hpp

Base class overridden functions: sngcm::ast::Node::Clone

Calls: sngcm::ast::Node::GetSpan , sngcm::ast::TemplateParameterNode::Clone

Called by: sngcm::ast::TemplateParameterNode::Clone


DefaultTemplateArgument Member Function

const Node * sngcm::ast::TemplateParameterNode::DefaultTemplateArgument() const

Definition at line 44 of Template.hpp :
44 { return defaultTemplateArgument.get(); }


DefaultTemplateArgument Member Function

Node * sngcm::ast::TemplateParameterNode::DefaultTemplateArgument()

Definition at line 45 of Template.hpp :
45 { return defaultTemplateArgument.get(); }

Called by: sngcm::ast::SourceWriter::Visit


Id Member Function

const IdentifierNode * sngcm::ast::TemplateParameterNode::Id() const

Definition at line 42 of Template.hpp :
42 { return id.get(); }


Id Member Function

IdentifierNode * sngcm::ast::TemplateParameterNode::Id()

Definition at line 43 of Template.hpp :
43 { return id.get(); }

Called by: sngcm::ast::SourceWriter::Visit


Read Member Function

void sngcm::ast::TemplateParameterNode::Read(AstReader & reader) override

Definition at line 118 of Template.cpp
Declaration at line 41 of Template.hpp

Base class overridden functions: sngcm::ast::Node::Read

Calls: sngcm::ast::AstReader::GetBinaryReader , sngcm::ast::AstReader::ReadIdentifierNode , sngcm::ast::AstReader::ReadNode , sngcm::ast::Node::Read , sngcm::ast::Node::SetParent , soulng::util::BinaryReader::ReadBool


Write Member Function

void sngcm::ast::TemplateParameterNode::Write(AstWriter & writer) override

Definition at line 106 of Template.cpp :
107 {
108     Node::Write(writer);
109     writer.Write(id.get());
110     bool hasDefaultTemplateArgument = defaultTemplateArgument != nullptr;
111     writer.GetBinaryWriter().Write(hasDefaultTemplateArgument);
112     if (hasDefaultTemplateArgument)
113     {
114         writer.Write(defaultTemplateArgument.get());
115     }
116 }


Declaration at line 40 of Template.hpp

Base class overridden functions: sngcm::ast::Node::Write

Calls: sngcm::ast::AstWriter::GetBinaryWriter , sngcm::ast::Node::Write , soulng::util::BinaryWriter::Write


top | up | prev | next