Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
Public Member Functions
regexp::FormalRegExpIteration< SymbolType > Class Template Reference

Represents the iteration operator in the regular expression. The node has exactly one child. More...

#include <FormalRegExpIteration.h>

Inheritance diagram for regexp::FormalRegExpIteration< SymbolType >:
[legend]
Collaboration diagram for regexp::FormalRegExpIteration< SymbolType >:
[legend]

Public Member Functions

 FormalRegExpIteration (FormalRegExpElement< SymbolType > &&)
 Creates a new instance of the iteration node with explicit iterated element. More...
 
 FormalRegExpIteration (const FormalRegExpElement< SymbolType > &)
 Creates a new instance of the iteration node with explicit iterated element. More...
 
FormalRegExpIteration< SymbolType > * clone () const &override
 ( ) const & More...
 
FormalRegExpIteration< SymbolType > * clone () &&override
 ( ) const & More...
 
ext::smart_ptr< UnboundedRegExpElement< SymbolType > > asUnbounded () const override
 ( ) const & More...
 
bool testSymbol (const SymbolType &symbol) const override
 
void computeMinimalAlphabet (ext::set< SymbolType > &alphabet) const override
 
bool checkAlphabet (const ext::set< SymbolType > &alphabet) const override
 
const FormalRegExpElement< SymbolType > & getElement () const
 
FormalRegExpElement< SymbolType > & getElement ()
 
void setElement (FormalRegExpElement< SymbolType > &&element)
 
void setElement (const FormalRegExpElement< SymbolType > &element)
 
std::strong_ordering operator<=> (const FormalRegExpElement< SymbolType > &other) const override
 < SymbolType >::operator <=> ( const FormalRegExpElement < SymbolType > & other ) const; More...
 
std::strong_ordering operator<=> (const FormalRegExpIteration< SymbolType > &) const
 
bool operator== (const FormalRegExpElement< SymbolType > &other) const override
 < SymbolType >::operator == ( const FormalRegExpElement < SymbolType > & other ) const; More...
 
bool operator== (const FormalRegExpIteration< SymbolType > &) const
 
void operator>> (ext::ostream &out) const override
 < FormalRegExpElement < SymbolType > >::operator >> ( ext::ostream & ) More...
 
ext::smart_ptr< FormalRegExpElement< DefaultSymbolType > > normalize () &&override
 < SymbolType >::normalize ( ) && More...
 
- Public Member Functions inherited from ext::UnaryNode< FormalRegExpElement< SymbolType > >
 UnaryNode (const FormalRegExpElement< SymbolType > &c)
 Constructor of the class accepting the child node. More...
 
 UnaryNode (FormalRegExpElement< SymbolType > &&c)
 Constructor of the class accepting the child node. More...
 
FormalRegExpElement< SymbolType > & getChild ()
 Getter of the child of the node. More...
 
const FormalRegExpElement< SymbolType > & getChild () const
 Getter of the child of the node. More...
 
void setChild (const FormalRegExpElement< SymbolType > &c)
 Setter of the child of the node. More...
 
void setChild (FormalRegExpElement< SymbolType > &&c)
 Setter of the child of the node. More...
 
- Public Member Functions inherited from ext::AnyaryNode< Data, arity, Base >
 AnyaryNode (ext::ptr_array< Data, arity > c)
 Constructor based on array of child nodes. More...
 
 ~AnyaryNode () noexcept override=default
 Destructor of the class. More...
 
 AnyaryNode (const AnyaryNode &other)
 Copy constructor. More...
 
 AnyaryNode (AnyaryNode &&other) noexcept
 Move constructor. More...
 
AnyaryNodeoperator= (const AnyaryNode &other)
 Copy operator of assignment. More...
 
AnyaryNodeoperator= (AnyaryNode &&other) noexcept
 move operator of assignment. More...
 
const ext::ptr_array< Data, arity > & getChildren () &
 Getter of the child nodes. More...
 
const ext::ptr_array< Data, arity > & getChildren () const &
 Getter of the child nodes. More...
 
ext::ptr_array< Data, arity > && getChildren () &&
 Getter of the child nodes. More...
 
template<size_t N>
const Data & getChild () const
 Getter of the child node based on compile time index. More...
 
template<size_t N>
Data & getChild ()
 Getter of the child node based on compile time index. More...
 
void setChildren (ext::ptr_array< Data, arity > c)
 Setter of the child nodes. More...
 
template<size_t N>
void setChild (const Data &d)
 Setter of the child node based on compile time index. More...
 
template<size_t N>
void setChild (Data &&d)
 Setter of the child node based on compile time index. More...
 
ext::ptr_array< Data, arity >::iterator begin ()
 Getter of an iterator to the begining of children array. More...
 
ext::ptr_array< Data, arity >::const_iterator begin () const
 Getter of an iterator to the begining of children array. More...
 
ext::ptr_array< Data, arity >::iterator end ()
 Getter of an iterator to the end of children array. More...
 
ext::ptr_array< Data, arity >::const_iterator end () const
 Getter of an iterator to the end of children array. More...
 

Detailed Description

template<class SymbolType>
class regexp::FormalRegExpIteration< SymbolType >

Represents the iteration operator in the regular expression. The node has exactly one child.

The structure is derived from UnaryNode that provides the child node and its accessors.

The node can be visited by the FormalRegExpElement < SymbolType >::Visitor

Template Parameters
SymbolTypeused for the terminal alphabet

Constructor & Destructor Documentation

◆ FormalRegExpIteration() [1/2]

