top | up | prev | next

CharLiteralNode Class

Definition at line 196 of Literal.hpp

Constructors

CharLiteralNode(const Span& span_, const boost::uuids::uuid& moduleId_)
CharLiteralNode(const Span& span_, const boost::uuids::uuid& moduleId_, char value_)

Member Functions

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

Member Variables

char value

Constructor Details

CharLiteralNode Constructor

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

Definition at line 531 of Literal.cpp :
531 : LiteralNode(NodeType::charLiteralNodespan_moduleId_)value('\0')
532 {
533 }


Declaration at line 199 of Literal.hpp


CharLiteralNode Constructor

sngcm::ast::CharLiteralNode::CharLiteralNode(const Span& span_, const boost::uuids::uuid& moduleId_, char value_)

Definition at line 535 of Literal.cpp :
535 :
536 LiteralNode(NodeType::charLiteralNodespan_moduleId_)value(value_)
537 {
538 }


Declaration at line 200 of Literal.hpp


Member Function Details

Accept Member Function

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

Definition at line 546 of Literal.cpp :
547 {
548     visitor.Visit(*this);
549 }


Declaration at line 202 of Literal.hpp

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

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


Clone Member Function

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

Definition at line 540 of Literal.cpp :
541 {
542     CharLiteralNode* clone = new CharLiteralNode(GetSpan()ModuleId()value);
543     return clone;
544 }


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

Definition at line 557 of Literal.cpp :
558 {
559     LiteralNode::Read(reader);
560     value = reader.GetBinaryReader().ReadChar();
561 }


Declaration at line 204 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::ReadChar


ToString Member Function

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

Definition at line 563 of Literal.cpp :
564 {
565     return "'" + CharStr(value) + "'";
566 }


Declaration at line 205 of Literal.hpp

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


Value Member Function

char sngcm::ast::CharLiteralNode::Value() const

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

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


Write Member Function

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

Definition at line 551 of Literal.cpp :
552 {
553     LiteralNode::Write(writer);
554     writer.GetBinaryWriter().Write(value);
555 }


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