sun::ast::SliceExprAST
class · Source (opens in a new tab)
class sun::ast::SliceExprAST : public sun::ast::ExprASTSlice expression: represents either a single index or a range slice Single index: x[5] -> start=5, end=nullptr, isRange=false Range slice: x[5:10] -> start=5, end=10, isRange=true Partial slices: x[:10], x[5:], x[:] -> isRange=true with nullptr bounds.
Inherits
- sun::ast::ExprAST (public)
Public Functions
SliceExprAST
SliceExprAST(std::unique_ptr< ExprAST > index)
public · function · Source (opens in a new tab)
sun::ast::SliceExprAST::SliceExprAST(std::unique_ptr< ExprAST > index)Constructor for single index (isRange=false).
Related: ExprAST
SliceExprAST(std::unique_ptr< ExprAST > start, std::unique_ptr< ExprAST > end, bool isRange)
public · function · Source (opens in a new tab)
sun::ast::SliceExprAST::SliceExprAST(std::unique_ptr< ExprAST > start, std::unique_ptr< ExprAST > end, bool isRange)Constructor for range slice (isRange=true).
Related: ExprAST
dotLabel
public · function · Source (opens in a new tab)
std::string sun::ast::SliceExprAST::dotLabel() const overrideReturns the node label used in syntax-tree graph visualizations.
forEachChildSlot
public · function · Source (opens in a new tab)
void sun::ast::SliceExprAST::forEachChildSlot(const ChildSlotFn &fn) overrideVisits replaceable child expressions so tree passes can rewrite them in place.
Related: ChildSlotFn
getEnd
public · function · Source (opens in a new tab)
const ExprAST * sun::ast::SliceExprAST::getEnd() constReturns the end stored by this object.
Related: ExprAST
getStart
public · function · Source (opens in a new tab)
const ExprAST * sun::ast::SliceExprAST::getStart() constReturns the start stored by this object.
Related: ExprAST
getType
public · function · Source (opens in a new tab)
ASTNodeType sun::ast::SliceExprAST::getType() const overrideReturns the syntax-node kind used to dispatch tree visitors.
Related: ASTNodeType
hasEnd
public · function · Source (opens in a new tab)
bool sun::ast::SliceExprAST::hasEnd() constReports whether this object has end.
hasStart
public · function · Source (opens in a new tab)
bool sun::ast::SliceExprAST::hasStart() constReports whether this object has start.
isRange
public · function · Source (opens in a new tab)
bool sun::ast::SliceExprAST::isRange() constReports whether this syntax node represents a slice range.
toString
public · function · Source (opens in a new tab)
std::string sun::ast::SliceExprAST::toString() const overrideReturns a readable representation for diagnostics and debugging.
Private Fields
end_
private · variable · Source (opens in a new tab)
std::unique_ptr<ExprAST> sun::ast::SliceExprAST::end_No documentation comment.
Related: ExprAST
isRange_
private · variable · Source (opens in a new tab)
bool sun::ast::SliceExprAST::isRange_No documentation comment.
start_
private · variable · Source (opens in a new tab)
std::unique_ptr<ExprAST> sun::ast::SliceExprAST::start_No documentation comment.
Related: ExprAST