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

Represents the terminal symbol in the regular tree expression. The number of children must be the same as the arity of the symbol of the node. More...

#include <FormalRTESymbolAlphabet.h>

Inheritance diagram for rte::FormalRTESymbolAlphabet< SymbolType >:
[legend]
Collaboration diagram for rte::FormalRTESymbolAlphabet< SymbolType >:
[legend]

Public Member Functions

 FormalRTESymbolAlphabet (common::ranked_symbol< SymbolType > symbol, ext::ptr_vector< FormalRTEElement< SymbolType > > children)
 Creates a new instance of the symbol node using the actual symbol to represent. More...
 
FormalRTESymbolAlphabet< SymbolType > * clone () const &override
 < SymbolType >::clone ( ) const & More...
 
FormalRTESymbolAlphabet< SymbolType > * clone () &&override
 < SymbolType >::clone ( ) && More...
 
bool testSymbol (const common::ranked_symbol< SymbolType > &symbol) const override
 < SymbolType >::testSymbol ( const common::ranked_symbol < SymbolType > & ) const More...
 
void computeMinimalAlphabet (ext::set< common::ranked_symbol< SymbolType > > &alphabetF, ext::set< common::ranked_symbol< SymbolType > > &alphabetK) const override
 < SymbolType >::computeMinimalAlphabet ( ext::set < common::ranked_symbol < SymbolType > > &, ext::set < common::ranked_symbol < SymbolType > > & ) const More...
 
bool checkAlphabet (const ext::set< common::ranked_symbol< SymbolType > > &alphabetF, const ext::set< common::ranked_symbol< SymbolType > > &alphabetK) const override
 < SymbolType >::checkAlphabet ( const ext::set < common::ranked_symbol < SymbolType > > &, const ext::set < common::ranked_symbol < SymbolType > > & ) const More...
 
const ext::ptr_vector< FormalRTEElement< SymbolType > > & getElements () const
 
const ext::ptr_vector< FormalRTEElement< SymbolType > > & getElements ()
 
const FormalRTEElement< SymbolType > & getElement (size_t index) const
 
FormalRTEElement< SymbolType > & getElement (size_t index)
 
void setElement (size_t index, const FormalRTEElement< SymbolType > &element)
 
void setElement (size_t index, FormalRTEElement< SymbolType > &&element)
 
std::strong_ordering operator<=> (const FormalRTEElement< SymbolType > &other) const override
 < SymbolType >::operator <=> ( const FormalRTEElement < SymbolType > & other ) const; More...
 
std::strong_ordering operator<=> (const FormalRTESymbolAlphabet< SymbolType > &) const
 
bool operator== (const FormalRTEElement< SymbolType > &other) const override
 < SymbolType >::operator == ( const FormalRTEElement < SymbolType > & other ) const; More...
 
bool operator== (const FormalRTESymbolAlphabet< SymbolType > &) const
 
void operator>> (ext::ostream &out) const override
 < FormalRTEElement < SymbolType > >::operator >> ( ext::ostream & ) const More...
 
ext::smart_ptr< FormalRTEElement< DefaultSymbolType > > normalize () &&override
 < SymbolType >::normalize ( ) && More...
 
- Public Member Functions inherited from rte::FormalRTESymbol< SymbolType >
 FormalRTESymbol (common::ranked_symbol< SymbolType > symbol)
 Creates a new instance of the symbol node using the actual symbol to represent. More...
 
const common::ranked_symbol< SymbolType > & getSymbol () const &
 
common::ranked_symbol< SymbolType > && getSymbol () &&
 
