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

Represents the alternation operator in the regular expression. The node can have 0 to n children in list of UnboundedRegExpElement as operands of the alternation. More...

#include <UnboundedRegExpAlternation.h>

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

Public Member Functions

 UnboundedRegExpAlternation ()=default
 Creates a new instance of the alternation node. By default it is semantically equivalent to empty regular expression. More...
 
UnboundedRegExpAlternation< SymbolType > * clone () const &override
 ( ) const & More...
 
UnboundedRegExpAlternation< SymbolType > * clone () &&override
 ( ) const & More...
 
ext::smart_ptr< FormalRegExpElement< SymbolType > > asFormal () const override
 
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 ext::ptr_vector< UnboundedRegExpElement< SymbolType > > & getElements () const
 
const ext::ptr_vector< UnboundedRegExpElement< SymbolType > > & getElements ()
 
void appendElement (UnboundedRegExpElement< SymbolType > &&element)
 
void appendElement (const UnboundedRegExpElement< SymbolType > &element)
 
std::strong_ordering operator<=> (const UnboundedRegExpElement< SymbolType > &other) const override
 < SymbolType >::operator <=> ( const UnboundedRegExpElement < SymbolType > & other ) const; More...
 
std::strong_ordering operator<=> (const UnboundedRegExpAlternation< SymbolType > &) const
 
bool operator== (const UnboundedRegExpElement< SymbolType > &other) const override
 < SymbolType >::operator == ( const UnboundedRegExpElement < SymbolType > & other ) const; More...
 
bool operator== (const UnboundedRegExpAlternation< SymbolType > &) const
 
void operator>> (ext::ostream &out) const override
 < UnboundedRegExpElement < SymbolType > >::operator >> ( ext::ostream & ) More...
 
ext::smart_ptr< UnboundedRegExpElement< DefaultSymbolType > > normalize () &&override
 < SymbolType >::normalize ( ) && More...
 
- Public Member Functions inherited from ext::VararyNode< UnboundedRegExpElement< SymbolType > >
 VararyNode ()=default
 Default constructor. Sets the vector of children to empty vector. More...
 
 VararyNode (ext::ptr_vector< UnboundedRegExpElement< SymbolType > > c)
 Constructor from vector of child nodes. More...
 
 VararyNode (const VararyNode &other)
 Copy constructor of the class. More...
 
 VararyNode (VararyNode &&other) noexcept
 Move constructor of the class. More...
 
 ~VararyNode () noexcept override=default
 Destructor of the class. More...
 
VararyNodeoperator= (const VararyNode &other)
 Copy operator of assignment. More...
 
VararyNodeoperator= (VararyNode &&other) noexcept
 Move operator of assignment. More...
 
const ext::ptr_vector< UnboundedRegExpElement< SymbolType > > & getChildren () &
 Getter of the vector of children. More...
 
const ext::ptr_vector< UnboundedRegExpElement< SymbolType > > & getChildren () const &
 Getter of the vector of children. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > > && getChildren () &&
 Getter of the child nodes. More...
 
void setChildren (ext::ptr_vector< UnboundedRegExpElement< SymbolType > > c)
 Setter of the vector of children. More...
 
UnboundedRegExpElement< SymbolType > & getChild (size_t index)
 Getter of the child at given index. More...
 
const UnboundedRegExpElement< SymbolType > & getChild (size_t index) const
 Getter of the child at given index. More...
 
void setChild (const UnboundedRegExpElement< SymbolType > &d, PositionIterator it)
 Setter of the single child of the node. More...
 
void setChild (UnboundedRegExpElement< SymbolType > &&d, PositionIterator it)
 Setter of the single child of the node. More...
 
void setChild (const UnboundedRegExpElement< SymbolType > &d, size_t index)
 Setter of the single child of the node. More...
 
void setChild (UnboundedRegExpElement< SymbolType > &&d, size_t index)
 Setter of the single child of the node. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::reverse_iterator insert (typename ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::reverse_iterator it, const UnboundedRegExpElement< SymbolType > &d)
 Inserts a new child at position specified by iterator. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::reverse_iterator insert (typename ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::const_reverse_iterator it, const UnboundedRegExpElement< SymbolType > &d)
 Inserts a new child at position specified by iterator. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::iterator insert (typename ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::iterator it, const UnboundedRegExpElement< SymbolType > &d)
 Inserts a new child at position specified by iterator. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::iterator insert (typename ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::const_iterator it, const UnboundedRegExpElement< SymbolType > &d)
 Inserts a new child at position specified by iterator. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::reverse_iterator insert (typename ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::reverse_iterator it, UnboundedRegExpElement< SymbolType > &&d)
 Inserts a new child at position specified by iterator. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::reverse_iterator insert (typename ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::const_reverse_iterator it, UnboundedRegExpElement< SymbolType > &&d)
 Inserts a new child at position specified by iterator. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::iterator insert (typename ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::iterator it, UnboundedRegExpElement< SymbolType > &&d)
 Inserts a new child at position specified by iterator. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::iterator insert (typename ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::const_iterator it, UnboundedRegExpElement< SymbolType > &&d)
 Inserts a new child at position specified by iterator. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::reverse_iterator insert (typename ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::const_reverse_iterator it, InputIterator first, InputIterator last)
 Inserts a new children from a given range at position specified by iterator. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::reverse_iterator insert (typename ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::reverse_iterator it, InputIterator first, InputIterator last)
 Inserts a new children from a given range at position specified by iterator. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::iterator insert (typename ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::const_iterator it, InputIterator first, InputIterator last)
 Inserts a new children from a given range at position specified by iterator. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::iterator insert (typename ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::iterator it, InputIterator first, InputIterator last)
 Inserts a new children from a given range at position specified by iterator. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::reverse_iterator erase (typename ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::reverse_iterator it)
 Erases a child specified by an iterator. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::reverse_iterator erase (typename ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::const_reverse_iterator it)
 Erases a child specified by an iterator. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::iterator erase (typename ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::iterator it)
 Erases a child specified by an iterator. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::iterator erase (typename ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::const_iterator it)
 Erases a child specified by an iterator. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::reverse_iterator erase (typename ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::reverse_iterator first, typename ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::reverse_iterator last)
 Erases a range of children specified by an iterator. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::reverse_iterator erase (typename ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::const_reverse_iterator first, typename ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::const_reverse_iterator last)
 Erases a range of children specified by an iterator. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::iterator erase (typename ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::iterator first, typename ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::iterator last)
 Erases a range of children specified by an iterator. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::iterator erase (typename ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::const_iterator first, typename ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::const_iterator last)
 Erases a range of children specified by an iterator. More...
 
