top | up | prev | next

BooleanLiteralNode Class

Definition at line 30 of Literal.hpp

Constructors

BooleanLiteralNode(const Span& span_)
BooleanLiteralNode(const Span& span_, 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_)

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


Declaration at line 33 of Literal.hpp


BooleanLiteralNode Constructor

sngcm::ast::BooleanLiteralNode::BooleanLiteralNode(const Span& span_, bool value_)

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


Declaration at line 34 of Literal.hpp


Member Function Details

Accept Member Function

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

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


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 124 of Literal.cpp :
125 {
126     return new BooleanLiteralNode(GetSpan()value);
127 }


Declaration at line 35 of Literal.hpp

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

Calls: sngcm::ast::Node::GetSpan


Read Member Function

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

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


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 146 of Literal.cpp :
147 {
148     if (value) return "true"; else return "false";
149 }


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 134 of Literal.cpp :
135 {
136     LiteralNode::Write(writer);
137     writer.GetBinaryWriter().Write(value);
138 }


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