#include <mim/ast/ast.h>
Public Member Functions | |
| RecDecl (Loc loc, Mods mods, Dbg dbg, Ptr< Expr > body) | |
| Dbg | dbg () const override |
| The name this Decl introduces; anonymous if it has none. | |
| const Expr * | body () const |
| bool | has_mut_body () const |
| Only such a body is emitted as a mutable, so only it may refer to the declaration itself. | |
| void | bind (Scopes &) const override |
| virtual void | bind_decl (Scopes &) const |
| virtual void | bind_body (Scopes &) const |
| void | emit (Emitter &) const override |
| virtual void | emit_decl (Emitter &) const |
| virtual void | emit_body (Emitter &) const |
| void | stream (fe::Tab &, std::ostream &) const override |
| virtual void | stream_ (fe::Tab &, std::ostream &) const |
| Streams this declaration without modifiers and without the trailing ;. | |
| std::pair< AnnexInfo *, sub_t > | annex_sub () const override |
| The (AnnexInfo, sub) slot this decl registered itself under as an annex; {nullptr, 0} if it isn't one. | |
| Public Member Functions inherited from mim::ast::ValDecl | |
| Vis | vis () const override |
| A ValDecl's own Vis; Pub for anything else (Ptrn, Import, ...), which the priv/pub system ignores. | |
| bool | is_extern () const override |
| Whether this decl crosses the Mim/native boundary (extern); body presence picks which side supplies it. | |
| bool | is_anx () const override |
| Whether this decl is registered as a compiler-exposed annex (anx). | |
| const Mods & | mods () const |
| Public Member Functions inherited from mim::ast::Decl | |
| const Def * | def () const |
| virtual const Scope * | scope () const |
| Non-nullptr if this Decl is a module whose members a Path may walk into. | |
| Public Member Functions inherited from mim::ast::Node | |
| Loc | loc () const |
| void | dump () const |
Protected Attributes | |
| AnnexInfo * | annex_ = nullptr |
| sub_t | sub_ = 0 |
| Protected Attributes inherited from mim::ast::Decl | |
| const Def * | def_ = nullptr |
Additional Inherited Members | |
| Protected Member Functions inherited from mim::ast::ValDecl | |
| ValDecl (Loc loc, Mods mods={}) | |
| Protected Member Functions inherited from mim::ast::Decl | |
| Decl (Loc loc) | |
| Protected Member Functions inherited from mim::ast::Node | |
| Node (Loc loc) | |
Definition at line 1137 of file ast.h.
References body(), dbg(), mim::ast::Node::loc(), mim::ast::ValDecl::mods(), and mim::ast::ValDecl::ValDecl().
Referenced by mim::ast::LamDecl::LamDecl(), and mim::ast::NomDecl::NomDecl().
|
overridevirtual |
Implements mim::ast::ValDecl.
Definition at line 506 of file bind.cpp.
References bind_body(), and bind_decl().
|
virtual |
Reimplemented in mim::ast::LamDecl, and mim::ast::NomDecl.
Definition at line 540 of file bind.cpp.
References body().
Referenced by bind(), and mim::ast::NomDecl::bind_body().
|
virtual |
Reimplemented in mim::ast::LamDecl.
Definition at line 529 of file bind.cpp.
References annex_, body(), dbg(), has_mut_body(), mim::ast::ValDecl::is_anx(), mim::ast::Node::loc(), and sub_.
Referenced by bind().
|
inline |
Definition at line 1143 of file ast.h.
Referenced by mim::ast::LamDecl::bind_body(), bind_body(), mim::ast::LamDecl::bind_decl(), bind_decl(), mim::ast::LamDecl::emit_body(), mim::ast::NomDecl::emit_body(), emit_body(), mim::ast::NomDecl::emit_decl(), emit_decl(), has_mut_body(), mim::ast::LamDecl::LamDecl(), mim::ast::NomDecl::NomDecl(), RecDecl(), mim::ast::LamDecl::stream_(), mim::ast::NomDecl::stream_(), and stream_().
|
inlineoverridevirtual |
The name this Decl introduces; anonymous if it has none.
Reimplemented from mim::ast::Decl.
Definition at line 1142 of file ast.h.
Referenced by mim::ast::LamDecl::bind_decl(), bind_decl(), mim::ast::LamDecl::emit_body(), mim::ast::NomDecl::emit_body(), emit_body(), mim::ast::LamDecl::emit_decl(), emit_decl(), mim::ast::LamDecl::LamDecl(), mim::ast::NomDecl::NomDecl(), RecDecl(), mim::ast::LamDecl::stream_(), mim::ast::NomDecl::stream_(), and stream_().
|
overridevirtual |
Implements mim::ast::ValDecl.
Definition at line 949 of file emit.cpp.
References emit_body(), and emit_decl().
Referenced by mim::ast::LamDecl::emit_body(), and mim::ast::NomDecl::emit_body().
|
virtual |
Reimplemented in mim::ast::LamDecl, and mim::ast::NomDecl.
Definition at line 967 of file emit.cpp.
References annex_, body(), dbg(), mim::ast::Decl::def_, mim::ast::Node::loc(), and sub_.
Referenced by emit().
|
virtual |
Reimplemented in mim::ast::LamDecl, and mim::ast::NomDecl.
Definition at line 961 of file emit.cpp.
References body(), dbg(), mim::ast::Decl::def_, and mim::ast::Node::loc().
Referenced by emit().
| bool mim::ast::RecDecl::has_mut_body | ( | ) | const |
Only such a body is emitted as a mutable, so only it may refer to the declaration itself.
Definition at line 524 of file bind.cpp.
References body(), and mim::ast::InfixExpr::isa_op().
Referenced by bind_decl(), mim::ast::NomDecl::emit_ahead(), mim::ast::NomDecl::emit_body(), and mim::ast::NomDecl::emit_decl().
|
overridevirtual |
Implements mim::ast::Node.
Definition at line 319 of file stream.cpp.
References mim::ast::ValDecl::mods(), and stream_().
|
virtual |
Streams this declaration without modifiers and without the trailing ;.
Reimplemented in mim::ast::LamDecl, and mim::ast::NomDecl.
Definition at line 325 of file stream.cpp.
References body(), dbg(), and mim::ast::S::S().
Referenced by stream().
|
mutableprotected |
Definition at line 1161 of file ast.h.
Referenced by annex_sub(), mim::ast::LamDecl::bind_decl(), bind_decl(), mim::ast::LamDecl::emit_body(), mim::ast::NomDecl::emit_body(), and emit_body().
|
mutableprotected |
Definition at line 1162 of file ast.h.
Referenced by annex_sub(), mim::ast::LamDecl::bind_decl(), bind_decl(), mim::ast::LamDecl::emit_body(), mim::ast::NomDecl::emit_body(), and emit_body().