top | up | prev | next

InitDeclaratorNode Class

Definition at line 87 of Declarator.hpp

Constructors

InitDeclaratorNode()
InitDeclaratorNode(const Span& span_, Node* declarator_, Node* initializer_)

Member Functions

void Accept(Visitor& visitor) override
Node* Declarator()
Node* Initializer()
void Read(Reader& reader) override
void Write(Writer& writer) override

Member Variables

std::unique_ptr<Node> declarator
std::unique_ptr<Node> initializer

Constructor Details

InitDeclaratorNode Constructor

sngcpp::ast::InitDeclaratorNode::InitDeclaratorNode()

Definition at line 165 of Declarator.cpp :
165 : Node(NodeType::initDeclaratorNode)
166 {
167 }


Declaration at line 90 of Declarator.hpp


InitDeclaratorNode Constructor

sngcpp::ast::InitDeclaratorNode::InitDeclaratorNode(const Span& span_, Node * declarator_, Node * initializer_)

Definition at line 169 of Declarator.cpp :
169 : Node(NodeType::initDeclaratorNodespan_)declarator(declarator_)initializer(initializer_)
170 {
171 }


Declaration at line 91 of Declarator.hpp


Member Function Details

Accept Member Function

void sngcpp::ast::InitDeclaratorNode::Accept(Visitor & visitor) override

Definition at line 173 of Declarator.cpp :
174 {
175     visitor.Visit(*this);
176 }


Declaration at line 92 of Declarator.hpp

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

Calls: sngcpp::ast::Visitor::Visit


Declarator Member Function

Node * sngcpp::ast::InitDeclaratorNode::Declarator()

Definition at line 95 of Declarator.hpp :
 95 { return declarator.get(); }


Initializer Member Function

Node * sngcpp::ast::InitDeclaratorNode::Initializer()

Definition at line 96 of Declarator.hpp :
 96 { return initializer.get(); }


Read Member Function

void sngcpp::ast::InitDeclaratorNode::Read(Reader & reader) override

Definition at line 189 of Declarator.cpp :
190 {
191     Node::Read(reader);
192     declarator.reset(reader.ReadNode());
193     bool hasInitializer = reader.GetBinaryReader().ReadBool();
194     if (hasInitializer)
195     {
196         initializer.reset(reader.ReadNode());
197     }
198 }


Declaration at line 94 of Declarator.hpp

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

Calls: sngcpp::ast::Node::Read , sngcpp::ast::Reader::GetBinaryReader , sngcpp::ast::Reader::ReadNode


Write Member Function

void sngcpp::ast::InitDeclaratorNode::Write(Writer & writer) override

Definition at line 178 of Declarator.cpp :
179 {
180     Node::Write(writer);
181     declarator->Write(writer);
182     writer.GetBinaryWriter().Write(initializer != nullptr);
183     if (initializer)
184     {
185         initializer->Write(writer);
186     }
187 }


Declaration at line 93 of Declarator.hpp

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

Calls: sngcpp::ast::InitDeclaratorNode::Write , sngcpp::ast::Node::Write , sngcpp::ast::Writer::GetBinaryWriter

Called by: sngcpp::ast::InitDeclaratorNode::Write


top | up | prev | next