top | up | prev | next

ThrowStatementNode Class

Definition at line 493 of Statement.hpp

Constructors

ThrowStatementNode(const Span& span_, const boost::uuids::uuid& moduleId_)
ThrowStatementNode(const Span& span_, const boost::uuids::uuid& moduleId_, Node* expression_)

Member Functions

void Accept(Visitor& visitor) override
Node* Clone(CloneContext& cloneContext) const override
const Node* Expression() const
Node* Expression()
bool IsCaseTerminatingNode() const override
bool IsDefaultTerminatingNode() const override
bool IsFunctionTerminatingNode() const override
void Read(AstReader& reader) override
void Write(AstWriter& writer) override

Member Variables

std::unique_ptr<Node> expression

Constructor Details

ThrowStatementNode Constructor

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

Definition at line 1046 of Statement.cpp :
1046 :
1047 StatementNode(NodeType::throwStatementNodespan_moduleId_)expression()
1048 {
1049 }


Declaration at line 496 of Statement.hpp


ThrowStatementNode Constructor

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

Definition at line 1051 of Statement.cpp :
1051 :
1052 StatementNode(NodeType::throwStatementNodespan_moduleId_)expression(expression_)
1053 {
1054     if (expression)
1055     {
1056         expression->SetParent(this);
1057     }
1058 }


Declaration at line 497 of Statement.hpp


Member Function Details

Accept Member Function

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

Definition at line 1071 of Statement.cpp :
1072 {
1073     visitor.Visit(*this);
1074 }


Declaration at line 499 of Statement.hpp

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

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


Clone Member Function

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

Definition at line 1060 of Statement.cpp :
1061 {
1062     Node* clonedExpression = nullptr;
1063     if (expression)
1064     {
1065         clonedExpression = expression->Clone(cloneContext);
1066     }
1067     ThrowStatementNode* clone = new ThrowStatementNode(GetSpan()ModuleId()clonedExpression);
1068     return clone;
1069 }


Declaration at line 498 of Statement.hpp

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

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

Called by: sngcm::ast::ThrowStatementNode::Clone


Expression Member Function

const Node * sngcm::ast::ThrowStatementNode::Expression() const

Definition at line 505 of Statement.hpp :
505 { return expression.get(); }


Expression Member Function

Node * sngcm::ast::ThrowStatementNode::Expression()

Definition at line 506 of Statement.hpp :
506 { return expression.get(); }

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


IsCaseTerminatingNode Member Function

bool sngcm::ast::ThrowStatementNode::IsCaseTerminatingNode() const override

Definition at line 503 of Statement.hpp :
503 { return true; }

Base class overridden functions: sngcm::ast::StatementNode::IsCaseTerminatingNode


IsDefaultTerminatingNode Member Function

bool sngcm::ast::ThrowStatementNode::IsDefaultTerminatingNode() const override

Definition at line 504 of Statement.hpp :
504 { return true; }

Base class overridden functions: sngcm::ast::StatementNode::IsDefaultTerminatingNode


IsFunctionTerminatingNode Member Function

bool sngcm::ast::ThrowStatementNode::IsFunctionTerminatingNode() const override

Definition at line 502 of Statement.hpp :
502 { return true; }

Base class overridden functions: sngcm::ast::StatementNode::IsFunctionTerminatingNode


Read Member Function

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

Definition at line 1087 of Statement.cpp :
1088 {
1089     StatementNode::Read(reader);
1090     bool hasExpression = reader.GetBinaryReader().ReadBool();
1091     if (hasExpression)
1092     {
1093         expression.reset(reader.ReadNode());
1094         expression->SetParent(this);
1095     }
1096 }


Declaration at line 501 of Statement.hpp

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

Calls: sngcm::ast::AstReader::GetBinaryReader , sngcm::ast::AstReader::ReadNode , sngcm::ast::Node::SetParent , sngcm::ast::StatementNode::Read , soulng::util::BinaryReader::ReadBool


Write Member Function

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

Definition at line 1076 of Statement.cpp :
1077 {
1078     StatementNode::Write(writer);
1079     bool hasExpression = expression != nullptr;
1080     writer.GetBinaryWriter().Write(hasExpression);
1081     if (hasExpression)
1082     {
1083         writer.Write(expression.get());
1084     }
1085 }


Declaration at line 500 of Statement.hpp

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

Calls: sngcm::ast::AstWriter::GetBinaryWriter , sngcm::ast::StatementNode::Write , soulng::util::BinaryWriter::Write


top | up | prev | next