diff --git a/alib2str/src/regexp/RegExpFromStringParser.cpp b/alib2str/src/regexp/RegExpFromStringParser.cpp index c6a2062ff6b7b4d85c32664065ea80a42356d324..691e9b3eb3bdb282397fa61ab2702558129875e0 100644 --- a/alib2str/src/regexp/RegExpFromStringParser.cpp +++ b/alib2str/src/regexp/RegExpFromStringParser.cpp @@ -21,13 +21,17 @@ RegExp RegExpFromStringParser::parseRegExp(std::istream& input) { return parseRegExp(input, ext::set<FEATURES>({FEATURES::FORMAL, FEATURES::UNBOUNDED})); } +UnboundedRegExp < DefaultSymbolType > RegExpFromStringParser::parseUnboundedRegExp(std::istream& input) { + return UnboundedRegExp < DefaultSymbolType > { RegExpFromStringParser::parseUnboundedRegExpStructure ( input ) }; +} + UnboundedRegExpStructure < DefaultSymbolType > RegExpFromStringParser::parseUnboundedRegExpStructure(std::istream& input) { ext::rvalue_ref < UnboundedRegExpElement < DefaultSymbolType > > element = alternation(input); return regexp::UnboundedRegExpStructure < DefaultSymbolType >(std::move(element)); } RegExp RegExpFromStringParser::parseRegExp(std::istream& input, const ext::set<FEATURES>& features) { - UnboundedRegExp < > regexp { RegExpFromStringParser::parseUnboundedRegExpStructure ( input ) }; + UnboundedRegExp < > regexp = RegExpFromStringParser::parseUnboundedRegExp ( input ); if(features.count(FEATURES::UNBOUNDED)) return RegExp { std::move ( regexp ) }; diff --git a/alib2str/src/regexp/RegExpFromStringParser.h b/alib2str/src/regexp/RegExpFromStringParser.h index b22cacc12803c9ec1ad4fdb489d4d221fb06cfb3..c28a71c718948d83d66b7a5a23ac07dbb2877935 100644 --- a/alib2str/src/regexp/RegExpFromStringParser.h +++ b/alib2str/src/regexp/RegExpFromStringParser.h @@ -31,6 +31,7 @@ class RegExpFromStringParser { public: static UnboundedRegExpStructure < DefaultSymbolType > parseUnboundedRegExpStructure(std::istream& input); + static UnboundedRegExp < DefaultSymbolType > parseUnboundedRegExp(std::istream& input); static RegExp parseRegExp(std::istream& input); static RegExp parseRegExp(std::istream& input, const ext::set<FEATURES>& features); }; diff --git a/alib2str/src/regexp/RegExpStringApi.cpp b/alib2str/src/regexp/RegExpStringApi.cpp index e896ad537d847ce2f59642ef96a47a9d6153533f..c42703b1b715844c10a919e9eb9a8104e5216be4 100644 --- a/alib2str/src/regexp/RegExpStringApi.cpp +++ b/alib2str/src/regexp/RegExpStringApi.cpp @@ -19,6 +19,14 @@ void stringApi < regexp::RegExp >::compose ( std::ostream & output, const regexp return regexp::RegExpToStringComposer::compose ( output, data ); } +regexp::UnboundedRegExp < DefaultSymbolType > stringApi < regexp::UnboundedRegExp < DefaultSymbolType > >::parse ( std::istream & input ) { + return regexp::RegExpFromStringParser::parseUnboundedRegExp ( input ); +} + +void stringApi < regexp::UnboundedRegExp < DefaultSymbolType > >::compose ( std::ostream & output, const regexp::UnboundedRegExp < DefaultSymbolType > & data ) { + return regexp::RegExpToStringComposer::compose ( output, data ); +} + regexp::UnboundedRegExpStructure < DefaultSymbolType > stringApi < regexp::UnboundedRegExpStructure < DefaultSymbolType > >::parse ( std::istream & input ) { return regexp::RegExpFromStringParser::parseUnboundedRegExpStructure ( input ); } diff --git a/alib2str/src/regexp/RegExpStringApi.hpp b/alib2str/src/regexp/RegExpStringApi.hpp index 82f054ccb263752e9ad02cc78977febbd9b6bf92..71ce68c25e0641bc048328077f0500ae73e23ef0 100644 --- a/alib2str/src/regexp/RegExpStringApi.hpp +++ b/alib2str/src/regexp/RegExpStringApi.hpp @@ -20,6 +20,12 @@ struct stringApi < regexp::RegExp > { static void compose ( std::ostream & output, const regexp::RegExp & data ); }; +template < > +struct stringApi < regexp::UnboundedRegExp < DefaultSymbolType > > { + static regexp::UnboundedRegExp < DefaultSymbolType > parse ( std::istream & input ); + static void compose ( std::ostream & output, const regexp::UnboundedRegExp < DefaultSymbolType > & data ); +}; + template < > struct stringApi < regexp::UnboundedRegExpStructure < DefaultSymbolType > > { static regexp::UnboundedRegExpStructure < DefaultSymbolType > parse ( std::istream & input );