top | up | prev | next

ArrayNode Class

Definition at line 76 of TypeExpr.hpp

Constructors

ArrayNode(const Span& span_, const boost::uuids::uuid& moduleId_)
ArrayNode(const Span& span_, const boost::uuids::uuid& moduleId_, 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_, const boost::uuids::uuid& moduleId_)

Definition at line 168 of TypeExpr.cpp :
168 : Node(NodeType::arrayNodespan_moduleId_)subject()size()
169 {
170 }


Declaration at line 79 of TypeExpr.hpp


ArrayNode Constructor

sngcm::ast::ArrayNode::ArrayNode(const Span& span_, const boost::uuids::uuid& moduleId_, Node * subject_, Node * size_)

Definition at line 172 of TypeExpr.cpp :
172 :
173 Node(NodeType::arrayNodespan_moduleId_)subject(subject_)size(size_)
174 {
175     subject->SetParent(this);
176     if (size)
177     {
178         size->SetParent(this);
179     }
180 }


Declaration at line 80 of TypeExpr.hpp


Member Function Details

Accept Member Function

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

Definition at line 193 of TypeExpr.cpp :
194 {
195     visitor.Visit(*this);
196 }


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 182 of TypeExpr.cpp :
183 {
184     Node* clonedSize = nullptr;
185     if (size)
186     {
187         clonedSize = size->Clone(cloneContext);
188     }
189     ArrayNode* clone = new ArrayNode(GetSpan()ModuleId()subject->Clone(cloneContext)clonedSize);
190     return clone;
191 }


Declaration at line 81 of TypeExpr.hpp

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

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

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


Read Member Function

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

Definition at line 210 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 223 of TypeExpr.cpp :
224 {
225     std::string s = subject->ToString();
226     s.append("[");
227     if (size)
228     {
229         s.append(size->ToString());
230     }
231     s.append("]");
232     return s;
233 }


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 198 of TypeExpr.cpp :
199 {
200     Node::Write(writer);
201     writer.Write(subject.get());
202     bool hasSize = size != nullptr;
203     writer.GetBinaryWriter().Write(hasSize);
204     if (hasSize)
205     {
206         writer.Write(size.get());
207     }
208 }


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