top | up | prev | next

BooleanLiteralNode Class

Definition at line 30 of Literal.hpp

Constructors

BooleanLiteralNode(const Span& span_, const boost::uuids::uuid& moduleId_)
BooleanLiteralNode(const Span& span_, const boost::uuids::uuid& moduleId_, bool value_)

Member Functions

void Accept(Visitor& visitor) override
Node* Clone(CloneContext& cloneContext) const override
void Read(AstReader& reader) override
std::string ToString() const override
bool Value() const
void Write(AstWriter& writer) override

Member Variables

bool value

Constructor Details

BooleanLiteralNode Constructor

sngcm::ast::BooleanLiteralNode::BooleanLiteralNode(const Span& span_, const boost::uuids::uuid& moduleId_)

Definition at line 116 of Literal.cpp :
116 : LiteralNode(NodeType::booleanLiteralNodespan_moduleId_)value(false)
117 {
118 }


Declaration at line 33 of Literal.hpp


BooleanLiteralNode Constructor

sngcm::ast::BooleanLiteralNode::BooleanLiteralNode(const Span& span_, const boost::uuids::uuid& moduleId_, bool value_)

Definition at line 120 of Literal.cpp :
120 :
121 LiteralNode(NodeType::booleanLiteralNodespan_moduleId_)value(value_)
122 {
123 }


Declaration at line 34 of Literal.hpp


Member Function Details

Accept Member Function

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

Definition at line 131 of Literal.cpp :
132 {
133     visitor.Visit(*this);
134 }


Declaration at line 36 of Literal.hpp

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

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


Clone Member Function

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

Definition at line 125 of Literal.cpp :
126 {
127     BooleanLiteralNode* clone = new BooleanLiteralNode(GetSpan()ModuleId()value);
128     return clone;
129 }


Declaration at line 35 of Literal.hpp

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

Calls: sngcm::ast::Node::GetSpan , sngcm::ast::Node::ModuleId


Read Member Function

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

Definition at line 142 of Literal.cpp :
143 {
144     LiteralNode::Read(reader);
145     value = reader.GetBinaryReader().ReadBool();
146 }


Declaration at line 38 of Literal.hpp

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

Calls: sngcm::ast::AstReader::GetBinaryReader , sngcm::ast::LiteralNode::Read , soulng::util::BinaryReader::ReadBool


ToString Member Function

std::string sngcm::ast::BooleanLiteralNode::ToString() const override

Definition at line 148 of Literal.cpp :
149 {
150     if (value) return "true"; else return "false";
151 }


Declaration at line 39 of Literal.hpp

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


Value Member Function

bool sngcm::ast::BooleanLiteralNode::Value() const

Definition at line 40 of Literal.hpp :
 40 { return value; }

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


Write Member Function

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

Definition at line 136 of Literal.cpp :
137 {
138     LiteralNode::Write(writer);
139     writer.GetBinaryWriter().Write(value);
140 }


Declaration at line 37 of Literal.hpp

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

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


top | up | prev | next