nom dbg = body; - a nominal newtype. More...
#include <mim/ast/ast.h>
Public Member Functions | |
| NomDecl (Loc loc, Mods mods, Dbg dbg, Ptr< Expr > body) | |
| Vis | rep_vis () const |
| The visibility of this nom's representation: that of the enclosing top-level declaration. | |
| void | bind_body (Scopes &) const override |
| void | emit_decl (Emitter &) const override |
| void | emit_body (Emitter &) const override |
| const Def * | emit_ahead (Emitter &) const |
| Emits a nom without a mutable body as soon as a sibling refers to it; nullptr on a cycle. | |
| void | emit_sugar (Emitter &, Lam *lam) const |
Sets lam's body to this LamDecl::nom_sugar before emitting the latter's body. | |
| void | stream_ (fe::Tab &, std::ostream &) const override |
| Streams this declaration without modifiers and without the trailing ;. | |
| Public Member Functions inherited from mim::ast::RecDecl | |
| 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 |
| void | emit (Emitter &) const override |
| void | stream (fe::Tab &, std::ostream &) const override |
| 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 |
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) | |
| Protected Attributes inherited from mim::ast::RecDecl | |
| AnnexInfo * | annex_ = nullptr |
| sub_t | sub_ = 0 |
| Protected Attributes inherited from mim::ast::Decl | |
| const Def * | def_ = nullptr |
Definition at line 1172 of file ast.h.
References mim::ast::RecDecl::body(), mim::ast::RecDecl::dbg(), mim::ast::Node::loc(), mim::ast::ValDecl::mods(), and mim::ast::RecDecl::RecDecl().
|
overridevirtual |
Reimplemented from mim::ast::RecDecl.
Definition at line 542 of file bind.cpp.
References mim::ast::RecDecl::bind_body(), and mim::ast::Pub.
Emits a nom without a mutable body as soon as a sibling refers to it; nullptr on a cycle.
Definition at line 992 of file emit.cpp.
References mim::ast::Decl::def_, emit_body(), and mim::ast::RecDecl::has_mut_body().
Referenced by emit_sugar().
|
overridevirtual |
Reimplemented from mim::ast::RecDecl.
Definition at line 980 of file emit.cpp.
References mim::ast::RecDecl::annex_, mim::ast::RecDecl::body(), mim::ast::RecDecl::dbg(), mim::ast::Decl::def_, mim::ast::RecDecl::emit(), mim::ast::RecDecl::has_mut_body(), mim::ast::Node::loc(), mim::Nom::op(), and mim::ast::RecDecl::sub_.
Referenced by emit_ahead(), and emit_sugar().
|
overridevirtual |
Reimplemented from mim::ast::RecDecl.
Definition at line 974 of file emit.cpp.
References mim::ast::RecDecl::body(), emit_decl(), mim::ast::RecDecl::has_mut_body(), and mim::ast::Node::loc().
Referenced by emit_decl(), and emit_sugar().
Sets lam's body to this LamDecl::nom_sugar before emitting the latter's body.
Definition at line 997 of file emit.cpp.
References emit_ahead(), emit_body(), emit_decl(), and mim::Lam::set_body().
|
inline |
The visibility of this nom's representation: that of the enclosing top-level declaration.
Definition at line 1176 of file ast.h.
Referenced by mim::ast::Emitter::add_nom().
|
overridevirtual |
Streams this declaration without modifiers and without the trailing ;.
Reimplemented from mim::ast::RecDecl.
Definition at line 326 of file stream.cpp.
References mim::ast::RecDecl::body(), mim::ast::RecDecl::dbg(), and mim::ast::S::S().