Thorin 1.9.0
The Higher ORder INtermediate representation
Loading...
Searching...
No Matches
thorin::ast::TuplePtrn Class Reference

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

#include <thorin/ast/ast.h>

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

Public Member Functions

 TuplePtrn (Loc loc, bool rebind, Dbg dbg, Tok::Tag delim_l, Ptrs< Ptrn > &&ptrns)
 
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 thorin::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 thorin::ast::Decl
Ref def () const
 
- Public Member Functions inherited from thorin::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 thorin::ast::Ptrn
static Ptr< Exprto_expr (AST &, Ptr< Ptrn > &&)
 
static Ptr< Ptrnto_ptrn (Ptr< Expr > &&)
 
- Protected Member Functions inherited from thorin::ast::Decl
 Decl (Loc loc)
 
- Protected Member Functions inherited from thorin::ast::Node
 Node (Loc loc)
 
virtual ~Node ()
 
- Protected Attributes inherited from thorin::ast::Decl
Ref def_ = nullptr
 

Detailed Description

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

Definition at line 239 of file ast.h.

Constructor & Destructor Documentation

◆ TuplePtrn()

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

Definition at line 241 of file ast.h.

Member Function Documentation

◆ bind()

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

◆ delim_l()

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

Definition at line 246 of file ast.h.

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

◆ delim_r()

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

Definition at line 247 of file ast.h.

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

Referenced by stream().

◆ emit_body()

◆ emit_decl()

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

Definition at line 100 of file emit.cpp.

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

◆ emit_type()

Ref thorin::ast::TuplePtrn::emit_type ( Emitter e) const
overridevirtual

Implements thorin::ast::Ptrn.

Definition at line 75 of file emit.cpp.

References emit_body().

◆ emit_value_()

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

◆ is_brckt()

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

Definition at line 249 of file ast.h.

References delim_l().

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

◆ is_paren()

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

Definition at line 248 of file ast.h.

References delim_l().

◆ num_ptrns()

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

Definition at line 253 of file ast.h.

References ptrns().

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

◆ ptrn()

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

Definition at line 252 of file ast.h.

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

◆ ptrns()

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

Definition at line 251 of file ast.h.

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

◆ stream()

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

Implements thorin::ast::Node.

Definition at line 64 of file stream.cpp.

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


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