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

dbg::(ptrn_0, ..., ptrn_n-1) or dbg::[ptrn_0, ..., ptrn_n-1] More...

#include <mim/ast/ast.h>

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

Public Member Functions

 TuplePtrn (Loc loc, Tok::Tag delim_l, Ptrs< Ptrn > &&ptrns, bool rebind, Dbg dbg)
 
Tok::Tag delim_l () const
 
Tok::Tag delim_r () const
 
bool is_paren () const
 
bool is_brckt () const
 
const auto & ptrns () const
 
const Ptrnptrn (size_t i) const
 
size_t num_ptrns () const
 
void bind (Scopes &, bool quiet=false) const override
 
Ref emit_type (Emitter &) const override
 
Ref emit_decl (Emitter &, Ref type) const
 
Ref emit_body (Emitter &, Ref decl) const
 
std::ostream & stream (Tab &, std::ostream &) const override
 
- Public Member Functions inherited from mim::ast::Ptrn
 Ptrn (Loc loc, bool rebind, Dbg dbg)
 
bool rebind () const
 
Dbg dbg () const
 
Ref emit_value (Emitter &, Ref) const
 
- Public Member Functions inherited from mim::ast::Decl
Ref def () const
 
- Public Member Functions inherited from mim::ast::Node
Loc loc () const
 
void dump () const
 

Private Member Functions

void emit_value_ (Emitter &, Ref) const override
 

Additional Inherited Members

- Static Public Member Functions inherited from mim::ast::Ptrn
static Ptr< Exprto_expr (AST &, Ptr< Ptrn > &&)
 
static Ptr< Ptrnto_ptrn (Ptr< Expr > &&)
 
- Protected Member Functions inherited from mim::ast::Decl
 Decl (Loc loc)
 
- Protected Member Functions inherited from mim::ast::Node
 Node (Loc loc)
 
virtual ~Node ()
 
- Protected Attributes inherited from mim::ast::Decl
Ref def_ = nullptr
 

Detailed Description

dbg::(ptrn_0, ..., ptrn_n-1) or dbg::[ptrn_0, ..., ptrn_n-1]

Definition at line 249 of file ast.h.

Constructor & Destructor Documentation

◆ TuplePtrn()

mim::ast::TuplePtrn::TuplePtrn ( Loc loc,
Tok::Tag delim_l,
Ptrs< Ptrn > && ptrns,
bool rebind,
Dbg dbg )
inline

Definition at line 251 of file ast.h.

Member Function Documentation

◆ bind()

void mim::ast::TuplePtrn::bind ( Scopes & s,
bool quiet = false ) const
overridevirtual

◆ delim_l()

Tok::Tag mim::ast::TuplePtrn::delim_l ( ) const
inline

Definition at line 256 of file ast.h.

Referenced by delim_r(), is_brckt(), is_paren(), and stream().

◆ delim_r()

Tok::Tag mim::ast::TuplePtrn::delim_r ( ) const
inline

Definition at line 257 of file ast.h.

References delim_l(), and mim::ast::Tok::delim_l2r().

Referenced by stream().

◆ emit_body()

◆ emit_decl()

Ref mim::ast::TuplePtrn::emit_decl ( Emitter & e,
Ref type ) const

Definition at line 102 of file emit.cpp.

References mim::ast::Ptrn::dbg(), mim::ast::Node::loc(), and num_ptrns().

◆ emit_type()

Ref mim::ast::TuplePtrn::emit_type ( Emitter & e) const
overridevirtual

Implements mim::ast::Ptrn.

Definition at line 77 of file emit.cpp.

References emit_body().

Referenced by emit_body().

◆ emit_value_()

void mim::ast::TuplePtrn::emit_value_ ( Emitter & e,
Ref def ) const
overrideprivatevirtual

Reimplemented from mim::ast::Ptrn.

Definition at line 60 of file emit.cpp.

References mim::ast::Decl::def(), mim::ast::Ptrn::emit_value(), num_ptrns(), mim::Def::proj(), and ptrn().

◆ is_brckt()

bool mim::ast::TuplePtrn::is_brckt ( ) const
inline

Definition at line 259 of file ast.h.

References delim_l().

Referenced by mim::ast::Ptrn::to_expr().

◆ is_paren()

bool mim::ast::TuplePtrn::is_paren ( ) const
inline

Definition at line 258 of file ast.h.

References delim_l().

◆ num_ptrns()

size_t mim::ast::TuplePtrn::num_ptrns ( ) const
inline

Definition at line 263 of file ast.h.

References ptrns().

Referenced by emit_body(), emit_decl(), and emit_value_().

◆ ptrn()

const Ptrn * mim::ast::TuplePtrn::ptrn ( size_t i) const
inline

Definition at line 262 of file ast.h.

Referenced by bind(), emit_body(), and emit_value_().

◆ ptrns()

const auto & mim::ast::TuplePtrn::ptrns ( ) const
inline

Definition at line 261 of file ast.h.

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

◆ stream()

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

Implements mim::ast::Node.

Definition at line 66 of file stream.cpp.

References mim::ast::Ptrn::dbg(), delim_l(), delim_r(), mim::print(), and ptrns().


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