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

Represents the concatenation operator in the regular expression. The node must have exactly two children. More...

#include <FormalRegExpConcatenation.h>

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

Public Member Functions

 FormalRegExpConcatenation (FormalRegExpElement< SymbolType > &&left, FormalRegExpElement< SymbolType > &&right)
 Creates a new instance of the concatenation node with explicit concatenated elements. More...
 
 FormalRegExpConcatenation (const FormalRegExpElement< SymbolType > &left, const FormalRegExpElement< SymbolType > &right)
 Creates a new instance of the concatenation node with explicit concatenated elements. More...
 
FormalRegExpConcatenation< SymbolType > * clone () const &override
 ( ) const & More...
 
FormalRegExpConcatenation< 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 > & getLeftElement () const
 
const FormalRegExpElement< SymbolType > & getRightElement () const
 
FormalRegExpElement< SymbolType > & getLeftElement ()
 
FormalRegExpElement< SymbolType > & getRightElement ()
 
void setLeftElement (FormalRegExpElement< SymbolType > &&element)
 
void setLeftElement (const FormalRegExpElement< SymbolType > &element)
 
void setRightElement (FormalRegExpElement< SymbolType > &&element)
 
void setRightElement (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 FormalRegExpConcatenation< SymbolType > &) const
 
bool operator== (const FormalRegExpElement< SymbolType > &other) const override
 < SymbolType >::operator == ( const FormalRegExpElement < SymbolType > & other ) const; More...
 
bool operator== (const FormalRegExpConcatenation< 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::BinaryNode< FormalRegExpElement< SymbolType > >
 BinaryNode (const FormalRegExpElement< SymbolType > &l, const FormalRegExpElement< SymbolType > &r)
 Constructor of the class accepting the two child nodes. More...
 
 BinaryNode (FormalRegExpElement< SymbolType > &&l, FormalRegExpElement< SymbolType > &&r)
 Constructor of the class accepting the two child nodes. More...
 
FormalRegExpElement< SymbolType > & getLeft ()
 Getter of the first child of the node. More...
 
const FormalRegExpElement< SymbolType > & getLeft () const
 Getter of the first child of the node. More...
 
void setLeft (const FormalRegExpElement< SymbolType > &l)
 Setter of the first child of the node. More...
 
void setLeft (FormalRegExpElement< SymbolType > &&l)
 Setter of the first child of the node. More...
 
FormalRegExpElement< SymbolType > & getRight ()
 Getter of the second child of the node. More...
 
const FormalRegExpElement< SymbolType > & getRight () const
 Getter of the second child of the node. More...
 
void setRight (const FormalRegExpElement< SymbolType > &r)
 Setter of the second child of the node. More...
 
void setRight (FormalRegExpElement< SymbolType > &&r)
 Setter of the second 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::FormalRegExpConcatenation< SymbolType >

Represents the concatenation operator in the regular expression. The node must have exactly two children.

The structure is derived from BinaryNode that provides the children accessors.

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

Template Parameters
SymbolTypeused for the terminal alphabet

Constructor & Destructor Documentation

◆ FormalRegExpConcatenation() [1/2]

template<class SymbolType >
regexp::FormalRegExpConcatenation< SymbolType >::FormalRegExpConcatenation ( FormalRegExpElement< SymbolType > &&  left,
FormalRegExpElement< SymbolType > &&  right 
)
explicit

Creates a new instance of the concatenation node with explicit concatenated elements.

Parameters
leftthe first concatenated element
rightthe second concatenated element

◆ FormalRegExpConcatenation() [2/2]

template<class SymbolType >
regexp::FormalRegExpConcatenation< SymbolType >::FormalRegExpConcatenation ( const FormalRegExpElement< SymbolType > &  left,
const FormalRegExpElement< SymbolType > &  right 
)
explicit

Creates a new instance of the concatenation node with explicit concatenated elements.

Parameters
leftthe first concatenated element
rightthe second concatenated element

Member Function Documentation

◆ asUnbounded()

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

( ) const &

( ) const &

◆ checkAlphabet()

template<class SymbolType >
bool regexp::FormalRegExpConcatenation< 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 >
FormalRegExpConcatenation< SymbolType > * regexp::FormalRegExpConcatenation< SymbolType >::clone ( ) &&
override

( ) const &

( ) const &

◆ clone() [2/2]

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

( ) const &

( ) const &

◆ computeMinimalAlphabet()

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

◆ getLeftElement() [1/2]

template<class SymbolType >
FormalRegExpElement< SymbolType > & regexp::FormalRegExpConcatenation< SymbolType >::getLeftElement

Getter of the left alternated element

Returns
left alternated element

◆ getLeftElement() [2/2]

template<class SymbolType >
const FormalRegExpElement< SymbolType > & regexp::FormalRegExpConcatenation< SymbolType >::getLeftElement

Getter of the left alternated element

Returns
left alternated element
Here is the caller graph for this function:

◆ getRightElement() [1/2]

template<class SymbolType >
FormalRegExpElement< SymbolType > & regexp::FormalRegExpConcatenation< SymbolType >::getRightElement

Getter of the right alternated element

Returns
right alternated element

◆ getRightElement() [2/2]

template<class SymbolType >
const FormalRegExpElement< SymbolType > & regexp::FormalRegExpConcatenation< SymbolType >::getRightElement

Getter of the right alternated element

Returns
right alternated element
Here is the caller graph for this function:

◆ normalize()

template<class SymbolType >
ext::smart_ptr< FormalRegExpElement< DefaultSymbolType > > regexp::FormalRegExpConcatenation< 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::FormalRegExpConcatenation< SymbolType >::operator<=> ( const FormalRegExpConcatenation< 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::FormalRegExpConcatenation< 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==() [1/2]

template<class SymbolType >
bool regexp::FormalRegExpConcatenation< SymbolType >::operator== ( const FormalRegExpConcatenation< 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::FormalRegExpConcatenation< 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>>()

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

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

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

◆ setLeftElement() [1/2]

template<class SymbolType >
void regexp::FormalRegExpConcatenation< SymbolType >::setLeftElement ( const FormalRegExpElement< SymbolType > &  element)

Setter of the left alternated element

Parameters
elementleft alternated element
Here is the call graph for this function:

◆ setLeftElement() [2/2]

template<class SymbolType >
void regexp::FormalRegExpConcatenation< SymbolType >::setLeftElement ( FormalRegExpElement< SymbolType > &&  element)

Setter of the left alternated element

Parameters
elementleft alternated element

◆ setRightElement() [1/2]

template<class SymbolType >
void regexp::FormalRegExpConcatenation< SymbolType >::setRightElement ( const FormalRegExpElement< SymbolType > &  element)

Setter of the right alternated element

Parameters
elementright alternated element
Here is the call graph for this function:

◆ setRightElement() [2/2]

template<class SymbolType >
void regexp::FormalRegExpConcatenation< SymbolType >::setRightElement ( FormalRegExpElement< SymbolType > &&  element)

Setter of the right alternated element

Parameters
elementright alternated element

◆ testSymbol()

template<class SymbolType >
bool regexp::FormalRegExpConcatenation< 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 file: