21template<
class SymbolType >
55template<
class SymbolType >
60template<
class SymbolType >
62 return alternationCont(input, concatenation(input));
65template<
class SymbolType >
70 res.appendElement(std::move(left));
71 res.appendElement(concatenation(input));
73 return alternationContCont(input, std::move (
res ) );
80template<
class SymbolType >
84 res.appendElement(concatenation(input));
86 return alternationContCont(input, std::move (
res ) );
93template<
class SymbolType >
95 return concatenationCont(input, factor(input));
98template<
class SymbolType >
104 res.appendElement(std::move(left));
105 res.appendElement(factor(input));
107 return concatenationContCont(input, std::move (
res ) );
114template<
class SymbolType >
119 res.appendElement(factor(input));
121 return concatenationContCont(input, std::move (
res ) );
128template<
class SymbolType >
135 return star(input, std::move ( base ) );
143 return star(input, std::move (
res ) );
149template<
class SymbolType >
154 return star(input, std::move ( iter ) );
161template<
class SymbolType >
166template<
class SymbolType >
168 Priority tmp = Priority::ALTERNATION;
170 regexp.getStructure ( ).template accept < void, stringApi < regexp::UnboundedRegExpStructure < SymbolType > >::Unbounded > ( out );
173template <
class SymbolType >
176 std::get < 1 > ( output ) <<
"#0";
177 }
else if ( alternation.
getElements ( ).size ( ) == 1) {
178 alternation.
getElements ( ) [ 0 ].template accept < void, core::stringApi < regexp::UnboundedRegExpStructure < SymbolType > >::Unbounded > ( output );
180 Priority outerPriorityMinimum = std::get < 0 > ( output );
181 if ( outerPriorityMinimum ==
ext::any_of ( Priority::CONCATENATION, Priority::FACTOR ) )
182 std::get < 1 > ( output ) <<
'(';
184 for (
const auto & element : alternation.
getElements ( ) ) {
188 std::get < 1 > ( output ) <<
'+';
190 std::get < 0 > ( output ) = Priority::ALTERNATION;
191 element.template accept < void, core::stringApi < regexp::UnboundedRegExpStructure < SymbolType > >::Unbounded > ( output );
193 if ( outerPriorityMinimum ==
ext::any_of ( Priority::CONCATENATION, Priority::FACTOR ) )
194 std::get < 1 > ( output ) <<
')';
198template <
class SymbolType >
200 Priority outerPriorityMinimum = std::get < 0 > ( output );
202 std::get < 1 > ( output ) <<
"#E";
203 }
else if ( concatenation.
getElements ( ).size ( ) == 1 ) {
204 concatenation.
getElements ( ) [ 0 ].template accept < void, core::stringApi < regexp::UnboundedRegExpStructure < SymbolType > >::Unbounded > ( output );
206 if ( outerPriorityMinimum == Priority::FACTOR )
207 std::get < 1 > ( output ) <<
'(';
209 for (
const auto & element : concatenation.
getElements ( ) ) {
213 std::get < 1 > ( output ) <<
' ';
215 std::get < 0 > ( output ) = Priority::CONCATENATION;
216 element.template accept < void, core::stringApi < regexp::UnboundedRegExpStructure < SymbolType > >::Unbounded > ( output );
218 if ( outerPriorityMinimum == Priority::FACTOR )
219 std::get < 1 > ( output ) <<
')';
223template <
class SymbolType >
225 std::get < 0 > ( output ) = Priority::FACTOR;
226 iteration.
getElement ( ).template accept < void, core::stringApi < regexp::UnboundedRegExpStructure < SymbolType > >::Unbounded > ( output );
227 std::get < 1 > ( output ) <<
"*";
230template <
class SymbolType >
235template <
class SymbolType >
237 std::get < 1 > ( output ) <<
"#E";
240template <
class SymbolType >
242 std::get < 1 > ( output ) <<
"#0";
245template<
class SymbolType >
252template<
class SymbolType >
257template<
class SymbolType >
262template<
class SymbolType >
Basic exception from which all other exceptions are derived.
Definition: CommonException.h:21
static void putback(ext::istream &input, const Token &token)
Definition: lexer.hpp:61
Definition: dry-comparisons.hpp:131
Class representing wrapper of dynamically allocated object behaving like rvalue reference.
Definition: ptr_value.hpp:40
Class extending the tuple class from the standard library. Original reason is to allow printing of th...
Definition: tuple.hpp:42
static Token next(ext::istream &input)
Definition: RegExpFromStringLexer.cpp:10
Represents the alternation operator in the regular expression. The node can have 0 to n children in l...
Definition: UnboundedRegExpAlternation.h:44
const ext::ptr_vector< UnboundedRegExpElement< SymbolType > > & getElements() const
Definition: UnboundedRegExpAlternation.h:185
Represents the concatenation operator in the regular expression. The node can have 0 to n children in...
Definition: UnboundedRegExpConcatenation.h:44
const ext::ptr_vector< UnboundedRegExpElement< SymbolType > > & getElements() const
Definition: UnboundedRegExpConcatenation.h:185
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
const UnboundedRegExpElement< SymbolType > & getElement() const
Definition: UnboundedRegExpIteration.h:196
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
const SymbolType & getSymbol() const &
Definition: UnboundedRegExpSymbol.h:220
Unbounded regular expression represents regular expression. It describes regular languages....
Definition: UnboundedRegExp.h:80
return res
Definition: MinimizeByPartitioning.h:145
Definition: normalize.hpp:10
constexpr tuple< Elements &... > tie(Elements &... args) noexcept
Helper of extended tuple of references construction. The tuple is constructed to reffer to values in ...
Definition: tuple.hpp:218
constexpr auto visit(Visitor &&vis, Variants &&... vars)
Definition: variant.hpp:42
Definition: ToAutomaton.h:15
Definition: stringApi.hpp:26