Classes | |
| struct | NomInfo |
Public Member Functions | |
| Emitter (AST &ast) | |
| AST & | ast () const |
| World & | world () |
| Driver & | driver () |
| fe::Error & | error () |
| void | attach (AnnexInfo *annex, sub_t sub, Sym name, const Def *def) |
name is this registration's own (unqualified) Dbg::sym; AnnexInfo::qualified turns it into the full plugin.tag[.sub] name. | |
| void | attach_alias (AnnexInfo *annex, sub_t sub, Sym name) |
Names | |
Field and constructor names live on the Def, so same-shaped types share one table. | |
| void | add_names (const Def *def, const fe::SymMap< size_t > &sym2idx) |
| void | adopt_names (const Nom *nom) |
Copies the names of nom's declaration onto the corresponding parts of nom - an instance of it. | |
| auto | variant_str (const Def *variant) |
A declared variant prints under its name; an anonymous one spells out its cases, named as source does. | |
| std::optional< size_t > | find_name (const Def *def, Dbg dbg) |
| void | add_ctors (const Def *variant, const VariantExpr *expr) |
| size_t | ctor (const Def *variant, Dbg dbg) |
| std::string | ctor_names (const Def *variant, size_t i) |
Every name case i goes by, sorted for a deterministic diagnostic; its index if it has none. | |
Nominal scope | |
Only the mod declaring a private nom - or one nested in it - may access its representation. | |
| void | push_mod (const ModDecl *mod) |
| void | pop_mod () |
| fe::Vector< const ModDecl * > | reset_mods () |
| void | restore_mods (fe::Vector< const ModDecl * > mods) |
| void | add_nom (const Nom *nom, const NomDecl *decl) |
| NomInfo | nom_decl (const Nom *nom) const |
The declared nom that nom instantiates and, if its representation is private, the mod owning it. | |
| bool | within (const ModDecl *mod) const |
| struct mim::ast::Emitter::NomInfo |
|
inline |
|
inline |
Definition at line 98 of file emit.cpp.
References add_names(), mim::ast::VariantExpr::ctor(), mim::ast::VariantExpr::Ctor::dbg(), error(), and mim::ast::VariantExpr::num_ctors().
|
inline |
Definition at line 40 of file emit.cpp.
Referenced by add_ctors().
Definition at line 135 of file emit.cpp.
References mim::Nom::key(), mim::ast::Priv, and mim::ast::NomDecl::rep_vis().
|
inline |
Copies the names of nom's declaration onto the corresponding parts of nom - an instance of it.
Definition at line 47 of file emit.cpp.
References adopt_names(), mim::ast::Emitter::NomInfo::decl, nom_decl(), and mim::Nom::op().
Referenced by adopt_names().
|
inline |
name is this registration's own (unqualified) Dbg::sym; AnnexInfo::qualified turns it into the full plugin.tag[.sub] name.
We must take it from the declaration rather than from Def::sym, since hash-consing can make several annexes share a single Def (e.g. mod foo anx let bar = 23; anx let baz = 23; end).
Definition at line 28 of file emit.cpp.
References mim::World::annexes(), mim::World::Annexes::attach(), driver(), mim::ast::AnnexInfo::id, mim::ast::AnnexInfo::plugin_id(), mim::ast::AnnexInfo::qualified(), and world().
Definition at line 33 of file emit.cpp.
References mim::World::annexes(), mim::World::Annexes::attach_alias(), driver(), mim::ast::AnnexInfo::id, mim::ast::AnnexInfo::plugin_id(), mim::ast::AnnexInfo::qualified(), and world().
|
inline |
Definition at line 107 of file emit.cpp.
References error(), find_name(), and variant_str().
|
inline |
|
inline |
Definition at line 21 of file emit.cpp.
References mim::World::driver(), and world().
Referenced by attach(), attach_alias(), and error().
|
inline |
Definition at line 22 of file emit.cpp.
References driver().
Referenced by add_ctors(), ctor(), and find_name().
|
inline |
Definition at line 75 of file emit.cpp.
References error(), and variant_str().
Referenced by ctor().
The declared nom that nom instantiates and, if its representation is private, the mod owning it.
Definition at line 140 of file emit.cpp.
References mim::Nom::key().
Referenced by adopt_names().
|
inline |
|
inline |
|
inline |
|
inline |
A declared variant prints under its name; an anonymous one spells out its cases, named as source does.
Streams lazily so that it still renders under the PlainNames guard Error::msg formats within.
Definition at line 56 of file emit.cpp.
References mim::Def::num_ops(), mim::Def::op(), mim::World::sigma(), mim::Def::sym(), and mim::Def::world().
Referenced by ctor(), and find_name().
|
inline |
|
inline |
Definition at line 20 of file emit.cpp.
References ast(), and mim::ast::AST::world().
Referenced by attach(), attach_alias(), and driver().