sun::ast::InterfaceDefinitionAST
class · Source (opens in a new tab)
class sun::ast::InterfaceDefinitionAST : public sun::ast::ExprASTInterface definition: interface Name<T, U> { fields and methods }.
Inherits
- sun::ast::ExprAST (public)
Public Functions
- InterfaceDefinitionAST
- dotLabel
- forEachChildSlot
- getDefaultMethods
- getDoc
- getFields
- getLifetimeParameters
- getMethods
- getMutableFields
- getMutableMethods
- getName
- getParent
- getQualifiedName
- getRequiredMethods
- getType
- getTypeParameterNames
- getTypeParameters
- hasQualifiedName
- isGeneric
- setDoc
- setLifetimeParameters
- setParent
- setQualifiedName
- toString
InterfaceDefinitionAST
public · function · Source (opens in a new tab)
sun::ast::InterfaceDefinitionAST::InterfaceDefinitionAST(std::string name, std::vector< TypeParameter > typeParams, std::vector< InterfaceFieldDecl > fields, std::vector< InterfaceMethodDecl > methods, bool precompiled=false)Creates this syntax node and takes ownership of any supplied child expressions.
Related: TypeParameter, InterfaceFieldDecl, InterfaceMethodDecl
dotLabel
public · function · Source (opens in a new tab)
std::string sun::ast::InterfaceDefinitionAST::dotLabel() const overrideReturns the node label used in syntax-tree graph visualizations.
forEachChildSlot
public · function · Source (opens in a new tab)
void sun::ast::InterfaceDefinitionAST::forEachChildSlot(const ChildSlotFn &fn) overrideVisits replaceable child expressions so tree passes can rewrite them in place.
Related: ChildSlotFn
getDefaultMethods
public · function · Source (opens in a new tab)
std::vector< const InterfaceMethodDecl * > sun::ast::InterfaceDefinitionAST::getDefaultMethods() constGet methods with default implementations.
Related: InterfaceMethodDecl
getDoc
public · function · Source (opens in a new tab)
const std::string & sun::ast::InterfaceDefinitionAST::getDoc() constComment written above the interface (see doc_comments.h).
Related: doc_comments.h
getFields
public · function · Source (opens in a new tab)
const std::vector< InterfaceFieldDecl > & sun::ast::InterfaceDefinitionAST::getFields() constProvides the field declarations belonging to this type.
Related: InterfaceFieldDecl
getLifetimeParameters
public · function · Source (opens in a new tab)
const std::vector< LifetimeParameter > & sun::ast::InterfaceDefinitionAST::getLifetimeParameters() constProvides the declared lifetime parameters used to check borrowed values.
Related: LifetimeParameter
getMethods
public · function · Source (opens in a new tab)
const std::vector< InterfaceMethodDecl > & sun::ast::InterfaceDefinitionAST::getMethods() constProvides the method declarations belonging to this type.
Related: InterfaceMethodDecl
getMutableFields
public · function · Source (opens in a new tab)
std::vector< InterfaceFieldDecl > & sun::ast::InterfaceDefinitionAST::getMutableFields()Provides mutable access to field declarations for later compiler passes.
Related: InterfaceFieldDecl
getMutableMethods
public · function · Source (opens in a new tab)
std::vector< InterfaceMethodDecl > & sun::ast::InterfaceDefinitionAST::getMutableMethods()Provides mutable access to method declarations for later compiler passes.
Related: InterfaceMethodDecl
getName
public · function · Source (opens in a new tab)
const std::string & sun::ast::InterfaceDefinitionAST::getName() constReturns the declared name used to identify this object.
getParent
public · function · Source (opens in a new tab)
const std::optional< TypeAnnotation > & sun::ast::InterfaceDefinitionAST::getParent() constReturns the written parent interface, when this declaration extends one.
Related: TypeAnnotation
getQualifiedName
public · function · Source (opens in a new tab)
const sun::semantic_analysis::QualifiedName & sun::ast::InterfaceDefinitionAST::getQualifiedName() constQualified name (after semantic analysis qualifies it).
Related: sun::semantic_analysis::QualifiedName
getRequiredMethods
public · function · Source (opens in a new tab)
std::vector< const InterfaceMethodDecl * > sun::ast::InterfaceDefinitionAST::getRequiredMethods() constGet methods without default implementations (must be implemented by class).
Related: InterfaceMethodDecl
getType
public · function · Source (opens in a new tab)
ASTNodeType sun::ast::InterfaceDefinitionAST::getType() const overrideReturns the syntax-node kind used to dispatch tree visitors.
Related: ASTNodeType
getTypeParameterNames
public · function · Source (opens in a new tab)
std::vector< std::string > sun::ast::InterfaceDefinitionAST::getTypeParameterNames() constReturns the names used to bind generic arguments during specialization.
getTypeParameters
public · function · Source (opens in a new tab)
const std::vector< TypeParameter > & sun::ast::InterfaceDefinitionAST::getTypeParameters() constProvides the generic parameters declared by this type or function.
Related: TypeParameter
hasQualifiedName
public · function · Source (opens in a new tab)
bool sun::ast::InterfaceDefinitionAST::hasQualifiedName() constReports whether a name including the enclosing scopes has been assigned.
isGeneric
public · function · Source (opens in a new tab)
bool sun::ast::InterfaceDefinitionAST::isGeneric() constReports whether this declaration still has unbound type parameters.
setDoc
public · function · Source (opens in a new tab)
void sun::ast::InterfaceDefinitionAST::setDoc(std::string doc)Stores the source documentation comment for this declaration.
setLifetimeParameters
public · function · Source (opens in a new tab)
void sun::ast::InterfaceDefinitionAST::setLifetimeParameters(std::vector< LifetimeParameter > params)Stores the declared lifetime parameters used to check borrowed values.
Related: LifetimeParameter
setParent
public · function · Source (opens in a new tab)
void sun::ast::InterfaceDefinitionAST::setParent(std::optional< TypeAnnotation > parent)Records the single parent annotation for resolution and serialization.
Related: TypeAnnotation
setQualifiedName
public · function · Source (opens in a new tab)
void sun::ast::InterfaceDefinitionAST::setQualifiedName(sun::semantic_analysis::QualifiedName qname)Records the declaration name together with its enclosing scopes.
Related: sun::semantic_analysis::QualifiedName
toString
public · function · Source (opens in a new tab)
std::string sun::ast::InterfaceDefinitionAST::toString() const overrideReturns a readable representation for diagnostics and debugging.
Protected Functions
ensureAnalysis
protected · function · Source (opens in a new tab)
void sun::ast::InterfaceDefinitionAST::ensureAnalysis() const overrideOverride to allocate InterfaceAnalysis instead of base ExprAnalysis.
Related: InterfaceAnalysis, ExprAnalysis
Private Functions
ifaceAnalysis
private · function · Source (opens in a new tab)
InterfaceAnalysis & sun::ast::InterfaceDefinitionAST::ifaceAnalysis() constAccess as InterfaceAnalysis.
Related: InterfaceAnalysis
Private Fields
doc_
private · variable · Source (opens in a new tab)
std::string sun::ast::InterfaceDefinitionAST::doc_No documentation comment.
fields
private · variable · Source (opens in a new tab)
std::vector<InterfaceFieldDecl> sun::ast::InterfaceDefinitionAST::fieldsNo documentation comment.
Related: InterfaceFieldDecl
lifetimeParameters
private · variable · Source (opens in a new tab)
std::vector<LifetimeParameter> sun::ast::InterfaceDefinitionAST::lifetimeParametersNo documentation comment.
Related: LifetimeParameter
methods
private · variable · Source (opens in a new tab)
std::vector<InterfaceMethodDecl> sun::ast::InterfaceDefinitionAST::methodsNo documentation comment.
Related: InterfaceMethodDecl
name
private · variable · Source (opens in a new tab)
std::string sun::ast::InterfaceDefinitionAST::nameNo documentation comment.
parent_
private · variable · Source (opens in a new tab)
std::optional<TypeAnnotation> sun::ast::InterfaceDefinitionAST::parent_No documentation comment.
Related: TypeAnnotation
typeParameters
private · variable · Source (opens in a new tab)
std::vector<TypeParameter> sun::ast::InterfaceDefinitionAST::typeParametersNo documentation comment.
Related: TypeParameter