(ptrn_0, ..., ptrn_n-1), [ptrn_0, ..., ptrn_n-1], or {ptrn_0, ..., ptrn_n-1} More...
#include <mim/ast/ast.h>
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 Ptrn * | ptrn (size_t i) const |
| size_t | num_ptrns () const |
| void | bind (Scopes &, bool rebind, bool quiet) const override |
| const Def * | emit_value (Emitter &, const Def *) const override |
| const Def * | emit_type (Emitter &) const override |
| const Def * | emit_decl (Emitter &, const Def *type) const |
| const Def * | emit_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 Def * | emit_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 Def * | def () const |
| virtual Dbg | dbg () const |
| The name this Decl introduces; anonymous if it has none. | |
| virtual const Scope * | scope () const |
| Non-nullptr if this Decl is a module whose members a Path may walk into. | |
| virtual std::pair< AnnexInfo *, sub_t > | annex_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< Expr > | to_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 Def * | def_ = nullptr |
(ptrn_0, ..., ptrn_n-1), [ptrn_0, ..., ptrn_n-1], or {ptrn_0, ..., ptrn_n-1}
| using mim::ast::TuplePtrn::VLA_Types = std::tuple<Ptr<Ptrn>> |
|
inline |
Definition at line 394 of file ast.h.
References delim_l(), mim::ast::Node::loc(), and mim::ast::Ptrn::Ptrn().
|
overridevirtual |
Implements mim::ast::Ptrn.
Definition at line 173 of file bind.cpp.
References mim::ast::Ptrn::bind(), ptrn(), and ptrns().
|
inline |
Definition at line 398 of file ast.h.
Referenced by delim_r(), is_brckt(), is_paren(), stream(), and TuplePtrn().
|
inline |
Definition at line 399 of file ast.h.
References delim_l(), and mim::ast::Tok::delim_l2r().
Referenced by stream().
Definition at line 109 of file emit.cpp.
References mim::Def::as_mut(), mim::ast::Decl::dbg(), mim::ast::Ptrn::emit_proj(), emit_type(), mim::Def::immutabilize(), mim::ast::Node::loc(), num_ptrns(), ptrn(), mim::Sigma::set(), and mim::Def::var().
Referenced by emit_type().
Definition at line 132 of file emit.cpp.
References mim::ast::Node::loc(), and num_ptrns().
Implements mim::ast::Ptrn.
Definition at line 107 of file emit.cpp.
References emit_body().
Referenced by emit_body(), and emit_value().
Implements mim::ast::Ptrn.
Definition at line 84 of file emit.cpp.
References mim::ast::Decl::def(), mim::ast::Decl::def_, mim::ast::Ptrn::emit_proj(), emit_type(), mim::ast::Node::loc(), num_ptrns(), and ptrn().
|
inline |
Definition at line 401 of file ast.h.
References delim_l().
Referenced by mim::ast::Ptrn::to_expr().
|
inlineoverridevirtual |
Reimplemented from mim::ast::Ptrn.
|
inline |
|
inline |
Definition at line 406 of file ast.h.
References ptrns().
Referenced by emit_body(), emit_decl(), and emit_value().
|
inline |
Definition at line 405 of file ast.h.
References mim::ast::Ptrn::Ptrn(), and ptrns().
Referenced by bind(), emit_body(), and emit_value().
|
inline |
|
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().