top | up | prev | next

VariableSymbol Class

Definition at line 16 of VariableSymbol.hpp

Constructors

VariableSymbol(SymbolType symbolType_, const Span& span_, const boost::uuids::uuid& sourceModuleId_, const std::u32string& name_)

Member Functions

void Check() override
const char* ClassName() const override
void EmplaceType(TypeSymbol* typeSymbol, int index) override
std::string GetSymbolHelp() const override
const TypeSymbol* GetType() const
TypeSymbol* GetType()
const ContainerScope* GetTypeScope() const override
ContainerScope* GetTypeScope() override
std::u32string Info() const override
bool IsVariableSymbol() const override
void Read(SymbolReader& reader) override
void SetType(TypeSymbol* typeSymbol)
void Write(SymbolWriter& writer) override

Member Variables

TypeSymbol* type

Constructor Details

VariableSymbol Constructor

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

Definition at line 22 of VariableSymbol.cpp :
 22 :
 23 Symbol(symbolType_span_sourceModuleId_name_)type()
 24 {
 25 }


Declaration at line 19 of VariableSymbol.hpp


Member Function Details

Check Member Function

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

Definition at line 71 of VariableSymbol.cpp :
 72 {
 73     Symbol::Check();
 74     if (!type)
 75     {
 76         throw SymbolCheckException("variable symbol contains null type pointer"GetSpan()SourceModuleId());
 77     }
 78 }


Declaration at line 31 of VariableSymbol.hpp

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

Derived class overrides: cmajor::symbols::MemberVariableSymbol::Check

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

Called by: cmajor::symbols::MemberVariableSymbol::Check


ClassName Member Function

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

Definition at line 30 of VariableSymbol.hpp :
 30 { return "VariableSymbol"; }

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

Derived class overrides: cmajor::symbols::GlobalVariableSymbol::ClassName , cmajor::symbols::LocalVariableSymbol::ClassName , cmajor::symbols::MemberVariableSymbol::ClassName , cmajor::symbols::ParameterSymbol::ClassName


EmplaceType Member Function

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

Definition at line 41 of VariableSymbol.cpp :
 42 {
 43     Assert(index == 0"invalid emplace type index");
 44     type = typeSymbol;
 45 }


Declaration at line 23 of VariableSymbol.hpp

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


GetSymbolHelp Member Function

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

Definition at line 80 of VariableSymbol.cpp :
 81 {
 82     if (!type) return std::string();
 83     std::string help = "(";
 84     help.append(GetSymbolCategoryDescription()).append(") ");
 85     help.append(ToUtf8(type->FullName())).append(" ");
 86     help.append(ToUtf8(FullName()));
 87     return help;
 88 }


Declaration at line 32 of VariableSymbol.hpp

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

Derived class overrides: cmajor::symbols::LocalVariableSymbol::GetSymbolHelp , cmajor::symbols::ParameterSymbol::GetSymbolHelp

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


GetType Member Function

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

Definition at line 24 of VariableSymbol.hpp :
 24 { return type; }

Called by: cmajor::symbols::ContainerScope::LookupQualifiedBeginWith


GetType Member Function

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

Definition at line 25 of VariableSymbol.hpp :
 25 { return type; }

Called by: cmajor::symbols::ClassDelegateTypeSymbol::GetSymbolHelp , cmajor::symbols::ClassDelegateTypeSymbol::Syntax , cmajor::symbols::ClassTypeSymbol::CreateLayouts , cmajor::symbols::ClassTypeSymbol::HasNontrivialDestructor , cmajor::symbols::ClassTypeSymbol::IsRecursive , cmajor::symbols::ConstructorSymbol::DocName , cmajor::symbols::DelegateTypeSymbol::GetSymbolHelp , cmajor::symbols::DelegateTypeSymbol::IrType , cmajor::symbols::DelegateTypeSymbol::Syntax , cmajor::symbols::FunctionSymbol::ComputeName , cmajor::symbols::FunctionSymbol::DocName , cmajor::symbols::FunctionSymbol::FullName , cmajor::symbols::FunctionSymbol::IrType , cmajor::symbols::GlobalVariableSymbol::CreateIrObject , cmajor::symbols::GlobalVariableSymbol::Dump , cmajor::symbols::GlobalVariableSymbol::IrObject , cmajor::symbols::GlobalVariableSymbol::Read , cmajor::symbols::GlobalVariableSymbol::Syntax , cmajor::symbols::LocalVariableSymbol::CreateDomElement , cmajor::symbols::LocalVariableSymbol::GetSymbolHelp , cmajor::symbols::MemberFunctionSymbol::DocName , cmajor::symbols::MemberVariableSymbol::CreateDomElement , cmajor::symbols::MemberVariableSymbol::Dump , cmajor::symbols::MemberVariableSymbol::GetDIMemberType , cmajor::symbols::MemberVariableSymbol::Syntax , cmajor::symbols::ParameterSymbol::Clone , cmajor::symbols::ParameterSymbol::CreateDomElement , cmajor::symbols::ParameterSymbol::GetSymbolHelp , cmajor::symbols::StructuredValue::Read , cmajor::symbols::TypeIndex::AddType


