top | up | prev | next

ArrayNode Class

Definition at line 76 of TypeExpr.hpp

Constructors

ArrayNode(const Span& span_)
ArrayNode(const Span& span_, Node* subject_, Node* size_)

Member Functions

void Accept(Visitor& visitor) override
Node* Clone(CloneContext& cloneContext) const override
void Read(AstReader& reader) override
const Node* Size() const
Node* Size()
const Node* Subject() const
Node* Subject()
std::string ToString() const override
void Write(AstWriter& writer) override

Member Variables

std::unique_ptr<Node> size
std::unique_ptr<Node> subject

Constructor Details

ArrayNode Constructor

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

Definition at line 161 of TypeExpr.cpp :
161 : Node(NodeType::arrayNodespan_)subject()size()
162 {
163 }


Declaration at line 79 of TypeExpr.hpp


ArrayNode Constructor

sngcm::ast::ArrayNode::ArrayNode(const Span& span_, Node * subject_, Node * size_)

Definition at line 165 of TypeExpr.cpp :
165 : Node(NodeType::arrayNodespan_)subject(subject_)size(size_)
166 {
167     subject->SetParent(this);
168     if (size)
169     {
170         size->SetParent(this);
171     }
172 }


Declaration at line 80 of TypeExpr.hpp


Member Function Details

Accept Member Function

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

Definition at line 184 of TypeExpr.cpp :
185 {
186     visitor.Visit(*this);
187 }


Declaration at line 82 of TypeExpr.hpp

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

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


Clone Member Function

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

Definition at line 174 of TypeExpr.cpp :
175 {
176     Node* clonedSize = nullptr;
177     if (size)
178     {
179         clonedSize = size->Clone(cloneContext);
180     }
181     return new ArrayNode(GetSpan()subject->Clone(cloneContext)clonedSize);
182 }


Declaration at line 81 of TypeExpr.hpp

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

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

Called by: sngcm::ast::ArrayNode::Clone


Read Member Function

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

Definition at line 201 of TypeExpr.cpp
Declaration at line 84 of TypeExpr.hpp

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

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


Size Member Function

const Node * sngcm::ast::ArrayNode::Size() const

Definition at line 88 of TypeExpr.hpp :
88 { return size.get(); }


Size Member Function

Node * sngcm::ast::ArrayNode::Size()

Definition at line 89 of TypeExpr.hpp :
89 { return size.get(); }

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


Subject Member Function

const Node * sngcm::ast::ArrayNode::Subject() const

Definition at line 86 of TypeExpr.hpp :
86 { return subject.get(); }


Subject Member Function

Node * sngcm::ast::ArrayNode::Subject()

Definition at line 87 of TypeExpr.hpp :
87 { return subject.get(); }

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


ToString Member Function

std::string sngcm::ast::ArrayNode::ToString() const override

Definition at line 214 of TypeExpr.cpp :
215 {
216     std::string s = subject->ToString();
217     s.append("[");
218     if (size)
219     {
220         s.append(size->ToString());
221     }
222     s.append("]");
223     return s;
224 }


Declaration at line 85 of TypeExpr.hpp

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

Calls: sngcm::ast::ArrayNode::ToString

Called by: sngcm::ast::ArrayNode::ToString


Write Member Function

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

Definition at line 189 of TypeExpr.cpp :
190 {
191     Node::Write(writer);
192     writer.Write(subject.get());
193     bool hasSize = size != nullptr;
194     writer.GetBinaryWriter().Write(hasSize);
195     if (hasSize)
196     {
197         writer.Write(size.get());
198     }
199 }


Declaration at line 83 of TypeExpr.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