top | up | prev | next

WhileStatementNode Class

Definition at line 129 of Statement.hpp

Constructors

WhileStatementNode(const Span& span_)
WhileStatementNode(const Span& span_, Node* condition_, StatementNode* statement_)

Member Functions

void Accept(Visitor& visitor) override
Node* Clone(CloneContext& cloneContext) const override
const Node* Condition() const
Node* Condition()
bool IsBreakEnclosingStatementNode() const override
bool IsContinueEnclosingStatementNode() const override
const Span& LeftParenSpan() const
void Read(AstReader& reader) override
const Span& RightParenSpan() const
void SetLeftParenSpan(const Span& leftParenSpan_)
void SetRightParenSpan(const Span& rightParenSpan_)
const StatementNode* Statement() const
StatementNode* Statement()
void Write(AstWriter& writer) override

Member Variables

std::unique_ptr<Node> condition
Span leftParenSpan
Span rightParenSpan
std::unique_ptr<StatementNode> statement

Constructor Details

WhileStatementNode Constructor

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

Definition at line 263 of Statement.cpp :
 263 : StatementNode(NodeType::whileStatementNodespan_)condition()statement()
 264 {
 265 }


Declaration at line 132 of Statement.hpp


WhileStatementNode Constructor

sngcm::ast::WhileStatementNode::WhileStatementNode(const Span& span_, Node * condition_, StatementNode * statement_)

Definition at line 267 of Statement.cpp :
 267 :
 268 StatementNode(NodeType::whileStatementNodespan_)condition(condition_)statement(statement_)
 269 {
 270     condition->SetParent(this);
 271     statement->SetParent(this);
 272 }


Declaration at line 133 of Statement.hpp


Member Function Details

Accept Member Function

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

Definition at line 282 of Statement.cpp :
 283 {
 284     visitor.Visit(*this);
 285 }


Declaration at line 135 of Statement.hpp

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

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


Clone Member Function

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

Definition at line 274 of Statement.cpp :
 275 {
 276     WhileStatementNode* clone = new WhileStatementNode(GetSpan()condition->Clone(cloneContext)static_cast<StatementNode*>(statement->Clone(cloneContext)));
 277     clone->SetLeftParenSpan(leftParenSpan);
 278     clone->SetRightParenSpan(rightParenSpan);
 279     return clone;
 280 }


Declaration at line 134 of Statement.hpp

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

Calls: sngcm::ast::Node::GetSpan , sngcm::ast::WhileStatementNode::Clone , sngcm::ast::WhileStatementNode::SetLeftParenSpan , sngcm::ast::WhileStatementNode::SetRightParenSpan

Called by: sngcm::ast::WhileStatementNode::Clone


Condition Member Function

const Node * sngcm::ast::WhileStatementNode::Condition() const

Definition at line 140 of Statement.hpp :
140 { return condition.get(); }


Condition Member Function

Node * sngcm::ast::WhileStatementNode::Condition()

Definition at line 141 of Statement.hpp :
141 { return condition.get(); }

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


IsBreakEnclosingStatementNode Member Function

bool sngcm::ast::WhileStatementNode::IsBreakEnclosingStatementNode() const override

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

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


IsContinueEnclosingStatementNode Member Function

bool sngcm::ast::WhileStatementNode::IsContinueEnclosingStatementNode() const override

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

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


LeftParenSpan Member Function

const Span& sngcm::ast::WhileStatementNode::LeftParenSpan() const

Definition at line 145 of Statement.hpp :
145 { return leftParenSpan; }


Read Member Function

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

Definition at line 296 of Statement.cpp :
 297 {
 298     StatementNode::Read(reader);
 299     condition.reset(reader.ReadNode());
 300     condition->SetParent(this);
 301     statement.reset(reader.ReadStatementNode());
 302     statement->SetParent(this);
 303     leftParenSpan = reader.ReadSpan();
 304     rightParenSpan = reader.ReadSpan();
 305 }


Declaration at line 137 of Statement.hpp

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

Calls: sngcm::ast::AstReader::ReadNode , sngcm::ast::AstReader::ReadSpan , sngcm::ast::AstReader::ReadStatementNode , sngcm::ast::Node::SetParent , sngcm::ast::StatementNode::Read


RightParenSpan Member Function

const Span& sngcm::ast::WhileStatementNode::RightParenSpan() const

Definition at line 147 of Statement.hpp :
147 { return rightParenSpan; }


SetLeftParenSpan Member Function

void sngcm::ast::WhileStatementNode::SetLeftParenSpan(const Span& leftParenSpan_)

Definition at line 144 of Statement.hpp :
144 { leftParenSpan = leftParenSpan_; }

Called by: sngcm::ast::WhileStatementNode::Clone


SetRightParenSpan Member Function

void sngcm::ast::WhileStatementNode::SetRightParenSpan(const Span& rightParenSpan_)

Definition at line 146 of Statement.hpp :
146 { rightParenSpan = rightParenSpan_; }

Called by: sngcm::ast::WhileStatementNode::Clone


Statement Member Function

const StatementNode * sngcm::ast::WhileStatementNode::Statement() const

Definition at line 142 of Statement.hpp :
142 { return statement.get(); }


Statement Member Function

StatementNode * sngcm::ast::WhileStatementNode::Statement()

Definition at line 143 of Statement.hpp :
143 { return statement.get(); }

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


Write Member Function

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

Definition at line 287 of Statement.cpp :
 288 {
 289     StatementNode::Write(writer);
 290     writer.Write(condition.get());
 291     writer.Write(statement.get());
 292     writer.Write(leftParenSpan);
 293     writer.Write(rightParenSpan);
 294 }


Declaration at line 136 of Statement.hpp

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

Calls: sngcm::ast::AstWriter::Write , sngcm::ast::StatementNode::Write


top | up | prev | next