sun::ast::SliceExprAST

sun::ast::SliceExprAST

class · Source (opens in a new tab)

class sun::ast::SliceExprAST : public sun::ast::ExprAST

Slice 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

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 override

Returns 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) override

Visits 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() const

Returns the end stored by this object.

Related: ExprAST

getStart

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

const ExprAST * sun::ast::SliceExprAST::getStart() const

Returns the start stored by this object.

Related: ExprAST

getType

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

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

Returns 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() const

Reports whether this object has end.

hasStart

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

bool sun::ast::SliceExprAST::hasStart() const

Reports whether this object has start.

isRange

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

bool sun::ast::SliceExprAST::isRange() const

Reports whether this syntax node represents a slice range.

toString

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

std::string sun::ast::SliceExprAST::toString() const override

Returns 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