sun::ast::ModuleAST
class · Source (opens in a new tab)
class sun::ast::ModuleAST : public sun::ast::ExprASTModule declaration: module Name { declarations... } Also supports legacy 'namespace' keyword.
Inherits
- sun::ast::ExprAST (public)
Public Functions
- ModuleAST
- dotLabel
- forEachChildSlot
- getBody
- getDoc
- getName
- getNameLocation
- getQualifiedName
- getShorthandChild
- getType
- hasQualifiedName
- mutableBody
- setDoc
- setNameLocation
- setQualifiedName
- toString
ModuleAST
public · function · Source (opens in a new tab)
sun::ast::ModuleAST::ModuleAST(std::string name, std::unique_ptr< BlockExprAST > body)Creates this syntax node and takes ownership of any supplied child expressions.
Related: BlockExprAST
dotLabel
public · function · Source (opens in a new tab)
std::string sun::ast::ModuleAST::dotLabel() const overrideReturns the node label used in syntax-tree graph visualizations.
forEachChildSlot
public · function · Source (opens in a new tab)
void sun::ast::ModuleAST::forEachChildSlot(const ChildSlotFn &fn) overrideVisits replaceable child expressions so tree passes can rewrite them in place.
Related: ChildSlotFn
getBody
public · function · Source (opens in a new tab)
const BlockExprAST & sun::ast::ModuleAST::getBody() constProvides access to the expressions that make up the body.
Related: BlockExprAST
getDoc
public · function · Source (opens in a new tab)
const std::string & sun::ast::ModuleAST::getDoc() constReturn the comment documenting this module.
getName
public · function · Source (opens in a new tab)
const std::string & sun::ast::ModuleAST::getName() constReturns the declared name used to identify this object.
getNameLocation
public · function · Source (opens in a new tab)
const std::optional< sun::support::Position > & sun::ast::ModuleAST::getNameLocation() constReturn the source span of this module's name, when available.
Related: sun::support::Position
getQualifiedName
public · function · Source (opens in a new tab)
const QualifiedName & sun::ast::ModuleAST::getQualifiedName() constReturn the defining module name, independent of source aliases.
Related: QualifiedName
getShorthandChild
getShorthandChild()
public · function · Source (opens in a new tab)
ModuleAST * sun::ast::ModuleAST::getShorthandChild()Return the next mutable module in the same dotted declaration, or null.
Related: ModuleAST
getShorthandChild() const
public · function · Source (opens in a new tab)
const ModuleAST * sun::ast::ModuleAST::getShorthandChild() constReturn the next module in the same dotted declaration, or null.
Related: ModuleAST
getType
public · function · Source (opens in a new tab)
ASTNodeType sun::ast::ModuleAST::getType() const overrideReturns the syntax-node kind used to dispatch tree visitors.
Related: ASTNodeType
hasQualifiedName
public · function · Source (opens in a new tab)
bool sun::ast::ModuleAST::hasQualifiedName() constWhether the module's defining name has been recorded.
mutableBody
public · function · Source (opens in a new tab)
BlockExprAST & sun::ast::ModuleAST::mutableBody()Provides mutable access to the body so compiler passes can rewrite it.
Related: BlockExprAST
setDoc
public · function · Source (opens in a new tab)
void sun::ast::ModuleAST::setDoc(std::string value)Store the comment documenting this module.
setNameLocation
public · function · Source (opens in a new tab)
void sun::ast::ModuleAST::setNameLocation(sun::support::Position value)Record the source span of this module's name.
Related: sun::support::Position
setQualifiedName
public · function · Source (opens in a new tab)
void sun::ast::ModuleAST::setQualifiedName(QualifiedName value)Record the module's defining name during import or semantic analysis.
Related: QualifiedName
toString
public · function · Source (opens in a new tab)
std::string sun::ast::ModuleAST::toString() const overrideReturns a readable representation for diagnostics and debugging.
Private Fields
body
private · variable · Source (opens in a new tab)
std::unique_ptr<BlockExprAST> sun::ast::ModuleAST::bodyNo documentation comment.
Related: BlockExprAST
doc
private · variable · Source (opens in a new tab)
std::string sun::ast::ModuleAST::docNo documentation comment.
name
private · variable · Source (opens in a new tab)
std::string sun::ast::ModuleAST::nameNo documentation comment.
nameLocation
private · variable · Source (opens in a new tab)
std::optional<sun::support::Position> sun::ast::ModuleAST::nameLocationNo documentation comment.
Related: sun::support::Position
qualifiedName
private · variable · Source (opens in a new tab)
QualifiedName sun::ast::ModuleAST::qualifiedNameNo documentation comment.
Related: QualifiedName