sun::ast::DeclareTypeAST
class · Source (opens in a new tab)
class sun::ast::DeclareTypeAST : public sun::ast::ExprASTDeclare type statement: declare [Alias =] Type<Args>; Used to explicitly instantiate generic types and optionally create aliases.
Inherits
- sun::ast::ExprAST (public)
Public Functions
- DeclareTypeAST
- dotLabel
- getAliasName
- getResolvedDeclaredType
- getType
- getTypeAnnotation
- hasAlias
- hasResolvedDeclaredType
- setResolvedDeclaredType
- toString
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 overrideReturns 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() constReturns the alias name stored by this object.
getResolvedDeclaredType
public · function · Source (opens in a new tab)
sun::types::TypePtr sun::ast::DeclareTypeAST::getResolvedDeclaredType() constReturns 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 overrideReturns 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() constReturns the type annotation stored by this object.
Related: TypeAnnotation
hasAlias
public · function · Source (opens in a new tab)
bool sun::ast::DeclareTypeAST::hasAlias() constReports whether this object has alias.
hasResolvedDeclaredType
public · function · Source (opens in a new tab)
bool sun::ast::DeclareTypeAST::hasResolvedDeclaredType() constReports 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) constResolved 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 overrideReturns a readable representation for diagnostics and debugging.
Protected Functions
ensureAnalysis
protected · function · Source (opens in a new tab)
void sun::ast::DeclareTypeAST::ensureAnalysis() const overrideOverride 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() constAccess as DeclareTypeAnalysis.
Related: DeclareTypeAnalysis
Private Fields
aliasName
private · variable · Source (opens in a new tab)
std::optional<std::string> sun::ast::DeclareTypeAST::aliasNameNo documentation comment.
typeAnnotation
private · variable · Source (opens in a new tab)
TypeAnnotation sun::ast::DeclareTypeAST::typeAnnotationNo documentation comment.
Related: TypeAnnotation