reglibcpp  2.0.0
A C++ implementation of models for regular languages
Public Member Functions | Public Attributes | List of all members
reg::fabuilder::impl Struct Reference

Private implementation details of FA builders. More...

Public Member Functions

string const * findStatePointer (string const &state)
 Delivers a pointer towards one of transitions' keys. More...
 
string const * findStatePointer (string &&state)
 Delivers a pointer towards one of transitions' keys. More...
 
bool isDeterministic ()
 Checks for nondeterministic transitions. More...
 
bool isTrashState (string const *q) const
 Tests whether all of a state's outgoing transitions point to itself. More...
 
string const * generateNewState ()
 Generates a uniquely named new state and adds it to the set of states. More...
 
 impl ()=default
 Constructs empty private implementation object. More...
 
 impl (impl const &other)
 Copies a private implementation object by copying all non-pointer data verbatim and reconstructing pointer data afterwards. More...
 
 impl (nfa const &nfa)
 Constructs a private implementation object for fabuilder(nfa const&). More...
 
 impl (dfa const &dfa)
 Constructs a private implementation object for fabuilder(dfa const&). More...
 

Public Attributes

string const * initial = nullptr
 Points to the initial state within transitions. More...
 
unordered_set< char32_t > alphabet
 Set of symbols processable by the prospective FA. More...
 
unordered_map< string, unordered_map< char32_t, unordered_set< string const * > > > transitions
 Transition function (state × symbol → set of states) of the prospective NFA. More...
 
unordered_set< string const * > acceptingStates
 Set of pointers to accept states within transitions. More...
 

Detailed Description

Private implementation details of FA builders.

Definition at line 39 of file fabuilder.cpp.

Constructor & Destructor Documentation

◆ impl() [1/4]

reg::fabuilder::impl::impl ( )
default

Constructs empty private implementation object.

◆ impl() [2/4]

reg::fabuilder::impl::impl ( impl const &  other)
inline

Copies a private implementation object by copying all non-pointer data verbatim and reconstructing pointer data afterwards.

Definition at line 117 of file fabuilder.cpp.

◆ impl() [3/4]

reg::fabuilder::impl::impl ( nfa const &  nfa)
inline

Constructs a private implementation object for fabuilder(nfa const&).

Definition at line 139 of file fabuilder.cpp.

◆ impl() [4/4]

reg::fabuilder::impl::impl ( dfa const &  dfa)
inline

Constructs a private implementation object for fabuilder(dfa const&).

Definition at line 164 of file fabuilder.cpp.

Member Function Documentation

◆ findStatePointer() [1/2]

string const* reg::fabuilder::impl::findStatePointer ( string const &  state)
inline

Delivers a pointer towards one of transitions' keys.

Constructs a key with the given value if none can be found.

Definition at line 57 of file fabuilder.cpp.

◆ findStatePointer() [2/2]

string const* reg::fabuilder::impl::findStatePointer ( string &&  state)
inline

Delivers a pointer towards one of transitions' keys.

Constructs a key with the given rvalue if none can be found.

Definition at line 63 of file fabuilder.cpp.

◆ generateNewState()

string const* reg::fabuilder::impl::generateNewState ( )
inline

Generates a uniquely named new state and adds it to the set of states.

Definition at line 96 of file fabuilder.cpp.

◆ isDeterministic()

bool reg::fabuilder::impl::isDeterministic ( )
inline

Checks for nondeterministic transitions.

Definition at line 68 of file fabuilder.cpp.

◆ isTrashState()

bool reg::fabuilder::impl::isTrashState ( string const *  q) const
inline

Tests whether all of a state's outgoing transitions point to itself.

Definition at line 81 of file fabuilder.cpp.

Member Data Documentation

◆ acceptingStates

unordered_set<string const*> reg::fabuilder::impl::acceptingStates

Set of pointers to accept states within transitions.

Definition at line 52 of file fabuilder.cpp.

◆ alphabet

unordered_set<char32_t> reg::fabuilder::impl::alphabet

Set of symbols processable by the prospective FA.

Definition at line 42 of file fabuilder.cpp.

◆ initial

string const* reg::fabuilder::impl::initial = nullptr

Points to the initial state within transitions.

Definition at line 40 of file fabuilder.cpp.

◆ transitions

unordered_map<string, unordered_map<char32_t, unordered_set<string const*> > > reg::fabuilder::impl::transitions

Transition function (state × symbol → set of states) of the prospective NFA.

Also encodes the set of states in its set of keys. All pointers used by this object point towards this member's keys.

Definition at line 45 of file fabuilder.cpp.


The documentation for this struct was generated from the following file: