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

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

#include <FormalRegExpSymbol.h>

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

Public Member Functions

 FormalRegExpSymbol (SymbolType symbol)
 Creates a new instance of the symbol node using the actual symbol to represent. More...
 
FormalRegExpSymbol< SymbolType > * clone () const &override
 ( ) const & More...
 
FormalRegExpSymbol< 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 SymbolType & getSymbol () const &
 
SymbolType && getSymbol () &&
 
std::strong_ordering operator<=> (const FormalRegExpElement< SymbolType > &other) const override
 < SymbolType >::operator <=> ( const FormalRegExpElement < SymbolType > & other ) const; More...
 
std::strong_ordering operator<=> (const FormalRegExpSymbol< SymbolType > &) const
 
bool operator== (const FormalRegExpElement< SymbolType > &other) const override
 < SymbolType >::operator == ( const FormalRegExpElement < SymbolType > & other ) const; More...
 
bool operator== (const FormalRegExpSymbol< 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::NullaryNode< FormalRegExpElement< 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::FormalRegExpSymbol< SymbolType >

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

The structure is derived from NullaryNode disallowing adding any child.

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

Template Parameters
SymbolTypeused for the terminal alphabet

Constructor & Destructor Documentation

◆ FormalRegExpSymbol()

template<class SymbolType >
regexp::FormalRegExpSymbol< SymbolType >::FormalRegExpSymbol ( SymbolType  symbol)
explicit

Creates a new instance of the symbol node using the actual symbol to represent.

Parameters
symbolthe value of the represented symbol

Member Function Documentation

◆ asUnbounded()

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

( ) const &

( ) const &

◆ checkAlphabet()

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

◆ clone() [1/2]

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

( ) const &

( ) const &

◆ clone() [2/2]

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

( ) const &

( ) const &

◆ computeMinimalAlphabet()

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

◆ getSymbol() [1/2]

template<class SymbolType >
SymbolType && regexp::FormalRegExpSymbol< SymbolType >::getSymbol ( ) &&

Getter of the symbol.

Returns
the symbol

◆ getSymbol() [2/2]

template<class SymbolType >
const SymbolType & regexp::FormalRegExpSymbol< SymbolType >::getSymbol ( ) const &

Getter of the symbol.

Returns
the symbol
Here is the caller graph for this function:

◆ normalize()

template<class SymbolType >
ext::smart_ptr< FormalRegExpElement< DefaultSymbolType > > regexp::FormalRegExpSymbol< 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:

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

template<class SymbolType >
std::strong_ordering regexp::FormalRegExpSymbol< 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::FormalRegExpSymbol< SymbolType >::operator<=> ( const FormalRegExpSymbol< SymbolType > &  other) 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::FormalRegExpSymbol< 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::FormalRegExpSymbol< SymbolType >::operator== ( const FormalRegExpSymbol< 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

◆ operator>>()

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

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

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

◆ testSymbol()

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


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