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

Represents formal regular expression structure. Regular expression is stored as a tree of FormalRegExpElements. More...

#include <FormalRegExpStructure.h>

Public Member Functions

 FormalRegExpStructure ()
 Creates a new instance of the expression structure. Defaultly created structure is empty expression. More...
 
 FormalRegExpStructure (FormalRegExpElement< SymbolType > &&structure)
 Creates a new instance of the expression structure. The new instance contains structure as provided by the parameter. More...
 
 FormalRegExpStructure (const FormalRegExpElement< SymbolType > &structure)
 Creates a new instance of the expression structure. The new instance contains structure as provided by the parameter. More...
 
 FormalRegExpStructure (const UnboundedRegExpStructure< SymbolType > &other)
 Creates a new instance based on unbounded representation. The new instance contains structure converted to formal representation. More...
 
const FormalRegExpElement< SymbolType > & getStructure () const
 
FormalRegExpElement< SymbolType > & getStructure ()
 
void setStructure (FormalRegExpElement< SymbolType > &&param)
 
void setStructure (const FormalRegExpElement< SymbolType > &structure)
 
FormalRegExpStructure< DefaultSymbolTypenormalize () &&
 Performs the type normalization of the regexp structure. More...
 

Friends

ext::ostreamoperator<< (ext::ostream &out, const FormalRegExpStructure< SymbolType > &structure)
 Strucuture printer to the stream. More...
 
bool operator<=> (const FormalRegExpStructure< SymbolType > &first, const FormalRegExpStructure< SymbolType > &second)
 Three way comparison operator implementation for the expression structure. More...
 
bool operator== (const FormalRegExpStructure< SymbolType > &first, const FormalRegExpStructure< SymbolType > &second)
 Equality operator implementation for the expression structure. More...
 

Detailed Description

template<class SymbolType>
class regexp::FormalRegExpStructure< SymbolType >

Represents formal regular expression structure. Regular expression is stored as a tree of FormalRegExpElements.

Template Parameters
SymbolTypeused for the terminal alphabet

Constructor & Destructor Documentation

◆ FormalRegExpStructure() [1/4]

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

Creates a new instance of the expression structure. Defaultly created structure is empty expression.

◆ FormalRegExpStructure() [2/4]

template<class SymbolType >
regexp::FormalRegExpStructure< SymbolType >::FormalRegExpStructure ( FormalRegExpElement< SymbolType > &&  structure)
explicit

Creates a new instance of the expression structure. The new instance contains structure as provided by the parameter.

Parameters
structurethe expression structure.

◆ FormalRegExpStructure() [3/4]

template<class SymbolType >
regexp::FormalRegExpStructure< SymbolType >::FormalRegExpStructure ( const FormalRegExpElement< SymbolType > &  structure)
explicit

Creates a new instance of the expression structure. The new instance contains structure as provided by the parameter.

Parameters
structurethe expression structure.

◆ FormalRegExpStructure() [4/4]

template<class SymbolType >
regexp::FormalRegExpStructure< SymbolType >::FormalRegExpStructure ( const UnboundedRegExpStructure< SymbolType > &  other)
explicit

Creates a new instance based on unbounded representation. The new instance contains structure converted to formal representation.

Parameters
otherthe structure in unbounded representation

Member Function Documentation

◆ getStructure() [1/2]

template<class SymbolType >
FormalRegExpElement< SymbolType > & regexp::FormalRegExpStructure< SymbolType >::getStructure

Getter of the root of the structure.

Returns
Root node of the formal regular expression tree

◆ getStructure() [2/2]

template<class SymbolType >
const FormalRegExpElement< SymbolType > & regexp::FormalRegExpStructure< SymbolType >::getStructure

Getter of the root of the structure.

Returns
Root node of the formal regular expression tree
Here is the caller graph for this function:

◆ normalize()

template<class SymbolType >
FormalRegExpStructure< DefaultSymbolType > regexp::FormalRegExpStructure< SymbolType >::normalize ( ) &&
inline

Performs the type normalization of the regexp structure.

Returns
the normalized structure
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setStructure() [1/2]

template<class SymbolType >
void regexp::FormalRegExpStructure< SymbolType >::setStructure ( const FormalRegExpElement< SymbolType > &  structure)

Sets the root node of the expression structure

Parameters
structurenew root node of the structure
Here is the call graph for this function:

◆ setStructure() [2/2]

template<class SymbolType >
void regexp::FormalRegExpStructure< SymbolType >::setStructure ( FormalRegExpElement< SymbolType > &&  param)

Sets the root node of the expression structure

Parameters
structurenew root node of the structure

Friends And Related Function Documentation

◆ operator<<

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

Strucuture printer to the stream.

Parameters
outthe output stream
structurethe structure to print

◆ operator<=>

template<class SymbolType >
bool operator<=> ( const FormalRegExpStructure< SymbolType > &  first,
const FormalRegExpStructure< SymbolType > &  second 
)
friend

Three way comparison operator implementation for the expression structure.

Parameters
firstthe first instance
secondthe second instance
Returns
the strong ordering between the the first and the second parameter

◆ operator==

template<class SymbolType >
bool operator== ( const FormalRegExpStructure< SymbolType > &  first,
const FormalRegExpStructure< SymbolType > &  second 
)
friend

Equality operator implementation for the expression structure.

Parameters
firstthe first instance
secondthe second instance
Returns
true if the first is equal to the second, false otherwise

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