top | up | prev | next

FloatLiteralNode Class

Definition at line 166 of Literal.hpp

Constructors

FloatLiteralNode(const Span& span_, const boost::uuids::uuid& moduleId_)
FloatLiteralNode(const Span& span_, const boost::uuids::uuid& moduleId_, float value_)

Member Functions

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

Member Variables

float value

Constructor Details

FloatLiteralNode Constructor

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

Definition at line 455 of Literal.cpp :
455 :
456 LiteralNode(NodeType::floatLiteralNodespan_moduleId_)value(0)
457 {
458 }


Declaration at line 169 of Literal.hpp


FloatLiteralNode Constructor

sngcm::ast::FloatLiteralNode::FloatLiteralNode(const Span& span_, const boost::uuids::uuid& moduleId_, float value_)

Definition at line 460 of Literal.cpp :
460 :
461 LiteralNode(NodeType::floatLiteralNodespan_moduleId_)value(value_)
462 {
463 }


Declaration at line 170 of Literal.hpp


Member Function Details

Accept Member Function

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

Definition at line 471 of Literal.cpp :
472 {
473     visitor.Visit(*this);
474 }


Declaration at line 172 of Literal.hpp

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

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


Clone Member Function

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

Definition at line 465 of Literal.cpp :
466 {
467     FloatLiteralNode* clone = new FloatLiteralNode(GetSpan()ModuleId()value);
468     return clone;
469 }


Declaration at line 171 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::FloatLiteralNode::Read(AstReader & reader) override

Definition at line 482 of Literal.cpp :
483 {
484     LiteralNode::Read(reader);
485     value = reader.GetBinaryReader().ReadFloat();
486 }


Declaration at line 174 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::ReadFloat


ToString Member Function

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

Definition at line 488 of Literal.cpp :
489 {
490     return std::to_string(value) + "f";
491 }


Declaration at line 175 of Literal.hpp

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


Value Member Function

float sngcm::ast::FloatLiteralNode::Value() const

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

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


Write Member Function

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

Definition at line 476 of Literal.cpp :
477 {
478     LiteralNode::Write(writer);
479     writer.GetBinaryWriter().Write(value);
480 }


Declaration at line 173 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