top | up | prev | next

ConstantSymbol Class

Definition at line 13 of ConstantSymbol.hpp

Constructors

ConstantSymbol(const Span& span_, const boost::uuids::uuid& sourceModuleId_, const std::u32string& name_)

Member Functions

void Accept(SymbolCollector* collector) override
void* ArrayIrObject(Emitter& emitter, bool create)
void Check() override
const char* ClassName() const override
void ComputeMangledName() override
void Dump(CodeFormatter& formatter) override
void EmplaceType(TypeSymbol* typeSymbol, int index) override
bool Evaluating() const
std::string GetSymbolCategoryDescription() const override
std::string GetSymbolCategoryStr() const override
std::string GetSymbolHelp() const override
const TypeSymbol* GetType() const
TypeSymbol* GetType()
Value* GetValue()
std::u32string Info() const override
void Read(SymbolReader& reader) override
void ResetEvaluating()
void SetEvaluating()
void SetSpecifiers(Specifiers specifiers)
void SetStrValue(const std::u32string& strValue_)
void SetType(TypeSymbol* typeSymbol)
void SetValue(Value* value_)
const std::u32string& StrValue() const
void* StructureIrObject(Emitter& emitter, bool create)
std::string Syntax() const override
std::string TypeString() const override
void Write(SymbolWriter& writer) override

Member Variables

bool evaluating
std::string filePathReadFrom
uint32_t sizeOfValue
std::u32string strValue
TypeSymbol* type
std::unique_ptr<Value> value
uint32_t valuePos

Constructor Details

ConstantSymbol Constructor

cmajor::symbols::ConstantSymbol::ConstantSymbol(const Span& span_, const boost::uuids::uuid& sourceModuleId_, const std::u32string& name_)

Definition at line 21 of ConstantSymbol.cpp :
 21 :
 22 Symbol(SymbolType::constantSymbolspan_sourceModuleId_name_)type()evaluating(false)sizeOfValue(0)valuePos(0)
 23 {
 24 }


Declaration at line 16 of ConstantSymbol.hpp


Member Function Details

Accept Member Function

void cmajor::symbols::ConstantSymbol::Accept(SymbolCollector * collector) override

Definition at line 99 of ConstantSymbol.cpp :
100 {
101     if (IsProject() && Access() == SymbolAccess::public_)
102     {
103         collector->AddConstant(this);
104     }
105 }


Declaration at line 20 of ConstantSymbol.hpp

Base class overridden functions: cmajor::symbols::Symbol::Accept

Calls: cmajor::symbols::Symbol::Access , cmajor::symbols::Symbol::IsProject , cmajor::symbols::SymbolCollector::AddConstant


ArrayIrObject Member Function

void * cmajor::symbols::ConstantSymbol::ArrayIrObject(Emitter& emitter, bool create)

Definition at line 222 of ConstantSymbol.cpp
Declaration at line 34 of ConstantSymbol.hpp

Calls: cmajor::symbols::ArrayValue::IrValue , cmajor::symbols::Symbol::GetSpan , cmajor::symbols::Symbol::MangledName , cmajor::symbols::Symbol::SourceModuleId , cmajor::symbols::TypeSymbol::IrType , cmajor::symbols::TypeSymbol::IsArrayType


Check Member Function

void cmajor::symbols::ConstantSymbol::Check() override

Definition at line 272 of ConstantSymbol.cpp :
273 {
274     Symbol::Check();
275     if (!type)
276     {
277         throw SymbolCheckException("constant symbol has no type"GetSpan()SourceModuleId());
278     }
279 }


Declaration at line 40 of ConstantSymbol.hpp

Base class overridden functions: cmajor::symbols::Symbol::Check

Calls: cmajor::symbols::Symbol::Check , cmajor::symbols::Symbol::GetSpan , cmajor::symbols::Symbol::SourceModuleId


ClassName Member Function

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

Definition at line 37 of ConstantSymbol.hpp :
37 { return "ConstantSymbol"; }

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


ComputeMangledName Member Function

void cmajor::symbols::ConstantSymbol::ComputeMangledName() override

Definition at line 186 of ConstantSymbol.cpp :
187 {
188     Symbol::ComputeMangledName();
189 }


Declaration at line 25 of ConstantSymbol.hpp

Base class overridden functions: cmajor::symbols::Symbol::ComputeMangledName

