MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches

Builds a nesting tree for all mutables/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.
 Nest (const Nest &)=delete
 Nest (Nest &&)=delete
Nestoperator= (Nest)=delete
Getters
Worldworld () const
const Noderoot () const
Vars vars () const
 All Vars occurring in this Nest.
bool contains (const Def *def) const
bool is_recursive () const
Nodes
size_t num_nodes () const
auto muts () const
auto nodes () const
const Nodeoperator[] (Def *mut) const
Iterators
auto begin () const
auto end () const
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

template<bool bootstrapping = false>
static const Nodelca (const Node *n, const Node *m)
 Least common ancestor of n and m.

Detailed Description

Builds a nesting tree for all mutables/binders.

Note
This type should typically be constructed as const, because some member functions used during lookup have private non-const overloads.
const auto nest = Nest(lam);
Nest(Def *root)
Definition nest.cpp:7

Definition at line 18 of file nest.h.

Constructor & Destructor Documentation

◆ Nest() [1/5]

mim::Nest::Nest ( Def * root)

Definition at line 7 of file nest.cpp.

References world().

Referenced by Nest(), Nest(), and operator=().

◆ Nest() [2/5]

mim::Nest::Nest ( View< Def * > muts)

Constructs a virtual root with muts as children.

Definition at line 13 of file nest.cpp.

References muts(), and world().

◆ Nest() [3/5]

mim::Nest::Nest ( World & world)

Virtual root with all World::externals as children.

Definition at line 21 of file nest.cpp.

References world().

◆ Nest() [4/5]

mim::Nest::Nest ( const Nest & )
delete

References Nest().

◆ Nest() [5/5]

mim::Nest::Nest ( Nest && )
delete

References Nest().

Member Function Documentation

◆ begin()

auto mim::Nest::begin ( ) const
inline

Definition at line 230 of file nest.h.

◆ contains()

bool mim::Nest::contains ( const Def * def) const
inline

◆ dot() [1/3]

void mim::Nest::dot ( const char * file = nullptr) const

Definition at line 195 of file dot.cpp.

References dot().

◆ dot() [2/3]

void mim::Nest::dot ( std::ostream & os) const

Definition at line 204 of file dot.cpp.

References root().

Referenced by dot(), and main().

◆ dot() [3/3]

void mim::Nest::dot ( std::string s) const
inline

Definition at line 242 of file nest.h.

References dot().

Referenced by dot().

◆ end()

auto mim::Nest::end ( ) const
inline

Definition at line 231 of file nest.h.

◆ is_recursive()

bool mim::Nest::is_recursive ( ) const
inline

Definition at line 211 of file nest.h.

Referenced by mim::LamSpec::rewrite().

◆ lca()

template<bool bootstrapping>
template const Nest::Node * mim::Nest::lca< false > ( const Node * n,
const Node * m )
static

Least common ancestor of n and m.

Definition at line 105 of file nest.cpp.

References mim::Nest::Node::inest().

Referenced by mim::Scheduler::late().

◆ muts()

auto mim::Nest::muts ( ) const
inline

Definition at line 218 of file nest.h.

Referenced by Nest().

◆ nodes()

auto mim::Nest::nodes ( ) const
inline

Definition at line 219 of file nest.h.

◆ num_nodes()

size_t mim::Nest::num_nodes ( ) const
inline

Definition at line 216 of file nest.h.

◆ operator=()

Nest & mim::Nest::operator= ( Nest )
delete

References Nest().

◆ operator[]()

const Node * mim::Nest::operator[] ( Def * mut) const
inline

Definition at line 222 of file nest.h.

◆ root()

const Node * mim::Nest::root ( ) const
inline

Definition at line 208 of file nest.h.

Referenced by dot(), mim::sexpr::Emitter::finalize(), and mim::plug::clos::free_defs().

◆ vars()

Vars mim::Nest::vars ( ) const
inline

All Vars occurring in this Nest.

Definition at line 209 of file nest.h.

Referenced by contains().

◆ world()

World & mim::Nest::world ( ) const
inline

Definition at line 207 of file nest.h.

Referenced by Nest(), Nest(), Nest(), and mim::Scheduler::world().


The documentation for this class was generated from the following files: