sun::ast::TryCatchExprAST

sun::ast::TryCatchExprAST

class · Source (opens in a new tab)

class sun::ast::TryCatchExprAST : public sun::ast::ExprAST

Try-catch expression: try { ... } catch (e: ref A) { ... } catch (e: ref IError) { ... } Supports multiple typed catch handlers, tested in source order.

Inherits

Public Functions

TryCatchExprAST

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

sun::ast::TryCatchExprAST::TryCatchExprAST(std::unique_ptr< BlockExprAST > tryBlk, std::vector< CatchClause > catchCls)

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

Related: BlockExprAST, CatchClause

dotLabel

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

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

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

Related: ChildSlotFn

getCatchClauses

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

const std::vector< CatchClause > & sun::ast::TryCatchExprAST::getCatchClauses() const

Returns the catch clauses stored by this object.

Related: CatchClause

getCatchClausesMutable

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

std::vector< CatchClause > & sun::ast::TryCatchExprAST::getCatchClausesMutable()

Returns the catch clauses mutable stored by this object.

Related: CatchClause

getTryBlock

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

const BlockExprAST & sun::ast::TryCatchExprAST::getTryBlock() const

Returns the try block stored by this object.

Related: BlockExprAST

getType

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

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

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

Related: ASTNodeType

toString

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

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

Returns a readable representation for diagnostics and debugging.

Private Fields

catchClauses

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

std::vector<CatchClause> sun::ast::TryCatchExprAST::catchClauses

No documentation comment.

Related: CatchClause

tryBlock

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

std::unique_ptr<BlockExprAST> sun::ast::TryCatchExprAST::tryBlock

No documentation comment.

Related: BlockExprAST