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

Represents the epsilon expression in the regular expression. The node can't have any children. More...

#include <UnboundedRegExpEpsilon.h>

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

Public Member Functions

 UnboundedRegExpEpsilon ()=default
 Creates a new instance of the epsilon node. More...
 
UnboundedRegExpEpsilon< SymbolType > * clone () const &override
 ( ) const & More...
 
UnboundedRegExpEpsilon< 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
 
std::strong_ordering operator<=> (const UnboundedRegExpElement< SymbolType > &other) const override
 < SymbolType >::operator <=> ( const UnboundedRegExpElement < SymbolType > & other ) const; More...
 
std::strong_ordering operator<=> (const UnboundedRegExpEpsilon< SymbolType > &) const
 
bool operator== (const UnboundedRegExpElement< SymbolType > &other) const override
 < SymbolType >::operator == ( const UnboundedRegExpElement < SymbolType > & other ) const; More...
 
bool operator== (const UnboundedRegExpEpsilon< 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::NullaryNode< UnboundedRegExpElement< SymbolType > >
 NullaryNode ()
 The default constructor of the class. 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::UnboundedRegExpEpsilon< SymbolType >

Represents the epsilon expression in the regular expression. The node can't have any children.

The structure is derived from NullaryNode disallowing adding any child.

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

Template Parameters
SymbolTypeused for the terminal alphabet

Constructor & Destructor Documentation

◆ UnboundedRegExpEpsilon()

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

Creates a new instance of the epsilon node.

Member Function Documentation

◆ asFormal()

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

◆ checkAlphabet()

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

( ) const &

( ) const &

◆ clone() [2/2]

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

( ) const &

( ) const &

◆ computeMinimalAlphabet()

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

◆ normalize()

template<class SymbolType >
ext::smart_ptr< UnboundedRegExpElement< DefaultSymbolType > > regexp::UnboundedRegExpEpsilon< 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 ( ) &&

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

template<class SymbolType >
std::strong_ordering regexp::UnboundedRegExpEpsilon< 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<=>() [2/2]

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

The three way comparison implementation

Parameters
otherthe other instance
Returns
the ordering between this object and the other.

◆ operator==() [1/2]

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

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

The equality comparison implementation.

Parameters
otherthe other object to compare with.
Returns
true if this and other objects are equal, false othervise

◆ operator>>()

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

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

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

◆ testSymbol()

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


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