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

Formal regular expression represents regular expression. It describes regular languages. The expression consists of the following nodes: More...

#include <FormalRegExp.h>

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

Public Types

using symbol_type = SymbolType
 

Public Member Functions

 FormalRegExp ()
 Creates a new instance of the expression. The default constructor creates expression describing empty language. More...
 
 FormalRegExp (ext::set< SymbolType > alphabet, FormalRegExpStructure< SymbolType > regExp)
 Creates a new instance of the expression with a concrete alphabet and initial content. More...
 
 FormalRegExp (FormalRegExpStructure< SymbolType > regExp)
 Creates a new instance of the expression based on initial content. The alphabet is derived from the content. More...
 
 FormalRegExp (const UnboundedRegExp< SymbolType > &other)
 Created a new instance of the expression based on the UnboundedRegExp representation. More...
 
const ext::set< SymbolType > & getAlphabet () const &
 
ext::set< SymbolType > && getAlphabet () &&
 
const FormalRegExpStructure< SymbolType > & getRegExp () const &
 
FormalRegExpStructure< SymbolType > && getRegExp () &&
 
void setRegExp (FormalRegExpStructure< SymbolType > param)
 
auto operator<=> (const FormalRegExp &other) const
 
bool operator== (const FormalRegExp &other) const
 
- Public Member Functions inherited from core::Components< FormalRegExp< SymbolType >, ext::set< SymbolType >, component::Set, GeneralAlphabet >
void accessComponent ()
 

Friends

ext::ostreamoperator<< (ext::ostream &out, const FormalRegExp &instance)
 

Additional Inherited Members

- Static Public Member Functions inherited from core::Components< FormalRegExp< SymbolType >, ext::set< SymbolType >, component::Set, GeneralAlphabet >
static void registerComponent ()
 
static void unregisterComponent ()
 

Detailed Description

template<class SymbolType>
class regexp::FormalRegExp< SymbolType >

Formal regular expression represents regular expression. It describes regular languages. The expression consists of the following nodes:

The formal representation allows nodes of concatenation and alternation to have exactly two children.

The structure of the regular expression is wrapped in a structure class to allow separate the alphabet from the structure for example in Extended NFA

Definition is unbounded definition of regular expressions. E = (T, C), T (Alphabet) = finite set of terminal symbols C (Content) = representation of the regular expression

Template Parameters
SymbolTypeused for the terminal alphabet

Member Typedef Documentation

◆ symbol_type

template<class SymbolType >
using regexp::FormalRegExp< SymbolType >::symbol_type = SymbolType

The exposed SymbolType template parameter.

Constructor & Destructor Documentation

◆ FormalRegExp() [1/4]

template<class SymbolType >
regexp::FormalRegExp< SymbolType >::FormalRegExp
explicit

Creates a new instance of the expression. The default constructor creates expression describing empty language.

◆ FormalRegExp() [2/4]

template<class SymbolType >
regexp::FormalRegExp< SymbolType >::FormalRegExp ( ext::set< SymbolType >  alphabet,
FormalRegExpStructure< SymbolType >  regExp 
)
explicit

Creates a new instance of the expression with a concrete alphabet and initial content.

Parameters
alphabetthe initial input alphabet
regExpthe initial regexp content

◆ FormalRegExp() [3/4]

template<class SymbolType >
regexp::FormalRegExp< SymbolType >::FormalRegExp ( FormalRegExpStructure< SymbolType >  regExp)
explicit

Creates a new instance of the expression based on initial content. The alphabet is derived from the content.

Parameters
regExpthe initial regexp content

◆ FormalRegExp() [4/4]

template<class SymbolType >
regexp::FormalRegExp< SymbolType >::FormalRegExp ( const UnboundedRegExp< SymbolType > &  other)
explicit

Created a new instance of the expression based on the UnboundedRegExp representation.

Member Function Documentation

◆ getAlphabet() [1/2]

template<class SymbolType >
ext::set< SymbolType > && regexp::FormalRegExp< SymbolType >::getAlphabet ( ) &&
inline

Getter of the alphabet.

Returns
the alphabet of the expression
Here is the call graph for this function:

◆ getAlphabet() [2/2]

template<class SymbolType >
const ext::set< SymbolType > & regexp::FormalRegExp< SymbolType >::getAlphabet ( ) const &
inline

Getter of the alphabet.

Returns
the alphabet of the expression
Here is the caller graph for this function:

◆ getRegExp() [1/2]

template<class SymbolType >
FormalRegExpStructure< SymbolType > && regexp::FormalRegExp< SymbolType >::getRegExp ( ) &&

Get the structure of the expression.

Returns
the structure of the expression.

◆ getRegExp() [2/2]

template<class SymbolType >
const FormalRegExpStructure< SymbolType > & regexp::FormalRegExp< SymbolType >::getRegExp ( ) const &

Get the structure of the expression.

Returns
the structure of the expression.
Here is the caller graph for this function:

◆ operator<=>()

template<class SymbolType >
auto regexp::FormalRegExp< SymbolType >::operator<=> ( const FormalRegExp< SymbolType > &  other) const
inline

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==()

template<class SymbolType >
bool regexp::FormalRegExp< SymbolType >::operator== ( const FormalRegExp< SymbolType > &  other) const
inline

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:

◆ setRegExp()

template<class SymbolType >
void regexp::FormalRegExp< SymbolType >::setRegExp ( FormalRegExpStructure< SymbolType >  param)

Set the structure of the expression.

Parameters
regExpthe new structure of the expression.

Friends And Related Function Documentation

◆ operator<<

template<class SymbolType >
ext::ostream & operator<< ( ext::ostream out,
const FormalRegExp< SymbolType > &  instance 
)
friend

Print this object as raw representation to ostream.

Parameters
outostream where to print
instanceobject to print
Returns
modified output stream

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