MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
automaton Namespace Reference

Classes

class  AutomatonBase
 
class  DFA
 
class  DFANode
 
class  NFA
 
class  NFANode
 
struct  RangeCompare
 

Typedefs

template<class To >
using DFAMap = absl::flat_hash_map<const DFANode*, To>
 
using Range = std::pair<std::uint64_t, std::uint64_t>
 

Functions

template<class NodeType , class PrintCharF >
std::ostream & print_node (std::ostream &os, const NodeType &node, PrintCharF &&print_char)
 
std::unique_ptr< DFAminimize_dfa (const DFA &dfa)
 
std::unique_ptr< DFAnfa2dfa (const NFA &nfa)
 
std::optional< Rangemerge_ranges (Range a, Range b) noexcept
 
template<class Vec , class LogF >
Vec merge_ranges (const Vec &old_ranges, LogF &&log)
 
template<class Vec >
auto merge_ranges (const Vec &old_ranges)
 
std::ostream & operator<< (std::ostream &os, const DFANode &node)
 
std::ostream & operator<< (std::ostream &os, const NFANode &node)
 
std::set< const NFANode * > epsilonClosure (const std::set< const NFANode * > &states)
 
std::set< const NFANode * > epsilonClosure (const NFANode *state)
 

Typedef Documentation

◆ DFAMap

template<class To >
using automaton::DFAMap = absl::flat_hash_map<const DFANode*, To>

Definition at line 61 of file dfa.h.

◆ Range

using automaton::Range = std::pair<std::uint64_t, std::uint64_t>

Definition at line 10 of file range_helper.h.

Function Documentation

◆ epsilonClosure() [1/2]

std::set< const NFANode * > automaton::epsilonClosure ( const NFANode * state)

Definition at line 28 of file nfa2dfa.cpp.

References epsilonClosure().

◆ epsilonClosure() [2/2]

std::set< const NFANode * > automaton::epsilonClosure ( const std::set< const NFANode * > & states)

Definition at line 11 of file nfa2dfa.cpp.

References automaton::NFA::EPSILON.

Referenced by epsilonClosure(), and nfa2dfa().

◆ merge_ranges() [1/3]

template<class Vec >
auto automaton::merge_ranges ( const Vec & old_ranges)

Definition at line 52 of file range_helper.h.

References merge_ranges().

◆ merge_ranges() [2/3]

template<class Vec , class LogF >
Vec automaton::merge_ranges ( const Vec & old_ranges,
LogF && log )

Definition at line 26 of file range_helper.h.

References merge_ranges().

◆ merge_ranges() [3/3]

std::optional< Range > automaton::merge_ranges ( Range a,
Range b )
inlinenoexcept

◆ minimize_dfa()

std::unique_ptr< DFA > automaton::minimize_dfa ( const DFA & dfa)

◆ nfa2dfa()

std::unique_ptr< DFA > automaton::nfa2dfa ( const NFA & nfa)

◆ operator<<() [1/2]

std::ostream & automaton::operator<< ( std::ostream & os,
const DFANode & node )

Definition at line 19 of file dfa.cpp.

◆ operator<<() [2/2]

std::ostream & automaton::operator<< ( std::ostream & os,
const NFANode & node )

Definition at line 25 of file nfa.cpp.

◆ print_node()

template<class NodeType , class PrintCharF >
std::ostream & automaton::print_node ( std::ostream & os,
const NodeType & node,
PrintCharF && print_char )

Definition at line 67 of file automaton.h.

References merge_ranges().