top | up | prev | next

LabeledStatementNode Class

Definition at line 43 of Statement.hpp

Constructors

LabeledStatementNode(const Span& span_)
LabeledStatementNode(const Span& span_, StatementNode* stmt_)

Member Functions

void Accept(Visitor& visitor) override
Node* Clone(CloneContext& cloneContext) const override
const LabelNode* Label() const
LabelNode* Label()
void Read(AstReader& reader) override
void SetLabelNode(LabelNode* labelNode_)
StatementNode* Stmt()
void Write(AstWriter& writer) override

Member Variables

std::unique_ptr<LabelNode> labelNode
std::unique_ptr<StatementNode> stmt

Constructor Details

LabeledStatementNode Constructor

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

Definition at line 56 of Statement.cpp :
  56 : StatementNode(NodeType::labeledStatementNodespan_)
  57 {
  58 }


Declaration at line 46 of Statement.hpp


LabeledStatementNode Constructor

sngcm::ast::LabeledStatementNode::LabeledStatementNode(const Span& span_, StatementNode * stmt_)

Definition at line 60 of Statement.cpp :
  60 : StatementNode(NodeType::labeledStatementNodespan_)stmt(stmt_)
  61 {
  62     stmt->SetParent(this);
  63 }


Declaration at line 47 of Statement.hpp


Member Function Details

Accept Member Function

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

Definition at line 72 of Statement.cpp :
  73 {
  74     visitor.Visit(*this);
  75 }


Declaration at line 49 of Statement.hpp

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

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


Clone Member Function

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

Definition at line 65 of Statement.cpp :
  66 {
  67     LabeledStatementNode* clone = new LabeledStatementNode(GetSpan()static_cast<StatementNode*>(stmt->Clone(cloneContext)));
  68     clone->SetLabelNode(static_cast<LabelNode*>(labelNode->Clone(cloneContext)));
  69     return clone;
  70 }


Declaration at line 48 of Statement.hpp

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

Calls: sngcm::ast::LabeledStatementNode::Clone , sngcm::ast::LabeledStatementNode::SetLabelNode , sngcm::ast::Node::GetSpan

Called by: sngcm::ast::LabeledStatementNode::Clone


Label Member Function

const LabelNode * sngcm::ast::LabeledStatementNode::Label() const

Definition at line 52 of Statement.hpp :
 52 { return labelNode.get(); }


Label Member Function

LabelNode * sngcm::ast::LabeledStatementNode::Label()

Definition at line 53 of Statement.hpp :
 53 { return labelNode.get(); }

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


Read Member Function

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

Definition at line 84 of Statement.cpp :
  85 {
  86     StatementNode::Read(reader);
  87     labelNode.reset(reader.ReadLabelNode());
  88     labelNode->SetParent(this);
  89     stmt.reset(reader.ReadStatementNode());
  90     stmt->SetParent(this);
  91 }


Declaration at line 51 of Statement.hpp

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

Calls: sngcm::ast::AstReader::ReadLabelNode , sngcm::ast::AstReader::ReadStatementNode , sngcm::ast::Node::SetParent , sngcm::ast::StatementNode::Read


SetLabelNode Member Function

void sngcm::ast::LabeledStatementNode::SetLabelNode(LabelNode * labelNode_)

Definition at line 93 of Statement.cpp :
  94 {
  95     labelNode.reset(labelNode_);
  96     labelNode->SetParent(this);
  97 }


Declaration at line 54 of Statement.hpp

Calls: sngcm::ast::Node::SetParent

Called by: sngcm::ast::LabeledStatementNode::Clone


Stmt Member Function

StatementNode * sngcm::ast::LabeledStatementNode::Stmt()

Definition at line 55 of Statement.hpp :
 55 { return stmt.get(); }

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


Write Member Function

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

Definition at line 77 of Statement.cpp :
  78 {
  79     StatementNode::Write(writer);
  80     writer.Write(labelNode.get());
  81     writer.Write(stmt.get());
  82 }


Declaration at line 50 of Statement.hpp

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

Calls: sngcm::ast::StatementNode::Write


top | up | prev | next