top | up | prev | next

IfStatementNode Class

Definition at line 111 of Statement.hpp

Constructors

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

Definition at line 215 of Statement.cpp :
 215 :
 216 StatementNode(NodeType::ifStatementNodespan_moduleId_)condition()thenS()elseS()
 217 {
 218 }


Declaration at line 114 of Statement.hpp


IfStatementNode Constructor

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

Definition at line 220 of Statement.cpp :
 220 :
 221 StatementNode(NodeType::ifStatementNodespan_moduleId_)condition(condition_)thenS(thenS_)elseS(elseS_)
 222 {
 223     condition->SetParent(this);
 224     thenS->SetParent(this);
 225     if (elseS)
 226     {
 227         elseS->SetParent(this);
 228     }
 229 }


Declaration at line 115 of Statement.hpp


Member Function Details

Accept Member Function

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

Definition at line 245 of Statement.cpp :
 246 {
 247     visitor.Visit(*this);
 248 }


Declaration at line 117 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 231 of Statement.cpp
Declaration at line 116 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 , sngcm::ast::Node::ModuleId

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


Condition Member Function

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

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


Condition Member Function

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

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

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


ElseS Member Function

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

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


ElseS Member Function

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

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

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


ElseSpan Member Function

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

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


LeftParenSpan Member Function

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

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


Read Member Function

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

Definition at line 267 of Statement.cpp
Declaration at line 119 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 129 of Statement.hpp :
129 { return rightParenSpan; }


SetElseSpan Member Function

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

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

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


SetLeftParenSpan Member Function

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

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

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


SetRightParenSpan Member Function

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

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

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


ThenS Member Function

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

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


ThenS Member Function

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

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

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


Write Member Function

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

Definition at line 250 of Statement.cpp
Declaration at line 118 of Statement.hpp

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

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


top | up | prev | next