MimIR 0.1
MimIR is my Intermediate Representation
|
Builds a nesting tree of all immutables/binders. More...
#include <mim/nest.h>
Classes | |
class | Node |
Public Member Functions | |
Constructors | |
Nest (Def *root) | |
Nest (View< Def * > muts) | |
Constructs a virtual root with muts as children. | |
Nest (World &) | |
Virtual root with all World::externals as children. | |
Getters | |
World & | world () const |
const Node * | root () const |
Vars | vars () const |
All Vars occurring in this Nest. | |
bool | contains (const Def *def) const |
bool | is_recursive () const |
Nodes | |
auto | muts () const |
auto | nodes () const |
const auto & | mut2node () const |
size_t | num_nodes () const |
const Node * | mut2node (Def *mut) const |
const Node * | operator[] (Def *mut) const |
Same as above. | |
dot | |
GraphViz output. | |
void | dot (std::ostream &os) const |
void | dot (const char *file=nullptr) const |
void | dot (std::string s) const |
Static Public Member Functions | |
static const Node * | lca (const Node *n, const Node *m) |
Least common ancestor of n and m . | |
mim::Nest::Nest | ( | World & | world | ) |
Virtual root with all World::externals as children.
Definition at line 24 of file nest.cpp.
References world().
Definition at line 131 of file nest.h.
References mim::Def::free_vars(), mim::PooledSet< T >::has_intersection(), and vars().
Referenced by mim::plug::clos::free_defs(), and mim::Scheduler::Scheduler().
void mim::Nest::dot | ( | const char * | file = nullptr | ) | const |
void mim::Nest::dot | ( | std::ostream & | os | ) | const |
Definition at line 168 of file dot.cpp.
References mim::println(), mim::Tab::println(), and root().
|
inline |
|
inline |
Definition at line 132 of file nest.h.
References mim::Nest::Node::is_recursive(), and root().
Referenced by mim::LamSpec::rewrite().
|
static |
Least common ancestor of n
and m
.
Definition at line 78 of file nest.cpp.
References mim::Nest::Node::level(), and mim::Nest::Node::parent().
|
inline |
Definition at line 141 of file nest.h.
Referenced by operator[](), and mim::post_order().
|
inline |
Definition at line 137 of file nest.h.
Referenced by Nest(), and mim::Scheduler::Scheduler().
|
inline |
Definition at line 129 of file nest.h.
Referenced by dot(), mim::plug::clos::free_defs(), is_recursive(), mim::Scheduler::root(), and mim::Scheduler::schedule().
|
inline |
|
inline |
Definition at line 128 of file nest.h.
Referenced by Nest(), and mim::Scheduler::world().