sun::ast::BinaryExprAST
class · Source (opens in a new tab)
class sun::ast::BinaryExprAST : public sun::ast::CallExprASTA 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
- sun::ast::CallExprAST (public)
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.
dotLabel
public · function · Source (opens in a new tab)
std::string sun::ast::BinaryExprAST::dotLabel() const overrideReturns 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) overrideVisits 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() constReturns the left operand.
Related: ExprAST
getOp
public · function · Source (opens in a new tab)
Token sun::ast::BinaryExprAST::getOp() constReturns the operator applied by this expression.
Related: Token
getRHS
public · function · Source (opens in a new tab)
const ExprAST * sun::ast::BinaryExprAST::getRHS() constReturns the right operand.
Related: ExprAST
getType
public · function · Source (opens in a new tab)
ASTNodeType sun::ast::BinaryExprAST::getType() const overrideReturns 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 overrideReturns 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::LHSNo documentation comment.
Related: ExprAST
RHS
private · variable · Source (opens in a new tab)
std::unique_ptr<ExprAST> sun::ast::BinaryExprAST::RHSNo documentation comment.
Related: ExprAST
op
private · variable · Source (opens in a new tab)
Token sun::ast::BinaryExprAST::opNo documentation comment.
Related: Token