top | up | prev | next

ThrowStatementNode Class

Definition at line 481 of Statement.hpp

Constructors

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

Definition at line 987 of Statement.cpp :
 987 : StatementNode(NodeType::throwStatementNodespan_)expression()
 988 {
 989 }


Declaration at line 484 of Statement.hpp


ThrowStatementNode Constructor

sngcm::ast::ThrowStatementNode::ThrowStatementNode(const Span& span_, Node * expression_)

Definition at line 991 of Statement.cpp :
 991 : StatementNode(NodeType::throwStatementNodespan_)expression(expression_)
 992 {
 993     if (expression)
 994     {
 995         expression->SetParent(this);
 996     }
 997 }


Declaration at line 485 of Statement.hpp


Member Function Details

Accept Member Function

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

Definition at line 1010 of Statement.cpp :
1011 {
1012     visitor.Visit(*this);
1013 }


Declaration at line 487 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 999 of Statement.cpp :
1000 {
1001     Node* clonedExpression = nullptr;
1002     if (expression)
1003     {
1004         clonedExpression = expression->Clone(cloneContext);
1005     }
1006     ThrowStatementNode* clone = new ThrowStatementNode(GetSpan()clonedExpression);
1007     return clone;
1008 }


Declaration at line 486 of Statement.hpp

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

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

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


Expression Member Function

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

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


Expression Member Function

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

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

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


IsCaseTerminatingNode Member Function

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

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

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


IsDefaultTerminatingNode Member Function

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

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

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


IsFunctionTerminatingNode Member Function

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

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

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


Read Member Function

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

Definition at line 1026 of Statement.cpp :
1027 {
1028     StatementNode::Read(reader);
1029     bool hasExpression = reader.GetBinaryReader().ReadBool();
1030     if (hasExpression)
1031     {
1032         expression.reset(reader.ReadNode());
1033         expression->SetParent(this);
1034     }
1035 }


Declaration at line 489 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 1015 of Statement.cpp :
1016 {
1017     StatementNode::Write(writer);
1018     bool hasExpression = expression != nullptr;
1019     writer.GetBinaryWriter().Write(hasExpression);
1020     if (hasExpression)
1021     {
1022         writer.Write(expression.get());
1023     }
1024 }


Declaration at line 488 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