sun::ast::CompoundAssignmentAST
class · Source (opens in a new tab)
class sun::ast::CompoundAssignmentAST : public sun::ast::ExprASTCompound assignment: target op= value (e.g.
x += 1, obj.f *= 2, arr[i] |= mask). Kept as a single node through analysis and lowered in codegen as address-once -> load -> op -> store, so the target is evaluated exactly once. op is the compound token itself (e.g. '+=').
Inherits
- sun::ast::ExprAST (public)
Public Functions
- CompoundAssignmentAST
- binaryOpKind
- dotLabel
- forEachChildSlot
- getOp
- getTarget
- getType
- getValue
- toString
CompoundAssignmentAST
public · function · Source (opens in a new tab)
sun::ast::CompoundAssignmentAST::CompoundAssignmentAST(std::unique_ptr< ExprAST > target, Token op, std::unique_ptr< ExprAST > value)Creates this syntax node and takes ownership of any supplied child expressions.
binaryOpKind
public · function · Source (opens in a new tab)
sun::parsing::TokenKind sun::ast::CompoundAssignmentAST::binaryOpKind() constThe underlying binary operator (e.g.
PLUS for PLUS_ASSIGN)
Related: sun::parsing::TokenKind
dotLabel
public · function · Source (opens in a new tab)
std::string sun::ast::CompoundAssignmentAST::dotLabel() const overrideReturns the node label used in syntax-tree graph visualizations.
forEachChildSlot
public · function · Source (opens in a new tab)
void sun::ast::CompoundAssignmentAST::forEachChildSlot(const ChildSlotFn &fn) overrideVisits replaceable child expressions so tree passes can rewrite them in place.
Related: ChildSlotFn
getOp
public · function · Source (opens in a new tab)
const Token & sun::ast::CompoundAssignmentAST::getOp() constReturns the operator applied by this expression.
Related: Token
getTarget
public · function · Source (opens in a new tab)
const ExprAST * sun::ast::CompoundAssignmentAST::getTarget() constReturns the target stored by this object.
Related: ExprAST
getType
public · function · Source (opens in a new tab)
ASTNodeType sun::ast::CompoundAssignmentAST::getType() const overrideReturns the syntax-node kind used to dispatch tree visitors.
Related: ASTNodeType
getValue
public · function · Source (opens in a new tab)
const ExprAST * sun::ast::CompoundAssignmentAST::getValue() constReturns the value represented by this object.
Related: ExprAST
toString
public · function · Source (opens in a new tab)
std::string sun::ast::CompoundAssignmentAST::toString() const overrideReturns a readable representation for diagnostics and debugging.
Private Fields
op
private · variable · Source (opens in a new tab)
Token sun::ast::CompoundAssignmentAST::opNo documentation comment.
Related: Token
target
private · variable · Source (opens in a new tab)
std::unique_ptr<ExprAST> sun::ast::CompoundAssignmentAST::targetNo documentation comment.
Related: ExprAST
value
private · variable · Source (opens in a new tab)
std::unique_ptr<ExprAST> sun::ast::CompoundAssignmentAST::valueNo documentation comment.
Related: ExprAST