MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
mim::ast::MatchExpr Class Reference

match scrutinee with | arm_0 | ... | arm_n-1 More...

#include <mim/ast/ast.h>

Inheritance diagram for mim::ast::MatchExpr:
[legend]

Classes

class  Arm
 ptrn => body of a MatchExpr. More...

Public Types

using VLA_Types = std::tuple<Ptr<Arm>>

Public Member Functions

 MatchExpr (Loc loc, Ptr< Expr > scrutinee)
const Exprscrutinee () const
auto arms () const
const Armarm (size_t i) const
size_t num_arms () const
void bind (Scopes &) const override
void stream (fe::Tab &, std::ostream &) const override
Public Member Functions inherited from mim::ast::Expr
const Defemit (Emitter &) const
const Defemit_decl (Emitter &, const Def *type) const
void emit_body (Emitter &, const Def *decl) const
Public Member Functions inherited from mim::ast::Node
Loc loc () const
void dump () const

Private Member Functions

const Defemit_ (Emitter &) const override

Additional Inherited Members

Protected Member Functions inherited from mim::ast::Expr
 Expr (Loc loc)
Protected Member Functions inherited from mim::ast::Node
 Node (Loc loc)

Detailed Description

match scrutinee with | arm_0 | ... | arm_n-1

Definition at line 634 of file ast.h.

Member Typedef Documentation

◆ VLA_Types

using mim::ast::MatchExpr::VLA_Types = std::tuple<Ptr<Arm>>

Definition at line 656 of file ast.h.

Constructor & Destructor Documentation

◆ MatchExpr()

mim::ast::MatchExpr::MatchExpr ( Loc loc,
Ptr< Expr > scrutinee )
inline

Definition at line 658 of file ast.h.

References mim::ast::Expr::Expr(), mim::ast::Node::loc(), and scrutinee().

Member Function Documentation

◆ arm()

const Arm * mim::ast::MatchExpr::arm ( size_t i) const
inline

Definition at line 664 of file ast.h.

References arms().

Referenced by bind(), emit_(), and stream().

◆ arms()

auto mim::ast::MatchExpr::arms ( ) const
inline

Definition at line 663 of file ast.h.

Referenced by arm(), bind(), emit_(), num_arms(), and stream().

◆ bind()

void mim::ast::MatchExpr::bind ( Scopes & s) const
overridevirtual

Implements mim::ast::Expr.

Definition at line 261 of file bind.cpp.

References arm(), arms(), mim::ast::Expr::bind(), mim::ast::MatchExpr::Arm::bind(), and scrutinee().

◆ emit_()

const Def * mim::ast::MatchExpr::emit_ ( Emitter & e) const
overrideprivatevirtual

Implements mim::ast::Expr.

Definition at line 362 of file emit.cpp.

References arm(), arms(), mim::ast::Expr::emit(), mim::ast::MatchExpr::Arm::emit(), and scrutinee().

◆ num_arms()

size_t mim::ast::MatchExpr::num_arms ( ) const
inline

Definition at line 665 of file ast.h.

References arms().

◆ scrutinee()

const Expr * mim::ast::MatchExpr::scrutinee ( ) const
inline

Definition at line 662 of file ast.h.

References mim::ast::Expr::Expr().

Referenced by bind(), emit_(), MatchExpr(), and stream().

◆ stream()

void mim::ast::MatchExpr::stream ( fe::Tab & tab,
std::ostream & os ) const
overridevirtual

Implements mim::ast::Node.

Definition at line 150 of file stream.cpp.

References arm(), arms(), mim::ast::S::S(), and scrutinee().


The documentation for this class was generated from the following files: