top | up | prev | next

TryStatementNode Class

Definition at line 230 of Statement.hpp

Constructors

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

Member Functions

void Accept(Visitor& visitor) override
void AddHandler(const Span& span, Node* handler)
Node* Handlers()
void Read(Reader& reader) override
CompoundStatementNode* TryBlock()
void Write(Writer& writer) override

Member Variables

std::unique_ptr<Node> handlers
std::unique_ptr<CompoundStatementNode> tryBlock

Constructor Details

TryStatementNode Constructor

sngcpp::ast::TryStatementNode::TryStatementNode()

Definition at line 438 of Statement.cpp :
438 : Node(NodeType::tryStatementNode)
439 {
440 }


Declaration at line 233 of Statement.hpp


TryStatementNode Constructor

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

Definition at line 442 of Statement.cpp :
442 : Node(NodeType::tryStatementNodespan_)tryBlock(tryBlock_)
443 {
444 }


Declaration at line 234 of Statement.hpp


Member Function Details

Accept Member Function

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

Definition at line 446 of Statement.cpp :
447 {
448     visitor.Visit(*this);
449 }


Declaration at line 235 of Statement.hpp

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

Calls: sngcpp::ast::Visitor::Visit


AddHandler Member Function

void sngcpp::ast::TryStatementNode::AddHandler(const Span& span, Node * handler)

Definition at line 473 of Statement.cpp :
474 {
475     if (handlers)
476     {
477         handlers.reset(new HandlerSequenceNode(spanhandlers.release()handler));
478     }
479     else
480     {
481         handlers.reset(handler);
482     }
483 }


Declaration at line 238 of Statement.hpp


Handlers Member Function

Node * sngcpp::ast::TryStatementNode::Handlers()

Definition at line 240 of Statement.hpp :
240 { return handlers.get(); }


Read Member Function

void sngcpp::ast::TryStatementNode::Read(Reader & reader) override

Definition at line 462 of Statement.cpp :
463 {
464     Node::Read(reader);
465     tryBlock.reset(reader.ReadCompoundStatementNode());
466     bool hasHandlers = reader.GetBinaryReader().ReadBool();
467     if (hasHandlers)
468     {
469         handlers.reset(reader.ReadNode());
470     }
471 }


Declaration at line 237 of Statement.hpp

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

Calls: sngcpp::ast::Node::Read , sngcpp::ast::Reader::GetBinaryReader , sngcpp::ast::Reader::ReadCompoundStatementNode , sngcpp::ast::Reader::ReadNode


TryBlock Member Function

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

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


Write Member Function

void sngcpp::ast::TryStatementNode::Write(Writer & writer) override

Definition at line 451 of Statement.cpp :
452 {
453     Node::Write(writer);
454     tryBlock->Write(writer);
455     writer.GetBinaryWriter().Write(handlers != nullptr);
456     if (handlers)
457     {
458         handlers->Write(writer);
459     }
460 }


Declaration at line 236 of Statement.hpp

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

Calls: sngcpp::ast::Node::Write , sngcpp::ast::TryStatementNode::Write , sngcpp::ast::Writer::GetBinaryWriter

Called by: sngcpp::ast::TryStatementNode::Write


top | up | prev | next