sun::semantic_analysis::InterfaceAnalyzer
class · Source (opens in a new tab)
class sun::semantic_analysis::InterfaceAnalyzerOwns interface preparation state and checks contracts and implementations.
Public Functions
- InterfaceAnalyzer
- analyzeInterfaceDefinition
- ensureClassInterfaces
- ensureInterfaceShape
- inheritInterfaceFields
- mergeInterfaceParent
- resolveInterfaceMemberType
- validateInterfaceImplementation
InterfaceAnalyzer
public · function · Source (opens in a new tab)
sun::semantic_analysis::InterfaceAnalyzer::InterfaceAnalyzer(SemanticContext &ctx, SemanticAnalyzer &sema, GenericSpecializer &generics, type_analysis::TypeResolver &resolver)Borrows the context and analysis helpers for this compilation.
Related: SemanticContext, SemanticAnalyzer, GenericSpecializer, type_analysis::TypeResolver
analyzeInterfaceDefinition
public · function · Source (opens in a new tab)
void sun::semantic_analysis::InterfaceAnalyzer::analyzeInterfaceDefinition(sun::ast::InterfaceDefinitionAST &interfaceDef)Resolves declarations and checks types in this interface definition, recording the results on its syntax nodes.
Related: sun::ast::InterfaceDefinitionAST
ensureClassInterfaces
public · function · Source (opens in a new tab)
void sun::semantic_analysis::InterfaceAnalyzer::ensureClassInterfaces(DeclarationId declaration)Records a registered class's interface claims before constraint checking.
Field inheritance and method conformance remain part of class analysis.
Related: DeclarationId
ensureInterfaceShape
public · function · Source (opens in a new tab)
void sun::semantic_analysis::InterfaceAnalyzer::ensureInterfaceShape(DeclarationId declaration)Resolves an interface's complete inherited shape without checking bodies.
Related: DeclarationId
inheritInterfaceFields
public · function · Source (opens in a new tab)
void sun::semantic_analysis::InterfaceAnalyzer::inheritInterfaceFields(const sun::ast::ClassDefinitionAST &classDef, std::shared_ptr< sun::types::ClassType > classType)Copy the fields an implemented interface declares onto the class.
Must run before its methods are analyzed, since they may read those fields.
Related: sun::ast::ClassDefinitionAST, sun::types::ClassType
mergeInterfaceParent
public · function · Source (opens in a new tab)
void sun::semantic_analysis::InterfaceAnalyzer::mergeInterfaceParent(sun::types::InterfaceType &interfaceType, const sun::ast::InterfaceDefinitionAST &definition)Combines inherited members and validates matching child declarations.
Related: sun::types::InterfaceType, sun::ast::InterfaceDefinitionAST
resolveInterfaceMemberType
public · function · Source (opens in a new tab)
TypePtr sun::semantic_analysis::InterfaceAnalyzer::resolveInterfaceMemberType(const sun::ast::MemberAccessAST &expr, const sun::types::TypePtr &objectType, const std::string &memberName)Resolve the receiver member and enforce access rules.
Related: sun::types::TypePtr, sun::ast::MemberAccessAST
validateInterfaceImplementation
public · function · Source (opens in a new tab)
void sun::semantic_analysis::InterfaceAnalyzer::validateInterfaceImplementation(const sun::ast::ClassDefinitionAST &classDef, std::shared_ptr< sun::types::ClassType > classType)Check that a class implements every method its interfaces require, with matching signatures and constness.
Related: sun::ast::ClassDefinitionAST, sun::types::ClassType
Private Functions
prepareInterfaceShape
private · function · Source (opens in a new tab)
void sun::semantic_analysis::InterfaceAnalyzer::prepareInterfaceShape(sun::ast::InterfaceDefinitionAST &interfaceDef)Resolves the local members and inherited contract of an interface.
Related: sun::ast::InterfaceDefinitionAST
Private Fields
- analyzedInterfaceBodies_
- ctx_
- generics_
- preparedTypes_
- preparingTypes_
- resolver_
- resolvingInterfaceParents_
- sema_
analyzedInterfaceBodies_
private · variable · Source (opens in a new tab)
std::set<DeclarationId> sun::semantic_analysis::InterfaceAnalyzer::analyzedInterfaceBodies_No documentation comment.
Related: DeclarationId
ctx_
private · variable · Source (opens in a new tab)
SemanticContext& sun::semantic_analysis::InterfaceAnalyzer::ctx_No documentation comment.
Related: SemanticContext
generics_
private · variable · Source (opens in a new tab)
GenericSpecializer& sun::semantic_analysis::InterfaceAnalyzer::generics_No documentation comment.
Related: GenericSpecializer
preparedTypes_
private · variable · Source (opens in a new tab)
std::set<DeclarationId> sun::semantic_analysis::InterfaceAnalyzer::preparedTypes_No documentation comment.
Related: DeclarationId
preparingTypes_
private · variable · Source (opens in a new tab)
std::set<DeclarationId> sun::semantic_analysis::InterfaceAnalyzer::preparingTypes_No documentation comment.
Related: DeclarationId
resolver_
private · variable · Source (opens in a new tab)
type_analysis::TypeResolver& sun::semantic_analysis::InterfaceAnalyzer::resolver_No documentation comment.
Related: type_analysis::TypeResolver
resolvingInterfaceParents_
private · variable · Source (opens in a new tab)
std::set<DeclarationId> sun::semantic_analysis::InterfaceAnalyzer::resolvingInterfaceParents_No documentation comment.
Related: DeclarationId
sema_
private · variable · Source (opens in a new tab)
SemanticAnalyzer& sun::semantic_analysis::InterfaceAnalyzer::sema_No documentation comment.
Related: SemanticAnalyzer