From 530506aa702eec0732bd957f53372991e86686bd Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Thu, 14 Apr 2016 21:40:36 +0200 Subject: [PATCH] AlibException -> CommonException finalize --- aarbology2/src/aarbology.cpp | 6 ++--- acast2/src/acast.cpp | 4 +-- acompaction2/src/acompaction.cpp | 4 +-- acompare2/src/AutomatonCompare.cpp | 2 -- acompare2/src/GrammarCompare.cpp | 2 -- acompare2/src/acompare.cpp | 18 ++++++------- aconversions2/src/ConversionHandler.cpp | 33 ++++++++++++----------- aconversions2/src/ConversionHandler.h | 1 - aconversions2/src/aconversion.cpp | 3 ++- aconvert2/src/DotConverter.cpp | 4 +-- aconvert2/src/GasTexConverter.cpp | 4 +-- aconvert2/src/TikZConverter.cpp | 4 +-- aconvert2/src/aconvert.cpp | 4 +-- aderivation2/src/aderivation.cpp | 4 +-- adeterminize2/src/adeterminize.cpp | 4 +-- aecho2/src/aecho.cpp | 4 +-- aepsilon2/src/aepsilon.cpp | 8 +++--- agenerate2/src/agenerate.cpp | 6 ++--- agraphbench2/src/agraphbench.cpp | 4 +-- aintegral2/src/aintegral.cpp | 4 +-- alangop2/src/alangop.cpp | 6 ++--- alib2common/src/sax/SaxComposeInterface.h | 4 +-- alib2common/src/sax/SaxParseInterface.h | 4 +-- alphabetManip2/src/alphabetManip.cpp | 8 +++--- aminimize2/src/aminimize.cpp | 6 ++--- anormalize2/src/anormalize.cpp | 6 ++--- arand2/src/arand.cpp | 10 +++---- araw2/src/araw.cpp | 6 ++--- arename2/src/arename.cpp | 4 +-- areverse2/src/areverse.cpp | 4 +-- arun2/src/arun.cpp | 6 ++--- astat2/src/AutomataStat.cpp | 2 -- astat2/src/GrammarStat.cpp | 2 -- astat2/src/RegExpStat.cpp | 6 ++--- astat2/src/SetStat.cpp | 2 -- astat2/src/StringStat.cpp | 2 -- astat2/src/TreeStat.cpp | 2 -- astat2/src/astat.cpp | 8 +++--- astringology2/src/astringology.cpp | 6 ++--- atrim2/src/atrim.cpp | 6 ++--- tniceprint/src/tniceprint.cpp | 6 ++--- 41 files changed, 108 insertions(+), 121 deletions(-) diff --git a/aarbology2/src/aarbology.cpp b/aarbology2/src/aarbology.cpp index a47a999253..d8a19530ec 100644 --- a/aarbology2/src/aarbology.cpp +++ b/aarbology2/src/aarbology.cpp @@ -12,7 +12,7 @@ #include <sax/FromXMLParserHelper.h> #include <factory/XmlDataFactory.hpp> -#include <exception/AlibException.h> +#include <exception/CommonException.h> #include <tree/Tree.h> #include <container/Container.h> #include <container/ObjectsSet.h> @@ -227,7 +227,7 @@ int main ( int argc, char * argv[] ) { alib::XmlDataFactory::toStdout ( res ); } else { - throw exception::AlibException ( "Invalid algorithm" ); + throw exception::CommonException ( "Invalid algorithm" ); return 1; } @@ -237,7 +237,7 @@ int main ( int argc, char * argv[] ) { if ( measure.getValue ( ) ) std::cmeasure << measurements::results ( ) << std::endl; return 0; - } catch ( const exception::AlibException & exception ) { + } catch ( const exception::CommonException & exception ) { alib::XmlDataFactory::toStdout ( exception ); return 1; } catch ( const TCLAP::ArgException & exception ) { diff --git a/acast2/src/acast.cpp b/acast2/src/acast.cpp index 5198ff81fb..6e1bce8bd8 100644 --- a/acast2/src/acast.cpp +++ b/acast2/src/acast.cpp @@ -10,7 +10,7 @@ #include <measure> #include <string> #include <sax/FromXMLParserHelper.h> -#include <exception/AlibException.h> +#include <exception/CommonException.h> #include <factory/XmlDataFactory.hpp> #include <object/Object.h> #include <cast/CastApi.hpp> @@ -61,7 +61,7 @@ int main(int argc, char** argv) { if(measure.getValue()) std::cmeasure << measurements::results() << std::endl; return 0; - } catch(const exception::AlibException& exception) { + } catch(const exception::CommonException& exception) { alib::XmlDataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { diff --git a/acompaction2/src/acompaction.cpp b/acompaction2/src/acompaction.cpp index 7b9e8d7990..794037d07d 100644 --- a/acompaction2/src/acompaction.cpp +++ b/acompaction2/src/acompaction.cpp @@ -10,7 +10,7 @@ #include <measure> #include <sax/FromXMLParserHelper.h> -#include "exception/AlibException.h" +#include "exception/CommonException.h" #include "factory/XmlDataFactory.hpp" #include "automaton/transform/Compaction.h" @@ -56,7 +56,7 @@ int main(int argc, char** argv) { if(measure.getValue()) std::cmeasure << measurements::results() << std::endl; return 0; - } catch (const exception::AlibException& exception) { + } catch (const exception::CommonException& exception) { alib::XmlDataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { diff --git a/acompare2/src/AutomatonCompare.cpp b/acompare2/src/AutomatonCompare.cpp index b7720a52fc..cca0687ebf 100644 --- a/acompare2/src/AutomatonCompare.cpp +++ b/acompare2/src/AutomatonCompare.cpp @@ -39,8 +39,6 @@ #include "automaton/PDA/SinglePopDPDA.h" #include "automaton/TM/OneTapeDTM.h" -#include "exception/AlibException.h" - bool AutomatonCompare::testCompare(const automaton::DFA& a, const automaton::DFA& b) { return a.getFinalStates() == b.getFinalStates() && a.getInitialState() == b.getInitialState() && diff --git a/acompare2/src/GrammarCompare.cpp b/acompare2/src/GrammarCompare.cpp index cc8f6d3f32..1392316fa4 100644 --- a/acompare2/src/GrammarCompare.cpp +++ b/acompare2/src/GrammarCompare.cpp @@ -30,8 +30,6 @@ #include "grammar/Unrestricted/ContextPreservingUnrestrictedGrammar.h" #include "grammar/Unrestricted/UnrestrictedGrammar.h" -#include "exception/AlibException.h" - bool GrammarCompare::testCompare(const grammar::LeftLG& a, const grammar::LeftLG& b) { return a.getNonterminalAlphabet() == b.getNonterminalAlphabet() && a.getRules() == b.getRules() && diff --git a/acompare2/src/acompare.cpp b/acompare2/src/acompare.cpp index d038237aee..79fee62b12 100644 --- a/acompare2/src/acompare.cpp +++ b/acompare2/src/acompare.cpp @@ -11,7 +11,7 @@ #include <sax/FromXMLParserHelper.h> #include "factory/XmlDataFactory.hpp" -#include "exception/AlibException.h" +#include "exception/CommonException.h" #include "AutomatonCompare.h" #include "GrammarCompare.h" @@ -47,13 +47,13 @@ int main(int argc, char** argv) { std::deque<sax::Token> tokens1 = sax::FromXMLParserHelper::parseInput(input1); std::deque<sax::Token> tokens2 = sax::FromXMLParserHelper::parseInput(input2); - if (tokens1.empty() && tokens2.empty()) throw exception::AlibException("Invalid arguments tokens streams 1 and 2 are empty."); - if (tokens1.empty()) throw exception::AlibException("Invalid arguments tokens stream 1 is empty."); - if (tokens2.empty()) throw exception::AlibException("Invalid arguments tokens stream 2 is empty."); + if (tokens1.empty() && tokens2.empty()) throw exception::CommonException("Invalid arguments tokens streams 1 and 2 are empty."); + if (tokens1.empty()) throw exception::CommonException("Invalid arguments tokens stream 1 is empty."); + if (tokens2.empty()) throw exception::CommonException("Invalid arguments tokens stream 2 is empty."); - if(alib::XmlDataFactory::first<exception::AlibException>(tokens1)) std::cerr << alib::XmlDataFactory::fromTokens<exception::AlibException>(std::move(tokens1)).getCause() << std::endl; //TODO is this realy needed? - if(alib::XmlDataFactory::first<exception::AlibException>(tokens2)) std::cerr << alib::XmlDataFactory::fromTokens<exception::AlibException>(std::move(tokens2)).getCause() << std::endl; - if(alib::XmlDataFactory::first<exception::AlibException>(tokens1) || alib::XmlDataFactory::first<exception::AlibException>(tokens2)) return 0; + if(alib::XmlDataFactory::first<exception::CommonException>(tokens1)) std::cerr << alib::XmlDataFactory::fromTokens<exception::CommonException>(std::move(tokens1)).getCause() << std::endl; //TODO is this realy needed? + if(alib::XmlDataFactory::first<exception::CommonException>(tokens2)) std::cerr << alib::XmlDataFactory::fromTokens<exception::CommonException>(std::move(tokens2)).getCause() << std::endl; + if(alib::XmlDataFactory::first<exception::CommonException>(tokens1) || alib::XmlDataFactory::first<exception::CommonException>(tokens2)) return 0; int res; @@ -74,14 +74,14 @@ int main(int argc, char** argv) { res = GrammarCompare::compare(grammar1, grammar2); } else { - throw exception::AlibException("Only automata and grammars can be compared."); + throw exception::CommonException("Only automata and grammars can be compared."); } measurements::end(); measurements::end(); return res; - } catch (const exception::AlibException& exception) { + } catch (const exception::CommonException& exception) { alib::XmlDataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { diff --git a/aconversions2/src/ConversionHandler.cpp b/aconversions2/src/ConversionHandler.cpp index 76200868d3..b30e9ba05f 100644 --- a/aconversions2/src/ConversionHandler.cpp +++ b/aconversions2/src/ConversionHandler.cpp @@ -25,6 +25,7 @@ #include "regexp/convert/ToGrammarRightRGDerivation.h" #include <factory/XmlDataFactory.hpp> +#include <exception/CommonException.h> ConversionHandler::ConversionHandler( std::deque<sax::Token> && tokens, const std::string & target, const std::string & algorithm ) : m_tokens( std::move( tokens ) ), @@ -48,7 +49,7 @@ void ConversionHandler::convert( void ) else if( m_source == CONTEXTFREE_GRAMMAR) convertCFG( ); else - throw exception::AlibException( "ConversionHandler: Unknown source formalism." ); + throw exception::CommonException( "ConversionHandler: Unknown source formalism." ); } // ---------------------------------------------------------------------------- @@ -60,7 +61,7 @@ void ConversionHandler::convertFA( void ) else if( m_target == REGULAR_GRAMMAR ) convertFAtoRG( ); else - throw exception::AlibException( "ConversionHandler: Unknown target formalism." ); + throw exception::CommonException( "ConversionHandler: Unknown target formalism." ); } void ConversionHandler::convertRE( void ) @@ -70,7 +71,7 @@ void ConversionHandler::convertRE( void ) else if( m_target == REGULAR_GRAMMAR ) convertREtoRG( ); else - throw exception::AlibException( "ConversionHandler: Invalid target formalism." ); + throw exception::CommonException( "ConversionHandler: Invalid target formalism." ); } void ConversionHandler::convertRG( void ) @@ -80,12 +81,12 @@ void ConversionHandler::convertRG( void ) else if( m_target == REGULAR_EXPRESSION ) convertRGtoRE( ); else - throw exception::AlibException( "ConversionHandler: Invalid target formalism." ); + throw exception::CommonException( "ConversionHandler: Invalid target formalism." ); } void ConversionHandler::convertPDA( void ) { - throw exception::AlibException( "ConversionHandler: Invalid source formalism." ); + throw exception::CommonException( "ConversionHandler: Invalid source formalism." ); } void ConversionHandler::convertCFG( void ) @@ -93,7 +94,7 @@ void ConversionHandler::convertCFG( void ) if( m_target == PUSHDOWN_AUTOMATON) convertCFGtoPDA( ); else - throw exception::AlibException( "ConversionHandler: Invalid target formalism." ); + throw exception::CommonException( "ConversionHandler: Invalid target formalism." ); } // ---------------------------------------------------------------------------- @@ -126,7 +127,7 @@ void ConversionHandler::convertFAtoRE( void ) break; } default: - throw exception::AlibException( "ConversionHandler: Invalid algorithm." ); + throw exception::CommonException( "ConversionHandler: Invalid algorithm." ); } } @@ -158,7 +159,7 @@ void ConversionHandler::convertFAtoRG( void ) break; } default: - throw exception::AlibException( "ConversionHandler: Invalid algorithm." ); + throw exception::CommonException( "ConversionHandler: Invalid algorithm." ); } } @@ -201,7 +202,7 @@ void ConversionHandler::convertREtoFA( void ) break; } default: - throw exception::AlibException( "ConversionHandler: Invalid algorithm." ); + throw exception::CommonException( "ConversionHandler: Invalid algorithm." ); } } @@ -233,7 +234,7 @@ void ConversionHandler::convertREtoRG( void ) break; } default: - throw exception::AlibException( "ConversionHandler: Invalid algorithm." ); + throw exception::CommonException( "ConversionHandler: Invalid algorithm." ); } } @@ -256,7 +257,7 @@ void ConversionHandler::convertRGtoFA( void ) { break; } default: - throw exception::AlibException( "ConversionHandler: Invalid algorithm." ); + throw exception::CommonException( "ConversionHandler: Invalid algorithm." ); } } @@ -278,7 +279,7 @@ void ConversionHandler::convertRGtoRE( void ) { break; } default: - throw exception::AlibException( "ConversionHandler: Invalid algorithm." ); + throw exception::CommonException( "ConversionHandler: Invalid algorithm." ); } } @@ -310,7 +311,7 @@ void ConversionHandler::convertCFGtoPDA( void ) break; } default: - throw exception::AlibException( "ConversionHandler: Invalid algorithm." ); + throw exception::CommonException( "ConversionHandler: Invalid algorithm." ); } } @@ -324,7 +325,7 @@ ConversionHandler::TFormalism ConversionHandler::parseFormalismFromString( const if( target == "pda" ) return PUSHDOWN_AUTOMATON; if( target == "cfg" ) return CONTEXTFREE_GRAMMAR; - throw exception::AlibException( "ConversionHandler: Unknown target type." ); + throw exception::CommonException( "ConversionHandler: Unknown target type." ); } ConversionHandler::TFormalism ConversionHandler::parseFormalismFromTokens( void ) const { @@ -340,7 +341,7 @@ ConversionHandler::TFormalism ConversionHandler::parseFormalismFromTokens( void if( alib::XmlDataFactory::first<grammar::Grammar>(m_tokens) ) return REGULAR_GRAMMAR; - throw exception::AlibException( "ConversionHandler: Invalid input formalism." ); + throw exception::CommonException( "ConversionHandler: Invalid input formalism." ); } ConversionHandler::TAlgorithm ConversionHandler::parseAlgorithmFromString( const std::string & algorithm ) const { @@ -357,5 +358,5 @@ ConversionHandler::TAlgorithm ConversionHandler::parseAlgorithmFromString( const if( algorithm == "" || algorithm == "default" ) return DEFAULT; - throw exception::AlibException( "ConversionHandler:: Invalid algorithm. See help." ); + throw exception::CommonException( "ConversionHandler:: Invalid algorithm. See help." ); } diff --git a/aconversions2/src/ConversionHandler.h b/aconversions2/src/ConversionHandler.h index cb42dd4eee..c98ed5de90 100644 --- a/aconversions2/src/ConversionHandler.h +++ b/aconversions2/src/ConversionHandler.h @@ -10,7 +10,6 @@ #include <deque> #include <sax/Token.h> -#include <exception/AlibException.h> /** * Wraps all conversions. diff --git a/aconversions2/src/aconversion.cpp b/aconversions2/src/aconversion.cpp index 83dc9c60a4..cd68615cc8 100644 --- a/aconversions2/src/aconversion.cpp +++ b/aconversions2/src/aconversion.cpp @@ -11,6 +11,7 @@ #include <sax/FromXMLParserHelper.h> #include <factory/XmlDataFactory.hpp> +#include <exception/CommonException.h> #include "ConversionHandler.h" @@ -57,7 +58,7 @@ int main(int argc, char* argv[]) if(measure.getValue()) std::cmeasure << measurements::results() << std::endl; return 0; - } catch(const exception::AlibException& exception) { + } catch(const exception::CommonException& exception) { alib::XmlDataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { diff --git a/aconvert2/src/DotConverter.cpp b/aconvert2/src/DotConverter.cpp index d3eafc7ee9..a524dc8ced 100644 --- a/aconvert2/src/DotConverter.cpp +++ b/aconvert2/src/DotConverter.cpp @@ -30,7 +30,7 @@ #include <factory/StringDataFactory.hpp> -#include <exception/AlibException.h> +#include <exception/CommonException.h> #include <set> #include <map> @@ -1852,7 +1852,7 @@ void DotConverter::transitions(const automaton::OneTapeDTM& tm, const std::map<a symbol += "×"; break; default: - throw exception::AlibException("Unexpected shift direction"); + throw exception::CommonException("Unexpected shift direction"); } //Insert into map diff --git a/aconvert2/src/GasTexConverter.cpp b/aconvert2/src/GasTexConverter.cpp index 2404c2a344..73eafdeb2e 100644 --- a/aconvert2/src/GasTexConverter.cpp +++ b/aconvert2/src/GasTexConverter.cpp @@ -32,7 +32,7 @@ #include <set> #include <map> #include <typeinfo> -#include "exception/AlibException.h" +#include "exception/CommonException.h" void GasTexConverter::convert(std::ostream& out, const automaton::Automaton& a) { getInstance().dispatch(out, a.getData()); @@ -1416,7 +1416,7 @@ void GasTexConverter::transitions(const automaton::OneTapeDTM& tm, std::ostream& symbol += "$\\times$"; break; default: - throw exception::AlibException("Unexpected shift direction"); + throw exception::CommonException("Unexpected shift direction"); } if (mapIterator == transitionMap.end()) { diff --git a/aconvert2/src/TikZConverter.cpp b/aconvert2/src/TikZConverter.cpp index 047bff868c..20f46c4678 100644 --- a/aconvert2/src/TikZConverter.cpp +++ b/aconvert2/src/TikZConverter.cpp @@ -30,7 +30,7 @@ #include <factory/StringDataFactory.hpp> -#include <exception/AlibException.h> +#include <exception/CommonException.h> #include <set> #include <map> @@ -1947,7 +1947,7 @@ void TikZConverter::transitions ( const automaton::OneTapeDTM & tm, const std::m break; default: - throw exception::AlibException ( "Unexpected shift direction" ); + throw exception::CommonException ( "Unexpected shift direction" ); } // Insert into map diff --git a/aconvert2/src/aconvert.cpp b/aconvert2/src/aconvert.cpp index fb41ee279b..a039d94eff 100644 --- a/aconvert2/src/aconvert.cpp +++ b/aconvert2/src/aconvert.cpp @@ -12,7 +12,7 @@ #include "factory/XmlDataFactory.hpp" #include "factory/StringDataFactory.hpp" -#include "exception/AlibException.h" +#include "exception/CommonException.h" #include "DotConverter.h" #include "GasTexConverter.h" @@ -245,7 +245,7 @@ int main ( int argc, char * argv[] ) { if ( measure.getValue ( ) ) std::cmeasure << measurements::results ( ) << std::endl; return 0; - } catch ( const exception::AlibException & exception ) { + } catch ( const exception::CommonException & exception ) { alib::XmlDataFactory::toStdout ( exception ); return 1; } catch ( const TCLAP::ArgException & exception ) { diff --git a/aderivation2/src/aderivation.cpp b/aderivation2/src/aderivation.cpp index eb59fefea7..20198a7ce8 100644 --- a/aderivation2/src/aderivation.cpp +++ b/aderivation2/src/aderivation.cpp @@ -11,7 +11,7 @@ #include <sax/FromXMLParserHelper.h> #include <factory/XmlDataFactory.hpp> -#include <exception/AlibException.h> +#include <exception/CommonException.h> #include "regexp/transform/RegExpDerivation.h" @@ -59,7 +59,7 @@ int main(int argc, char** argv) { if(measure.getValue()) std::cmeasure << measurements::results() << std::endl; return 0; - } catch(const exception::AlibException& exception) { + } catch(const exception::CommonException& exception) { alib::XmlDataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { diff --git a/adeterminize2/src/adeterminize.cpp b/adeterminize2/src/adeterminize.cpp index 74e8a0c7bf..78d9283a49 100644 --- a/adeterminize2/src/adeterminize.cpp +++ b/adeterminize2/src/adeterminize.cpp @@ -12,7 +12,7 @@ #include "automaton/Automaton.h" #include "factory/XmlDataFactory.hpp" -#include "exception/AlibException.h" +#include "exception/CommonException.h" #include "automaton/determinize/Determinize.h" int main(int argc, char** argv) { @@ -56,7 +56,7 @@ int main(int argc, char** argv) { if(measure.getValue()) std::cmeasure << measurements::results() << std::endl; return 0; - } catch (const exception::AlibException& exception) { + } catch (const exception::CommonException& exception) { alib::XmlDataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { diff --git a/aecho2/src/aecho.cpp b/aecho2/src/aecho.cpp index 3593540aae..fb3b14cfed 100644 --- a/aecho2/src/aecho.cpp +++ b/aecho2/src/aecho.cpp @@ -10,7 +10,7 @@ #include <measure> #include <string> #include <sax/FromXMLParserHelper.h> -#include <exception/AlibException.h> +#include <exception/CommonException.h> #include <factory/XmlDataFactory.hpp> #include <object/Object.h> @@ -50,7 +50,7 @@ int main(int argc, char** argv) { if(measure.getValue()) std::cmeasure << measurements::results() << std::endl; return 0; - } catch(const exception::AlibException& exception) { + } catch(const exception::CommonException& exception) { alib::XmlDataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { diff --git a/aepsilon2/src/aepsilon.cpp b/aepsilon2/src/aepsilon.cpp index e23fd53d89..7cf5944a10 100644 --- a/aepsilon2/src/aepsilon.cpp +++ b/aepsilon2/src/aepsilon.cpp @@ -11,7 +11,7 @@ #include <sax/FromXMLParserHelper.h> #include <factory/XmlDataFactory.hpp> -#include <exception/AlibException.h> +#include <exception/CommonException.h> #include "automaton/simplify/EpsilonRemoverIncoming.h" #include "automaton/simplify/EpsilonRemoverOutgoing.h" @@ -130,9 +130,9 @@ int main(int argc, char** argv) { alib::XmlDataFactory::toStdout(res); } else - throw exception::AlibException("Invalid formalism"); + throw exception::CommonException("Invalid formalism"); } else { - throw exception::AlibException("Invalid algorithm"); + throw exception::CommonException("Invalid algorithm"); } measurements::end(); @@ -141,7 +141,7 @@ int main(int argc, char** argv) { if(measure.getValue()) std::cmeasure << measurements::results() << std::endl; return 0; - } catch (const exception::AlibException& exception) { + } catch (const exception::CommonException& exception) { alib::XmlDataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { diff --git a/agenerate2/src/agenerate.cpp b/agenerate2/src/agenerate.cpp index ad320ebfda..d49136fd3b 100644 --- a/agenerate2/src/agenerate.cpp +++ b/agenerate2/src/agenerate.cpp @@ -12,7 +12,7 @@ #include <sax/FromXMLParserHelper.h> #include <factory/XmlDataFactory.hpp> -#include <exception/AlibException.h> +#include <exception/CommonException.h> #include <string/LinearString.h> #include <grammar/Grammar.h> #include <grammar/generate/GenerateUpToLength.h> @@ -84,7 +84,7 @@ int main ( int argc, char * argv[] ) { alib::XmlDataFactory::toStdout ( res ); } else { - throw exception::AlibException ( "Invalid run type" ); + throw exception::CommonException ( "Invalid run type" ); } measurements::end ( ); @@ -93,7 +93,7 @@ int main ( int argc, char * argv[] ) { if ( measure.getValue ( ) ) std::cmeasure << measurements::results ( ) << std::endl; return 0; - } catch ( const exception::AlibException & exception ) { + } catch ( const exception::CommonException & exception ) { alib::XmlDataFactory::toStdout ( exception ); return 1; } catch ( const TCLAP::ArgException & exception ) { diff --git a/agraphbench2/src/agraphbench.cpp b/agraphbench2/src/agraphbench.cpp index 526f9fc6d9..a7614ba67f 100644 --- a/agraphbench2/src/agraphbench.cpp +++ b/agraphbench2/src/agraphbench.cpp @@ -2,7 +2,7 @@ #include <global/GlobalData.h> #include <measure> #include <string> -#include <exception/AlibException.h> +#include <exception/CommonException.h> #include <factory/XmlDataFactory.hpp> #include <sax/SaxParseInterface.h> #include <sax/ParserException.h> @@ -50,7 +50,7 @@ int main(int argc, char** argv) { } return 0; - } catch(const exception::AlibException& exception) { + } catch(const exception::CommonException& exception) { alib::XmlDataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { diff --git a/aintegral2/src/aintegral.cpp b/aintegral2/src/aintegral.cpp index 68950e964b..feb642d292 100644 --- a/aintegral2/src/aintegral.cpp +++ b/aintegral2/src/aintegral.cpp @@ -11,7 +11,7 @@ #include <sax/FromXMLParserHelper.h> #include <factory/XmlDataFactory.hpp> -#include <exception/AlibException.h> +#include <exception/CommonException.h> #include "regexp/transform/RegExpIntegral.h" @@ -59,7 +59,7 @@ int main(int argc, char** argv) { if(measure.getValue()) std::cmeasure << measurements::results() << std::endl; return 0; - } catch(const exception::AlibException& exception) { + } catch(const exception::CommonException& exception) { alib::XmlDataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { diff --git a/alangop2/src/alangop.cpp b/alangop2/src/alangop.cpp index 9e8cc5e876..6cdd3cac7f 100644 --- a/alangop2/src/alangop.cpp +++ b/alangop2/src/alangop.cpp @@ -12,7 +12,7 @@ #include <sax/FromXMLParserHelper.h> #include <factory/XmlDataFactory.hpp> -#include <exception/AlibException.h> +#include <exception/CommonException.h> #include <automaton/Automaton.h> #include <automaton/transform/AutomataConcatenationEpsilonTransition.h> @@ -148,7 +148,7 @@ int main(int argc, char* argv[]) { alib::XmlDataFactory::toStdout( res ); } else { - throw exception::AlibException( "Invalid algorithm" ); + throw exception::CommonException( "Invalid algorithm" ); } measurements::end(); @@ -157,7 +157,7 @@ int main(int argc, char* argv[]) { if(measure.getValue()) std::cmeasure << measurements::results() << std::endl; return 0; - } catch( const exception::AlibException & exception ) { + } catch( const exception::CommonException & exception ) { alib::XmlDataFactory::toStdout( exception ); return 1; } catch(const TCLAP::ArgException& exception) { diff --git a/alib2common/src/sax/SaxComposeInterface.h b/alib2common/src/sax/SaxComposeInterface.h index 78dce65402..734f8ba6a3 100644 --- a/alib2common/src/sax/SaxComposeInterface.h +++ b/alib2common/src/sax/SaxComposeInterface.h @@ -25,7 +25,7 @@ public: * Parses the string containing XML. * @param xmlIn input XML * @param out list of tokens that are returned - * @throws AlibException when an error occurs (e.g. XML is not valid) + * @throws CommonException when an error occurs (e.g. XML is not valid) */ static void printMemory(std::string& xmlOut, const std::deque<Token>& in); @@ -33,7 +33,7 @@ public: * Parses the file containing XML. * @param filename input XML * @param out list of tokens that are returned - * @throws AlibException when an error occurs (e.g. file doesn't exist, XML is not valid) + * @throws CommonException when an error occurs (e.g. file doesn't exist, XML is not valid) */ static void printFile(const std::string& filename, const std::deque<Token>& in); diff --git a/alib2common/src/sax/SaxParseInterface.h b/alib2common/src/sax/SaxParseInterface.h index d5ec09f5ab..b64b333f85 100644 --- a/alib2common/src/sax/SaxParseInterface.h +++ b/alib2common/src/sax/SaxParseInterface.h @@ -25,7 +25,7 @@ public: * Parses the string containing XML. * @param xmlIn input XML * @param out list of tokens that are returned - * @throws AlibException when an error occurs (e.g. XML is not valid) + * @throws CommonException when an error occurs (e.g. XML is not valid) */ static void parseMemory(const std::string& xmlIn, std::deque<Token>& out); @@ -33,7 +33,7 @@ public: * Parses the file containing XML. * @param filename input XML * @param out list of tokens that are returned - * @throws AlibException when an error occurs (e.g. file doesn't exist, XML is not valid) + * @throws CommonException when an error occurs (e.g. file doesn't exist, XML is not valid) */ static void parseFile(const std::string& filename, std::deque<Token>& out); diff --git a/alphabetManip2/src/alphabetManip.cpp b/alphabetManip2/src/alphabetManip.cpp index 843935ce92..8817594865 100644 --- a/alphabetManip2/src/alphabetManip.cpp +++ b/alphabetManip2/src/alphabetManip.cpp @@ -12,7 +12,7 @@ #include <sax/FromXMLParserHelper.h> #include <factory/XmlDataFactory.hpp> -#include <exception/AlibException.h> +#include <exception/CommonException.h> #include <tree/RankedTreeWrapper.h> #include <tree/UnrankedTreeWrapper.h> #include <string/String.h> @@ -49,7 +49,7 @@ void process ( T & data, TCLAP::ValueArg < std::string > & operation, std::deque } else if ( operation.getValue ( ) == "set" ) { } else if ( operation.getValue ( ) == "remove" ) { } else { - throw exception::AlibException ( "Invalid operation" ); + throw exception::CommonException ( "Invalid operation" ); } } @@ -105,7 +105,7 @@ int main ( int argc, char * argv[] ) { string::String data = alib::XmlDataFactory::fromTokens < string::String > ( std::move ( inputTokens ) ); process ( data, operation, std::move ( argumentTokens ) ); } else { - throw exception::AlibException ( "Invalid data type" ); + throw exception::CommonException ( "Invalid data type" ); } measurements::end ( ); @@ -114,7 +114,7 @@ int main ( int argc, char * argv[] ) { if ( measure.getValue ( ) ) std::cmeasure << measurements::results ( ) << std::endl; return 0; - } catch ( const exception::AlibException & exception ) { + } catch ( const exception::CommonException & exception ) { alib::XmlDataFactory::toStdout ( exception ); return 1; } catch ( const TCLAP::ArgException & exception ) { diff --git a/aminimize2/src/aminimize.cpp b/aminimize2/src/aminimize.cpp index 8c05c2959d..004a416941 100644 --- a/aminimize2/src/aminimize.cpp +++ b/aminimize2/src/aminimize.cpp @@ -10,7 +10,7 @@ #include <measure> #include <sax/FromXMLParserHelper.h> -#include <exception/AlibException.h> +#include <exception/CommonException.h> #include <factory/XmlDataFactory.hpp> #include "automaton/simplify/Minimize.h" @@ -65,7 +65,7 @@ int main(int argc, char** argv) { alib::XmlDataFactory::toStdout(res); } else { - throw exception::AlibException("Unknown algorithm selected."); + throw exception::CommonException("Unknown algorithm selected."); } measurements::end(); @@ -74,7 +74,7 @@ int main(int argc, char** argv) { if(measure.getValue()) std::cmeasure << measurements::results() << std::endl; return 0; - } catch (const exception::AlibException& exception) { + } catch (const exception::CommonException& exception) { alib::XmlDataFactory::toStdout(exception); return 1; } catch (const TCLAP::ArgException& exception) { diff --git a/anormalize2/src/anormalize.cpp b/anormalize2/src/anormalize.cpp index 51e594a26e..957698ebfc 100644 --- a/anormalize2/src/anormalize.cpp +++ b/anormalize2/src/anormalize.cpp @@ -10,7 +10,7 @@ #include <measure> #include <sax/FromXMLParserHelper.h> -#include "exception/AlibException.h" +#include "exception/CommonException.h" #include "factory/XmlDataFactory.hpp" #include "string/simplify/NormalizeAlphabet.h" #include "automaton/simplify/Normalize.h" @@ -181,7 +181,7 @@ int main ( int argc, char * * argv ) { alib::XmlDataFactory::toStdout ( res ); } else { - throw exception::AlibException ( "Invalid normalize command" ); + throw exception::CommonException ( "Invalid normalize command" ); } measurements::end ( ); @@ -190,7 +190,7 @@ int main ( int argc, char * * argv ) { if ( measure.getValue ( ) ) std::cmeasure << measurements::results ( ) << std::endl; return 0; - } catch ( const exception::AlibException & exception ) { + } catch ( const exception::CommonException & exception ) { alib::XmlDataFactory::toStdout ( exception ); return 1; } catch ( const TCLAP::ArgException & exception ) { diff --git a/arand2/src/arand.cpp b/arand2/src/arand.cpp index 19a66ba102..26c435c11e 100644 --- a/arand2/src/arand.cpp +++ b/arand2/src/arand.cpp @@ -90,12 +90,12 @@ int main ( int argc, char * argv[] ) { measurements::start ( "Overal", measurements::Type::OVERALL ); - if ( !type.isSet ( ) ) throw exception::AlibException ( "Type is not defined." ); + if ( !type.isSet ( ) ) throw exception::CommonException ( "Type is not defined." ); if ( type.getValue ( ) == "FSM" ) { if ( ( density.getValue ( ) < 1 ) || ( density.getValue ( ) > 100 ) ) // TODO: floating point arithmetic - throw exception::AlibException ( "You must specify density as a number between 1 and 100." ); + throw exception::CommonException ( "You must specify density as a number between 1 and 100." ); measurements::start ( "Algorithm", measurements::Type::MAIN ); @@ -108,7 +108,7 @@ int main ( int argc, char * argv[] ) { } else if ( type.getValue ( ) == "CFG" ) { if ( ( density.getValue ( ) < 1 ) || ( density.getValue ( ) > 100 ) ) // TODO: floating point arithmetic - throw exception::AlibException ( "You must specify density as a number between 1 and 100." ); + throw exception::CommonException ( "You must specify density as a number between 1 and 100." ); measurements::start ( "Algorithm", measurements::Type::MAIN ); @@ -184,7 +184,7 @@ int main ( int argc, char * argv[] ) { alib::XmlDataFactory::toStdout ( res ); } else { - throw exception::AlibException ( "Invalid type." ); + throw exception::CommonException ( "Invalid type." ); } measurements::end ( ); @@ -193,7 +193,7 @@ int main ( int argc, char * argv[] ) { if ( measure.getValue ( ) ) std::cmeasure << measurements::results ( ) << std::endl; return 0; - } catch ( const exception::AlibException & exception ) { + } catch ( const exception::CommonException & exception ) { alib::XmlDataFactory::toStdout ( exception ); return 1; } catch ( const TCLAP::ArgException & exception ) { diff --git a/araw2/src/araw.cpp b/araw2/src/araw.cpp index b8640350b2..f81b5e4f6d 100644 --- a/araw2/src/araw.cpp +++ b/araw2/src/araw.cpp @@ -11,7 +11,7 @@ #include <string> #include <sax/FromXMLParserHelper.h> #include <fstream> -#include <exception/AlibException.h> +#include <exception/CommonException.h> #include <RawApi.hpp> #include <factory/XmlDataFactory.hpp> #include <sax/SaxParseInterface.h> @@ -109,7 +109,7 @@ int main(int argc, char** argv) { string::StringToRawComposer::compose(std::cout, string); } else { - throw exception::AlibException("Invalid input format specified"); + throw exception::CommonException("Invalid input format specified"); } measurements::end(); @@ -118,7 +118,7 @@ int main(int argc, char** argv) { if(measure.getValue()) std::cmeasure << measurements::results() << std::endl; return 0; - } catch(const exception::AlibException& exception) { + } catch(const exception::CommonException& exception) { alib::XmlDataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { diff --git a/arename2/src/arename.cpp b/arename2/src/arename.cpp index 137966326d..c71839e22c 100644 --- a/arename2/src/arename.cpp +++ b/arename2/src/arename.cpp @@ -10,7 +10,7 @@ #include <measure> #include <sax/FromXMLParserHelper.h> -#include "exception/AlibException.h" +#include "exception/CommonException.h" #include "factory/XmlDataFactory.hpp" #include "automaton/simplify/Rename.h" @@ -56,7 +56,7 @@ int main(int argc, char** argv) { if(measure.getValue()) std::cmeasure << measurements::results() << std::endl; return 0; - } catch (const exception::AlibException& exception) { + } catch (const exception::CommonException& exception) { alib::XmlDataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { diff --git a/areverse2/src/areverse.cpp b/areverse2/src/areverse.cpp index 7138907ec8..8e7e79e133 100644 --- a/areverse2/src/areverse.cpp +++ b/areverse2/src/areverse.cpp @@ -10,7 +10,7 @@ #include <measure> #include <sax/FromXMLParserHelper.h> -#include "exception/AlibException.h" +#include "exception/CommonException.h" #include "factory/XmlDataFactory.hpp" #include "automaton/transform/Reverse.h" @@ -56,7 +56,7 @@ int main(int argc, char** argv) { if(measure.getValue()) std::cmeasure << measurements::results() << std::endl; return 0; - } catch (const exception::AlibException& exception) { + } catch (const exception::CommonException& exception) { alib::XmlDataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { diff --git a/arun2/src/arun.cpp b/arun2/src/arun.cpp index 38f03b9587..255be348a1 100644 --- a/arun2/src/arun.cpp +++ b/arun2/src/arun.cpp @@ -12,7 +12,7 @@ #include <sax/FromXMLParserHelper.h> #include <factory/XmlDataFactory.hpp> -#include <exception/AlibException.h> +#include <exception/CommonException.h> #include <string/String.h> #include <primitive/Bool.h> #include <object/Object.h> @@ -88,7 +88,7 @@ int main(int argc, char* argv[]) { alib::XmlDataFactory::toStdout( res ); } else { - throw exception::AlibException( "Invalid run type" ); + throw exception::CommonException( "Invalid run type" ); } measurements::end(); @@ -97,7 +97,7 @@ int main(int argc, char* argv[]) { if(measure.getValue()) std::cmeasure << measurements::results() << std::endl; return 0; - } catch ( const exception::AlibException & exception ) { + } catch ( const exception::CommonException & exception ) { alib::XmlDataFactory::toStdout( exception ); return 1; } catch (const TCLAP::ArgException& exception) { diff --git a/astat2/src/AutomataStat.cpp b/astat2/src/AutomataStat.cpp index dce8d2af0b..631f14d826 100644 --- a/astat2/src/AutomataStat.cpp +++ b/astat2/src/AutomataStat.cpp @@ -7,8 +7,6 @@ #include "AutomataStat.h" -#include <exception/AlibException.h> - #include <automaton/FSM/NFA.h> #include <automaton/FSM/DFA.h> diff --git a/astat2/src/GrammarStat.cpp b/astat2/src/GrammarStat.cpp index 723fb953ab..51f7f227b5 100644 --- a/astat2/src/GrammarStat.cpp +++ b/astat2/src/GrammarStat.cpp @@ -7,8 +7,6 @@ #include "GrammarStat.h" -#include <exception/AlibException.h> - #include <grammar/Regular/RightRG.h> #include <grammar/Regular/RightLG.h> diff --git a/astat2/src/RegExpStat.cpp b/astat2/src/RegExpStat.cpp index 35d32cb164..f438ba0be6 100644 --- a/astat2/src/RegExpStat.cpp +++ b/astat2/src/RegExpStat.cpp @@ -7,7 +7,7 @@ #include "RegExpStat.h" -#include <exception/AlibException.h> +#include <exception/CommonException.h> #include <regexp/formal/FormalRegExp.h> #include <regexp/formal/FormalRegExpElement.h> @@ -23,7 +23,7 @@ void RegExpStat::stat ( const regexp::RegExp & regexp, const RegExpSettings & se } unsigned RegExpStat::countNodes ( const regexp::FormalRegExpElement & ) { - throw exception::AlibException ( "unimplemented" ); + throw exception::CommonException ( "unimplemented" ); } void RegExpStat::stat ( const regexp::FormalRegExp & regexp, const RegExpSettings & settings ) { @@ -67,7 +67,7 @@ void RegExpStat::stat ( const regexp::FormalRegExp & regexp, const RegExpSetting auto RegExpStatFormalRegExp = RegExpStat::RegistratorWrapper < void, regexp::FormalRegExp > ( RegExpStat::getInstance ( ), RegExpStat::stat ); unsigned RegExpStat::countNodes ( const regexp::UnboundedRegExpElement & ) { - throw exception::AlibException ( "unimplemented" ); + throw exception::CommonException ( "unimplemented" ); } void RegExpStat::stat ( const regexp::UnboundedRegExp & regexp, const RegExpSettings & settings ) { diff --git a/astat2/src/SetStat.cpp b/astat2/src/SetStat.cpp index d6d7713110..82e780a5c9 100644 --- a/astat2/src/SetStat.cpp +++ b/astat2/src/SetStat.cpp @@ -7,8 +7,6 @@ #include "SetStat.h" -#include <exception/AlibException.h> - #include <factory/XmlDataFactory.hpp> #include <iostream> diff --git a/astat2/src/StringStat.cpp b/astat2/src/StringStat.cpp index b21aef26bf..84bc91686c 100644 --- a/astat2/src/StringStat.cpp +++ b/astat2/src/StringStat.cpp @@ -7,8 +7,6 @@ #include "StringStat.h" -#include <exception/AlibException.h> - #include <string/LinearString.h> #include <string/CyclicString.h> diff --git a/astat2/src/TreeStat.cpp b/astat2/src/TreeStat.cpp index c8498b84c3..7e0b33740b 100644 --- a/astat2/src/TreeStat.cpp +++ b/astat2/src/TreeStat.cpp @@ -7,8 +7,6 @@ #include "TreeStat.h" -#include <exception/AlibException.h> - #include <tree/ranked/RankedTree.h> #include <tree/unranked/UnrankedTree.h> diff --git a/astat2/src/astat.cpp b/astat2/src/astat.cpp index fc07fd6368..115c22f5ca 100644 --- a/astat2/src/astat.cpp +++ b/astat2/src/astat.cpp @@ -12,7 +12,7 @@ #include <sax/FromXMLParserHelper.h> #include <factory/XmlDataFactory.hpp> -#include <exception/AlibException.h> +#include <exception/CommonException.h> #include "AutomataStat.h" #include "GrammarStat.h" @@ -31,7 +31,7 @@ PrintingOptions translatePrintingOptions ( std::string value ) { else if ( value == "both" ) return PrintingOptions::BOTH; else - throw exception::AlibException ( "Invalid Argument in translate printing options (" + value + ")" ); + throw exception::CommonException ( "Invalid Argument in translate printing options (" + value + ")" ); } int main ( int argc, char * argv[] ) { @@ -268,7 +268,7 @@ int main ( int argc, char * argv[] ) { SetStat::stat ( data, settings ); } else { - throw exception::AlibException ( "Input not recognized." ); + throw exception::CommonException ( "Input not recognized." ); } measurements::end ( ); @@ -277,7 +277,7 @@ int main ( int argc, char * argv[] ) { if ( measure.getValue ( ) ) std::cmeasure << measurements::results ( ) << std::endl; return 0; - } catch ( const exception::AlibException & exception ) { + } catch ( const exception::CommonException & exception ) { alib::XmlDataFactory::toStdout ( exception ); return 1; } catch ( const TCLAP::ArgException & exception ) { diff --git a/astringology2/src/astringology.cpp b/astringology2/src/astringology.cpp index 1c6abe9209..3c7d355b0a 100644 --- a/astringology2/src/astringology.cpp +++ b/astringology2/src/astringology.cpp @@ -12,7 +12,7 @@ #include <sax/FromXMLParserHelper.h> #include <factory/XmlDataFactory.hpp> -#include <exception/AlibException.h> +#include <exception/CommonException.h> #include <string/String.h> #include <automaton/Automaton.h> #include <container/Container.h> @@ -287,7 +287,7 @@ int main ( int argc, char * argv[] ) { alib::XmlDataFactory::toStdout ( suffixTrie ); } else { - throw exception::AlibException ( "Invalid algorithm" ); + throw exception::CommonException ( "Invalid algorithm" ); } measurements::end ( ); @@ -296,7 +296,7 @@ int main ( int argc, char * argv[] ) { if ( measure.getValue ( ) ) std::cmeasure << measurements::results ( ) << std::endl; return 0; - } catch ( const exception::AlibException & exception ) { + } catch ( const exception::CommonException & exception ) { alib::XmlDataFactory::toStdout ( exception ); return 1; } catch ( const TCLAP::ArgException & exception ) { diff --git a/atrim2/src/atrim.cpp b/atrim2/src/atrim.cpp index 7dc35ed7e9..24b04e0599 100644 --- a/atrim2/src/atrim.cpp +++ b/atrim2/src/atrim.cpp @@ -11,7 +11,7 @@ #include <sax/FromXMLParserHelper.h> #include <factory/XmlDataFactory.hpp> -#include <exception/AlibException.h> +#include <exception/CommonException.h> #include "grammar/simplify/Trim.h" #include "grammar/simplify/UnproductiveSymbolsRemover.h" @@ -141,7 +141,7 @@ int main(int argc, char* argv[]) { alib::XmlDataFactory::toStdout( res ); } else { - throw exception::AlibException( "Input not recognized." ); + throw exception::CommonException( "Input not recognized." ); } measurements::end(); @@ -150,7 +150,7 @@ int main(int argc, char* argv[]) { if(measure.getValue()) std::cmeasure << measurements::results() << std::endl; return 0; - } catch( const exception::AlibException & exception ) { + } catch( const exception::CommonException & exception ) { alib::XmlDataFactory::toStdout( exception ); return 1; } catch(const TCLAP::ArgException& exception) { diff --git a/tniceprint/src/tniceprint.cpp b/tniceprint/src/tniceprint.cpp index e3344113f8..09a7951bd2 100644 --- a/tniceprint/src/tniceprint.cpp +++ b/tniceprint/src/tniceprint.cpp @@ -10,7 +10,7 @@ #include <measure> #include <string> #include <sax/FromXMLParserHelper.h> -#include <exception/AlibException.h> +#include <exception/CommonException.h> #include <factory/XmlDataFactory.hpp> #include <tree/Tree.h> #include <tree/ranked/RankedTree.h> @@ -56,7 +56,7 @@ int main(int argc, char** argv) { tree.nicePrint(std::cout); } else { - throw exception::AlibException("no tree on input"); + throw exception::CommonException("no tree on input"); } measurements::end(); @@ -65,7 +65,7 @@ int main(int argc, char** argv) { if(measure.getValue()) std::cmeasure << measurements::results() << std::endl; return 0; - } catch(const exception::AlibException& exception) { + } catch(const exception::CommonException& exception) { alib::XmlDataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { -- GitLab