top | up | prev | next

GlobalVariableNode Class

Definition at line 16 of GlobalVariable.hpp

Constructors

GlobalVariableNode(const Span& span_)
GlobalVariableNode(const Span& span_, Specifiers specifiers_, Node* typeExpr_, IdentifierNode* id_, CompileUnitNode* cu_)

Member Functions

void Accept(Visitor& visitor) override
Node* Clone(CloneContext& cloneContext) const override
CompileUnitNode* CompileUnit() const
Specifiers GetSpecifiers() const override
const IdentifierNode* Id() const
IdentifierNode* Id()
Node* Initializer()
void Read(AstReader& reader) override
void SetInitializer(Node* initializer_)
const Node* TypeExpr() const
Node* TypeExpr()
void Write(AstWriter& writer) override

Member Variables

CompileUnitNode* cu
std::unique_ptr<IdentifierNode> id
std::unique_ptr<Node> initializer
Specifiers specifiers
std::unique_ptr<Node> typeExpr

Constructor Details

GlobalVariableNode Constructor

sngcm::ast::GlobalVariableNode::GlobalVariableNode(const Span& span_)

Definition at line 14 of GlobalVariable.cpp :
14 : Node(NodeType::globalVariableNodespan_)specifiers(Specifiers::none)cu(nullptr)
15 {
16 }


Declaration at line 19 of GlobalVariable.hpp


GlobalVariableNode Constructor

sngcm::ast::GlobalVariableNode::GlobalVariableNode(const Span& span_, Specifiers specifiers_, Node * typeExpr_, IdentifierNode * id_, CompileUnitNode * cu_)

Definition at line 18 of GlobalVariable.cpp :
18 :
19 Node(NodeType::globalVariableNodespan_)specifiers(specifiers_)typeExpr(typeExpr_)id(id_)cu(cu_)
20 {
21     typeExpr->SetParent(this);
22     id->SetParent(this);
23 }


Declaration at line 20 of GlobalVariable.hpp


Member Function Details

Accept Member Function

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

Definition at line 35 of GlobalVariable.cpp :
36 {
37     visitor.Visit(*this);
38 }


Declaration at line 22 of GlobalVariable.hpp

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

Calls: sngcm::ast::Visitor::Visit


Clone Member Function

Node * sngcm::ast::GlobalVariableNode::Clone(CloneContext & cloneContext) const override

Definition at line 25 of GlobalVariable.cpp :
26 {
27     GlobalVariableNode* clone = new GlobalVariableNode(GetSpan()specifierstypeExpr->Clone(cloneContext)static_cast<IdentifierNode*>(id->Clone(cloneContext))cu);
28     if (initializer)
29     {
30         clone->SetInitializer(initializer->Clone(cloneContext));
31     }
32     return clone;
33 }


Declaration at line 21 of GlobalVariable.hpp

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

Calls: sngcm::ast::GlobalVariableNode::Clone , sngcm::ast::GlobalVariableNode::SetInitializer , sngcm::ast::Node::GetSpan

Called by: sngcm::ast::GlobalVariableNode::Clone


CompileUnit Member Function

CompileUnitNode * sngcm::ast::GlobalVariableNode::CompileUnit() const

Definition at line 32 of GlobalVariable.hpp :
32 { return cu; }


GetSpecifiers Member Function

Specifiers sngcm::ast::GlobalVariableNode::GetSpecifiers() const override

Definition at line 25 of GlobalVariable.hpp :
25 { return specifiers; }

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

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


Id Member Function

const IdentifierNode * sngcm::ast::GlobalVariableNode::Id() const

Definition at line 28 of GlobalVariable.hpp :
28 { return id.get(); }


Id Member Function

IdentifierNode * sngcm::ast::GlobalVariableNode::Id()

Definition at line 29 of GlobalVariable.hpp :
29 { return id.get(); }

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


Initializer Member Function

Node * sngcm::ast::GlobalVariableNode::Initializer()

Definition at line 30 of GlobalVariable.hpp :
30 { return initializer.get(); }

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


Read Member Function

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

Definition at line 54 of GlobalVariable.cpp
Declaration at line 24 of GlobalVariable.hpp

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

Calls: sngcm::ast::AstReader::GetBinaryReader , sngcm::ast::AstReader::ReadIdentifierNode , sngcm::ast::AstReader::ReadNode , sngcm::ast::AstReader::ReadSpecifiers , sngcm::ast::Node::Read , sngcm::ast::Node::SetParent , soulng::util::BinaryReader::ReadBool


SetInitializer Member Function

void sngcm::ast::GlobalVariableNode::SetInitializer(Node * initializer_)

Definition at line 70 of GlobalVariable.cpp :
71 {
72     initializer.reset(initializer_);
73     if (initializer)
74     {
75         initializer->SetParent(this);
76     }
77 }


Declaration at line 31 of GlobalVariable.hpp

Calls: sngcm::ast::Node::SetParent

Called by: sngcm::ast::GlobalVariableNode::Clone


TypeExpr Member Function

const Node * sngcm::ast::GlobalVariableNode::TypeExpr() const

Definition at line 26 of GlobalVariable.hpp :
26 { return typeExpr.get(); }


TypeExpr Member Function

Node * sngcm::ast::GlobalVariableNode::TypeExpr()

Definition at line 27 of GlobalVariable.hpp :
27 { return typeExpr.get(); }

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


Write Member Function

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

Definition at line 40 of GlobalVariable.cpp
Declaration at line 23 of GlobalVariable.hpp

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

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


top | up | prev | next