top | up | prev | next

StringLiteralNode Class

Definition at line 240 of Literal.hpp

Constructors

StringLiteralNode(const Span& span_)
StringLiteralNode(const Span& span_, const std::string& value_)

Member Functions

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

Member Variables

std::string value

Constructor Details

StringLiteralNode Constructor

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

Definition at line 606 of Literal.cpp :
606 : LiteralNode(NodeType::stringLiteralNodespan_)value()
607 {
608 }


Declaration at line 243 of Literal.hpp


StringLiteralNode Constructor

sngcm::ast::StringLiteralNode::StringLiteralNode(const Span& span_, const std::string& value_)

Definition at line 610 of Literal.cpp :
610 : LiteralNode(NodeType::stringLiteralNodespan_)value(value_)
611 {
612 }


Declaration at line 244 of Literal.hpp


Member Function Details

Accept Member Function

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

Definition at line 619 of Literal.cpp :
620 {
621     visitor.Visit(*this);
622 }


Declaration at line 246 of Literal.hpp

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

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


Clone Member Function

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

Definition at line 614 of Literal.cpp :
615 {
616     return new StringLiteralNode(GetSpan()value);
617 }


Declaration at line 245 of Literal.hpp

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

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


Read Member Function

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

Definition at line 630 of Literal.cpp :
631 {
632     LiteralNode::Read(reader);
633     value = reader.GetBinaryReader().ReadUtf8String();
634 }


Declaration at line 248 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::ReadUtf8String


ToString Member Function

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

Definition at line 636 of Literal.cpp :
637 {
638     return "\"" + StringStr(value) + "\"";
639 }


Declaration at line 249 of Literal.hpp

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


Value Member Function

const std::string& sngcm::ast::StringLiteralNode::Value() const

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

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


Write Member Function

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

Definition at line 624 of Literal.cpp :
625 {
626     LiteralNode::Write(writer);
627     writer.GetBinaryWriter().Write(value);
628 }


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