match scrutinee with | arm_0 | ... | arm_n-1 More...
#include <mim/ast/ast.h>
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) | |
| using mim::ast::MatchExpr::VLA_Types = std::tuple<Ptr<Arm>> |
Definition at line 722 of file ast.h.
References mim::ast::Expr::Expr(), mim::ast::Node::loc(), and scrutinee().
|
inline |
|
inline |
|
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().
Implements mim::ast::Expr.
Definition at line 698 of file emit.cpp.
References mim::Match::accepts(), arm(), arms(), mim::Match::cases(), mim::ast::MatchExpr::Arm::ctor(), mim::Pi::dom(), mim::ast::Expr::emit(), mim::ast::MatchExpr::Arm::emit(), mim::ast::MatchExpr::Arm::index(), mim::Def::isa_type(), mim::ast::Node::loc(), num_arms(), mim::Def::op(), mim::ast::open_nom(), scrutinee(), and mim::type_of().
|
inline |
|
inline |
Definition at line 726 of file ast.h.
References mim::ast::Expr::Expr().
Referenced by bind(), emit_(), MatchExpr(), and stream().
|
overridevirtual |
Implements mim::ast::Node.
Definition at line 193 of file stream.cpp.
References arm(), arms(), mim::ast::S::S(), and scrutinee().