21 template <
class SymbolType >
24 template <
class SymbolType >
27 template <
class SymbolType >
30 template <
class SymbolType >
36 template <
class SymbolType >
39 template <
class SymbolType >
47 template <
class SymbolType >
50 template <
class SymbolType >
62template <
class SymbolType >
81 rte.getRTE ( ).getStructure ( ).template accept < void, GlushkovFollow::Formal < SymbolType > > (
rte, subMap,
res );
87template <
class SymbolType >
94 if (
rte.getSubstitutionAlphabet ( ).count ( e ) > 0 )
95 processed.insert ( subMap.
at ( e ).begin ( ), subMap.
at ( e ).end ( ) );
97 processed.insert ( e );
99 follow.push_back ( processed );
110template <
class SymbolType >
112 const TSetOfSymbols < SymbolType > & alphabetK =
rte.getSubstitutionAlphabet ( );
113 for (
bool change =
true; change; change = false )
115 TSetOfSymbols < SymbolType > & substSet = kv.second;
117 for (
auto eIter = substSet.begin ( ); eIter != substSet.end ( ); ) {
118 if ( alphabetK.count ( * eIter ) == 0 ) {
121 auto it = subMap.find ( * eIter );
122 size_t oldSize = substSet.size ( );
123 substSet.
insert ( it->second.begin ( ), it->second.end ( ) );
124 change = ( oldSize != substSet.size ( ) );
125 eIter = substSet.erase ( eIter );
134template <
class SymbolType >
141 node.getLeftElement ( ).template accept < void, GlushkovFollow::Formal < SymbolType > > (
rte, subMap,
res );
142 node.getRightElement ( ).template accept < void, GlushkovFollow::Formal < SymbolType > > (
rte, subMap,
res );
145template <
class SymbolType >
147 preprocessSubMap ( subMap,
rte );
151 auto itMap = subMap.find (
node.getSubstitutionSymbol ( ).getSymbol ( ) );
153 itMap->second.clear();
156 itMap->second.insert ( s );
158 node.getLeftElement ( ).template accept < void, GlushkovFollow::Formal < SymbolType > > (
rte, subMap,
res );
161 itMap->second = std::move ( backup );
163 node.getRightElement ( ).template accept < void, GlushkovFollow::Formal < SymbolType > > (
rte, subMap,
res );
166template <
class SymbolType >
168 preprocessSubMap ( subMap,
rte );
171 auto itMap = subMap.find (
node.getSubstitutionSymbol ( ).getSymbol ( ) );
174 subMap [
node.getSubstitutionSymbol ( ).getSymbol ( ) ].
insert ( s );
177 node.getElement ( ).template accept < void, GlushkovFollow::Formal < SymbolType > > (
rte, subMap,
res );
180 itMap->second = backup;
183template <
class SymbolType >
185 preprocessSubMap ( subMap,
rte );
198 for (
const auto & childNode :
node.getElements ( ) ) {
199 childNode .
template accept < void, GlushkovFollow::Formal < SymbolType > > (
rte, subMap,
res );
203template <
class SymbolType >
205 preprocessSubMap ( subMap,
rte );
208template <
class SymbolType >
210 preprocessSubMap ( subMap,
rte );
Definition: ranked_symbol.hpp:20
Class extending the map class from the standard library. Original reason is to allow printing of the ...
Definition: map.hpp:48
R & at(const T &key, R &defaultValue)
Definition: map.hpp:163
std::pair< iterator, bool > insert(const T &key, const R &value)
Insert variant with explicit key and value parameters.
Definition: map.hpp:118
Class extending the pair class from the standard library. Original reason is to allow printing of the...
Definition: pair.hpp:43
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
Definition: GlushkovFollow.h:33
static ext::map< common::ranked_symbol< ext::pair< SymbolType, unsigned > >, TFollowTuple< SymbolType > > follow(const rte::FormalRTE< ext::pair< SymbolType, unsigned > > &rte)
Definition: GlushkovFollow.h:63
return res
Definition: MinimizeByPartitioning.h:145
constexpr auto visit(Visitor &&vis, Variants &&... vars)
Definition: variant.hpp:42
constexpr auto make_pair(T1 &&x, T2 &&y)
Definition: pair.hpp:79
Definition: ToFTAGlushkov.h:22