sun::ast::ParenExprAST

sun::ast::ParenExprAST

class · Source (opens in a new tab)

class sun::ast::ParenExprAST : public sun::ast::ExprAST

Grouping parentheses: (expr).

Preserved by the parser for a lossless parse tree; the lowering pass unwraps it before semantic analysis, so it never reaches the borrow checker or codegen.

Inherits

Public Functions

ParenExprAST

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

sun::ast::ParenExprAST::ParenExprAST(std::unique_ptr< ExprAST > inner)

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::ParenExprAST::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::ParenExprAST::forEachChildSlot(const ChildSlotFn &fn) override

Visits replaceable child expressions so tree passes can rewrite them in place.

Related: ChildSlotFn

getInner

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

const ExprAST * sun::ast::ParenExprAST::getInner() const

Returns the enclosed expression.

Related: ExprAST

getType

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

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

Returns the syntax-node kind used to dispatch tree visitors.

Related: ASTNodeType

takeInner

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

std::unique_ptr< ExprAST > sun::ast::ParenExprAST::takeInner()

Used by the lowering pass to unwrap the node.

Related: ExprAST

toString

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

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

Returns a readable representation for diagnostics and debugging.

Private Fields

inner_

private · variable · Source (opens in a new tab)

std::unique_ptr<ExprAST> sun::ast::ParenExprAST::inner_

No documentation comment.

Related: ExprAST