void clear ()
 Erases all children. More...
 
void pushBackChild (const UnboundedRegExpElement< SymbolType > &d)
 Appends a new child at the end of the child vector. More...
 
void pushBackChild (UnboundedRegExpElement< SymbolType > &&d)
 Appends a new child at the end of the child vector. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::iterator begin ()
 Getter of an iterator to the begining of children vector. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::const_iterator begin () const
 Getter of an iterator to the begining of children vector. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::reverse_iterator rbegin ()
 Getter of an iterator to the begining of children vector. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::const_reverse_iterator rbegin () const
 Getter of an iterator to the begining of children vector. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::iterator end ()
 Getter of an iterator to the end of children vector. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::const_iterator end () const
 Getter of an iterator to the end of children vector. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::reverse_iterator rend ()
 Getter of an iterator to the end of children vector. More...
 
ext::ptr_vector< UnboundedRegExpElement< SymbolType > >::const_reverse_iterator rend () const
 Getter of an iterator to the end of children vector. More...
 

Detailed Description

template<class SymbolType>
class regexp::UnboundedRegExpAlternation< SymbolType >

Represents the alternation operator in the regular expression. The node can have 0 to n children in list of UnboundedRegExpElement as operands of the alternation.

The structure is derived from VararyNode that provides the children list and its accessors.

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

Template Parameters
SymbolTypeused for the terminal alphabet

Constructor & Destructor Documentation

◆ UnboundedRegExpAlternation()

template<class SymbolType >
regexp::UnboundedRegExpAlternation< SymbolType >::UnboundedRegExpAlternation ( )
explicitdefault

Creates a new instance of the alternation node. By default it is semantically equivalent to empty regular expression.

Member Function Documentation

◆ appendElement() [1/2]

template<class SymbolType >
void regexp::UnboundedRegExpAlternation< SymbolType >::appendElement ( const UnboundedRegExpElement< SymbolType > &  element)

Node appending method. The node is added to the current list of nodes.

Parameters
appendednode
Here is the call graph for this function:

◆ appendElement() [2/2]

template<class SymbolType >
void regexp::UnboundedRegExpAlternation< SymbolType >::appendElement ( UnboundedRegExpElement< SymbolType > &&  element)

Node appending method. The node is added to the current list of nodes.

Parameters
appendednode
Here is the caller graph for this function:

◆ asFormal()

template<class SymbolType >
ext::smart_ptr< FormalRegExpElement< SymbolType > > regexp::UnboundedRegExpAlternation< SymbolType >::asFormal
override

◆ checkAlphabet()

template<class SymbolType >
bool regexp::UnboundedRegExpAlternation< 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
alphabetalphabet to check against
Returns
true if symbols in the regexp are in the alphabet, false otherwise

◆ clone() [1/2]

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

( ) const &

( ) const &

◆ clone() [2/2]

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

( ) const &

( ) const &

◆ computeMinimalAlphabet()

template<class SymbolType >
void regexp::UnboundedRegExpAlternation< 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:

◆ getElements() [1/2]

template<class SymbolType >
const ext::ptr_vector< UnboundedRegExpElement< SymbolType > > & regexp::UnboundedRegExpAlternation< SymbolType >::getElements

Getter of child nodes of the regexp node

Returns
child nodes

◆ getElements() [2/2]

template<class SymbolType >
const ext::ptr_vector< UnboundedRegExpElement< SymbolType > > & regexp::UnboundedRegExpAlternation< SymbolType >::getElements

Getter of child nodes of the regexp node

Returns
child nodes
Here is the caller graph for this function:

◆ normalize()

template<class SymbolType >
ext::smart_ptr< UnboundedRegExpElement< DefaultSymbolType > > regexp::UnboundedRegExpAlternation< SymbolType >::normalize ( ) &&
inlineoverride

< SymbolType >::normalize ( ) &&

Abstract class representing element in the unbounded 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::UnboundedRegExpAlternation< SymbolType >::operator<=> ( const UnboundedRegExpAlternation< 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<=>() [2/2]

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

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

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

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

◆ operator==() [1/2]

template<class SymbolType >
bool regexp::UnboundedRegExpAlternation< SymbolType >::operator== ( const UnboundedRegExpAlternation< 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==() [2/2]

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

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

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

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

◆ operator>>()

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

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

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

◆ testSymbol()

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


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