sun::ast::MatchExprAST
class · Source (opens in a new tab)
class sun::ast::MatchExprAST : public sun::ast::ExprASTA match expression containing the value to inspect and its pattern arms.
Inherits
- sun::ast::ExprAST (public)
Public Functions
MatchExprAST
public · function · Source (opens in a new tab)
sun::ast::MatchExprAST::MatchExprAST(std::unique_ptr< ExprAST > discriminant, std::vector< MatchArm > arms)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::MatchExprAST::dotLabel() const overrideReturns the node label used in syntax-tree graph visualizations.
forEachChildSlot
public · function · Source (opens in a new tab)
void sun::ast::MatchExprAST::forEachChildSlot(const ChildSlotFn &fn) overrideVisits replaceable child expressions so tree passes can rewrite them in place.
Related: ChildSlotFn
getArms
public · function · Source (opens in a new tab)
const std::vector< MatchArm > & sun::ast::MatchExprAST::getArms() constReturns the pattern-match branches.
Related: MatchArm
getArmsMutable
public · function · Source (opens in a new tab)
std::vector< MatchArm > & sun::ast::MatchExprAST::getArmsMutable()Returns the modifiable pattern-match branches.
Related: MatchArm
getDiscriminant
public · function · Source (opens in a new tab)
const ExprAST * sun::ast::MatchExprAST::getDiscriminant() constReturns the enum tag.
Related: ExprAST
getType
public · function · Source (opens in a new tab)
ASTNodeType sun::ast::MatchExprAST::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::MatchExprAST::toString() const overrideReturns a readable representation for diagnostics and debugging.
Private Fields
arms
private · variable · Source (opens in a new tab)
std::vector<MatchArm> sun::ast::MatchExprAST::armsNo documentation comment.
Related: MatchArm
discriminant
private · variable · Source (opens in a new tab)
std::unique_ptr<ExprAST> sun::ast::MatchExprAST::discriminantNo documentation comment.
Related: ExprAST