sun::ast::TernaryExprAST
class · Source (opens in a new tab)
class sun::ast::TernaryExprAST : public sun::ast::ExprASTTernary conditional: cond ?
thenExpr : elseExpr. Always value-producing; branch types are unified by the semantic analyzer (exact match, integer literal coercion, or numeric widening).
Inherits
- sun::ast::ExprAST (public)
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 overrideReturns 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) overrideVisits 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() constReturns the condition expression.
Related: ExprAST
getElse
public · function · Source (opens in a new tab)
ExprAST * sun::ast::TernaryExprAST::getElse() constReturns the alternative branch.
Related: ExprAST
getThen
public · function · Source (opens in a new tab)
ExprAST * sun::ast::TernaryExprAST::getThen() constReturns 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 overrideReturns 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 overrideReturns 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::condNo documentation comment.
Related: ExprAST
elseExpr
private · variable · Source (opens in a new tab)
std::unique_ptr<ExprAST> sun::ast::TernaryExprAST::elseExprNo documentation comment.
Related: ExprAST
thenExpr
private · variable · Source (opens in a new tab)
std::unique_ptr<ExprAST> sun::ast::TernaryExprAST::thenExprNo documentation comment.
Related: ExprAST