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

(ptrn_0, ..., ptrn_n-1), [ptrn_0, ..., ptrn_n-1], or {ptrn_0, ..., ptrn_n-1} More...

#include <mim/ast/ast.h>

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

Public Types

using VLA_Types = std::tuple<Ptr<Ptrn>>

Public Member Functions

 TuplePtrn (Loc loc, Tok::Tag delim_l)
Tok::Tag delim_l () const
Tok::Tag delim_r () const
bool is_paren () const
bool is_brckt () const
bool is_implicit () const override
auto ptrns () const
const Ptrnptrn (size_t i) const
size_t num_ptrns () const
void bind (Scopes &, bool rebind, bool quiet) const override
const Defemit_value (Emitter &, const Def *) const override
const Defemit_type (Emitter &) const override
const Defemit_decl (Emitter &, const Def *type) const
const Defemit_body (Emitter &, const Def *decl) const
void stream (fe::Tab &, std::ostream &) const override
Public Member Functions inherited from mim::ast::Ptrn
 Ptrn (Loc loc)
const Defemit_proj (Emitter &, const Def *def, size_t n, size_t i) const
 Ptrn::emit_value on def's i-th of n projections - with this Ptrn's Loc, so the projection is blamed on the binder it introduces instead of on the enclosing pattern.
Public Member Functions inherited from mim::ast::Decl
const Defdef () const
virtual Dbg dbg () const
 The name this Decl introduces; anonymous if it has none.
virtual const Scopescope () const
 Non-nullptr if this Decl is a module whose members a Path may walk into.
virtual std::pair< AnnexInfo *, sub_tannex_sub () const
 The (AnnexInfo, sub) slot this decl registered itself under as an annex; {nullptr, 0} if it isn't one.
virtual Vis vis () const
 A ValDecl's own Vis; Pub for anything else (Ptrn, Import, ...), which the priv/pub system ignores.
virtual bool is_extern () const
 Whether this decl crosses the Mim/native boundary (extern); body presence picks which side supplies it.
virtual bool is_anx () const
 Whether this decl is registered as a compiler-exposed annex (anx).
Public Member Functions inherited from mim::ast::Node
Loc loc () const
void dump () const

Additional Inherited Members

Static Public Member Functions inherited from mim::ast::Ptrn
static Ptr< Exprto_expr (AST &, Ptr< Ptrn >)
Protected Member Functions inherited from mim::ast::Decl
 Decl (Loc loc)
Protected Member Functions inherited from mim::ast::Node
 Node (Loc loc)
Protected Attributes inherited from mim::ast::Decl
const Defdef_ = nullptr

Detailed Description

(ptrn_0, ..., ptrn_n-1), [ptrn_0, ..., ptrn_n-1], or {ptrn_0, ..., ptrn_n-1}

Definition at line 390 of file ast.h.

Member Typedef Documentation

◆ VLA_Types

using mim::ast::TuplePtrn::VLA_Types = std::tuple<Ptr<Ptrn>>

Definition at line 392 of file ast.h.

Constructor & Destructor Documentation

◆ TuplePtrn()

mim::ast::TuplePtrn::TuplePtrn ( Loc loc,
Tok::Tag delim_l )
inline

Definition at line 394 of file ast.h.

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

Member Function Documentation

◆ bind()

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

Implements mim::ast::Ptrn.

Definition at line 173 of file bind.cpp.

References mim::ast::Ptrn::bind(), ptrn(), and ptrns().

◆ delim_l()

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

Definition at line 398 of file ast.h.

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

◆ delim_r()

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

Definition at line 399 of file ast.h.

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

Referenced by stream().

◆ emit_body()

const Def * mim::ast::TuplePtrn::emit_body ( Emitter & e,
const Def * decl ) const

◆ emit_decl()

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

Definition at line 132 of file emit.cpp.

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

◆ emit_type()

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

Implements mim::ast::Ptrn.

Definition at line 107 of file emit.cpp.

References emit_body().

Referenced by emit_body(), and emit_value().

◆ emit_value()

const Def * mim::ast::TuplePtrn::emit_value ( Emitter & e,
const Def * def ) const
overridevirtual

◆ is_brckt()

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

Definition at line 401 of file ast.h.

References delim_l().

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

◆ is_implicit()

bool mim::ast::TuplePtrn::is_implicit ( ) const
inlineoverridevirtual

Reimplemented from mim::ast::Ptrn.

Definition at line 402 of file ast.h.

◆ is_paren()

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

Definition at line 400 of file ast.h.

References delim_l().

◆ num_ptrns()

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

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

References mim::ast::Ptrn::Ptrn(), and ptrns().

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

◆ ptrns()

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

Definition at line 404 of file ast.h.

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

◆ stream()

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

Implements mim::ast::Node.

Definition at line 95 of file stream.cpp.

References delim_l(), delim_r(), ptrns(), and mim::ast::R< T >::R().


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