Class mata::nfa::StatePost¶
-
class StatePost : private OrdVector<SymbolPost>¶
A data structure representing possible transitions over different symbols from a source state.
It is an ordered vector containing possible
SymbolPost(i.e., pair of symbol and target states).SymbolPostsin the vector are ordered by symbols inSymbolPosts.Public Functions
-
const_iterator first_epsilon_it(Symbol first_epsilon) const¶
returns an iterator to the smallest epsilon, or end() if there is no epsilon
-
StateSet get_successors() const¶
Get the set of all target states in the
StatePost.- Returns:
Set of all target states in the
StatePost.
-
const StateSet &get_successors(Symbol symbol) const¶
Returns a reference to target states for a given symbol in the
StatePost.If there is no such symbol, a static empty set is returned.
- Parameters:
symbol – Symbol to get the successors for.
- Returns:
Set of target states for the given symbol.
-
inline Moves moves() const¶
Iterator over all moves (over all labels) in
StatePostrepresented asMoveinstances.
-
Moves moves(StatePost::const_iterator symbol_post_it, StatePost::const_iterator symbol_post_end) const¶
Iterator over specified moves in
StatePostrepresented asMoveinstances.- Parameters:
symbol_post_it – [in] First iterator over symbol posts to iterate over.
symbol_post_end – [in] End iterator over symbol posts (which functions as an sentinel, is not iterated over).
-
Moves moves_epsilons(Symbol first_epsilon = EPSILON) const¶
Iterator over epsilon moves in
StatePostrepresented asMoveinstances.
-
Moves moves_symbols(Symbol last_symbol = EPSILON - 1) const¶
Iterator over alphabet (normal) symbols (not over epsilons) in
StatePostrepresented asMoveinstances.
-
inline virtual reference back()¶
Get reference to the last element in the vector.
Modifying the underlying value in the reference could break sortedness.
-
inline size_t erase(const SymbolPost &k)¶
Remove
kfrom sorted vector.This function expects the vector to be sorted.
Private Functions
-
inline OrdVector difference(const OrdVector &rhs) const¶
Compute set difference as
thisminusrhs.- Parameters:
rhs – Other vector with symbols to be excluded.
- Returns:
thisminusrhs.
-
inline bool contains(const SymbolPost &key) const¶
Check whether
keyexists in the ordered vector.
Private Static Functions
-
class Moves¶
Iterator over moves represented as
Moveinstances.It iterates over pairs (symbol, target) for the given
StatePost.Public Functions
-
Moves(const StatePost &state_post, StatePost::const_iterator symbol_post_it, StatePost::const_iterator symbol_post_end)¶
construct moves iterating over a range
symbol_post_it(including) tosymbol_post_end(excluding).- Parameters:
state_post – [in] State post to iterate over.
symbol_post_it – [in] First iterator over symbol posts to iterate over.
symbol_post_end – [in] End iterator over symbol posts (which functions as an sentinel; is not iterated over).
-
class const_iterator¶
Iterator over moves.
Public Functions
-
inline const_iterator()¶
Construct end iterator.
-
const_iterator(const StatePost &state_post, StatePost::const_iterator symbol_post_it, StatePost::const_iterator symbol_post_it_end)¶
Construct iterator from
symbol_post_it(including) tosymbol_post_it_end(excluding).
-
inline const_iterator()¶
-
Moves(const StatePost &state_post, StatePost::const_iterator symbol_post_it, StatePost::const_iterator symbol_post_end)¶
-
const_iterator first_epsilon_it(Symbol first_epsilon) const¶