template<class SymbolType >
regexp::FormalRegExpIteration< SymbolType >::FormalRegExpIteration ( FormalRegExpElement< SymbolType > &&  element)
explicit

Creates a new instance of the iteration node with explicit iterated element.

Parameters
elementthe iterated element

◆ FormalRegExpIteration() [2/2]

template<class SymbolType >
regexp::FormalRegExpIteration< SymbolType >::FormalRegExpIteration ( const FormalRegExpElement< SymbolType > &  element)
explicit

Creates a new instance of the iteration node with explicit iterated element.

Parameters
elementthe iterated element

Member Function Documentation

◆ asUnbounded()

template<class SymbolType >
ext::smart_ptr< UnboundedRegExpElement< SymbolType > > regexp::FormalRegExpIteration< SymbolType >::asUnbounded
override

( ) const &

( ) const &

◆ checkAlphabet()

template<class SymbolType >
bool regexp::FormalRegExpIteration< SymbolType >::checkAlphabet ( const ext::set< SymbolType > &  alphabet) const
override

Traverses the regexp tree and checks whether all symbols in the regexp tree are in the alphabet

Parameters
alphabet
Returns
true if symbols in the regexp are in the alphabet, false otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ clone() [1/2]

template<class SymbolType >
FormalRegExpIteration< SymbolType > * regexp::FormalRegExpIteration< SymbolType >::clone ( ) &&
override

( ) const &

( ) const &

◆ clone() [2/2]

template<class SymbolType >
FormalRegExpIteration< SymbolType > * regexp::FormalRegExpIteration< SymbolType >::clone ( ) const &
override

( ) const &

( ) const &

◆ computeMinimalAlphabet()

template<class SymbolType >
void regexp::FormalRegExpIteration< SymbolType >::computeMinimalAlphabet ( ext::set< SymbolType > &  alphabet) const
override

Traverses the regexp tree computing minimal alphabet needed by regexp

Parameters
alphabetAll alphabet symbols encountered are added into this set
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getElement() [1/2]

template<class SymbolType >
FormalRegExpElement< SymbolType > & regexp::FormalRegExpIteration< SymbolType >::getElement

Getter of the iterated element

Returns
iterated element

◆ getElement() [2/2]

template<class SymbolType >
const FormalRegExpElement< SymbolType > & regexp::FormalRegExpIteration< SymbolType >::getElement

Getter of the iterated element

Returns
iterated element
Here is the caller graph for this function:

◆ normalize()

template<class SymbolType >
ext::smart_ptr< FormalRegExpElement< DefaultSymbolType > > regexp::FormalRegExpIteration< SymbolType >::normalize ( ) &&
inlineoverride

< SymbolType >::normalize ( ) &&

Abstract class representing element in the formal regular expression. Can be an operator, special node, or a symbol.

Template Parameters
SymbolTypeused for the terminal alphabet < SymbolType >::normalize ( ) &&
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator<=>() [1/2]

template<class SymbolType >
std::strong_ordering regexp::FormalRegExpIteration< SymbolType >::operator<=> ( const FormalRegExpElement< SymbolType > &  other) const
inlineoverride

< SymbolType >::operator <=> ( const FormalRegExpElement < SymbolType > & other ) const;

Abstract class representing element in the formal regular expression. Can be an operator, special node, or a symbol.

Template Parameters
SymbolTypeused for the terminal alphabet < SymbolType >::operator <=> ( const FormalRegExpElement < SymbolType > & other ) const;

◆ operator<=>() [2/2]

template<class SymbolType >
std::strong_ordering regexp::FormalRegExpIteration< SymbolType >::operator<=> ( const FormalRegExpIteration< SymbolType > &  other) const

The three way comparison implementation

Parameters
otherthe other instance
Returns
the ordering between this object and the other.
Here is the call graph for this function:

◆ operator==() [1/2]

template<class SymbolType >
bool regexp::FormalRegExpIteration< SymbolType >::operator== ( const FormalRegExpElement< SymbolType > &  other) const
inlineoverride

< SymbolType >::operator == ( const FormalRegExpElement < SymbolType > & other ) const;

Abstract class representing element in the formal regular expression. Can be an operator, special node, or a symbol.

Template Parameters
SymbolTypeused for the terminal alphabet < SymbolType >::operator == ( const FormalRegExpElement < SymbolType > & other ) const;

◆ operator==() [2/2]

template<class SymbolType >
bool regexp::FormalRegExpIteration< SymbolType >::operator== ( const FormalRegExpIteration< SymbolType > &  other) const

The equality comparison implementation.

Parameters
otherthe other object to compare with.
Returns
true if this and other objects are equal, false othervise
Here is the call graph for this function:

◆ operator>>()

template<class SymbolType >
void regexp::FormalRegExpIteration< SymbolType >::operator>> ( ext::ostream out) const
override

< FormalRegExpElement < SymbolType > >::operator >> ( ext::ostream & )

< FormalRegExpElement < SymbolType > >::operator >> ( ext::ostream & )

◆ setElement() [1/2]

template<class SymbolType >
void regexp::FormalRegExpIteration< SymbolType >::setElement ( const FormalRegExpElement< SymbolType > &  element)

Setter of the iterated element

Parameters
iteratedelement
Here is the call graph for this function:

◆ setElement() [2/2]

template<class SymbolType >
void regexp::FormalRegExpIteration< SymbolType >::setElement ( FormalRegExpElement< SymbolType > &&  element)

Setter of the iterated element

Parameters
iteratedelement

◆ testSymbol()

template<class SymbolType >
bool regexp::FormalRegExpIteration< SymbolType >::testSymbol ( const SymbolType &  symbol) const
override

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: