top | up | prev | next

ConstantNode Class

Definition at line 15 of Constant.hpp

Constructors

ConstantNode(const Span& span_)
ConstantNode(const Span& span_, Specifiers specifiers_, Node* typeExpr_, IdentifierNode* id_, Node* value_)

Member Functions

void Accept(Visitor& visitor) override
Node* Clone(CloneContext& cloneContext) const override
Specifiers GetSpecifiers() const override
const IdentifierNode* Id() const
IdentifierNode* Id()
void Read(AstReader& reader) override
void SetStrValue(const std::u32string& strValue_)
const std::u32string& StrValue() const
const Node* TypeExpr() const
Node* TypeExpr()
const Node* Value() const
Node* Value()
void Write(AstWriter& writer) override

Member Variables

std::unique_ptr<IdentifierNode> id
Specifiers specifiers
std::u32string strValue
std::unique_ptr<Node> typeExpr
std::unique_ptr<Node> value

Constructor Details

ConstantNode Constructor

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

Definition at line 14 of Constant.cpp :
14 : Node(NodeType::constantNodespan_)specifiers(Specifiers::none)
15 {
16 }


Declaration at line 18 of Constant.hpp


ConstantNode Constructor

sngcm::ast::ConstantNode::ConstantNode(const Span& span_, Specifiers specifiers_, Node * typeExpr_, IdentifierNode * id_, Node * value_)

Definition at line 18 of Constant.cpp :
18 :
19 Node(NodeType::constantNodespan_)specifiers(specifiers_)typeExpr(typeExpr_)id(id_)value(value_)
20 {
21     typeExpr->SetParent(this);
22     id->SetParent(this);
23     if (value)
24     {
25         value->SetParent(this);
26     }
27 }


Declaration at line 19 of Constant.hpp


Member Function Details

Accept Member Function

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

Definition at line 39 of Constant.cpp :
40 {
41     visitor.Visit(*this);
42 }


Declaration at line 21 of Constant.hpp

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

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


Clone Member Function

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

Definition at line 29 of Constant.cpp :
30 {
31     Node* clonedValue = nullptr;
32     if (value)
33     {
34         clonedValue = value->Clone(cloneContext);
35     }
36     return new ConstantNode(GetSpan()specifierstypeExpr->Clone(cloneContext)static_cast<IdentifierNode*>(id->Clone(cloneContext))clonedValue);
37 }


Declaration at line 20 of Constant.hpp

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

Calls: sngcm::ast::ConstantNode::Clone , sngcm::ast::Node::GetSpan

Called by: sngcm::ast::ConstantNode::Clone


GetSpecifiers Member Function

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

Definition at line 24 of Constant.hpp :
24 { return specifiers; }

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

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


Id Member Function

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

Definition at line 27 of Constant.hpp :
27 { return id.get(); }


Id Member Function

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

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

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


Read Member Function

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

Definition at line 59 of Constant.cpp
Declaration at line 23 of Constant.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 , soulng::util::BinaryReader::ReadUtf32String


SetStrValue Member Function

void sngcm::ast::ConstantNode::SetStrValue(const std::u32string& strValue_)

Definition at line 31 of Constant.hpp :
31 { strValue = strValue_; }


StrValue Member Function

const std::u32string& sngcm::ast::ConstantNode::StrValue() const

Definition at line 32 of Constant.hpp :
32 { return strValue; }


TypeExpr Member Function

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

Definition at line 25 of Constant.hpp :
25 { return typeExpr.get(); }


TypeExpr Member Function

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

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

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


Value Member Function

const Node * sngcm::ast::ConstantNode::Value() const

Definition at line 29 of Constant.hpp :
29 { return value.get(); }


Value Member Function

Node * sngcm::ast::ConstantNode::Value()

Definition at line 30 of Constant.hpp :
30 { return value.get(); }

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


Write Member Function

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

Definition at line 44 of Constant.cpp
Declaration at line 22 of Constant.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 , soulng::util::BinaryWriter::Write


top | up | prev | next