top | up | prev | next

TryStatementNode Class

Definition at line 513 of Statement.hpp

Constructors

TryStatementNode(const Span& span_, const boost::uuids::uuid& moduleId_)
TryStatementNode(const Span& span_, const boost::uuids::uuid& moduleId_, 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_, const boost::uuids::uuid& moduleId_)

Definition at line 1164 of Statement.cpp :
1164 :
1165 StatementNode(NodeType::tryStatementNodespan_moduleId_)tryBlock()catches()
1166 {
1167 }


Declaration at line 516 of Statement.hpp


TryStatementNode Constructor

sngcm::ast::TryStatementNode::TryStatementNode(const Span& span_, const boost::uuids::uuid& moduleId_, CompoundStatementNode * tryBlock_)

Definition at line 1169 of Statement.cpp :
1169 :
1170 StatementNode(NodeType::tryStatementNodespan_moduleId_)tryBlock(tryBlock_)catches()
1171 {
1172     tryBlock->SetParent(this);
1173 }


Declaration at line 517 of Statement.hpp


Member Function Details

Accept Member Function

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

Definition at line 1186 of Statement.cpp :
1187 {
1188     visitor.Visit(*this);
1189 }


Declaration at line 519 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 1207 of Statement.cpp :
1208 {
1209     catch_->SetParent(this);
1210     catches.Add(catch_);
1211 }


Declaration at line 525 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 524 of Statement.hpp :
524 { return catches; }

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


Clone Member Function

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

Definition at line 1175 of Statement.cpp :
1176 {
1177     TryStatementNode* clone = new TryStatementNode(GetSpan()ModuleId()static_cast<CompoundStatementNode*>(tryBlock->Clone(cloneContext)));
1178     int n = catches.Count();
1179     for (int i = 0; i < n; ++i)
1180     {
1181         clone->AddCatch(static_cast<CatchNode*>(catches[i]->Clone(cloneContext)));
1182     }
1183     return clone;
1184 }


Declaration at line 518 of Statement.hpp

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

Calls: sngcm::ast::Node::GetSpan , sngcm::ast::Node::ModuleId , 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 1198 of Statement.cpp :
1199 {
1200     StatementNode::Read(reader);
1201     tryBlock.reset(reader.ReadCompoundStatementNode());
1202     tryBlock->SetParent(this);
1203     catches.Read(reader);
1204     catches.SetParent(this);
1205 }


Declaration at line 521 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 522 of Statement.hpp :
522 { return tryBlock.get(); }


TryBlock Member Function

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

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

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


Write Member Function

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

Definition at line 1191 of Statement.cpp :
1192 {
1193     StatementNode::Write(writer);
1194     writer.Write(tryBlock.get());
1195     catches.Write(writer);
1196 }


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