sun::ast::ArrayLiteralAST

sun::ast::ArrayLiteralAST

class · Source (opens in a new tab)

class sun::ast::ArrayLiteralAST : public sun::ast::ExprAST

Array literal: [1, 2, 3] or [[1, 2], [3, 4]] for nested arrays.

Inherits

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 override

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

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

Returns the elements stored by this object.

Related: ExprAST

getType

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

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

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

Returns the number of stored entries.

toString

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

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

Returns 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::elements

No documentation comment.

Related: ExprAST