top | up | prev | next

TryStatementNode Class

Definition at line 501 of Statement.hpp

Constructors

TryStatementNode(const Span& span_)
TryStatementNode(const Span& span_, CompoundStatementNode* tryBlock_)

Member Functions

void Accept(Visitor& visitor) override
void AddCatch(CatchNode* catch_)
const NodeList<CatchNode>& Catches() const
Node* Clone(CloneContext& cloneContext) const override
void Read(AstReader& reader) override
const CompoundStatementNode* TryBlock() const
CompoundStatementNode* TryBlock()
void Write(AstWriter& writer) override

Member Variables

NodeList<CatchNode> catches
std::unique_ptr<CompoundStatementNode> tryBlock

Constructor Details

TryStatementNode Constructor

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

Definition at line 1102 of Statement.cpp :
1102 : StatementNode(NodeType::tryStatementNodespan_)tryBlock()catches()
1103 {
1104 }


Declaration at line 504 of Statement.hpp


TryStatementNode Constructor

sngcm::ast::TryStatementNode::TryStatementNode(const Span& span_, CompoundStatementNode * tryBlock_)

Definition at line 1106 of Statement.cpp :
1106 : StatementNode(NodeType::tryStatementNodespan_)tryBlock(tryBlock_)catches()
1107 {
1108     tryBlock->SetParent(this);
1109 }


Declaration at line 505 of Statement.hpp


Member Function Details

Accept Member Function

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

Definition at line 1122 of Statement.cpp :
1123 {
1124     visitor.Visit(*this);
1125 }


Declaration at line 507 of Statement.hpp

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

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


AddCatch Member Function

void sngcm::ast::TryStatementNode::AddCatch(CatchNode * catch_)

Definition at line 1143 of Statement.cpp :
1144 {
1145     catch_->SetParent(this);
1146     catches.Add(catch_);
1147 }


Declaration at line 513 of Statement.hpp

Calls: sngcm::ast::Node::SetParent , sngcm::ast::NodeList::Add

Called by: sngcm::ast::TryStatementNode::Clone


Catches Member Function

const NodeList <CatchNode >& sngcm::ast::TryStatementNode::Catches() const

Definition at line 512 of Statement.hpp :
512 { return catches; }

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


Clone Member Function

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

Definition at line 1111 of Statement.cpp :
1112 {
1113     TryStatementNode* clone = new TryStatementNode(GetSpan()static_cast<CompoundStatementNode*>(tryBlock->Clone(cloneContext)));
1114     int n = catches.Count();
1115     for (int i = 0; i < n; ++i)
1116     {
1117         clone->AddCatch(static_cast<CatchNode*>(catches[i]->Clone(cloneContext)));
1118     }
1119     return clone;
1120 }


Declaration at line 506 of Statement.hpp

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

Calls: sngcm::ast::Node::GetSpan , sngcm::ast::NodeList::Count , sngcm::ast::TryStatementNode::AddCatch , sngcm::ast::TryStatementNode::Clone

Called by: sngcm::ast::TryStatementNode::Clone


Read Member Function

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

Definition at line 1134 of Statement.cpp :
1135 {
1136     StatementNode::Read(reader);
1137     tryBlock.reset(reader.ReadCompoundStatementNode());
1138     tryBlock->SetParent(this);
1139     catches.Read(reader);
1140     catches.SetParent(this);
1141 }


Declaration at line 509 of Statement.hpp

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

Calls: sngcm::ast::AstReader::ReadCompoundStatementNode , sngcm::ast::Node::SetParent , sngcm::ast::NodeList::Read , sngcm::ast::NodeList::SetParent , sngcm::ast::StatementNode::Read


TryBlock Member Function

const CompoundStatementNode * sngcm::ast::TryStatementNode::TryBlock() const

Definition at line 510 of Statement.hpp :
510 { return tryBlock.get(); }


TryBlock Member Function

CompoundStatementNode * sngcm::ast::TryStatementNode::TryBlock()

Definition at line 511 of Statement.hpp :
511 { return tryBlock.get(); }

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


Write Member Function

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

Definition at line 1127 of Statement.cpp :
1128 {
1129     StatementNode::Write(writer);
1130     writer.Write(tryBlock.get());
1131     catches.Write(writer);
1132 }


Declaration at line 508 of Statement.hpp

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

Calls: sngcm::ast::NodeList::Write , sngcm::ast::StatementNode::Write


top | up | prev | next