top | up | prev | next

FunctionDeclarationSymbol Abstract Class

Definition at line 31 of FunctionSymbol.hpp

Constructors

FunctionDeclarationSymbol(const Span& span_, const std::u32string& groupName_, const std::u32string& name_, Specifier specifiers_)

Member Functions

void AddMember(std::unique_ptr<Symbol>&& member) override
void AddSpecifiers(Specifier specifiers_)
void AddTemplateParameter(std::unique_ptr<TypeSymbol>&& templateParameter)
int Arity() const
std::unique_ptr<sngxml::dom::Element> CreateElement() override
const std::u32string& FileId() const
const std::string& FileName() const
FunctionSymbol* FunctionDefinition() const
FunctionGroupSymbol* FunctionGroup() override
std::u32string FunctionId() override
std::u32string FunctionKind() override
TypeSymbol* GetType() override
const std::u32string& GroupName() const override
std::u32string IdStr() override
bool IsConst() const override
bool IsFunctionDeclarationSymbol() const override
bool IsInstallSymbol() const override
std::u32string KindStr() override
const std::vector<ParameterSymbol*>& Parameters() const override
TypeSymbol* ReturnType() override
void SetFileId(const std::u32string& fileId_)
void SetFileName(const std::string& fileName_)
void SetFunctionDefinition(FunctionSymbol* functionDefinition_)
void SetFunctionGroup(FunctionGroupSymbol* functionGroup_)
void SetReturnType(TypeSymbol* returnType_)
Specifier Specifiers() const

Member Variables

std::u32string fileId
std::string fileName
FunctionSymbol* functionDefinition
FunctionGroupSymbol* functionGroup
std::u32string groupName
std::vector<ParameterSymbol*> parameters
TypeSymbol* returnType
Specifier specifiers
std::vector<std::unique_ptr<TypeSymbol>> templateParameters

Constructor Details

FunctionDeclarationSymbol Constructor

sngcpp::symbols::FunctionDeclarationSymbol::FunctionDeclarationSymbol(const Span& span_, const std::u32string& groupName_, const std::u32string& name_, Specifier specifiers_)

Definition at line 21 of FunctionSymbol.cpp :
 21 :
 22 CallableSymbol(span_name_)groupName(groupName_)specifiers(specifiers_)functionGroup(nullptr)returnType(nullptr)functionDefinition(nullptr)
 23 {
 24 }


Declaration at line 34 of FunctionSymbol.hpp


Member Function Details

AddMember Member Function

void sngcpp::symbols::FunctionDeclarationSymbol::AddMember(std::unique_ptr<Symbol >&& member) override

Definition at line 66 of FunctionSymbol.cpp :
 67 {
 68     Symbol* symbol = member.get();
 69     if (symbol->IsParameterSymbol())
 70     {
 71         parameters.push_back(static_cast<ParameterSymbol*>(symbol));
 72     }
 73     ContainerSymbol::AddMember(std::move(member));
 74 }


Declaration at line 37 of FunctionSymbol.hpp

Base class overridden functions: sngcpp::symbols::ContainerSymbol::AddMember

Calls: sngcpp::symbols::ContainerSymbol::AddMember , sngcpp::symbols::Symbol::IsParameterSymbol


AddSpecifiers Member Function

void sngcpp::symbols::FunctionDeclarationSymbol::AddSpecifiers(Specifier specifiers_)

Definition at line 76 of FunctionSymbol.cpp :
 77 {
 78     specifiers = specifiers | specifiers_;
 79 }


Declaration at line 38 of FunctionSymbol.hpp


AddTemplateParameter Member Function

void sngcpp::symbols::FunctionDeclarationSymbol::AddTemplateParameter(std::unique_ptr<TypeSymbol >&& templateParameter)

Definition at line 26 of FunctionSymbol.cpp :
 27 {
 28     templateParameters.push_back(std::move(templateParameter));
 29 }


Declaration at line 45 of FunctionSymbol.hpp