GetTypeScope Member Function

const ContainerScope * cmajor::symbols::VariableSymbol::GetTypeScope() const override

Definition at line 47 of VariableSymbol.cpp :
 48 {
 49     if (type)
 50     {
 51         return type->BaseType()->GetContainerScope();
 52     }
 53     else
 54     {
 55         return nullptr;
 56     }
 57 }


Declaration at line 27 of VariableSymbol.hpp

Base class overridden functions: cmajor::symbols::Symbol::GetTypeScope , cmajor::symbols::Symbol::GetTypeScope

Calls: cmajor::symbols::ContainerSymbol::GetContainerScope , cmajor::symbols::TypeSymbol::BaseType


GetTypeScope Member Function

ContainerScope * cmajor::symbols::VariableSymbol::GetTypeScope() override

Definition at line 59 of VariableSymbol.cpp :
 60 {
 61     if (type)
 62     {
 63         return type->BaseType()->GetContainerScope();
 64     }
 65     else
 66     {
 67         return nullptr;
 68     }
 69 }


Declaration at line 28 of VariableSymbol.hpp

Base class overridden functions: cmajor::symbols::Symbol::GetTypeScope , cmajor::symbols::Symbol::GetTypeScope

Calls: cmajor::symbols::ContainerSymbol::GetContainerScope , cmajor::symbols::TypeSymbol::BaseType


Info Member Function

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

Definition at line 29 of VariableSymbol.hpp :
 29 { return Name(); }

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

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


IsVariableSymbol Member Function

bool cmajor::symbols::VariableSymbol::IsVariableSymbol() const override

Definition at line 20 of VariableSymbol.hpp :
 20 { return true; }

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


Read Member Function

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

Definition at line 33 of VariableSymbol.cpp :
 34 {
 35     Symbol::Read(reader);
 36     boost::uuids::uuid typeId;
 37     reader.GetBinaryReader().ReadUuid(typeId);
 38     reader.GetSymbolTable()->EmplaceTypeRequest(readerthistypeId0);
 39 }


Declaration at line 22 of VariableSymbol.hpp

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

Derived class overrides: cmajor::symbols::GlobalVariableSymbol::Read , cmajor::symbols::MemberVariableSymbol::Read , cmajor::symbols::ParameterSymbol::Read

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

Called by: cmajor::symbols::GlobalVariableSymbol::Read , cmajor::symbols::MemberVariableSymbol::Read , cmajor::symbols::ParameterSymbol::Read


SetType Member Function

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

Definition at line 26 of VariableSymbol.hpp :
 26 { type = typeSymbol; }

Called by: cmajor::symbols::ClassTypeSymbol::CreateDestructorSymbol , cmajor::symbols::ClassTypeSymbol::CreateLayouts , cmajor::symbols::FunctionSymbol::CreateTemporary , cmajor::symbols::GlobalVariableSymbol::Read , cmajor::symbols::ParameterSymbol::Clone , cmajor::symbols::SymbolTable::BeginConstructor , cmajor::symbols::SymbolTable::BeginConversionFunction , cmajor::symbols::SymbolTable::BeginDestructor , cmajor::symbols::SymbolTable::BeginMemberFunction


Write Member Function

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

Definition at line 27 of VariableSymbol.cpp :
 28 {
 29     Symbol::Write(writer);
 30     writer.GetBinaryWriter().Write(type->TypeId());
 31 }


Declaration at line 21 of VariableSymbol.hpp

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

Derived class overrides: cmajor::symbols::GlobalVariableSymbol::Write , cmajor::symbols::MemberVariableSymbol::Write , cmajor::symbols::ParameterSymbol::Write

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

Called by: cmajor::symbols::GlobalVariableSymbol::Write , cmajor::symbols::MemberVariableSymbol::Write , cmajor::symbols::ParameterSymbol::Write , cmajor::symbols::VariableSymbol::Write


top | up | prev | next