sun::ast::ArrayIndexAST
class · Source (opens in a new tab)
class sun::ast::ArrayIndexAST : public sun::ast::ExprASTArray indexing: x[i] or x[i, j, k] for n-dimensional arrays (legacy) Uses comma-separated indices: x[0, 1] instead of x[0][1].
Inherits
- sun::ast::ExprAST (public)
Public Functions
ArrayIndexAST
public · function · Source (opens in a new tab)
sun::ast::ArrayIndexAST::ArrayIndexAST(std::unique_ptr< ExprAST > arr, std::vector< std::unique_ptr< ExprAST > > idxs)Creates this syntax node and takes ownership of any supplied child expressions.
Related: ExprAST
dotLabel
public · function · Source (opens in a new tab)
std::string sun::ast::ArrayIndexAST::dotLabel() const overrideReturns the node label used in syntax-tree graph visualizations.
getArray
public · function · Source (opens in a new tab)
const ExprAST * sun::ast::ArrayIndexAST::getArray() constReturns the array expression.
Related: ExprAST
getIndices
public · function · Source (opens in a new tab)
const std::vector< std::unique_ptr< ExprAST > > & sun::ast::ArrayIndexAST::getIndices() constProvides the index expressions used to select array elements.
Related: ExprAST
getType
public · function · Source (opens in a new tab)
ASTNodeType sun::ast::ArrayIndexAST::getType() const overrideReturns the syntax-node kind used to dispatch tree visitors.
Related: ASTNodeType
numIndices
public · function · Source (opens in a new tab)
size_t sun::ast::ArrayIndexAST::numIndices() constReturns the number of index expressions in this access.
toString
public · function · Source (opens in a new tab)
std::string sun::ast::ArrayIndexAST::toString() const overrideReturns a readable representation for diagnostics and debugging.
Private Fields
array
private · variable · Source (opens in a new tab)
std::unique_ptr<ExprAST> sun::ast::ArrayIndexAST::arrayNo documentation comment.
Related: ExprAST
indices
private · variable · Source (opens in a new tab)
std::vector<std::unique_ptr<ExprAST> > sun::ast::ArrayIndexAST::indicesNo documentation comment.
Related: ExprAST