sun::ast::TernaryExprAST

sun::ast::TernaryExprAST

class · Source (opens in a new tab)

class sun::ast::TernaryExprAST : public sun::ast::ExprAST

Ternary conditional: cond ?

thenExpr : elseExpr. Always value-producing; branch types are unified by the semantic analyzer (exact match, integer literal coercion, or numeric widening).

Inherits

Public Functions

TernaryExprAST

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

sun::ast::TernaryExprAST::TernaryExprAST(std::unique_ptr< ExprAST > cond, std::unique_ptr< ExprAST > thenExpr, std::unique_ptr< ExprAST > elseExpr, sun::support::Position loc)

Creates this syntax node and takes ownership of any supplied child expressions.

Related: ExprAST, sun::support::Position

dotLabel

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

std::string sun::ast::TernaryExprAST::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::TernaryExprAST::forEachChildSlot(const ChildSlotFn &fn) override

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

Related: ChildSlotFn

getCond

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

ExprAST * sun::ast::TernaryExprAST::getCond() const

Returns the condition expression.

Related: ExprAST

getElse

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

ExprAST * sun::ast::TernaryExprAST::getElse() const

Returns the alternative branch.

Related: ExprAST

getThen

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

ExprAST * sun::ast::TernaryExprAST::getThen() const

Returns the branch taken when the condition is true.

Related: ExprAST

getType

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

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

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

Related: ASTNodeType

toString

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

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

Returns a readable representation for diagnostics and debugging.

Private Fields

cond

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

std::unique_ptr<ExprAST> sun::ast::TernaryExprAST::cond

No documentation comment.

Related: ExprAST

elseExpr

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

std::unique_ptr<ExprAST> sun::ast::TernaryExprAST::elseExpr

No documentation comment.

Related: ExprAST

thenExpr

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

std::unique_ptr<ExprAST> sun::ast::TernaryExprAST::thenExpr

No documentation comment.

Related: ExprAST