sun::ast::MatchExprAST

sun::ast::MatchExprAST

class · Source (opens in a new tab)

class sun::ast::MatchExprAST : public sun::ast::ExprAST

A match expression containing the value to inspect and its pattern arms.

Inherits

Public Functions

MatchExprAST

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

sun::ast::MatchExprAST::MatchExprAST(std::unique_ptr< ExprAST > discriminant, std::vector< MatchArm > arms, bool propagation=false)

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

Related: ExprAST, MatchArm

dotLabel

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

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

Visits 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() const

Returns 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() const

Returns the enum tag.

Related: ExprAST

getType

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

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

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

Related: ASTNodeType

isPropagation

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

bool sun::ast::MatchExprAST::isPropagation() const

Reports whether this match implements prefix error propagation.

toString

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

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

Returns a readable representation for diagnostics and debugging.

Private Fields

arms

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

std::vector<MatchArm> sun::ast::MatchExprAST::arms

No documentation comment.

Related: MatchArm

discriminant

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

std::unique_ptr<ExprAST> sun::ast::MatchExprAST::discriminant

No documentation comment.

Related: ExprAST

propagation_

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

bool sun::ast::MatchExprAST::propagation_ = false

No documentation comment.