Calls: cmajor::symbols::Symbol::ComputeMangledName


Dump Member Function

void cmajor::symbols::ConstantSymbol::Dump(CodeFormatter& formatter) override

Definition at line 107 of ConstantSymbol.cpp :
108 {
109     formatter.WriteLine(ToUtf8(Name()));
110     formatter.WriteLine("full name: " + ToUtf8(FullNameWithSpecifiers()));
111     formatter.WriteLine("mangled name: " + ToUtf8(MangledName()));
112     formatter.WriteLine("type: " + ToUtf8(type->FullName()));
113     formatter.WriteLine("value: " + value->ToString());
114 }


Declaration at line 21 of ConstantSymbol.hpp

Calls: cmajor::symbols::Symbol::FullName , cmajor::symbols::Symbol::FullNameWithSpecifiers , cmajor::symbols::Symbol::MangledName , cmajor::symbols::Symbol::Name

Called by: cmajor::symbols::ClassTypeSymbol::Dump , cmajor::symbols::Module::Dump


EmplaceType Member Function

void cmajor::symbols::ConstantSymbol::EmplaceType(TypeSymbol * typeSymbol, int index) override

Definition at line 93 of ConstantSymbol.cpp :
 94 {
 95     Assert(index == 0"invalid emplace type index");
 96     type = typeSymbol;
 97 }


Declaration at line 19 of ConstantSymbol.hpp

Base class overridden functions: cmajor::symbols::Symbol::EmplaceType


Evaluating Member Function

bool cmajor::symbols::ConstantSymbol::Evaluating() const

Definition at line 26 of ConstantSymbol.hpp :
26 { return evaluating; }


GetSymbolCategoryDescription Member Function

std::string cmajor::symbols::ConstantSymbol::GetSymbolCategoryDescription() const override

Definition at line 42 of ConstantSymbol.hpp :
42 { return "constant"; }

Base class overridden functions: cmajor::symbols::Symbol::GetSymbolCategoryDescription

Called by: cmajor::symbols::ConstantSymbol::GetSymbolHelp


GetSymbolCategoryStr Member Function

std::string cmajor::symbols::ConstantSymbol::GetSymbolCategoryStr() const override

Definition at line 41 of ConstantSymbol.hpp :
41 { return "CN"; }

Base class overridden functions: cmajor::symbols::Symbol::GetSymbolCategoryStr


GetSymbolHelp Member Function

std::string cmajor::symbols::ConstantSymbol::GetSymbolHelp() const override

Definition at line 281 of ConstantSymbol.cpp :
282 {
283     std::string help = "(";
284     help.append(GetSymbolCategoryDescription()).append(") ");
285     help.append(ToUtf8(GetType()->FullName())).append(" ").append(ToUtf8(FullName()));
286     return help;
287 }


Declaration at line 43 of ConstantSymbol.hpp

Base class overridden functions: cmajor::symbols::Symbol::GetSymbolHelp

Calls: cmajor::symbols::ConstantSymbol::GetSymbolCategoryDescription , cmajor::symbols::ConstantSymbol::GetType , cmajor::symbols::Symbol::FullName


GetType Member Function

const TypeSymbol * cmajor::symbols::ConstantSymbol::GetType() const

Definition at line 29 of ConstantSymbol.hpp :
29 { return type; }


GetType Member Function

TypeSymbol * cmajor::symbols::ConstantSymbol::GetType()

Definition at line 30 of ConstantSymbol.hpp :
30 { return type; }

Called by: cmajor::symbols::ConstantSymbol::GetSymbolHelp , cmajor::symbols::ConstantSymbol::Syntax


GetValue Member Function

Value * cmajor::symbols::ConstantSymbol::GetValue()

Definition at line 73 of ConstantSymbol.cpp
Declaration at line 33 of ConstantSymbol.hpp

Calls: cmajor::symbols::ConstantSymbol::Read , cmajor::symbols::Symbol::FullName , cmajor::symbols::Symbol::GetSpan , cmajor::symbols::Symbol::SourceModuleId , cmajor::symbols::TypeSymbol::MakeValue


Info Member Function

std::u32string cmajor::symbols::ConstantSymbol::Info() const override

Definition at line 36 of ConstantSymbol.hpp :
36 { return Name(); }

Base class overridden functions: cmajor::symbols::Symbol::Info

