Skip to content
Snippets Groups Projects
Commit 8422e225 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

user documentation of regexp transformation algos

parent b6993577
No related branches found
No related tags found
No related merge requests found
Pipeline #37566 failed
...@@ -10,7 +10,18 @@ ...@@ -10,7 +10,18 @@
   
namespace regexp { namespace regexp {
   
auto RegExpAlternateFormalRegExp = registration::AbstractRegister < RegExpAlternate, regexp::FormalRegExp < >, const regexp::FormalRegExp < > &, const regexp::FormalRegExp < > & > ( RegExpAlternate::alternate ); auto RegExpAlternateFormalRegExp = registration::AbstractRegister < RegExpAlternate, regexp::FormalRegExp < >, const regexp::FormalRegExp < > &, const regexp::FormalRegExp < > & > ( RegExpAlternate::alternate, "first", "second" ).setDocumentation (
auto RegExpAlternateUnboundedRegExp = registration::AbstractRegister < RegExpAlternate, regexp::UnboundedRegExp < >, const regexp::UnboundedRegExp < > &, const regexp::UnboundedRegExp < > & > ( RegExpAlternate::alternate ); "Implements alternation of two regular expressions.\n\
\n\
@param first the first regexp to alternate\n\
@param second the second regexp to alternate\n\
@return regexp describing first + second" );
auto RegExpAlternateUnboundedRegExp = registration::AbstractRegister < RegExpAlternate, regexp::UnboundedRegExp < >, const regexp::UnboundedRegExp < > &, const regexp::UnboundedRegExp < > & > ( RegExpAlternate::alternate, "first", "second" ).setDocumentation (
"Implements alternation of two regular expressions.\n\
\n\
@param first the first regexp to alternate\n\
@param second the second regexp to alternate\n\
@return regexp describing first + second" );
   
} /* namespace regexp */ } /* namespace regexp */
...@@ -17,17 +17,39 @@ ...@@ -17,17 +17,39 @@
namespace regexp { namespace regexp {
   
/** /**
* Alternates two regexpses * Implements alternation of two regular expressions.
* *
*/ */
class RegExpAlternate { class RegExpAlternate {
public: public:
/**
* Implements alternation of two regular expressions.
*
* \tparam SymbolType the type of symbols in the regular expression
*
* \param first the first regexp to alternate
* \param second the second regexp to alternate
*
* \return regexp describing @p first + @p second
*/
template < class SymbolType > template < class SymbolType >
static regexp::FormalRegExp < SymbolType > alternate(const regexp::FormalRegExp < SymbolType > & first, const regexp::FormalRegExp < SymbolType > & second); static regexp::FormalRegExp < SymbolType > alternate(const regexp::FormalRegExp < SymbolType > & first, const regexp::FormalRegExp < SymbolType > & second);
/**
* \override
*/
template < class SymbolType > template < class SymbolType >
static regexp::FormalRegExpStructure < SymbolType > alternate(const regexp::FormalRegExpStructure < SymbolType > & first, const regexp::FormalRegExpStructure < SymbolType > & second); static regexp::FormalRegExpStructure < SymbolType > alternate(const regexp::FormalRegExpStructure < SymbolType > & first, const regexp::FormalRegExpStructure < SymbolType > & second);
/**
* \override
*/
template < class SymbolType > template < class SymbolType >
static regexp::UnboundedRegExp < SymbolType > alternate(const regexp::UnboundedRegExp < SymbolType > & first, const regexp::UnboundedRegExp < SymbolType > & second); static regexp::UnboundedRegExp < SymbolType > alternate(const regexp::UnboundedRegExp < SymbolType > & first, const regexp::UnboundedRegExp < SymbolType > & second);
/**
* \override
*/
template < class SymbolType > template < class SymbolType >
static regexp::UnboundedRegExpStructure < SymbolType > alternate(const regexp::UnboundedRegExpStructure < SymbolType > & first, const regexp::UnboundedRegExpStructure < SymbolType > & second); static regexp::UnboundedRegExpStructure < SymbolType > alternate(const regexp::UnboundedRegExpStructure < SymbolType > & first, const regexp::UnboundedRegExpStructure < SymbolType > & second);
}; };
......
...@@ -10,7 +10,18 @@ ...@@ -10,7 +10,18 @@
   
namespace regexp { namespace regexp {
   
auto RegExpConcatenateFormalRegExp = registration::AbstractRegister < RegExpConcatenate, regexp::FormalRegExp < >, const regexp::FormalRegExp < > &, const regexp::FormalRegExp < > & > ( RegExpConcatenate::concatenate ); auto RegExpConcatenateFormalRegExp = registration::AbstractRegister < RegExpConcatenate, regexp::FormalRegExp < >, const regexp::FormalRegExp < > &, const regexp::FormalRegExp < > & > ( RegExpConcatenate::concatenate, "first", "second" ).setDocumentation (
auto RegExpConcatenateUnboundedRegExp = registration::AbstractRegister < RegExpConcatenate, regexp::UnboundedRegExp < >, const regexp::UnboundedRegExp < > &, const regexp::UnboundedRegExp < > & > ( RegExpConcatenate::concatenate ); "Implements concatenation of two regular expressions.\n\
\n\
@param first the first regexp to concatenate\n\
@param second the second regexp to concatenate\n\
@return regexp describing first . second" );
auto RegExpConcatenateUnboundedRegExp = registration::AbstractRegister < RegExpConcatenate, regexp::UnboundedRegExp < >, const regexp::UnboundedRegExp < > &, const regexp::UnboundedRegExp < > & > ( RegExpConcatenate::concatenate, "first", "second" ).setDocumentation (
"Implements concatenation of two regular expressions.\n\
\n\
@param first the first regexp to concatenate\n\
@param second the second regexp to concatenate\n\
@return regexp describing first . second" );
   
} /* namespace regexp */ } /* namespace regexp */
...@@ -17,17 +17,39 @@ ...@@ -17,17 +17,39 @@
namespace regexp { namespace regexp {
   
/** /**
* Concatenates two regexpses * Implements concatenation of two regular expressions.
* *
*/ */
class RegExpConcatenate { class RegExpConcatenate {
public: public:
/**
* Implements concatenation of two regular expressions.
*
* \tparam SymbolType the type of symbols in the regular expression
*
* \param first the first regexp to concatenate
* \param second the second regexp to concatenate
*
* \return regexp describing @p first . @p second
*/
template < class SymbolType > template < class SymbolType >
static regexp::FormalRegExp < SymbolType > concatenate(const regexp::FormalRegExp < SymbolType > & first, const regexp::FormalRegExp < SymbolType > & second); static regexp::FormalRegExp < SymbolType > concatenate(const regexp::FormalRegExp < SymbolType > & first, const regexp::FormalRegExp < SymbolType > & second);
/**
* \override
*/
template < class SymbolType > template < class SymbolType >
static regexp::FormalRegExpStructure < SymbolType > concatenate(const regexp::FormalRegExpStructure < SymbolType > & first, const regexp::FormalRegExpStructure < SymbolType > & second); static regexp::FormalRegExpStructure < SymbolType > concatenate(const regexp::FormalRegExpStructure < SymbolType > & first, const regexp::FormalRegExpStructure < SymbolType > & second);
/**
* \override
*/
template < class SymbolType > template < class SymbolType >
static regexp::UnboundedRegExp < SymbolType > concatenate(const regexp::UnboundedRegExp < SymbolType > & first, const regexp::UnboundedRegExp < SymbolType > & second); static regexp::UnboundedRegExp < SymbolType > concatenate(const regexp::UnboundedRegExp < SymbolType > & first, const regexp::UnboundedRegExp < SymbolType > & second);
/**
* \override
*/
template < class SymbolType > template < class SymbolType >
static regexp::UnboundedRegExpStructure < SymbolType > concatenate(const regexp::UnboundedRegExpStructure < SymbolType > & first, const regexp::UnboundedRegExpStructure < SymbolType > & second); static regexp::UnboundedRegExpStructure < SymbolType > concatenate(const regexp::UnboundedRegExpStructure < SymbolType > & first, const regexp::UnboundedRegExpStructure < SymbolType > & second);
}; };
......
...@@ -10,10 +10,32 @@ ...@@ -10,10 +10,32 @@
   
namespace regexp { namespace regexp {
   
auto RegExpDerivationFormalRegExpString = registration::AbstractRegister < RegExpDerivation, regexp::FormalRegExp < >, const regexp::FormalRegExp < > &, const string::LinearString < > & > ( RegExpDerivation::derivation ); auto RegExpDerivationFormalRegExpString = registration::AbstractRegister < RegExpDerivation, regexp::FormalRegExp < >, const regexp::FormalRegExp < > &, const string::LinearString < > & > ( RegExpDerivation::derivation, "regexp", "string" ).setDocumentation (
auto RegExpDerivationUnboundedRegExpString = registration::AbstractRegister < RegExpDerivation, regexp::UnboundedRegExp < >, const regexp::UnboundedRegExp < > &, const string::LinearString < > & > ( RegExpDerivation::derivation ); "Implements derivation of regular expression by a symbol sequence.\n\
\n\
@param regexp the regexp to derivate\n\
@param string the sequence of symbols to derivate by\n\
@return resulting regexp");
   
auto RegExpDerivationFormalRegExpSymbol = registration::AbstractRegister < RegExpDerivation, regexp::FormalRegExp < >, const regexp::FormalRegExp < > &, const DefaultSymbolType & > ( RegExpDerivation::derivation ); auto RegExpDerivationUnboundedRegExpString = registration::AbstractRegister < RegExpDerivation, regexp::UnboundedRegExp < >, const regexp::UnboundedRegExp < > &, const string::LinearString < > & > ( RegExpDerivation::derivation, "regexp", "string" ).setDocumentation (
auto RegExpDerivationUnboundedRegExpSymbol = registration::AbstractRegister < RegExpDerivation, regexp::UnboundedRegExp < >, const regexp::UnboundedRegExp < > &, const DefaultSymbolType & > ( RegExpDerivation::derivation ); "Implements derivation of regular expression by a symbol sequence.\n\
\n\
@param regexp the regexp to derivate\n\
@param string the sequence of symbols to derivate by\n\
@return resulting regexp");
auto RegExpDerivationFormalRegExpSymbol = registration::AbstractRegister < RegExpDerivation, regexp::FormalRegExp < >, const regexp::FormalRegExp < > &, const DefaultSymbolType & > ( RegExpDerivation::derivation, "regexp", "symbol" ).setDocumentation (
"Implements derivation of regular expression by a symbol sequence.\n\
\n\
@param regexp the regexp to derivate\n\
@param symbol the symbol to derivate by\n\
@return resulting regexp");
auto RegExpDerivationUnboundedRegExpSymbol = registration::AbstractRegister < RegExpDerivation, regexp::UnboundedRegExp < >, const regexp::UnboundedRegExp < > &, const DefaultSymbolType & > ( RegExpDerivation::derivation, "regexp", "symbol" ).setDocumentation (
"Implements derivation of regular expression by a symbol sequence.\n\
\n\
@param regexp the regexp to derivate\n\
@param symbol the symbol to derivate by\n\
@return resulting regexp");
   
} /* namespace regexp */ } /* namespace regexp */
...@@ -31,13 +31,41 @@ namespace regexp { ...@@ -31,13 +31,41 @@ namespace regexp {
*/ */
class RegExpDerivation { class RegExpDerivation {
public: public:
/**
* Implements derivation of regular expression by a symbol sequence.
*
* \tparam SymbolType the type of symbols in the regular expression
*
* \param regexp the regexp to derivate
* \param string the sequence of symbols to derivate by
*
* \return resulting regexp
*/
template < class SymbolType > template < class SymbolType >
static regexp::FormalRegExp < SymbolType > derivation(const regexp::FormalRegExp < SymbolType > & regexp, const string::LinearString < SymbolType > & string); static regexp::FormalRegExp < SymbolType > derivation(const regexp::FormalRegExp < SymbolType > & regexp, const string::LinearString < SymbolType > & string);
/**
* \override
*/
template < class SymbolType > template < class SymbolType >
static regexp::UnboundedRegExp < SymbolType > derivation(const regexp::UnboundedRegExp < SymbolType > & regexp, const string::LinearString < SymbolType > & string); static regexp::UnboundedRegExp < SymbolType > derivation(const regexp::UnboundedRegExp < SymbolType > & regexp, const string::LinearString < SymbolType > & string);
   
/**
* Implements derivation of regular expression by a symbol.
*
* \tparam SymbolType the type of symbols in the regular expression
*
* \param regexp the regexp to derivate
* \param symbol the symbol to derivate by
*
* \return resulting regexp
*/
template < class SymbolType > template < class SymbolType >
static regexp::FormalRegExp < SymbolType > derivation(const regexp::FormalRegExp < SymbolType > & regexp, const SymbolType & symbol); static regexp::FormalRegExp < SymbolType > derivation(const regexp::FormalRegExp < SymbolType > & regexp, const SymbolType & symbol);
/**
* \override
*/
template < class SymbolType > template < class SymbolType >
static regexp::UnboundedRegExp < SymbolType > derivation(const regexp::UnboundedRegExp < SymbolType > & regexp, const SymbolType & symbol); static regexp::UnboundedRegExp < SymbolType > derivation(const regexp::UnboundedRegExp < SymbolType > & regexp, const SymbolType & symbol);
   
......
...@@ -10,10 +10,32 @@ ...@@ -10,10 +10,32 @@
   
namespace regexp { namespace regexp {
   
auto RegExpIntegralFormalRegExpString = registration::AbstractRegister < RegExpIntegral, regexp::FormalRegExp < >, const regexp::FormalRegExp < > &, const string::LinearString < > & > ( RegExpIntegral::integral ); auto RegExpIntegralFormalRegExpString = registration::AbstractRegister < RegExpIntegral, regexp::FormalRegExp < >, const regexp::FormalRegExp < > &, const string::LinearString < > & > ( RegExpIntegral::integral, "regexp", "string" ).setDocumentation (
auto RegExpIntegralUnboundedRegExpString = registration::AbstractRegister < RegExpIntegral, regexp::UnboundedRegExp < >, const regexp::UnboundedRegExp < > &, const string::LinearString < > & > ( RegExpIntegral::integral ); "Implements integration of regular expression by a symbol. Result does not include the integration constant.\n\
\n\
@param regexp the regexp to derivate\n\
@param string the sequence of symbols to integrate by\n\
@return resulting regexp" );
   
auto RegExpIntegralFormalRegExpSymbol = registration::AbstractRegister < RegExpIntegral, regexp::FormalRegExp < >, const regexp::FormalRegExp < > &, const DefaultSymbolType & > ( RegExpIntegral::integral ); auto RegExpIntegralUnboundedRegExpString = registration::AbstractRegister < RegExpIntegral, regexp::UnboundedRegExp < >, const regexp::UnboundedRegExp < > &, const string::LinearString < > & > ( RegExpIntegral::integral, "regexp", "string" ).setDocumentation (
auto RegExpIntegralUnboundedRegExpSymbol = registration::AbstractRegister < RegExpIntegral, regexp::UnboundedRegExp < >, const regexp::UnboundedRegExp < > &, const DefaultSymbolType & > ( RegExpIntegral::integral ); "Implements integration of regular expression by a symbol. Result does not include the integration constant.\n\
\n\
@param regexp the regexp to derivate\n\
@param string the sequence of symbols to integrate by\n\
@return resulting regexp" );
auto RegExpIntegralFormalRegExpSymbol = registration::AbstractRegister < RegExpIntegral, regexp::FormalRegExp < >, const regexp::FormalRegExp < > &, const DefaultSymbolType & > ( RegExpIntegral::integral, "regexp", "symbol" ).setDocumentation (
"Implements integration of regular expression by a symbol. Result does not include the integration constant.\n\
\n\
@param regexp the regexp to derivate\n\
@param symbol the symbol to integrate by\n\
@return resulting regexp" );
auto RegExpIntegralUnboundedRegExpSymbol = registration::AbstractRegister < RegExpIntegral, regexp::UnboundedRegExp < >, const regexp::UnboundedRegExp < > &, const DefaultSymbolType & > ( RegExpIntegral::integral, "regexp", "symbol" ).setDocumentation (
"Implements integration of regular expression by a symbol. Result does not include the integration constant.\n\
\n\
@param regexp the regexp to derivate\n\
@param symbol the symbol to integrate by\n\
@return resulting regexp" );
   
} /* namespace regexp */ } /* namespace regexp */
...@@ -21,18 +21,46 @@ ...@@ -21,18 +21,46 @@
namespace regexp { namespace regexp {
   
/** /**
* Calculates integral of regular expression * Calculates integral of regular expression. Result does not include the integration constant.
* Source: Melichar definition 2.93 in chapter 2.4.4 * Source: Melichar definition 2.93 in chapter 2.4.4
*/ */
class RegExpIntegral { class RegExpIntegral {
public: public:
/**
* Implements integration of regular expression by a symbol sequence. Result does not include the integration constant.
*
* \tparam SymbolType the type of symbols in the regular expression
*
* \param regexp the regexp to derivate
* \param string the sequence of symbols to integrate by
*
* \return resulting regexp
*/
template < class SymbolType > template < class SymbolType >
static regexp::FormalRegExp < SymbolType > integral(const regexp::FormalRegExp < SymbolType > & regexp, const string::LinearString < SymbolType >& string); static regexp::FormalRegExp < SymbolType > integral(const regexp::FormalRegExp < SymbolType > & regexp, const string::LinearString < SymbolType >& string);
/**
* \override
*/
template < class SymbolType > template < class SymbolType >
static regexp::UnboundedRegExp < SymbolType > integral(const regexp::UnboundedRegExp < SymbolType > & regexp, const string::LinearString < SymbolType >& string); static regexp::UnboundedRegExp < SymbolType > integral(const regexp::UnboundedRegExp < SymbolType > & regexp, const string::LinearString < SymbolType >& string);
   
/**
* Implements integration of regular expression by a symbol. Result does not include the integration constant.
*
* \tparam SymbolType the type of symbols in the regular expression
*
* \param regexp the regexp to derivate
* \param symbol the symbol to integrate by
*
* \return resulting regexp
*/
template < class SymbolType > template < class SymbolType >
static regexp::FormalRegExp < SymbolType > integral(const regexp::FormalRegExp < SymbolType > & regexp, const SymbolType & symbol); static regexp::FormalRegExp < SymbolType > integral(const regexp::FormalRegExp < SymbolType > & regexp, const SymbolType & symbol);
/**
* \override
*/
template < class SymbolType > template < class SymbolType >
static regexp::UnboundedRegExp < SymbolType > integral(const regexp::UnboundedRegExp < SymbolType > & regexp, const SymbolType & symbol); static regexp::UnboundedRegExp < SymbolType > integral(const regexp::UnboundedRegExp < SymbolType > & regexp, const SymbolType & symbol);
   
......
...@@ -17,11 +17,20 @@ ...@@ -17,11 +17,20 @@
namespace regexp { namespace regexp {
   
/** /**
* Iterates two regexpses * Implements iteration of regular expression.
* *
*/ */
class RegExpIterate { class RegExpIterate {
public: public:
/**
* Implements iteration of regular expression.
*
* \tparam SymbolType the type of symbols in the regular expression
*
* \param regexp the regexp to iterate
*
* \return regexp describing @p regexp *
*/
template < class SymbolType > template < class SymbolType >
static regexp::FormalRegExp < SymbolType > iterate(const regexp::FormalRegExp < SymbolType > & regexp); static regexp::FormalRegExp < SymbolType > iterate(const regexp::FormalRegExp < SymbolType > & regexp);
template < class SymbolType > template < class SymbolType >
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment