top | up | prev | next

CastNode Class

Definition at line 472 of Expression.hpp

Constructors

CastNode(const Span& span_, const boost::uuids::uuid& moduleId_)
CastNode(const Span& span_, const boost::uuids::uuid& moduleId_, Node* targetTypeExpr_, Node* sourceExpr_)

Member Functions

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

Member Variables

std::unique_ptr<Node> sourceExpr
std::unique_ptr<Node> targetTypeExpr

Constructor Details

CastNode Constructor

sngcm::ast::CastNode::CastNode(const Span& span_, const boost::uuids::uuid& moduleId_)

Definition at line 1143 of Expression.cpp :
1143 : Node(NodeType::castNodespan_moduleId_)targetTypeExpr()sourceExpr()
1144 {
1145 }


Declaration at line 475 of Expression.hpp


CastNode Constructor

sngcm::ast::CastNode::CastNode(const Span& span_, const boost::uuids::uuid& moduleId_, Node * targetTypeExpr_, Node * sourceExpr_)

Definition at line 1147 of Expression.cpp :
1147 :
1148 Node(NodeType::castNodespan_moduleId_)targetTypeExpr(targetTypeExpr_)sourceExpr(sourceExpr_)
1149 {
1150     targetTypeExpr->SetParent(this);
1151     sourceExpr->SetParent(this);
1152 }


Declaration at line 476 of Expression.hpp


Member Function Details

Accept Member Function

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

Definition at line 1160 of Expression.cpp :
1161 {
1162     visitor.Visit(*this);
1163 }


Declaration at line 478 of Expression.hpp

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

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


Clone Member Function

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

Definition at line 1154 of Expression.cpp :
1155 {
1156     CastNode* clone = new CastNode(GetSpan()ModuleId()targetTypeExpr->Clone(cloneContext)sourceExpr->Clone(cloneContext));
1157     return clone;
1158 }


Declaration at line 477 of Expression.hpp

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

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

Called by: sngcm::ast::CastNode::Clone


Read Member Function

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

Definition at line 1172 of Expression.cpp :
1173 {
1174     Node::Read(reader);
1175     targetTypeExpr.reset(reader.ReadNode());
1176     targetTypeExpr->SetParent(this);
1177     sourceExpr.reset(reader.ReadNode());
1178     sourceExpr->SetParent(this);
1179 }


Declaration at line 480 of Expression.hpp

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

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


SourceExpr Member Function

const Node * sngcm::ast::CastNode::SourceExpr() const

Definition at line 483 of Expression.hpp :
483 { return sourceExpr.get(); }


SourceExpr Member Function

Node * sngcm::ast::CastNode::SourceExpr()

Definition at line 484 of Expression.hpp :
484 { return sourceExpr.get(); }

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


TargetTypeExpr Member Function

const Node * sngcm::ast::CastNode::TargetTypeExpr() const

Definition at line 481 of Expression.hpp :
481 { return targetTypeExpr.get(); }


TargetTypeExpr Member Function

Node * sngcm::ast::CastNode::TargetTypeExpr()

Definition at line 482 of Expression.hpp :
482 { return targetTypeExpr.get(); }

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


ToString Member Function

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

Definition at line 1181 of Expression.cpp :
1182 {
1183     return "cast<" + targetTypeExpr->ToString() + ">(" + sourceExpr->ToString() + ")";
1184 }


Declaration at line 485 of Expression.hpp

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

Calls: sngcm::ast::CastNode::ToString

Called by: sngcm::ast::CastNode::ToString


Write Member Function

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

Definition at line 1165 of Expression.cpp :
1166 {
1167     Node::Write(writer);
1168     writer.Write(targetTypeExpr.get());
1169     writer.Write(sourceExpr.get());
1170 }


Declaration at line 479 of Expression.hpp

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

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


top | up | prev | next