sun::ast::DeclareTypeAST

sun::ast::DeclareTypeAST

class · Source (opens in a new tab)

class sun::ast::DeclareTypeAST : public sun::ast::ExprAST

Declare type statement: declare [Alias =] Type<Args>; Used to explicitly instantiate generic types and optionally create aliases.

Inherits

Public Functions

DeclareTypeAST

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

sun::ast::DeclareTypeAST::DeclareTypeAST(TypeAnnotation type, std::optional< std::string > alias=std::nullopt)

Creates this syntax node and takes ownership of any supplied child expressions.

Related: TypeAnnotation

dotLabel

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

std::string sun::ast::DeclareTypeAST::dotLabel() const override

Returns the node label used in syntax-tree graph visualizations.

getAliasName

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

const std::string & sun::ast::DeclareTypeAST::getAliasName() const

Returns the alias name stored by this object.

getResolvedDeclaredType

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

sun::types::TypePtr sun::ast::DeclareTypeAST::getResolvedDeclaredType() const

Returns the resolved declared type stored by this object.

Related: sun::types::TypePtr

getType

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

ASTNodeType sun::ast::DeclareTypeAST::getType() const override

Returns the syntax-node kind used to dispatch tree visitors.

Related: ASTNodeType

getTypeAnnotation

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

const TypeAnnotation & sun::ast::DeclareTypeAST::getTypeAnnotation() const

Returns the type annotation stored by this object.

Related: TypeAnnotation

hasAlias

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

bool sun::ast::DeclareTypeAST::hasAlias() const

Reports whether this object has alias.

hasResolvedDeclaredType

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

bool sun::ast::DeclareTypeAST::hasResolvedDeclaredType() const

Reports whether this object has resolved declared type.

setResolvedDeclaredType

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

void sun::ast::DeclareTypeAST::setResolvedDeclaredType(sun::types::TypePtr type) const

Resolved declared type (set by semantic analysis).

Related: sun::types::TypePtr

toString

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

std::string sun::ast::DeclareTypeAST::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::DeclareTypeAST::ensureAnalysis() const override

Override to allocate DeclareTypeAnalysis instead of base ExprAnalysis.

Related: DeclareTypeAnalysis, ExprAnalysis

Private Functions

declAnalysis

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

DeclareTypeAnalysis & sun::ast::DeclareTypeAST::declAnalysis() const

Access as DeclareTypeAnalysis.

Related: DeclareTypeAnalysis

Private Fields

aliasName

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

std::optional<std::string> sun::ast::DeclareTypeAST::aliasName

No documentation comment.

typeAnnotation

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

TypeAnnotation sun::ast::DeclareTypeAST::typeAnnotation

No documentation comment.

Related: TypeAnnotation