top | up | prev | next

IfStatementNode Class

Definition at line 99 of Statement.hpp

Constructors

IfStatementNode(const Span& span_)
IfStatementNode(const Span& span_, Node* condition_, StatementNode* thenS_, StatementNode* elseS_)

Member Functions

void Accept(Visitor& visitor) override
Node* Clone(CloneContext& cloneContext) const override
const Node* Condition() const
Node* Condition()
const StatementNode* ElseS() const
StatementNode* ElseS()
const Span& ElseSpan() const
const Span& LeftParenSpan() const
void Read(AstReader& reader) override
const Span& RightParenSpan() const
void SetElseSpan(const Span& elseSpan_)
void SetLeftParenSpan(const Span& leftParenSpan_)
void SetRightParenSpan(const Span& rightParenSpan_)
const StatementNode* ThenS() const
StatementNode* ThenS()
void Write(AstWriter& writer) override

Member Variables

std::unique_ptr<Node> condition
std::unique_ptr<StatementNode> elseS
Span elseSpan
Span leftParenSpan
Span rightParenSpan
std::unique_ptr<StatementNode> thenS

Constructor Details

IfStatementNode Constructor

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

Definition at line 195 of Statement.cpp :
 195 : StatementNode(NodeType::ifStatementNodespan_)condition()thenS()elseS()
 196 {
 197 }


Declaration at line 102 of Statement.hpp


IfStatementNode Constructor

sngcm::ast::IfStatementNode::IfStatementNode(const Span& span_, Node * condition_, StatementNode * thenS_, StatementNode * elseS_)

Definition at line 199 of Statement.cpp :
 199 :
 200 StatementNode(NodeType::ifStatementNodespan_)condition(condition_)thenS(thenS_)elseS(elseS_)
 201 {
 202     condition->SetParent(this);
 203     thenS->SetParent(this);
 204     if (elseS)
 205     {
 206         elseS->SetParent(this);
 207     }
 208 }


Declaration at line 103 of Statement.hpp


Member Function Details

Accept Member Function

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

Definition at line 224 of Statement.cpp :
 225 {
 226     visitor.Visit(*this);
 227 }


Declaration at line 105 of Statement.hpp

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

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


Clone Member Function

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

Definition at line 210 of Statement.cpp
Declaration at line 104 of Statement.hpp

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

Calls: sngcm::ast::IfStatementNode::Clone , sngcm::ast::IfStatementNode::SetElseSpan , sngcm::ast::IfStatementNode::SetLeftParenSpan , sngcm::ast::IfStatementNode::SetRightParenSpan , sngcm::ast::Node::GetSpan

Called by: sngcm::ast::IfStatementNode::Clone


Condition Member Function

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

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


Condition Member Function

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

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

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


ElseS Member Function

const StatementNode * sngcm::ast::IfStatementNode::ElseS() const

Definition at line 112 of Statement.hpp :
112 { return elseS.get(); }


ElseS Member Function

StatementNode * sngcm::ast::IfStatementNode::ElseS()

Definition at line 113 of Statement.hpp :
113 { return elseS.get(); }

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


ElseSpan Member Function

const Span& sngcm::ast::IfStatementNode::ElseSpan() const

Definition at line 119 of Statement.hpp :
119 { return elseSpan; }


LeftParenSpan Member Function

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

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


Read Member Function

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

Definition at line 245 of Statement.cpp
Declaration at line 107 of Statement.hpp

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

Calls: sngcm::ast::AstReader::GetBinaryReader , sngcm::ast::AstReader::ReadNode , sngcm::ast::AstReader::ReadSpan , sngcm::ast::AstReader::ReadStatementNode , sngcm::ast::Node::SetParent , sngcm::ast::StatementNode::Read , soulng::util::BinaryReader::ReadBool


RightParenSpan Member Function

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

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


SetElseSpan Member Function

void sngcm::ast::IfStatementNode::SetElseSpan(const Span& elseSpan_)

Definition at line 118 of Statement.hpp :
118 { elseSpan = elseSpan_; }

Called by: sngcm::ast::IfStatementNode::Clone


SetLeftParenSpan Member Function

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

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

Called by: sngcm::ast::IfStatementNode::Clone


SetRightParenSpan Member Function

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

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

Called by: sngcm::ast::IfStatementNode::Clone


ThenS Member Function

const StatementNode * sngcm::ast::IfStatementNode::ThenS() const

Definition at line 110 of Statement.hpp :
110 { return thenS.get(); }


ThenS Member Function

StatementNode * sngcm::ast::IfStatementNode::ThenS()

Definition at line 111 of Statement.hpp :
111 { return thenS.get(); }

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


Write Member Function

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

Definition at line 229 of Statement.cpp
Declaration at line 106 of Statement.hpp

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

Calls: sngcm::ast::AstWriter::GetBinaryWriter , sngcm::ast::AstWriter::Write , sngcm::ast::StatementNode::Write , soulng::util::BinaryWriter::Write


top | up | prev | next