top | up | prev | next

CharLiteralNode Class

Definition at line 195 of Literal.hpp

Constructors

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

Definition at line 501 of Literal.cpp :
501 : LiteralNode(NodeType::charLiteralNodespan_)value('\0')
502 {
503 }


Declaration at line 198 of Literal.hpp


CharLiteralNode Constructor

sngcm::ast::CharLiteralNode::CharLiteralNode(const Span& span_, char value_)

Definition at line 505 of Literal.cpp :
505 : LiteralNode(NodeType::charLiteralNodespan_)value(value_)
506 {
507 }


Declaration at line 199 of Literal.hpp


Member Function Details

Accept Member Function

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

Definition at line 514 of Literal.cpp :
515 {
516     visitor.Visit(*this);
517 }


Declaration at line 201 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 509 of Literal.cpp :
510 {
511     return new CharLiteralNode(GetSpan()value);
512 }


Declaration at line 200 of Literal.hpp

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

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


Read Member Function

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

Definition at line 525 of Literal.cpp :
526 {
527     LiteralNode::Read(reader);
528     value = reader.GetBinaryReader().ReadChar();
529 }


Declaration at line 203 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 531 of Literal.cpp :
532 {
533     return "'" + CharStr(value) + "'";
534 }


Declaration at line 204 of Literal.hpp

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


Value Member Function

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

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

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


Write Member Function

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

Definition at line 519 of Literal.cpp :
520 {
521     LiteralNode::Write(writer);
522     writer.GetBinaryWriter().Write(value);
523 }


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