diff --git a/aconvert2/src/DotConverter.h b/aconvert2/src/DotConverter.h index f41d0886046567fb36ee33415b5440293f06ad61..8cd046da22ba942e34fb60d44d2794867943e793 100644 --- a/aconvert2/src/DotConverter.h +++ b/aconvert2/src/DotConverter.h @@ -992,7 +992,7 @@ void DotConverter::transitions(const automaton::NFTA < SymbolType, RankType, Sta //put transitions from automaton to "transitions" for (const auto& transition : fta.getTransitions()) { std::string symbol = replace ( alib::StringDataFactory::toString ( transition.first.first.getSymbol( )), "\"", "\\\"" ); - symbol += std::to_string(transition.first.first.getRank()); + symbol += ext::to_string(transition.first.first.getRank()); for(const StateType& to : transition.second) { std::pair<int, std::vector<int>> key(states.find(to)->second, {}); @@ -1044,7 +1044,7 @@ void DotConverter::transitions(const automaton::DFTA < SymbolType, RankType, Sta //put transitions from automaton to "transitions" for (const auto& transition : fta.getTransitions()) { std::string symbol = replace ( alib::StringDataFactory::toString ( transition.first.first.getSymbol( )), "\"", "\\\"" ); - symbol += std::to_string(transition.first.first.getRank()); + symbol += ext::to_string(transition.first.first.getRank()); std::pair<int, std::vector<int>> key(states.find(transition.second)->second, {}); for(const StateType& state : transition.first.second) { diff --git a/aconvert2/src/TikZConverter.h b/aconvert2/src/TikZConverter.h index 57fec05f8de716984c98212cadca294e3997e031..942cce8b8e9b758c71a97d1a086eab1ba90fe1e6 100644 --- a/aconvert2/src/TikZConverter.h +++ b/aconvert2/src/TikZConverter.h @@ -960,7 +960,7 @@ void TikZConverter::transitions ( const automaton::NFTA < SymbolType, RankType, // put transitions from automaton to "transitions" for ( const auto & transition : fta.getTransitions ( ) ) { std::string symbol = replace ( alib::StringDataFactory::toString ( transition.first.first.getSymbol ( ) ), "\"", "\\\"" ); - symbol += std::to_string ( transition.first.first.getRank ( ) ); + symbol += ext::to_string ( transition.first.first.getRank ( ) ); for ( const StateType & to : transition.second ) { std::pair < int, std::vector < int > > key ( states.find ( to )->second, { } ); @@ -1026,7 +1026,7 @@ void TikZConverter::transitions ( const automaton::DFTA < SymbolType, RankType, // put transitions from automaton to "transitions" for ( const auto & transition : fta.getTransitions ( ) ) { std::string symbol = replace ( alib::StringDataFactory::toString ( transition.first.first.getSymbol ( ) ), "\"", "\\\"" ); - symbol += std::to_string ( transition.first.first.getRank ( ) ); + symbol += ext::to_string ( transition.first.first.getRank ( ) ); std::pair < int, std::vector < int > > key ( states.find ( transition.second )->second, { } ); diff --git a/alib2algo/src/automaton/transform/PDAToRHPDA.cpp b/alib2algo/src/automaton/transform/PDAToRHPDA.cpp index 870eecdde93ee5928f82d36342a481e033b9baab..c706b7719f679bc6a85ef369095127d517160d3f 100644 --- a/alib2algo/src/automaton/transform/PDAToRHPDA.cpp +++ b/alib2algo/src/automaton/transform/PDAToRHPDA.cpp @@ -71,11 +71,11 @@ automaton::RealTimeHeightDeterministicDPDA < > PDAToRHPDA::convert ( const autom int popPushIndex = 0; int popPushSymbols = std::get < 2 > ( transition.first ).size ( ) + to.second.size ( ); - DefaultStateType lastUS = common::createUnique ( DefaultStateType ( us + std::to_string ( i ) ), res.getStates ( ) ); + DefaultStateType lastUS = common::createUnique ( DefaultStateType ( us + ext::to_string ( i ) ), res.getStates ( ) ); for ( const DefaultSymbolType & pop :std::get < 2 > ( transition.first ) ) { DefaultStateType fromState = ( popPushIndex == 0 ) ? std::get < 0 > ( transition.first ) : lastUS; - if ( popPushIndex != 0 ) lastUS = common::createUnique ( DefaultStateType ( us + std::to_string ( ++i ) ), res.getStates ( ) ); + if ( popPushIndex != 0 ) lastUS = common::createUnique ( DefaultStateType ( us + ext::to_string ( ++i ) ), res.getStates ( ) ); DefaultStateType toState = ( popPushIndex == popPushSymbols - 1 ) ? to.first : lastUS; @@ -92,7 +92,7 @@ automaton::RealTimeHeightDeterministicDPDA < > PDAToRHPDA::convert ( const autom for ( const DefaultSymbolType & push : std::make_reverse ( to.second ) ) { DefaultStateType fromState = ( popPushIndex == 0 ) ? std::get < 0 > ( transition.first ) : lastUS; - if ( popPushIndex != 0 ) lastUS = common::createUnique ( DefaultStateType ( us + std::to_string ( ++i ) ), res.getStates ( ) ); + if ( popPushIndex != 0 ) lastUS = common::createUnique ( DefaultStateType ( us + ext::to_string ( ++i ) ), res.getStates ( ) ); DefaultStateType toState = ( popPushIndex == popPushSymbols - 1 ) ? to.first : lastUS; @@ -145,11 +145,11 @@ automaton::RealTimeHeightDeterministicNPDA < > PDAToRHPDA::convert ( const autom int popPushIndex = 0; int popPushSymbols = std::get < 2 > ( transition.first ).size ( ) + to.second.size ( ); - DefaultStateType lastUS = common::createUnique ( DefaultStateType ( us + std::to_string ( i ) ), res.getStates ( ) ); + DefaultStateType lastUS = common::createUnique ( DefaultStateType ( us + ext::to_string ( i ) ), res.getStates ( ) ); std::for_each ( std::get < 2 > ( transition.first ).begin ( ), std::get < 2 > ( transition.first ).end ( ), [&] ( const DefaultSymbolType & pop ) { DefaultStateType fromState = ( popPushIndex == 0 ) ? std::get < 0 > ( transition.first ) : lastUS; - if ( popPushIndex != 0 ) lastUS = common::createUnique ( DefaultStateType ( us + std::to_string ( ++i ) ), res.getStates ( ) ); + if ( popPushIndex != 0 ) lastUS = common::createUnique ( DefaultStateType ( us + ext::to_string ( ++i ) ), res.getStates ( ) ); DefaultStateType toState = ( popPushIndex == popPushSymbols - 1 ) ? to.first : lastUS; @@ -166,7 +166,7 @@ automaton::RealTimeHeightDeterministicNPDA < > PDAToRHPDA::convert ( const autom std::for_each ( to.second.rbegin ( ), to.second.rend ( ), [&] ( const DefaultSymbolType & push ) { DefaultStateType fromState = ( popPushIndex == 0 ) ? std::get < 0 > ( transition.first ) : lastUS; - if ( popPushIndex != 0 ) lastUS = common::createUnique ( DefaultStateType ( us + std::to_string ( ++i ) ), res.getStates ( ) ); + if ( popPushIndex != 0 ) lastUS = common::createUnique ( DefaultStateType ( us + ext::to_string ( ++i ) ), res.getStates ( ) ); DefaultStateType toState = ( popPushIndex == popPushSymbols - 1 ) ? to.first : lastUS; diff --git a/alib2algo/src/grammar/properties/NonterminalUnitRuleCycle.h b/alib2algo/src/grammar/properties/NonterminalUnitRuleCycle.h index 746315f34d6c51b30cdf57bfa22f920d9608278b..d5ecdfee85dbfa58ec5aa3f10b1431d385aea2d0 100644 --- a/alib2algo/src/grammar/properties/NonterminalUnitRuleCycle.h +++ b/alib2algo/src/grammar/properties/NonterminalUnitRuleCycle.h @@ -54,7 +54,7 @@ public: template<class T, class SymbolType > std::set<SymbolType> NonterminalUnitRuleCycle::getNonterminalUnitRuleCycle(const T& grammar, const SymbolType& nonterminal) { if(grammar.getNonterminalAlphabet().count(nonterminal) == 0) { - throw exception::CommonException("Nonterminal symbol \"" + std::to_string ( nonterminal ) + "\" is not present in grammar."); + throw exception::CommonException("Nonterminal symbol \"" + ext::to_string ( nonterminal ) + "\" is not present in grammar."); } std::deque<std::set<SymbolType>> Ni; diff --git a/alib2cli/src/ast/statements/SingleStatement.h b/alib2cli/src/ast/statements/SingleStatement.h index 8eceb6680048e8a31d1917c6f2c429b9591f4a68..54a51cb36f027d9c19fb0d1e2292aa49957c2449 100644 --- a/alib2cli/src/ast/statements/SingleStatement.h +++ b/alib2cli/src/ast/statements/SingleStatement.h @@ -34,7 +34,7 @@ public: unsigned i = 0; for ( const std::shared_ptr < abstraction::OperationAbstraction > & param : params ) { if ( ! algo->attachInput ( param, i ) ) - throw exception::CommonException ( "Can't connect param at " + std::to_string ( i ) + " of algorithm " + m_name + " with result of type " + std::type_name ( param->type ( ) ) + "." ); + throw exception::CommonException ( "Can't connect param at " + ext::to_string ( i ) + " of algorithm " + m_name + " with result of type " + std::type_name ( param->type ( ) ) + "." ); i++; } diff --git a/alib2cli/src/command/SetCommand.h b/alib2cli/src/command/SetCommand.h index 12e01e25ce6196a9412e12d12c43475b27806847..a2affbece4d7d79a179c9cd61a645cf0aedf91be 100644 --- a/alib2cli/src/command/SetCommand.h +++ b/alib2cli/src/command/SetCommand.h @@ -17,11 +17,11 @@ public: virtual Command::Result run ( Environment & ) const override { if ( m_param == "verbose" ) { - common::GlobalData::verbose = std::from_string < bool > ( m_value ); + common::GlobalData::verbose = ext::from_string < bool > ( m_value ); } else if ( m_param == "measure" ) { - common::GlobalData::measure = std::from_string < bool > ( m_value ); + common::GlobalData::measure = ext::from_string < bool > ( m_value ); } else if ( m_param == "optimizeXml" ) { - common::GlobalData::optimizeXml = std::from_string < bool > ( m_value ); + common::GlobalData::optimizeXml = ext::from_string < bool > ( m_value ); } else { std::cout << "The set parameter " << m_param << " does not exist." << std::endl; } diff --git a/alib2cli/src/parser/Parser.h b/alib2cli/src/parser/Parser.h index e1096c3b2803620cc0d1a40b569060f479f695da..279f1e22668700d2495f601e2ae31840783c8476 100644 --- a/alib2cli/src/parser/Parser.h +++ b/alib2cli/src/parser/Parser.h @@ -59,7 +59,7 @@ public: int matchInteger ( ) { if ( ! check ( Lexer::TokenType::INTEGER ) ) throw exception::CommonException ( "Mismatched token while matching a token." ); - int res = std::from_string < int > ( m_current.m_value ); + int res = ext::from_string < int > ( m_current.m_value ); m_current = m_lexer.nextToken ( ); return res; } diff --git a/alib2common/src/abstraction/ImmediateRegistry.hpp b/alib2common/src/abstraction/ImmediateRegistry.hpp index 2a63eb4f6f2535ce8da06242d412f04b328bb9f2..e85b18c6e9fec3bc0f0561e8d5635ebb1d9d310a 100644 --- a/alib2common/src/abstraction/ImmediateRegistry.hpp +++ b/alib2common/src/abstraction/ImmediateRegistry.hpp @@ -69,7 +69,7 @@ namespace abstraction { template < class Result > std::shared_ptr < abstraction::OperationAbstraction > ImmediateRegistry::EntryImpl < Result >::getAbstraction ( std::string value ) const { - return std::make_shared < ImmediateValueAbstraction < Result > > ( std::from_string < Result > ( value ) ); + return std::make_shared < ImmediateValueAbstraction < Result > > ( ext::from_string < Result > ( value ) ); } } /* namespace abstraction */ diff --git a/alib2common/src/abstraction/PrimitiveRegistrator.cpp b/alib2common/src/abstraction/PrimitiveRegistrator.cpp index f8545dcee2531fb72f39fd61f4be7e7d5cc045dc..eb4e8049c90c728a994cb765d1b0055ea400cc4b 100644 --- a/alib2common/src/abstraction/PrimitiveRegistrator.cpp +++ b/alib2common/src/abstraction/PrimitiveRegistrator.cpp @@ -25,8 +25,8 @@ public: abstraction::CastRegistry::registerCast < double, int > ( ); abstraction::CastRegistry::registerCast < int, double > ( ); - abstraction::CastRegistry::registerCastAlgorithm < std::string, int > ( std::to_string ); - abstraction::CastRegistry::registerCastAlgorithm < int, std::string > ( (int(*)(std::string)) std::from_string < int > ); + abstraction::CastRegistry::registerCastAlgorithm < std::string, int > ( ext::to_string ); + abstraction::CastRegistry::registerCastAlgorithm < int, std::string > ( (int(*)(std::string)) ext::from_string < int > ); abstraction::CastRegistry::registerCast < bool, int > ( ); diff --git a/alib2common/src/abstraction/UnaryOperationAbstraction.hpp b/alib2common/src/abstraction/UnaryOperationAbstraction.hpp index 6b443e20875e21876f9567e1f0efeafa5a9c4836..01681e0ad6b02db4451714225fc28c1c706fead4 100644 --- a/alib2common/src/abstraction/UnaryOperationAbstraction.hpp +++ b/alib2common/src/abstraction/UnaryOperationAbstraction.hpp @@ -22,7 +22,7 @@ protected: private: virtual bool attachInput ( const std::shared_ptr < OperationAbstraction > & input, unsigned index ) override { if ( index != 0 ) - throw exception::CommonException ( "Out of range index: " + std::to_string ( index ) + " max: " + std::to_string ( numberOfParams ( ) ) + "." ); + throw exception::CommonException ( "Out of range index: " + ext::to_string ( index ) + " max: " + ext::to_string ( numberOfParams ( ) ) + "." ); std::shared_ptr < ValueOperationAbstraction < ParamType > > validData = std::dynamic_pointer_cast < ValueOperationAbstraction < ParamType > > ( input ); if ( validData ) { @@ -79,7 +79,7 @@ public: virtual std::shared_ptr < OperationAbstraction > getXmlParserFromParam ( unsigned index, std::deque < sax::Token > tokens ) const override { if ( index != 0 ) - throw exception::CommonException ( "Out of range index: " + std::to_string ( index ) + " max: " + std::to_string ( numberOfParams ( ) ) + "." ); + throw exception::CommonException ( "Out of range index: " + ext::to_string ( index ) + " max: " + ext::to_string ( numberOfParams ( ) ) + "." ); std::string paramType = std::type_name < ParamType > ( ); return Registry::getXmlParserAbstraction ( std::move ( paramType ), std::move ( tokens ) ); diff --git a/alib2common/src/core/components.hpp b/alib2common/src/core/components.hpp index b3f420a5cffb3291b62553e6b35030845ff55a70..a0915214962aa9f7df7fbc125d9fa505e46eeaf3 100644 --- a/alib2common/src/core/components.hpp +++ b/alib2common/src/core/components.hpp @@ -76,7 +76,7 @@ class Component { if ( !ComponentConstraint < Derived, DataType, SetType >::available ( static_cast < const Derived & > ( * this ), symbol ) ) { std::string elementTypeName ( std::type_name < SetType * > ( ) ); elementTypeName.back ( ) = ' '; - throw::exception::CommonException ( elementTypeName + "element " + std::to_string ( symbol ) + " is not available." ); + throw::exception::CommonException ( elementTypeName + "element " + ext::to_string ( symbol ) + " is not available." ); } } @@ -88,7 +88,7 @@ class Component { if ( ComponentConstraint < Derived, DataType, SetType >::used ( static_cast < const Derived & > ( * this ), symbol ) ) { std::string elementTypeName ( std::type_name < SetType * > ( ) ); elementTypeName.back ( ) = ' '; - throw::exception::CommonException ( elementTypeName + "element " + std::to_string ( symbol ) + " is used." ); + throw::exception::CommonException ( elementTypeName + "element " + ext::to_string ( symbol ) + " is used." ); } } @@ -241,7 +241,7 @@ class Element { if ( !ElementConstraint < Derived, DataType, ElementType >::available ( static_cast < const Derived & > ( * this ), symbol ) ) { std::string elementTypeName ( std::type_name < ElementType * > ( ) ); elementTypeName.back ( ) = ' '; - throw::exception::CommonException ( elementTypeName + std::to_string ( symbol ) + " is not available." ); + throw::exception::CommonException ( elementTypeName + ext::to_string ( symbol ) + " is not available." ); } } diff --git a/alib2common/src/core/xmlApi.hpp b/alib2common/src/core/xmlApi.hpp index 2a0de346daa7a80e986dd52c517714e58a85250f..b28e5c651c07ce2e665480880d2d818b9a5f1665 100644 --- a/alib2common/src/core/xmlApi.hpp +++ b/alib2common/src/core/xmlApi.hpp @@ -148,14 +148,14 @@ public: if ( /* common::GlobalData::optimizeXml && */ tagName == "Ref" ) { sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::START_ELEMENT, "Ref" ); sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::START_ATTRIBUTE, "id" ); - int id = std::from_string < int > ( sax::FromXMLParserHelper::popTokenData ( input, sax::Token::TokenType::CHARACTER ) ); + int id = ext::from_string < int > ( sax::FromXMLParserHelper::popTokenData ( input, sax::Token::TokenType::CHARACTER ) ); sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::END_ATTRIBUTE, "id" ); sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::END_ELEMENT, "Ref" ); std::map < int, WrapperBaseBase * >::iterator elem = input.idToInstance ( std::type_name < Group > ( ) ).find ( id ); if ( elem == input.idToInstance ( std::type_name < Group > ( ) ).end ( ) ) { std::cerr << input.dump ( ) << std::endl; - throw exception::CommonException ( "XML Inconsistent ( id not found " + std::to_string ( id ) + " )" ); + throw exception::CommonException ( "XML Inconsistent ( id not found " + ext::to_string ( id ) + " )" ); } return * ( ( Group * ) elem->second ); @@ -169,7 +169,7 @@ public: int id = 0; if ( ref ) { std::deque < sax::Token >::iterator tmp = input + 2; - id = std::from_string < int > ( sax::FromXMLParserHelper::popTokenData ( tmp, sax::Token::TokenType::CHARACTER ) ); + id = ext::from_string < int > ( sax::FromXMLParserHelper::popTokenData ( tmp, sax::Token::TokenType::CHARACTER ) ); } Group res ( callback->second->parse ( input ) ); @@ -208,7 +208,7 @@ public: if ( common::GlobalData::optimizeXml && elem != context.instanceToId ( std::type_name < Group > ( ) ).end ( ) ) { output.emplace_back ( "Ref", sax::Token::TokenType::START_ELEMENT ); output.emplace_back ( "id", sax::Token::TokenType::START_ATTRIBUTE ); - output.emplace_back ( std::to_string ( elem->second ), sax::Token::TokenType::CHARACTER ); + output.emplace_back ( ext::to_string ( elem->second ), sax::Token::TokenType::CHARACTER ); output.emplace_back ( "id", sax::Token::TokenType::END_ATTRIBUTE ); output.emplace_back ( "Ref", sax::Token::TokenType::END_ELEMENT ); } else { @@ -225,7 +225,7 @@ public: /* emplace referenced attribute */ if ( common::GlobalData::optimizeXml ) { output.emplace ( output.begin ( ) + pos + 1, "ref", sax::Token::TokenType::START_ATTRIBUTE ); - output.emplace ( output.begin ( ) + pos + 2, std::to_string ( id ), sax::Token::TokenType::CHARACTER ); + output.emplace ( output.begin ( ) + pos + 2, ext::to_string ( id ), sax::Token::TokenType::CHARACTER ); output.emplace ( output.begin ( ) + pos + 3, "ref", sax::Token::TokenType::END_ATTRIBUTE ); context.instanceToId ( std::type_name < Group > ( ) ).insert ( std::make_pair ( static_cast< const CommonBaseBase * > ( & data.getData ( ) ), id ) ); diff --git a/alib2common/src/measurements/MeasurementResultsXml.cpp b/alib2common/src/measurements/MeasurementResultsXml.cpp index 945470c022a22a990d1fb5482c8128040712a285..1cef454d1a8e1fc808b6b13bcad4b43f26579093 100644 --- a/alib2common/src/measurements/MeasurementResultsXml.cpp +++ b/alib2common/src/measurements/MeasurementResultsXml.cpp @@ -55,10 +55,10 @@ void MeasurementResultsXml::composeTimeDataFrame ( std::deque < sax::Token > & t tokens.emplace_back ( TIME_DATA_FRAME_TAG, sax::Token::TokenType::START_ELEMENT ); tokens.emplace_back ( TIME_DATA_FRAME_DURATION_TAG, sax::Token::TokenType::START_ELEMENT ); - tokens.emplace_back ( std::to_string ( frame.duration.count ( ) ), sax::Token::TokenType::CHARACTER ); + tokens.emplace_back ( ext::to_string ( frame.duration.count ( ) ), sax::Token::TokenType::CHARACTER ); tokens.emplace_back ( TIME_DATA_FRAME_DURATION_TAG, sax::Token::TokenType::END_ELEMENT ); tokens.emplace_back ( TIME_DATA_FRAME_IN_FRAME_DURATION_TAG, sax::Token::TokenType::START_ELEMENT ); - tokens.emplace_back ( std::to_string ( frame.inFrameDuration.count ( ) ), sax::Token::TokenType::CHARACTER ); + tokens.emplace_back ( ext::to_string ( frame.inFrameDuration.count ( ) ), sax::Token::TokenType::CHARACTER ); tokens.emplace_back ( TIME_DATA_FRAME_IN_FRAME_DURATION_TAG, sax::Token::TokenType::END_ELEMENT ); tokens.emplace_back ( TIME_DATA_FRAME_TAG, sax::Token::TokenType::END_ELEMENT ); } @@ -68,16 +68,16 @@ void MeasurementResultsXml::composeMemoryDataFrame ( std::deque < sax::Token > & tokens.emplace_back ( MEMORY_DATA_FRAME_TAG, sax::Token::TokenType::START_ELEMENT ); tokens.emplace_back ( MEMORY_DATA_FRAME_START_HEAP_USAGE_TAG, sax::Token::TokenType::START_ELEMENT ); - tokens.emplace_back ( std::to_string ( frame.startHeapUsage ), sax::Token::TokenType::CHARACTER ); + tokens.emplace_back ( ext::to_string ( frame.startHeapUsage ), sax::Token::TokenType::CHARACTER ); tokens.emplace_back ( MEMORY_DATA_FRAME_START_HEAP_USAGE_TAG, sax::Token::TokenType::END_ELEMENT ); tokens.emplace_back ( MEMORY_DATA_FRAME_END_HEAP_USAGE_TAG, sax::Token::TokenType::START_ELEMENT ); - tokens.emplace_back ( std::to_string ( frame.endHeapUsage ), sax::Token::TokenType::CHARACTER ); + tokens.emplace_back ( ext::to_string ( frame.endHeapUsage ), sax::Token::TokenType::CHARACTER ); tokens.emplace_back ( MEMORY_DATA_FRAME_END_HEAP_USAGE_TAG, sax::Token::TokenType::END_ELEMENT ); tokens.emplace_back ( MEMORY_DATA_FRAME_HIGH_WATERMARK_TAG, sax::Token::TokenType::START_ELEMENT ); - tokens.emplace_back ( std::to_string ( frame.highWatermark ), sax::Token::TokenType::CHARACTER ); + tokens.emplace_back ( ext::to_string ( frame.highWatermark ), sax::Token::TokenType::CHARACTER ); tokens.emplace_back ( MEMORY_DATA_FRAME_HIGH_WATERMARK_TAG, sax::Token::TokenType::END_ELEMENT ); tokens.emplace_back ( MEMORY_DATA_FRAME_IN_FRAME_HIGH_WATERMARK_TAG, sax::Token::TokenType::START_ELEMENT ); - tokens.emplace_back ( std::to_string ( frame.inFrameHighWatermark ), sax::Token::TokenType::CHARACTER ); + tokens.emplace_back ( ext::to_string ( frame.inFrameHighWatermark ), sax::Token::TokenType::CHARACTER ); tokens.emplace_back ( MEMORY_DATA_FRAME_IN_FRAME_HIGH_WATERMARK_TAG, sax::Token::TokenType::END_ELEMENT ); tokens.emplace_back ( MEMORY_DATA_FRAME_TAG, sax::Token::TokenType::END_ELEMENT ); } @@ -95,7 +95,7 @@ void MeasurementResultsXml::composeCounterDataFrame ( std::deque < sax::Token > tokens.emplace_back ( measurements::to_string ( elem.first ), sax::Token::TokenType::CHARACTER ); tokens.emplace_back ( COUNTER_DATA_FRAME_COUNTER_NAME_TAG, sax::Token::TokenType::END_ELEMENT ); tokens.emplace_back ( COUNTER_DATA_FRAME_COUNTER_VALUE_TAG, sax::Token::TokenType::START_ELEMENT ); - tokens.emplace_back ( std::to_string ( elem.second ), sax::Token::TokenType::CHARACTER ); + tokens.emplace_back ( ext::to_string ( elem.second ), sax::Token::TokenType::CHARACTER ); tokens.emplace_back ( COUNTER_DATA_FRAME_COUNTER_VALUE_TAG, sax::Token::TokenType::END_ELEMENT ); tokens.emplace_back ( COUNTER_DATA_FRAME_COUNTER_TAG, sax::Token::TokenType::END_ELEMENT ); } @@ -110,7 +110,7 @@ void MeasurementResultsXml::composeCounterDataFrame ( std::deque < sax::Token > tokens.emplace_back ( measurements::to_string ( elem.first ), sax::Token::TokenType::CHARACTER ); tokens.emplace_back ( COUNTER_DATA_FRAME_COUNTER_NAME_TAG, sax::Token::TokenType::END_ELEMENT ); tokens.emplace_back ( COUNTER_DATA_FRAME_COUNTER_VALUE_TAG, sax::Token::TokenType::START_ELEMENT ); - tokens.emplace_back ( std::to_string ( elem.second ), sax::Token::TokenType::CHARACTER ); + tokens.emplace_back ( ext::to_string ( elem.second ), sax::Token::TokenType::CHARACTER ); tokens.emplace_back ( COUNTER_DATA_FRAME_COUNTER_VALUE_TAG, sax::Token::TokenType::END_ELEMENT ); tokens.emplace_back ( COUNTER_DATA_FRAME_COUNTER_TAG, sax::Token::TokenType::END_ELEMENT ); } diff --git a/alib2common/src/primitive/Double.cpp b/alib2common/src/primitive/Double.cpp index 80f17cc3b2bfc67b826e66b998fd30f8dec676c1..4f01a3a9b19bbf1f3e58490435cf012e6318bca7 100644 --- a/alib2common/src/primitive/Double.cpp +++ b/alib2common/src/primitive/Double.cpp @@ -52,7 +52,7 @@ void Double::operator>>(std::ostream& out) const { } Double::operator std::string() const { - return std::to_string(m_data); + return ext::to_string(m_data); } Double Double::parse(std::deque<sax::Token>::iterator& input) { @@ -61,7 +61,7 @@ Double Double::parse(std::deque<sax::Token>::iterator& input) { double Double::parseRaw(std::deque<sax::Token>::iterator& input) { sax::FromXMLParserHelper::popToken(input, sax::Token::TokenType::START_ELEMENT, Double::getXmlTagName()); - double data = std::from_string < double > (sax::FromXMLParserHelper::popTokenData(input, sax::Token::TokenType::CHARACTER)); + double data = ext::from_string < double > (sax::FromXMLParserHelper::popTokenData(input, sax::Token::TokenType::CHARACTER)); sax::FromXMLParserHelper::popToken(input, sax::Token::TokenType::END_ELEMENT, Double::getXmlTagName()); return data; } @@ -72,7 +72,7 @@ void Double::compose(std::deque<sax::Token>& out) const { void Double::compose(std::deque<sax::Token>& out, double primitive) { out.emplace_back(Double::getXmlTagName(), sax::Token::TokenType::START_ELEMENT); - out.emplace_back(std::to_string(primitive), sax::Token::TokenType::CHARACTER); + out.emplace_back(ext::to_string(primitive), sax::Token::TokenType::CHARACTER); out.emplace_back(Double::getXmlTagName(), sax::Token::TokenType::END_ELEMENT); } diff --git a/alib2common/src/primitive/Integer.cpp b/alib2common/src/primitive/Integer.cpp index d20f8689966a30731b6f93ea67f84e90bff91b97..d7ef8369d71c207d662214c65c7f6ffaba5f3ea9 100644 --- a/alib2common/src/primitive/Integer.cpp +++ b/alib2common/src/primitive/Integer.cpp @@ -47,7 +47,7 @@ void Integer::operator>>(std::ostream& out) const { } Integer::operator std::string() const { - return std::to_string(m_data); + return ext::to_string(m_data); } Integer Integer::parse(std::deque<sax::Token>::iterator& input) { @@ -56,7 +56,7 @@ Integer Integer::parse(std::deque<sax::Token>::iterator& input) { int Integer::parseRaw(std::deque<sax::Token>::iterator& input) { sax::FromXMLParserHelper::popToken(input, sax::Token::TokenType::START_ELEMENT, Integer::getXmlTagName()); - int data = std::from_string < int > (sax::FromXMLParserHelper::popTokenData(input, sax::Token::TokenType::CHARACTER)); + int data = ext::from_string < int > (sax::FromXMLParserHelper::popTokenData(input, sax::Token::TokenType::CHARACTER)); sax::FromXMLParserHelper::popToken(input, sax::Token::TokenType::END_ELEMENT, Integer::getXmlTagName()); return data; } @@ -67,7 +67,7 @@ void Integer::compose(std::deque<sax::Token>& out) const { void Integer::compose(std::deque<sax::Token>& out, int primitive) { out.emplace_back(Integer::getXmlTagName(), sax::Token::TokenType::START_ELEMENT); - out.emplace_back(std::to_string(primitive), sax::Token::TokenType::CHARACTER); + out.emplace_back(ext::to_string(primitive), sax::Token::TokenType::CHARACTER); out.emplace_back(Integer::getXmlTagName(), sax::Token::TokenType::END_ELEMENT); } diff --git a/alib2common/src/primitive/Unsigned.cpp b/alib2common/src/primitive/Unsigned.cpp index 2eff2fd218ba7cbca51d6aa27e15e335db4f5441..764cc2d1bfb005035016c0d4aa88efd2bc3b71a2 100644 --- a/alib2common/src/primitive/Unsigned.cpp +++ b/alib2common/src/primitive/Unsigned.cpp @@ -51,7 +51,7 @@ void Unsigned::operator>>(std::ostream& out) const { } Unsigned::operator std::string() const { - return std::to_string(m_data); + return ext::to_string(m_data); } Unsigned Unsigned::parse(std::deque<sax::Token>::iterator& input) { @@ -60,7 +60,7 @@ Unsigned Unsigned::parse(std::deque<sax::Token>::iterator& input) { unsigned Unsigned::parseRaw(std::deque<sax::Token>::iterator& input) { sax::FromXMLParserHelper::popToken(input, sax::Token::TokenType::START_ELEMENT, Unsigned::getXmlTagName()); - unsigned data = std::from_string < unsigned > (sax::FromXMLParserHelper::popTokenData(input, sax::Token::TokenType::CHARACTER)); + unsigned data = ext::from_string < unsigned > (sax::FromXMLParserHelper::popTokenData(input, sax::Token::TokenType::CHARACTER)); sax::FromXMLParserHelper::popToken(input, sax::Token::TokenType::END_ELEMENT, Unsigned::getXmlTagName()); return data; } @@ -71,7 +71,7 @@ void Unsigned::compose(std::deque<sax::Token>& out) const { void Unsigned::compose(std::deque<sax::Token>& out, unsigned primitive) { out.emplace_back(Unsigned::getXmlTagName(), sax::Token::TokenType::START_ELEMENT); - out.emplace_back(std::to_string(primitive), sax::Token::TokenType::CHARACTER); + out.emplace_back(ext::to_string(primitive), sax::Token::TokenType::CHARACTER); out.emplace_back(Unsigned::getXmlTagName(), sax::Token::TokenType::END_ELEMENT); } diff --git a/alib2common/src/primitive/UnsignedLong.cpp b/alib2common/src/primitive/UnsignedLong.cpp index 154b5bbc10c7899bc0333b97738830911a560b6c..d3444e4c3e5bf37e659447b19794f5a1a29e588a 100644 --- a/alib2common/src/primitive/UnsignedLong.cpp +++ b/alib2common/src/primitive/UnsignedLong.cpp @@ -47,7 +47,7 @@ void UnsignedLong::operator>>(std::ostream& out) const { } UnsignedLong::operator std::string() const { - return std::to_string(m_data); + return ext::to_string(m_data); } UnsignedLong UnsignedLong::parse(std::deque<sax::Token>::iterator& input) { @@ -56,7 +56,7 @@ UnsignedLong UnsignedLong::parse(std::deque<sax::Token>::iterator& input) { unsigned long UnsignedLong::parseRaw(std::deque<sax::Token>::iterator& input) { sax::FromXMLParserHelper::popToken(input, sax::Token::TokenType::START_ELEMENT, UnsignedLong::getXmlTagName()); - unsigned long data = std::from_string < unsigned long > (sax::FromXMLParserHelper::popTokenData(input, sax::Token::TokenType::CHARACTER)); + unsigned long data = ext::from_string < unsigned long > (sax::FromXMLParserHelper::popTokenData(input, sax::Token::TokenType::CHARACTER)); sax::FromXMLParserHelper::popToken(input, sax::Token::TokenType::END_ELEMENT, UnsignedLong::getXmlTagName()); return data; } @@ -67,7 +67,7 @@ void UnsignedLong::compose(std::deque<sax::Token>& out) const { void UnsignedLong::compose(std::deque<sax::Token>& out, unsigned long primitive) { out.emplace_back(UnsignedLong::getXmlTagName(), sax::Token::TokenType::START_ELEMENT); - out.emplace_back(std::to_string(primitive), sax::Token::TokenType::CHARACTER); + out.emplace_back(ext::to_string(primitive), sax::Token::TokenType::CHARACTER); out.emplace_back(UnsignedLong::getXmlTagName(), sax::Token::TokenType::END_ELEMENT); } diff --git a/alib2common/test-src/core/DispatchTest.cpp b/alib2common/test-src/core/DispatchTest.cpp index 834a1def9a45fea099b6808803c402720eb1a02b..190b546a65045a935b78e98beb7061ea67dfd371 100644 --- a/alib2common/test-src/core/DispatchTest.cpp +++ b/alib2common/test-src/core/DispatchTest.cpp @@ -60,7 +60,7 @@ public: } virtual operator std::string ( ) const { - return "Tmp1(" + std::to_string ( m_data ) + ")"; + return "Tmp1(" + ext::to_string ( m_data ) + ")"; } int getData ( ) const { @@ -116,7 +116,7 @@ public: } virtual operator std::string ( ) const { - return "Tmp2(" + std::to_string ( m_data ) + ")"; + return "Tmp2(" + ext::to_string ( m_data ) + ")"; } double getData ( ) const { @@ -139,10 +139,10 @@ public: Tmp3 ( const std::string & data ) : m_data ( data ), m_moves ( 0 ), m_copies ( 0 ) { } - Tmp3 ( const Tmp1 & other ) : m_data ( std::to_string ( other.getData ( ) ) ), m_moves ( 0 ), m_copies ( 0 ) { + Tmp3 ( const Tmp1 & other ) : m_data ( ext::to_string ( other.getData ( ) ) ), m_moves ( 0 ), m_copies ( 0 ) { } - Tmp3 ( const Tmp2 & other ) : m_data ( std::to_string ( other.getData ( ) ) ), m_moves ( 0 ), m_copies ( 0 ) { + Tmp3 ( const Tmp2 & other ) : m_data ( ext::to_string ( other.getData ( ) ) ), m_moves ( 0 ), m_copies ( 0 ) { } Tmp3 ( const Tmp3 & other ) : m_data ( other.m_data ), m_moves ( other.m_moves ), m_copies ( other.m_copies + 1 ) { diff --git a/alib2data/src/alphabet/NonlinearVariableSymbol.h b/alib2data/src/alphabet/NonlinearVariableSymbol.h index b90f23a0beed8e7f693fca1b3ce13b4b7aa7553f..ca223d07e4d178385afbb7063096416b02bb6a60 100644 --- a/alib2data/src/alphabet/NonlinearVariableSymbol.h +++ b/alib2data/src/alphabet/NonlinearVariableSymbol.h @@ -134,7 +134,7 @@ void NonlinearVariableSymbol < SymbolType >::operator >>( std::ostream & out ) c template < class SymbolType > NonlinearVariableSymbol < SymbolType >::operator std::string ( ) const { - return "$" + std::to_string ( m_symbol ); + return "$" + ext::to_string ( m_symbol ); } template < class SymbolType > diff --git a/alib2data/src/automaton/FSM/CompactNFA.h b/alib2data/src/automaton/FSM/CompactNFA.h index 6e908f5e09f02ff313f9daba2d2ded68483b4579..8e7b93a9ee519d8ad4945f7641ef18268f118c98 100644 --- a/alib2data/src/automaton/FSM/CompactNFA.h +++ b/alib2data/src/automaton/FSM/CompactNFA.h @@ -279,7 +279,7 @@ AutomatonBase * CompactNFA < SymbolType, StateType >::plunder ( ) && { template < class SymbolType, class StateType > bool CompactNFA < SymbolType, StateType >::addTransition ( StateType from, std::vector < SymbolType > input, StateType to ) { if ( !getStates ( ).count ( from ) ) - throw AutomatonException ( "State \"" + std::to_string ( from ) + "\" doesn't exist." ); + throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist." ); std::set < SymbolType > inputStringAlphabet ( input.begin ( ), input.end ( ) ); @@ -288,7 +288,7 @@ bool CompactNFA < SymbolType, StateType >::addTransition ( StateType from, std:: throw AutomatonException ( "Input string is over different alphabet than automaton" ); if ( !getStates ( ).count ( to ) ) - throw AutomatonException ( "State \"" + std::to_string ( to ) + "\" doesn't exist." ); + throw AutomatonException ( "State \"" + ext::to_string ( to ) + "\" doesn't exist." ); std::pair < StateType, std::vector < SymbolType > > key = std::make_pair ( std::move ( from ), std::move ( input ) ); @@ -298,7 +298,7 @@ bool CompactNFA < SymbolType, StateType >::addTransition ( StateType from, std:: template < class SymbolType, class StateType > void CompactNFA < SymbolType, StateType >::addTransitions ( StateType from, std::vector < SymbolType > input, std::set < StateType > to ) { if ( !getStates ( ).count ( from ) ) - throw AutomatonException ( "State \"" + std::to_string ( from ) + "\" doesn't exist." ); + throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist." ); std::set < SymbolType > inputStringAlphabet ( input.begin ( ), input.end ( ) ); @@ -329,7 +329,7 @@ const std::map < std::pair < StateType, std::vector < SymbolType > >, std::set < template < class SymbolType, class StateType > std::map < std::pair < StateType, std::vector < SymbolType > >, std::set < StateType > > CompactNFA < SymbolType, StateType >::getTransitionsFromState ( const StateType & from ) const { if ( !getStates ( ).count ( from ) ) - throw AutomatonException ( "State \"" + std::to_string ( from ) + "\" doesn't exist" ); + throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist" ); std::map < std::pair < StateType, std::vector < SymbolType > >, std::set < StateType > > transitionsFromState; @@ -343,7 +343,7 @@ std::map < std::pair < StateType, std::vector < SymbolType > >, std::set < State template < class SymbolType, class StateType > std::map < std::pair < StateType, std::vector < SymbolType > >, std::set < StateType > > CompactNFA < SymbolType, StateType >::getTransitionsToState ( const StateType & to ) const { if ( !getStates ( ).count ( to ) ) - throw AutomatonException ( "State \"" + std::to_string ( to ) + "\" doesn't exist" ); + throw AutomatonException ( "State \"" + ext::to_string ( to ) + "\" doesn't exist" ); std::map < std::pair < StateType, std::vector < SymbolType > >, std::set < StateType > > transitionsToState; diff --git a/alib2data/src/automaton/FSM/DFA.h b/alib2data/src/automaton/FSM/DFA.h index 0c86bc6aeeb108d91a86da88d46af2c8768b4c49..17ebf8fda6c0389934af4c0a66a34981cf789bdb 100644 --- a/alib2data/src/automaton/FSM/DFA.h +++ b/alib2data/src/automaton/FSM/DFA.h @@ -221,13 +221,13 @@ AutomatonBase * DFA<SymbolType, StateType>::plunder ( ) && { template<class SymbolType, class StateType > bool DFA<SymbolType, StateType>::addTransition ( StateType from, SymbolType input, StateType to ) { if ( !getStates ( ).count ( from ) ) - throw AutomatonException ( "State \"" + std::to_string ( from ) + "\" doesn't exist." ); + throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist." ); if ( !getInputAlphabet ( ).count ( input ) ) - throw AutomatonException ( "Input symbol \"" + std::to_string ( input ) + "\" doesn't exist." ); + throw AutomatonException ( "Input symbol \"" + ext::to_string ( input ) + "\" doesn't exist." ); if ( !getStates ( ).count ( to ) ) - throw AutomatonException ( "State \"" + std::to_string ( to ) + "\" doesn't exist." ); + throw AutomatonException ( "State \"" + ext::to_string ( to ) + "\" doesn't exist." ); std::pair < StateType, SymbolType > key = std::make_pair ( std::move ( from ), std::move ( input ) ); @@ -235,7 +235,7 @@ bool DFA<SymbolType, StateType>::addTransition ( StateType from, SymbolType inpu if ( transitions.find ( key )->second == to ) return false; else - throw AutomatonException ( "Transition from this state and symbol already exists (\"" + std::to_string ( key.first ) + "\", \"" + std::to_string ( key.second ) + "\") -> \"" + std::to_string ( to ) + "\"." ); + throw AutomatonException ( "Transition from this state and symbol already exists (\"" + ext::to_string ( key.first ) + "\", \"" + ext::to_string ( key.second ) + "\") -> \"" + ext::to_string ( to ) + "\"." ); } transitions.insert ( std::make_pair ( std::move ( key ), std::move ( to ) ) ); @@ -250,7 +250,7 @@ bool DFA<SymbolType, StateType>::removeTransition ( const StateType & from, cons return false; if ( transitions.find ( key )->second != to ) - throw AutomatonException ( "Transition (\"" + std::to_string ( from ) + "\", \"" + std::to_string ( input ) + "\") -> \"" + std::to_string ( to ) + "\" doesn't exist." ); + throw AutomatonException ( "Transition (\"" + ext::to_string ( from ) + "\", \"" + ext::to_string ( input ) + "\") -> \"" + ext::to_string ( to ) + "\" doesn't exist." ); transitions.erase ( key ); return true; @@ -283,7 +283,7 @@ const std::map < std::pair < StateType, SymbolType >, StateType > & DFA<SymbolTy template<class SymbolType, class StateType > std::range < typename std::map < std::pair < StateType, SymbolType >, StateType >::const_iterator > DFA<SymbolType, StateType>::getTransitionsFromState ( const StateType & from ) const { if ( !getStates ( ).count ( from ) ) - throw AutomatonException ( "State \"" + std::to_string ( from ) + "\" doesn't exist" ); + throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist" ); typename std::map < std::pair < StateType, SymbolType >, StateType >::const_iterator lower = transitions.begin ( ); while ( lower != transitions.end ( ) && lower->first.first < from ) { ++ lower; @@ -300,7 +300,7 @@ std::range < typename std::map < std::pair < StateType, SymbolType >, StateType template<class SymbolType, class StateType > std::map < std::pair < StateType, SymbolType >, StateType > DFA<SymbolType, StateType>::getTransitionsToState ( const StateType & to ) const { if ( !getStates ( ).count ( to ) ) - throw AutomatonException ( "State \"" + std::to_string ( to ) + "\" doesn't exist" ); + throw AutomatonException ( "State \"" + ext::to_string ( to ) + "\" doesn't exist" ); std::map < std::pair < StateType, SymbolType >, StateType > transitionsToState; diff --git a/alib2data/src/automaton/FSM/EpsilonNFA.h b/alib2data/src/automaton/FSM/EpsilonNFA.h index f10a9e5999f02e01eebe3d3f3715a1c39c5f59e9..cc4e806adeba496c8d6b7fc1ae3bdf1ee5341bd1 100644 --- a/alib2data/src/automaton/FSM/EpsilonNFA.h +++ b/alib2data/src/automaton/FSM/EpsilonNFA.h @@ -359,13 +359,13 @@ AutomatonBase * EpsilonNFA < SymbolType, EpsilonType, StateType >::plunder ( ) & template<class SymbolType, class EpsilonType, class StateType > bool EpsilonNFA < SymbolType, EpsilonType, StateType >::addTransition ( StateType from, std::variant < EpsilonType, SymbolType > input, StateType to ) { if ( !getStates ( ).count ( from ) ) - throw AutomatonException ( "State \"" + std::to_string ( from ) + "\" doesn't exist." ); + throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist." ); if ( input.template is < SymbolType > ( ) && !getInputAlphabet ( ).count ( input.template get < SymbolType > ( ) ) ) - throw AutomatonException ( "Input symbol \"" + std::to_string ( input.template get < SymbolType > ( ) ) + "\" doesn't exist." ); + throw AutomatonException ( "Input symbol \"" + ext::to_string ( input.template get < SymbolType > ( ) ) + "\" doesn't exist." ); if ( !getStates ( ).count ( to ) ) - throw AutomatonException ( "State \"" + std::to_string ( to ) + "\" doesn't exist." ); + throw AutomatonException ( "State \"" + ext::to_string ( to ) + "\" doesn't exist." ); std::pair < StateType, std::variant < EpsilonType, SymbolType > > key = std::make_pair ( std::move ( from ), std::move ( input ) ); @@ -389,10 +389,10 @@ bool EpsilonNFA < SymbolType, EpsilonType, StateType >::addTransition ( StateTyp template < class SymbolType, class EpsilonType, class StateType > void EpsilonNFA < SymbolType, EpsilonType, StateType >::addTransitions ( StateType from, std::variant < EpsilonType, SymbolType > input, std::set < StateType > to ) { if ( !getStates ( ).count ( from ) ) - throw AutomatonException ( "State \"" + std::to_string ( from ) + "\" doesn't exist." ); + throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist." ); if ( input.template is < SymbolType > ( ) && !getInputAlphabet ( ).count ( input.template get < SymbolType > ( ) ) ) - throw AutomatonException ( "Input symbol \"" + std::to_string ( input.template get < SymbolType > ( ) ) + "\" doesn't exist." ); + throw AutomatonException ( "Input symbol \"" + ext::to_string ( input.template get < SymbolType > ( ) ) + "\" doesn't exist." ); if ( !std::includes ( getStates ( ).begin ( ), getStates ( ).end ( ), to.begin ( ), to.end ( ) ) ) throw AutomatonException ( "Some target states don't exist." ); @@ -463,7 +463,7 @@ std::map < std::pair < StateType, SymbolType >, std::set < StateType > > Epsilon template<class SymbolType, class EpsilonType, class StateType > std::map < std::pair < StateType, std::variant < EpsilonType, SymbolType > >, std::set < StateType > > EpsilonNFA < SymbolType, EpsilonType, StateType >::getTransitionsFromState ( const StateType & from ) const { if ( !getStates ( ).count ( from ) ) - throw AutomatonException ( "State \"" + std::to_string ( from ) + "\" doesn't exist" ); + throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist" ); std::map < std::pair < StateType, std::variant < EpsilonType, SymbolType > >, std::set < StateType > > transitionsFromState; @@ -477,7 +477,7 @@ std::map < std::pair < StateType, std::variant < EpsilonType, SymbolType > >, st template<class SymbolType, class EpsilonType, class StateType > std::map < StateType, std::set < StateType > > EpsilonNFA < SymbolType, EpsilonType, StateType >::getEpsilonTransitionsFromState ( const StateType & from ) const { if ( !getStates ( ).count ( from ) ) - throw AutomatonException ( "State \"" + std::to_string ( from ) + "\" doesn't exist" ); + throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist" ); std::pair < StateType, std::variant < EpsilonType, SymbolType > > key ( from, std::variant < EpsilonType, SymbolType >::template from < EpsilonType > ( ) ); std::map < StateType, std::set < StateType > > res; @@ -492,7 +492,7 @@ std::map < StateType, std::set < StateType > > EpsilonNFA < SymbolType, EpsilonT template<class SymbolType, class EpsilonType, class StateType > std::map < std::pair < StateType, SymbolType >, std::set < StateType > > EpsilonNFA < SymbolType, EpsilonType, StateType >::getSymbolTransitionsFromState ( const StateType & from ) const { if ( !getStates ( ).count ( from ) ) - throw AutomatonException ( "State \"" + std::to_string ( from ) + "\" doesn't exist" ); + throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist" ); std::map < std::pair < StateType, SymbolType >, std::set < StateType > > transitionsFromState; @@ -506,7 +506,7 @@ std::map < std::pair < StateType, SymbolType >, std::set < StateType > > Epsilon template<class SymbolType, class EpsilonType, class StateType > std::map < std::pair < StateType, std::variant < EpsilonType, SymbolType > >, std::set < StateType > > EpsilonNFA < SymbolType, EpsilonType, StateType >::getTransitionsToState ( const StateType & to ) const { if ( !getStates ( ).count ( to ) ) - throw AutomatonException ( "State \"" + std::to_string ( to ) + "\" doesn't exist" ); + throw AutomatonException ( "State \"" + ext::to_string ( to ) + "\" doesn't exist" ); std::map < std::pair < StateType, std::variant < EpsilonType, SymbolType > >, std::set < StateType > > transitionsToState; @@ -520,7 +520,7 @@ std::map < std::pair < StateType, std::variant < EpsilonType, SymbolType > >, st template<class SymbolType, class EpsilonType, class StateType > std::map < StateType, std::set < StateType > > EpsilonNFA < SymbolType, EpsilonType, StateType >::getEpsilonTransitionsToState ( const StateType & to ) const { if ( !getStates ( ).count ( to ) ) - throw AutomatonException ( "State \"" + std::to_string ( to ) + "\" doesn't exist" ); + throw AutomatonException ( "State \"" + ext::to_string ( to ) + "\" doesn't exist" ); std::map < StateType, std::set < StateType > > transitionsToState; @@ -534,7 +534,7 @@ std::map < StateType, std::set < StateType > > EpsilonNFA < SymbolType, EpsilonT template<class SymbolType, class EpsilonType, class StateType > std::map < std::pair < StateType, SymbolType >, std::set < StateType > > EpsilonNFA < SymbolType, EpsilonType, StateType >::getSymbolTransitionsToState ( const StateType & to ) const { if ( !getStates ( ).count ( to ) ) - throw AutomatonException ( "State \"" + std::to_string ( to ) + "\" doesn't exist" ); + throw AutomatonException ( "State \"" + ext::to_string ( to ) + "\" doesn't exist" ); std::map < std::pair < StateType, SymbolType >, std::set < StateType > > transitionsToState; diff --git a/alib2data/src/automaton/FSM/ExtendedNFA.h b/alib2data/src/automaton/FSM/ExtendedNFA.h index 76794767aeb596bb1b63215ce846d59636adfa72..34e2ff050a29bfef325e27816092a56d74aa48db 100644 --- a/alib2data/src/automaton/FSM/ExtendedNFA.h +++ b/alib2data/src/automaton/FSM/ExtendedNFA.h @@ -297,7 +297,7 @@ AutomatonBase * ExtendedNFA < SymbolType, StateType >::plunder ( ) && { template<class SymbolType, class StateType > bool ExtendedNFA < SymbolType, StateType >::addTransition ( StateType from, regexp::UnboundedRegExpStructure < SymbolType > input, StateType to ) { if ( !getStates ( ).count ( from ) ) - throw AutomatonException ( "State \"" + std::to_string ( from ) + "\" doesn't exist." ); + throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist." ); std::set < SymbolType > inputRegExpAlphabet = input.getStructure ( ).computeMinimalAlphabet ( ); @@ -306,7 +306,7 @@ bool ExtendedNFA < SymbolType, StateType >::addTransition ( StateType from, rege throw AutomatonException ( "Input string is over different alphabet than automaton" ); if ( !getStates ( ).count ( to ) ) - throw AutomatonException ( "State \"" + std::to_string ( to ) + "\" doesn't exist." ); + throw AutomatonException ( "State \"" + ext::to_string ( to ) + "\" doesn't exist." ); std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType > > key = std::make_pair ( std::move ( from ), std::move ( input ) ); @@ -316,7 +316,7 @@ bool ExtendedNFA < SymbolType, StateType >::addTransition ( StateType from, rege template<class SymbolType, class StateType > void ExtendedNFA < SymbolType, StateType >::addTransitions ( StateType from, regexp::UnboundedRegExpStructure < SymbolType > input, std::set < StateType > to ) { if ( !getStates ( ).count ( from ) ) - throw AutomatonException ( "State \"" + std::to_string ( from ) + "\" doesn't exist." ); + throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist." ); std::set < SymbolType > inputRegExpAlphabet = input.getStructure ( ).computeMinimalAlphabet ( ); @@ -347,7 +347,7 @@ const std::map < std::pair < StateType, regexp::UnboundedRegExpStructure < Symbo template<class SymbolType, class StateType > std::map < std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType > >, std::set < StateType > > ExtendedNFA < SymbolType, StateType >::getTransitionsFromState ( const StateType & from ) const { if ( !getStates ( ).count ( from ) ) - throw AutomatonException ( "State \"" + std::to_string ( from ) + "\" doesn't exist" ); + throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist" ); std::map < std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType > >, std::set < StateType > > transitionsFromState; @@ -361,7 +361,7 @@ std::map < std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType template<class SymbolType, class StateType > std::map < std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType > >, std::set < StateType > > ExtendedNFA < SymbolType, StateType >::getTransitionsToState ( const StateType & to ) const { if ( !getStates ( ).count ( to ) ) - throw AutomatonException ( "State \"" + std::to_string ( to ) + "\" doesn't exist" ); + throw AutomatonException ( "State \"" + ext::to_string ( to ) + "\" doesn't exist" ); std::map < std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType > >, std::set < StateType > > transitionsToState; diff --git a/alib2data/src/automaton/FSM/MultiInitialStateNFA.h b/alib2data/src/automaton/FSM/MultiInitialStateNFA.h index 84bfc5496fee25589fb20feb0209b1eace2fa749..3a7b4c2b0c63742863c0354cae7e414599bcab59 100644 --- a/alib2data/src/automaton/FSM/MultiInitialStateNFA.h +++ b/alib2data/src/automaton/FSM/MultiInitialStateNFA.h @@ -266,13 +266,13 @@ AutomatonBase * MultiInitialStateNFA < SymbolType, StateType >::plunder ( ) && { template < class SymbolType, class StateType > bool MultiInitialStateNFA < SymbolType, StateType >::addTransition ( StateType from, SymbolType input, StateType to ) { if ( !getStates ( ).count ( from ) ) - throw AutomatonException ( "State \"" + std::to_string ( from ) + "\" doesn't exist." ); + throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist." ); if ( !getInputAlphabet ( ).count ( input ) ) - throw AutomatonException ( "Input symbol \"" + std::to_string ( input ) + "\" doesn't exist." ); + throw AutomatonException ( "Input symbol \"" + ext::to_string ( input ) + "\" doesn't exist." ); if ( !getStates ( ).count ( to ) ) - throw AutomatonException ( "State \"" + std::to_string ( to ) + "\" doesn't exist." ); + throw AutomatonException ( "State \"" + ext::to_string ( to ) + "\" doesn't exist." ); std::pair < StateType, SymbolType > key = std::make_pair ( std::move ( from ), std::move ( input ) ); @@ -282,10 +282,10 @@ bool MultiInitialStateNFA < SymbolType, StateType >::addTransition ( StateType f template < class SymbolType, class StateType > void MultiInitialStateNFA < SymbolType, StateType >::addTransitions ( StateType from, SymbolType input, std::set < StateType > to ) { if ( !getStates ( ).count ( from ) ) - throw AutomatonException ( "State \"" + std::to_string ( from ) + "\" doesn't exist." ); + throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist." ); if ( !getInputAlphabet ( ).count ( input ) ) - throw AutomatonException ( "Input symbol \"" + std::to_string ( input ) + "\" doesn't exist." ); + throw AutomatonException ( "Input symbol \"" + ext::to_string ( input ) + "\" doesn't exist." ); if ( !std::includes ( getStates ( ).begin ( ), getStates ( ).end ( ), to.begin ( ), to.end ( ) ) ) throw AutomatonException ( "Some target states don't exist." ); @@ -310,7 +310,7 @@ const std::map < std::pair < StateType, SymbolType >, std::set < StateType > > & template < class SymbolType, class StateType > std::map < std::pair < StateType, SymbolType >, std::set < StateType > > MultiInitialStateNFA < SymbolType, StateType >::getTransitionsFromState ( const StateType & from ) const { if ( !getStates ( ).count ( from ) ) - throw AutomatonException ( "State \"" + std::to_string ( from ) + "\" doesn't exist" ); + throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist" ); std::map < std::pair < StateType, SymbolType >, std::set < StateType > > transitionsFromState; @@ -324,7 +324,7 @@ std::map < std::pair < StateType, SymbolType >, std::set < StateType > > MultiIn template < class SymbolType, class StateType > std::map < std::pair < StateType, SymbolType >, std::set < StateType > > MultiInitialStateNFA < SymbolType, StateType >::getTransitionsToState ( const StateType & to ) const { if ( !getStates ( ).count ( to ) ) - throw AutomatonException ( "State \"" + std::to_string ( to ) + "\" doesn't exist" ); + throw AutomatonException ( "State \"" + ext::to_string ( to ) + "\" doesn't exist" ); std::map < std::pair < StateType, SymbolType >, std::set < StateType > > transitionsToState; diff --git a/alib2data/src/automaton/FSM/NFA.h b/alib2data/src/automaton/FSM/NFA.h index f5762b03b6f8f3a36731dc9bf36b0ac48750aa4e..2a5798a9254d460030d43d2ae6b1b44c297169f7 100644 --- a/alib2data/src/automaton/FSM/NFA.h +++ b/alib2data/src/automaton/FSM/NFA.h @@ -251,13 +251,13 @@ AutomatonBase * NFA < SymbolType, StateType >::plunder ( ) && { template<class SymbolType, class StateType > bool NFA < SymbolType, StateType >::addTransition ( StateType from, SymbolType input, StateType to ) { if ( !getStates ( ).count ( from ) ) - throw AutomatonException ( "State \"" + std::to_string ( from ) + "\" doesn't exist." ); + throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist." ); if ( !getInputAlphabet ( ).count ( input ) ) - throw AutomatonException ( "Input symbol \"" + std::to_string ( input ) + "\" doesn't exist." ); + throw AutomatonException ( "Input symbol \"" + ext::to_string ( input ) + "\" doesn't exist." ); if ( !getStates ( ).count ( to ) ) - throw AutomatonException ( "State \"" + std::to_string ( to ) + "\" doesn't exist." ); + throw AutomatonException ( "State \"" + ext::to_string ( to ) + "\" doesn't exist." ); std::pair < StateType, SymbolType > key = std::make_pair ( std::move ( from ), std::move ( input ) ); @@ -267,10 +267,10 @@ bool NFA < SymbolType, StateType >::addTransition ( StateType from, SymbolType i template < class SymbolType, class StateType > void NFA < SymbolType, StateType >::addTransitions ( StateType from, SymbolType input, std::set < StateType > to ) { if ( !getStates ( ).count ( from ) ) - throw AutomatonException ( "State \"" + std::to_string ( from ) + "\" doesn't exist." ); + throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist." ); if ( !getInputAlphabet ( ).count ( input ) ) - throw AutomatonException ( "Input symbol \"" + std::to_string ( input ) + "\" doesn't exist." ); + throw AutomatonException ( "Input symbol \"" + ext::to_string ( input ) + "\" doesn't exist." ); if ( !std::includes ( getStates ( ).begin ( ), getStates ( ).end ( ), to.begin ( ), to.end ( ) ) ) throw AutomatonException ( "Some target states don't exist." ); @@ -295,7 +295,7 @@ const std::map < std::pair < StateType, SymbolType >, std::set < StateType > > & template<class SymbolType, class StateType > std::map < std::pair < StateType, SymbolType >, std::set < StateType > > NFA < SymbolType, StateType >::getTransitionsFromState ( const StateType & from ) const { if ( !getStates ( ).count ( from ) ) - throw AutomatonException ( "State \"" + std::to_string ( from ) + "\" doesn't exist" ); + throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist" ); std::map < std::pair < StateType, SymbolType >, std::set < StateType > > transitionsFromState; @@ -309,7 +309,7 @@ std::map < std::pair < StateType, SymbolType >, std::set < StateType > > NFA < S template<class SymbolType, class StateType > std::map < std::pair < StateType, SymbolType >, std::set < StateType > > NFA < SymbolType, StateType >::getTransitionsToState ( const StateType & to ) const { if ( !getStates ( ).count ( to ) ) - throw AutomatonException ( "State \"" + std::to_string ( to ) + "\" doesn't exist" ); + throw AutomatonException ( "State \"" + ext::to_string ( to ) + "\" doesn't exist" ); std::map < std::pair < StateType, SymbolType >, std::set < StateType > > transitionsToState; diff --git a/alib2data/src/automaton/PDA/DPDA.h b/alib2data/src/automaton/PDA/DPDA.h index fe31534568446e69f28d4b0e5f8d2903482c8556..976f0a370e260c1eeddc3d137a5dbc06b9fb1ea7 100644 --- a/alib2data/src/automaton/PDA/DPDA.h +++ b/alib2data/src/automaton/PDA/DPDA.h @@ -259,26 +259,26 @@ AutomatonBase* DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, Sta template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > bool DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::addTransition(StateType from, std::variant<EpsilonType, InputSymbolType> input, std::vector < PushdownStoreSymbolType > pop, StateType to, std::vector < PushdownStoreSymbolType > push) { if (! getStates().count(from)) { - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); } if (input.template is < InputSymbolType > ( ) && ! getInputAlphabet().count ( input.template get < InputSymbolType > ( ) ) ) { - throw AutomatonException("Input symbol \"" + std::to_string ( input.template get < InputSymbolType > ( ) ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input.template get < InputSymbolType > ( ) ) + "\" doesn't exist."); } if (! getStates().count(to)) { - throw AutomatonException("State \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist."); } for(const PushdownStoreSymbolType & popSymbol : pop) { if (! getPushdownStoreAlphabet().count(popSymbol)) { - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( popSymbol ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( popSymbol ) + "\" doesn't exist."); } } for(const PushdownStoreSymbolType & pushSymbol : push) { if (! getPushdownStoreAlphabet().count(pushSymbol)) { - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( pushSymbol ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( pushSymbol ) + "\" doesn't exist."); } } @@ -290,10 +290,10 @@ bool DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >:: return false; else if (std::get<1>(key).template is<InputSymbolType>()) throw AutomatonException( - "Transition (\"" + std::to_string ( std::get<0>(key) ) + "\", \"" + std::to_string ( std::get<1>(key).template get<InputSymbolType>() ) + "\", \"pop\") -> ?? already exists."); + "Transition (\"" + ext::to_string ( std::get<0>(key) ) + "\", \"" + ext::to_string ( std::get<1>(key).template get<InputSymbolType>() ) + "\", \"pop\") -> ?? already exists."); else throw AutomatonException( - "Transition (\"" + std::to_string ( std::get<0>(key) ) + "\", \"" + std::to_string ( std::get<1>(key).template get<EpsilonType>() ) + "\", \"pop\") -> ?? already exists."); + "Transition (\"" + ext::to_string ( std::get<0>(key) ) + "\", \"" + ext::to_string ( std::get<1>(key).template get<EpsilonType>() ) + "\", \"pop\") -> ?? already exists."); } if(std::get<1>(key).template is<EpsilonType>()) { @@ -359,10 +359,10 @@ bool DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >:: if(transitions.find(key)->second != value) { if (input.template is < InputSymbolType > ( ) ) throw AutomatonException( - "Transition (\"" + std::to_string ( from ) + "\", \"" + std::to_string ( input.template get < InputSymbolType > ( ) ) + "\") -> \"to\" doesn't exist."); + "Transition (\"" + ext::to_string ( from ) + "\", \"" + ext::to_string ( input.template get < InputSymbolType > ( ) ) + "\") -> \"to\" doesn't exist."); else throw AutomatonException( - "Transition (\"" + std::to_string ( from ) + "\", \"" + std::to_string ( input.template get<EpsilonType>() ) + "\") -> \"to\" doesn't exist."); + "Transition (\"" + ext::to_string ( from ) + "\", \"" + ext::to_string ( input.template get<EpsilonType>() ) + "\") -> \"to\" doesn't exist."); } transitions.erase(key); @@ -389,7 +389,7 @@ const std::map<std::tuple<StateType, std::variant<EpsilonType, InputSymbolType > template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > std::map<std::tuple<StateType, std::variant<EpsilonType, InputSymbolType>, std::vector<PushdownStoreSymbolType> >, std::pair<StateType, std::vector<PushdownStoreSymbolType> > > DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getTransitionsFromState(const StateType& from) const { if( ! getStates().count(from) ) - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist"); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist"); std::map<std::tuple<StateType, std::variant<EpsilonType, InputSymbolType>, std::vector<PushdownStoreSymbolType> >, std::pair<StateType, std::vector<PushdownStoreSymbolType> > > transitionsFromState; for (const std::pair<const std::tuple<StateType, std::variant<EpsilonType, InputSymbolType>, std::vector<PushdownStoreSymbolType> >, std::pair<StateType, std::vector<PushdownStoreSymbolType> > >& transition : transitions) { @@ -404,7 +404,7 @@ std::map<std::tuple<StateType, std::variant<EpsilonType, InputSymbolType>, std:: template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > std::map<std::tuple<StateType, std::variant<EpsilonType, InputSymbolType>, std::vector<PushdownStoreSymbolType> >, std::pair<StateType, std::vector<PushdownStoreSymbolType> > > DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getTransitionsToState(const StateType& to) const { if( ! getStates().count(to)) - throw AutomatonException("State \"" + std::to_string ( to ) + "\" doesn't exist"); + throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist"); std::map<std::tuple<StateType, std::variant<EpsilonType, InputSymbolType>, std::vector<PushdownStoreSymbolType> >, std::pair<StateType, std::vector<PushdownStoreSymbolType> > > transitionsToState; for (const std::pair<const std::tuple<StateType, std::variant<EpsilonType, InputSymbolType>, std::vector<PushdownStoreSymbolType> >, std::pair<StateType, std::vector<PushdownStoreSymbolType> > >& transition : transitions) { diff --git a/alib2data/src/automaton/PDA/InputDrivenDPDA.h b/alib2data/src/automaton/PDA/InputDrivenDPDA.h index 6b73a6b2c1a5c216b644b2aee270ec4f38d03560..18d84c4ba350172b1af2c672bc88d2c347b40ae7 100644 --- a/alib2data/src/automaton/PDA/InputDrivenDPDA.h +++ b/alib2data/src/automaton/PDA/InputDrivenDPDA.h @@ -269,18 +269,18 @@ AutomatonBase* InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, State template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > void InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::checkPushdownStoreOperation(const InputSymbolType& input, const std::vector<PushdownStoreSymbolType>& pop, const std::vector<PushdownStoreSymbolType>& push) { if (! getInputAlphabet().count(input)) { - throw AutomatonException("Input symbol \"" + std::to_string ( input ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input ) + "\" doesn't exist."); } for(const PushdownStoreSymbolType& popSymbol : pop) { if (! getPushdownStoreAlphabet().count(popSymbol)) { - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( popSymbol ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( popSymbol ) + "\" doesn't exist."); } } for(const PushdownStoreSymbolType& pushSymbol : push) { if (! getPushdownStoreAlphabet().count(pushSymbol)) { - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( pushSymbol ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( pushSymbol ) + "\" doesn't exist."); } } } @@ -311,7 +311,7 @@ template < class InputSymbolType, class PushdownStoreSymbolType, class StateType bool InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::clearPushdownStoreOperation(const InputSymbolType& input) { for (const std::pair<const std::pair<StateType, InputSymbolType>, StateType>& transition : transitions) { if (transition.first.second == input) - throw AutomatonException("Input symbol \"" + std::to_string ( input ) + "\" is used."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input ) + "\" is used."); } return inputSymbolToPushdownStoreOperation.erase(input); @@ -325,16 +325,16 @@ const std::map < InputSymbolType, std::pair<std::vector<PushdownStoreSymbolType> template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > bool InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::addTransition(StateType from, InputSymbolType input, StateType to) { if (!getStates().count(from)) - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); if (!getInputAlphabet().count(input)) - throw AutomatonException("Input symbol \"" + std::to_string ( input ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input ) + "\" doesn't exist."); if (! getPushdownStoreOperations().count(input)) - throw AutomatonException("Input symbol \"" + std::to_string ( input ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input ) + "\" doesn't exist."); if (! getStates().count(to)) - throw AutomatonException("State \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist."); std::pair<StateType, InputSymbolType> key = std::make_pair(std::move(from), std::move(input)); @@ -342,7 +342,7 @@ bool InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::ad if(transitions.find(key)->second == to) return false; else - throw AutomatonException( "Transition from this state and symbol already exists (\"" + std::to_string ( key.first ) + "\", \"" + std::to_string ( key.second ) + "\") -> \"" + std::to_string ( to ) + "\"." ); + throw AutomatonException( "Transition from this state and symbol already exists (\"" + ext::to_string ( key.first ) + "\", \"" + ext::to_string ( key.second ) + "\") -> \"" + ext::to_string ( to ) + "\"." ); } transitions.insert(std::make_pair(std::move(key), std::move(to))); @@ -357,7 +357,7 @@ bool InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::re return false; if(transitions.find(key)->second != to) - throw AutomatonException( "Transition (\"" + std::to_string ( from ) + "\", \"" + std::to_string ( input ) + "\") -> \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException( "Transition (\"" + ext::to_string ( from ) + "\", \"" + ext::to_string ( input ) + "\") -> \"" + ext::to_string ( to ) + "\" doesn't exist."); transitions.erase(key); return true; @@ -371,7 +371,7 @@ const std::map<std::pair<StateType, InputSymbolType>, StateType>& InputDrivenDPD template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > std::map<std::pair<StateType, InputSymbolType>, StateType > InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getTransitionsFromState(const StateType& from) const { if( ! getStates().count(from)) - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist"); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist"); std::map<std::pair<StateType, InputSymbolType>, StateType> transitionsFromState; for (const std::pair<const std::pair<StateType, InputSymbolType>, StateType>& transition : transitions) { @@ -386,7 +386,7 @@ std::map<std::pair<StateType, InputSymbolType>, StateType > InputDrivenDPDA < In template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > std::map<std::pair<StateType, InputSymbolType>, StateType> InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getTransitionsToState(const StateType& to) const { if( ! getStates().count(to)) - throw AutomatonException("State \"" + std::to_string ( to ) + "\" doesn't exist"); + throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist"); std::map<std::pair<StateType, InputSymbolType>, StateType> transitionsToState; for (const std::pair<const std::pair<StateType, InputSymbolType>, StateType>& transition : transitions) { diff --git a/alib2data/src/automaton/PDA/InputDrivenNPDA.h b/alib2data/src/automaton/PDA/InputDrivenNPDA.h index 9f23d9a1cc67ea7ea4433173aeddface4f91aff1..3ba0ce7ac07fc615e41e316be707b6f2f6c2b3fc 100644 --- a/alib2data/src/automaton/PDA/InputDrivenNPDA.h +++ b/alib2data/src/automaton/PDA/InputDrivenNPDA.h @@ -278,18 +278,18 @@ AutomatonBase* InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, State template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > void InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::checkPushdownStoreOperation(const InputSymbolType& input, const std::vector<PushdownStoreSymbolType>& pop, const std::vector<PushdownStoreSymbolType>& push) { if (! getInputAlphabet().count(input)) { - throw AutomatonException("Input symbol \"" + std::to_string ( input ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input ) + "\" doesn't exist."); } for(const PushdownStoreSymbolType& popSymbol : pop) { if (! getPushdownStoreAlphabet().count(popSymbol)) { - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( popSymbol ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( popSymbol ) + "\" doesn't exist."); } } for(const PushdownStoreSymbolType& pushSymbol : push) { if (! getPushdownStoreAlphabet().count(pushSymbol)) { - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( pushSymbol ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( pushSymbol ) + "\" doesn't exist."); } } } @@ -320,7 +320,7 @@ template < class InputSymbolType, class PushdownStoreSymbolType, class StateType bool InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::clearPushdownStoreOperation(const InputSymbolType& input) { for (const std::pair<const std::pair<StateType, InputSymbolType>, std::set<StateType > >& transition : transitions) { if (transition.first.second == input) - throw AutomatonException("Input symbol \"" + std::to_string ( input ) + "\" is used."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input ) + "\" is used."); } return inputSymbolToPushdownStoreOperation.erase(input); @@ -334,16 +334,16 @@ const std::map < InputSymbolType, std::pair<std::vector<PushdownStoreSymbolType> template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > bool InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::addTransition(StateType from, InputSymbolType input, StateType to) { if (! getStates().count(from)) - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); if (! getInputAlphabet().count(input)) - throw AutomatonException("Input symbol \"" + std::to_string ( input ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input ) + "\" doesn't exist."); if (! getPushdownStoreOperations().count(input)) - throw AutomatonException("Input symbol \"" + std::to_string ( input ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input ) + "\" doesn't exist."); if (! getStates().count(to)) - throw AutomatonException("State \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist."); std::pair<StateType, InputSymbolType> key = std::make_pair(std::move(from), std::move(input)); @@ -353,13 +353,13 @@ bool InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::ad template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > void InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::addTransitions ( StateType from, InputSymbolType input, std::set < StateType > to) { if (! getStates().count(from)) - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); if (! getInputAlphabet().count(input)) - throw AutomatonException("Input symbol \"" + std::to_string ( input ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input ) + "\" doesn't exist."); if (! getPushdownStoreOperations().count(input)) - throw AutomatonException("Input symbol \"" + std::to_string ( input ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input ) + "\" doesn't exist."); if ( !std::includes ( getStates ( ).begin ( ), getStates ( ).end ( ), to.begin ( ), to.end ( ) ) ) throw AutomatonException ( "Some target states don't exist." ); @@ -383,7 +383,7 @@ const std::map<std::pair < StateType, InputSymbolType >, std::set<StateType > >& template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > std::map<std::pair<StateType, InputSymbolType>, std::set<StateType > > InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getTransitionsFromState(const StateType& from) const { if (! getStates().count(from)) - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist"); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist"); std::map<std::pair<StateType, InputSymbolType>, std::set<StateType > > transitionsFromState; for (const std::pair<const std::pair < StateType, InputSymbolType>, std::set<StateType > >& transition : transitions) { @@ -398,7 +398,7 @@ std::map<std::pair<StateType, InputSymbolType>, std::set<StateType > > InputDriv template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > std::map<std::pair<StateType, InputSymbolType>, std::set<StateType > > InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getTransitionsToState(const StateType& to) const { if (! getStates().count(to)) - throw AutomatonException("State \"" + std::to_string ( to ) + "\" doesn't exist"); + throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist"); std::map<std::pair<StateType, InputSymbolType>, std::set<StateType > > transitionsToState; for (const std::pair<const std::pair<StateType, InputSymbolType>, std::set<StateType > >& transition : transitions) { diff --git a/alib2data/src/automaton/PDA/NPDA.h b/alib2data/src/automaton/PDA/NPDA.h index 644459b42fad2304b6d2236395143fc2b15916cd..69860da1d0dea1fc4c8cfd626702ec7defe19415 100644 --- a/alib2data/src/automaton/PDA/NPDA.h +++ b/alib2data/src/automaton/PDA/NPDA.h @@ -258,21 +258,21 @@ AutomatonBase* NPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, Sta template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > bool NPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::addTransition(StateType from, std::variant < EpsilonType, InputSymbolType > input, std::vector<PushdownStoreSymbolType> pop, StateType to, std::vector<PushdownStoreSymbolType> push) { if (! getStates().count(from)) - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); if (input.template is<InputSymbolType>() && ! getInputAlphabet().count(input.template get<InputSymbolType>())) - throw AutomatonException("Input symbol \"" + std::to_string ( input.template get<InputSymbolType>() ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input.template get<InputSymbolType>() ) + "\" doesn't exist."); if (! getStates().count(to)) - throw AutomatonException("State \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist."); for(const PushdownStoreSymbolType& popSymbol : pop) if (! getPushdownStoreAlphabet().count(popSymbol)) - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( popSymbol ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( popSymbol ) + "\" doesn't exist."); for(const PushdownStoreSymbolType& pushSymbol : push) if (! getPushdownStoreAlphabet().count(pushSymbol)) - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( pushSymbol ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( pushSymbol ) + "\" doesn't exist."); std::tuple<StateType, std::variant < EpsilonType, InputSymbolType >, std::vector<PushdownStoreSymbolType> > key(std::move(from), std::move(input), std::move(pop)); std::pair<StateType, std::vector<PushdownStoreSymbolType> > value = std::make_pair(std::move(to), std::move(push)); @@ -295,22 +295,22 @@ bool NPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >:: template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > void NPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::addTransitions ( StateType from, std::variant < EpsilonType, InputSymbolType > input, std::vector < PushdownStoreSymbolType > pop, std::set < std::pair < StateType, std::vector < PushdownStoreSymbolType > > > targets ) { if (! getStates().count(from)) - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); if (input.template is<InputSymbolType>() && ! getInputAlphabet().count(input.template get<InputSymbolType>())) - throw AutomatonException("Input symbol \"" + std::to_string ( input.template get<InputSymbolType>() ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input.template get<InputSymbolType>() ) + "\" doesn't exist."); for(const PushdownStoreSymbolType& popSymbol : pop) if (! getPushdownStoreAlphabet().count(popSymbol)) - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( popSymbol ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( popSymbol ) + "\" doesn't exist."); for ( const std::pair < StateType, std::vector < PushdownStoreSymbolType > > & target : targets ) { if (! getStates().count ( target.first ) ) - throw AutomatonException("State \"" + std::to_string ( target.first ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( target.first ) + "\" doesn't exist."); for ( const PushdownStoreSymbolType& pushSymbol : target.second ) if (! getPushdownStoreAlphabet().count(pushSymbol)) - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( pushSymbol ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( pushSymbol ) + "\" doesn't exist."); } std::tuple<StateType, std::variant < EpsilonType, InputSymbolType >, std::vector<PushdownStoreSymbolType> > key(std::move(from), std::move(input), std::move(pop)); diff --git a/alib2data/src/automaton/PDA/NPDTA.h b/alib2data/src/automaton/PDA/NPDTA.h index b79b3cdfd6407b6b46f0daf7ab33ec82c40f9c13..9cfe95bb37f7a526905cf4aa6928ac206cc87f1a 100644 --- a/alib2data/src/automaton/PDA/NPDTA.h +++ b/alib2data/src/automaton/PDA/NPDTA.h @@ -283,32 +283,32 @@ AutomatonBase* NPDTA < InputSymbolType, OutputSymbolType, EpsilonType, PushdownS template < class InputSymbolType, class OutputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > bool NPDTA < InputSymbolType, OutputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::addTransition(StateType from, std::variant < EpsilonType, InputSymbolType > input, std::vector<PushdownStoreSymbolType> pop, StateType to, std::vector<PushdownStoreSymbolType> push, std::vector < OutputSymbolType > output) { if (!getStates().count(from)) { - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); } if (input.template is < InputSymbolType >() && !getInputAlphabet().count(input.template get < InputSymbolType >())) { - throw AutomatonException("Input symbol \"" + std::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); } if (!getStates().count(to)) { - throw AutomatonException("State \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist."); } for(const PushdownStoreSymbolType& popSymbol : pop) { if (!getPushdownStoreAlphabet().count(popSymbol)) { - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( popSymbol ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( popSymbol ) + "\" doesn't exist."); } } for(const PushdownStoreSymbolType& pushSymbol : push) { if (!getPushdownStoreAlphabet().count(pushSymbol)) { - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( pushSymbol ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( pushSymbol ) + "\" doesn't exist."); } } for(const OutputSymbolType& outputSymbol : output) { if (!getOutputAlphabet().count(outputSymbol)) { - throw AutomatonException("Output symbol \"" + std::to_string ( outputSymbol ) + "\" doesn't exist."); + throw AutomatonException("Output symbol \"" + ext::to_string ( outputSymbol ) + "\" doesn't exist."); } } @@ -333,26 +333,26 @@ bool NPDTA < InputSymbolType, OutputSymbolType, EpsilonType, PushdownStoreSymbol template < class InputSymbolType, class OutputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > void NPDTA < InputSymbolType, OutputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::addTransitions ( StateType from, std::variant < EpsilonType, InputSymbolType > input, std::vector<PushdownStoreSymbolType> pop, std::set < std::tuple < StateType, std::vector < PushdownStoreSymbolType >, std::vector < OutputSymbolType > > > targets ) { if ( ! getStates ( ).count ( from ) ) - throw AutomatonException ( "State \"" + std::to_string ( from ) + "\" doesn't exist." ); + throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist." ); if ( input.template is < InputSymbolType > ( ) && ! getInputAlphabet ( ).count ( input.template get < InputSymbolType > ( ) ) ) - throw AutomatonException ( "Input symbol \"" + std::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist." ); + throw AutomatonException ( "Input symbol \"" + ext::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist." ); for ( const PushdownStoreSymbolType & popSymbol : pop) if (!getPushdownStoreAlphabet ( ).count ( popSymbol ) ) - throw AutomatonException ( "Pushdown store symbol \"" + std::to_string ( popSymbol ) + "\" doesn't exist." ); + throw AutomatonException ( "Pushdown store symbol \"" + ext::to_string ( popSymbol ) + "\" doesn't exist." ); for ( const std::tuple < StateType, std::vector < PushdownStoreSymbolType >, std::vector < OutputSymbolType > > & target : targets ) { if ( ! getStates ( ).count ( std::get < 0 > ( target ) ) ) - throw AutomatonException ( "State \"" + std::to_string ( std::get < 0 > ( target ) ) + "\" doesn't exist." ); + throw AutomatonException ( "State \"" + ext::to_string ( std::get < 0 > ( target ) ) + "\" doesn't exist." ); for ( const PushdownStoreSymbolType& pushSymbol : std::get < 1 > ( target ) ) if ( ! getPushdownStoreAlphabet ( ).count ( pushSymbol ) ) - throw AutomatonException ( "Pushdown store symbol \"" + std::to_string ( pushSymbol ) + "\" doesn't exist." ); + throw AutomatonException ( "Pushdown store symbol \"" + ext::to_string ( pushSymbol ) + "\" doesn't exist." ); for ( const OutputSymbolType& outputSymbol : std::get < 2 > ( target ) ) if ( ! getOutputAlphabet ( ).count ( outputSymbol ) ) - throw AutomatonException ( "Output symbol \"" + std::to_string ( outputSymbol ) + "\" doesn't exist." ); + throw AutomatonException ( "Output symbol \"" + ext::to_string ( outputSymbol ) + "\" doesn't exist." ); } std::tuple < StateType, std::variant < EpsilonType, InputSymbolType >, std::vector < PushdownStoreSymbolType > > key ( std::move ( from ), std::move ( input ), std::move ( pop ) ); @@ -400,7 +400,7 @@ const std::map<std::tuple<StateType, std::variant < EpsilonType, InputSymbolType template < class InputSymbolType, class OutputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > std::map < std::tuple < StateType, std::variant < EpsilonType, InputSymbolType >, std::vector < PushdownStoreSymbolType > >, std::tuple < StateType, std::vector < PushdownStoreSymbolType >, std::vector < OutputSymbolType > > > NPDTA < InputSymbolType, OutputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getTransitionsFromState ( const StateType & from ) const { if( !getStates().count(from)) - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist"); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist"); std::map < std::tuple < StateType, std::variant < EpsilonType, InputSymbolType >, std::vector < PushdownStoreSymbolType > >, std::tuple < StateType, std::vector < PushdownStoreSymbolType >, std::vector < PushdownStoreSymbolType > > > transitionsFromState; for ( auto transition: transitions ) { diff --git a/alib2data/src/automaton/PDA/RealTimeHeightDeterministicDPDA.h b/alib2data/src/automaton/PDA/RealTimeHeightDeterministicDPDA.h index c4e1fe237b01fc0339dbe0a2cabaa31a16f992f7..f65ec876fc7e1944919624dfac02bbf8dcdc882e 100644 --- a/alib2data/src/automaton/PDA/RealTimeHeightDeterministicDPDA.h +++ b/alib2data/src/automaton/PDA/RealTimeHeightDeterministicDPDA.h @@ -302,23 +302,23 @@ AutomatonBase* RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, P template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > bool RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::addCallTransition(StateType from, std::variant < EpsilonType, InputSymbolType > input, StateType to, PushdownStoreSymbolType push) { if (!getStates().count(from)) { - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); } if (input.template is < InputSymbolType >() && !getInputAlphabet().count(input.template get < InputSymbolType >())) { - throw AutomatonException("Input symbol \"" + std::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); } if (!getStates().count(to)) { - throw AutomatonException("State \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist."); } if (!getPushdownStoreAlphabet().count(push)) { - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( push ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( push ) + "\" doesn't exist."); } if(getBottomOfTheStackSymbol() == push) - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( push ) + "\" is bottom of the stack."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( push ) + "\" is bottom of the stack."); std::pair<StateType, std::variant < EpsilonType, InputSymbolType >> key(std::move(from), std::move(input)); std::pair<StateType, PushdownStoreSymbolType> value = std::make_pair(std::move(to), std::move(push)); @@ -329,27 +329,27 @@ bool RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownSto if(key.second.template is<EpsilonType>()) { for(const auto& transition : callTransitions) if(transition.first.first == key.first ) - throw AutomatonException("Can't add epsilon transition from state \"" + std::to_string ( key.first ) + "\" when other transitions are present."); + throw AutomatonException("Can't add epsilon transition from state \"" + ext::to_string ( key.first ) + "\" when other transitions are present."); for(const auto& transition : returnTransitions) if(std::get<0>(transition.first) == key.first) - throw AutomatonException("Can't add epsilon transition from state \"" + std::to_string ( key.first ) + "\" when other transitions are present."); + throw AutomatonException("Can't add epsilon transition from state \"" + ext::to_string ( key.first ) + "\" when other transitions are present."); for(const auto& transition : localTransitions) if(transition.first.first == key.first) - throw AutomatonException("Can't add epsilon transition from state \"" + std::to_string ( from ) + "\" when other transitions are present."); + throw AutomatonException("Can't add epsilon transition from state \"" + ext::to_string ( from ) + "\" when other transitions are present."); } else { for(const auto& transition : callTransitions) if(transition.first.first == key.first && (transition.first.second.template is<EpsilonType>() || transition.first.second == key.second)) - throw AutomatonException("Can't add transition from state \"" + std::to_string ( key.first ) + "\" when transition reading \"" + std::to_string ( key.second ) + "\" is present."); + throw AutomatonException("Can't add transition from state \"" + ext::to_string ( key.first ) + "\" when transition reading \"" + ext::to_string ( key.second ) + "\" is present."); for(const auto& transition : returnTransitions) if(std::get<0>(transition.first) == key.first && (std::get<1>(transition.first).template is<EpsilonType>() || std::get<1>(transition.first) == key.second)) - throw AutomatonException("Can't add transition from state \"" + std::to_string ( key.first ) + "\" when transition reading \"" + std::to_string ( key.second ) + "\" is present."); + throw AutomatonException("Can't add transition from state \"" + ext::to_string ( key.first ) + "\" when transition reading \"" + ext::to_string ( key.second ) + "\" is present."); for(const auto& transition : localTransitions) if(transition.first.first == key.first && (transition.first.second.template is<EpsilonType>() || transition.first.second == key.second)) - throw AutomatonException("Can't add transition from state \"" + std::to_string ( key.first ) + "\" when transition reading \"" + std::to_string ( key.second ) + "\" is present."); + throw AutomatonException("Can't add transition from state \"" + ext::to_string ( key.first ) + "\" when transition reading \"" + ext::to_string ( key.second ) + "\" is present."); } callTransitions.insert(std::make_pair(std::move(key), std::move(value))); @@ -371,19 +371,19 @@ bool RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownSto template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > bool RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::addReturnTransition(StateType from, std::variant < EpsilonType, InputSymbolType > input, PushdownStoreSymbolType pop, StateType to) { if (!getStates().count(from)) { - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); } if (input.template is < InputSymbolType >() && !getInputAlphabet().count(input.template get < InputSymbolType >())) { - throw AutomatonException("Input symbol \"" + std::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); } if (!getStates().count(to)) { - throw AutomatonException("State \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist."); } if (!getPushdownStoreAlphabet().count(pop)) { - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( pop ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( pop ) + "\" doesn't exist."); } std::tuple<StateType, std::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType> key(std::move(from), std::move(input), std::move(pop)); @@ -394,27 +394,27 @@ bool RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownSto if(std::get<1>(key).template is<EpsilonType>()) { for(const auto& transition : callTransitions) if(transition.first.first == std::get<0>(key) ) - throw AutomatonException("Can't add epsilon transition from state \"" + std::to_string ( std::get<0>(key) ) + "\" when other transitions are present."); + throw AutomatonException("Can't add epsilon transition from state \"" + ext::to_string ( std::get<0>(key) ) + "\" when other transitions are present."); for(const auto& transition : returnTransitions) if(std::get<0>(transition.first) == std::get<0>(key) && std::get<2>(transition.first) == std::get<2>(key)) - throw AutomatonException("Can't add epsilon transition from state \"" + std::to_string ( std::get<0>(key) ) + "\" when other transitions are present."); + throw AutomatonException("Can't add epsilon transition from state \"" + ext::to_string ( std::get<0>(key) ) + "\" when other transitions are present."); for(const auto& transition : localTransitions) if(transition.first.first == std::get<0>(key)) - throw AutomatonException("Can't add epsilon transition from state \"" + std::to_string ( std::get<0>(key) ) + "\" when other transitions are present."); + throw AutomatonException("Can't add epsilon transition from state \"" + ext::to_string ( std::get<0>(key) ) + "\" when other transitions are present."); } else { for(const auto& transition : callTransitions) if(transition.first.first == std::get<0>(key) && (transition.first.second.template is<EpsilonType>() || transition.first.second == std::get<1>(key))) - throw AutomatonException("Can't add transition from state \"" + std::to_string ( std::get<0>(key) ) + "\" when transition reading \"" + std::to_string ( std::get<1>(key) ) + "\" is present."); + throw AutomatonException("Can't add transition from state \"" + ext::to_string ( std::get<0>(key) ) + "\" when transition reading \"" + ext::to_string ( std::get<1>(key) ) + "\" is present."); for(const auto& transition : returnTransitions) if(std::get<0>(transition.first) == std::get<0>(key) && (std::get<1>(transition.first).template is<EpsilonType>() || std::get<1>(transition.first) == std::get<1>(key)) && std::get<2>(transition.first) == std::get<2>(key)) - throw AutomatonException("Can't add transition from state \"" + std::to_string ( std::get<0>(key) ) + "\" when transition reading \"" + std::to_string ( std::get<1>(key) ) + "\" is present."); + throw AutomatonException("Can't add transition from state \"" + ext::to_string ( std::get<0>(key) ) + "\" when transition reading \"" + ext::to_string ( std::get<1>(key) ) + "\" is present."); for(const auto& transition : localTransitions) if(transition.first.first == std::get<0>(key) && (transition.first.second.template is<EpsilonType>() || transition.first.second == std::get<1>(key))) - throw AutomatonException("Can't add transition from state \"" + std::to_string ( std::get<0>(key) ) + "\" when transition reading \"" + std::to_string ( std::get<1>(key) ) + "\" is present."); + throw AutomatonException("Can't add transition from state \"" + ext::to_string ( std::get<0>(key) ) + "\" when transition reading \"" + ext::to_string ( std::get<1>(key) ) + "\" is present."); } returnTransitions.insert(std::make_pair(std::move(key), std::move(to))); @@ -436,15 +436,15 @@ bool RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownSto template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > bool RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::addLocalTransition(StateType from, std::variant < EpsilonType, InputSymbolType > input, StateType to) { if (!getStates().count(from)) { - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); } if (input.template is < InputSymbolType >() && !getInputAlphabet().count(input.template get < InputSymbolType >())) { - throw AutomatonException("Input symbol \"" + std::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); } if (!getStates().count(to)) { - throw AutomatonException("State \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist."); } std::pair<StateType, std::variant < EpsilonType, InputSymbolType >> key(std::move(from), std::move(input)); @@ -455,27 +455,27 @@ bool RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownSto if(key.second.template is<EpsilonType>()) { for(const auto& transition : callTransitions) if(transition.first.first == key.first ) - throw AutomatonException("Can't add epsilon transition from state \"" + std::to_string ( key.first ) + "\" when other transitions are present."); + throw AutomatonException("Can't add epsilon transition from state \"" + ext::to_string ( key.first ) + "\" when other transitions are present."); for(const auto& transition : returnTransitions) if(std::get<0>(transition.first) == key.first) - throw AutomatonException("Can't add epsilon transition from state \"" + std::to_string ( key.first ) + "\" when other transitions are present."); + throw AutomatonException("Can't add epsilon transition from state \"" + ext::to_string ( key.first ) + "\" when other transitions are present."); for(const auto& transition : localTransitions) if(transition.first.first == key.first) - throw AutomatonException("Can't add epsilon transition from state \"" + std::to_string ( key.first ) + "\" when other transitions are present."); + throw AutomatonException("Can't add epsilon transition from state \"" + ext::to_string ( key.first ) + "\" when other transitions are present."); } else { for(const auto& transition : callTransitions) if(transition.first.first == key.first && (transition.first.second.template is<EpsilonType>() || transition.first.second == key.second)) - throw AutomatonException("Can't add transition from state \"" + std::to_string ( key.first ) + "\" when transition reading \"" + std::to_string ( key.second ) + "\" is present."); + throw AutomatonException("Can't add transition from state \"" + ext::to_string ( key.first ) + "\" when transition reading \"" + ext::to_string ( key.second ) + "\" is present."); for(const auto& transition : returnTransitions) if(std::get<0>(transition.first) == key.first && (std::get<1>(transition.first).template is<EpsilonType>() || std::get<1>(transition.first) == key.second)) - throw AutomatonException("Can't add transition from state \"" + std::to_string ( key.first ) + "\" when transition reading \"" + std::to_string ( key.second ) + "\" is present."); + throw AutomatonException("Can't add transition from state \"" + ext::to_string ( key.first ) + "\" when transition reading \"" + ext::to_string ( key.second ) + "\" is present."); for(const auto& transition : localTransitions) if(transition.first.first == key.first && (transition.first.second.template is<EpsilonType>() || transition.first.second == key.second)) - throw AutomatonException("Can't add transition from state \"" + std::to_string ( key.first ) + "\" when transition reading \"" + std::to_string ( key.second ) + "\" is present."); + throw AutomatonException("Can't add transition from state \"" + ext::to_string ( key.first ) + "\" when transition reading \"" + ext::to_string ( key.second ) + "\" is present."); } localTransitions.insert(std::make_pair(std::move(key), std::move(to))); @@ -503,7 +503,7 @@ bool RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownSto return false; if(callTransitions.find(key)->second != value) - throw AutomatonException("Transition (\"" + std::to_string ( from ) + "\", \"" + std::to_string ( input ) + "\") -> \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("Transition (\"" + ext::to_string ( from ) + "\", \"" + ext::to_string ( input ) + "\") -> \"" + ext::to_string ( to ) + "\" doesn't exist."); callTransitions.erase(key); return true; @@ -529,7 +529,7 @@ bool RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownSto return false; if(returnTransitions.find(key)->second != to) - throw AutomatonException("Transition (\"" + std::to_string ( from ) + "\", \"" + std::to_string ( input ) + "\") -> \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("Transition (\"" + ext::to_string ( from ) + "\", \"" + ext::to_string ( input ) + "\") -> \"" + ext::to_string ( to ) + "\" doesn't exist."); returnTransitions.erase(key); return true; @@ -555,7 +555,7 @@ bool RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownSto return false; if(localTransitions.find(key)->second != to) - throw AutomatonException("Transition (\"" + std::to_string ( from ) + "\", \"" + std::to_string ( input ) + "\") -> \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("Transition (\"" + ext::to_string ( from ) + "\", \"" + ext::to_string ( input ) + "\") -> \"" + ext::to_string ( to ) + "\" doesn't exist."); localTransitions.erase(key); return true; diff --git a/alib2data/src/automaton/PDA/RealTimeHeightDeterministicNPDA.h b/alib2data/src/automaton/PDA/RealTimeHeightDeterministicNPDA.h index e61a2220bfc7711d2b3915dd42f94f501ddb3a8d..6ea0eb56f64c882cfddd597b6f1422b87d0152f3 100644 --- a/alib2data/src/automaton/PDA/RealTimeHeightDeterministicNPDA.h +++ b/alib2data/src/automaton/PDA/RealTimeHeightDeterministicNPDA.h @@ -344,19 +344,19 @@ AutomatonBase* RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, P template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > bool RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::addCallTransition(StateType from, std::variant < EpsilonType, InputSymbolType > input, StateType to, PushdownStoreSymbolType push) { if (! getStates().count(from)) { - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); } if (input.template is < InputSymbolType >() && ! getInputAlphabet().count(input.template get < InputSymbolType >())) { - throw AutomatonException("Input symbol \"" + std::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); } if (! getStates().count(to)) { - throw AutomatonException("State \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist."); } if (! getPushdownStoreAlphabet().count(push)) { - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( push ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( push ) + "\" doesn't exist."); } std::pair<StateType, std::variant < EpsilonType, InputSymbolType >> key(std::move(from), std::move(input)); @@ -380,19 +380,19 @@ bool RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownSto template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > bool RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::addReturnTransition(StateType from, std::variant < EpsilonType, InputSymbolType > input, PushdownStoreSymbolType pop, StateType to) { if (! getStates().count(from)) { - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); } if (input.template is < InputSymbolType >() && !getInputAlphabet().count(input.template get < InputSymbolType >())) { - throw AutomatonException("Input symbol \"" + std::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); } if (! getStates().count(to)) { - throw AutomatonException("State \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist."); } if (! getPushdownStoreAlphabet().count(pop)) { - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( pop ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( pop ) + "\" doesn't exist."); } std::tuple<StateType, std::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType> key(std::move(from), std::move(input), std::move(pop)); @@ -415,15 +415,15 @@ bool RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownSto template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > bool RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::addLocalTransition(StateType from, std::variant < EpsilonType, InputSymbolType > input, StateType to) { if (! getStates().count(from)) { - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); } if (input.template is < InputSymbolType >() && ! getInputAlphabet().count(input.template get < InputSymbolType >())) { - throw AutomatonException("Input symbol \"" + std::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); } if (! getStates().count(to)) { - throw AutomatonException("State \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist."); } std::pair<StateType, std::variant < EpsilonType, InputSymbolType >> key(std::move(from), std::move(input)); @@ -446,17 +446,17 @@ bool RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownSto template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > void RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::addCallTransitions(StateType from, std::variant < EpsilonType, InputSymbolType > input, std::set < std::pair < StateType, PushdownStoreSymbolType > > targets ) { if (! getStates().count(from)) - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); if (input.template is < InputSymbolType >() && ! getInputAlphabet().count(input.template get < InputSymbolType >())) - throw AutomatonException("Input symbol \"" + std::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); for ( const std::pair < StateType, PushdownStoreSymbolType > & target : targets ) { if ( ! getStates().count ( target.first ) ) - throw AutomatonException("State \"" + std::to_string ( target.first ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( target.first ) + "\" doesn't exist."); if ( ! getPushdownStoreAlphabet().count ( target.second ) ) - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( target.second ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( target.second ) + "\" doesn't exist."); } std::pair < StateType, std::variant < EpsilonType, InputSymbolType > > key ( std::move ( from ), std::move ( input ) ); @@ -478,16 +478,16 @@ void RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownSto template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > void RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::addReturnTransitions(StateType from, std::variant < EpsilonType, InputSymbolType > input, PushdownStoreSymbolType pop, std::set < StateType > to) { if (! getStates().count(from)) - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); if (input.template is < InputSymbolType >() && !getInputAlphabet().count(input.template get < InputSymbolType >())) - throw AutomatonException("Input symbol \"" + std::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); if ( !std::includes ( getStates ( ).begin ( ), getStates ( ).end ( ), to.begin ( ), to.end ( ) ) ) throw AutomatonException ( "Some target states don't exist." ); if ( ! getPushdownStoreAlphabet().count ( pop ) ) - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( pop ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( pop ) + "\" doesn't exist."); std::tuple<StateType, std::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType> key(std::move(from), std::move(input), std::move(pop)); returnTransitions[std::move(key)].insert ( std::make_moveable_set ( to ).begin ( ), std::make_moveable_set ( to ).end ( ) ); @@ -508,10 +508,10 @@ void RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownSto template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > void RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::addLocalTransitions(StateType from, std::variant < EpsilonType, InputSymbolType > input, std::set < StateType > to) { if (! getStates().count(from)) - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); if (input.template is < InputSymbolType >() && ! getInputAlphabet().count(input.template get < InputSymbolType >())) - throw AutomatonException("Input symbol \"" + std::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); if ( !std::includes ( getStates ( ).begin ( ), getStates ( ).end ( ), to.begin ( ), to.end ( ) ) ) throw AutomatonException ( "Some target states don't exist." ); diff --git a/alib2data/src/automaton/PDA/SinglePopDPDA.h b/alib2data/src/automaton/PDA/SinglePopDPDA.h index a55fee0fa3147376ac6d2dafc296f9aa2c6deece..395d7c448a646cd39217bc4b4bdfddfec9e47e84 100644 --- a/alib2data/src/automaton/PDA/SinglePopDPDA.h +++ b/alib2data/src/automaton/PDA/SinglePopDPDA.h @@ -250,24 +250,24 @@ AutomatonBase* SinglePopDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbol template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > bool SinglePopDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::addTransition(StateType from, std::variant < EpsilonType, InputSymbolType > input, PushdownStoreSymbolType pop, StateType to, std::vector<PushdownStoreSymbolType> push) { if (!getStates().count(from)) { - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); } if (input.template is < InputSymbolType >() && ! getInputAlphabet().count(input.template get < InputSymbolType >())) { - throw AutomatonException("Input symbol \"" + std::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); } if (!getStates().count(to)) { - throw AutomatonException("State \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist."); } if (!getPushdownStoreAlphabet().count(pop)) { - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( pop ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( pop ) + "\" doesn't exist."); } for(const PushdownStoreSymbolType& pushSymbol : push) { if (!getPushdownStoreAlphabet().count(pushSymbol)) { - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( pushSymbol ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( pushSymbol ) + "\" doesn't exist."); } } @@ -278,9 +278,9 @@ bool SinglePopDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, Stat if(transitions.find(key)->second == value) return false; else if (input.template is < InputSymbolType >()) - throw AutomatonException("Transition (\"" + std::to_string ( std::get<0>(key) ) + "\", \"" + std::to_string ( std::get<1>(key).template get < InputSymbolType >() ) + "\", \"" + std::to_string ( std::get<2>(key) ) + "\") -> ?? already exists."); + throw AutomatonException("Transition (\"" + ext::to_string ( std::get<0>(key) ) + "\", \"" + ext::to_string ( std::get<1>(key).template get < InputSymbolType >() ) + "\", \"" + ext::to_string ( std::get<2>(key) ) + "\") -> ?? already exists."); else - throw AutomatonException("Transition (\"" + std::to_string ( std::get<0>(key) ) + "\", \"" + std::to_string ( std::get<1>(key).template get<EpsilonType>() ) + "\", \"" + std::to_string ( std::get<2>(key) ) + "\") -> ?? already exists."); + throw AutomatonException("Transition (\"" + ext::to_string ( std::get<0>(key) ) + "\", \"" + ext::to_string ( std::get<1>(key).template get<EpsilonType>() ) + "\", \"" + ext::to_string ( std::get<2>(key) ) + "\") -> ?? already exists."); } if(input.template is<EpsilonType>()) { @@ -321,9 +321,9 @@ bool SinglePopDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, Stat if(transitions.find(key)->second != value) { if (input.template is < InputSymbolType >()) - throw AutomatonException("Transition (\"" + std::to_string ( from ) + "\", \"" + std::to_string ( input.template get < InputSymbolType >() ) + "\") -> \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("Transition (\"" + ext::to_string ( from ) + "\", \"" + ext::to_string ( input.template get < InputSymbolType >() ) + "\") -> \"" + ext::to_string ( to ) + "\" doesn't exist."); else - throw AutomatonException("Transition (\"" + std::to_string ( from ) + "\", \"" + std::to_string ( input.template get<EpsilonType>() ) + "\") -> \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("Transition (\"" + ext::to_string ( from ) + "\", \"" + ext::to_string ( input.template get<EpsilonType>() ) + "\") -> \"" + ext::to_string ( to ) + "\" doesn't exist."); } transitions.erase(key); diff --git a/alib2data/src/automaton/PDA/SinglePopNPDA.h b/alib2data/src/automaton/PDA/SinglePopNPDA.h index 546137830eee033c87bf7949038c6bf0c5345424..dd531f540658abfea8d6554a2a988960e63986d8 100644 --- a/alib2data/src/automaton/PDA/SinglePopNPDA.h +++ b/alib2data/src/automaton/PDA/SinglePopNPDA.h @@ -258,24 +258,24 @@ AutomatonBase* SinglePopNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbol template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > bool SinglePopNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::addTransition(StateType from, std::variant < EpsilonType, InputSymbolType > input, PushdownStoreSymbolType pop, StateType to, std::vector<PushdownStoreSymbolType> push) { if (! getStates().count(from)) { - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); } if (input.template is < InputSymbolType >() && ! getInputAlphabet().count(input.template get < InputSymbolType >())) { - throw AutomatonException("Input symbol \"" + std::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); } if (! getStates().count(to)) { - throw AutomatonException("State \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist."); } if (! getPushdownStoreAlphabet().count(pop)) { - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( pop ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( pop ) + "\" doesn't exist."); } for(const PushdownStoreSymbolType& pushSymbol : push) { if (! getPushdownStoreAlphabet().count(pushSymbol)) { - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( pushSymbol ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( pushSymbol ) + "\" doesn't exist."); } } @@ -300,21 +300,21 @@ bool SinglePopNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, Stat template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > void SinglePopNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::addTransitions(StateType from, std::variant < EpsilonType, InputSymbolType > input, PushdownStoreSymbolType pop, std::set < std::pair < StateType, std::vector < PushdownStoreSymbolType > > > targets ) { if (! getStates().count(from)) - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); if (input.template is < InputSymbolType >() && ! getInputAlphabet().count(input.template get < InputSymbolType >())) - throw AutomatonException("Input symbol \"" + std::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input.template get < InputSymbolType >() ) + "\" doesn't exist."); if (! getPushdownStoreAlphabet().count(pop)) - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( pop ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( pop ) + "\" doesn't exist."); for ( const std::pair < StateType, std::vector < PushdownStoreSymbolType > > & target : targets ) { if ( ! getStates ( ).count ( target.first ) ) - throw AutomatonException("State \"" + std::to_string ( target.first ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( target.first ) + "\" doesn't exist."); for ( const PushdownStoreSymbolType & pushSymbol : target.second ) if ( ! getPushdownStoreAlphabet().count(pushSymbol)) - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( pushSymbol ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( pushSymbol ) + "\" doesn't exist."); } std::tuple<StateType, std::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType> key(std::move(from), std::move(input), std::move(pop)); diff --git a/alib2data/src/automaton/PDA/VisiblyPushdownDPDA.h b/alib2data/src/automaton/PDA/VisiblyPushdownDPDA.h index a8a5524f094cee496c655ae71f5a3404bbdcef06..e6b5f115d5235f108863d484d92265059f2f6bf2 100644 --- a/alib2data/src/automaton/PDA/VisiblyPushdownDPDA.h +++ b/alib2data/src/automaton/PDA/VisiblyPushdownDPDA.h @@ -338,19 +338,19 @@ AutomatonBase* VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, S template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > bool VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::addCallTransition(StateType from, InputSymbolType input, StateType to, PushdownStoreSymbolType push) { if (!getStates().count(from)) { - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); } if (!getCallInputAlphabet().count(input)) { - throw AutomatonException("Input symbol \"" + std::to_string ( input ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input ) + "\" doesn't exist."); } if (!getStates().count(to)) { - throw AutomatonException("State \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist."); } if (!getPushdownStoreAlphabet().count(push)) { - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( push ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( push ) + "\" doesn't exist."); } std::pair<StateType, InputSymbolType> key(std::move(from), std::move(input)); @@ -361,15 +361,15 @@ bool VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > for(const auto& transition : callTransitions) if(transition.first.first == key.first && transition.first.second == key.second) - throw AutomatonException("Can't add transition from state \"" + std::to_string ( key.first ) + "\" when transition reading \"" + std::to_string ( key.second ) + "\" is present."); + throw AutomatonException("Can't add transition from state \"" + ext::to_string ( key.first ) + "\" when transition reading \"" + ext::to_string ( key.second ) + "\" is present."); for(const auto& transition : returnTransitions) if(std::get<0>(transition.first) == key.first && std::get<1>(transition.first) == key.second) - throw AutomatonException("Can't add transition from state \"" + std::to_string ( key.first ) + "\" when transition reading \"" + std::to_string ( key.second ) + "\" is present."); + throw AutomatonException("Can't add transition from state \"" + ext::to_string ( key.first ) + "\" when transition reading \"" + ext::to_string ( key.second ) + "\" is present."); for(const auto& transition : localTransitions) if(transition.first.first == key.first && transition.first.second == key.second) - throw AutomatonException("Can't add transition from state \"" + std::to_string ( key.first ) + "\" when transition reading \"" + std::to_string ( key.second ) + "\" is present."); + throw AutomatonException("Can't add transition from state \"" + ext::to_string ( key.first ) + "\" when transition reading \"" + ext::to_string ( key.second ) + "\" is present."); callTransitions.insert(std::make_pair(std::move(key), std::move(value))); return true; @@ -378,19 +378,19 @@ bool VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > bool VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::addReturnTransition(StateType from, InputSymbolType input, PushdownStoreSymbolType pop, StateType to) { if (!getStates().count(from)) { - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); } if (!getReturnInputAlphabet().count(input)) { - throw AutomatonException("Input symbol \"" + std::to_string ( input ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input ) + "\" doesn't exist."); } if (!getStates().count(to)) { - throw AutomatonException("State \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist."); } if (!getPushdownStoreAlphabet().count(pop)) { - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( pop ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( pop ) + "\" doesn't exist."); } std::tuple<StateType, InputSymbolType, PushdownStoreSymbolType> key(std::move(from), std::move(input), std::move(pop)); @@ -400,15 +400,15 @@ bool VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > for(const auto& transition : callTransitions) if(transition.first.first == std::get<0>(key) && transition.first.second == std::get<1>(key)) - throw AutomatonException("Can't add transition from state \"" + std::to_string ( std::get<0>(key) ) + "\" when transition reading \"" + std::to_string ( std::get<1>(key) ) + "\" is present."); + throw AutomatonException("Can't add transition from state \"" + ext::to_string ( std::get<0>(key) ) + "\" when transition reading \"" + ext::to_string ( std::get<1>(key) ) + "\" is present."); for(const auto& transition : returnTransitions) if(std::get<0>(transition.first) == std::get<0>(key) && std::get<1>(transition.first) == std::get<1>(key) && std::get<2>(transition.first) == std::get<2>(key)) - throw AutomatonException("Can't add transition from state \"" + std::to_string ( from ) + "\" when transition reading \"" + std::to_string ( input ) + "\" is present."); + throw AutomatonException("Can't add transition from state \"" + ext::to_string ( from ) + "\" when transition reading \"" + ext::to_string ( input ) + "\" is present."); for(const auto& transition : localTransitions) if(transition.first.first == std::get<0>(key) && transition.first.second == std::get<1>(key)) - throw AutomatonException("Can't add transition from state \"" + std::to_string ( std::get<0>(key) ) + "\" when transition reading \"" + std::to_string ( std::get<1>(key) ) + "\" is present."); + throw AutomatonException("Can't add transition from state \"" + ext::to_string ( std::get<0>(key) ) + "\" when transition reading \"" + ext::to_string ( std::get<1>(key) ) + "\" is present."); returnTransitions.insert(std::make_pair(std::move(key), std::move(to))); return true; @@ -417,15 +417,15 @@ bool VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > bool VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::addLocalTransition(StateType from, InputSymbolType input, StateType to) { if (!getStates().count(from)) { - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); } if (!getLocalInputAlphabet().count(input)) { - throw AutomatonException("Input symbol \"" + std::to_string ( input ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input ) + "\" doesn't exist."); } if (!getStates().count(to)) { - throw AutomatonException("State \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist."); } std::pair<StateType, InputSymbolType> key(std::move(from), std::move(input)); @@ -435,15 +435,15 @@ bool VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > for(const auto& transition : callTransitions) if(transition.first.first == key.first && transition.first.second == key.second) - throw AutomatonException("Can't add transition from state \"" + std::to_string ( key.first ) + "\" when transition reading \"" + std::to_string ( key.second ) + "\" is present."); + throw AutomatonException("Can't add transition from state \"" + ext::to_string ( key.first ) + "\" when transition reading \"" + ext::to_string ( key.second ) + "\" is present."); for(const auto& transition : returnTransitions) if(std::get<0>(transition.first) == key.first && std::get<1>(transition.first) == key.second) - throw AutomatonException("Can't add transition from state \"" + std::to_string ( key.first ) + "\" when transition reading \"" + std::to_string ( key.second ) + "\" is present."); + throw AutomatonException("Can't add transition from state \"" + ext::to_string ( key.first ) + "\" when transition reading \"" + ext::to_string ( key.second ) + "\" is present."); for(const auto& transition : localTransitions) if(transition.first.first == key.first && transition.first.second == key.second) - throw AutomatonException("Can't add transition from state \"" + std::to_string ( key.first ) + "\" when transition reading \"" + std::to_string ( key.second ) + "\" is present."); + throw AutomatonException("Can't add transition from state \"" + ext::to_string ( key.first ) + "\" when transition reading \"" + ext::to_string ( key.second ) + "\" is present."); localTransitions.insert(std::make_pair(std::move(key), std::move(to))); return true; @@ -458,7 +458,7 @@ bool VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > return false; if(callTransitions.find(key)->second != value) - throw AutomatonException("Transition (\"" + std::to_string ( from ) + "\", \"" + std::to_string ( input ) + "\") -> \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("Transition (\"" + ext::to_string ( from ) + "\", \"" + ext::to_string ( input ) + "\") -> \"" + ext::to_string ( to ) + "\" doesn't exist."); callTransitions.erase(key); return true; @@ -472,7 +472,7 @@ bool VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > return false; if(returnTransitions.find(key)->second != to) - throw AutomatonException( "Transition (\"" + std::to_string ( from ) + "\", \"" + std::to_string ( input ) + "\") -> \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException( "Transition (\"" + ext::to_string ( from ) + "\", \"" + ext::to_string ( input ) + "\") -> \"" + ext::to_string ( to ) + "\" doesn't exist."); returnTransitions.erase(key); return true; @@ -486,7 +486,7 @@ bool VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > return false; if(localTransitions.find(key)->second != to) - throw AutomatonException("Transition (\"" + std::to_string ( from ) + "\", \"" + std::to_string ( input ) + "\") -> \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("Transition (\"" + ext::to_string ( from ) + "\", \"" + ext::to_string ( input ) + "\") -> \"" + ext::to_string ( to ) + "\" doesn't exist."); localTransitions.erase(key); return true; @@ -676,9 +676,9 @@ public: static void valid ( const automaton::VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & automaton, const InputSymbolType & symbol ) { if(automaton.getLocalInputAlphabet().count(symbol)) - throw automaton::AutomatonException("Input symbol " + std::to_string ( symbol ) + " already in local alphabet"); + throw automaton::AutomatonException("Input symbol " + ext::to_string ( symbol ) + " already in local alphabet"); if(automaton.getReturnInputAlphabet().count(symbol)) - throw automaton::AutomatonException("Input symbol " + std::to_string ( symbol ) + " already in return alphabet"); + throw automaton::AutomatonException("Input symbol " + ext::to_string ( symbol ) + " already in return alphabet"); } }; @@ -699,9 +699,9 @@ public: static void valid ( const automaton::VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & automaton, const InputSymbolType & symbol ) { if(automaton.getLocalInputAlphabet().count(symbol)) - throw automaton::AutomatonException("Input symbol " + std::to_string ( symbol ) + " already in local alphabet"); + throw automaton::AutomatonException("Input symbol " + ext::to_string ( symbol ) + " already in local alphabet"); if(automaton.getCallInputAlphabet().count(symbol)) - throw automaton::AutomatonException("Input symbol " + std::to_string ( symbol ) + " already in call alphabet"); + throw automaton::AutomatonException("Input symbol " + ext::to_string ( symbol ) + " already in call alphabet"); } }; @@ -722,9 +722,9 @@ public: static void valid ( const automaton::VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & automaton, const InputSymbolType & symbol ) { if(automaton.getReturnInputAlphabet().count(symbol)) - throw automaton::AutomatonException("Input symbol " + std::to_string ( symbol ) + " already in return alphabet"); + throw automaton::AutomatonException("Input symbol " + ext::to_string ( symbol ) + " already in return alphabet"); if(automaton.getCallInputAlphabet().count(symbol)) - throw automaton::AutomatonException("Input symbol " + std::to_string ( symbol ) + " already in call alphabet"); + throw automaton::AutomatonException("Input symbol " + ext::to_string ( symbol ) + " already in call alphabet"); } }; diff --git a/alib2data/src/automaton/PDA/VisiblyPushdownNPDA.h b/alib2data/src/automaton/PDA/VisiblyPushdownNPDA.h index dc6eb71d60a48225c741545a70583fc02ca3c27e..1c9feaff882e13267d7c1649ecc2feea8c760dc0 100644 --- a/alib2data/src/automaton/PDA/VisiblyPushdownNPDA.h +++ b/alib2data/src/automaton/PDA/VisiblyPushdownNPDA.h @@ -374,19 +374,19 @@ AutomatonBase* VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, S template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > bool VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::addCallTransition(StateType from, InputSymbolType input, StateType to, PushdownStoreSymbolType push) { if ( ! getStates().count(from)) { - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); } if ( ! getCallInputAlphabet().count(input)) { - throw AutomatonException("Input symbol \"" + std::to_string ( input ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input ) + "\" doesn't exist."); } if ( ! getStates().count(to)) { - throw AutomatonException("State \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist."); } if (! getPushdownStoreAlphabet().count(push)) { - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( push ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( push ) + "\" doesn't exist."); } std::pair<StateType, InputSymbolType> key(std::move(from), std::move(input)); @@ -398,19 +398,19 @@ bool VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > bool VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::addReturnTransition(StateType from, InputSymbolType input, PushdownStoreSymbolType pop, StateType to) { if (! getStates().count(from)) { - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); } if (! getReturnInputAlphabet().count(input)) { - throw AutomatonException("Input symbol \"" + std::to_string ( input ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input ) + "\" doesn't exist."); } if (! getStates().count(to)) { - throw AutomatonException("State \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist."); } if (! getPushdownStoreAlphabet().count(pop)) { - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( pop ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( pop ) + "\" doesn't exist."); } std::tuple<StateType, InputSymbolType, PushdownStoreSymbolType> key(std::move(from), std::move(input), std::move(pop)); @@ -421,15 +421,15 @@ bool VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > bool VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::addLocalTransition(StateType from, InputSymbolType input, StateType to) { if (! getStates().count(from)) { - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); } if (! getLocalInputAlphabet().count(input)) { - throw AutomatonException("Input symbol \"" + std::to_string ( input ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input ) + "\" doesn't exist."); } if (! getStates().count(to)) { - throw AutomatonException("State \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist."); } std::pair<StateType, InputSymbolType> key(std::move(from), std::move(input)); @@ -440,17 +440,17 @@ bool VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > void VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::addCallTransitions(StateType from, InputSymbolType input, std::set < std::pair < StateType, PushdownStoreSymbolType > > targets ) { if ( ! getStates().count(from)) - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); if ( ! getCallInputAlphabet().count(input)) - throw AutomatonException("Input symbol \"" + std::to_string ( input ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input ) + "\" doesn't exist."); for ( const std::pair < StateType, PushdownStoreSymbolType > & target : targets ) { if ( ! getStates().count ( target.first ) ) - throw AutomatonException("State \"" + std::to_string ( target.first ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( target.first ) + "\" doesn't exist."); if ( ! getPushdownStoreAlphabet().count ( target.second ) ) - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( target.second ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( target.second ) + "\" doesn't exist."); } std::pair<StateType, InputSymbolType> key(std::move(from), std::move(input)); @@ -460,13 +460,13 @@ void VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > void VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::addReturnTransitions(StateType from, InputSymbolType input, PushdownStoreSymbolType pop, std::set < StateType > to) { if (! getStates().count(from)) - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); if (! getReturnInputAlphabet().count(input)) - throw AutomatonException("Input symbol \"" + std::to_string ( input ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input ) + "\" doesn't exist."); if (! getPushdownStoreAlphabet().count(pop)) - throw AutomatonException("Pushdown store symbol \"" + std::to_string ( pop ) + "\" doesn't exist."); + throw AutomatonException("Pushdown store symbol \"" + ext::to_string ( pop ) + "\" doesn't exist."); if ( !std::includes ( getStates ( ).begin ( ), getStates ( ).end ( ), to.begin ( ), to.end ( ) ) ) throw AutomatonException ( "Some target states don't exist." ); @@ -478,10 +478,10 @@ void VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > void VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::addLocalTransitions(StateType from, InputSymbolType input, std::set < StateType > to) { if (! getStates().count(from)) - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); if (! getLocalInputAlphabet().count(input)) - throw AutomatonException("Input symbol \"" + std::to_string ( input ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( input ) + "\" doesn't exist."); if ( !std::includes ( getStates ( ).begin ( ), getStates ( ).end ( ), to.begin ( ), to.end ( ) ) ) throw AutomatonException ( "Some target states don't exist." ); @@ -703,9 +703,9 @@ public: static void valid ( const automaton::VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & automaton, const InputSymbolType & symbol ) { if(automaton.getLocalInputAlphabet().count(symbol)) - throw automaton::AutomatonException("Input symbol " + std::to_string ( symbol ) + " already in local alphabet"); + throw automaton::AutomatonException("Input symbol " + ext::to_string ( symbol ) + " already in local alphabet"); if(automaton.getReturnInputAlphabet().count(symbol)) - throw automaton::AutomatonException("Input symbol " + std::to_string ( symbol ) + " already in return alphabet"); + throw automaton::AutomatonException("Input symbol " + ext::to_string ( symbol ) + " already in return alphabet"); } }; @@ -726,9 +726,9 @@ public: static void valid ( const automaton::VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & automaton, const InputSymbolType & symbol ) { if(automaton.getLocalInputAlphabet().count(symbol)) - throw automaton::AutomatonException("Input symbol " + std::to_string ( symbol ) + " already in local alphabet"); + throw automaton::AutomatonException("Input symbol " + ext::to_string ( symbol ) + " already in local alphabet"); if(automaton.getCallInputAlphabet().count(symbol)) - throw automaton::AutomatonException("Input symbol " + std::to_string ( symbol ) + " already in call alphabet"); + throw automaton::AutomatonException("Input symbol " + ext::to_string ( symbol ) + " already in call alphabet"); } }; @@ -749,9 +749,9 @@ public: static void valid ( const automaton::VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & automaton, const InputSymbolType & symbol ) { if(automaton.getReturnInputAlphabet().count(symbol)) - throw automaton::AutomatonException("Input symbol " + std::to_string ( symbol ) + " already in return alphabet"); + throw automaton::AutomatonException("Input symbol " + ext::to_string ( symbol ) + " already in return alphabet"); if(automaton.getCallInputAlphabet().count(symbol)) - throw automaton::AutomatonException("Input symbol " + std::to_string ( symbol ) + " already in call alphabet"); + throw automaton::AutomatonException("Input symbol " + ext::to_string ( symbol ) + " already in call alphabet"); } }; diff --git a/alib2data/src/automaton/TA/DFTA.h b/alib2data/src/automaton/TA/DFTA.h index 42cd129d623235e6aff6e8e399ebd812d11e4402..1c6bfc06e37617fdb3dd4a42c2488cad2fec0532 100644 --- a/alib2data/src/automaton/TA/DFTA.h +++ b/alib2data/src/automaton/TA/DFTA.h @@ -202,14 +202,14 @@ bool DFTA < SymbolType, RankType, StateType >::addTransition ( common::ranked_sy throw AutomatonException("Number of states doesn't match rank of the symbol"); if (! getInputAlphabet().count(symbol)) - throw AutomatonException("Input symbol \"" + std::to_string ( symbol ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( symbol ) + "\" doesn't exist."); if (! getStates().count(next)) - throw AutomatonException("State \"" + std::to_string ( next ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( next ) + "\" doesn't exist."); for ( const StateType & it : prevStates) { if (! getStates().count(it)) - throw AutomatonException("State \"" + std::to_string ( it ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( it ) + "\" doesn't exist."); } std::pair<common::ranked_symbol < SymbolType, RankType >, std::vector<StateType> > key = std::make_pair ( std::move ( symbol ), std::move ( prevStates ) ); diff --git a/alib2data/src/automaton/TA/NFTA.h b/alib2data/src/automaton/TA/NFTA.h index 9775ba9df2a64a6bdda86300a79f8fe84adf7d47..b2e550f7b8e3f2c12bbd1e4e90c88f77d92edbb1 100644 --- a/alib2data/src/automaton/TA/NFTA.h +++ b/alib2data/src/automaton/TA/NFTA.h @@ -229,14 +229,14 @@ bool NFTA < SymbolType, RankType, StateType >::addTransition ( common::ranked_sy throw AutomatonException("Number of states doesn't match rank of the symbol"); if (! getInputAlphabet().count(symbol)) - throw AutomatonException("Input symbol \"" + std::to_string ( symbol ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( symbol ) + "\" doesn't exist."); if (! getStates().count(next)) - throw AutomatonException("State \"" + std::to_string ( next ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( next ) + "\" doesn't exist."); for (const StateType& it : prevStates) { if (! getStates().count(it)) - throw AutomatonException("State \"" + std::to_string ( it ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( it ) + "\" doesn't exist."); } std::pair<common::ranked_symbol < SymbolType, RankType >, std::vector < StateType > > key = std::make_pair ( std::move ( symbol ), std::move ( prevStates ) ); @@ -249,14 +249,14 @@ void NFTA < SymbolType, RankType, StateType >::addTransitions ( common::ranked_s throw AutomatonException("Number of states doesn't match rank of the symbol"); if (! getInputAlphabet().count(symbol)) - throw AutomatonException("Input symbol \"" + std::to_string ( symbol ) + "\" doesn't exist."); + throw AutomatonException("Input symbol \"" + ext::to_string ( symbol ) + "\" doesn't exist."); if ( !std::includes ( getStates ( ).begin ( ), getStates ( ).end ( ), next.begin ( ), next.end ( ) ) ) throw AutomatonException ( "Some target states don't exist." ); for (const StateType& it : prevStates) { if (! getStates().count(it)) - throw AutomatonException("State \"" + std::to_string ( it ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( it ) + "\" doesn't exist."); } std::pair<common::ranked_symbol < SymbolType, RankType >, std::vector < StateType > > key = std::make_pair ( std::move ( symbol ), std::move ( prevStates ) ); diff --git a/alib2data/src/automaton/TM/OneTapeDTM.h b/alib2data/src/automaton/TM/OneTapeDTM.h index 82a364fe1acd212583b32eaac0dfe9893c0ea098..eef93dc0f767e881e6f7876951608abd57054425 100644 --- a/alib2data/src/automaton/TM/OneTapeDTM.h +++ b/alib2data/src/automaton/TM/OneTapeDTM.h @@ -238,19 +238,19 @@ AutomatonBase* OneTapeDTM<SymbolType, StateType>::plunder() && { template<class SymbolType, class StateType > bool OneTapeDTM<SymbolType, StateType>::addTransition(StateType from, SymbolType input, StateType to, SymbolType output, Shift shift) { if (!getStates().count(from)) { - throw AutomatonException("State \"" + std::to_string ( from ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist."); } if (!getTapeAlphabet().count(input)) { - throw AutomatonException("Tape symbol \"" + std::to_string ( input ) + "\" doesn't exist."); + throw AutomatonException("Tape symbol \"" + ext::to_string ( input ) + "\" doesn't exist."); } if (!getStates().count(to)) { - throw AutomatonException("State \"" + std::to_string ( to ) + "\" doesn't exist."); + throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist."); } if (!getTapeAlphabet().count(output)) { - throw AutomatonException("Tape symbol \"" + std::to_string ( output ) + "\" doesn't exist."); + throw AutomatonException("Tape symbol \"" + ext::to_string ( output ) + "\" doesn't exist."); } std::pair<StateType, SymbolType> key = std::make_pair(std::move(from), std::move(input)); @@ -261,7 +261,7 @@ bool OneTapeDTM<SymbolType, StateType>::addTransition(StateType from, SymbolType if(transitions.find(key)->second == value) return false; else - throw AutomatonException("Transition (\"" + std::to_string ( key.first ) + "\", \"" + std::to_string ( key.second ) + "\") -> ? already exists."); + throw AutomatonException("Transition (\"" + ext::to_string ( key.first ) + "\", \"" + ext::to_string ( key.second ) + "\") -> ? already exists."); } transitions.insert(std::make_pair(std::move(key), std::move(value))); @@ -277,7 +277,7 @@ bool OneTapeDTM<SymbolType, StateType>::removeTransition(const StateType& from, std::tuple<StateType, SymbolType, Shift > value(to, output, shift); if(transitions.find(key)->second != value) - throw AutomatonException("Transition (\"" + std::to_string ( from ) + "\", \"" + std::to_string ( input ) + "\") -> ? doesn't exists."); + throw AutomatonException("Transition (\"" + ext::to_string ( from ) + "\", \"" + ext::to_string ( input ) + "\") -> ? doesn't exists."); transitions.erase(key); return true; @@ -434,7 +434,7 @@ public: static void valid ( const automaton::OneTapeDTM<SymbolType, StateType> & automaton, const SymbolType & symbol ) { if (symbol == automaton.getBlankSymbol()) - throw automaton::AutomatonException("Input symbol \"" + std::to_string ( symbol ) + "\" cannot be blank symbol."); + throw automaton::AutomatonException("Input symbol \"" + ext::to_string ( symbol ) + "\" cannot be blank symbol."); } }; @@ -447,7 +447,7 @@ public: static void valid ( const automaton::OneTapeDTM<SymbolType, StateType> & automaton, const SymbolType & symbol ) { if (automaton.getInputAlphabet().count( symbol )) - throw automaton::AutomatonException("Blank symbol \"" + std::to_string ( symbol ) + "\" cannot be in input alphabet."); + throw automaton::AutomatonException("Blank symbol \"" + ext::to_string ( symbol ) + "\" cannot be in input alphabet."); } }; diff --git a/alib2data/src/common/ranked_symbol.hpp b/alib2data/src/common/ranked_symbol.hpp index 02315e16adda828fa6bb3ffbb02a49dd1881e935..fd1aa058511cb76802681950168c73c0f1dcd224 100644 --- a/alib2data/src/common/ranked_symbol.hpp +++ b/alib2data/src/common/ranked_symbol.hpp @@ -143,7 +143,7 @@ int ranked_symbol < SymbolType, RankType >::compare(const ranked_symbol& other) template < class SymbolType, class RankType > ranked_symbol < SymbolType, RankType >::operator std::string () const { - return std::to_string ( m_symbol ) + "_" + std::to_string ( m_rank ); + return ext::to_string ( m_symbol ) + "_" + ext::to_string ( m_rank ); } template < class SymbolType, class RankType > diff --git a/alib2data/src/grammar/ContextFree/CFG.h b/alib2data/src/grammar/ContextFree/CFG.h index 2bafa49c792f070241cf67c54606ef7a727728aa..8becc9cd11e6ef6a69096b5ba8cc289cc4a900a3 100644 --- a/alib2data/src/grammar/ContextFree/CFG.h +++ b/alib2data/src/grammar/ContextFree/CFG.h @@ -189,7 +189,7 @@ bool CFG < SymbolType >::addRule ( SymbolType leftHandSide, std::vector < Symbol for ( const SymbolType & symbol : rightHandSide ) if ( !getTerminalAlphabet ( ).count ( symbol ) && !getNonterminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); return rules[std::move ( leftHandSide )].insert ( std::move ( rightHandSide ) ).second; } @@ -202,7 +202,7 @@ void CFG < SymbolType >::addRules ( SymbolType leftHandSide, std::set < std::vec for ( const std::vector < SymbolType > & rhs : rightHandSide ) for ( const SymbolType & symbol : rhs ) if ( ! getTerminalAlphabet ( ).count ( symbol ) && ! getNonterminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); rules [ std::move ( leftHandSide ) ].insert ( std::make_moveable_set ( rightHandSide ).begin ( ), std::make_moveable_set ( rightHandSide ).end ( ) ); } @@ -342,7 +342,7 @@ public: static void valid ( const grammar::CFG < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); } }; @@ -372,7 +372,7 @@ public: static void valid ( const grammar::CFG < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::TerminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); } }; diff --git a/alib2data/src/grammar/ContextFree/CNF.h b/alib2data/src/grammar/ContextFree/CNF.h index 2448c2d1294f040e4515977e0938d552f7e8c6db..fe31f6b744e752cd9fb874b6a783cfb1631be174 100644 --- a/alib2data/src/grammar/ContextFree/CNF.h +++ b/alib2data/src/grammar/ContextFree/CNF.h @@ -187,10 +187,10 @@ bool CNF < SymbolType >::addRule ( SymbolType leftHandSide, std::variant < Symbo const std::pair < SymbolType, SymbolType > rhs = rightHandSide.template get < std::pair < SymbolType, SymbolType > > ( ); if ( !getNonterminalAlphabet ( ).count ( rhs.first ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( rhs.first ) + "\" is not a nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( rhs.first ) + "\" is not a nonterminal symbol" ); if ( !getNonterminalAlphabet ( ).count ( rhs.second ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( rhs.second ) + "\" is not a nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( rhs.second ) + "\" is not a nonterminal symbol" ); } return rules[std::move ( leftHandSide )].insert ( std::move ( rightHandSide ) ).second; @@ -223,10 +223,10 @@ void CNF < SymbolType >::addRules ( SymbolType leftHandSide, std::set < std::var const std::pair < SymbolType, SymbolType > rhs = element.template get < std::pair < SymbolType, SymbolType > > ( ); if ( !getNonterminalAlphabet ( ).count ( rhs.first ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( rhs.first ) + "\" is not a nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( rhs.first ) + "\" is not a nonterminal symbol" ); if ( !getNonterminalAlphabet ( ).count ( rhs.second ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( rhs.second ) + "\" is not a nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( rhs.second ) + "\" is not a nonterminal symbol" ); } } @@ -438,7 +438,7 @@ public: static void valid ( const grammar::CNF < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); } }; @@ -468,7 +468,7 @@ public: static void valid ( const grammar::CNF < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::TerminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); } }; diff --git a/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.h b/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.h index a8e08241a92941be9b3df4dffaf3249c114a2a07..a06522a387f8a5acb7efcc91759ae381281acb34 100644 --- a/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.h +++ b/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.h @@ -180,7 +180,7 @@ bool EpsilonFreeCFG < SymbolType >::addRule ( SymbolType leftHandSide, std::vect for ( const SymbolType & symbol : rightHandSide ) if ( !getTerminalAlphabet ( ).count ( symbol ) && !getNonterminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); return rules[std::move ( leftHandSide )].insert ( std::move ( rightHandSide ) ).second; } @@ -196,7 +196,7 @@ void EpsilonFreeCFG < SymbolType >::addRules ( SymbolType leftHandSide, std::set for ( const SymbolType & symbol : rhs ) if ( ! getTerminalAlphabet ( ).count ( symbol ) && ! getNonterminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); } rules [ std::move ( leftHandSide ) ].insert ( std::make_moveable_set ( rightHandSide ).begin ( ), std::make_moveable_set ( rightHandSide ).end ( ) ); @@ -373,7 +373,7 @@ public: static void valid ( const grammar::EpsilonFreeCFG < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); } }; @@ -403,7 +403,7 @@ public: static void valid ( const grammar::EpsilonFreeCFG < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::TerminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); } }; diff --git a/alib2data/src/grammar/ContextFree/GNF.h b/alib2data/src/grammar/ContextFree/GNF.h index 5a8013e6978a326d949913386473ed12f969ac6f..fb047c6a940ff9134f274c7f87f30106c57a643a 100644 --- a/alib2data/src/grammar/ContextFree/GNF.h +++ b/alib2data/src/grammar/ContextFree/GNF.h @@ -181,7 +181,7 @@ bool GNF < SymbolType >::addRule ( SymbolType leftHandSide, std::pair < SymbolTy for ( const SymbolType & rhsNTs : rightHandSide.second ) if ( !getNonterminalAlphabet ( ).count ( rhsNTs ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( rhsNTs ) + "\" is not a nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( rhsNTs ) + "\" is not a nonterminal symbol" ); return rules[std::move ( leftHandSide )].insert ( std::move ( rightHandSide ) ).second; } @@ -197,7 +197,7 @@ void GNF < SymbolType >::addRules ( SymbolType leftHandSide, std::set < std::pai for ( const SymbolType & rhsNTs : rhs.second ) if ( !getNonterminalAlphabet ( ).count ( rhsNTs ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( rhsNTs ) + "\" is not a nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( rhsNTs ) + "\" is not a nonterminal symbol" ); } rules[std::move ( leftHandSide )].insert ( std::make_moveable_set ( rightHandSide ).begin ( ), std::make_moveable_set ( rightHandSide ).end ( ) ); @@ -384,7 +384,7 @@ public: static void valid ( const grammar::GNF < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); } }; @@ -413,7 +413,7 @@ public: static void valid ( const grammar::GNF < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::TerminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); } }; diff --git a/alib2data/src/grammar/ContextFree/LG.h b/alib2data/src/grammar/ContextFree/LG.h index d96b4388261028588c882866c28a12fdd6819639..4baf568306da75766734b8324876a420d03dddce 100644 --- a/alib2data/src/grammar/ContextFree/LG.h +++ b/alib2data/src/grammar/ContextFree/LG.h @@ -180,20 +180,20 @@ bool LG < SymbolType >::addRule ( SymbolType leftHandSide, std::variant < std::v for ( const SymbolType & symbol : rhs ) if ( !getTerminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol " + std::to_string ( symbol ) + " is not a terminal symbol" ); + throw GrammarException ( "Symbol " + ext::to_string ( symbol ) + " is not a terminal symbol" ); } else { const std::tuple < std::vector < SymbolType >, SymbolType, std::vector < SymbolType > > & rhs = rightHandSide.template get < std::tuple < std::vector < SymbolType >, SymbolType, std::vector < SymbolType > > > ( ); for ( const SymbolType & symbol : std::get < 0 > ( rhs ) ) if ( !getTerminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol " + std::to_string ( symbol ) + " is not a terminal symbol" ); + throw GrammarException ( "Symbol " + ext::to_string ( symbol ) + " is not a terminal symbol" ); if ( !getNonterminalAlphabet ( ).count ( std::get < 1 > ( rhs ) ) ) - throw GrammarException ( "Symbol " + std::to_string ( std::get < 1 > ( rhs ) ) + " is not a nonterminal symbol" ); + throw GrammarException ( "Symbol " + ext::to_string ( std::get < 1 > ( rhs ) ) + " is not a nonterminal symbol" ); for ( const SymbolType & symbol : std::get < 2 > ( rhs ) ) if ( !getTerminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol " + std::to_string ( symbol ) + " is not a terminal symbol" ); + throw GrammarException ( "Symbol " + ext::to_string ( symbol ) + " is not a terminal symbol" ); } return rules[std::move ( leftHandSide )].insert ( std::move ( rightHandSide ) ).second; @@ -224,20 +224,20 @@ void LG < SymbolType >::addRules ( SymbolType leftHandSide, std::set < std::vari for ( const SymbolType & symbol : rhs ) if ( !getTerminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol " + std::to_string ( symbol ) + " is not a terminal symbol" ); + throw GrammarException ( "Symbol " + ext::to_string ( symbol ) + " is not a terminal symbol" ); } else { const std::tuple < std::vector < SymbolType >, SymbolType, std::vector < SymbolType > > & rhs = element.template get < std::tuple < std::vector < SymbolType >, SymbolType, std::vector < SymbolType > > > ( ); for ( const SymbolType & symbol : std::get < 0 > ( rhs ) ) if ( !getTerminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol " + std::to_string ( symbol ) + " is not a terminal symbol" ); + throw GrammarException ( "Symbol " + ext::to_string ( symbol ) + " is not a terminal symbol" ); if ( !getNonterminalAlphabet ( ).count ( std::get < 1 > ( rhs ) ) ) - throw GrammarException ( "Symbol " + std::to_string ( std::get < 1 > ( rhs ) ) + " is not a nonterminal symbol" ); + throw GrammarException ( "Symbol " + ext::to_string ( std::get < 1 > ( rhs ) ) + " is not a nonterminal symbol" ); for ( const SymbolType & symbol : std::get < 2 > ( rhs ) ) if ( !getTerminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol " + std::to_string ( symbol ) + " is not a terminal symbol" ); + throw GrammarException ( "Symbol " + ext::to_string ( symbol ) + " is not a terminal symbol" ); } } @@ -442,7 +442,7 @@ public: static void valid ( const grammar::LG < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); } }; @@ -476,7 +476,7 @@ public: static void valid ( const grammar::LG < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::TerminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); } }; diff --git a/alib2data/src/grammar/ContextSensitive/CSG.h b/alib2data/src/grammar/ContextSensitive/CSG.h index 81150a49a064f5eb379c6c250e1699045bcd25a5..2a4d06f50294749367556268d3a86b54afc4e8a1 100644 --- a/alib2data/src/grammar/ContextSensitive/CSG.h +++ b/alib2data/src/grammar/ContextSensitive/CSG.h @@ -170,21 +170,21 @@ template < class SymbolType > bool CSG < SymbolType >::addRule ( std::vector < SymbolType > lContext, SymbolType leftHandSide, std::vector < SymbolType > rContext, std::vector < SymbolType > rightHandSide ) { for ( const SymbolType & symbol : lContext ) if ( !getTerminalAlphabet ( ).count ( symbol ) && !getNonterminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); if ( !getNonterminalAlphabet ( ).count ( leftHandSide ) ) throw GrammarException ( "Rule must rewrite nonterminal symbol" ); for ( const SymbolType & symbol : rContext ) if ( !getTerminalAlphabet ( ).count ( symbol ) && !getNonterminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); if ( rightHandSide.size ( ) == 0 ) { throw GrammarException ( "Epsilon rule is not allowed" ); } else { for ( const SymbolType & symbol : rightHandSide ) if ( !getTerminalAlphabet ( ).count ( symbol ) && !getNonterminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); } return rules[make_tuple ( std::move ( lContext ), std::move ( leftHandSide ), std::move ( rContext ) )].insert ( std::move ( rightHandSide ) ).second; @@ -194,14 +194,14 @@ template < class SymbolType > void CSG < SymbolType >::addRules ( std::vector < SymbolType > lContext, SymbolType leftHandSide, std::vector < SymbolType > rContext, std::set < std::vector < SymbolType > > rightHandSide ) { for ( const SymbolType & symbol : lContext ) if ( !getTerminalAlphabet ( ).count ( symbol ) && !getNonterminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); if ( !getNonterminalAlphabet ( ).count ( leftHandSide ) ) throw GrammarException ( "Rule must rewrite nonterminal symbol" ); for ( const SymbolType & symbol : rContext ) if ( !getTerminalAlphabet ( ).count ( symbol ) && !getNonterminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); for ( const std::vector < SymbolType > & rhs : rightHandSide ) { if ( rhs.size ( ) == 0 ) { @@ -209,7 +209,7 @@ void CSG < SymbolType >::addRules ( std::vector < SymbolType > lContext, SymbolT } else { for ( const SymbolType & symbol : rhs ) if ( !getTerminalAlphabet ( ).count ( symbol ) && !getNonterminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); } } @@ -365,7 +365,7 @@ public: static void valid ( const grammar::CSG < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); } }; @@ -403,7 +403,7 @@ public: static void valid ( const grammar::CSG < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::TerminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); } }; diff --git a/alib2data/src/grammar/ContextSensitive/NonContractingGrammar.h b/alib2data/src/grammar/ContextSensitive/NonContractingGrammar.h index 338c05ed1b669994b806b63968c9aae05c04c360..1bd931330f22f7ff24729c6335c5e480798b42e8 100644 --- a/alib2data/src/grammar/ContextSensitive/NonContractingGrammar.h +++ b/alib2data/src/grammar/ContextSensitive/NonContractingGrammar.h @@ -175,7 +175,7 @@ bool NonContractingGrammar < SymbolType >::addRule ( std::vector < SymbolType > for ( const SymbolType & symbol : leftHandSide ) if ( !getTerminalAlphabet ( ).count ( symbol ) && !getNonterminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); int rSize = rightHandSide.size ( ); @@ -184,7 +184,7 @@ bool NonContractingGrammar < SymbolType >::addRule ( std::vector < SymbolType > for ( const SymbolType & symbol : rightHandSide ) if ( !getTerminalAlphabet ( ).count ( symbol ) && !getNonterminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); return rules[std::move ( leftHandSide )].insert ( std::move ( rightHandSide ) ).second; } @@ -200,7 +200,7 @@ void NonContractingGrammar < SymbolType >::addRules ( std::vector < SymbolType > for ( const SymbolType & symbol : leftHandSide ) if ( !getTerminalAlphabet ( ).count ( symbol ) && !getNonterminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); for ( const std::vector < SymbolType > & rhs : rightHandSide ) { @@ -211,7 +211,7 @@ void NonContractingGrammar < SymbolType >::addRules ( std::vector < SymbolType > for ( const SymbolType & symbol : rhs ) if ( !getTerminalAlphabet ( ).count ( symbol ) && !getNonterminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); } rules [ std::move ( leftHandSide ) ].insert ( std::make_moveable_set ( rightHandSide ).begin ( ), std::make_moveable_set ( rightHandSide ).end ( ) ); @@ -357,7 +357,7 @@ public: static void valid ( const grammar::NonContractingGrammar < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); } }; @@ -387,7 +387,7 @@ public: static void valid ( const grammar::NonContractingGrammar < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::TerminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); } }; diff --git a/alib2data/src/grammar/Regular/LeftLG.h b/alib2data/src/grammar/Regular/LeftLG.h index 137fa889735bfbaafcdcb8489192930181e190ad..cb5f37ebb459ec69384698082c610cb905a0c38a 100644 --- a/alib2data/src/grammar/Regular/LeftLG.h +++ b/alib2data/src/grammar/Regular/LeftLG.h @@ -420,16 +420,16 @@ bool LeftLG < SymbolType >::addRule ( SymbolType leftHandSide, std::variant < st if ( rightHandSide.template is < std::vector < SymbolType > > ( ) ) { for ( const auto & symbol : rightHandSide.template get < std::vector < SymbolType > > ( ) ) if ( !getTerminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol " + std::to_string ( symbol ) + " is not a terminal symbol" ); + throw GrammarException ( "Symbol " + ext::to_string ( symbol ) + " is not a terminal symbol" ); } else { const std::pair < SymbolType, std::vector < SymbolType > > & rhs = rightHandSide.template get < std::pair < SymbolType, std::vector < SymbolType > > > ( ); if ( !getNonterminalAlphabet ( ).count ( rhs.first ) ) - throw GrammarException ( "Symbol " + std::to_string ( rhs.first ) + " is not a nonterminal symbol" ); + throw GrammarException ( "Symbol " + ext::to_string ( rhs.first ) + " is not a nonterminal symbol" ); for ( const auto & symbol : rhs.second ) if ( !getTerminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol " + std::to_string ( symbol ) + " is not a terminal symbol" ); + throw GrammarException ( "Symbol " + ext::to_string ( symbol ) + " is not a terminal symbol" ); } return rules [ std::move ( leftHandSide ) ].insert ( std::move ( rightHandSide ) ).second; @@ -458,17 +458,17 @@ void LeftLG < SymbolType >::addRules ( SymbolType leftHandSide, std::set < std:: if ( element.template is < std::vector < SymbolType > > ( ) ) { for ( const auto & symbol : element.template get < std::vector < SymbolType > > ( ) ) if ( !getTerminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol " + std::to_string ( symbol ) + " is not a terminal symbol" ); + throw GrammarException ( "Symbol " + ext::to_string ( symbol ) + " is not a terminal symbol" ); } else { const std::pair < SymbolType, std::vector < SymbolType > > & rhs = element.template get < std::pair < SymbolType, std::vector < SymbolType > > > ( ); if ( !getNonterminalAlphabet ( ).count ( rhs.first ) ) - throw GrammarException ( "Symbol " + std::to_string ( rhs.first ) + " is not a nonterminal symbol" ); + throw GrammarException ( "Symbol " + ext::to_string ( rhs.first ) + " is not a nonterminal symbol" ); for ( const auto & symbol : rhs.second ) if ( !getTerminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol " + std::to_string ( symbol ) + " is not a terminal symbol" ); + throw GrammarException ( "Symbol " + ext::to_string ( symbol ) + " is not a terminal symbol" ); } } @@ -686,7 +686,7 @@ public: */ static void valid ( const grammar::LeftLG < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); } }; @@ -746,7 +746,7 @@ public: */ static void valid ( const grammar::LeftLG < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::TerminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); } }; diff --git a/alib2data/src/grammar/Regular/LeftRG.h b/alib2data/src/grammar/Regular/LeftRG.h index 8e5f9e45f0ec298dc9765de3acef38d473c53cbd..7c3e0d3adabf7d38c1bc933bb04c799dc84a0761 100644 --- a/alib2data/src/grammar/Regular/LeftRG.h +++ b/alib2data/src/grammar/Regular/LeftRG.h @@ -724,7 +724,7 @@ public: */ static void valid ( const grammar::LeftRG < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); } }; @@ -780,7 +780,7 @@ public: */ static void valid ( const grammar::LeftRG < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::TerminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); } }; diff --git a/alib2data/src/grammar/Regular/RightLG.h b/alib2data/src/grammar/Regular/RightLG.h index 5ba8b3428e5d2d113e19b602fc49039e66981f47..c9f31d4994d49604ddb130b65bc0b1988e23a33b 100644 --- a/alib2data/src/grammar/Regular/RightLG.h +++ b/alib2data/src/grammar/Regular/RightLG.h @@ -419,16 +419,16 @@ bool RightLG < SymbolType >::addRule ( SymbolType leftHandSide, std::variant < s if ( rightHandSide.template is < std::vector < SymbolType > > ( ) ) { for ( const auto & symbol : rightHandSide.template get < std::vector < SymbolType > > ( ) ) if ( !getTerminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol " + std::to_string ( symbol ) + " is not a terminal symbol" ); + throw GrammarException ( "Symbol " + ext::to_string ( symbol ) + " is not a terminal symbol" ); } else { const std::pair < std::vector < SymbolType >, SymbolType > & rhs = rightHandSide.template get < std::pair < std::vector < SymbolType >, SymbolType > > ( ); if ( !getNonterminalAlphabet ( ).count ( rhs.second ) ) - throw GrammarException ( "Symbol " + std::to_string ( rhs.second ) + " is not a nonterminal symbol" ); + throw GrammarException ( "Symbol " + ext::to_string ( rhs.second ) + " is not a nonterminal symbol" ); for ( const auto & symbol : rhs.first ) if ( !getTerminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol " + std::to_string ( symbol ) + " is not a terminal symbol" ); + throw GrammarException ( "Symbol " + ext::to_string ( symbol ) + " is not a terminal symbol" ); } return rules [ std::move ( leftHandSide ) ].insert ( std::move ( rightHandSide ) ).second; @@ -457,16 +457,16 @@ void RightLG < SymbolType >::addRules ( SymbolType leftHandSide, std::set < std: if ( element.template is < std::vector < SymbolType > > ( ) ) { for ( const auto & symbol : element.template get < std::vector < SymbolType > > ( ) ) if ( !getTerminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol " + std::to_string ( symbol ) + " is not a terminal symbol" ); + throw GrammarException ( "Symbol " + ext::to_string ( symbol ) + " is not a terminal symbol" ); } else { const std::pair < std::vector < SymbolType >, SymbolType > & rhs = element.template get < std::pair < std::vector < SymbolType >, SymbolType > > ( ); if ( !getNonterminalAlphabet ( ).count ( rhs.second ) ) - throw GrammarException ( "Symbol " + std::to_string ( rhs.second ) + " is not a nonterminal symbol" ); + throw GrammarException ( "Symbol " + ext::to_string ( rhs.second ) + " is not a nonterminal symbol" ); for ( const auto & symbol : rhs.first ) if ( !getTerminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol " + std::to_string ( symbol ) + " is not a terminal symbol" ); + throw GrammarException ( "Symbol " + ext::to_string ( symbol ) + " is not a terminal symbol" ); } } @@ -683,7 +683,7 @@ public: */ static void valid ( const grammar::RightLG < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); } }; @@ -743,7 +743,7 @@ public: */ static void valid ( const grammar::RightLG < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::TerminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); } }; diff --git a/alib2data/src/grammar/Regular/RightRG.h b/alib2data/src/grammar/Regular/RightRG.h index b6605b4e145dffc22003ddedb0ab4980f9fafe25..769cf75b134a916acaacfce59025012dd65ddb42 100644 --- a/alib2data/src/grammar/Regular/RightRG.h +++ b/alib2data/src/grammar/Regular/RightRG.h @@ -721,7 +721,7 @@ public: */ static void valid ( const grammar::RightRG < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); } }; @@ -777,7 +777,7 @@ public: */ static void valid ( const grammar::RightRG < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::TerminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); } }; diff --git a/alib2data/src/grammar/Unrestricted/ContextPreservingUnrestrictedGrammar.h b/alib2data/src/grammar/Unrestricted/ContextPreservingUnrestrictedGrammar.h index b98a5074730088fee49ee49ff7cc431029f407a7..830504c21c61652349e4da9091c17ae36a28ca59 100644 --- a/alib2data/src/grammar/Unrestricted/ContextPreservingUnrestrictedGrammar.h +++ b/alib2data/src/grammar/Unrestricted/ContextPreservingUnrestrictedGrammar.h @@ -164,18 +164,18 @@ template < class SymbolType > bool ContextPreservingUnrestrictedGrammar < SymbolType >::addRule ( std::vector < SymbolType > lContext, SymbolType leftHandSide, std::vector < SymbolType > rContext, std::vector < SymbolType > rightHandSide ) { for ( const SymbolType & symbol : lContext ) if ( !getTerminalAlphabet ( ).count ( symbol ) && !getNonterminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); if ( !getNonterminalAlphabet ( ).count ( leftHandSide ) ) throw GrammarException ( "Rule must rewrite nonterminal symbol" ); for ( const SymbolType & symbol : rContext ) if ( !getTerminalAlphabet ( ).count ( symbol ) && !getNonterminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); for ( const SymbolType & symbol : rightHandSide ) if ( !getTerminalAlphabet ( ).count ( symbol ) && !getNonterminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); return rules[make_tuple ( std::move ( lContext ), std::move ( leftHandSide ), std::move ( rContext ) )].insert ( std::move ( rightHandSide ) ).second; } @@ -184,19 +184,19 @@ template < class SymbolType > void ContextPreservingUnrestrictedGrammar < SymbolType >::addRules ( std::vector < SymbolType > lContext, SymbolType leftHandSide, std::vector < SymbolType > rContext, std::set < std::vector < SymbolType > > rightHandSide ) { for ( const SymbolType & symbol : lContext ) if ( !getTerminalAlphabet ( ).count ( symbol ) && !getNonterminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); if ( !getNonterminalAlphabet ( ).count ( leftHandSide ) ) throw GrammarException ( "Rule must rewrite nonterminal symbol" ); for ( const SymbolType & symbol : rContext ) if ( !getTerminalAlphabet ( ).count ( symbol ) && !getNonterminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); for ( const std::vector < SymbolType > & rhs : rightHandSide ) for ( const SymbolType & symbol : rhs ) if ( !getTerminalAlphabet ( ).count ( symbol ) && !getNonterminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); rules [ make_tuple ( std::move ( lContext ), std::move ( leftHandSide ), std::move ( rContext ) ) ].insert ( std::make_moveable_set ( rightHandSide ).begin ( ), std::make_moveable_set ( rightHandSide ).end ( ) ); } @@ -335,7 +335,7 @@ public: static void valid ( const grammar::ContextPreservingUnrestrictedGrammar < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); } }; @@ -373,7 +373,7 @@ public: static void valid ( const grammar::ContextPreservingUnrestrictedGrammar < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::TerminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); } }; diff --git a/alib2data/src/grammar/Unrestricted/UnrestrictedGrammar.h b/alib2data/src/grammar/Unrestricted/UnrestrictedGrammar.h index 4f0220ee05d580ce1104096d3005b44994b30170..caa2091d20508d58c2a5963e963e657da5b27901 100644 --- a/alib2data/src/grammar/Unrestricted/UnrestrictedGrammar.h +++ b/alib2data/src/grammar/Unrestricted/UnrestrictedGrammar.h @@ -167,11 +167,11 @@ bool UnrestrictedGrammar < SymbolType >::addRule ( std::vector < SymbolType > le for ( const SymbolType & symbol : leftHandSide ) if ( !getTerminalAlphabet ( ).count ( symbol ) && !getNonterminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); for ( const SymbolType & symbol : rightHandSide ) if ( !getTerminalAlphabet ( ).count ( symbol ) && !getNonterminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); return rules[std::move ( leftHandSide )].insert ( std::move ( rightHandSide ) ).second; } @@ -185,12 +185,12 @@ void UnrestrictedGrammar < SymbolType >::addRules ( std::vector < SymbolType > l for ( const SymbolType & symbol : leftHandSide ) if ( !getTerminalAlphabet ( ).count ( symbol ) && !getNonterminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); for ( const std::vector < SymbolType > & rhs : rightHandSide ) for ( const SymbolType & symbol : rhs ) if ( !getTerminalAlphabet ( ).count ( symbol ) && !getNonterminalAlphabet ( ).count ( symbol ) ) - throw GrammarException ( "Symbol \"" + std::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); + throw GrammarException ( "Symbol \"" + ext::to_string ( symbol ) + "\" is not neither terminal nor nonterminal symbol" ); rules [ std::move ( leftHandSide ) ].insert ( std::make_moveable_set ( rightHandSide ).begin ( ), std::make_moveable_set ( rightHandSide ).end ( ) ); } @@ -320,7 +320,7 @@ public: static void valid ( const grammar::UnrestrictedGrammar < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::NonterminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in terminal alphabet since it is already nonterminal alphabet" ); } }; @@ -350,7 +350,7 @@ public: static void valid ( const grammar::UnrestrictedGrammar < SymbolType > & grammar, const SymbolType & symbol ) { if ( grammar.template accessComponent < grammar::TerminalAlphabet > ( ).get ( ).count ( symbol ) ) - throw grammar::GrammarException ( "Symbol " + std::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); + throw grammar::GrammarException ( "Symbol " + ext::to_string ( symbol ) + "cannot be in nonterminal alphabet since it is already in terminal alphabet" ); } }; diff --git a/alib2data/src/indexes/stringology/PositionHeap.h b/alib2data/src/indexes/stringology/PositionHeap.h index b3f73951f0cbe6aa7fbcf0838804b31321965cc4..836d5fb827c7c0b740b2ba72f99a8aa889923743 100644 --- a/alib2data/src/indexes/stringology/PositionHeap.h +++ b/alib2data/src/indexes/stringology/PositionHeap.h @@ -172,7 +172,7 @@ template < class SymbolType > void PositionHeap < SymbolType >::checkTrie ( const std::trie < SymbolType, unsigned > & trie ) { for ( const std::pair < const SymbolType, std::trie < SymbolType, unsigned > > & child : trie.getChildren ( ) ) { if ( ! getAlphabet ( ).count ( child.first ) ) - throw exception::CommonException ( "Symbol " + std::to_string ( child.first ) + "not in the alphabet." ); + throw exception::CommonException ( "Symbol " + ext::to_string ( child.first ) + "not in the alphabet." ); checkTrie ( child.second ); } } diff --git a/alib2data/src/indexes/stringology/SuffixTrie.h b/alib2data/src/indexes/stringology/SuffixTrie.h index 5fed5fcf17f18cc929ad9e1ee41bde1886792793..c5bddedd4cb09f6708a32dc303743bfade5cc87f 100644 --- a/alib2data/src/indexes/stringology/SuffixTrie.h +++ b/alib2data/src/indexes/stringology/SuffixTrie.h @@ -170,7 +170,7 @@ template < class SymbolType > void SuffixTrie < SymbolType >::checkTrie ( const std::trie < SymbolType, std::variant < void, unsigned > > & trie ) { for ( const std::pair < const SymbolType, std::trie < SymbolType, std::variant < void, unsigned > > > & child : trie.getChildren ( ) ) { if ( ! getAlphabet ( ).count ( child.first ) ) - throw exception::CommonException ( "Symbol " + std::to_string ( child.first ) + "not in the alphabet." ); + throw exception::CommonException ( "Symbol " + ext::to_string ( child.first ) + "not in the alphabet." ); checkTrie ( child.second ); } } diff --git a/alib2data/src/label/HexavigesimalLabel.cpp b/alib2data/src/label/HexavigesimalLabel.cpp index 560afce384e21f47084fc7d88f2bac0ee7b49589..2db36aecc8de5756f2568ebd87919a8034b24a24 100644 --- a/alib2data/src/label/HexavigesimalLabel.cpp +++ b/alib2data/src/label/HexavigesimalLabel.cpp @@ -47,14 +47,14 @@ HexavigesimalLabel::operator std::string() const { HexavigesimalLabel HexavigesimalLabel::parse(std::deque<sax::Token>::iterator& input) { sax::FromXMLParserHelper::popToken(input, sax::Token::TokenType::START_ELEMENT, HexavigesimalLabel::getXmlTagName()); - HexavigesimalLabel data(std::from_string < int > (sax::FromXMLParserHelper::popTokenData(input, sax::Token::TokenType::CHARACTER))); + HexavigesimalLabel data(ext::from_string < int > (sax::FromXMLParserHelper::popTokenData(input, sax::Token::TokenType::CHARACTER))); sax::FromXMLParserHelper::popToken(input, sax::Token::TokenType::END_ELEMENT, HexavigesimalLabel::getXmlTagName()); return data; } void HexavigesimalLabel::compose(std::deque<sax::Token>& out) const { out.emplace_back(HexavigesimalLabel::getXmlTagName(), sax::Token::TokenType::START_ELEMENT); - out.emplace_back(std::to_string(m_hexavigesimal), sax::Token::TokenType::CHARACTER); + out.emplace_back(ext::to_string(m_hexavigesimal), sax::Token::TokenType::CHARACTER); out.emplace_back(HexavigesimalLabel::getXmlTagName(), sax::Token::TokenType::END_ELEMENT); } diff --git a/alib2data/src/rte/common/RTEFromXMLParser.h b/alib2data/src/rte/common/RTEFromXMLParser.h index d43ccfcf8a98b50f018b13f67b551658dbbef72d..adb5897b4c22a69a1652d79cdc03db16bd7b4b68 100644 --- a/alib2data/src/rte/common/RTEFromXMLParser.h +++ b/alib2data/src/rte/common/RTEFromXMLParser.h @@ -156,7 +156,7 @@ std::rvalue_ref < FormalRTESymbolAlphabet < SymbolType, RankType > > RTEFromXMLP elements.push_back ( parseFormalRTESymbol < SymbolType, RankType > ( input ) ); if ( elements.size() != ( size_t ) symbol.getRank( ) ) - throw exception::CommonException ( "Parsed symbol's rank and number of children differ. Rank is " + std::to_string ( symbol.getRank ( ) ) + ", number of children is " + std::to_string ( elements.size ( ) ) + "." ); + throw exception::CommonException ( "Parsed symbol's rank and number of children differ. Rank is " + ext::to_string ( symbol.getRank ( ) ) + ", number of children is " + ext::to_string ( elements.size ( ) ) + "." ); for ( std::rvalue_ref < FormalRTESymbol < SymbolType, RankType > > & element : elements ) ret->appendElement ( element ); diff --git a/alib2data/src/rte/formal/FormalRTE.h b/alib2data/src/rte/formal/FormalRTE.h index 0d22641feb4f230f15b8e369e9c78744bc190cde..e0473f5a4ed71de0d829f4aade8c4a06bf9a4536 100644 --- a/alib2data/src/rte/formal/FormalRTE.h +++ b/alib2data/src/rte/formal/FormalRTE.h @@ -262,7 +262,7 @@ public: static void valid ( const rte::FormalRTE < SymbolType, RankType > & rte, const common::ranked_symbol < SymbolType, RankType > & symbol ) { if ( rte.template accessComponent < rte::ConstantAlphabet > ( ).get ( ).count ( symbol ) ) - throw ::exception::CommonException ( "Symbol " + std::to_string ( symbol ) + " cannot be in general alphabet since it is already in constant alphabet" ); + throw ::exception::CommonException ( "Symbol " + ext::to_string ( symbol ) + " cannot be in general alphabet since it is already in constant alphabet" ); } }; @@ -279,7 +279,7 @@ public: static void valid ( const rte::FormalRTE < SymbolType, RankType > & rte, const common::ranked_symbol < SymbolType, RankType > & symbol ) { if ( rte.template accessComponent < rte::GeneralAlphabet > ( ).get ( ).count ( symbol ) ) - throw ::exception::CommonException ( "Symbol " + std::to_string ( symbol ) + " cannot be in constant alphabet since it is already in general alphabet" ); + throw ::exception::CommonException ( "Symbol " + ext::to_string ( symbol ) + " cannot be in constant alphabet since it is already in general alphabet" ); } }; diff --git a/alib2data/src/string/LinearString.h b/alib2data/src/string/LinearString.h index 7ce3dfafe51a90d752dddd01443dc129a26f89cf..56de0f113eb8fddf54675db4d46c537676cbbfb6 100644 --- a/alib2data/src/string/LinearString.h +++ b/alib2data/src/string/LinearString.h @@ -209,7 +209,7 @@ StringBase * LinearString < SymbolType >::plunder ( ) && { template < class SymbolType > void LinearString < SymbolType >::appendSymbol ( SymbolType symbol ) { if ( getAlphabet().count ( symbol ) == 0 ) - throw exception::CommonException ( "Input symbol \"" + std::to_string ( symbol ) + "\" not in the alphabet." ); + throw exception::CommonException ( "Input symbol \"" + ext::to_string ( symbol ) + "\" not in the alphabet." ); m_Data.push_back ( std::move ( symbol ) ); } diff --git a/alib2data/src/tree/ranked/PrefixRankedBarNonlinearPattern.h b/alib2data/src/tree/ranked/PrefixRankedBarNonlinearPattern.h index 1223234f3692eb973a86311779b2bd777196759f..6d6d43607b8a55e9c8422517f2bc954d2963d44f 100644 --- a/alib2data/src/tree/ranked/PrefixRankedBarNonlinearPattern.h +++ b/alib2data/src/tree/ranked/PrefixRankedBarNonlinearPattern.h @@ -389,7 +389,7 @@ public: throw ::tree::TreeException ( "SubtreeWildcard symbol has nonzero arity" ); if ( pattern.template accessElement < ::tree::SubtreeWildcard > ( ).get ( ) == symbol ) - throw ::tree::TreeException ( "Symbol " + std::to_string ( symbol ) + "cannot be set as nonlinear variable since it is already subtree wildcard" ); + throw ::tree::TreeException ( "Symbol " + ext::to_string ( symbol ) + "cannot be set as nonlinear variable since it is already subtree wildcard" ); } }; @@ -405,7 +405,7 @@ public: throw ::tree::TreeException ( "SubtreeWildcard symbol has nonzero arity" ); if ( pattern.template accessComponent < ::tree::NonlinearAlphabet > ( ).get ( ).count ( symbol ) ) - throw ::tree::TreeException ( "Symbol " + std::to_string ( symbol ) + "cannot be set as subtree wildcard since it is already nonlinear variable" ); + throw ::tree::TreeException ( "Symbol " + ext::to_string ( symbol ) + "cannot be set as subtree wildcard since it is already nonlinear variable" ); } }; diff --git a/alib2data/src/tree/ranked/PrefixRankedNonlinearPattern.h b/alib2data/src/tree/ranked/PrefixRankedNonlinearPattern.h index 673d781e5807f5d8273ce146ab65aa54e0e096a9..e083182af1d1247630f8d0c2b446b7de28b9c980 100644 --- a/alib2data/src/tree/ranked/PrefixRankedNonlinearPattern.h +++ b/alib2data/src/tree/ranked/PrefixRankedNonlinearPattern.h @@ -322,7 +322,7 @@ public: throw ::tree::TreeException ( "SubtreeWildcard symbol has nonzero arity" ); if ( pattern.template accessElement < ::tree::SubtreeWildcard > ( ).get ( ) == symbol ) - throw ::tree::TreeException ( "Symbol " + std::to_string ( symbol ) + "cannot be set as nonlinear variable since it is already subtree wildcard" ); + throw ::tree::TreeException ( "Symbol " + ext::to_string ( symbol ) + "cannot be set as nonlinear variable since it is already subtree wildcard" ); } }; @@ -338,7 +338,7 @@ public: throw ::tree::TreeException ( "SubtreeWildcard symbol has nonzero arity" ); if ( pattern.template accessComponent < ::tree::NonlinearAlphabet > ( ).get ( ).count ( symbol ) ) - throw ::tree::TreeException ( "Symbol " + std::to_string ( symbol ) + "cannot be set as subtree wildcard since it is already nonlinear variable" ); + throw ::tree::TreeException ( "Symbol " + ext::to_string ( symbol ) + "cannot be set as subtree wildcard since it is already nonlinear variable" ); } }; diff --git a/alib2data/src/tree/ranked/RankedNonlinearPattern.h b/alib2data/src/tree/ranked/RankedNonlinearPattern.h index 653e03bb939638af37482f114f9b78085c1d3d0d..09f779667d91bd61c5808ca57b9a21560689ae18 100644 --- a/alib2data/src/tree/ranked/RankedNonlinearPattern.h +++ b/alib2data/src/tree/ranked/RankedNonlinearPattern.h @@ -292,7 +292,7 @@ public: throw ::tree::TreeException ( "SubtreeWildcard symbol has nonzero arity" ); if ( pattern.template accessElement < ::tree::SubtreeWildcard > ( ).get ( ) == symbol ) - throw ::tree::TreeException ( "Symbol " + std::to_string ( symbol ) + "cannot be set as nonlinear variable since it is already subtree wildcard" ); + throw ::tree::TreeException ( "Symbol " + ext::to_string ( symbol ) + "cannot be set as nonlinear variable since it is already subtree wildcard" ); } }; @@ -308,7 +308,7 @@ public: throw ::tree::TreeException ( "SubtreeWildcard symbol has nonzero arity" ); if ( pattern.template accessComponent < ::tree::NonlinearAlphabet > ( ).get ( ).count ( symbol ) ) - throw ::tree::TreeException ( "Symbol " + std::to_string ( symbol ) + "cannot be set as subtree wildcard since it is already nonlinear variable" ); + throw ::tree::TreeException ( "Symbol " + ext::to_string ( symbol ) + "cannot be set as subtree wildcard since it is already nonlinear variable" ); } }; diff --git a/alib2data/src/tree/unranked/UnrankedNonlinearPattern.h b/alib2data/src/tree/unranked/UnrankedNonlinearPattern.h index 40c04104bb031df567b79eae0c69cde25db7d26e..0445eee8829e5595c0aadc2e4b9866b10648650f 100644 --- a/alib2data/src/tree/unranked/UnrankedNonlinearPattern.h +++ b/alib2data/src/tree/unranked/UnrankedNonlinearPattern.h @@ -283,7 +283,7 @@ public: static void valid ( const ::tree::UnrankedNonlinearPattern < SymbolType > & pattern, const SymbolType & symbol) { if ( pattern.template accessElement < ::tree::SubtreeWildcard > ( ).get ( ) == symbol ) - throw ::tree::TreeException ( "Symbol " + std::to_string ( symbol ) + "cannot be set as nonlinear variable since it is already subtree wildcard" ); + throw ::tree::TreeException ( "Symbol " + ext::to_string ( symbol ) + "cannot be set as nonlinear variable since it is already subtree wildcard" ); } }; @@ -296,7 +296,7 @@ public: static void valid ( const ::tree::UnrankedNonlinearPattern < SymbolType > & pattern, const SymbolType & symbol) { if ( pattern.template accessComponent < ::tree::NonlinearAlphabet > ( ).get ( ).count ( symbol ) ) - throw ::tree::TreeException ( "Symbol " + std::to_string ( symbol ) + "cannot be set as subtree wildcard since it is already nonlinear variable" ); + throw ::tree::TreeException ( "Symbol " + ext::to_string ( symbol ) + "cannot be set as subtree wildcard since it is already nonlinear variable" ); } }; diff --git a/alib2data/test-src/common/SparseBoolVectorTest.cpp b/alib2data/test-src/common/SparseBoolVectorTest.cpp index 443c950060b3fe4ba982506d6c0f47523f8db159..e2b44cab19da1f6fbf5c20249ec370a907bae4a3 100644 --- a/alib2data/test-src/common/SparseBoolVectorTest.cpp +++ b/alib2data/test-src/common/SparseBoolVectorTest.cpp @@ -236,7 +236,7 @@ void SparseBoolVectorTest::testSubscript() { std::cout << data.data ( ) << std::endl;*/ for ( size_t i = 0; i < ref.size ( ); ++ i ) - CPPUNIT_ASSERT_EQUAL_MESSAGE ( "Failed on index " + std::to_string ( i ), ( bool ) ref [ i ], ( bool ) data [ i ] ); + CPPUNIT_ASSERT_EQUAL_MESSAGE ( "Failed on index " + ext::to_string ( i ), ( bool ) ref [ i ], ( bool ) data [ i ] ); } void SparseBoolVectorTest::testSubscript2() { diff --git a/alib2data_experimental/src/graph/common/GraphFromXMLParser.cpp b/alib2data_experimental/src/graph/common/GraphFromXMLParser.cpp index 8ea05651a1f080fabd0d843d6462ade532e2a234..c054a90fa64f274a62a71d80fbf3183c087b701d 100644 --- a/alib2data_experimental/src/graph/common/GraphFromXMLParser.cpp +++ b/alib2data_experimental/src/graph/common/GraphFromXMLParser.cpp @@ -69,7 +69,7 @@ UndirectedEdge GraphFromXMLParser::parseUndirectedEdge(std::deque<sax::Token>::i int GraphFromXMLParser::parseValue(std::deque<sax::Token>::iterator& input) { sax::FromXMLParserHelper::popToken(input, sax::Token::TokenType::START_ELEMENT, "value"); - int value = std::from_string < int > (sax::FromXMLParserHelper::popTokenData(input, sax::Token::TokenType::CHARACTER)); + int value = ext::from_string < int > (sax::FromXMLParserHelper::popTokenData(input, sax::Token::TokenType::CHARACTER)); sax::FromXMLParserHelper::popToken(input, sax::Token::TokenType::END_ELEMENT, "value"); return value; diff --git a/alib2data_experimental/src/graph/common/GraphToXMLComposer.h b/alib2data_experimental/src/graph/common/GraphToXMLComposer.h index c55bc1d643b8c7f4cd3ab28f89fbab7535ab4d61..8a1676c9d2f307256d563519ab4eb81b67f3ba74 100644 --- a/alib2data_experimental/src/graph/common/GraphToXMLComposer.h +++ b/alib2data_experimental/src/graph/common/GraphToXMLComposer.h @@ -51,7 +51,7 @@ void GraphToXMLComposer::composeNodeValues(std::deque<sax::Token> &out, const T for (auto i : graph.nodeValues) { composeNode(out, i.first); out.emplace_back("value", sax::Token::TokenType::START_ELEMENT); - out.emplace_back(std::to_string(i.second), sax::Token::TokenType::CHARACTER); + out.emplace_back(ext::to_string(i.second), sax::Token::TokenType::CHARACTER); out.emplace_back("value", sax::Token::TokenType::END_ELEMENT); } out.emplace_back("nodevalues", sax::Token::TokenType::END_ELEMENT); @@ -63,7 +63,7 @@ void GraphToXMLComposer::composeEdgeValues(std::deque<sax::Token> &out, const T for (auto &i : graph.edgeValues) { composeEdge(out, i.first); out.emplace_back("value", sax::Token::TokenType::START_ELEMENT); - out.emplace_back(std::to_string(i.second), sax::Token::TokenType::CHARACTER); + out.emplace_back(ext::to_string(i.second), sax::Token::TokenType::CHARACTER); out.emplace_back("value", sax::Token::TokenType::END_ELEMENT); } out.emplace_back("edgevalues", sax::Token::TokenType::END_ELEMENT); diff --git a/alib2data_experimental/src/string/LinearStringTerminatingSymbol.cpp b/alib2data_experimental/src/string/LinearStringTerminatingSymbol.cpp index 952b8382cd78c73490f3c9b99fb99b93ea737e27..2b5392e7e75d53ec047079e50a293ca6d5be743b 100644 --- a/alib2data_experimental/src/string/LinearStringTerminatingSymbol.cpp +++ b/alib2data_experimental/src/string/LinearStringTerminatingSymbol.cpp @@ -46,7 +46,7 @@ StringBase * LinearStringTerminatingSymbol::plunder ( ) && { void LinearStringTerminatingSymbol::appendSymbol ( DefaultSymbolType symbol ) { if ( getAlphabet().count ( symbol ) == 0 ) - throw exception::CommonException ( "Input symbol \"" + std::to_string ( symbol ) + "\" not in the alphabet." ); + throw exception::CommonException ( "Input symbol \"" + ext::to_string ( symbol ) + "\" not in the alphabet." ); m_Data.push_back ( std::move ( symbol ) ); } diff --git a/alib2measurepp/src/processor/MeasurementProcessorViews.cpp b/alib2measurepp/src/processor/MeasurementProcessorViews.cpp index cf9e827d8830048348e3921a37ce40dddf5e48c2..8f23f62dda433c233f463239f0132398e927f080 100644 --- a/alib2measurepp/src/processor/MeasurementProcessorViews.cpp +++ b/alib2measurepp/src/processor/MeasurementProcessorViews.cpp @@ -10,31 +10,31 @@ std::string MeasurementProcessorViews::viewTimeDataFrame ( const MeasurementFram // make this default behavior // if(outputEngineAttr.count(TIME_DURATION_ATTR)) if ( outputEngineAttr.count ( INFRAME_ATTR ) ) - return std::to_string ( frame.time.inFrameDuration.count ( ) ); + return ext::to_string ( frame.time.inFrameDuration.count ( ) ); else - return std::to_string ( frame.time.duration.count ( ) ); + return ext::to_string ( frame.time.duration.count ( ) ); } std::string MeasurementProcessorViews::viewMemoryDataFrame ( const MeasurementFrame & frame, const std::set < std::string > & outputEngineAttr ) { if ( outputEngineAttr.count ( MEMORY_SHU_ATTR ) ) - return std::to_string ( frame.memory.startHeapUsage ); + return ext::to_string ( frame.memory.startHeapUsage ); if ( outputEngineAttr.count ( MEMORY_EHU_ATTR ) ) - return std::to_string ( frame.memory.endHeapUsage ); + return ext::to_string ( frame.memory.endHeapUsage ); if ( outputEngineAttr.count ( MEMORY_HW_ATTR ) ) { if ( outputEngineAttr.count ( INFRAME_ATTR ) ) - return std::to_string ( frame.memory.inFrameHighWatermark ); + return ext::to_string ( frame.memory.inFrameHighWatermark ); else - return std::to_string ( frame.memory.highWatermark ); + return ext::to_string ( frame.memory.highWatermark ); } // make this default behavior // if(outputEngineAttr.count(MEMORY_DELTA_ATTR)) if ( outputEngineAttr.count ( INFRAME_ATTR ) ) - return std::to_string ( frame.memory.inFrameHighWatermark - frame.memory.startHeapUsage ); + return ext::to_string ( frame.memory.inFrameHighWatermark - frame.memory.startHeapUsage ); else - return std::to_string ( frame.memory.highWatermark - frame.memory.startHeapUsage ); + return ext::to_string ( frame.memory.highWatermark - frame.memory.startHeapUsage ); } std::string MeasurementProcessorViews::viewCounterDataFrame ( const MeasurementFrame & frame, const std::set < std::string > & outputEngineAttr ) { @@ -45,17 +45,17 @@ std::string MeasurementProcessorViews::viewCounterDataFrame ( const MeasurementF auto it = frame.counter.counters.find ( measurements::stealthStringFromString ( attr ) ); if ( it != frame.counter.counters.end ( ) ) - return std::to_string ( it->second ); + return ext::to_string ( it->second ); } } else { auto it = frame.counter.inFrameCounters.find ( measurements::stealthStringFromString ( * outputEngineAttr.begin ( ) ) ); if ( it != frame.counter.inFrameCounters.end ( ) ) - return std::to_string ( it->second ); + return ext::to_string ( it->second ); } // we default to default constructed value_type - return std::to_string ( measurements::CounterHint::value_type { } ); + return ext::to_string ( measurements::CounterHint::value_type { } ); } std::string MeasurementProcessorViews::INFRAME_ATTR = "inFrame"; diff --git a/alib2measurepp/src/provisioner/MeasurementProvisionerConfigurationXml.cpp b/alib2measurepp/src/provisioner/MeasurementProvisionerConfigurationXml.cpp index 9979ac7d81507eaefff718223175e48c5f80858c..ceea9d353dbfb9bcda4cf26659a3854c72a1784c 100644 --- a/alib2measurepp/src/provisioner/MeasurementProvisionerConfigurationXml.cpp +++ b/alib2measurepp/src/provisioner/MeasurementProvisionerConfigurationXml.cpp @@ -60,7 +60,7 @@ void MeasurementProvisionerConfigurationXml::parseEnvironment ( MeasurementProvi sax::FromXMLParserHelper::popToken ( iter, sax::Token::TokenType::END_ELEMENT, WORKING_DIRECTORY_TAG ); } else if ( data == PIPELINE_ITERATIONS_TAG ) { sax::FromXMLParserHelper::popToken ( iter, sax::Token::TokenType::START_ELEMENT, PIPELINE_ITERATIONS_TAG ); - mpc.environment.pipelineIterations = std::from_string < int > ( sax::FromXMLParserHelper::popTokenData ( iter, sax::Token::TokenType::CHARACTER ) ); + mpc.environment.pipelineIterations = ext::from_string < int > ( sax::FromXMLParserHelper::popTokenData ( iter, sax::Token::TokenType::CHARACTER ) ); sax::FromXMLParserHelper::popToken ( iter, sax::Token::TokenType::END_ELEMENT, PIPELINE_ITERATIONS_TAG ); } else { break; @@ -152,10 +152,10 @@ MPCInputDatum MeasurementProvisionerConfigurationXml::parseInputDatum ( const st sax::FromXMLParserHelper::popToken ( iter, sax::Token::TokenType::END_ATTRIBUTE, attrName ); if ( attrName == INPUT_DATA_ATTR_ID_NAME ) { - mpcid.id = std::from_string < int > ( attrVal ); + mpcid.id = ext::from_string < int > ( attrVal ); foundId = true; } else if ( attrName == INPUT_DATA_ATTR_COUNT_NAME ) { - mpcid.count = std::from_string < int > ( attrVal ); + mpcid.count = ext::from_string < int > ( attrVal ); } else if ( attrName == INPUT_DATA_ATTR_ALIAS_NAME ) { mpcid.alias = std::move ( attrVal ); } else { diff --git a/alib2measurepp/src/provisioner/MeasurementProvisionerInputData.cpp b/alib2measurepp/src/provisioner/MeasurementProvisionerInputData.cpp index 08c4452b703937026cf9919d3c7bc8698edc5143..07621f347c3e5ff876ce130e880a5c484d2b63bb 100644 --- a/alib2measurepp/src/provisioner/MeasurementProvisionerInputData.cpp +++ b/alib2measurepp/src/provisioner/MeasurementProvisionerInputData.cpp @@ -237,7 +237,7 @@ void MPInputData::processSimpleBatch ( const MPCInputBatch & inputBatch ) { for ( const auto & didPair : distributedMPInputData ) if ( didLen != didPair.second.size ( ) ) - throw::exception::CommonException ( "MPInputData: Not enough data for id " + std::to_string ( didPair.first ) + " in input batch to make substitution maps" ); + throw::exception::CommonException ( "MPInputData: Not enough data for id " + ext::to_string ( didPair.first ) + " in input batch to make substitution maps" ); for ( size_t i = 0; i < didLen; ++i ) { MPSubstitutionMap substitutionMap; diff --git a/alib2measurepp/src/provisioner/MeasurementProvisionerResultsXml.cpp b/alib2measurepp/src/provisioner/MeasurementProvisionerResultsXml.cpp index 688e5aad129326c0f97617ad067d8cae2df8b8b2..ebee40cc045dd6b5df19576ab419e02def8d2274 100644 --- a/alib2measurepp/src/provisioner/MeasurementProvisionerResultsXml.cpp +++ b/alib2measurepp/src/provisioner/MeasurementProvisionerResultsXml.cpp @@ -36,7 +36,7 @@ void MeasurementProvisionerResultsXml::composeInputs ( std::deque < sax::Token > for ( const std::pair < const int, std::string > & input : mprir.inputs ) { tokens.emplace_back ( INPUT_TAG, sax::Token::TokenType::START_ELEMENT ); tokens.emplace_back ( INPUT_ATTR_ID_NAME, sax::Token::TokenType::START_ATTRIBUTE ); - tokens.emplace_back ( std::to_string ( input.first ), sax::Token::TokenType::CHARACTER ); + tokens.emplace_back ( ext::to_string ( input.first ), sax::Token::TokenType::CHARACTER ); tokens.emplace_back ( INPUT_ATTR_ID_NAME, sax::Token::TokenType::END_ATTRIBUTE ); tokens.emplace_back ( input.second, sax::Token::TokenType::CHARACTER ); tokens.emplace_back ( INPUT_TAG, sax::Token::TokenType::END_ELEMENT ); @@ -67,7 +67,7 @@ void MeasurementProvisionerResultsXml::composePipelineStatus ( std::deque < sax: tokens.emplace_back ( PIPELINE_STATUS_TAG, sax::Token::TokenType::START_ELEMENT ); tokens.emplace_back ( EXIT_CODE_TAG, sax::Token::TokenType::START_ELEMENT ); - tokens.emplace_back ( std::to_string ( mprpr.pipelineStatus.exitCode ), sax::Token::TokenType::CHARACTER ); + tokens.emplace_back ( ext::to_string ( mprpr.pipelineStatus.exitCode ), sax::Token::TokenType::CHARACTER ); tokens.emplace_back ( EXIT_CODE_TAG, sax::Token::TokenType::END_ELEMENT ); tokens.emplace_back ( ERROR_ORIGIN_TAG, sax::Token::TokenType::START_ELEMENT ); tokens.emplace_back ( mprpr.pipelineStatus.errorOrigin, sax::Token::TokenType::CHARACTER ); @@ -166,7 +166,7 @@ void MeasurementProvisionerResultsXml::parseInputs ( MPRInputResult & mprir, std sax::FromXMLParserHelper::popToken ( iter, sax::Token::TokenType::START_ATTRIBUTE, idAttr ); - int id = std::from_string < int > ( sax::FromXMLParserHelper::popTokenData ( iter, sax::Token::TokenType::CHARACTER ) ); + int id = ext::from_string < int > ( sax::FromXMLParserHelper::popTokenData ( iter, sax::Token::TokenType::CHARACTER ) ); sax::FromXMLParserHelper::popToken ( iter, sax::Token::TokenType::END_ATTRIBUTE, idAttr ); @@ -229,7 +229,7 @@ void MeasurementProvisionerResultsXml::parsePipelineStatus ( MPRPipelineResult & if ( data == EXIT_CODE_TAG ) { sax::FromXMLParserHelper::popToken ( iter, sax::Token::TokenType::START_ELEMENT, EXIT_CODE_TAG ); - mprpr.pipelineStatus.exitCode = std::from_string < int > ( sax::FromXMLParserHelper::popTokenData ( iter, sax::Token::TokenType::CHARACTER ) ); + mprpr.pipelineStatus.exitCode = ext::from_string < int > ( sax::FromXMLParserHelper::popTokenData ( iter, sax::Token::TokenType::CHARACTER ) ); sax::FromXMLParserHelper::popToken ( iter, sax::Token::TokenType::END_ELEMENT, EXIT_CODE_TAG ); } else if ( data == ERROR_ORIGIN_TAG ) { sax::FromXMLParserHelper::popToken ( iter, sax::Token::TokenType::START_ELEMENT, ERROR_ORIGIN_TAG ); diff --git a/alib2measurepp/src/provisioner/MeasurementProvisionerUtils.cpp b/alib2measurepp/src/provisioner/MeasurementProvisionerUtils.cpp index e4dee6e34fda1870df9bbbd4bd345eff75d8148d..cbf023f4e512615304666acf7d3e5e90295be9f8 100644 --- a/alib2measurepp/src/provisioner/MeasurementProvisionerUtils.cpp +++ b/alib2measurepp/src/provisioner/MeasurementProvisionerUtils.cpp @@ -32,10 +32,10 @@ std::list < std::string > MPUtils::shellExpand ( const std::string & str ) { } std::string MPUtils::randomFilename ( ) { - static std::string randomSeed = std::to_string ( std::random_devices::semirandom ( ) ); + static std::string randomSeed = ext::to_string ( std::random_devices::semirandom ( ) ); static int randomOrder = 0; - return randomSeed + "_" + std::to_string ( randomOrder++ ); + return randomSeed + "_" + ext::to_string ( randomOrder++ ); } MPUtils::ShmFileHandle MPUtils::openShmFile ( ) { diff --git a/alib2raw/src/string/StringToRawComposer.cpp b/alib2raw/src/string/StringToRawComposer.cpp index 14b1b3c8eea42cd3563250c1853d4f639877be94..df55d4e72f1b4321abb05056d5c6454ea434a583 100644 --- a/alib2raw/src/string/StringToRawComposer.cpp +++ b/alib2raw/src/string/StringToRawComposer.cpp @@ -19,7 +19,7 @@ void StringToRawComposer::compose(std::ostream& out, const String& string) { template < class SymbolType > void StringToRawComposer::compose(std::ostream& out, const LinearString < SymbolType > & string) { for(const SymbolType & symbol : string.getContent()) { - out << std::to_string ( symbol ); + out << ext::to_string ( symbol ); } } diff --git a/alib2raw/src/tree/TreeToRawComposer.h b/alib2raw/src/tree/TreeToRawComposer.h index f3c690db2ca39b77e93e56c3c58288f00fa3f387..06ea58b7c7c28067218508661d99d989312eed63 100644 --- a/alib2raw/src/tree/TreeToRawComposer.h +++ b/alib2raw/src/tree/TreeToRawComposer.h @@ -49,14 +49,14 @@ private: template < class SymbolType, class RankType > void TreeToRawComposer::composeNode(std::deque<sax::Token>& out, const std::tree < common::ranked_symbol < SymbolType, RankType > > & node) { if(node.getChildren().size() == 0) { - out.emplace_back(sax::Token(std::to_string ( node.getData ( ) ), sax::Token::TokenType::CHARACTER)); + out.emplace_back(sax::Token(ext::to_string ( node.getData ( ) ), sax::Token::TokenType::CHARACTER)); } else { - out.emplace_back(sax::Token( std::to_string ( node.getData ( ) ), sax::Token::TokenType::START_ELEMENT)); + out.emplace_back(sax::Token( ext::to_string ( node.getData ( ) ), sax::Token::TokenType::START_ELEMENT)); for(const std::tree < common::ranked_symbol < SymbolType, RankType > > & child : node.getChildren()) { composeNode(out, child); } - out.emplace_back(sax::Token( std::to_string ( node.getData ( ) ), sax::Token::TokenType::END_ELEMENT)); + out.emplace_back(sax::Token( ext::to_string ( node.getData ( ) ), sax::Token::TokenType::END_ELEMENT)); } } @@ -65,17 +65,17 @@ void TreeToRawComposer::composePrefixRankedNotation(std::deque<sax::Token>& out, unsigned size = ( unsigned ) notation[index].getRank(); unsigned root = index; if(size == 0) { - out.emplace_back(sax::Token( std::to_string ( notation[root] ), sax::Token::TokenType::CHARACTER)); + out.emplace_back(sax::Token( ext::to_string ( notation[root] ), sax::Token::TokenType::CHARACTER)); index += 1; } else { - out.emplace_back(sax::Token( std::to_string ( notation[root] ), sax::Token::TokenType::START_ELEMENT)); + out.emplace_back(sax::Token( ext::to_string ( notation[root] ), sax::Token::TokenType::START_ELEMENT)); index += 1; for(unsigned i = 0; i < size; ++i) { composePrefixRankedNotation(out, index, notation); } - out.emplace_back(sax::Token( std::to_string ( notation[root] ), sax::Token::TokenType::END_ELEMENT)); + out.emplace_back(sax::Token( ext::to_string ( notation[root] ), sax::Token::TokenType::END_ELEMENT)); } } @@ -84,10 +84,10 @@ void TreeToRawComposer::composePrefixRankedBarNotation(std::deque<sax::Token>& o unsigned size = ( unsigned ) notation[index].getRank(); unsigned root = index; if(size == 0) { - out.emplace_back(sax::Token( std::to_string ( notation[root] ), sax::Token::TokenType::CHARACTER)); + out.emplace_back(sax::Token( ext::to_string ( notation[root] ), sax::Token::TokenType::CHARACTER)); index += 2; } else { - out.emplace_back(sax::Token( std::to_string ( notation[root] ), sax::Token::TokenType::START_ELEMENT)); + out.emplace_back(sax::Token( ext::to_string ( notation[root] ), sax::Token::TokenType::START_ELEMENT)); index += 1; for(unsigned i = 0; i < size; i++) { @@ -95,7 +95,7 @@ void TreeToRawComposer::composePrefixRankedBarNotation(std::deque<sax::Token>& o } index += 1; - out.emplace_back(sax::Token(std::to_string ( notation[root] ), sax::Token::TokenType::END_ELEMENT)); + out.emplace_back(sax::Token(ext::to_string ( notation[root] ), sax::Token::TokenType::END_ELEMENT)); } } @@ -104,12 +104,12 @@ void TreeToRawComposer::composeNode(std::deque<sax::Token>& out, const std::tree if(node.getChildren().size() == 0) { } else { - out.emplace_back(sax::Token( std::to_string ( node.getData ( ) ), sax::Token::TokenType::START_ELEMENT)); + out.emplace_back(sax::Token( ext::to_string ( node.getData ( ) ), sax::Token::TokenType::START_ELEMENT)); for(const std::tree < SymbolType > & child : node.getChildren()) { composeNode(out, child); } - out.emplace_back(sax::Token(std::to_string ( node.getData ( ) ), sax::Token::TokenType::END_ELEMENT)); + out.emplace_back(sax::Token(ext::to_string ( node.getData ( ) ), sax::Token::TokenType::END_ELEMENT)); } } diff --git a/alib2std/src/extensions/bitset.hpp b/alib2std/src/extensions/bitset.hpp index 573b3477ffe92c90fc71cbb06f7809b169a46b49..cb982c01abd4ae14921af02420bb14532063a7f1 100644 --- a/alib2std/src/extensions/bitset.hpp +++ b/alib2std/src/extensions/bitset.hpp @@ -46,17 +46,13 @@ struct compare < std::bitset < N > > { } }; -} /* namespace ext */ - -namespace std { - template < size_t N > -string to_string ( const std::bitset < N > & value ) { +std::string to_string ( const std::bitset < N > & value ) { std::stringstream ss; ss << value; return ss.str ( ); } -} /* namespace std */ +} /* namespace ext */ #endif /* __BITSET_HPP_ */ diff --git a/alib2std/src/extensions/deque.hpp b/alib2std/src/extensions/deque.hpp index c77fe407e2afffbf3a6ad3b63585736c974b4269..7ac83b6fcde631adc6988b8d10fa6c2467c03b3f 100644 --- a/alib2std/src/extensions/deque.hpp +++ b/alib2std/src/extensions/deque.hpp @@ -58,10 +58,6 @@ struct compare < std::deque < T, Ts ... > > { }; -} /* namespace ext */ - -namespace std { - template < class T, class ... Ts > std::string to_string ( const std::deque < T, Ts ... > & value ) { std::stringstream ss; @@ -69,6 +65,6 @@ std::string to_string ( const std::deque < T, Ts ... > & value ) { return ss.str(); } -} /* namespace std */ +} /* namespace ext */ #endif /* __DEQUE_HPP_ */ diff --git a/alib2std/src/extensions/forward_list.hpp b/alib2std/src/extensions/forward_list.hpp index df4bde9561447ddbf565157916f7189e24266e1b..9efbba57fe2b707e6c0383ce7ec6ebf81a7d086f 100644 --- a/alib2std/src/extensions/forward_list.hpp +++ b/alib2std/src/extensions/forward_list.hpp @@ -51,10 +51,6 @@ struct compare<forward_list<T, Ts ... >> { } }; -} /* namespace ext */ - -namespace std { - template < class T, class ... Ts > string to_string ( const std::forward_list < T, Ts ... > & value ) { std::stringstream ss; @@ -62,7 +58,7 @@ string to_string ( const std::forward_list < T, Ts ... > & value ) { return ss.str(); } -} /* namespace std */ +} /* namespace ext */ #endif /* __FORWARD_LIST_HPP_ */ diff --git a/alib2std/src/extensions/forward_tree.hpp b/alib2std/src/extensions/forward_tree.hpp index 6c55ccf6dd46b68de2f1d5b88bfd6b28b0713210..ffc8b454268893f5cc5fcbea3f699f1db6c32b19 100644 --- a/alib2std/src/extensions/forward_tree.hpp +++ b/alib2std/src/extensions/forward_tree.hpp @@ -618,10 +618,6 @@ struct compare < std::forward_tree < T > > { }; -} /* namespace ext */ - -namespace std { - template < class T > std::string to_string ( const std::forward_tree < T > & value ) { std::stringstream ss; @@ -629,6 +625,6 @@ std::string to_string ( const std::forward_tree < T > & value ) { return ss.str(); } -} /* namespace std */ +} /* namespace ext */ #endif /* __FORWARD_TREE_HPP_ */ diff --git a/alib2std/src/extensions/linear_set.hpp b/alib2std/src/extensions/linear_set.hpp index 314630139c8ff47f90d958e6f15ad93256483d37..319461580424a3eabd74f8697e49fb07fefcf012 100644 --- a/alib2std/src/extensions/linear_set.hpp +++ b/alib2std/src/extensions/linear_set.hpp @@ -330,17 +330,17 @@ struct compare<std::linear_set<T, Ts ...>> { } }; -} /* namespace ext */ - -namespace std { - template < class T, class ... Ts > -std::string to_string ( const linear_set < T, Ts ... > & value ) { +std::string to_string ( const std::linear_set < T, Ts ... > & value ) { std::stringstream ss; ss << value; return ss.str(); } +} /* namespace ext */ + +namespace std { + template <class Iterator> class linear_set_move_iterator { Iterator current; diff --git a/alib2std/src/extensions/list.hpp b/alib2std/src/extensions/list.hpp index 10e9c8a4850fa5eab8cdedd966ddfd7eb1dcb701..72ef08dfc788a4c39e9126c2cbd7c61fe3f587fa 100644 --- a/alib2std/src/extensions/list.hpp +++ b/alib2std/src/extensions/list.hpp @@ -51,10 +51,6 @@ struct compare < std::list < T, Ts ... > > { } }; -} /* namespace ext */ - -namespace std { - template < class T, class ... Ts > std::string to_string ( const std::list < T, Ts ... > & value ) { std::stringstream ss; @@ -62,6 +58,6 @@ std::string to_string ( const std::list < T, Ts ... > & value ) { return ss.str(); } -} /* namespace std */ +} /* namespace ext */ #endif /* __LIST_HPP_ */ diff --git a/alib2std/src/extensions/map.hpp b/alib2std/src/extensions/map.hpp index 2ea3630ba7bab6a97fbce34f507168acf5a327ca..e32cd8295cb7187c3c1a0565e7b4690c675eda7a 100644 --- a/alib2std/src/extensions/map.hpp +++ b/alib2std/src/extensions/map.hpp @@ -53,10 +53,6 @@ struct compare < std::map < T, R, Ts ... > > { } }; -} /* namespace ext */ - -namespace std { - template < class T, class R, class ... Ts > std::string to_string ( const std::map < T, R, Ts ... > & value ) { std::stringstream ss; @@ -64,6 +60,10 @@ std::string to_string ( const std::map < T, R, Ts ... > & value ) { return ss.str(); } +} /* namespace ext */ + +namespace std { + template<typename map_type> class key_iterator : public map_type::const_iterator { public: diff --git a/alib2std/src/extensions/pair.hpp b/alib2std/src/extensions/pair.hpp index 7e6ba82a6e3713097874b1fde3fa4132b6f7bf8b..dd820f5fef2ff16d946fa238a8fcdd54661ae27f 100644 --- a/alib2std/src/extensions/pair.hpp +++ b/alib2std/src/extensions/pair.hpp @@ -39,10 +39,6 @@ struct compare < std::pair < T, R > > { } }; -} /* namespace ext */ - -namespace std { - template < class T, class R > std::string to_string ( const std::pair < T, R > & value ) { std::stringstream ss; @@ -50,6 +46,6 @@ std::string to_string ( const std::pair < T, R > & value ) { return ss.str(); } -} /* namespace std */ +} /* namespace ext */ #endif /* __PAIR_HPP_ */ diff --git a/alib2std/src/extensions/set.hpp b/alib2std/src/extensions/set.hpp index c29e38feb1b1c5b754f4e0c8e876a24ddbfd6620..51d946859f44eba8463ce70152f8b89135abaef9 100644 --- a/alib2std/src/extensions/set.hpp +++ b/alib2std/src/extensions/set.hpp @@ -51,10 +51,6 @@ struct compare < std::set < T, Ts ... > > { } }; -} /* namespace ext */ - -namespace std { - template < class T, class ... Ts > std::string to_string ( const std::set < T, Ts ... > & value ) { std::stringstream ss; @@ -62,6 +58,10 @@ std::string to_string ( const std::set < T, Ts ... > & value ) { return ss.str(); } +} /* namespace ext */ + +namespace std { + template <class Iterator> class set_move_iterator { Iterator current; diff --git a/alib2std/src/extensions/string.cpp b/alib2std/src/extensions/string.cpp index e7300f7aa8b2dc3d6691b3c3d622380e2eb35c79..ba99bf16426f299fd0123cb2509d455a1b8a9b46 100644 --- a/alib2std/src/extensions/string.cpp +++ b/alib2std/src/extensions/string.cpp @@ -8,7 +8,7 @@ #include <string> #include <sstream> -namespace std { +namespace ext { template < > std::string to_string ( const std::string & value ) { @@ -70,4 +70,4 @@ std::string cstringToString ( char * param ) { return res; } -} /* namespace std */ +} /* namespace ext */ diff --git a/alib2std/src/extensions/string.hpp b/alib2std/src/extensions/string.hpp index 21777a89b6d6292a51789d565dcac6267604edcf..191d6be9dc81fa46059298fd4c214d657735f85f 100644 --- a/alib2std/src/extensions/string.hpp +++ b/alib2std/src/extensions/string.hpp @@ -12,7 +12,7 @@ #include <stdexcept> #include "compare.hpp" -namespace std { +namespace ext { template<typename... Ts> using to_string_type = auto(Ts...) -> decltype(std::to_string__private(std::declval<Ts>()...)); @@ -62,10 +62,6 @@ double from_string ( const std::string & value ); std::string cstringToString ( char * param ); -} /* namespace std */ - -namespace ext { - template < > struct compare < std::string > { int operator ()( const std::string & first, const std::string & second ) const { diff --git a/alib2std/src/extensions/tree.hpp b/alib2std/src/extensions/tree.hpp index 8d8ed9e9acd2cccf0b336fe6996dd1559c4ff38e..cdd83a747c24f3bf87a887b87623ea43e2dd2b19 100644 --- a/alib2std/src/extensions/tree.hpp +++ b/alib2std/src/extensions/tree.hpp @@ -654,10 +654,6 @@ struct compare < std::tree < T > > { }; -} /* namespace ext */ - -namespace std { - template < class T > std::string to_string ( const std::tree < T > & value ) { std::stringstream ss; @@ -665,6 +661,6 @@ std::string to_string ( const std::tree < T > & value ) { return ss.str(); } -} /* namespace std */ +} /* namespace ext */ #endif /* __TREE_HPP_ */ diff --git a/alib2std/src/extensions/trie.hpp b/alib2std/src/extensions/trie.hpp index c17639f5cb5f3f92297da7950d22690c033a67d2..1e91cf86760e3db1b091b9fa7a76a56a686df073 100644 --- a/alib2std/src/extensions/trie.hpp +++ b/alib2std/src/extensions/trie.hpp @@ -316,10 +316,6 @@ struct compare < std::trie < Key, Value > > { }; -} /* namespace ext */ - -namespace std { - template < class Key, class Value > std::string to_string ( const std::trie < Key, Value > & value ) { std::stringstream ss; @@ -327,6 +323,6 @@ std::string to_string ( const std::trie < Key, Value > & value ) { return ss.str(); } -} /* namespace std */ +} /* namespace ext */ #endif /* __TRIE_HPP_ */ diff --git a/alib2std/src/extensions/tuple.hpp b/alib2std/src/extensions/tuple.hpp index 1567279cfa7b4b2747f83bf15138ec6eb713b802..b447a6078f7d3d35d43e9f177992080b5042cb6d 100644 --- a/alib2std/src/extensions/tuple.hpp +++ b/alib2std/src/extensions/tuple.hpp @@ -145,12 +145,6 @@ struct compare < std::tuple < Ts ... > > { }; -} /* namespace ext */ - -namespace std { - - - template < class ... Ts > std::string to_string ( const std::tuple < Ts ... > & value ) { std::stringstream ss; @@ -158,7 +152,9 @@ std::string to_string ( const std::tuple < Ts ... > & value ) { return ss.str(); } +} /* namespace ext */ +namespace std { template < class Type, int size, class ... Types > struct TupleBuilder; diff --git a/alib2std/src/extensions/unordered_map.hpp b/alib2std/src/extensions/unordered_map.hpp index 6fe1c9259904e13d59301c95c144d283b85ba12d..6fa30c9b2785e2f0bc01ef679dd60959aeb8c6de 100644 --- a/alib2std/src/extensions/unordered_map.hpp +++ b/alib2std/src/extensions/unordered_map.hpp @@ -53,10 +53,6 @@ struct compare<std::unordered_map<T, R, Ts ...>> { } }; -} /* namespace ext */ - -namespace std { - template < class T, class R > std::string to_string ( const std::unordered_map < T, R > & value ) { std::stringstream ss; @@ -64,7 +60,7 @@ std::string to_string ( const std::unordered_map < T, R > & value ) { return ss.str(); } -} /* namespace std */ +} /* namespace ext */ #endif /* __UNORDERED_MAP_HPP_ */ diff --git a/alib2std/src/extensions/variant.hpp b/alib2std/src/extensions/variant.hpp index d1f6ecb91be9434dd202d85c55da8a13c4e49436..99a947954c6c8d2847f457fbf754dacc91231ff7 100644 --- a/alib2std/src/extensions/variant.hpp +++ b/alib2std/src/extensions/variant.hpp @@ -104,7 +104,7 @@ struct variant_helper<F, Ts...> { inline static std::string string(type_id_hash_code id, const void* data) { if (id == typeid(F).hash_code()) - return std::to_string ( *reinterpret_cast<const F*>(data) ); + return ext::to_string ( *reinterpret_cast<const F*>(data) ); else return variant_helper<Ts...>::string(id, data); } @@ -374,17 +374,13 @@ struct compare<std::variant<Ts...>> { } }; -} /* namespace ext */ - -namespace std { - template < class ... Ts > -std::string to_string ( const variant < Ts ... > & value ) { +std::string to_string ( const std::variant < Ts ... > & value ) { std::stringstream ss; ss << value; return ss.str(); } -} /* namespace std */ +} /* namespace ext */ #endif /* __VARIANT_HPP_ */ diff --git a/alib2std/src/extensions/vector.hpp b/alib2std/src/extensions/vector.hpp index 0f94d5881112c4b2e2e984859a2a91dbecef1fd0..3af45d960ef9351bd4e2a01d3dba5598389a699c 100644 --- a/alib2std/src/extensions/vector.hpp +++ b/alib2std/src/extensions/vector.hpp @@ -51,10 +51,6 @@ struct compare<std::vector<T, Ts ...>> { } }; -} /* namespace ext */ - -namespace std { - template < class T, class ... Ts > std::string to_string ( const std::vector < T, Ts ... > & value ) { std::stringstream ss; @@ -62,6 +58,10 @@ std::string to_string ( const std::vector < T, Ts ... > & value ) { return ss.str(); } +} /* namespace ext */ + +namespace std { + template < class ... Ts > std::vector < bool, Ts ... > & operator |= ( std::vector < bool, Ts ... > & A, const std::vector < bool, Ts ... > & B ) { A.resize ( std::max ( A.size ( ), B.size ( ) ) ); diff --git a/alib2std/test-src/extensions/StringTest.cpp b/alib2std/test-src/extensions/StringTest.cpp index 8f0145c4862e2fd387237a6135fcf10a558464c6..7b1155c67eeb6dae6e6d3afc63969a95935c3441 100644 --- a/alib2std/test-src/extensions/StringTest.cpp +++ b/alib2std/test-src/extensions/StringTest.cpp @@ -11,12 +11,12 @@ void StringTest::tearDown() { } void StringTest::testToString() { - CPPUNIT_ASSERT ( std::is_function< std::to_string_type < int > >::value ); - CPPUNIT_ASSERT ( std::to_string ( std::string ( "1" ) ) == "1" ); - CPPUNIT_ASSERT ( std::to_string ( 1 ) == "1" ); - CPPUNIT_ASSERT ( std::to_string ( 1ul ) == "1" ); + CPPUNIT_ASSERT ( std::is_function< ext::to_string_type < int > >::value ); + CPPUNIT_ASSERT ( ext::to_string ( std::string ( "1" ) ) == "1" ); + CPPUNIT_ASSERT ( ext::to_string ( 1 ) == "1" ); + CPPUNIT_ASSERT ( ext::to_string ( 1ul ) == "1" ); StringTest::A a; - CPPUNIT_ASSERT ( std::to_string ( a ) == "" ); + CPPUNIT_ASSERT ( ext::to_string ( a ) == "" ); } diff --git a/alib2str/src/object/ObjectFromStringParser.cpp b/alib2str/src/object/ObjectFromStringParser.cpp index 27baffbfb9d2c4bef2ab52b8ff16c5c737b938ec..5fb9248005067f5224ae5340eeec0b42b1a0c8ae 100644 --- a/alib2str/src/object/ObjectFromStringParser.cpp +++ b/alib2str/src/object/ObjectFromStringParser.cpp @@ -66,7 +66,7 @@ Object ObjectFromStringParser::parseObject(std::istream& input) { case ObjectFromStringLexer::TokenType::STRING: return Object(primitive::String(token.value)); case ObjectFromStringLexer::TokenType::INTEGER: - return Object(primitive::Integer(std::from_string < int > (token.value))); + return Object(primitive::Integer(ext::from_string < int > (token.value))); case ObjectFromStringLexer::TokenType::ERROR: break; } diff --git a/alib2str/src/tree/TreeFromStringParser.cpp b/alib2str/src/tree/TreeFromStringParser.cpp index a425f8c4483fecc1807854b489546412d3a06013..02907219efb777d383affc54a3643d951baf0f86 100644 --- a/alib2str/src/tree/TreeFromStringParser.cpp +++ b/alib2str/src/tree/TreeFromStringParser.cpp @@ -54,7 +54,7 @@ Tree TreeFromStringParser::parseTree ( std::istream & input, const std::set < FE if ( token.type == TreeFromStringLexer::TokenType::RANK ) { std::set < common::ranked_symbol < DefaultSymbolType > > nonlinearVariables; - rank = std::from_string < unsigned > ( token.value ); + rank = ext::from_string < unsigned > ( token.value ); std::vector < std::tree < common::ranked_symbol < DefaultSymbolType > > > childs; bool isPattern = false; @@ -130,7 +130,7 @@ std::tree < common::ranked_symbol < DefaultSymbolType > > TreeFromStringParser:: token = TreeFromStringLexer::next ( input ); if ( token.type == TreeFromStringLexer::TokenType::RANK ) - rank = std::from_string < unsigned > ( token.value ); + rank = ext::from_string < unsigned > ( token.value ); else throw exception::CommonException ( "Missing rank" ); diff --git a/alib2str/src/tree/TreeToStringComposer.h b/alib2str/src/tree/TreeToStringComposer.h index b9a03ebd256847975412b459fb93e76d8b0ce16e..b27fd186b1f2b4b05fc19fee3cde98caa2891bda 100644 --- a/alib2str/src/tree/TreeToStringComposer.h +++ b/alib2str/src/tree/TreeToStringComposer.h @@ -56,7 +56,7 @@ template < class SymbolType, class RankType > void TreeToStringComposer::compose ( std::ostream & out, const std::tree < common::ranked_symbol < SymbolType, RankType> > & node ) { alib::ObjectToStringComposer::compose ( out, node.getData ( ).getSymbol ( ) ); - out << std::to_string ( node.getData ( ).getRank ( ) ); + out << ext::to_string ( node.getData ( ).getRank ( ) ); for ( const std::tree < common::ranked_symbol < SymbolType, RankType > > & child : node ) { out << " "; @@ -71,7 +71,7 @@ void TreeToStringComposer::compose ( std::ostream & out, const common::ranked_sy } else { alib::ObjectToStringComposer::compose ( out, node.getData ( ).getSymbol ( ) ); - out << std::to_string ( node.getData ( ).getRank ( ) ); + out << ext::to_string ( node.getData ( ).getRank ( ) ); for ( const std::tree < common::ranked_symbol < SymbolType, RankType > > & child : node ) { out << " "; diff --git a/alib2str_experimental/src/graph/GraphFromStringParser.cpp b/alib2str_experimental/src/graph/GraphFromStringParser.cpp index c925353e8b9f769b9c07f266328b1827939194e0..47605762a0e45df455cbf73799176e7b143b6211 100644 --- a/alib2str_experimental/src/graph/GraphFromStringParser.cpp +++ b/alib2str_experimental/src/graph/GraphFromStringParser.cpp @@ -224,7 +224,7 @@ int GraphFromStringParser::parseValue(std::istream &input) throw exception::CommonException("Invalid input. Expected INTEGER"); } - return std::from_string < int > (token.value); + return ext::from_string < int > (token.value); } template<typename T> diff --git a/alib2str_experimental/src/primitive/PrimitiveFromStringParser.cpp b/alib2str_experimental/src/primitive/PrimitiveFromStringParser.cpp index 6c7bfd708eb8caa56fb2ffb189f64f8a3624a2be..e6348060fde973987220d3ed1b87efbb02184395 100644 --- a/alib2str_experimental/src/primitive/PrimitiveFromStringParser.cpp +++ b/alib2str_experimental/src/primitive/PrimitiveFromStringParser.cpp @@ -32,7 +32,7 @@ Primitive PrimitiveFromStringParser::parsePrimitive(std::istream& input, const s return Primitive(Character(token.value[0])); case PrimitiveFromStringLexer::TokenType::INTEGER: if(!features.count(FEATURES::INTEGER)) throw exception::CommonException("Disabled formalism Integer"); - return Primitive(Integer(std::from_string < int > (token.value))); + return Primitive(Integer(ext::from_string < int > (token.value))); case PrimitiveFromStringLexer::TokenType::ERROR: break; }