top | up | prev | next

ConstNode Class

Definition at line 12 of TypeExpr.hpp

Constructors

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

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


Declaration at line 15 of TypeExpr.hpp


ConstNode Constructor

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

Definition at line 17 of TypeExpr.cpp :
 17 : Node(NodeType::constNodespan_moduleId_)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 28 of TypeExpr.cpp :
 29 {
 30     visitor.Visit(*this);
 31 }


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     ConstNode* clone = new ConstNode(GetSpan()ModuleId()subject->Clone(cloneContext));
 25     return clone;
 26 }


Declaration at line 17 of TypeExpr.hpp

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

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

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


Read Member Function

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

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


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 46 of TypeExpr.cpp :
 47 {
 48     return "const " + subject->ToString();
 49 }


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 33 of TypeExpr.cpp :
 34 {
 35     Node::Write(writer);
 36     writer.Write(subject.get());
 37 }


Declaration at line 19 of TypeExpr.hpp

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

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


top | up | prev | next