top | up | prev | next

AsNode Class

Definition at line 344 of Expression.hpp

Constructors

AsNode(const Span& span_)
AsNode(const Span& span_, Node* expr_, Node* targetTypeExpr_)

Member Functions

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

Member Variables

std::unique_ptr<Node> expr
std::unique_ptr<Node> targetTypeExpr

Constructor Details

AsNode Constructor

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

Definition at line 771 of Expression.cpp :
 771 : Node(NodeType::asNodespan_)expr()targetTypeExpr()
 772 {
 773 }


Declaration at line 347 of Expression.hpp


AsNode Constructor

sngcm::ast::AsNode::AsNode(const Span& span_, Node * expr_, Node * targetTypeExpr_)

Definition at line 775 of Expression.cpp :
 775 : Node(NodeType::asNodespan_)expr(expr_)targetTypeExpr(targetTypeExpr_)
 776 {
 777     expr->SetParent(this);
 778     targetTypeExpr->SetParent(this);
 779 }


Declaration at line 348 of Expression.hpp


Member Function Details

Accept Member Function

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

Definition at line 786 of Expression.cpp :
 787 {
 788     visitor.Visit(*this);
 789 }


Declaration at line 350 of Expression.hpp

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

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


Clone Member Function

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

Definition at line 781 of Expression.cpp :
 782 {
 783     return new AsNode(GetSpan()expr->Clone(cloneContext)targetTypeExpr->Clone(cloneContext));
 784 }


Declaration at line 349 of Expression.hpp

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

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

Called by: sngcm::ast::AsNode::Clone


Expr Member Function

const Node * sngcm::ast::AsNode::Expr() const

Definition at line 353 of Expression.hpp :
353 { return expr.get(); }


Expr Member Function

Node * sngcm::ast::AsNode::Expr()

Definition at line 354 of Expression.hpp :
354 { return expr.get(); }

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


Read Member Function

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

Definition at line 798 of Expression.cpp :
 799 {
 800     Node::Read(reader);
 801     expr.reset(reader.ReadNode());
 802     expr->SetParent(this);
 803     targetTypeExpr.reset(reader.ReadNode());
 804     targetTypeExpr->SetParent(this);
 805 }


Declaration at line 352 of Expression.hpp

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

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


TargetTypeExpr Member Function

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

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


TargetTypeExpr Member Function

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

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

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


ToString Member Function

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

Definition at line 807 of Expression.cpp :
 808 {
 809     return expr->ToString() + " as " + targetTypeExpr->ToString();
 810 }


Declaration at line 357 of Expression.hpp

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

Calls: sngcm::ast::AsNode::ToString

Called by: sngcm::ast::AsNode::ToString


Write Member Function

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

Definition at line 791 of Expression.cpp :
 792 {
 793     Node::Write(writer);
 794     writer.Write(expr.get());
 795     writer.Write(targetTypeExpr.get());
 796 }


Declaration at line 351 of Expression.hpp

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

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


top | up | prev | next