top | up | prev | next

BinaryNode Abstract Class

Definition at line 109 of Node.hpp

Constructors

BinaryNode(NodeType nodeType, const Span& span_)
BinaryNode(NodeType nodeType, const Span& span_, Node* left_, Node* right_)

Member Functions

const Node* Left() const
Node* Left()
void Read(AstReader& reader) override
const Node* Right() const
Node* Right()
void SetFullSpan() override
void Write(AstWriter& writer) override

Member Variables

std::unique_ptr<Node> left
std::unique_ptr<Node> right

Constructor Details

BinaryNode Constructor

sngcm::ast::BinaryNode::BinaryNode(NodeType nodeType, const Span& span_)

Definition at line 126 of Node.cpp :
126 : Node(nodeTypespan_)left()right()
127 {
128 }



BinaryNode Constructor

sngcm::ast::BinaryNode::BinaryNode(NodeType nodeType, const Span& span_, Node * left_, Node * right_)

Definition at line 130 of Node.cpp :
130 : Node(nodeTypespan_)left(left_)right(right_)
131 {
132     left->SetParent(this);
133     right->SetParent(this);
134 }



Member Function Details

Left Member Function

const Node * sngcm::ast::BinaryNode::Left() const

Definition at line 117 of Node.hpp :
117 { return left.get(); }


Left Member Function

Node * sngcm::ast::BinaryNode::Left()

Definition at line 118 of Node.hpp :
118 { return left.get(); }

Called by: sngcm::ast::AddNode::Clone , sngcm::ast::AddNode::ToString , sngcm::ast::BitAndNode::Clone , sngcm::ast::BitAndNode::ToString , sngcm::ast::BitOrNode::Clone , sngcm::ast::BitOrNode::ToString , sngcm::ast::BitXorNode::Clone , sngcm::ast::BitXorNode::ToString , sngcm::ast::ConjunctionNode::Clone , sngcm::ast::ConjunctionNode::ToString , sngcm::ast::DisjunctionNode::Clone , sngcm::ast::DisjunctionNode::ToString , sngcm::ast::DivNode::Clone , sngcm::ast::DivNode::ToString , sngcm::ast::EqualNode::Clone , sngcm::ast::EqualNode::ToString , sngcm::ast::EquivalenceNode::Clone , sngcm::ast::EquivalenceNode::ToString , sngcm::ast::GreaterNode::Clone , sngcm::ast::GreaterNode::ToString , sngcm::ast::GreaterOrEqualNode::Clone , sngcm::ast::GreaterOrEqualNode::ToString , sngcm::ast::ImplicationNode::Clone , sngcm::ast::ImplicationNode::ToString , sngcm::ast::LessNode::Clone , sngcm::ast::LessNode::ToString , sngcm::ast::LessOrEqualNode::Clone , sngcm::ast::LessOrEqualNode::ToString , sngcm::ast::MulNode::Clone , sngcm::ast::MulNode::ToString , sngcm::ast::NotEqualNode::Clone , sngcm::ast::NotEqualNode::ToString , sngcm::ast::RemNode::Clone , sngcm::ast::RemNode::ToString , sngcm::ast::ShiftLeftNode::Clone , sngcm::ast::ShiftLeftNode::ToString , sngcm::ast::ShiftRightNode::Clone , sngcm::ast::ShiftRightNode::ToString , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SubNode::Clone , sngcm::ast::SubNode::ToString


Read Member Function

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

Definition at line 143 of Node.cpp :
144 {
145     Node::Read(reader);
146     left.reset(reader.ReadNode());
147     left->SetParent(this);
148     right.reset(reader.ReadNode());
149     right->SetParent(this);
150 }


Declaration at line 115 of Node.hpp

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

Calls: sngcm::ast::AstReader::ReadNode , sngcm::ast::Node::Read , sngcm::ast::Node::SetParent


Right Member Function

const Node * sngcm::ast::BinaryNode::Right() const

Definition at line 119 of Node.hpp :
119 { return right.get(); }


Right Member Function

Node * sngcm::ast::BinaryNode::Right()

Definition at line 120 of Node.hpp :
120 { return right.get(); }

Called by: sngcm::ast::AddNode::Clone , sngcm::ast::AddNode::ToString , sngcm::ast::BitAndNode::Clone , sngcm::ast::BitAndNode::ToString , sngcm::ast::BitOrNode::Clone , sngcm::ast::BitOrNode::ToString , sngcm::ast::BitXorNode::Clone , sngcm::ast::BitXorNode::ToString , sngcm::ast::ConjunctionNode::Clone , sngcm::ast::ConjunctionNode::ToString , sngcm::ast::DisjunctionNode::Clone , sngcm::ast::DisjunctionNode::ToString , sngcm::ast::DivNode::Clone , sngcm::ast::DivNode::ToString , sngcm::ast::EqualNode::Clone , sngcm::ast::EqualNode::ToString , sngcm::ast::EquivalenceNode::Clone , sngcm::ast::EquivalenceNode::ToString , sngcm::ast::GreaterNode::Clone , sngcm::ast::GreaterNode::ToString , sngcm::ast::GreaterOrEqualNode::Clone , sngcm::ast::GreaterOrEqualNode::ToString , sngcm::ast::ImplicationNode::Clone , sngcm::ast::ImplicationNode::ToString , sngcm::ast::LessNode::Clone , sngcm::ast::LessNode::ToString , sngcm::ast::LessOrEqualNode::Clone , sngcm::ast::LessOrEqualNode::ToString , sngcm::ast::MulNode::Clone , sngcm::ast::MulNode::ToString , sngcm::ast::NotEqualNode::Clone , sngcm::ast::NotEqualNode::ToString , sngcm::ast::RemNode::Clone , sngcm::ast::RemNode::ToString , sngcm::ast::ShiftLeftNode::Clone , sngcm::ast::ShiftLeftNode::ToString , sngcm::ast::ShiftRightNode::Clone , sngcm::ast::ShiftRightNode::ToString , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SubNode::Clone , sngcm::ast::SubNode::ToString


SetFullSpan Member Function

void sngcm::ast::BinaryNode::SetFullSpan() override

Definition at line 152 of Node.cpp :
153 {
154     const Span& thisSpan = GetSpan();
155     left->SetFullSpan();
156     right->SetFullSpan();
157     const Span& leftSpan = left->GetSpan();
158     const Span& rightSpan = right->GetSpan();
159     SetSpanStart(std::min(thisSpan.startstd::min(leftSpan.startrightSpan.start)));
160     SetSpanEnd(std::max(thisSpan.endstd::max(leftSpan.endrightSpan.end)));
161 }


Declaration at line 116 of Node.hpp

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

Calls: sngcm::ast::BinaryNode::SetFullSpan , sngcm::ast::Node::GetSpan , sngcm::ast::Node::SetSpanEnd , sngcm::ast::Node::SetSpanStart

Called by: sngcm::ast::BinaryNode::SetFullSpan


Write Member Function

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

Definition at line 136 of Node.cpp :
137 {
138     Node::Write(writer);
139     writer.Write(left.get());
140     writer.Write(right.get());
141 }


Declaration at line 114 of Node.hpp

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

Calls: sngcm::ast::Node::Write


top | up | prev | next