sun::ast::BinaryExprAST

sun::ast::BinaryExprAST

class · Source (opens in a new tab)

class sun::ast::BinaryExprAST : public sun::ast::CallExprAST

A binary operation that becomes an ordinary call when a class hook resolves.

Inheriting the call representation lets existing visitors handle lowered operators without introducing separate lifetime or serialization rules.

Inherits

Public Functions

BinaryExprAST

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

sun::ast::BinaryExprAST::BinaryExprAST(Token Op, std::unique_ptr< ExprAST > LHS, std::unique_ptr< ExprAST > RHS)

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

Related: Token, ExprAST

dotLabel

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

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

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

Related: ChildSlotFn

getLHS

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

const ExprAST * sun::ast::BinaryExprAST::getLHS() const

Returns the left operand.

Related: ExprAST

getOp

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

Token sun::ast::BinaryExprAST::getOp() const

Returns the operator applied by this expression.

Related: Token

getRHS

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

const ExprAST * sun::ast::BinaryExprAST::getRHS() const

Returns the right operand.

Related: ExprAST

getType

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

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

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

Related: ASTNodeType

lowerToMethod

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

void sun::ast::BinaryExprAST::lowerToMethod(const std::string &name)

Converts class arithmetic to an ordinary call so all later passes use the same ownership, lifetime, serialization, and execution rules.

toString

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

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

Returns a readable representation for diagnostics and debugging.

Private Fields

LHS

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

std::unique_ptr<ExprAST> sun::ast::BinaryExprAST::LHS

No documentation comment.

Related: ExprAST

RHS

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

std::unique_ptr<ExprAST> sun::ast::BinaryExprAST::RHS

No documentation comment.

Related: ExprAST

op

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

Token sun::ast::BinaryExprAST::op

No documentation comment.

Related: Token