Called by: sngcpp::symbols::SymbolTable::BeginFunctionDeclaration


Arity Member Function

int sngcpp::symbols::FunctionDeclarationSymbol::Arity() const

Definition at line 51 of FunctionSymbol.hpp :
 51 { return parameters.size(); }


CreateElement Member Function

std::unique_ptr<sngxml::dom::Element> sngcpp::symbols::FunctionDeclarationSymbol::CreateElement() override

Definition at line 60 of FunctionSymbol.cpp :
 61 {
 62     std::unique_ptr<sngxml::dom::Element> functionElement(new sngxml::dom::Element(U"function_declaration"));
 63     return functionElement;
 64 }


Declaration at line 36 of FunctionSymbol.hpp

Base class overridden functions: sngcpp::symbols::Symbol::CreateElement

Derived class overrides: sngcpp::symbols::ConstructorDeclarationSymbol::CreateElement


FileId Member Function

const std::u32string& sngcpp::symbols::FunctionDeclarationSymbol::FileId() const

Definition at line 54 of FunctionSymbol.hpp :
 54 { return fileId; }


FileName Member Function

const std::string& sngcpp::symbols::FunctionDeclarationSymbol::FileName() const

Definition at line 56 of FunctionSymbol.hpp :
 56 { return fileName; }


FunctionDefinition Member Function

FunctionSymbol * sngcpp::symbols::FunctionDeclarationSymbol::FunctionDefinition() const

Definition at line 59 of FunctionSymbol.hpp :
 59 { return functionDefinition; }


FunctionGroup Member Function

FunctionGroupSymbol * sngcpp::symbols::FunctionDeclarationSymbol::FunctionGroup() override

Definition at line 52 of FunctionSymbol.hpp :
 52 { return functionGroup; }

Base class overridden functions: sngcpp::symbols::CallableSymbol::FunctionGroup


FunctionId Member Function

std::u32string sngcpp::symbols::FunctionDeclarationSymbol::FunctionId() override

Definition at line 53 of FunctionSymbol.cpp :
 54 {
 55     std::u32string functionId = FunctionKind();
 56     functionId.append(1'_').append(SimpleName()).append(1'_').append(ToUtf32(GetSha1MessageDigest(ToUtf8(IdStr()))));
 57     return functionId;
 58 }


Declaration at line 60 of FunctionSymbol.hpp

Base class overridden functions: sngcpp::symbols::CallableSymbol::FunctionId

Calls: sngcpp::symbols::FunctionDeclarationSymbol::FunctionKind , sngcpp::symbols::FunctionDeclarationSymbol::IdStr , sngcpp::symbols::Symbol::SimpleName


FunctionKind Member Function

std::u32string sngcpp::symbols::FunctionDeclarationSymbol::FunctionKind() override

Definition at line 43 of FunctionSymbol.hpp :
 43 { return U"function"; }

Base class overridden functions: sngcpp::symbols::CallableSymbol::FunctionKind

Derived class overrides: sngcpp::symbols::ConstructorDeclarationSymbol::FunctionKind

Called by: sngcpp::symbols::FunctionDeclarationSymbol::FunctionId


GetType Member Function

TypeSymbol * sngcpp::symbols::FunctionDeclarationSymbol::GetType() override

Definition at line 47 of FunctionSymbol.hpp :
 47 { return returnType; }

Base class overridden functions: sngcpp::symbols::Symbol::GetType

Derived class overrides: sngcpp::symbols::ConstructorDeclarationSymbol::GetType


GroupName Member Function

const std::u32string& sngcpp::symbols::FunctionDeclarationSymbol::GroupName() const override

Definition at line 50 of FunctionSymbol.hpp :
 50 { return groupName; }

Base class overridden functions: sngcpp::symbols::CallableSymbol::GroupName

Called by: sngcpp::symbols::ContainerSymbol::AddMember


IdStr Member Function

std::u32string sngcpp::symbols::FunctionDeclarationSymbol::IdStr() override

