top | up | prev | next

StringValue Abstract Class

Definition at line 317 of Value.hpp

Constructors

StringValue(const Span& span_, const boost::uuids::uuid& moduleId_, int stringId_, const std::string& str_)

Member Functions

Value* As(TypeSymbol* targetType, bool cast, const Span& span, const boost::uuids::uuid& moduleId, bool dontThrow) const
const char* ClassName() const override
Value* Clone() const override
TypeSymbol* GetType(SymbolTable* symbolTable) override
void* IrValue(Emitter& emitter)
void Read(BinaryReader& reader) override
const std::string& Str() const
int StringId() const
void Write(BinaryWriter& writer) override

Member Variables

std::string str
int stringId

Constructor Details

StringValue Constructor

cmajor::symbols::StringValue::StringValue(const Span& span_, const boost::uuids::uuid& moduleId_, int stringId_, const std::string& str_)

Definition at line 3646 of Value.cpp :
3646 : Value(span_moduleId_ValueType::stringValue)stringId(stringId_)str(str_)
3647 {
3648 }



Member Function Details

As Member Function

Value * cmajor::symbols::StringValue::As(TypeSymbol * targetType, bool cast, const Span& span, const boost::uuids::uuid& moduleId, bool dontThrow) const

Definition at line 3669 of Value.cpp

Calls: cmajor::symbols::TypeSymbol::GetValueType , cmajor::symbols::Value::GetValueType


ClassName Member Function

const char * cmajor::symbols::StringValue::ClassName() const override

Definition at line 329 of Value.hpp :
329 { return "StringValue"; }

Base class overridden functions: cmajor::symbols::Value::ClassName


Clone Member Function

Value * cmajor::symbols::StringValue::Clone() const override

Definition at line 321 of Value.hpp :
321 { return new StringValue(GetSpan()ModuleId()stringIdstr); }

Base class overridden functions: cmajor::symbols::Value::Clone

Calls: cmajor::symbols::Value::GetSpan , cmajor::symbols::Value::ModuleId


GetType Member Function

TypeSymbol * cmajor::symbols::StringValue::GetType(SymbolTable * symbolTable) override

Definition at line 3691 of Value.cpp :
3692 {
3693     return symbolTable->GetTypeByName(U"char")->AddConst(GetSpan()ModuleId())->AddPointer(GetSpan()ModuleId());
3694 }


Declaration at line 326 of Value.hpp

Base class overridden functions: cmajor::symbols::Value::GetType

Calls: cmajor::symbols::SymbolTable::GetTypeByName , cmajor::symbols::TypeSymbol::AddConst , cmajor::symbols::TypeSymbol::AddPointer , cmajor::symbols::Value::GetSpan , cmajor::symbols::Value::ModuleId


IrValue Member Function

void * cmajor::symbols::StringValue::IrValue(Emitter& emitter)

Definition at line 3650 of Value.cpp :
3651 {
3652     if (stringId == -1)
3653     {
3654         stringId = emitter.Install(str);
3655     }
3656     return emitter.GetGlobalStringPtr(stringId);
3657 }



Read Member Function

void cmajor::symbols::StringValue::Read(BinaryReader& reader) override

Definition at line 3664 of Value.cpp :
3665 {
3666     str = reader.ReadUtf8String();
3667 }


Declaration at line 324 of Value.hpp

Base class overridden functions: cmajor::symbols::Value::Read


Str Member Function

const std::string& cmajor::symbols::StringValue::Str() const

Definition at line 328 of Value.hpp :
328 { return str; }

Called by: cmajor::symbols::StringLengthFunction::ConstructValue


StringId Member Function

int cmajor::symbols::StringValue::StringId() const

Definition at line 327 of Value.hpp :
327 { return stringId; }


Write Member Function

void cmajor::symbols::StringValue::Write(BinaryWriter& writer) override

Definition at line 3659 of Value.cpp :
3660 {
3661     writer.Write(str);
3662 }


Declaration at line 323 of Value.hpp

Base class overridden functions: cmajor::symbols::Value::Write

Calls: cmajor::symbols::StringValue::Write

Called by: cmajor::symbols::StringValue::Write


top | up | prev | next