sun::ast::ArrayLiteralAST
class · Source (opens in a new tab)
class sun::ast::ArrayLiteralAST : public sun::ast::ExprASTArray literal: [1, 2, 3] or [[1, 2], [3, 4]] for nested arrays.
Inherits
- sun::ast::ExprAST (public)
Public Functions
ArrayLiteralAST
public · function · Source (opens in a new tab)
sun::ast::ArrayLiteralAST::ArrayLiteralAST(std::vector< std::unique_ptr< ExprAST > > elems)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::ArrayLiteralAST::dotLabel() const overrideReturns the node label used in syntax-tree graph visualizations.
forEachChildSlot
public · function · Source (opens in a new tab)
void sun::ast::ArrayLiteralAST::forEachChildSlot(const ChildSlotFn &fn) overrideVisits replaceable child expressions so tree passes can rewrite them in place.
Related: ChildSlotFn
getElements
public · function · Source (opens in a new tab)
const std::vector< std::unique_ptr< ExprAST > > & sun::ast::ArrayLiteralAST::getElements() constReturns the elements stored by this object.
Related: ExprAST
getType
public · function · Source (opens in a new tab)
ASTNodeType sun::ast::ArrayLiteralAST::getType() const overrideReturns the syntax-node kind used to dispatch tree visitors.
Related: ASTNodeType
size
public · function · Source (opens in a new tab)
size_t sun::ast::ArrayLiteralAST::size() constReturns the number of stored entries.
toString
public · function · Source (opens in a new tab)
std::string sun::ast::ArrayLiteralAST::toString() const overrideReturns a readable representation for diagnostics and debugging.
Private Fields
elements
private · variable · Source (opens in a new tab)
std::vector<std::unique_ptr<ExprAST> > sun::ast::ArrayLiteralAST::elementsNo documentation comment.
Related: ExprAST