top | up | prev | next

UnaryNode Abstract Class

Definition at line 95 of Node.hpp

Constructors

UnaryNode(NodeType nodeType_, const Span& span_)
UnaryNode(NodeType nodeType_, const Span& span_, Node* subject_)

Member Functions

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

Member Variables

std::unique_ptr<Node> subject

Constructor Details

UnaryNode Constructor

sngcm::ast::UnaryNode::UnaryNode(NodeType nodeType_, const Span& span_)

Definition at line 93 of Node.cpp :
 93 : Node(nodeType_span_)subject()
 94 {
 95 }



UnaryNode Constructor

sngcm::ast::UnaryNode::UnaryNode(NodeType nodeType_, const Span& span_, Node * subject_)

Definition at line 97 of Node.cpp :
 97 : Node(nodeType_span_)subject(subject_)
 98 {
 99 }



Member Function Details

Read Member Function

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

Definition at line 107 of Node.cpp :
108 {
109     Node::Read(reader);
110     subject.reset(reader.ReadNode());
111     subject->SetParent(this);
112 }


Declaration at line 101 of Node.hpp

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

Derived class overrides: sngcm::ast::ArrowNode::Read , sngcm::ast::DotNode::Read , sngcm::ast::ParenthesizedExpressionNode::Read

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

Called by: sngcm::ast::ArrowNode::Read , sngcm::ast::DotNode::Read , sngcm::ast::ParenthesizedExpressionNode::Read


SetFullSpan Member Function

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

Definition at line 114 of Node.cpp :
115 {
116     if (subject)
117     {
118         const Span& thisSpan = GetSpan();
119         subject->SetFullSpan();
120         const Span& childSpan = subject->GetSpan();
121         SetSpanStart(std::min(thisSpan.startchildSpan.start));
122         SetSpanEnd(std::max(thisSpan.endchildSpan.end));
123     }
124 }


Declaration at line 102 of Node.hpp

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

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

Called by: sngcm::ast::UnaryNode::SetFullSpan


Subject Member Function

const Node * sngcm::ast::UnaryNode::Subject() const

Definition at line 103 of Node.hpp :
103 { return subject.get(); }


Subject Member Function

Node * sngcm::ast::UnaryNode::Subject()

Definition at line 104 of Node.hpp :
104 { return subject.get(); }

Called by: sngcm::ast::AddrOfNode::Clone , sngcm::ast::AddrOfNode::ToString , sngcm::ast::ArrowNode::Clone , sngcm::ast::ArrowNode::ToString , sngcm::ast::ComplementNode::Clone , sngcm::ast::ComplementNode::ToString , sngcm::ast::DerefNode::Clone , sngcm::ast::DerefNode::ToString , sngcm::ast::DotNode::Clone , sngcm::ast::DotNode::ToString , sngcm::ast::NotNode::Clone , sngcm::ast::NotNode::ToString , sngcm::ast::ParenthesizedExpressionNode::Clone , sngcm::ast::ParenthesizedExpressionNode::ToString , sngcm::ast::PostfixDecrementNode::Clone , sngcm::ast::PostfixDecrementNode::ToString , sngcm::ast::PostfixIncrementNode::Clone , sngcm::ast::PostfixIncrementNode::ToString , sngcm::ast::PrefixDecrementNode::Clone , sngcm::ast::PrefixDecrementNode::ToString , sngcm::ast::PrefixIncrementNode::Clone , sngcm::ast::PrefixIncrementNode::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::UnaryMinusNode::Clone , sngcm::ast::UnaryMinusNode::ToString , sngcm::ast::UnaryPlusNode::Clone , sngcm::ast::UnaryPlusNode::ToString


Write Member Function

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

Definition at line 101 of Node.cpp :
102 {
103     Node::Write(writer);
104     writer.Write(subject.get());
105 }


Declaration at line 100 of Node.hpp

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

Derived class overrides: sngcm::ast::ArrowNode::Write , sngcm::ast::DotNode::Write , sngcm::ast::ParenthesizedExpressionNode::Write

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

Called by: sngcm::ast::ArrowNode::Write , sngcm::ast::DotNode::Write , sngcm::ast::ParenthesizedExpressionNode::Write


top | up | prev | next