- Public Member Functions inherited from ext::VararyNode< FormalRTEElement< SymbolType > >
 VararyNode ()=default
 Default constructor. Sets the vector of children to empty vector. More...
 
 VararyNode (ext::ptr_vector< FormalRTEElement< 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< FormalRTEElement< SymbolType > > & getChildren () &
 Getter of the vector of children. More...
 
const ext::ptr_vector< FormalRTEElement< SymbolType > > & getChildren () const &
 Getter of the vector of children. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > > && getChildren () &&
 Getter of the child nodes. More...
 
void setChildren (ext::ptr_vector< FormalRTEElement< SymbolType > > c)
 Setter of the vector of children. More...
 
FormalRTEElement< SymbolType > & getChild (size_t index)
 Getter of the child at given index. More...
 
const FormalRTEElement< SymbolType > & getChild (size_t index) const
 Getter of the child at given index. More...
 
void setChild (const FormalRTEElement< SymbolType > &d, PositionIterator it)
 Setter of the single child of the node. More...
 
void setChild (FormalRTEElement< SymbolType > &&d, PositionIterator it)
 Setter of the single child of the node. More...
 
void setChild (const FormalRTEElement< SymbolType > &d, size_t index)
 Setter of the single child of the node. More...
 
void setChild (FormalRTEElement< SymbolType > &&d, size_t index)
 Setter of the single child of the node. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > >::reverse_iterator insert (typename ext::ptr_vector< FormalRTEElement< SymbolType > >::reverse_iterator it, const FormalRTEElement< SymbolType > &d)
 Inserts a new child at position specified by iterator. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > >::reverse_iterator insert (typename ext::ptr_vector< FormalRTEElement< SymbolType > >::const_reverse_iterator it, const FormalRTEElement< SymbolType > &d)
 Inserts a new child at position specified by iterator. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > >::iterator insert (typename ext::ptr_vector< FormalRTEElement< SymbolType > >::iterator it, const FormalRTEElement< SymbolType > &d)
 Inserts a new child at position specified by iterator. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > >::iterator insert (typename ext::ptr_vector< FormalRTEElement< SymbolType > >::const_iterator it, const FormalRTEElement< SymbolType > &d)
 Inserts a new child at position specified by iterator. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > >::reverse_iterator insert (typename ext::ptr_vector< FormalRTEElement< SymbolType > >::reverse_iterator it, FormalRTEElement< SymbolType > &&d)
 Inserts a new child at position specified by iterator. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > >::reverse_iterator insert (typename ext::ptr_vector< FormalRTEElement< SymbolType > >::const_reverse_iterator it, FormalRTEElement< SymbolType > &&d)
 Inserts a new child at position specified by iterator. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > >::iterator insert (typename ext::ptr_vector< FormalRTEElement< SymbolType > >::iterator it, FormalRTEElement< SymbolType > &&d)
 Inserts a new child at position specified by iterator. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > >::iterator insert (typename ext::ptr_vector< FormalRTEElement< SymbolType > >::const_iterator it, FormalRTEElement< SymbolType > &&d)
 Inserts a new child at position specified by iterator. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > >::reverse_iterator insert (typename ext::ptr_vector< FormalRTEElement< 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< FormalRTEElement< SymbolType > >::reverse_iterator insert (typename ext::ptr_vector< FormalRTEElement< 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< FormalRTEElement< SymbolType > >::iterator insert (typename ext::ptr_vector< FormalRTEElement< 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< FormalRTEElement< SymbolType > >::iterator insert (typename ext::ptr_vector< FormalRTEElement< SymbolType > >::iterator it, InputIterator first, InputIterator last)
 Inserts a new children from a given range at position specified by iterator. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > >::reverse_iterator erase (typename ext::ptr_vector< FormalRTEElement< SymbolType > >::reverse_iterator it)
 Erases a child specified by an iterator. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > >::reverse_iterator erase (typename ext::ptr_vector< FormalRTEElement< SymbolType > >::const_reverse_iterator it)
 Erases a child specified by an iterator. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > >::iterator erase (typename ext::ptr_vector< FormalRTEElement< SymbolType > >::iterator it)
 Erases a child specified by an iterator. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > >::iterator erase (typename ext::ptr_vector< FormalRTEElement< SymbolType > >::const_iterator it)
 Erases a child specified by an iterator. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > >::reverse_iterator erase (typename ext::ptr_vector< FormalRTEElement< SymbolType > >::reverse_iterator first, typename ext::ptr_vector< FormalRTEElement< SymbolType > >::reverse_iterator last)
 Erases a range of children specified by an iterator. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > >::reverse_iterator erase (typename ext::ptr_vector< FormalRTEElement< SymbolType > >::const_reverse_iterator first, typename ext::ptr_vector< FormalRTEElement< SymbolType > >::const_reverse_iterator last)
 Erases a range of children specified by an iterator. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > >::iterator erase (typename ext::ptr_vector< FormalRTEElement< SymbolType > >::iterator first, typename ext::ptr_vector< FormalRTEElement< SymbolType > >::iterator last)
 Erases a range of children specified by an iterator. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > >::iterator erase (typename ext::ptr_vector< FormalRTEElement< SymbolType > >::const_iterator first, typename ext::ptr_vector< FormalRTEElement< SymbolType > >::const_iterator last)
 Erases a range of children specified by an iterator. More...
 
void clear ()
 Erases all children. More...
 
void pushBackChild (const FormalRTEElement< SymbolType > &d)
 Appends a new child at the end of the child vector. More...
 
void pushBackChild (FormalRTEElement< SymbolType > &&d)
 Appends a new child at the end of the child vector. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > >::iterator begin ()
 Getter of an iterator to the begining of children vector. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > >::const_iterator begin () const
 Getter of an iterator to the begining of children vector. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > >::reverse_iterator rbegin ()
 Getter of an iterator to the begining of children vector. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > >::const_reverse_iterator rbegin () const
 Getter of an iterator to the begining of children vector. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > >::iterator end ()
 Getter of an iterator to the end of children vector. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > >::const_iterator end () const
 Getter of an iterator to the end of children vector. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > >::reverse_iterator rend ()
 Getter of an iterator to the end of children vector. More...
 
ext::ptr_vector< FormalRTEElement< SymbolType > >::const_reverse_iterator rend () const
 Getter of an iterator to the end of children vector. More...
 

Detailed Description

template<class SymbolType>
class rte::FormalRTESymbolAlphabet< SymbolType >

Represents the terminal symbol in the regular tree expression. The number of children must be the same as the arity of the symbol of the node.

The structure is derived from VararyNode, which however does not check the number of children of the node.

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

Template Parameters
SymbolTypeused for the symbol part of the ranked symbol

Constructor & Destructor Documentation

◆ FormalRTESymbolAlphabet()

template<class SymbolType >
rte::FormalRTESymbolAlphabet< SymbolType >::FormalRTESymbolAlphabet ( common::ranked_symbol< SymbolType >  symbol,
ext::ptr_vector< FormalRTEElement< SymbolType > >  children 
)
explicit

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

Parameters
symbolthe value of the represented symbol
Here is the call graph for this function:

Member Function Documentation

◆ checkAlphabet()

template<class SymbolType >
bool rte::FormalRTESymbolAlphabet< SymbolType >::checkAlphabet ( const ext::set< common::ranked_symbol< SymbolType > > &  alphabetF,
const ext::set< common::ranked_symbol< SymbolType > > &  alphabetK 
) const
override

< SymbolType >::checkAlphabet ( const ext::set < common::ranked_symbol < SymbolType > > &, const ext::set < common::ranked_symbol < SymbolType > > & ) const

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

Template Parameters
SymbolTypeused for the symbol part of the ranked symbol < SymbolType >::checkAlphabet ( const ext::set < common::ranked_symbol < SymbolType > > &, const ext::set < common::ranked_symbol < SymbolType > > & ) const
Here is the call graph for this function:

◆ clone() [1/2]

template<class SymbolType >
FormalRTESymbolAlphabet< SymbolType > * rte::FormalRTESymbolAlphabet< SymbolType >::clone ( ) &&
override

< SymbolType >::clone ( ) &&

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

Template Parameters
SymbolTypeused for the symbol part of the ranked symbol < SymbolType >::clone ( ) &&

◆ clone() [2/2]

template<class SymbolType >
FormalRTESymbolAlphabet< SymbolType > * rte::FormalRTESymbolAlphabet< SymbolType >::clone ( ) const &
override

< SymbolType >::clone ( ) const &

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

Template Parameters
SymbolTypeused for the symbol part of the ranked symbol < SymbolType >::clone ( ) const &

◆ computeMinimalAlphabet()

template<class SymbolType >
void rte::FormalRTESymbolAlphabet< SymbolType >::computeMinimalAlphabet ( ext::set< common::ranked_symbol< SymbolType > > &  alphabetF,
ext::set< common::ranked_symbol< SymbolType > > &  alphabetK 
) const
override

< SymbolType >::computeMinimalAlphabet ( ext::set < common::ranked_symbol < SymbolType > > &, ext::set < common::ranked_symbol < SymbolType > > & ) const

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

Template Parameters
SymbolTypeused for the symbol part of the ranked symbol < SymbolType >::computeMinimalAlphabet ( ext::set < common::ranked_symbol < SymbolType > > &, ext::set < common::ranked_symbol < SymbolType > > & ) const
Here is the call graph for this function:

◆ getElement() [1/2]

template<class SymbolType >
FormalRTEElement< SymbolType > & rte::FormalRTESymbolAlphabet< SymbolType >::getElement ( size_t  index)

Getter of child node on n-th position

Returns
child node

◆ getElement() [2/2]

template<class SymbolType >
const FormalRTEElement< SymbolType > & rte::FormalRTESymbolAlphabet< SymbolType >::getElement ( size_t  index) const

Getter of child node on n-th position

Returns
child node

◆ getElements() [1/2]

template<class SymbolType >
const ext::ptr_vector< FormalRTEElement< SymbolType > > & rte::FormalRTESymbolAlphabet< SymbolType >::getElements

Getter of child nodes of the rte node

Returns
child nodes

◆ getElements() [2/2]

template<class SymbolType >
const ext::ptr_vector< FormalRTEElement< SymbolType > > & rte::FormalRTESymbolAlphabet< SymbolType >::getElements

Getter of child nodes of the rte node

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

◆ normalize()

template<class SymbolType >
ext::smart_ptr< FormalRTEElement< DefaultSymbolType > > rte::FormalRTESymbolAlphabet< SymbolType >::normalize ( ) &&
inlineoverride

< SymbolType >::normalize ( ) &&

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

Template Parameters
SymbolTypeused for the symbol part of the ranked symbol < 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 rte::FormalRTESymbolAlphabet< SymbolType >::operator<=> ( const FormalRTEElement< SymbolType > &  other) const
inlineoverride

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

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

Template Parameters
SymbolTypeused for the symbol part of the ranked symbol < SymbolType >::operator <=> ( const FormalRTEElement < SymbolType > & other ) const;

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

template<class SymbolType >
std::strong_ordering rte::FormalRTESymbolAlphabet< SymbolType >::operator<=> ( const FormalRTESymbolAlphabet< 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 rte::FormalRTESymbolAlphabet< SymbolType >::operator== ( const FormalRTEElement< SymbolType > &  other) const
inlineoverride

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

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

Template Parameters
SymbolTypeused for the symbol part of the ranked symbol < SymbolType >::operator == ( const FormalRTEElement < SymbolType > & other ) const;

◆ operator==() [2/2]

template<class SymbolType >
bool rte::FormalRTESymbolAlphabet< SymbolType >::operator== ( const FormalRTESymbolAlphabet< 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 rte::FormalRTESymbolAlphabet< SymbolType >::operator>> ( ext::ostream out) const
override

< FormalRTEElement < SymbolType > >::operator >> ( ext::ostream & ) const

< FormalRTEElement < SymbolType > >::operator >> ( ext::ostream & ) const

◆ setElement() [1/2]

template<class SymbolType >
void rte::FormalRTESymbolAlphabet< SymbolType >::setElement ( size_t  index,
const FormalRTEElement< SymbolType > &  element 
)

Setter of the n-th child

Parameters
indexthe index of child to change
elementthe iterated tree
Here is the call graph for this function:

◆ setElement() [2/2]

template<class SymbolType >
void rte::FormalRTESymbolAlphabet< SymbolType >::setElement ( size_t  index,
FormalRTEElement< SymbolType > &&  element 
)

Setter of the n-th child

Parameters
indexthe index of child to change
elementthe iterated tree

◆ testSymbol()

template<class SymbolType >
bool rte::FormalRTESymbolAlphabet< SymbolType >::testSymbol ( const common::ranked_symbol< SymbolType > &  symbol) const
override

< SymbolType >::testSymbol ( const common::ranked_symbol < SymbolType > & ) const

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

Template Parameters
SymbolTypeused for the symbol part of the ranked symbol < SymbolType >::testSymbol ( const common::ranked_symbol < SymbolType > & ) const

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