Definition at line 31 of FunctionSymbol.cpp
Declaration at line 44 of FunctionSymbol.hpp

Base class overridden functions: sngcpp::symbols::Symbol::IdStr

Calls: sngcpp::symbols::ParameterSymbol::GetType , sngcpp::symbols::Symbol::FullName , sngcpp::symbols::Symbol::Id , sngcpp::symbols::Symbol::Name

Called by: sngcpp::symbols::FunctionDeclarationSymbol::FunctionId


IsConst Member Function

bool sngcpp::symbols::FunctionDeclarationSymbol::IsConst() const override

Definition at line 40 of FunctionSymbol.hpp :
 40 { return (specifiers & Specifier::const_) != Specifier::none; }

Base class overridden functions: sngcpp::symbols::CallableSymbol::IsConst


IsFunctionDeclarationSymbol Member Function

bool sngcpp::symbols::FunctionDeclarationSymbol::IsFunctionDeclarationSymbol() const override

Definition at line 35 of FunctionSymbol.hpp :
 35 { return true; }

Base class overridden functions: sngcpp::symbols::Symbol::IsFunctionDeclarationSymbol


IsInstallSymbol Member Function

bool sngcpp::symbols::FunctionDeclarationSymbol::IsInstallSymbol() const override

Definition at line 41 of FunctionSymbol.hpp :
 41 { return false; }

Base class overridden functions: sngcpp::symbols::Symbol::IsInstallSymbol


KindStr Member Function

std::u32string sngcpp::symbols::FunctionDeclarationSymbol::KindStr() override

Definition at line 42 of FunctionSymbol.hpp :
 42 { return U"function_declaration"; }

Base class overridden functions: sngcpp::symbols::Symbol::KindStr

Derived class overrides: sngcpp::symbols::ConstructorDeclarationSymbol::KindStr


Parameters Member Function

const std::vector<ParameterSymbol *>& sngcpp::symbols::FunctionDeclarationSymbol::Parameters() const override

Definition at line 46 of FunctionSymbol.hpp :
 46 { return parameters; }

Base class overridden functions: sngcpp::symbols::CallableSymbol::Parameters


ReturnType Member Function

TypeSymbol * sngcpp::symbols::FunctionDeclarationSymbol::ReturnType() override

Definition at line 48 of FunctionSymbol.hpp :
 48 { return returnType; }

Base class overridden functions: sngcpp::symbols::CallableSymbol::ReturnType

Derived class overrides: sngcpp::symbols::ConstructorDeclarationSymbol::ReturnType


SetFileId Member Function

void sngcpp::symbols::FunctionDeclarationSymbol::SetFileId(const std::u32string& fileId_)

Definition at line 53 of FunctionSymbol.hpp :
 53 { fileId = fileId_; }


SetFileName Member Function

void sngcpp::symbols::FunctionDeclarationSymbol::SetFileName(const std::string& fileName_)

Definition at line 55 of FunctionSymbol.hpp :
 55 { fileName = fileName_; }


SetFunctionDefinition Member Function

void sngcpp::symbols::FunctionDeclarationSymbol::SetFunctionDefinition(FunctionSymbol * functionDefinition_)

Definition at line 58 of FunctionSymbol.hpp :
 58 { functionDefinition = functionDefinition_; }


SetFunctionGroup Member Function

void sngcpp::symbols::FunctionDeclarationSymbol::SetFunctionGroup(FunctionGroupSymbol * functionGroup_)

Definition at line 57 of FunctionSymbol.hpp :
 57 { functionGroup = functionGroup_; }


SetReturnType Member Function

void sngcpp::symbols::FunctionDeclarationSymbol::SetReturnType(TypeSymbol * returnType_)

Definition at line 49 of FunctionSymbol.hpp :
 49 { returnType = returnType_; }


Specifiers Member Function

Specifier sngcpp::symbols::FunctionDeclarationSymbol::Specifiers() const

Definition at line 39 of FunctionSymbol.hpp :
 39 { return specifiers; }


top | up | prev | next