sun::ast::InterfaceDefinitionAST

sun::ast::InterfaceDefinitionAST

class · Source (opens in a new tab)

class sun::ast::InterfaceDefinitionAST : public sun::ast::ExprAST

Interface definition: interface Name<T, U> { fields and methods }.

Inherits

Public Functions

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 override

Returns 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) override

Visits 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() const

Get methods with default implementations.

Related: InterfaceMethodDecl

getDoc

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

const std::string & sun::ast::InterfaceDefinitionAST::getDoc() const

Comment 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() const

Provides 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() const

Provides 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() const

Provides 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() const

Returns 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() const

Returns 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() const

Qualified 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() const

Get 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 override

Returns 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() const

Returns 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() const

Provides 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() const

Reports whether a name including the enclosing scopes has been assigned.

isGeneric

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

bool sun::ast::InterfaceDefinitionAST::isGeneric() const

Reports 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 override

Returns a readable representation for diagnostics and debugging.

Protected Functions

ensureAnalysis

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

void sun::ast::InterfaceDefinitionAST::ensureAnalysis() const override

Override 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() const

Access 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::fields

No documentation comment.

Related: InterfaceFieldDecl

lifetimeParameters

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

std::vector<LifetimeParameter> sun::ast::InterfaceDefinitionAST::lifetimeParameters

No documentation comment.

Related: LifetimeParameter

methods

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

std::vector<InterfaceMethodDecl> sun::ast::InterfaceDefinitionAST::methods

No documentation comment.

Related: InterfaceMethodDecl

name

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

std::string sun::ast::InterfaceDefinitionAST::name

No 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::typeParameters

No documentation comment.

Related: TypeParameter