Owns the arena all AST nodes live in as well as the AnnexInfos of all plugins. More...
#include <mim/ast/ast.h>
Classes | |
| struct | Files |
Public Member Functions | |
| AST (const AST &)=delete | |
| AST (World &) | |
| AST (AST &&) | |
| ~AST () | |
| template<class T, class... Args> | |
| auto | ptr (Args &&... args) |
| The VLA ranges of a fe::VLA node come last, in the order its VLA_Types declares them. | |
| template<class R, class T = std::ranges::range_value_t<R>> | |
| fe::View< T > | copy (const R &range) |
An Arena-allocated copy of range - for the few lists that do not sit behind a node. | |
| Scope & | scope () |
| A fresh Scope for a ModDecl; owned here, as an AST node never runs a destructor. | |
Getters | |
| World & | world () const |
| Driver & | driver () const |
| Error & | error () const |
Sym | |
| Sym | sym (const char *s) |
| Sym | sym (std::string_view s) |
| Sym | sym (const std::string &s) |
| Sym | sym_anon () |
| "_". | |
| Sym | sym_return () |
| "return". | |
| Sym | sym_error () |
| "_error_". | |
Manage Files | |
| std::pair< Ptr< File > &, bool > | file (const fe::Src *src) |
Manage Annex | |
| AnnexInfo * | name2annex (Scopes &s, Dbg dbg, sub_t *sub_id) |
| const auto & | plugin2annexes (Sym plugin) |
bootstrap | |
| void | bootstrap (Sym plugin, std::ostream &h) |
| void | bootstrap_py (Sym plugin, std::ostream &h) |
Friends | |
| void | swap (AST &a1, AST &a2) noexcept |
|
delete |
References AST().
Referenced by AST(), AST(), mim::ast::load_plugins(), and swap.
| mim::ast::AST::AST | ( | AST && | other | ) |
|
default |
| void mim::ast::AST::bootstrap | ( | Sym | plugin, |
| std::ostream & | h ) |
Definition at line 28 of file ast.cpp.
References mim::Annex::mangle(), plugin2annexes(), and sym().
| void mim::ast::AST::bootstrap_py | ( | Sym | plugin, |
| std::ostream & | h ) |
Definition at line 135 of file ast.cpp.
References mim::Annex::mangle(), plugin2annexes(), and sym().
|
inline |
Definition at line 109 of file ast.h.
References mim::World::driver(), and world().
Referenced by mim::ast::Parser::driver(), error(), sym(), sym(), and sym().
|
inline |
Definition at line 110 of file ast.h.
References driver().
Referenced by mim::ast::Scopes::error(), and name2annex().
The slot of src and whether it is fresh; a fresh slot is nullptr until the caller fills it in. A nullptr slot that is not fresh is a file still being parsed further up the stack.
Definition at line 23 of file ast.cpp.
Referenced by mim::ast::Parser::import().
Registers dbg as an annex, deriving plugin/tag/sub from dbg's source file and s's current mod-nesting (Scopes::mod_depth/Scopes::enclosing_mod); sub_id receives dbg's sub index within its tag. nullptr if dbg is anonymous or nests more than one mod deep.
Definition at line 323 of file bind.cpp.
References error(), mim::Annex::mangle(), sym(), and sym_error().
|
inline |
Definition at line 153 of file ast.h.
Referenced by bootstrap(), and bootstrap_py().
|
inline |
|
inline |
|
inline |
Definition at line 115 of file ast.h.
References driver().
Referenced by bootstrap(), bootstrap_py(), name2annex(), sym_anon(), sym_error(), and sym_return().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |