Base class of all declarations; caches the emitted Decl::def. More...
#include <mim/ast/ast.h>
Public Member Functions | |
| 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 |
Protected Member Functions | |
| Decl (Loc loc) | |
| Protected Member Functions inherited from mim::ast::Node | |
| Node (Loc loc) | |
Protected Attributes | |
| const Def * | def_ = nullptr |
|
inlineprotected |
Definition at line 232 of file ast.h.
References mim::ast::Node::loc(), and mim::ast::Node::Node().
Referenced by mim::ast::DummyDecl::DummyDecl(), and mim::ast::Ptrn::Ptrn().
The (AnnexInfo, sub) slot this decl registered itself under as an annex; {nullptr, 0} if it isn't one.
Reimplemented in mim::ast::AliasDecl, mim::ast::AxmDecl, mim::ast::AxmDecl::Sibling, mim::ast::IdPtrn, mim::ast::LamDecl, and mim::ast::RecDecl.
|
inlinevirtual |
The name this Decl introduces; anonymous if it has none.
Reimplemented in mim::ast::AliasDecl, mim::ast::AliasPtrn, mim::ast::AxmDecl, mim::ast::AxmDecl::Sibling, mim::ast::GrpPtrn, mim::ast::IdPtrn, mim::ast::ModDecl, mim::ast::RecDecl, mim::ast::RuleDecl, and mim::ast::UseDecl.
Definition at line 239 of file ast.h.
References mim::ast::Node::loc().
Referenced by mim::ast::TuplePtrn::emit_body().
|
inline |
Definition at line 236 of file ast.h.
References def_.
Referenced by mim::ast::Ptrn::emit_proj(), mim::ast::Ptrn::emit_type(), mim::ast::AliasPtrn::emit_value(), mim::ast::ErrorPtrn::emit_value(), mim::ast::GrpPtrn::emit_value(), mim::ast::IdPtrn::emit_value(), and mim::ast::TuplePtrn::emit_value().
|
inlinevirtual |
Whether this decl is registered as a compiler-exposed annex (anx).
Reimplemented in mim::ast::IdPtrn, and mim::ast::ValDecl.
|
inlinevirtual |
Whether this decl crosses the Mim/native boundary (extern); body presence picks which side supplies it.
Reimplemented in mim::ast::ValDecl.
|
inlinevirtual |
Non-nullptr if this Decl is a module whose members a Path may walk into.
Reimplemented in mim::ast::ModDecl, and mim::ast::UseDecl.
Definition at line 241 of file ast.h.
Referenced by mim::ast::Scopes::bind().
|
inlinevirtual |
A ValDecl's own Vis; Pub for anything else (Ptrn, Import, ...), which the priv/pub system ignores.
Reimplemented in mim::ast::IdPtrn, and mim::ast::ValDecl.
Definition at line 245 of file ast.h.
References mim::ast::Pub.
Referenced by mim::ast::Scopes::bind().
|
mutableprotected |
Definition at line 252 of file ast.h.
Referenced by def(), mim::ast::AliasDecl::emit(), mim::ast::AxmDecl::emit(), mim::ast::AxmDecl::Sibling::emit(), mim::ast::LetDecl::emit(), mim::ast::RuleDecl::emit(), mim::ast::LamDecl::emit_body(), mim::ast::RecDecl::emit_body(), mim::ast::LamDecl::emit_decl(), mim::ast::RecDecl::emit_decl(), mim::ast::AliasPtrn::emit_value(), mim::ast::GrpPtrn::emit_value(), mim::ast::IdPtrn::emit_value(), and mim::ast::TuplePtrn::emit_value().