Calls: cmajor::symbols::Symbol::Name


Read Member Function

void cmajor::symbols::ConstantSymbol::Read(SymbolReader & reader) override

Definition at line 52 of ConstantSymbol.cpp
Declaration at line 18 of ConstantSymbol.hpp

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

Calls: cmajor::symbols::Symbol::GetSpan , cmajor::symbols::Symbol::Read , cmajor::symbols::Symbol::SourceModuleId , cmajor::symbols::SymbolReader::GetBinaryReader , cmajor::symbols::SymbolReader::GetSymbolTable , cmajor::symbols::SymbolTable::EmplaceTypeRequest

Called by: cmajor::symbols::ConstantSymbol::GetValue


ResetEvaluating Member Function

void cmajor::symbols::ConstantSymbol::ResetEvaluating()

Definition at line 28 of ConstantSymbol.hpp :
28 { evaluating = false; }


SetEvaluating Member Function

void cmajor::symbols::ConstantSymbol::SetEvaluating()

Definition at line 27 of ConstantSymbol.hpp :
27 { evaluating = true; }


SetSpecifiers Member Function

void cmajor::symbols::ConstantSymbol::SetSpecifiers(Specifiers specifiers)

Definition at line 116 of ConstantSymbol.cpp
Declaration at line 24 of ConstantSymbol.hpp

Calls: cmajor::symbols::Symbol::GetSpan , cmajor::symbols::Symbol::SetAccess , cmajor::symbols::Symbol::SourceModuleId


SetStrValue Member Function

void cmajor::symbols::ConstantSymbol::SetStrValue(const std::u32string& strValue_)

Definition at line 38 of ConstantSymbol.hpp :
38 { strValue = strValue_; }

Called by: cmajor::symbols::SymbolTable::AddConstant


SetType Member Function

void cmajor::symbols::ConstantSymbol::SetType(TypeSymbol * typeSymbol)

Definition at line 31 of ConstantSymbol.hpp :
31 { type = typeSymbol; }


SetValue Member Function

void cmajor::symbols::ConstantSymbol::SetValue(Value * value_)

Definition at line 217 of ConstantSymbol.cpp :
218 {
219     value.reset(value_);
220 }


Declaration at line 32 of ConstantSymbol.hpp


StrValue Member Function

const std::u32string& cmajor::symbols::ConstantSymbol::StrValue() const

Definition at line 39 of ConstantSymbol.hpp :
39 { return strValue; }


StructureIrObject Member Function

void * cmajor::symbols::ConstantSymbol::StructureIrObject(Emitter& emitter, bool create)

Definition at line 247 of ConstantSymbol.cpp
Declaration at line 35 of ConstantSymbol.hpp

Calls: cmajor::symbols::StructuredValue::IrValue , cmajor::symbols::Symbol::GetSpan , cmajor::symbols::Symbol::IsClassTypeSymbol , cmajor::symbols::Symbol::MangledName , cmajor::symbols::Symbol::SourceModuleId , cmajor::symbols::TypeSymbol::IrType


Syntax Member Function

std::string cmajor::symbols::ConstantSymbol::Syntax() const override

Definition at line 192 of ConstantSymbol.cpp
Declaration at line 23 of ConstantSymbol.hpp

Base class overridden functions: cmajor::symbols::Symbol::Syntax

Calls: cmajor::symbols::ConstantSymbol::GetType , cmajor::symbols::Symbol::DocName , cmajor::symbols::Symbol::GetSpecifierStr , cmajor::symbols::TypeSymbol::IsUnsignedType


TypeString Member Function

std::string cmajor::symbols::ConstantSymbol::TypeString() const override

Definition at line 22 of ConstantSymbol.hpp :
22 { return "constant"; }

Base class overridden functions: cmajor::symbols::Symbol::TypeString


Write Member Function

void cmajor::symbols::ConstantSymbol::Write(SymbolWriter & writer) override

Definition at line 26 of ConstantSymbol.cpp
Declaration at line 17 of ConstantSymbol.hpp

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

Calls: cmajor::symbols::ConstantSymbol::Write , cmajor::symbols::Symbol::Write , cmajor::symbols::SymbolWriter::GetBinaryWriter , cmajor::symbols::TypeSymbol::TypeId

Called by: cmajor::symbols::ConstantSymbol::Write


top | up | prev | next