The AST of one source file: an anonymous ModDecl that a UseDecl binds under a name of its own. More...
#include <mim/ast/ast.h>
Public Member Functions | |
| File (Loc loc, Scope &members, fe::View< Ptr< ValDecl > > decls) | |
| auto | implicit_imports () const |
| Imports the driver was told about via -p; they precede everything the file itself declares. | |
| void | add_implicit_imports (fe::View< Ptr< UseDecl > > imports) const |
| void | compile (AST &) const |
| void | bind (AST &) const |
| void | bind (Scopes &) const override |
| void | emit (AST &) const |
| void | emit (Emitter &) const override |
| void | stream (fe::Tab &, std::ostream &) const override |
| Public Member Functions inherited from mim::ast::ModDecl | |
| ModDecl (Loc loc, Vis vis, Dbg dbg, Scope &members, fe::View< Ptr< ValDecl > > decls) | |
| Dbg | dbg () const override |
| The name this Decl introduces; anonymous if it has none. | |
| auto | decls () const |
| const Scope * | scope () const override |
| Non-nullptr if this Decl is a module whose members a Path may walk into. | |
| void | bind (Scopes &) const override |
| void | emit (Emitter &) const override |
| void | stream (fe::Tab &, std::ostream &) const override |
| 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 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. | |
| Public Member Functions inherited from mim::ast::Node | |
| Loc | loc () const |
| void | dump () const |
Additional Inherited Members | |
| Protected Member Functions inherited from mim::ast::ModDecl | |
| Scope & | members () const |
| void | bind_decls (Scopes &) const |
| void | emit_decls (Emitter &) const |
| 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::Decl | |
| const Def * | def_ = nullptr |
The AST of one source file: an anonymous ModDecl that a UseDecl binds under a name of its own.
Unlike a nested ModDecl, its Scope is a barrier: a file must not see whoever imports it.
Definition at line 1206 of file ast.h.
References mim::ast::ModDecl::decls(), mim::ast::Node::loc(), mim::ast::ModDecl::members(), mim::ast::ModDecl::ModDecl(), and mim::ast::Priv.
| void mim::ast::File::bind | ( | AST & | ast | ) | const |
|
overridevirtual |
Implements mim::ast::ValDecl.
Definition at line 145 of file bind.cpp.
References mim::ast::ModDecl::bind_decls(), implicit_imports(), and mim::ast::ModDecl::members().
| void mim::ast::File::compile | ( | AST & | ast | ) | const |
Definition at line 201 of file ast.cpp.
References bind(), and emit().
Referenced by mim::ast::load_plugins().
| void mim::ast::File::emit | ( | AST & | ast | ) | const |
Definition at line 43 of file emit.cpp.
References emit(), and mim::ast::Emitter::Emitter().
Referenced by compile(), emit(), and mim::ast::UseDecl::emit().
|
overridevirtual |
Implements mim::ast::ValDecl.
Definition at line 48 of file emit.cpp.
References mim::ast::ModDecl::emit_decls(), implicit_imports(), and mim::ast::Node::loc().
|
inline |
|
overridevirtual |
Implements mim::ast::Node.
Definition at line 76 of file stream.cpp.
References mim::ast::ModDecl::decls(), and mim::ast::stream_decls().