sun::ast::ForInExprAST
class · Source (opens in a new tab)
class sun::ast::ForInExprAST : public sun::ast::ExprASTfor (var x: T in iterable) { ... } Iterates over iterable by calling iter() -> IIterator<T, C> (when the iterable is not itself an iterator), then next(ref C) -> Option<T> until None
Inherits
- sun::ast::ExprAST (public)
Public Functions
- ForInExprAST
- bodySlot
- dotLabel
- forEachChildSlot
- forInAnalysis
- getBody
- getIterable
- getLoopVar
- getLoopVarType
- getResolvedLoopVarType
- getType
- hasResolvedLoopVarType
- isConst
- setResolvedLoopVarType
- toString
ForInExprAST
public · function · Source (opens in a new tab)
sun::ast::ForInExprAST::ForInExprAST(std::string LoopVar, TypeAnnotation LoopVarType, std::unique_ptr< ExprAST > Iterable, std::unique_ptr< ExprAST > Body, bool isConst=false)Creates this syntax node and takes ownership of any supplied child expressions.
Related: TypeAnnotation, ExprAST
bodySlot
public · function · Source (opens in a new tab)
std::unique_ptr< ExprAST > & sun::ast::ForInExprAST::bodySlot()Mutable body slot for LoweringPass block normalization.
Related: ExprAST
dotLabel
public · function · Source (opens in a new tab)
std::string sun::ast::ForInExprAST::dotLabel() const overrideReturns the node label used in syntax-tree graph visualizations.
forEachChildSlot
public · function · Source (opens in a new tab)
void sun::ast::ForInExprAST::forEachChildSlot(const ChildSlotFn &fn) overrideVisits replaceable child expressions so tree passes can rewrite them in place.
Related: ChildSlotFn
forInAnalysis
public · function · Source (opens in a new tab)
ForInAnalysis & sun::ast::ForInExprAST::forInAnalysis() constAccess the resolved iterator protocol and loop binding.
Related: ForInAnalysis
getBody
public · function · Source (opens in a new tab)
const ExprAST * sun::ast::ForInExprAST::getBody() constProvides access to the expressions that make up the body.
Related: ExprAST
getIterable
public · function · Source (opens in a new tab)
const ExprAST * sun::ast::ForInExprAST::getIterable() constReturns the expression being iterated.
Related: ExprAST
getLoopVar
public · function · Source (opens in a new tab)
const std::string & sun::ast::ForInExprAST::getLoopVar() constReturns the loop variable declaration.
getLoopVarType
public · function · Source (opens in a new tab)
const TypeAnnotation & sun::ast::ForInExprAST::getLoopVarType() constReturns the declared loop-variable type.
Related: TypeAnnotation
getResolvedLoopVarType
public · function · Source (opens in a new tab)
sun::types::TypePtr sun::ast::ForInExprAST::getResolvedLoopVarType() constReturns the loop-variable type selected by analysis.
Related: sun::types::TypePtr
getType
public · function · Source (opens in a new tab)
ASTNodeType sun::ast::ForInExprAST::getType() const overrideReturns the syntax-node kind used to dispatch tree visitors.
Related: ASTNodeType
hasResolvedLoopVarType
public · function · Source (opens in a new tab)
bool sun::ast::ForInExprAST::hasResolvedLoopVarType() constReports whether this object has resolved loop var type.
isConst
public · function · Source (opens in a new tab)
bool sun::ast::ForInExprAST::isConst() constReports whether this syntax node represents an immutable declaration.
setResolvedLoopVarType
public · function · Source (opens in a new tab)
void sun::ast::ForInExprAST::setResolvedLoopVarType(sun::types::TypePtr type) constResolved loop variable type (set by semantic analyzer).
Related: sun::types::TypePtr
toString
public · function · Source (opens in a new tab)
std::string sun::ast::ForInExprAST::toString() const overrideReturns a readable representation for diagnostics and debugging.
Protected Functions
ensureAnalysis
protected · function · Source (opens in a new tab)
void sun::ast::ForInExprAST::ensureAnalysis() const overrideOverride to allocate ForInAnalysis instead of base ExprAnalysis.
Related: ForInAnalysis, ExprAnalysis
Private Fields
Body
private · variable · Source (opens in a new tab)
std::unique_ptr<ExprAST> sun::ast::ForInExprAST::BodyNo documentation comment.
Related: ExprAST
Iterable
private · variable · Source (opens in a new tab)
std::unique_ptr<ExprAST> sun::ast::ForInExprAST::IterableNo documentation comment.
Related: ExprAST
LoopVar
private · variable · Source (opens in a new tab)
std::string sun::ast::ForInExprAST::LoopVarNo documentation comment.
LoopVarType
private · variable · Source (opens in a new tab)
TypeAnnotation sun::ast::ForInExprAST::LoopVarTypeNo documentation comment.
Related: TypeAnnotation
isConst_
private · variable · Source (opens in a new tab)
bool sun::ast::ForInExprAST::isConst_No documentation comment.