top | up | prev | next

CastNode Class

Definition at line 472 of Expression.hpp

Constructors

CastNode(const Span& span_)
CastNode(const Span& span_, 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_)

Definition at line 1082 of Expression.cpp :
1082 : Node(NodeType::castNodespan_)targetTypeExpr()sourceExpr()
1083 {
1084 }


Declaration at line 475 of Expression.hpp


CastNode Constructor

sngcm::ast::CastNode::CastNode(const Span& span_, Node * targetTypeExpr_, Node * sourceExpr_)

Definition at line 1086 of Expression.cpp :
1086 : Node(NodeType::castNodespan_)targetTypeExpr(targetTypeExpr_)sourceExpr(sourceExpr_)
1087 {
1088     targetTypeExpr->SetParent(this);
1089     sourceExpr->SetParent(this);
1090 }


Declaration at line 476 of Expression.hpp


Member Function Details

Accept Member Function

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

Definition at line 1097 of Expression.cpp :
1098 {
1099     visitor.Visit(*this);
1100 }


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 1092 of Expression.cpp :
1093 {
1094     return new CastNode(GetSpan()targetTypeExpr->Clone(cloneContext)sourceExpr->Clone(cloneContext));
1095 }


Declaration at line 477 of Expression.hpp

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

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

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


Read Member Function

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

Definition at line 1109 of Expression.cpp :
1110 {
1111     Node::Read(reader);
1112     targetTypeExpr.reset(reader.ReadNode());
1113     targetTypeExpr->SetParent(this);
1114     sourceExpr.reset(reader.ReadNode());
1115     sourceExpr->SetParent(this);
1116 }


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 1118 of Expression.cpp :
1119 {
1120     return "cast<" + targetTypeExpr->ToString() + ">(" + sourceExpr->ToString() + ")";
1121 }


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 1102 of Expression.cpp :
1103 {
1104     Node::Write(writer);
1105     writer.Write(targetTypeExpr.get());
1106     writer.Write(sourceExpr.get());
1107 }


Declaration at line 479 of Expression.hpp

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

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


top | up | prev | next