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, ctor ptrn => body, or index [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 Expr * scrutinee () const
auto arms () const
const Arm * arm (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 Def * emit (Emitter &) const
const Def * emit_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 Def * emit_ (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 689 of file ast.h.

Member Typedef Documentation

◆ VLA_Types

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

Definition at line 720 of file ast.h.

Constructor & Destructor Documentation

◆ MatchExpr()

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

Definition at line 722 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 728 of file ast.h.

References arms().

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

◆ arms()

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

Definition at line 727 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 281 of file bind.cpp.

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

◆ emit_()

◆ num_arms()

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

Definition at line 729 of file ast.h.

References arms().

Referenced by emit_().

◆ scrutinee()

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

Definition at line 726 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 193 of file stream.cpp.

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


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