Base class of all patterns. More...
#include <mim/ast/ast.h>
Public Member Functions | |
| Ptrn (Loc loc) | |
| virtual bool | is_implicit () const |
| virtual void | bind (Scopes &, bool rebind, bool quiet) const =0 |
| virtual const Def * | emit_value (Emitter &, const Def *) const =0 |
| virtual const Def * | emit_type (Emitter &) const =0 |
| 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 |
| virtual void | stream (fe::Tab &, std::ostream &) const =0 |
| void | dump () const |
Static Public Member Functions | |
| static Ptr< Expr > | to_expr (AST &, Ptr< Ptrn >) |
Additional Inherited Members | |
| 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 |
|
inline |
Definition at line 282 of file ast.h.
References mim::ast::Decl::Decl(), and mim::ast::Node::loc().
Referenced by mim::ast::AliasPtrn::AliasPtrn(), mim::ast::ErrorPtrn::ErrorPtrn(), mim::ast::GrpPtrn::GrpPtrn(), mim::ast::IdPtrn::IdPtrn(), mim::ast::AliasPtrn::ptrn(), mim::ast::TuplePtrn::ptrn(), and mim::ast::TuplePtrn::TuplePtrn().
|
pure virtual |
Implemented in mim::ast::AliasPtrn, mim::ast::ErrorPtrn, mim::ast::GrpPtrn, mim::ast::IdPtrn, and mim::ast::TuplePtrn.
Referenced by mim::ast::AliasPtrn::bind(), mim::ast::MatchExpr::Arm::bind(), and mim::ast::TuplePtrn::bind().
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.
Definition at line 79 of file emit.cpp.
References mim::ast::Decl::def(), emit_value(), mim::ast::Node::loc(), and mim::Def::proj().
Referenced by mim::ast::TuplePtrn::emit_body(), emit_type(), and mim::ast::TuplePtrn::emit_value().
Implemented in mim::ast::AliasPtrn, mim::ast::ErrorPtrn, mim::ast::GrpPtrn, mim::ast::IdPtrn, and mim::ast::TuplePtrn.
References mim::ast::Decl::def(), emit_proj(), and to_expr().
Referenced by mim::ast::MatchExpr::Arm::emit(), and mim::ast::AliasPtrn::emit_type().
Implemented in mim::ast::AliasPtrn, mim::ast::ErrorPtrn, mim::ast::GrpPtrn, mim::ast::IdPtrn, and mim::ast::TuplePtrn.
Referenced by mim::ast::MatchExpr::Arm::emit(), emit_proj(), and mim::ast::AliasPtrn::emit_value().
|
inlinevirtual |
Reimplemented in mim::ast::AliasPtrn, and mim::ast::TuplePtrn.
Definition at line 285 of file ast.h.
Referenced by mim::ast::AliasPtrn::is_implicit(), and mim::ast::LamDecl::Dom::is_implicit().
Definition at line 191 of file ast.cpp.
References mim::ast::IdPtrn::dbg(), mim::ast::TuplePtrn::is_brckt(), and mim::ast::Node::loc().
Referenced by emit_type().