MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
mim::Nest Class Reference

Builds a nesting tree of 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 of all mutables‍/binders.

Definition at line 12 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(), operator=(), 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 220 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 161 of file dot.cpp.

References dot().

◆ dot() [2/3]

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

Definition at line 170 of file dot.cpp.

References mim::println(), mim::Tab::println(), and root().

Referenced by dot(), and main().

◆ dot() [3/3]

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

Definition at line 232 of file nest.h.

References dot().

Referenced by dot().

◆ end()

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

Definition at line 221 of file nest.h.

◆ is_recursive()

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

Definition at line 205 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 212 of file nest.h.

Referenced by Nest().

◆ nodes()

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

Definition at line 213 of file nest.h.

◆ num_nodes()

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

Definition at line 210 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 215 of file nest.h.

References Nest().

◆ root()

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

Definition at line 202 of file nest.h.

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

◆ vars()

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

All Vars occurring in this Nest.

Definition at line 203 of file nest.h.

Referenced by contains().

◆ world()

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

Definition at line 201 of file nest.h.

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


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