top | up | prev | next

FloatLiteralNode Class

Definition at line 165 of Literal.hpp

Constructors

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

Definition at line 431 of Literal.cpp :
431 : LiteralNode(NodeType::floatLiteralNodespan_)value(0)
432 {
433 }


Declaration at line 168 of Literal.hpp


FloatLiteralNode Constructor

sngcm::ast::FloatLiteralNode::FloatLiteralNode(const Span& span_, float value_)

Definition at line 435 of Literal.cpp :
435 : LiteralNode(NodeType::floatLiteralNodespan_)value(value_)
436 {
437 }


Declaration at line 169 of Literal.hpp


Member Function Details

Accept Member Function

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

Definition at line 444 of Literal.cpp :
445 {
446     visitor.Visit(*this);
447 }


Declaration at line 171 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 439 of Literal.cpp :
440 {
441     return new FloatLiteralNode(GetSpan()value);
442 }


Declaration at line 170 of Literal.hpp

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

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


Read Member Function

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

Definition at line 455 of Literal.cpp :
456 {
457     LiteralNode::Read(reader);
458     value = reader.GetBinaryReader().ReadFloat();
459 }


Declaration at line 173 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 461 of Literal.cpp :
462 {
463     return std::to_string(value) + "f";
464 }


Declaration at line 174 of Literal.hpp

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


Value Member Function

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

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

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


Write Member Function

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

Definition at line 449 of Literal.cpp :
450 {
451     LiteralNode::Write(writer);
452     writer.GetBinaryWriter().Write(value);
453 }


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