top | up | prev | next

UnaryNode Abstract Class

Definition at line 103 of Node.hpp

Constructors

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

Definition at line 94 of Node.cpp :
 94 : Node(nodeType_span_moduleId_)subject()
 95 {
 96 }



UnaryNode Constructor

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

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



Member Function Details

Read Member Function

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

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


Declaration at line 109 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 115 of Node.cpp :
116 {
117     if (subject)
118     {
119         const Span& thisSpan = GetSpan();
120         subject->SetFullSpan();
121         const Span& childSpan = subject->GetSpan();
122         SetSpanStart(std::min(thisSpan.startchildSpan.start));
123         SetSpanEnd(std::max(thisSpan.endchildSpan.end));
124     }
125 }


Declaration at line 110 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 111 of Node.hpp :
111 { return subject.get(); }


Subject Member Function

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

Definition at line 112 of Node.hpp :
112 { 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 102 of Node.cpp :
103 {
104     Node::Write(writer);
105     writer.Write(subject.get());
106 }


Declaration at line 108 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