top | up | prev | next

ShortLiteralNode Class

Definition at line 75 of Literal.hpp

Constructors

ShortLiteralNode(const Span& span_)
ShortLiteralNode(const Span& span_, int16_t value_)

Member Functions

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

Member Variables

int16_t value

Constructor Details

ShortLiteralNode Constructor

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

Definition at line 221 of Literal.cpp :
221 : LiteralNode(NodeType::shortLiteralNodespan_)value(0)
222 {
223 }


Declaration at line 78 of Literal.hpp


ShortLiteralNode Constructor

sngcm::ast::ShortLiteralNode::ShortLiteralNode(const Span& span_, int16_t value_)

Definition at line 225 of Literal.cpp :
225 : LiteralNode(NodeType::shortLiteralNodespan_)value(value_)
226 {
227 }


Declaration at line 79 of Literal.hpp


Member Function Details

Accept Member Function

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

Definition at line 234 of Literal.cpp :
235 {
236     visitor.Visit(*this);
237 }


Declaration at line 81 of Literal.hpp

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

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


Clone Member Function

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

Definition at line 229 of Literal.cpp :
230 {
231     return new ShortLiteralNode(GetSpan()value);
232 }


Declaration at line 80 of Literal.hpp

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

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


Read Member Function

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

Definition at line 245 of Literal.cpp :
246 {
247     LiteralNode::Read(reader);
248     value = reader.GetBinaryReader().ReadShort();
249 }


Declaration at line 83 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::ReadShort


ToString Member Function

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

Definition at line 251 of Literal.cpp :
252 {
253     return std::to_string(value);
254 }


Declaration at line 84 of Literal.hpp

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


Value Member Function

int16_t sngcm::ast::ShortLiteralNode::Value() const

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

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


Write Member Function

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

Definition at line 239 of Literal.cpp :
240 {
241     LiteralNode::Write(writer);
242     writer.GetBinaryWriter().Write(value);
243 }


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