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

#include <mim/ast/ast.h>

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

Classes

class  Arm
 

Public Member Functions

 MatchExpr (Loc loc, Ptr< Expr > &&scrutinee, Ptrs< Arm > &&arms)
 
const Exprscrutinee () const
 
const auto & arms () const
 
const Armarm (size_t i) const
 
size_t num_arms () const
 
void bind (Scopes &) const override
 
std::ostream & stream (Tab &, std::ostream &) const override
 
- Public Member Functions inherited from mim::ast::Expr
const Defemit (Emitter &) const
 
virtual const Defemit_decl (Emitter &, const Def *) const
 
virtual void emit_body (Emitter &, const Def *) 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

enum class  Prec {
  Err ,
  Bot ,
  Where ,
  Arrow ,
  Pi ,
  Inj ,
  App ,
  Union ,
  Extract ,
  Lit
}
 
static constexpr bool is_rassoc (Prec p)
 
- Protected Member Functions inherited from mim::ast::Expr
 Expr (Loc loc)
 
- Protected Member Functions inherited from mim::ast::Node
 Node (Loc loc)
 
virtual ~Node ()
 

Detailed Description

Definition at line 496 of file ast.h.

Constructor & Destructor Documentation

◆ MatchExpr()

mim::ast::MatchExpr::MatchExpr ( Loc loc,
Ptr< Expr > && scrutinee,
Ptrs< Arm > && arms )
inline

Definition at line 517 of file ast.h.

References arms(), 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 524 of file ast.h.

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

◆ arms()

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

Definition at line 523 of file ast.h.

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

◆ bind()

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

Implements mim::ast::Expr.

Definition at line 162 of file bind.cpp.

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

◆ emit_()

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

Implements mim::ast::Expr.

Definition at line 231 of file emit.cpp.

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

◆ num_arms()

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

Definition at line 525 of file ast.h.

◆ scrutinee()

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

Definition at line 522 of file ast.h.

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

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

◆ stream()

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

Implements mim::ast::Node.

Definition at line 122 of file stream.cpp.

References arm(), arms(), mim::Tab::println(), and scrutinee().


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