sun::semantic_analysis::DeclarationState

sun::semantic_analysis::DeclarationState

class · Source (opens in a new tab)

class sun::semantic_analysis::DeclarationState

Declaration bookkeeping shared by collection and body checking.

Public Functions

clearPendingExtensions

public · function · Source (opens in a new tab)

void sun::semantic_analysis::DeclarationState::clearPendingExtensions(const std::string &className)

Drop the extensions for a class once they have been merged into it.

deferExtension

public · function · Source (opens in a new tab)

void sun::semantic_analysis::DeclarationState::deferExtension(const std::string &className, ClassDefinitionAST *extension)

Hold an extension until its primary class is analyzed.

Related: ClassDefinitionAST

hasClassShape

public · function · Source (opens in a new tab)

bool sun::semantic_analysis::DeclarationState::hasClassShape(sun::semantic_analysis::DeclarationId declaration) const

True when this class's shape was already registered by the pre-pass.

Related: sun::semantic_analysis::DeclarationId

isDeclared

public · function · Source (opens in a new tab)

bool sun::semantic_analysis::DeclarationState::isDeclared(const std::string &name, const SemanticScopeBase *scopeIdentity) const

Check whether a source name has already been declared in this scope.

Related: SemanticScopeBase

noteClassShape

public · function · Source (opens in a new tab)

bool sun::semantic_analysis::DeclarationState::noteClassShape(sun::semantic_analysis::DeclarationId declaration)

Record a class shape and report whether it is new.

Related: sun::semantic_analysis::DeclarationId

noteDeclared

public · function · Source (opens in a new tab)

void sun::semantic_analysis::DeclarationState::noteDeclared(const std::string &name, const SemanticScopeBase *scopeIdentity)

Record a source name in its scope; reopened modules reuse their scope.

Related: SemanticScopeBase

pendingExtensions

public · function · Source (opens in a new tab)

const std::vector< ClassDefinitionAST * > * sun::semantic_analysis::DeclarationState::pendingExtensions(const std::string &className) const

The extensions waiting for this class, or nullptr when there are none.

Related: ClassDefinitionAST

Private Fields

definedSymbols_

private · variable · Source (opens in a new tab)

std::unordered_map<const SemanticScopeBase *, std::unordered_set<std::string> > sun::semantic_analysis::DeclarationState::definedSymbols_

No documentation comment.

Related: SemanticScopeBase

pendingExtensions_

private · variable · Source (opens in a new tab)

std::unordered_map<std::string, std::vector<ClassDefinitionAST *> > sun::semantic_analysis::DeclarationState::pendingExtensions_

No documentation comment.

Related: ClassDefinitionAST

preRegisteredClassShapes_

private · variable · Source (opens in a new tab)

std::unordered_set<sun::semantic_analysis::DeclarationId> sun::semantic_analysis::DeclarationState::preRegisteredClassShapes_

No documentation comment.

Related: sun::semantic_analysis::DeclarationId