13#include <string/LinearString.h>
43 template <
class SymbolType >
49 template <
class SymbolType >
62 template <
class SymbolType >
68 template <
class SymbolType >
72 template <
class SymbolType >
83 template <
class SymbolType >
95template <
class SymbolType >
97 std::unique_ptr < regexp::FormalRegExpElement < SymbolType > > newRegExp =
regexp.getRegExp().getStructure().template accept<std::unique_ptr < regexp::FormalRegExpElement < SymbolType > >, regexp::transform::RegExpDerivation::Formal < SymbolType >>(symbol);
102template <
class SymbolType >
104 std::unique_ptr < regexp::UnboundedRegExpElement < SymbolType > > newRegExp =
regexp.getRegExp().getStructure().template accept<std::unique_ptr < regexp::UnboundedRegExpElement < SymbolType > >, regexp::transform::RegExpDerivation::Unbounded < SymbolType > > ( symbol );
109template <
class SymbolType >
111 std::unique_ptr < regexp::FormalRegExpElement < SymbolType > > newRegExp (
regexp.getRegExp().getStructure().clone() );
113 for(
const auto& symbol :
string.getContent())
114 newRegExp = newRegExp->template accept<std::unique_ptr < regexp::FormalRegExpElement < SymbolType > >, regexp::transform::RegExpDerivation::Formal < SymbolType >>(symbol);
119template <
class SymbolType >
121 std::unique_ptr < regexp::UnboundedRegExpElement < SymbolType > > newRegExp (
regexp.getRegExp().getStructure().clone() );
123 for(
const auto& symbol :
string.getContent())
124 newRegExp = newRegExp->template accept<std::unique_ptr < regexp::UnboundedRegExpElement < SymbolType > >, regexp::transform::RegExpDerivation::Unbounded < SymbolType > > ( symbol );
131template <
class SymbolType >
133 std::unique_ptr < regexp::FormalRegExpElement < SymbolType > > leftDerivative = alternation.getLeftElement().template accept<std::unique_ptr < regexp::FormalRegExpElement < SymbolType > >, regexp::transform::RegExpDerivation::Formal < SymbolType >>(argument);
134 std::unique_ptr < regexp::FormalRegExpElement < SymbolType > > rightDerivative = alternation.getRightElement().template accept<std::unique_ptr < regexp::FormalRegExpElement < SymbolType > >, regexp::transform::RegExpDerivation::Formal < SymbolType >>(argument);
139template <
class SymbolType >
141 std::unique_ptr < regexp::FormalRegExpElement < SymbolType > > leftDerivative = concatenation.getLeftElement().template accept<std::unique_ptr < regexp::FormalRegExpElement < SymbolType > >, regexp::transform::RegExpDerivation::Formal < SymbolType >>(argument);
146 std::unique_ptr < regexp::FormalRegExpElement < SymbolType > > rightDerivative = concatenation.getRightElement().template accept<std::unique_ptr < regexp::FormalRegExpElement < SymbolType > >, regexp::transform::RegExpDerivation::Formal < SymbolType >>(argument);
154template <
class SymbolType >
156 std::unique_ptr < regexp::FormalRegExpElement < SymbolType > > elementDerivative = iteration.getElement().template accept<std::unique_ptr < regexp::FormalRegExpElement < SymbolType > >, regexp::transform::RegExpDerivation::Formal < SymbolType > > ( argument );
160template <
class SymbolType >
162 if(argument == symbol.getSymbol())
168template <
class SymbolType >
173template <
class SymbolType >
180template <
class SymbolType >
184 for(
const UnboundedRegExpElement < SymbolType > & child : alternation.getElements())
187 return std::unique_ptr < regexp::UnboundedRegExpElement < SymbolType > > ( std::move (
ret ) );
190template <
class SymbolType >
194 for(
auto child = concatenation.getElements().begin(); child != concatenation.getElements().end(); ++ child) {
198 auto succeedingElement = child;
199 while ( ++ succeedingElement != concatenation.getElements().end())
202 ret->appendElement ( std::move ( concat ) );
208 return std::unique_ptr < regexp::UnboundedRegExpElement < SymbolType > > ( std::move (
ret ) );
211template <
class SymbolType >
215 con->appendElement ( iteration );
216 return std::unique_ptr < UnboundedRegExpElement < SymbolType > > ( std::move ( con ) );
219template <
class SymbolType >
221 if(argument == symbol.getSymbol())
227template <
class SymbolType >
232template <
class SymbolType >
Represents the alternation operator in the regular expression. The node can have 0 to n children in l...
Definition: UnboundedRegExpAlternation.h:44
Represents the concatenation operator in the regular expression. The node can have 0 to n children in...
Definition: UnboundedRegExpConcatenation.h:44
void appendElement(UnboundedRegExpElement< SymbolType > &&element)
Definition: UnboundedRegExpConcatenation.h:195
Definition: UnboundedRegExpElement.h:62
Represents the empty expression in the regular expression. The node can't have any children.
Definition: UnboundedRegExpEmpty.h:41
Represents the epsilon expression in the regular expression. The node can't have any children.
Definition: UnboundedRegExpEpsilon.h:41
Represents the iteration operator in the regular expression. The node has exactly one child.
Definition: UnboundedRegExpIteration.h:43
Represents unbounded regular expression structure. Regular expression is stored as a tree of Unbounde...
Definition: UnboundedRegExpStructure.h:47
Represents the symbol in the regular expression. The can't have any children.
Definition: UnboundedRegExpSymbol.h:42
Unbounded regular expression represents regular expression. It describes regular languages....
Definition: UnboundedRegExp.h:80
static bool languageContainsEpsilon(const regexp::FormalRegExpElement< SymbolType > ®exp)
Definition: RegExpEpsilon.h:91
Linear string.
Definition: LinearString.h:57
ext::set< ext::pair< StateType, StateType > > ret(const ext::set< ext::pair< StateType, StateType > > &S, const DeterministicPushdownStoreSymbolType &pdaSymbol, const InputSymbolType &input, const N &nondeterministic)
Definition: RHDPDACommon.h:57
typename T::SymbolType SymbolType
Definition: ReachableStates.h:176
return res
Definition: MinimizeByPartitioning.h:145
auto move_copy(const T ¶m)
Allow moving of copied instance of the source.
Definition: utility.hpp:45
ContainerType< ResType > transform(const ContainerType< InType, Ts ... > &in, Callback transform)
In container tranformation of all elements according to the tranform.
Definition: algorithm.hpp:150
constexpr auto visit(Visitor &&vis, Variants &&... vars)
Definition: variant.hpp:42
Definition: ToAutomaton.h:15