|
reglibcpp
1.5.0
(Naïve) C++ implementation of models for regular languages
|
Where this library lives. More...
Classes | |
| class | dfa |
| Represents deterministic finite automata. More... | |
| class | expression |
| Represents formal regular expressions. More... | |
| class | gnfa |
| Represents generalized nondeterministic finite automata. More... | |
| class | nfa |
| Represents nondeterministic finite automata with ε-moves. More... | |
Typedefs | |
| using | Dtransitionmap = unordered_map< string, unordered_map< char32_t, string > > |
| Shorthand for the map from state name and transition symbol to target state. More... | |
| using | Ntransitionmap = unordered_map< string, unordered_map< char32_t, unordered_set< string > >> |
| Shorthand for the map from state name and transition symbol to set of target states. More... | |
Functions | |
| u32string | findShortestWord (dfa const &d) |
| Searches the shortest UTF-32-encoded word accepted by a given DFA. More... | |
| string | findShortestUtf8Word (dfa const &d) |
| Same as above for a UTF-8-encoded word. More... | |
| template<class T > | |
| size_t | index_of (vector< T > const &vec, T const &element) |
| Basically Java's List interface's indexOf, but as a non-member function and returning the container's size upon failure. More... | |
| template size_t | index_of (vector< char32_t > const &vec, char32_t const &element) |
| Explicit instantiation for use in other translation units. More... | |
| template size_t | index_of (vector< string > const &vec, string const &element) |
| Explicit instantiation for use in other translation units. More... | |
| u32string | findShortestWord (nfa const &n) |
| Searches the shortest UTF-32-encoded word accepted by a given NFA. More... | |
| string | findShortestUtf8Word (nfa const &n) |
| Same as above for a UTF-8-encoded word. More... | |
Variables | |
| std::wstring_convert< std::codecvt_utf8< char32_t >, char32_t > | converter |
| Converts between UTF-8-encoded and UTF-32-encoded strings. More... | |
Where this library lives.
| using reg::Dtransitionmap = typedef unordered_map<string, unordered_map<char32_t, string> > |
| using reg::Ntransitionmap = typedef unordered_map<string, unordered_map<char32_t, unordered_set<string> >> |
| std::string reg::findShortestUtf8Word | ( | dfa const & | d | ) |
| std::string reg::findShortestUtf8Word | ( | nfa const & | n | ) |
| std::u32string reg::findShortestWord | ( | dfa const & | d | ) |
Searches the shortest UTF-32-encoded word accepted by a given DFA.
| d | the DFA |
| std::logic_error | if the DFA doesn't accept any words |
| std::u32string reg::findShortestWord | ( | nfa const & | n | ) |
Searches the shortest UTF-32-encoded word accepted by a given NFA.
| n | the NFA |
| std::logic_error | if the NFA doesn't accept any words |
| size_t reg::index_of | ( | vector< T > const & | vec, |
| T const & | element | ||
| ) |
Basically Java's List interface's indexOf, but as a non-member function and returning the container's size upon failure.
| vec | the container to search through |
| element | the element to find the index of |
i with vec[i]==element or vec.size() if none is found | template size_t reg::index_of | ( | vector< char32_t > const & | vec, |
| char32_t const & | element | ||
| ) |
Explicit instantiation for use in other translation units.
Explicit instantiation for use in other translation units.
| std::wstring_convert< std::codecvt_utf8< char32_t >, char32_t > reg::converter |
1.8.14