10template <
class SymbolType >
12 while ( Unbounded < SymbolType >::A1( alt ) || Unbounded < SymbolType >::A2( alt ) || Unbounded < SymbolType >::A3( alt ) || Unbounded < SymbolType >::A4( alt ) );
14 while ( Unbounded < SymbolType >::A8( alt ) || Unbounded < SymbolType >::A9( alt ) || Unbounded < SymbolType >::A10 ( alt ) || Unbounded < SymbolType >::V2 ( alt ) || Unbounded < SymbolType >::V5 ( alt ) || Unbounded < SymbolType >::V6 ( alt ) );
19 while ( Unbounded < SymbolType >::A1( alt ) || Unbounded < SymbolType >::A2( alt ) || Unbounded < SymbolType >::A3( alt ) || Unbounded < SymbolType >::A4( alt ) || Unbounded < SymbolType >::A8( alt ) || Unbounded < SymbolType >::A9( alt ) || Unbounded < SymbolType >::A10( alt ) || Unbounded < SymbolType >::V2( alt ) || Unbounded < SymbolType >::V5( alt ) || Unbounded < SymbolType >::V6( alt ) || Unbounded < SymbolType >::X1( alt ) );
25template <
class SymbolType >
27 while ( Unbounded < SymbolType >::A5( concat ) || Unbounded < SymbolType >::A6( concat ) || Unbounded < SymbolType >::A7( concat ) );
29 while ( Unbounded < SymbolType >::V8 ( concat ) || Unbounded < SymbolType >::V8R ( concat ) || Unbounded < SymbolType >::V9( concat ) );
34 while ( Unbounded < SymbolType >::A5( concat ) || Unbounded < SymbolType >::A6( concat ) || Unbounded < SymbolType >::A7( concat ) || Unbounded < SymbolType >::V8( concat ) || Unbounded < SymbolType >::V8R( concat ) || Unbounded < SymbolType >::V9( concat ) );
40template <
class SymbolType >
44 while ( Unbounded < SymbolType >::A11( iter ) || Unbounded < SymbolType >::V1( iter ) || Unbounded < SymbolType >::V3( iter ) || Unbounded < SymbolType >::V4( iter ) || Unbounded < SymbolType >::V10( iter ) );
49template <
class SymbolType >
51 optimize ( alt, recursive );
53 if( alt.getElements ( ).size( ) == 1 )
56 if( alt.getElements ( ).empty ( ) )
62template <
class SymbolType >
64 optimize ( concat, recursive );
66 if( concat.getElements ( ).size( ) == 1 )
69 if( concat.getElements ( ).empty ( ) )
75template <
class SymbolType >
77 optimize ( iter, recursive );
80 if(
dynamic_cast < UnboundedRegExpEmpty < SymbolType > *
> ( & iter.getChild ( ) ) )
84 if (
dynamic_cast < UnboundedRegExpEpsilon < SymbolType > *
> ( & iter.getChild ( ) ) )
90template <
class SymbolType >
95template <
class SymbolType >
100template <
class SymbolType >
110template <
class SymbolType >
111bool RegExpOptimize::Unbounded < SymbolType >::A1( UnboundedRegExpAlternation < SymbolType > &
node ) {
112 bool optimized =
false;
114 for(
auto it =
node.begin( ); it !=
node.end( ); ) {
115 if(
dynamic_cast < UnboundedRegExpAlternation < SymbolType > *
> ( & * it ) ) {
116 UnboundedRegExpAlternation < SymbolType > childAlt (
static_cast < UnboundedRegExpAlternation < SymbolType > &&
> ( std::move ( * it ) ) );
117 it =
node.erase( it );
119 it =
node.insert ( it, std::make_move_iterator ( childAlt.begin ( ) ), std::make_move_iterator ( childAlt.end ( ) ) );
134template <
class SymbolType >
135bool RegExpOptimize::Unbounded < SymbolType >::A2( UnboundedRegExpAlternation < SymbolType > &
node ) {
137 auto cmp = [ ](
const UnboundedRegExpElement < SymbolType > * a,
const UnboundedRegExpElement < SymbolType > * b ) ->
bool {
return * a < * b; };
139 if ( std::is_sorted (
node.begin( ).base ( ),
node.end( ).base ( ), cmp ) )
142 std::sort (
node.begin ( ).base ( ),
node.end ( ).base ( ), cmp );
151template <
class SymbolType >
152bool RegExpOptimize::Unbounded < SymbolType >::A3( UnboundedRegExpAlternation < SymbolType > &
node ) {
153 bool optimized =
false;
157 for(
auto it =
node.begin ( ); it !=
node.end ( ); ) {
158 if(
dynamic_cast < UnboundedRegExpEmpty < SymbolType > *
>( & * it ) ) {
159 it =
node.erase ( it );
174template <
class SymbolType >
175bool RegExpOptimize::Unbounded < SymbolType >::A4( UnboundedRegExpAlternation < SymbolType > &
node ) {
184 auto cmp = [ ](
const UnboundedRegExpElement < SymbolType > * a,
const UnboundedRegExpElement < SymbolType > * b ) ->
bool {
return * a == * b; };
186 size_t size =
node.getChildren ( ).size ( );
189 return size !=
node.getChildren ( ).size ( );
197template <
class SymbolType >
198bool RegExpOptimize::Unbounded < SymbolType >::A5( UnboundedRegExpConcatenation < SymbolType > &
node ) {
199 bool optimized =
false;
201 for(
auto it =
node.begin( ); it !=
node.end( ); ) {
202 if(
dynamic_cast < UnboundedRegExpConcatenation < SymbolType > *
> ( & * it ) ) {
204 UnboundedRegExpConcatenation < SymbolType > childConcat =
static_cast < UnboundedRegExpConcatenation < SymbolType > &&
> ( std::move ( * it ) );
205 it =
node.erase ( it );
207 it =
node.insert ( it, std::make_move_iterator ( childConcat.begin( ) ), std::make_move_iterator ( childConcat.end( ) ) );
222template <
class SymbolType >
223bool RegExpOptimize::Unbounded < SymbolType >::A6( UnboundedRegExpConcatenation < SymbolType > &
node ) {
224 bool optimized =
false;
228 for(
auto it =
node.begin( ); it !=
node.end( ); ) {
229 if (
dynamic_cast < UnboundedRegExpEpsilon < SymbolType > *
> ( & * it ) ) {
230 it =
node.erase ( it );
245template <
class SymbolType >
246bool RegExpOptimize::Unbounded < SymbolType >::A7( UnboundedRegExpConcatenation < SymbolType > &
node ) {
248 if(
node.getChildren ( ).size() == 1)
return false;
250 if(
std::any_of (
node.begin( ),
node.end( ), [ ] (
const UnboundedRegExpElement < SymbolType > & a ) ->
bool {
return dynamic_cast < const UnboundedRegExpEmpty < SymbolType > *
> ( & a ); } ) ) {
252 node.pushBackChild ( UnboundedRegExpEmpty < SymbolType > ( ) );
265template <
class SymbolType >
266bool RegExpOptimize::Unbounded < SymbolType >::A8( UnboundedRegExpAlternation < SymbolType > &
node ) {
269 for ( UnboundedRegExpElement < SymbolType > & element :
node ) {
270 if ( UnboundedRegExpConcatenation < SymbolType > * childConcat =
dynamic_cast < UnboundedRegExpConcatenation < SymbolType > *
> ( & element ); childConcat ) {
277 if ( data.size ( ) ==
node.getChildren ( ).size ( ) )
280 UnboundedRegExpAlternation < SymbolType >
res;
282 if ( entry.second.size ( ) == 1 ) {
283 res.appendElement ( std::move ( entry.second.front ( ).get ( ) ) );
285 UnboundedRegExpConcatenation < SymbolType > innerConcat;
286 innerConcat.appendElement ( std::move ( entry.first.get ( ) ) );
287 UnboundedRegExpAlternation < SymbolType > innerAlt;
289 UnboundedRegExpElement < SymbolType > & innerEntryElement = innerEntry.get ( );
290 if ( UnboundedRegExpConcatenation < SymbolType > * innerEntryConcat =
dynamic_cast < UnboundedRegExpConcatenation < SymbolType > *
> ( & innerEntryElement ); innerEntryConcat ) {
291 if ( innerEntryConcat->getElements ( ).size ( ) == 1 ) {
292 innerAlt.appendElement ( UnboundedRegExpEpsilon < SymbolType > ( ) );
294 innerEntryConcat->erase ( innerEntryConcat->begin ( ) );
295 innerAlt.appendElement ( std::move ( * innerEntryConcat ) );
298 innerAlt.appendElement ( UnboundedRegExpEpsilon < SymbolType > ( ) );
301 innerConcat.insert ( innerConcat.end ( ), std::move ( innerAlt ) );
316template <
class SymbolType >
317bool RegExpOptimize::Unbounded < SymbolType >::A9( UnboundedRegExpAlternation < SymbolType > &
node ) {
320 for ( UnboundedRegExpElement < SymbolType > & element :
node ) {
321 if ( UnboundedRegExpConcatenation < SymbolType > * childConcat =
dynamic_cast < UnboundedRegExpConcatenation < SymbolType > *
> ( & element ); childConcat ) {
328 if ( data.size ( ) ==
node.getChildren ( ).size ( ) )
331 UnboundedRegExpAlternation < SymbolType >
res;
333 if ( entry.second.size ( ) == 1 ) {
334 res.appendElement ( std::move ( entry.second.front ( ).get ( ) ) );
336 UnboundedRegExpConcatenation < SymbolType > innerConcat;
337 innerConcat.appendElement ( std::move ( entry.first.get ( ) ) );
338 UnboundedRegExpAlternation < SymbolType > innerAlt;
340 UnboundedRegExpElement < SymbolType > & innerEntryElement = innerEntry.get ( );
341 if ( UnboundedRegExpConcatenation < SymbolType > * innerEntryConcat =
dynamic_cast < UnboundedRegExpConcatenation < SymbolType > *
> ( & innerEntryElement ); innerEntryConcat ) {
342 if ( innerEntryConcat->getElements ( ).size ( ) == 1 ) {
343 innerAlt.appendElement ( UnboundedRegExpEpsilon < SymbolType > ( ) );
345 innerEntryConcat->erase ( innerEntryConcat->rbegin ( ) );
346 innerAlt.appendElement ( std::move ( * innerEntryConcat ) );
349 innerAlt.appendElement ( UnboundedRegExpEpsilon < SymbolType > ( ) );
352 innerConcat.insert ( innerConcat.begin ( ), std::move ( innerAlt ) );
367template <
class SymbolType >
368bool RegExpOptimize::Unbounded < SymbolType >::A10( UnboundedRegExpAlternation < SymbolType > &
node ) {
369 bool optimized =
false;
378 auto eps = find_if(
node.getElements().begin( ),
node.getElements().end( ), [ ](
const UnboundedRegExpElement < SymbolType > & a ) ->
bool {
379 return regexp::properties::RegExpEpsilon::languageContainsEpsilon ( a );
382 if( eps ==
node.getElements().end( ) )
385 for(
size_t i = 0;
i <
node.getChildren ( ).size ( );
i++ ) {
386 const UnboundedRegExpConcatenation < SymbolType > * childConcat =
dynamic_cast < const UnboundedRegExpConcatenation < SymbolType > *
> ( &
node.getChildren ( ) [
i ] );
387 if( ! childConcat || childConcat->getElements ( ).size ( ) < 2 )
391 const UnboundedRegExpIteration < SymbolType > * iter =
dynamic_cast < const UnboundedRegExpIteration < SymbolType > *
> ( & childConcat->getElements ( ).front( ) );
396 const UnboundedRegExpConcatenation < SymbolType > * concat =
dynamic_cast < const UnboundedRegExpConcatenation < SymbolType > *
> ( & iter->getChild ( ) );
398 if ( ( concat && equal ( concat->getChildren ( ).begin( ), concat->getChildren ( ).end ( ), childConcat->begin ( ) + 1 , childConcat->end ( ) ) ) || ( childConcat->getElements ( ).size ( ) == 2 && iter->getChild ( ) == childConcat->getElements ( ) [ 1 ] ) ) {
401 node.setChild ( std::move ( childConcat->getElements().front() ),
i );
413template <
class SymbolType >
414bool RegExpOptimize::Unbounded < SymbolType >::A11( UnboundedRegExpIteration < SymbolType > &
node ) {
416 UnboundedRegExpAlternation < SymbolType > * childAlt =
dynamic_cast<UnboundedRegExpAlternation < SymbolType > *
>( &
node.getChild ( ) );
420 auto eps = find_if ( childAlt->begin( ), childAlt->end( ), [ ] (
const UnboundedRegExpElement < SymbolType > & a ) ->
bool {
421 return dynamic_cast < const UnboundedRegExpEpsilon < SymbolType > * > ( & a );
425 if ( eps == childAlt->end( ) )
429 childAlt->erase ( eps );
441template <
class SymbolType >
442bool RegExpOptimize::Unbounded < SymbolType >::V1( UnboundedRegExpIteration < SymbolType > &) {
453template <
class SymbolType >
454bool RegExpOptimize::Unbounded < SymbolType >::V2( UnboundedRegExpAlternation < SymbolType > &
node ) {
455 bool optimized =
false;
464 for(
const UnboundedRegExpElement < SymbolType > & n :
node.getElements ( ) ) {
465 if (
const UnboundedRegExpIteration < SymbolType > * iter =
dynamic_cast < const UnboundedRegExpIteration < SymbolType > *
> ( & n ); iter ) {
466 if (
const UnboundedRegExpAlternation < SymbolType > * inner =
dynamic_cast < const UnboundedRegExpAlternation < SymbolType > *
> ( & iter->getChild ( ) ); inner ) {
467 for (
const UnboundedRegExpElement < SymbolType > & innerElement : inner->getElements ( ) ) {
468 if ( !
dynamic_cast < const UnboundedRegExpIteration < SymbolType > *
> ( & innerElement ) )
469 iterElements.push_back ( & innerElement );
472 else if ( !
dynamic_cast < const UnboundedRegExpIteration < SymbolType > *
> ( & iter->getChild ( ) ) ) {
473 iterElements.push_back ( & iter->getChild ( ) );
478 for(
const UnboundedRegExpElement < SymbolType > * n : iterElements ) {
479 auto it = find_if (
node.getChildren ( ).begin ( ),
node.getChildren ( ).end ( ), [ n ] (
const UnboundedRegExpElement < SymbolType > & a ) ->
bool {
483 if( it ==
node.getChildren ( ).end ( ) ) {
499template <
class SymbolType >
500bool RegExpOptimize::Unbounded < SymbolType >::V3 ( UnboundedRegExpIteration < SymbolType > &
node ) {
502 if ( UnboundedRegExpIteration < SymbolType > * childIter =
dynamic_cast < UnboundedRegExpIteration < SymbolType > *
> ( &
node.getChild ( ) ); childIter ) {
503 node.setChild ( std::move ( childIter->getChild ( ) ) );
516template <
class SymbolType >
517bool RegExpOptimize::Unbounded < SymbolType >::V4( UnboundedRegExpIteration < SymbolType > &
node ) {
521 auto areAllItersInConcat = [] ( UnboundedRegExpElement < SymbolType > & testedNode ) {
522 UnboundedRegExpConcatenation < SymbolType > * cont =
dynamic_cast < UnboundedRegExpConcatenation < SymbolType > *
> ( & testedNode );
523 return cont &&
all_of ( cont->begin( ), cont->end ( ), [ ] (
const UnboundedRegExpElement < SymbolType > & a ) ->
bool { return dynamic_cast < const UnboundedRegExpIteration < SymbolType > * > ( & a ); } );
526 auto toAlternationOfChildren = [] ( UnboundedRegExpConcatenation < SymbolType > & cont ) {
527 UnboundedRegExpAlternation < SymbolType > newAlt;
529 for ( UnboundedRegExpElement < SymbolType > & n : cont )
530 newAlt.pushBackChild ( std::move (
static_cast < UnboundedRegExpIteration < SymbolType > &
> ( n ).getChild ( ) ) );
535 if ( areAllItersInConcat (
node.getChild ( ) ) ) {
536 node.setChild ( toAlternationOfChildren (
static_cast < UnboundedRegExpConcatenation < SymbolType > &
> (
node.getChild ( ) ) ) );
538 }
else if (
dynamic_cast < UnboundedRegExpAlternation < SymbolType > *
> ( &
node.getChild ( ) ) ) {
539 UnboundedRegExpAlternation < SymbolType > & alt =
static_cast < UnboundedRegExpAlternation < SymbolType > &
> (
node.getChild ( ) );
541 for (
size_t i = 0;
i < alt.getChildren ( ).size ( ); ++
i ) {
542 if ( areAllItersInConcat ( alt.getChild (
i ) ) ) {
543 alt.setChild ( toAlternationOfChildren (
static_cast < UnboundedRegExpConcatenation < SymbolType > &
> ( alt.getChild (
i ) ) ),
i );
558template <
class SymbolType >
559bool RegExpOptimize::Unbounded < SymbolType >::V5( UnboundedRegExpAlternation < SymbolType > & ) {
570template <
class SymbolType >
571bool RegExpOptimize::Unbounded < SymbolType >::V6( UnboundedRegExpAlternation < SymbolType > & ) {
582template <
class SymbolType >
583bool RegExpOptimize::Unbounded < SymbolType >::V8( UnboundedRegExpConcatenation < SymbolType > &
node ) {
584 bool optimized =
false;
588 if (
node.getChildren ( ).empty ( ) )
591 for(
auto it =
node.getChildren ( ).begin( ); it !=
node.getChildren ( ).end( ); ) {
592 const UnboundedRegExpIteration < SymbolType > * iter =
dynamic_cast < const UnboundedRegExpIteration < SymbolType > *
> ( & * it );
600 const UnboundedRegExpConcatenation < SymbolType > * concat =
dynamic_cast < const UnboundedRegExpConcatenation < SymbolType > *
> ( & iter->getChild ( ) );
604 if(
static_cast < size_t > ( distance(
node.getChildren ( ).begin( ), it ) ) < concat->getChildren ( ).size ( ) ) {
613 concat->getChildren().size ( ) ==
static_cast < size_t > ( distance ( it2,
node.getChildren ( ).end ( ) ) ) &&
614 equal ( concat->getChildren ( ).begin( ), concat->getChildren ( ).end( ), it2 ) ) {
617 it =
node.erase ( it2, it );
622 if ( it ==
node.getChildren ( ).begin ( ) ) {
627 auto prev = std::prev ( it );
630 it =
node.erase ( prev );
645template <
class SymbolType >
646bool RegExpOptimize::Unbounded < SymbolType >::V8R( UnboundedRegExpConcatenation < SymbolType > &
node ) {
647 bool optimized =
false;
651 if (
node.getChildren ( ).empty ( ) )
654 for(
auto it =
node.getChildren ( ).rbegin( ); it !=
node.getChildren ( ).rend( ); ) {
655 const UnboundedRegExpIteration < SymbolType > * iter =
dynamic_cast < const UnboundedRegExpIteration < SymbolType > *
> ( & * it );
663 if (
const UnboundedRegExpConcatenation < SymbolType > * concat =
dynamic_cast < const UnboundedRegExpConcatenation < SymbolType > *
> ( & iter->getChild ( ) ); concat ) {
665 if(
static_cast < size_t > ( distance(
node.getChildren ( ).rbegin( ), it ) ) < concat->getChildren ( ).size ( ) ) {
674 concat->getChildren().size ( ) ==
static_cast < size_t > ( distance ( it2,
node.getChildren ( ).rend ( ) ) ) &&
675 equal ( concat->getChildren ( ).rbegin( ), concat->getChildren ( ).rend( ), it2 ) ) {
678 it =
node.erase ( it2, it );
683 if ( it ==
node.getChildren ( ).rbegin ( ) ) {
688 auto prev = std::prev ( it );
691 it =
node.erase ( prev );
706template <
class SymbolType >
707bool RegExpOptimize::Unbounded < SymbolType >::V9( UnboundedRegExpConcatenation < SymbolType > &
node ) {
708 bool optimized =
false;
713 for(
auto it =
node.begin( ) ; it !=
node.end( ) ; ) {
714 UnboundedRegExpIteration < SymbolType > * iter =
dynamic_cast < UnboundedRegExpIteration < SymbolType > *
> ( & * it );
719 UnboundedRegExpConcatenation < SymbolType > * concat =
dynamic_cast < UnboundedRegExpConcatenation < SymbolType > *
> ( & iter->getChild( ) );
721 auto cIter = std::next ( it );
722 if ( cIter ==
node.end ( ) || * cIter != iter->getChild ( ) ) {
727 it =
node.insert ( it, std::move ( * std::next ( it ) ) );
728 it = std::next ( it );
729 it =
node.erase ( std::next ( it ) );
730 it = std::prev ( it );
733 auto c1Iter = std::next( it );
734 auto c2Iter = concat->begin( );
735 while( c1Iter !=
node.end() && c2Iter != concat->end( ) && *c1Iter == * c2Iter ) {
740 if( c1Iter == std::next( it ) ) {
752 copyRange.
insert ( copyRange.
end(), std::make_move_iterator ( std::next( it ) ), std::make_move_iterator ( c1Iter ) );
753 it =
node.erase ( std::next ( it ), c1Iter );
754 it = std::prev( it );
757 it =
node.insert( it, std::make_move_iterator ( copyRange.
begin( ) ), std::make_move_iterator ( copyRange.
end( ) ) );
761 copyRange.
insert ( copyRange.
end(), std::make_move_iterator ( concat->begin( ) ), std::make_move_iterator ( c2Iter ) );
762 concat->erase ( concat->begin( ), c2Iter );
763 concat->insert ( concat->end(), std::make_move_iterator ( copyRange.
begin( ) ), std::make_move_iterator ( copyRange.
end( ) ) );
776template <
class SymbolType >
777bool RegExpOptimize::Unbounded < SymbolType >::V10( UnboundedRegExpIteration < SymbolType > &
node ) {
780 UnboundedRegExpAlternation < SymbolType > * alt =
dynamic_cast < UnboundedRegExpAlternation < SymbolType > *
> ( &
node.getChild ( ) );
781 if ( ! alt || !
any_of ( alt->begin( ), alt->end( ), [] (
const UnboundedRegExpElement < SymbolType > & a ) ->
bool {
return dynamic_cast < const UnboundedRegExpIteration < SymbolType > *
> ( & a ); } ) )
784 for (
auto it = alt->begin( ); it != alt->end ( ); ++ it ) {
785 if (
dynamic_cast < UnboundedRegExpIteration < SymbolType > *
> ( & * it ) )
786 alt->setChild ( std::move (
static_cast < UnboundedRegExpIteration < SymbolType > &
> ( * it ).getChild ( ) ), it );
799template <
class SymbolType >
800bool RegExpOptimize::Unbounded < SymbolType >::X1( UnboundedRegExpAlternation < SymbolType > &
node ) {
805 auto iter = find_if (
node.begin( ),
node.end( ), [] (
const UnboundedRegExpElement < SymbolType > & a ) ->
bool { return dynamic_cast < const UnboundedRegExpIteration < SymbolType > * > ( & a );} );
806 auto eps = find_if (
node.begin( ),
node.end( ), [] (
const UnboundedRegExpElement < SymbolType > & a ) ->
bool { return dynamic_cast < const UnboundedRegExpEpsilon < SymbolType > * > ( & a );} );
808 if( iter !=
node.end( ) && eps !=
node.end( ) ) {
Data & getChild()
Getter of the child of the node.
Definition: tree_base.hpp:403
void setChild(const Data &c)
Setter of the child of the node.
Definition: tree_base.hpp:429
const ext::ptr_vector< Data > & getChildren() &
Getter of the vector of children.
Definition: tree_base.hpp:1071
Data & getChild(size_t index)
Getter of the child at given index.
Definition: tree_base.hpp:1116
void setChild(const Data &d, PositionIterator it)
Setter of the single child of the node.
Definition: tree_base.hpp:1140
Class extending the map class from the standard library. Original reason is to allow printing of the ...
Definition: map.hpp:48
Class representing wrapper of dynamically allocated object behaving like rvalue reference.
Definition: ptr_value.hpp:40
Implementation of vector storing dynamicaly allocated instances of given type. The class mimicks the ...
Definition: ptr_vector.hpp:44
iterator end() &noexcept
Iterator one past the last element of the values range in the vector.
Definition: ptr_vector.hpp:422
iterator begin() &noexcept
Iterator to the begining of the values range in the vector.
Definition: ptr_vector.hpp:382
void clear() noexcept
Removes all values from the vector.
Definition: ptr_vector.hpp:614
iterator insert(iterator pos, R &&value)
Inserts the value on position given by iterator pos.
Definition: ptr_vector.hpp:775
Class extending the reference wrapper class from the standard library. Original reason is to allow it...
Definition: functional.hpp:108
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
Represents the alternation operator in the regular expression. The node can have 0 to n children in l...
Definition: UnboundedRegExpAlternation.h:44
Represents the concatenation operator in the regular expression. The node can have 0 to n children in...
Definition: UnboundedRegExpConcatenation.h:44
Definition: UnboundedRegExpElement.h:62
Represents the empty expression in the regular expression. The node can't have any children.
Definition: UnboundedRegExpEmpty.h:41
Represents the epsilon expression in the regular expression. The node can't have any children.
Definition: UnboundedRegExpEpsilon.h:41
Represents the iteration operator in the regular expression. The node has exactly one child.
Definition: UnboundedRegExpIteration.h:43
static bool languageContainsEpsilon(const regexp::FormalRegExpElement< SymbolType > ®exp)
Definition: RegExpEpsilon.h:91
static regexp::UnboundedRegExp< SymbolType > optimize(const regexp::UnboundedRegExp< SymbolType > ®exp)
int i
Definition: AllEpsilonClosure.h:118
return res
Definition: MinimizeByPartitioning.h:145
constexpr void retract(Iterator &i, Distance n)
A generalization of pointer arithmetic.
Definition: iterator.hpp:887
ForwardIterator unique(ForwardIterator first, ForwardIterator last)
Shuffles values in a sequece so that consecutive duplicate values are pushed to the front and others ...
Definition: algorithm.hpp:384
reference_mover< T > make_mover(T ¶m)
Move adaptor construction function specialized to lvalue reference parameter.
Definition: iterator.hpp:468
dereferencing_iterator< Iterator > dereferencer(Iterator iter)
Dereferencing adaptor construction function.
Definition: iterator.hpp:815
all_of(T &&...) -> all_of< T... >
constexpr auto visit(Visitor &&vis, Variants &&... vars)
Definition: variant.hpp:42
any_of(T &&...) -> any_of< T... >
Definition: RegExpOptimize.h:22