top | up | prev | next

ConstNode Class

Definition at line 12 of TypeExpr.hpp

Constructors

ConstNode(const Span& span_)
ConstNode(const Span& span_, Node* subject_)

Member Functions

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

Member Variables

std::unique_ptr<Node> subject

Constructor Details

ConstNode Constructor

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

Definition at line 13 of TypeExpr.cpp :
 13 : Node(NodeType::constNodespan_)
 14 {
 15 }


Declaration at line 15 of TypeExpr.hpp


ConstNode Constructor

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

Definition at line 17 of TypeExpr.cpp :
 17 : Node(NodeType::constNodespan_)subject(subject_)
 18 {
 19     subject->SetParent(this);
 20 }


Declaration at line 16 of TypeExpr.hpp


Member Function Details

Accept Member Function

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

Definition at line 27 of TypeExpr.cpp :
 28 {
 29     visitor.Visit(*this);
 30 }


Declaration at line 18 of TypeExpr.hpp

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

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


Clone Member Function

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

Definition at line 22 of TypeExpr.cpp :
 23 {
 24     return new ConstNode(GetSpan()subject->Clone(cloneContext));
 25 }


Declaration at line 17 of TypeExpr.hpp

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

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

Called by: sngcm::ast::ConstNode::Clone


Read Member Function

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

Definition at line 38 of TypeExpr.cpp :
 39 {
 40     Node::Read(reader);
 41     subject.reset(reader.ReadNode());
 42     subject->SetParent(this);
 43 }


Declaration at line 20 of TypeExpr.hpp

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

Calls: sngcm::ast::AstReader::ReadNode , sngcm::ast::Node::Read , sngcm::ast::Node::SetParent


Subject Member Function

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

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


Subject Member Function

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

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

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


ToString Member Function

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

Definition at line 45 of TypeExpr.cpp :
 46 {
 47     return "const " + subject->ToString();
 48 }


Declaration at line 21 of TypeExpr.hpp

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

Calls: sngcm::ast::ConstNode::ToString

Called by: sngcm::ast::ConstNode::ToString


Write Member Function

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

Definition at line 32 of TypeExpr.cpp :
 33 {
 34     Node::Write(writer);
 35     writer.Write(subject.get());
 36 }


Declaration at line 19 of TypeExpr.hpp

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

Calls: sngcm::ast::Node::Write


top | up | prev | next