From de0a0753436b2a9d8e4150c35bc7b76d922daf69 Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Mon, 5 Jan 2015 14:22:59 +0100 Subject: [PATCH] rename Api to XmlApi --- acompare2/src/acompare.cpp | 20 +- aconversions2/src/ConversionHandler.cpp | 42 +- aconversions2/src/ConversionHandler.h | 4 +- aconversions2/src/aconversion.cpp | 3 +- aconvert2/src/aconvert.cpp | 24 +- aderivation2/src/aderivation.cpp | 6 +- adeterminize2/src/adeterminize.cpp | 6 +- aecho2/src/aecho.cpp | 8 +- aepsilon2/src/aepsilon.cpp | 8 +- aintegral2/src/aintegral.cpp | 6 +- alangop2/src/alangop.cpp | 30 +- .../automaton/determinize/determinizeTest.cpp | 7 +- .../transform/AutomataConcatenationTest.cpp | 2 - .../automaton/transform/AutomataUnionTest.cpp | 2 - .../transform/AutomatonIterationTest.cpp | 2 - .../properties/GrammarPropertiesTest.cpp | 4 +- .../test-src/regexp/toAutomaton/re2faTest.cpp | 1 - alib2data/src/{Api.cpp => XmlApi.cpp} | 582 +++++++++--------- alib2data/src/{Api.hpp => XmlApi.hpp} | 200 +++--- .../src/alphabet/SymbolFromXMLParser.cpp | 38 +- alib2data/src/alphabet/SymbolFromXMLParser.h | 4 +- .../src/alphabet/SymbolToXMLComposer.cpp | 20 +- alib2data/src/alphabet/SymbolToXMLComposer.h | 4 +- .../src/automaton/AutomatonFromXMLParser.cpp | 90 +-- .../src/automaton/AutomatonFromXMLParser.h | 4 +- .../src/automaton/AutomatonToXMLComposer.cpp | 58 +- .../src/automaton/AutomatonToXMLComposer.h | 4 +- .../src/container/ContainerFromXMLParser.cpp | 20 +- .../src/container/ContainerFromXMLParser.hpp | 18 +- .../src/container/ContainerToXMLComposer.cpp | 10 +- .../src/container/ContainerToXMLComposer.hpp | 18 +- .../src/exception/ExceptionFromXMLParser.cpp | 4 +- .../src/exception/ExceptionFromXMLParser.h | 4 +- .../src/exception/ExceptionToXMLComposer.cpp | 2 +- .../src/exception/ExceptionToXMLComposer.h | 4 +- .../{DataFactory.hpp => XmlDataFactory.hpp} | 22 +- .../src/grammar/GrammarFromXMLParser.cpp | 54 +- alib2data/src/grammar/GrammarFromXMLParser.h | 4 +- .../src/grammar/GrammarToXMLComposer.cpp | 48 +- alib2data/src/grammar/GrammarToXMLComposer.h | 4 +- alib2data/src/label/LabelFromXMLParser.cpp | 26 +- alib2data/src/label/LabelFromXMLParser.h | 4 +- alib2data/src/label/LabelToXMLComposer.cpp | 16 +- alib2data/src/label/LabelToXMLComposer.h | 4 +- alib2data/src/object/ObjectFromXMLParser.cpp | 24 +- alib2data/src/object/ObjectFromXMLParser.h | 4 +- alib2data/src/object/ObjectToXMLComposer.cpp | 2 +- alib2data/src/object/ObjectToXMLComposer.h | 4 +- .../src/primitive/PrimitiveFromXMLParser.cpp | 10 +- .../src/primitive/PrimitiveFromXMLParser.h | 4 +- .../src/primitive/PrimitiveToXMLComposer.cpp | 2 +- .../src/primitive/PrimitiveToXMLComposer.h | 4 +- alib2data/src/regexp/RegExpFromXMLParser.cpp | 16 +- alib2data/src/regexp/RegExpFromXMLParser.h | 4 +- alib2data/src/regexp/RegExpToXMLComposer.cpp | 10 +- alib2data/src/regexp/RegExpToXMLComposer.h | 4 +- alib2data/src/string/StringFromXMLParser.cpp | 14 +- alib2data/src/string/StringFromXMLParser.h | 4 +- alib2data/src/string/StringToXMLComposer.cpp | 12 +- alib2data/src/string/StringToXMLComposer.h | 4 +- alib2data/test-src/alphabet/SymbolTest.cpp | 10 +- .../test-src/automaton/AutomatonTest.cpp | 10 +- .../test-src/container/ContainerTest.cpp | 16 +- alib2data/test-src/grammar/GrammarTest.cpp | 46 +- alib2data/test-src/label/LabelTest.cpp | 10 +- alib2data/test-src/regexp/RegExpTest.cpp | 10 +- alib2data/test-src/string/StringTest.cpp | 10 +- aminimize2/src/aminimize.cpp | 8 +- anormalize2/src/anormalize.cpp | 14 +- arand2/src/arand.cpp | 8 +- arename2/src/arename.cpp | 6 +- areverse2/src/areverse.cpp | 6 +- arun2/src/arun.cpp | 16 +- astat2/src/AutomataStat.cpp | 42 +- astat2/src/astat.cpp | 16 +- astringology2/src/astringology.cpp | 14 +- atrim2/src/atrim.cpp | 22 +- 77 files changed, 913 insertions(+), 914 deletions(-) rename alib2data/src/{Api.cpp => XmlApi.cpp} (54%) rename alib2data/src/{Api.hpp => XmlApi.hpp} (87%) rename alib2data/src/factory/{DataFactory.hpp => XmlDataFactory.hpp} (82%) diff --git a/acompare2/src/acompare.cpp b/acompare2/src/acompare.cpp index a9069c7487..d016d36384 100644 --- a/acompare2/src/acompare.cpp +++ b/acompare2/src/acompare.cpp @@ -7,7 +7,7 @@ #include <tclap/CmdLine.h> -#include "factory/DataFactory.hpp" +#include "factory/XmlDataFactory.hpp" #include "exception/AlibException.h" #include "AutomatonCompare.h" @@ -53,20 +53,20 @@ int main(int argc, char** argv) { 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(alib::DataFactory::first<exception::AlibException>(tokens1)) std::cerr << alib::DataFactory::fromTokens<exception::AlibException>(tokens1).getCause() << std::endl; - if(alib::DataFactory::first<exception::AlibException>(tokens2)) std::cerr << alib::DataFactory::fromTokens<exception::AlibException>(tokens2).getCause() << std::endl; - if(alib::DataFactory::first<exception::AlibException>(tokens1) || alib::DataFactory::first<exception::AlibException>(tokens2)) return 0; + if(alib::XmlDataFactory::first<exception::AlibException>(tokens1)) std::cerr << alib::XmlDataFactory::fromTokens<exception::AlibException>(tokens1).getCause() << std::endl; + if(alib::XmlDataFactory::first<exception::AlibException>(tokens2)) std::cerr << alib::XmlDataFactory::fromTokens<exception::AlibException>(tokens2).getCause() << std::endl; + if(alib::XmlDataFactory::first<exception::AlibException>(tokens1) || alib::XmlDataFactory::first<exception::AlibException>(tokens2)) return 0; - if(alib::DataFactory::first<automaton::Automaton>(tokens1) && alib::FromXMLParsers::automatonParser.first(tokens2)) { - automaton::Automaton automaton1 = alib::DataFactory::fromTokens<automaton::Automaton>(tokens1); - automaton::Automaton automaton2 = alib::DataFactory::fromTokens<automaton::Automaton>(tokens2); + if(alib::XmlDataFactory::first<automaton::Automaton>(tokens1) && alib::FromXMLParsers::automatonParser.first(tokens2)) { + automaton::Automaton automaton1 = alib::XmlDataFactory::fromTokens<automaton::Automaton>(tokens1); + automaton::Automaton automaton2 = alib::XmlDataFactory::fromTokens<automaton::Automaton>(tokens2); return AutomatonCompare::compare(automaton1, automaton2); } if(alib::FromXMLParsers::grammarParser.first(tokens1) && alib::FromXMLParsers::grammarParser.first(tokens2)) { - grammar::Grammar grammar1 = alib::DataFactory::fromTokens<grammar::Grammar>(tokens1); - grammar::Grammar grammar2 = alib::DataFactory::fromTokens<grammar::Grammar>(tokens2); + grammar::Grammar grammar1 = alib::XmlDataFactory::fromTokens<grammar::Grammar>(tokens1); + grammar::Grammar grammar2 = alib::XmlDataFactory::fromTokens<grammar::Grammar>(tokens2); return GrammarCompare::compare(grammar1, grammar2); } @@ -75,7 +75,7 @@ int main(int argc, char** argv) { return 2; } catch (const exception::AlibException& exception) { - alib::DataFactory::toStdout(exception); + alib::XmlDataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { std::cerr << exception.error() << std::endl; diff --git a/aconversions2/src/ConversionHandler.cpp b/aconversions2/src/ConversionHandler.cpp index 7a64359be8..2c3bb6a39d 100644 --- a/aconversions2/src/ConversionHandler.cpp +++ b/aconversions2/src/ConversionHandler.cpp @@ -23,6 +23,8 @@ #include "regexp/convert/ToGrammarRightRGGlushkov.h" #include "regexp/convert/ToGrammarRightRGDerivation.h" +#include <factory/XmlDataFactory.hpp> + ConversionHandler::ConversionHandler( std::list<sax::Token> & tokens, const std::string & target, const std::string & algorithm ) : m_tokens( tokens ), m_source( parseFormalismFromTokens( ) ), @@ -80,15 +82,15 @@ void ConversionHandler::convertRG( void ) void ConversionHandler::convertFAtoRE( void ) { - const automaton::Automaton automaton = alib::DataFactory::fromTokens<automaton::Automaton>(m_tokens); + const automaton::Automaton automaton = alib::XmlDataFactory::fromTokens<automaton::Automaton>(m_tokens); switch( m_algorithm ) { case BRZOZOWSKI_ALGEBRAIC: - alib::DataFactory::toStdout(automaton::convert::ToRegExpAlgebraic::convert( automaton ) ); + alib::XmlDataFactory::toStdout(automaton::convert::ToRegExpAlgebraic::convert( automaton ) ); break; case STATE_ELIMINATION: case DEFAULT: - alib::DataFactory::toStdout(automaton::convert::ToRegExpStateElimination::convert(automaton)); + alib::XmlDataFactory::toStdout(automaton::convert::ToRegExpStateElimination::convert(automaton)); break; default: throw exception::AlibException( "ConversionHandler: Invalid algorithm." ); @@ -97,15 +99,15 @@ void ConversionHandler::convertFAtoRE( void ) void ConversionHandler::convertFAtoRG( void ) { - const automaton::Automaton fsm = alib::DataFactory::fromTokens<automaton::Automaton>( m_tokens ); + const automaton::Automaton fsm = alib::XmlDataFactory::fromTokens<automaton::Automaton>( m_tokens ); switch( m_algorithm ) { case INCOMING_TRANSITIONS: - alib::DataFactory::toStdout(automaton::convert::ToGrammarLeftRG::convert(fsm)); + alib::XmlDataFactory::toStdout(automaton::convert::ToGrammarLeftRG::convert(fsm)); break; case OUTGOING_TRANSITIONS: case DEFAULT: - alib::DataFactory::toStdout(automaton::convert::ToGrammarRightRG::convert(fsm)); + alib::XmlDataFactory::toStdout(automaton::convert::ToGrammarRightRG::convert(fsm)); break; default: throw exception::AlibException( "ConversionHandler: Invalid algorithm." ); @@ -116,18 +118,18 @@ void ConversionHandler::convertFAtoRG( void ) void ConversionHandler::convertREtoFA( void ) { - const regexp::RegExp regexp = alib::DataFactory::fromTokens<regexp::RegExp>(m_tokens); + const regexp::RegExp regexp = alib::XmlDataFactory::fromTokens<regexp::RegExp>(m_tokens); switch( m_algorithm ) { case BRZOZOWSKI_DERIVATION: - alib::DataFactory::toStdout(regexp::convert::ToAutomatonDerivation::convert(regexp)); + alib::XmlDataFactory::toStdout(regexp::convert::ToAutomatonDerivation::convert(regexp)); break; case THOMPSON_NFA: - alib::DataFactory::toStdout(regexp::convert::ToAutomatonThompson::convert(regexp)); + alib::XmlDataFactory::toStdout(regexp::convert::ToAutomatonThompson::convert(regexp)); break; case GLUSHKOV_NFA: case DEFAULT: - alib::DataFactory::toStdout(regexp::convert::ToAutomatonGlushkov::convert(regexp)); + alib::XmlDataFactory::toStdout(regexp::convert::ToAutomatonGlushkov::convert(regexp)); break; default: throw exception::AlibException( "ConversionHandler: Invalid algorithm." ); @@ -136,15 +138,15 @@ void ConversionHandler::convertREtoFA( void ) void ConversionHandler::convertREtoRG( void ) { - const regexp::RegExp regexp = alib::DataFactory::fromTokens<regexp::RegExp>(m_tokens); + const regexp::RegExp regexp = alib::XmlDataFactory::fromTokens<regexp::RegExp>(m_tokens); switch(m_algorithm) { case BRZOZOWSKI_DERIVATION: - alib::DataFactory::toStdout(regexp::convert::ToGrammarRightRGDerivation::convert(regexp)); + alib::XmlDataFactory::toStdout(regexp::convert::ToGrammarRightRGDerivation::convert(regexp)); break; case GLUSHKOV_NFA: case DEFAULT: - alib::DataFactory::toStdout(regexp::convert::ToGrammarRightRGGlushkov::convert(regexp)); + alib::XmlDataFactory::toStdout(regexp::convert::ToGrammarRightRGGlushkov::convert(regexp)); break; default: throw exception::AlibException( "ConversionHandler: Invalid algorithm." ); @@ -154,10 +156,10 @@ void ConversionHandler::convertREtoRG( void ) // ---------------------------------------------------------------------------- void ConversionHandler::convertRGtoFA( void ) { - const grammar::Grammar grammar = alib::DataFactory::fromTokens<grammar::Grammar>(m_tokens); + const grammar::Grammar grammar = alib::XmlDataFactory::fromTokens<grammar::Grammar>(m_tokens); switch( m_algorithm ) { case DEFAULT: - alib::DataFactory::toStdout(grammar::convert::ToAutomaton::convert(grammar)); + alib::XmlDataFactory::toStdout(grammar::convert::ToAutomaton::convert(grammar)); break; default: throw exception::AlibException( "ConversionHandler: Invalid algorithm." ); @@ -165,12 +167,12 @@ void ConversionHandler::convertRGtoFA( void ) { } void ConversionHandler::convertRGtoRE( void ) { - const grammar::Grammar grammar = alib::DataFactory::fromTokens<grammar::Grammar>(m_tokens); + const grammar::Grammar grammar = alib::XmlDataFactory::fromTokens<grammar::Grammar>(m_tokens); switch( m_algorithm ) { case BRZOZOWSKI_ALGEBRAIC: case DEFAULT: - alib::DataFactory::toStdout(grammar::convert::ToRegExpAlgebraic::convert(grammar)); + alib::XmlDataFactory::toStdout(grammar::convert::ToRegExpAlgebraic::convert(grammar)); break; default: throw exception::AlibException( "ConversionHandler: Invalid algorithm." ); @@ -188,13 +190,13 @@ ConversionHandler::TFormalism ConversionHandler::parseFormalismFromString( const } ConversionHandler::TFormalism ConversionHandler::parseFormalismFromTokens( void ) const { - if( alib::DataFactory::first<automaton::Automaton>(m_tokens) ) + if( alib::XmlDataFactory::first<automaton::Automaton>(m_tokens) ) return FINITE_AUTOMATON; - if( alib::DataFactory::first<regexp::RegExp>(m_tokens) ) + if( alib::XmlDataFactory::first<regexp::RegExp>(m_tokens) ) return REGULAR_EXPRESSION; - if( alib::DataFactory::first<grammar::Grammar>(m_tokens) ) + if( alib::XmlDataFactory::first<grammar::Grammar>(m_tokens) ) return REGULAR_GRAMMAR; throw exception::AlibException( "ConversionHandler: Invalid input formalism." ); diff --git a/aconversions2/src/ConversionHandler.h b/aconversions2/src/ConversionHandler.h index b90c9f20a7..9c2fbc77e6 100644 --- a/aconversions2/src/ConversionHandler.h +++ b/aconversions2/src/ConversionHandler.h @@ -9,10 +9,8 @@ #define ALGORITHMCHOOSER_H_ #include <list> - +#include <sax/Token.h> #include <exception/AlibException.h> -#include <factory/DataFactory.hpp> - /** * Wraps all conversions. diff --git a/aconversions2/src/aconversion.cpp b/aconversions2/src/aconversion.cpp index e97e5dff2c..ca27793bce 100644 --- a/aconversions2/src/aconversion.cpp +++ b/aconversions2/src/aconversion.cpp @@ -9,6 +9,7 @@ #include <sax/SaxParseInterface.h> #include <sax/ParserException.h> +#include <factory/XmlDataFactory.hpp> #include "ConversionHandler.h" @@ -47,7 +48,7 @@ int main(int argc, char* argv[]) conv.convert( ); return 0; } catch(const exception::AlibException& exception) { - alib::DataFactory::toStdout(exception); + alib::XmlDataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { std::cerr << exception.error() << std::endl; diff --git a/aconvert2/src/aconvert.cpp b/aconvert2/src/aconvert.cpp index 8ee133ebcf..885ac7b7c6 100644 --- a/aconvert2/src/aconvert.cpp +++ b/aconvert2/src/aconvert.cpp @@ -9,7 +9,7 @@ #include <fstream> #include "automaton/Automaton.h" -#include "factory/DataFactory.hpp" +#include "factory/XmlDataFactory.hpp" #include "factory/StringDataFactory.hpp" #include "exception/AlibException.h" @@ -17,44 +17,44 @@ #include "GasTexConverter.h" void automatonFromString(std::istream& in, std::ostream& out) { - alib::DataFactory::toStream(alib::StringDataFactory::fromStream<automaton::Automaton>(in), out); + alib::XmlDataFactory::toStream(alib::StringDataFactory::fromStream<automaton::Automaton>(in), out); } void grammarFromString(std::istream& in, std::ostream& out) { - alib::DataFactory::toStream(alib::StringDataFactory::fromStream<grammar::Grammar>(in), out); + alib::XmlDataFactory::toStream(alib::StringDataFactory::fromStream<grammar::Grammar>(in), out); } void regexpFromString(std::istream& in, std::ostream& out) { - alib::DataFactory::toStream(alib::StringDataFactory::fromStream<regexp::RegExp>(in), out); + alib::XmlDataFactory::toStream(alib::StringDataFactory::fromStream<regexp::RegExp>(in), out); } void stringFromString(std::istream& in, std::ostream& out) { - alib::DataFactory::toStream(alib::StringDataFactory::fromStream<string::String>(in), out); + alib::XmlDataFactory::toStream(alib::StringDataFactory::fromStream<string::String>(in), out); } void automatonToString(std::istream& in, std::ostream& out) { - alib::StringDataFactory::toStream(alib::DataFactory::fromStream<automaton::Automaton>(in), out); + alib::StringDataFactory::toStream(alib::XmlDataFactory::fromStream<automaton::Automaton>(in), out); } void grammarToString(std::istream& in, std::ostream& out) { - alib::StringDataFactory::toStream(alib::DataFactory::fromStream<grammar::Grammar>(in), out); + alib::StringDataFactory::toStream(alib::XmlDataFactory::fromStream<grammar::Grammar>(in), out); } void regexpToString(std::istream& in, std::ostream& out) { - alib::StringDataFactory::toStream(alib::DataFactory::fromStream<regexp::RegExp>(in), out); + alib::StringDataFactory::toStream(alib::XmlDataFactory::fromStream<regexp::RegExp>(in), out); } void stringToString(std::istream& in, std::ostream& out) { - alib::StringDataFactory::toStream(alib::DataFactory::fromStream<string::String>(in), out); + alib::StringDataFactory::toStream(alib::XmlDataFactory::fromStream<string::String>(in), out); } void automatonToDot(std::istream& in, std::ostream& out) { - automaton::Automaton automaton = alib::DataFactory::fromStream<automaton::Automaton>(in); + automaton::Automaton automaton = alib::XmlDataFactory::fromStream<automaton::Automaton>(in); DotConverter::convert(automaton, out); } void automatonToGasTex(std::istream& in, std::ostream& out) { - automaton::Automaton automaton = alib::DataFactory::fromStream<automaton::Automaton>(in); + automaton::Automaton automaton = alib::XmlDataFactory::fromStream<automaton::Automaton>(in); GasTexConverter::convert(automaton, out); } @@ -136,7 +136,7 @@ int main(int argc, char* argv[]) { return 0; } catch (const exception::AlibException& exception) { - alib::DataFactory::toStdout(exception); + alib::XmlDataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { std::cerr << exception.error() << std::endl; diff --git a/aderivation2/src/aderivation.cpp b/aderivation2/src/aderivation.cpp index bd2592ac39..0f39f2759f 100644 --- a/aderivation2/src/aderivation.cpp +++ b/aderivation2/src/aderivation.cpp @@ -7,7 +7,7 @@ #include <tclap/CmdLine.h> -#include <factory/DataFactory.hpp> +#include <factory/XmlDataFactory.hpp> #include <exception/AlibException.h> #include "regexp/transform/RegExpDerivation.h" @@ -45,10 +45,10 @@ int main(int argc, char** argv) { sax::SaxParseInterface::parseStdin(regexpTokens); } - alib::DataFactory::toStdout(regexp::RegExpDerivation::derivation(alib::DataFactory::fromTokens<regexp::RegExp>(regexpTokens), alib::DataFactory::fromTokens<string::LinearString>(stringTokens))); + alib::XmlDataFactory::toStdout(regexp::RegExpDerivation::derivation(alib::XmlDataFactory::fromTokens<regexp::RegExp>(regexpTokens), alib::XmlDataFactory::fromTokens<string::LinearString>(stringTokens))); return 0; } catch(const exception::AlibException& exception) { - alib::DataFactory::toStdout(exception); + alib::XmlDataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { std::cerr << exception.error() << std::endl; diff --git a/adeterminize2/src/adeterminize.cpp b/adeterminize2/src/adeterminize.cpp index 9a49b13882..04106c58cb 100644 --- a/adeterminize2/src/adeterminize.cpp +++ b/adeterminize2/src/adeterminize.cpp @@ -8,7 +8,7 @@ #include <tclap/CmdLine.h> #include "automaton/Automaton.h" -#include "factory/DataFactory.hpp" +#include "factory/XmlDataFactory.hpp" #include "exception/AlibException.h" #include "automaton/determinize/Determinize.h" @@ -32,10 +32,10 @@ int main(int argc, char** argv) { sax::SaxParseInterface::parseStdin(tokens); } - alib::DataFactory::toStdout(automaton::determinize::Determinize::determinize(alib::DataFactory::fromTokens<automaton::Automaton>(tokens))); + alib::XmlDataFactory::toStdout(automaton::determinize::Determinize::determinize(alib::XmlDataFactory::fromTokens<automaton::Automaton>(tokens))); return 0; } catch (const exception::AlibException& exception) { - alib::DataFactory::toStdout(exception); + alib::XmlDataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { std::cerr << exception.error() << std::endl; diff --git a/aecho2/src/aecho.cpp b/aecho2/src/aecho.cpp index f4c31a5102..0f8f05bec2 100644 --- a/aecho2/src/aecho.cpp +++ b/aecho2/src/aecho.cpp @@ -8,7 +8,7 @@ #include <tclap/CmdLine.h> #include <string> #include <exception/AlibException.h> -#include <factory/DataFactory.hpp> +#include <factory/XmlDataFactory.hpp> #include <sax/SaxParseInterface.h> #include <sax/ParserException.h> #include <object/Object.h> @@ -33,12 +33,12 @@ int main(int argc, char** argv) { sax::SaxParseInterface::parseStdin(tokens); } - alib::Object object = alib::DataFactory::fromTokens<alib::Object>(tokens); - alib::DataFactory::toStdout(object); + alib::Object object = alib::XmlDataFactory::fromTokens<alib::Object>(tokens); + alib::XmlDataFactory::toStdout(object); return 0; } catch(const exception::AlibException& exception) { - alib::DataFactory::toStdout(exception); + alib::XmlDataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { std::cerr << exception.error() << std::endl; diff --git a/aepsilon2/src/aepsilon.cpp b/aepsilon2/src/aepsilon.cpp index ff4285e658..2afd29fe7b 100644 --- a/aepsilon2/src/aepsilon.cpp +++ b/aepsilon2/src/aepsilon.cpp @@ -7,7 +7,7 @@ #include <tclap/CmdLine.h> -#include <factory/DataFactory.hpp> +#include <factory/XmlDataFactory.hpp> #include <exception/AlibException.h> #include "automaton/simplify/EpsilonRemoverIncoming.h" @@ -40,16 +40,16 @@ int main(int argc, char** argv) { } if(algorithm.getValue() == "outgoing") - alib::DataFactory::toStdout(automaton::simplify::EpsilonRemoverOutgoing::remove(alib::DataFactory::fromTokens<automaton::Automaton>(tokens))); + alib::XmlDataFactory::toStdout(automaton::simplify::EpsilonRemoverOutgoing::remove(alib::XmlDataFactory::fromTokens<automaton::Automaton>(tokens))); else if(algorithm.getValue() == "incoming" || algorithm.getValue() == "default") { - alib::DataFactory::toStdout(automaton::simplify::EpsilonRemoverIncoming::remove(alib::DataFactory::fromTokens<automaton::Automaton>(tokens))); + alib::XmlDataFactory::toStdout(automaton::simplify::EpsilonRemoverIncoming::remove(alib::XmlDataFactory::fromTokens<automaton::Automaton>(tokens))); } else { throw exception::AlibException("Invalid algorithm"); } return 0; } catch (const exception::AlibException& exception) { - alib::DataFactory::toStdout(exception); + alib::XmlDataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { std::cout << exception.error() << std::endl; diff --git a/aintegral2/src/aintegral.cpp b/aintegral2/src/aintegral.cpp index 71813ec0b0..9d4157f701 100644 --- a/aintegral2/src/aintegral.cpp +++ b/aintegral2/src/aintegral.cpp @@ -7,7 +7,7 @@ #include <tclap/CmdLine.h> -#include <factory/DataFactory.hpp> +#include <factory/XmlDataFactory.hpp> #include <exception/AlibException.h> #include "regexp/transform/RegExpIntegral.h" @@ -45,10 +45,10 @@ int main(int argc, char** argv) { sax::SaxParseInterface::parseStdin(regexpTokens); } - alib::DataFactory::toStdout(regexp::RegExpIntegral::integral(alib::DataFactory::fromTokens<regexp::RegExp>(regexpTokens), alib::DataFactory::fromTokens<string::LinearString>(stringTokens))); + alib::XmlDataFactory::toStdout(regexp::RegExpIntegral::integral(alib::XmlDataFactory::fromTokens<regexp::RegExp>(regexpTokens), alib::XmlDataFactory::fromTokens<string::LinearString>(stringTokens))); return 0; } catch(const exception::AlibException& exception) { - alib::DataFactory::toStdout(exception); + alib::XmlDataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { std::cout << exception.error() << std::endl; diff --git a/alangop2/src/alangop.cpp b/alangop2/src/alangop.cpp index 7c35665648..7165bddaee 100644 --- a/alangop2/src/alangop.cpp +++ b/alangop2/src/alangop.cpp @@ -8,7 +8,7 @@ #include <tclap/CmdLine.h> #include <vector> -#include <factory/DataFactory.hpp> +#include <factory/XmlDataFactory.hpp> #include <exception/AlibException.h> #include <automaton/Automaton.h> @@ -66,40 +66,40 @@ int main(int argc, char* argv[]) { sax::SaxParseInterface::parseStdin(a2Tokens); } - automaton::Automaton automaton1 = alib::DataFactory::fromTokens<automaton::Automaton>(a1Tokens); + automaton::Automaton automaton1 = alib::XmlDataFactory::fromTokens<automaton::Automaton>(a1Tokens); if( algorithm.getValue() == "unionEpsilon") { - automaton::Automaton automaton2 = alib::DataFactory::fromTokens<automaton::Automaton>(a2Tokens); - alib::DataFactory::toStdout(automaton::transform::AutomataUnionEpsilonTransition::unification(automaton1, automaton2)); + automaton::Automaton automaton2 = alib::XmlDataFactory::fromTokens<automaton::Automaton>(a2Tokens); + alib::XmlDataFactory::toStdout(automaton::transform::AutomataUnionEpsilonTransition::unification(automaton1, automaton2)); return 0; } else if( algorithm.getValue() == "unionCartesian") { - automaton::Automaton automaton2 = alib::DataFactory::fromTokens<automaton::Automaton>(a2Tokens); - alib::DataFactory::toStdout(automaton::transform::AutomataUnionCartesianProduct::unification(automaton1, automaton2)); + automaton::Automaton automaton2 = alib::XmlDataFactory::fromTokens<automaton::Automaton>(a2Tokens); + alib::XmlDataFactory::toStdout(automaton::transform::AutomataUnionCartesianProduct::unification(automaton1, automaton2)); return 0; } else if( algorithm.getValue() == "concatenationEpsilon") { - automaton::Automaton automaton2 = alib::DataFactory::fromTokens<automaton::Automaton>(a2Tokens); - alib::DataFactory::toStdout(automaton::transform::AutomataConcatenationEpsilonTransition::concatenation(automaton1, automaton2)); + automaton::Automaton automaton2 = alib::XmlDataFactory::fromTokens<automaton::Automaton>(a2Tokens); + alib::XmlDataFactory::toStdout(automaton::transform::AutomataConcatenationEpsilonTransition::concatenation(automaton1, automaton2)); return 0; } else if( algorithm.getValue() == "concatenation") { - automaton::Automaton automaton2 = alib::DataFactory::fromTokens<automaton::Automaton>(a2Tokens); - alib::DataFactory::toStdout(automaton::transform::AutomataConcatenation::concatenation(automaton1, automaton2)); + automaton::Automaton automaton2 = alib::XmlDataFactory::fromTokens<automaton::Automaton>(a2Tokens); + alib::XmlDataFactory::toStdout(automaton::transform::AutomataConcatenation::concatenation(automaton1, automaton2)); return 0; } else if( algorithm.getValue() == "intersectionCartesian") { - automaton::Automaton automaton2 = alib::DataFactory::fromTokens<automaton::Automaton>(a2Tokens); - alib::DataFactory::toStdout(automaton::transform::AutomataIntersectionCartesianProduct::intersection(automaton1, automaton2)); + automaton::Automaton automaton2 = alib::XmlDataFactory::fromTokens<automaton::Automaton>(a2Tokens); + alib::XmlDataFactory::toStdout(automaton::transform::AutomataIntersectionCartesianProduct::intersection(automaton1, automaton2)); return 0; } else if( algorithm.getValue() == "iteration") { - alib::DataFactory::toStdout(automaton::transform::AutomatonIteration::iteration(automaton1)); + alib::XmlDataFactory::toStdout(automaton::transform::AutomatonIteration::iteration(automaton1)); return 0; } else if( algorithm.getValue() == "iterationEpsilon") { - alib::DataFactory::toStdout(automaton::transform::AutomatonIterationEpsilonTransition::iteration(automaton1)); + alib::XmlDataFactory::toStdout(automaton::transform::AutomatonIterationEpsilonTransition::iteration(automaton1)); return 0; } else { throw exception::AlibException( "Invalid algorithm" ); return 1; } } catch( const exception::AlibException & exception ) { - alib::DataFactory::toStdout( exception ); + alib::XmlDataFactory::toStdout( exception ); return 1; } catch(const TCLAP::ArgException& exception) { std::cout << exception.error() << std::endl; diff --git a/alib2algo/test-src/automaton/determinize/determinizeTest.cpp b/alib2algo/test-src/automaton/determinize/determinizeTest.cpp index f2408f344d..441af1afde 100644 --- a/alib2algo/test-src/automaton/determinize/determinizeTest.cpp +++ b/alib2algo/test-src/automaton/determinize/determinizeTest.cpp @@ -1,9 +1,12 @@ #include <list> #include "determinizeTest.h" -#include "automaton/determinize/Determinize.h" +#include <automaton/FSM/NFA.h> +#include <automaton/PDA/InputDrivenNPDA.h> +#include <automaton/PDA/VisiblyPushdownNPDA.h> +#include <alphabet/BottomOfTheStackSymbol.h> -#include "factory/DataFactory.hpp" +#include "automaton/determinize/Determinize.h" #define CPPUNIT_IMPLY(x, y) CPPUNIT_ASSERT(!(x) || (y)) diff --git a/alib2algo/test-src/automaton/transform/AutomataConcatenationTest.cpp b/alib2algo/test-src/automaton/transform/AutomataConcatenationTest.cpp index 628181d4d7..6f1414d682 100644 --- a/alib2algo/test-src/automaton/transform/AutomataConcatenationTest.cpp +++ b/alib2algo/test-src/automaton/transform/AutomataConcatenationTest.cpp @@ -11,8 +11,6 @@ #include "automaton/simplify/Total.h" #include "automaton/determinize/Determinize.h" -#include <factory/DataFactory.hpp> - #define CPPUNIT_IMPLY(x, y) CPPUNIT_ASSERT(!(x) || (y)) CPPUNIT_TEST_SUITE_REGISTRATION( AutomataConcatenationTest ); diff --git a/alib2algo/test-src/automaton/transform/AutomataUnionTest.cpp b/alib2algo/test-src/automaton/transform/AutomataUnionTest.cpp index fbbcb7a5ab..e91953c036 100644 --- a/alib2algo/test-src/automaton/transform/AutomataUnionTest.cpp +++ b/alib2algo/test-src/automaton/transform/AutomataUnionTest.cpp @@ -10,8 +10,6 @@ #include "automaton/simplify/Total.h" #include "automaton/determinize/Determinize.h" -#include <factory/DataFactory.hpp> - #define CPPUNIT_IMPLY(x, y) CPPUNIT_ASSERT(!(x) || (y)) CPPUNIT_TEST_SUITE_REGISTRATION( AutomataUnionTest ); diff --git a/alib2algo/test-src/automaton/transform/AutomatonIterationTest.cpp b/alib2algo/test-src/automaton/transform/AutomatonIterationTest.cpp index 6d408e12bc..8fdf13d6e8 100644 --- a/alib2algo/test-src/automaton/transform/AutomatonIterationTest.cpp +++ b/alib2algo/test-src/automaton/transform/AutomatonIterationTest.cpp @@ -11,8 +11,6 @@ #include "automaton/simplify/Total.h" #include "automaton/determinize/Determinize.h" -#include <factory/DataFactory.hpp> - #define CPPUNIT_IMPLY(x, y) CPPUNIT_ASSERT(!(x) || (y)) CPPUNIT_TEST_SUITE_REGISTRATION( AutomatonIterationTest ); diff --git a/alib2algo/test-src/grammar/properties/GrammarPropertiesTest.cpp b/alib2algo/test-src/grammar/properties/GrammarPropertiesTest.cpp index dcc23b4012..426e790251 100644 --- a/alib2algo/test-src/grammar/properties/GrammarPropertiesTest.cpp +++ b/alib2algo/test-src/grammar/properties/GrammarPropertiesTest.cpp @@ -1,9 +1,11 @@ #include "GrammarPropertiesTest.h" -#include <factory/DataFactory.hpp> #include <label/PrimitiveLabel.h> +#include <grammar/Grammar.h> #include <alphabet/LabeledSymbol.h> #include <alphabet/Symbol.h> +#include <grammar/ContextFree/CFG.h> +#include <grammar/Regular/LeftLG.h> #include "grammar/properties/NullableNonterminals.h" #include "grammar/properties/NonterminalUnitRuleCycle.h" diff --git a/alib2algo/test-src/regexp/toAutomaton/re2faTest.cpp b/alib2algo/test-src/regexp/toAutomaton/re2faTest.cpp index 9ad8525789..6357d9f191 100644 --- a/alib2algo/test-src/regexp/toAutomaton/re2faTest.cpp +++ b/alib2algo/test-src/regexp/toAutomaton/re2faTest.cpp @@ -13,7 +13,6 @@ #include "regexp/unbounded/UnboundedRegExp.h" #include "automaton/FSM/NFA.h" -#include <factory/DataFactory.hpp> #include <factory/StringDataFactory.hpp> CPPUNIT_TEST_SUITE_REGISTRATION( re2faTest ); diff --git a/alib2data/src/Api.cpp b/alib2data/src/XmlApi.cpp similarity index 54% rename from alib2data/src/Api.cpp rename to alib2data/src/XmlApi.cpp index b9ff749cf2..1ceafb6b67 100644 --- a/alib2data/src/Api.cpp +++ b/alib2data/src/XmlApi.cpp @@ -1,11 +1,11 @@ /* - * FromXMLParsers.cpp + * XmlApi.cpp * * Created on: Apr 1, 2013 * Author: Jan Travnicek */ -#include "Api.hpp" +#include "XmlApi.hpp" namespace alib { @@ -99,1166 +99,1166 @@ const std::string Names::PRIMITIVE_CHARACTER = "Character"; const std::string Names::PRIMITIVE_UNSIGNED = "Unsigned"; const std::string Names::PRIMITIVE_BOOL = "Bool"; -Void api<Void>::parse(std::list<sax::Token>& input) { +Void xmlApi<Void>::parse(std::list<sax::Token>& input) { return FromXMLParsers::objectParser.parseVoid(input); } -bool api<Void>::first(const std::list<sax::Token>& input) { +bool xmlApi<Void>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::ALIB_VOID); } -std::list<sax::Token> api<Void>::compose(const Void& data) { +std::list<sax::Token> xmlApi<Void>::compose(const Void& data) { return ToXMLComposers::objectComposer.compose(data); } -container::Container api<container::Container>::parse(std::list<sax::Token>& input) { +container::Container xmlApi<container::Container>::parse(std::list<sax::Token>& input) { return FromXMLParsers::containerParser.parseContainer(input); } -bool api<container::Container>::first(const std::list<sax::Token>& input) { +bool xmlApi<container::Container>::first(const std::list<sax::Token>& input) { return FromXMLParsers::containerParser.first(input); } -std::list<sax::Token> api<container::Container>::compose(const container::Container& data) { +std::list<sax::Token> xmlApi<container::Container>::compose(const container::Container& data) { return ToXMLComposers::containerComposer.compose(data); } -container::ObjectsSet api<container::ObjectsSet>::parse(std::list<sax::Token>& input) { +container::ObjectsSet xmlApi<container::ObjectsSet>::parse(std::list<sax::Token>& input) { return FromXMLParsers::containerParser.parseObjectsSet(input); } -bool api<container::ObjectsSet>::first(const std::list<sax::Token>& input) { +bool xmlApi<container::ObjectsSet>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::CONTAINER_OBJECTS_SET); } -std::list<sax::Token> api<container::ObjectsSet>::compose(const container::ObjectsSet& data) { +std::list<sax::Token> xmlApi<container::ObjectsSet>::compose(const container::ObjectsSet& data) { return ToXMLComposers::containerComposer.compose(data); } -container::ObjectsVector api<container::ObjectsVector>::parse(std::list<sax::Token>& input) { +container::ObjectsVector xmlApi<container::ObjectsVector>::parse(std::list<sax::Token>& input) { return FromXMLParsers::containerParser.parseObjectsVector(input); } -bool api<container::ObjectsVector>::first(const std::list<sax::Token>& input) { +bool xmlApi<container::ObjectsVector>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::CONTAINER_OBJECTS_VECTOR); } -std::list<sax::Token> api<container::ObjectsVector>::compose(const container::ObjectsVector& data) { +std::list<sax::Token> xmlApi<container::ObjectsVector>::compose(const container::ObjectsVector& data) { return ToXMLComposers::containerComposer.compose(data); } -container::ObjectsPair api<container::ObjectsPair>::parse(std::list<sax::Token>& input) { +container::ObjectsPair xmlApi<container::ObjectsPair>::parse(std::list<sax::Token>& input) { return FromXMLParsers::containerParser.parseObjectsPair(input); } -bool api<container::ObjectsPair>::first(const std::list<sax::Token>& input) { +bool xmlApi<container::ObjectsPair>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::CONTAINER_OBJECTS_PAIR); } -std::list<sax::Token> api<container::ObjectsPair>::compose(const container::ObjectsPair& data) { +std::list<sax::Token> xmlApi<container::ObjectsPair>::compose(const container::ObjectsPair& data) { return ToXMLComposers::containerComposer.compose(data); } -container::ObjectsMap api<container::ObjectsMap>::parse(std::list<sax::Token>& input) { +container::ObjectsMap xmlApi<container::ObjectsMap>::parse(std::list<sax::Token>& input) { return FromXMLParsers::containerParser.parseObjectsMap(input); } -bool api<container::ObjectsMap>::first(const std::list<sax::Token>& input) { +bool xmlApi<container::ObjectsMap>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::CONTAINER_OBJECTS_MAP); } -std::list<sax::Token> api<container::ObjectsMap>::compose(const container::ObjectsMap& data) { +std::list<sax::Token> xmlApi<container::ObjectsMap>::compose(const container::ObjectsMap& data) { return ToXMLComposers::containerComposer.compose(data); } -alib::Object api<alib::Object>::parse(std::list<sax::Token>& input) { +alib::Object xmlApi<alib::Object>::parse(std::list<sax::Token>& input) { return FromXMLParsers::objectParser.parseObject(input); } -bool api<alib::Object>::first(const std::list<sax::Token>& input) { +bool xmlApi<alib::Object>::first(const std::list<sax::Token>& input) { return FromXMLParsers::objectParser.first(input); } -std::list<sax::Token> api<alib::Object>::compose(const alib::Object& data) { +std::list<sax::Token> xmlApi<alib::Object>::compose(const alib::Object& data) { return ToXMLComposers::objectComposer.compose(data); } -exception::AlibException api<exception::AlibException>::parse(std::list<sax::Token>& input) { +exception::AlibException xmlApi<exception::AlibException>::parse(std::list<sax::Token>& input) { return FromXMLParsers::exceptionParser.parseException(input); } -bool api<exception::AlibException>::first(const std::list<sax::Token>& input) { +bool xmlApi<exception::AlibException>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::EXCEPTION_ALIB_EXCEPTION); } -std::list<sax::Token> api<exception::AlibException>::compose(const exception::AlibException& data) { +std::list<sax::Token> xmlApi<exception::AlibException>::compose(const exception::AlibException& data) { return ToXMLComposers::exceptionComposer.compose(data); } -alphabet::Symbol api<alphabet::Symbol>::parse(std::list<sax::Token>& input) { +alphabet::Symbol xmlApi<alphabet::Symbol>::parse(std::list<sax::Token>& input) { return FromXMLParsers::symbolParser.parseSymbol(input); } -bool api<alphabet::Symbol>::first(const std::list<sax::Token>& input) { +bool xmlApi<alphabet::Symbol>::first(const std::list<sax::Token>& input) { return FromXMLParsers::symbolParser.first(input); } -std::list<sax::Token> api<alphabet::Symbol>::compose(const alphabet::Symbol& data) { +std::list<sax::Token> xmlApi<alphabet::Symbol>::compose(const alphabet::Symbol& data) { return ToXMLComposers::symbolComposer.compose(data); } -alphabet::LabeledSymbol api<alphabet::LabeledSymbol>::parse(std::list<sax::Token>& input) { +alphabet::LabeledSymbol xmlApi<alphabet::LabeledSymbol>::parse(std::list<sax::Token>& input) { return FromXMLParsers::symbolParser.parseLabeledSymbol(input); } -bool api<alphabet::LabeledSymbol>::first(const std::list<sax::Token>& input) { +bool xmlApi<alphabet::LabeledSymbol>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::ALPHABET_LABELED_SYMBOL); } -std::list<sax::Token> api<alphabet::LabeledSymbol>::compose(const alphabet::LabeledSymbol& data) { +std::list<sax::Token> xmlApi<alphabet::LabeledSymbol>::compose(const alphabet::LabeledSymbol& data) { return ToXMLComposers::symbolComposer.compose(data); } -alphabet::BlankSymbol api<alphabet::BlankSymbol>::parse(std::list<sax::Token>& input) { +alphabet::BlankSymbol xmlApi<alphabet::BlankSymbol>::parse(std::list<sax::Token>& input) { return FromXMLParsers::symbolParser.parseBlankSymbol(input); } -bool api<alphabet::BlankSymbol>::first(const std::list<sax::Token>& input) { +bool xmlApi<alphabet::BlankSymbol>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::ALPHABET_BLANK_SYMBOL); } -std::list<sax::Token> api<alphabet::BlankSymbol>::compose(const alphabet::BlankSymbol& data) { +std::list<sax::Token> xmlApi<alphabet::BlankSymbol>::compose(const alphabet::BlankSymbol& data) { return ToXMLComposers::symbolComposer.compose(data); } -alphabet::BottomOfTheStackSymbol api<alphabet::BottomOfTheStackSymbol>::parse(std::list<sax::Token>& input) { +alphabet::BottomOfTheStackSymbol xmlApi<alphabet::BottomOfTheStackSymbol>::parse(std::list<sax::Token>& input) { return FromXMLParsers::symbolParser.parseBottomOfTheStackSymbol(input); } -bool api<alphabet::BottomOfTheStackSymbol>::first(const std::list<sax::Token>& input) { +bool xmlApi<alphabet::BottomOfTheStackSymbol>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::ALPHABET_BOTTOM_OF_THE_STACK_SYMBOL); } -std::list<sax::Token> api<alphabet::BottomOfTheStackSymbol>::compose(const alphabet::BottomOfTheStackSymbol& data) { +std::list<sax::Token> xmlApi<alphabet::BottomOfTheStackSymbol>::compose(const alphabet::BottomOfTheStackSymbol& data) { return ToXMLComposers::symbolComposer.compose(data); } -alphabet::EndSymbol api<alphabet::EndSymbol>::parse(std::list<sax::Token>& input) { +alphabet::EndSymbol xmlApi<alphabet::EndSymbol>::parse(std::list<sax::Token>& input) { return FromXMLParsers::symbolParser.parseEndSymbol(input); } -bool api<alphabet::EndSymbol>::first(const std::list<sax::Token>& input) { +bool xmlApi<alphabet::EndSymbol>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::ALPHABET_END_SYMBOL); } -std::list<sax::Token> api<alphabet::EndSymbol>::compose(const alphabet::EndSymbol& data) { +std::list<sax::Token> xmlApi<alphabet::EndSymbol>::compose(const alphabet::EndSymbol& data) { return ToXMLComposers::symbolComposer.compose(data); } -alphabet::StartSymbol api<alphabet::StartSymbol>::parse(std::list<sax::Token>& input) { +alphabet::StartSymbol xmlApi<alphabet::StartSymbol>::parse(std::list<sax::Token>& input) { return FromXMLParsers::symbolParser.parseStartSymbol(input); } -bool api<alphabet::StartSymbol>::first(const std::list<sax::Token>& input) { +bool xmlApi<alphabet::StartSymbol>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::ALPHABET_START_SYMBOL); } -std::list<sax::Token> api<alphabet::StartSymbol>::compose(const alphabet::StartSymbol& data) { +std::list<sax::Token> xmlApi<alphabet::StartSymbol>::compose(const alphabet::StartSymbol& data) { return ToXMLComposers::symbolComposer.compose(data); } -alphabet::RankedSymbol api<alphabet::RankedSymbol>::parse(std::list<sax::Token>& input) { +alphabet::RankedSymbol xmlApi<alphabet::RankedSymbol>::parse(std::list<sax::Token>& input) { return FromXMLParsers::symbolParser.parseRankedSymbol(input); } -bool api<alphabet::RankedSymbol>::first(const std::list<sax::Token>& input) { +bool xmlApi<alphabet::RankedSymbol>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::ALPHABET_RANKED_SYMBOL); } -std::list<sax::Token> api<alphabet::RankedSymbol>::compose(const alphabet::RankedSymbol& data) { +std::list<sax::Token> xmlApi<alphabet::RankedSymbol>::compose(const alphabet::RankedSymbol& data) { return ToXMLComposers::symbolComposer.compose(data); } -alphabet::BarSymbol api<alphabet::BarSymbol>::parse(std::list<sax::Token>& input) { +alphabet::BarSymbol xmlApi<alphabet::BarSymbol>::parse(std::list<sax::Token>& input) { return FromXMLParsers::symbolParser.parseBarSymbol(input); } -bool api<alphabet::BarSymbol>::first(const std::list<sax::Token>& input) { +bool xmlApi<alphabet::BarSymbol>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::ALPHABET_BAR_SYMBOL); } -std::list<sax::Token> api<alphabet::BarSymbol>::compose(const alphabet::BarSymbol& data) { +std::list<sax::Token> xmlApi<alphabet::BarSymbol>::compose(const alphabet::BarSymbol& data) { return ToXMLComposers::symbolComposer.compose(data); } -alphabet::RankedBarSymbol api<alphabet::RankedBarSymbol>::parse(std::list<sax::Token>& input) { +alphabet::RankedBarSymbol xmlApi<alphabet::RankedBarSymbol>::parse(std::list<sax::Token>& input) { return FromXMLParsers::symbolParser.parseRankedBarSymbol(input); } -bool api<alphabet::RankedBarSymbol>::first(const std::list<sax::Token>& input) { +bool xmlApi<alphabet::RankedBarSymbol>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::ALPHABET_RANKED_BAR_SYMBOL); } -std::list<sax::Token> api<alphabet::RankedBarSymbol>::compose(const alphabet::RankedBarSymbol& data) { +std::list<sax::Token> xmlApi<alphabet::RankedBarSymbol>::compose(const alphabet::RankedBarSymbol& data) { return ToXMLComposers::symbolComposer.compose(data); } -alphabet::SubtreeWildcardSymbol api<alphabet::SubtreeWildcardSymbol>::parse(std::list<sax::Token>& input) { +alphabet::SubtreeWildcardSymbol xmlApi<alphabet::SubtreeWildcardSymbol>::parse(std::list<sax::Token>& input) { return FromXMLParsers::symbolParser.parseSubtreeWildcardSymbol(input); } -bool api<alphabet::SubtreeWildcardSymbol>::first(const std::list<sax::Token>& input) { +bool xmlApi<alphabet::SubtreeWildcardSymbol>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::ALPHABET_SUBTREE_WILDCARD_SYMBOL); } -std::list<sax::Token> api<alphabet::SubtreeWildcardSymbol>::compose(const alphabet::SubtreeWildcardSymbol& data) { +std::list<sax::Token> xmlApi<alphabet::SubtreeWildcardSymbol>::compose(const alphabet::SubtreeWildcardSymbol& data) { return ToXMLComposers::symbolComposer.compose(data); } -alphabet::SymbolSetSymbol api<alphabet::SymbolSetSymbol>::parse(std::list<sax::Token>& input) { +alphabet::SymbolSetSymbol xmlApi<alphabet::SymbolSetSymbol>::parse(std::list<sax::Token>& input) { return FromXMLParsers::symbolParser.parseSymbolSetSymbol(input); } -bool api<alphabet::SymbolSetSymbol>::first(const std::list<sax::Token>& input) { +bool xmlApi<alphabet::SymbolSetSymbol>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::ALPHABET_SYMBOL_SET_SYMBOL); } -std::list<sax::Token> api<alphabet::SymbolSetSymbol>::compose(const alphabet::SymbolSetSymbol& data) { +std::list<sax::Token> xmlApi<alphabet::SymbolSetSymbol>::compose(const alphabet::SymbolSetSymbol& data) { return ToXMLComposers::symbolComposer.compose(data); } -alphabet::SymbolPairSymbol api<alphabet::SymbolPairSymbol>::parse(std::list<sax::Token>& input) { +alphabet::SymbolPairSymbol xmlApi<alphabet::SymbolPairSymbol>::parse(std::list<sax::Token>& input) { return FromXMLParsers::symbolParser.parseSymbolPairSymbol(input); } -bool api<alphabet::SymbolPairSymbol>::first(const std::list<sax::Token>& input) { +bool xmlApi<alphabet::SymbolPairSymbol>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::ALPHABET_SYMBOL_PAIR_SYMBOL); } -std::list<sax::Token> api<alphabet::SymbolPairSymbol>::compose(const alphabet::SymbolPairSymbol& data) { +std::list<sax::Token> xmlApi<alphabet::SymbolPairSymbol>::compose(const alphabet::SymbolPairSymbol& data) { return ToXMLComposers::symbolComposer.compose(data); } -alphabet::UniqueSymbol api<alphabet::UniqueSymbol>::parse(std::list<sax::Token>& input) { +alphabet::UniqueSymbol xmlApi<alphabet::UniqueSymbol>::parse(std::list<sax::Token>& input) { return FromXMLParsers::symbolParser.parseUniqueSymbol(input); } -bool api<alphabet::UniqueSymbol>::first(const std::list<sax::Token>& input) { +bool xmlApi<alphabet::UniqueSymbol>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::ALPHABET_UNIQUE_SYMBOL); } -std::list<sax::Token> api<alphabet::UniqueSymbol>::compose(const alphabet::UniqueSymbol& data) { +std::list<sax::Token> xmlApi<alphabet::UniqueSymbol>::compose(const alphabet::UniqueSymbol& data) { return ToXMLComposers::symbolComposer.compose(data); } -automaton::Automaton api<automaton::Automaton>::parse(std::list<sax::Token>& input) { +automaton::Automaton xmlApi<automaton::Automaton>::parse(std::list<sax::Token>& input) { return FromXMLParsers::automatonParser.parseAutomaton(input); } -bool api<automaton::Automaton>::first(const std::list<sax::Token>& input) { +bool xmlApi<automaton::Automaton>::first(const std::list<sax::Token>& input) { return FromXMLParsers::automatonParser.first(input); } -std::list<sax::Token> api<automaton::Automaton>::compose(const automaton::Automaton& data) { +std::list<sax::Token> xmlApi<automaton::Automaton>::compose(const automaton::Automaton& data) { return ToXMLComposers::automatonComposer.compose(data); } -automaton::EpsilonNFA api<automaton::EpsilonNFA>::parse(std::list<sax::Token>& input) { +automaton::EpsilonNFA xmlApi<automaton::EpsilonNFA>::parse(std::list<sax::Token>& input) { return FromXMLParsers::automatonParser.parseEpsilonNFA(input); } -bool api<automaton::EpsilonNFA>::first(const std::list<sax::Token>& input) { +bool xmlApi<automaton::EpsilonNFA>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::AUTOMATON_EPSILON_NFA); } -std::list<sax::Token> api<automaton::EpsilonNFA>::compose(const automaton::EpsilonNFA& data) { +std::list<sax::Token> xmlApi<automaton::EpsilonNFA>::compose(const automaton::EpsilonNFA& data) { return ToXMLComposers::automatonComposer.compose(data); } -automaton::MultiInitialStateNFA api<automaton::MultiInitialStateNFA>::parse(std::list<sax::Token>& input) { +automaton::MultiInitialStateNFA xmlApi<automaton::MultiInitialStateNFA>::parse(std::list<sax::Token>& input) { return FromXMLParsers::automatonParser.parseMultiInitialStateNFA(input); } -bool api<automaton::MultiInitialStateNFA>::first(const std::list<sax::Token>& input) { +bool xmlApi<automaton::MultiInitialStateNFA>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::AUTOMATON_MULTI_INITIAL_STATE_NFA); } -std::list<sax::Token> api<automaton::MultiInitialStateNFA>::compose(const automaton::MultiInitialStateNFA& data) { +std::list<sax::Token> xmlApi<automaton::MultiInitialStateNFA>::compose(const automaton::MultiInitialStateNFA& data) { return ToXMLComposers::automatonComposer.compose(data); } -automaton::NFA api<automaton::NFA>::parse(std::list<sax::Token>& input) { +automaton::NFA xmlApi<automaton::NFA>::parse(std::list<sax::Token>& input) { return FromXMLParsers::automatonParser.parseNFA(input); } -bool api<automaton::NFA>::first(const std::list<sax::Token>& input) { +bool xmlApi<automaton::NFA>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::AUTOMATON_NFA); } -std::list<sax::Token> api<automaton::NFA>::compose(const automaton::NFA& data) { +std::list<sax::Token> xmlApi<automaton::NFA>::compose(const automaton::NFA& data) { return ToXMLComposers::automatonComposer.compose(data); } -automaton::DFA api<automaton::DFA>::parse(std::list<sax::Token>& input) { +automaton::DFA xmlApi<automaton::DFA>::parse(std::list<sax::Token>& input) { return FromXMLParsers::automatonParser.parseDFA(input); } -bool api<automaton::DFA>::first(const std::list<sax::Token>& input) { +bool xmlApi<automaton::DFA>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::AUTOMATON_DFA); } -std::list<sax::Token> api<automaton::DFA>::compose(const automaton::DFA& data) { +std::list<sax::Token> xmlApi<automaton::DFA>::compose(const automaton::DFA& data) { return ToXMLComposers::automatonComposer.compose(data); } -automaton::ExtendedNFA api<automaton::ExtendedNFA>::parse(std::list<sax::Token>& input) { +automaton::ExtendedNFA xmlApi<automaton::ExtendedNFA>::parse(std::list<sax::Token>& input) { return FromXMLParsers::automatonParser.parseExtendedNFA(input); } -bool api<automaton::ExtendedNFA>::first(const std::list<sax::Token>& input) { +bool xmlApi<automaton::ExtendedNFA>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::AUTOMATON_EXTENDED_NFA); } -std::list<sax::Token> api<automaton::ExtendedNFA>::compose(const automaton::ExtendedNFA& data) { +std::list<sax::Token> xmlApi<automaton::ExtendedNFA>::compose(const automaton::ExtendedNFA& data) { return ToXMLComposers::automatonComposer.compose(data); } -automaton::CompactNFA api<automaton::CompactNFA>::parse(std::list<sax::Token>& input) { +automaton::CompactNFA xmlApi<automaton::CompactNFA>::parse(std::list<sax::Token>& input) { return FromXMLParsers::automatonParser.parseCompactNFA(input); } -bool api<automaton::CompactNFA>::first(const std::list<sax::Token>& input) { +bool xmlApi<automaton::CompactNFA>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::AUTOMATON_COMPACT_NFA); } -std::list<sax::Token> api<automaton::CompactNFA>::compose(const automaton::CompactNFA& data) { +std::list<sax::Token> xmlApi<automaton::CompactNFA>::compose(const automaton::CompactNFA& data) { return ToXMLComposers::automatonComposer.compose(data); } -automaton::DPDA api<automaton::DPDA>::parse(std::list<sax::Token>& input) { +automaton::DPDA xmlApi<automaton::DPDA>::parse(std::list<sax::Token>& input) { return FromXMLParsers::automatonParser.parseDPDA(input); } -bool api<automaton::DPDA>::first(const std::list<sax::Token>& input) { +bool xmlApi<automaton::DPDA>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::AUTOMATON_DPDA); } -std::list<sax::Token> api<automaton::DPDA>::compose(const automaton::DPDA& data) { +std::list<sax::Token> xmlApi<automaton::DPDA>::compose(const automaton::DPDA& data) { return ToXMLComposers::automatonComposer.compose(data); } -automaton::SinglePopDPDA api<automaton::SinglePopDPDA>::parse(std::list<sax::Token>& input) { +automaton::SinglePopDPDA xmlApi<automaton::SinglePopDPDA>::parse(std::list<sax::Token>& input) { return FromXMLParsers::automatonParser.parseSinglePopDPDA(input); } -bool api<automaton::SinglePopDPDA>::first(const std::list<sax::Token>& input) { +bool xmlApi<automaton::SinglePopDPDA>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::AUTOMATON_SINGLE_POP_DPDA); } -std::list<sax::Token> api<automaton::SinglePopDPDA>::compose(const automaton::SinglePopDPDA& data) { +std::list<sax::Token> xmlApi<automaton::SinglePopDPDA>::compose(const automaton::SinglePopDPDA& data) { return ToXMLComposers::automatonComposer.compose(data); } -automaton::InputDrivenNPDA api<automaton::InputDrivenNPDA>::parse(std::list<sax::Token>& input) { +automaton::InputDrivenNPDA xmlApi<automaton::InputDrivenNPDA>::parse(std::list<sax::Token>& input) { return FromXMLParsers::automatonParser.parseInputDrivenNPDA(input); } -bool api<automaton::InputDrivenNPDA>::first(const std::list<sax::Token>& input) { +bool xmlApi<automaton::InputDrivenNPDA>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::AUTOMATON_INPUT_DRIVEN_NPDA); } -std::list<sax::Token> api<automaton::InputDrivenNPDA>::compose(const automaton::InputDrivenNPDA& data) { +std::list<sax::Token> xmlApi<automaton::InputDrivenNPDA>::compose(const automaton::InputDrivenNPDA& data) { return ToXMLComposers::automatonComposer.compose(data); } -automaton::VisiblyPushdownDPDA api<automaton::VisiblyPushdownDPDA>::parse(std::list<sax::Token>& input) { +automaton::VisiblyPushdownDPDA xmlApi<automaton::VisiblyPushdownDPDA>::parse(std::list<sax::Token>& input) { return FromXMLParsers::automatonParser.parseVisiblyPushdownDPDA(input); } -bool api<automaton::VisiblyPushdownDPDA>::first(const std::list<sax::Token>& input) { +bool xmlApi<automaton::VisiblyPushdownDPDA>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::AUTOMATON_VISIBLY_PUSHDOWN_DPDA); } -std::list<sax::Token> api<automaton::VisiblyPushdownDPDA>::compose(const automaton::VisiblyPushdownDPDA& data) { +std::list<sax::Token> xmlApi<automaton::VisiblyPushdownDPDA>::compose(const automaton::VisiblyPushdownDPDA& data) { return ToXMLComposers::automatonComposer.compose(data); } -automaton::VisiblyPushdownNPDA api<automaton::VisiblyPushdownNPDA>::parse(std::list<sax::Token>& input) { +automaton::VisiblyPushdownNPDA xmlApi<automaton::VisiblyPushdownNPDA>::parse(std::list<sax::Token>& input) { return FromXMLParsers::automatonParser.parseVisiblyPushdownNPDA(input); } -bool api<automaton::VisiblyPushdownNPDA>::first(const std::list<sax::Token>& input) { +bool xmlApi<automaton::VisiblyPushdownNPDA>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::AUTOMATON_VISIBLY_PUSHDOWN_NPDA); } -std::list<sax::Token> api<automaton::VisiblyPushdownNPDA>::compose(const automaton::VisiblyPushdownNPDA& data) { +std::list<sax::Token> xmlApi<automaton::VisiblyPushdownNPDA>::compose(const automaton::VisiblyPushdownNPDA& data) { return ToXMLComposers::automatonComposer.compose(data); } -automaton::RealTimeHeightDeterministicDPDA api<automaton::RealTimeHeightDeterministicDPDA>::parse(std::list<sax::Token>& input) { +automaton::RealTimeHeightDeterministicDPDA xmlApi<automaton::RealTimeHeightDeterministicDPDA>::parse(std::list<sax::Token>& input) { return FromXMLParsers::automatonParser.parseRealTimeHeightDeterministicDPDA(input); } -bool api<automaton::RealTimeHeightDeterministicDPDA>::first(const std::list<sax::Token>& input) { +bool xmlApi<automaton::RealTimeHeightDeterministicDPDA>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::AUTOMATON_REAL_TIME_HEIGHT_DETERMINISTIC_DPDA); } -std::list<sax::Token> api<automaton::RealTimeHeightDeterministicDPDA>::compose(const automaton::RealTimeHeightDeterministicDPDA& data) { +std::list<sax::Token> xmlApi<automaton::RealTimeHeightDeterministicDPDA>::compose(const automaton::RealTimeHeightDeterministicDPDA& data) { return ToXMLComposers::automatonComposer.compose(data); } -automaton::RealTimeHeightDeterministicNPDA api<automaton::RealTimeHeightDeterministicNPDA>::parse(std::list<sax::Token>& input) { +automaton::RealTimeHeightDeterministicNPDA xmlApi<automaton::RealTimeHeightDeterministicNPDA>::parse(std::list<sax::Token>& input) { return FromXMLParsers::automatonParser.parseRealTimeHeightDeterministicNPDA(input); } -bool api<automaton::RealTimeHeightDeterministicNPDA>::first(const std::list<sax::Token>& input) { +bool xmlApi<automaton::RealTimeHeightDeterministicNPDA>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::AUTOMATON_REAL_TIME_HEIGHT_DETERMINISTIC_NPDA); } -std::list<sax::Token> api<automaton::RealTimeHeightDeterministicNPDA>::compose(const automaton::RealTimeHeightDeterministicNPDA& data) { +std::list<sax::Token> xmlApi<automaton::RealTimeHeightDeterministicNPDA>::compose(const automaton::RealTimeHeightDeterministicNPDA& data) { return ToXMLComposers::automatonComposer.compose(data); } -automaton::NPDA api<automaton::NPDA>::parse(std::list<sax::Token>& input) { +automaton::NPDA xmlApi<automaton::NPDA>::parse(std::list<sax::Token>& input) { return FromXMLParsers::automatonParser.parseNPDA(input); } -bool api<automaton::NPDA>::first(const std::list<sax::Token>& input) { +bool xmlApi<automaton::NPDA>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::AUTOMATON_NPDA); } -std::list<sax::Token> api<automaton::NPDA>::compose(const automaton::NPDA& data) { +std::list<sax::Token> xmlApi<automaton::NPDA>::compose(const automaton::NPDA& data) { return ToXMLComposers::automatonComposer.compose(data); } -automaton::SinglePopNPDA api<automaton::SinglePopNPDA>::parse(std::list<sax::Token>& input) { +automaton::SinglePopNPDA xmlApi<automaton::SinglePopNPDA>::parse(std::list<sax::Token>& input) { return FromXMLParsers::automatonParser.parseSinglePopNPDA(input); } -bool api<automaton::SinglePopNPDA>::first(const std::list<sax::Token>& input) { +bool xmlApi<automaton::SinglePopNPDA>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::AUTOMATON_SINGLE_POP_NPDA); } -std::list<sax::Token> api<automaton::SinglePopNPDA>::compose(const automaton::SinglePopNPDA& data) { +std::list<sax::Token> xmlApi<automaton::SinglePopNPDA>::compose(const automaton::SinglePopNPDA& data) { return ToXMLComposers::automatonComposer.compose(data); } -automaton::OneTapeDTM api<automaton::OneTapeDTM>::parse(std::list<sax::Token>& input) { +automaton::OneTapeDTM xmlApi<automaton::OneTapeDTM>::parse(std::list<sax::Token>& input) { return FromXMLParsers::automatonParser.parseOneTapeDTM(input); } -bool api<automaton::OneTapeDTM>::first(const std::list<sax::Token>& input) { +bool xmlApi<automaton::OneTapeDTM>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::AUTOMATON_ONE_TAPE_DTM); } -std::list<sax::Token> api<automaton::OneTapeDTM>::compose(const automaton::OneTapeDTM& data) { +std::list<sax::Token> xmlApi<automaton::OneTapeDTM>::compose(const automaton::OneTapeDTM& data) { return ToXMLComposers::automatonComposer.compose(data); } -automaton::State api<automaton::State>::parse(std::list<sax::Token>& input) { +automaton::State xmlApi<automaton::State>::parse(std::list<sax::Token>& input) { return FromXMLParsers::automatonParser.parseState(input); } -bool api<automaton::State>::first(const std::list<sax::Token>& input) { +bool xmlApi<automaton::State>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::AUTOMATON_STATE); } -std::list<sax::Token> api<automaton::State>::compose(const automaton::State& data) { +std::list<sax::Token> xmlApi<automaton::State>::compose(const automaton::State& data) { return ToXMLComposers::automatonComposer.compose(data); } -grammar::Grammar api<grammar::Grammar>::parse(std::list<sax::Token>& input) { +grammar::Grammar xmlApi<grammar::Grammar>::parse(std::list<sax::Token>& input) { return FromXMLParsers::grammarParser.parseGrammar(input); } -bool api<grammar::Grammar>::first(const std::list<sax::Token>& input) { +bool xmlApi<grammar::Grammar>::first(const std::list<sax::Token>& input) { return FromXMLParsers::grammarParser.first(input); } -std::list<sax::Token> api<grammar::Grammar>::compose(const grammar::Grammar& data) { +std::list<sax::Token> xmlApi<grammar::Grammar>::compose(const grammar::Grammar& data) { return ToXMLComposers::grammarComposer.compose(data); } -grammar::LeftLG api<grammar::LeftLG>::parse(std::list<sax::Token>& input) { +grammar::LeftLG xmlApi<grammar::LeftLG>::parse(std::list<sax::Token>& input) { return FromXMLParsers::grammarParser.parseLeftLG(input); } -bool api<grammar::LeftLG>::first(const std::list<sax::Token>& input) { +bool xmlApi<grammar::LeftLG>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::GRAMMAR_LEFT_LG); } -std::list<sax::Token> api<grammar::LeftLG>::compose(const grammar::LeftLG& data) { +std::list<sax::Token> xmlApi<grammar::LeftLG>::compose(const grammar::LeftLG& data) { return ToXMLComposers::grammarComposer.compose(data); } -grammar::LeftRG api<grammar::LeftRG>::parse(std::list<sax::Token>& input) { +grammar::LeftRG xmlApi<grammar::LeftRG>::parse(std::list<sax::Token>& input) { return FromXMLParsers::grammarParser.parseLeftRG(input); } -bool api<grammar::LeftRG>::first(const std::list<sax::Token>& input) { +bool xmlApi<grammar::LeftRG>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::GRAMMAR_LEFT_RG); } -std::list<sax::Token> api<grammar::LeftRG>::compose(const grammar::LeftRG& data) { +std::list<sax::Token> xmlApi<grammar::LeftRG>::compose(const grammar::LeftRG& data) { return ToXMLComposers::grammarComposer.compose(data); } -grammar::RightLG api<grammar::RightLG>::parse(std::list<sax::Token>& input) { +grammar::RightLG xmlApi<grammar::RightLG>::parse(std::list<sax::Token>& input) { return FromXMLParsers::grammarParser.parseRightLG(input); } -bool api<grammar::RightLG>::first(const std::list<sax::Token>& input) { +bool xmlApi<grammar::RightLG>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::GRAMMAR_RIGHT_LG); } -std::list<sax::Token> api<grammar::RightLG>::compose(const grammar::RightLG& data) { +std::list<sax::Token> xmlApi<grammar::RightLG>::compose(const grammar::RightLG& data) { return ToXMLComposers::grammarComposer.compose(data); } -grammar::RightRG api<grammar::RightRG>::parse(std::list<sax::Token>& input) { +grammar::RightRG xmlApi<grammar::RightRG>::parse(std::list<sax::Token>& input) { return FromXMLParsers::grammarParser.parseRightRG(input); } -bool api<grammar::RightRG>::first(const std::list<sax::Token>& input) { +bool xmlApi<grammar::RightRG>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::GRAMMAR_RIGHT_RG); } -std::list<sax::Token> api<grammar::RightRG>::compose(const grammar::RightRG& data) { +std::list<sax::Token> xmlApi<grammar::RightRG>::compose(const grammar::RightRG& data) { return ToXMLComposers::grammarComposer.compose(data); } -grammar::LG api<grammar::LG>::parse(std::list<sax::Token>& input) { +grammar::LG xmlApi<grammar::LG>::parse(std::list<sax::Token>& input) { return FromXMLParsers::grammarParser.parseLG(input); } -bool api<grammar::LG>::first(const std::list<sax::Token>& input) { +bool xmlApi<grammar::LG>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::GRAMMAR_LG); } -std::list<sax::Token> api<grammar::LG>::compose(const grammar::LG& data) { +std::list<sax::Token> xmlApi<grammar::LG>::compose(const grammar::LG& data) { return ToXMLComposers::grammarComposer.compose(data); } -grammar::CFG api<grammar::CFG>::parse(std::list<sax::Token>& input) { +grammar::CFG xmlApi<grammar::CFG>::parse(std::list<sax::Token>& input) { return FromXMLParsers::grammarParser.parseCFG(input); } -bool api<grammar::CFG>::first(const std::list<sax::Token>& input) { +bool xmlApi<grammar::CFG>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::GRAMMAR_CFG); } -std::list<sax::Token> api<grammar::CFG>::compose(const grammar::CFG& data) { +std::list<sax::Token> xmlApi<grammar::CFG>::compose(const grammar::CFG& data) { return ToXMLComposers::grammarComposer.compose(data); } -grammar::EpsilonFreeCFG api<grammar::EpsilonFreeCFG>::parse(std::list<sax::Token>& input) { +grammar::EpsilonFreeCFG xmlApi<grammar::EpsilonFreeCFG>::parse(std::list<sax::Token>& input) { return FromXMLParsers::grammarParser.parseEpsilonFreeCFG(input); } -bool api<grammar::EpsilonFreeCFG>::first(const std::list<sax::Token>& input) { +bool xmlApi<grammar::EpsilonFreeCFG>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::GRAMMAR_EPSILON_FREE_CFG); } -std::list<sax::Token> api<grammar::EpsilonFreeCFG>::compose(const grammar::EpsilonFreeCFG& data) { +std::list<sax::Token> xmlApi<grammar::EpsilonFreeCFG>::compose(const grammar::EpsilonFreeCFG& data) { return ToXMLComposers::grammarComposer.compose(data); } -grammar::CNF api<grammar::CNF>::parse(std::list<sax::Token>& input) { +grammar::CNF xmlApi<grammar::CNF>::parse(std::list<sax::Token>& input) { return FromXMLParsers::grammarParser.parseCNF(input); } -bool api<grammar::CNF>::first(const std::list<sax::Token>& input) { +bool xmlApi<grammar::CNF>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::GRAMMAR_CNF); } -std::list<sax::Token> api<grammar::CNF>::compose(const grammar::CNF& data) { +std::list<sax::Token> xmlApi<grammar::CNF>::compose(const grammar::CNF& data) { return ToXMLComposers::grammarComposer.compose(data); } -grammar::GNF api<grammar::GNF>::parse(std::list<sax::Token>& input) { +grammar::GNF xmlApi<grammar::GNF>::parse(std::list<sax::Token>& input) { return FromXMLParsers::grammarParser.parseGNF(input); } -bool api<grammar::GNF>::first(const std::list<sax::Token>& input) { +bool xmlApi<grammar::GNF>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::GRAMMAR_GNF); } -std::list<sax::Token> api<grammar::GNF>::compose(const grammar::GNF& data) { +std::list<sax::Token> xmlApi<grammar::GNF>::compose(const grammar::GNF& data) { return ToXMLComposers::grammarComposer.compose(data); } -grammar::CSG api<grammar::CSG>::parse(std::list<sax::Token>& input) { +grammar::CSG xmlApi<grammar::CSG>::parse(std::list<sax::Token>& input) { return FromXMLParsers::grammarParser.parseCSG(input); } -bool api<grammar::CSG>::first(const std::list<sax::Token>& input) { +bool xmlApi<grammar::CSG>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::GRAMMAR_CSG); } -std::list<sax::Token> api<grammar::CSG>::compose(const grammar::CSG& data) { +std::list<sax::Token> xmlApi<grammar::CSG>::compose(const grammar::CSG& data) { return ToXMLComposers::grammarComposer.compose(data); } -grammar::NonContractingGrammar api<grammar::NonContractingGrammar>::parse(std::list<sax::Token>& input) { +grammar::NonContractingGrammar xmlApi<grammar::NonContractingGrammar>::parse(std::list<sax::Token>& input) { return FromXMLParsers::grammarParser.parseNonContractingGrammar(input); } -bool api<grammar::NonContractingGrammar>::first(const std::list<sax::Token>& input) { +bool xmlApi<grammar::NonContractingGrammar>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::GRAMMAR_NON_CONTRACTING_GRAMMAR); } -std::list<sax::Token> api<grammar::NonContractingGrammar>::compose(const grammar::NonContractingGrammar& data) { +std::list<sax::Token> xmlApi<grammar::NonContractingGrammar>::compose(const grammar::NonContractingGrammar& data) { return ToXMLComposers::grammarComposer.compose(data); } -grammar::ContextPreservingUnrestrictedGrammar api<grammar::ContextPreservingUnrestrictedGrammar>::parse(std::list<sax::Token>& input) { +grammar::ContextPreservingUnrestrictedGrammar xmlApi<grammar::ContextPreservingUnrestrictedGrammar>::parse(std::list<sax::Token>& input) { return FromXMLParsers::grammarParser.parseContextPreservingUnrestrictedGrammar(input); } -bool api<grammar::ContextPreservingUnrestrictedGrammar>::first(const std::list<sax::Token>& input) { +bool xmlApi<grammar::ContextPreservingUnrestrictedGrammar>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::GRAMMAR_CONTEXT_PRESERVING_UNRESTRICTED_GRAMMAR); } -std::list<sax::Token> api<grammar::ContextPreservingUnrestrictedGrammar>::compose(const grammar::ContextPreservingUnrestrictedGrammar& data) { +std::list<sax::Token> xmlApi<grammar::ContextPreservingUnrestrictedGrammar>::compose(const grammar::ContextPreservingUnrestrictedGrammar& data) { return ToXMLComposers::grammarComposer.compose(data); } -grammar::UnrestrictedGrammar api<grammar::UnrestrictedGrammar>::parse(std::list<sax::Token>& input) { +grammar::UnrestrictedGrammar xmlApi<grammar::UnrestrictedGrammar>::parse(std::list<sax::Token>& input) { return FromXMLParsers::grammarParser.parseUnrestrictedGrammar(input); } -bool api<grammar::UnrestrictedGrammar>::first(const std::list<sax::Token>& input) { +bool xmlApi<grammar::UnrestrictedGrammar>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::GRAMMAR_UNRESTRICTED_GRAMMAR); } -std::list<sax::Token> api<grammar::UnrestrictedGrammar>::compose(const grammar::UnrestrictedGrammar& data) { +std::list<sax::Token> xmlApi<grammar::UnrestrictedGrammar>::compose(const grammar::UnrestrictedGrammar& data) { return ToXMLComposers::grammarComposer.compose(data); } -label::Label api<label::Label>::parse(std::list<sax::Token>& input) { +label::Label xmlApi<label::Label>::parse(std::list<sax::Token>& input) { return FromXMLParsers::labelParser.parseLabel(input); } -bool api<label::Label>::first(const std::list<sax::Token>& input) { +bool xmlApi<label::Label>::first(const std::list<sax::Token>& input) { return FromXMLParsers::labelParser.first(input); } -std::list<sax::Token> api<label::Label>::compose(const label::Label& data) { +std::list<sax::Token> xmlApi<label::Label>::compose(const label::Label& data) { return ToXMLComposers::labelComposer.compose(data); } -label::PrimitiveLabel api<label::PrimitiveLabel>::parse(std::list<sax::Token>& input) { +label::PrimitiveLabel xmlApi<label::PrimitiveLabel>::parse(std::list<sax::Token>& input) { return FromXMLParsers::labelParser.parsePrimitiveLabel(input); } -bool api<label::PrimitiveLabel>::first(const std::list<sax::Token>& input) { +bool xmlApi<label::PrimitiveLabel>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::LABEL_PRIMITIVE_LABEL); } -std::list<sax::Token> api<label::PrimitiveLabel>::compose(const label::PrimitiveLabel& data) { +std::list<sax::Token> xmlApi<label::PrimitiveLabel>::compose(const label::PrimitiveLabel& data) { return ToXMLComposers::labelComposer.compose(data); } -label::HexavigesimalLabel api<label::HexavigesimalLabel>::parse(std::list<sax::Token>& input) { +label::HexavigesimalLabel xmlApi<label::HexavigesimalLabel>::parse(std::list<sax::Token>& input) { return FromXMLParsers::labelParser.parseHexavigesimalLabel(input); } -bool api<label::HexavigesimalLabel>::first(const std::list<sax::Token>& input) { +bool xmlApi<label::HexavigesimalLabel>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::LABEL_PRIMITIVE_LABEL); } -std::list<sax::Token> api<label::HexavigesimalLabel>::compose(const label::HexavigesimalLabel& data) { +std::list<sax::Token> xmlApi<label::HexavigesimalLabel>::compose(const label::HexavigesimalLabel& data) { return ToXMLComposers::labelComposer.compose(data); } -label::ObjectLabel api<label::ObjectLabel>::parse(std::list<sax::Token>& input) { +label::ObjectLabel xmlApi<label::ObjectLabel>::parse(std::list<sax::Token>& input) { return FromXMLParsers::labelParser.parseObjectLabel(input); } -bool api<label::ObjectLabel>::first(const std::list<sax::Token>& input) { +bool xmlApi<label::ObjectLabel>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::LABEL_OBJECT_LABEL); } -std::list<sax::Token> api<label::ObjectLabel>::compose(const label::ObjectLabel& data) { +std::list<sax::Token> xmlApi<label::ObjectLabel>::compose(const label::ObjectLabel& data) { return ToXMLComposers::labelComposer.compose(data); } -label::LabelSetLabel api<label::LabelSetLabel>::parse(std::list<sax::Token>& input) { +label::LabelSetLabel xmlApi<label::LabelSetLabel>::parse(std::list<sax::Token>& input) { return FromXMLParsers::labelParser.parseLabelSetLabel(input); } -bool api<label::LabelSetLabel>::first(const std::list<sax::Token>& input) { +bool xmlApi<label::LabelSetLabel>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::LABEL_LABEL_SET_LABEL); } -std::list<sax::Token> api<label::LabelSetLabel>::compose(const label::LabelSetLabel& data) { +std::list<sax::Token> xmlApi<label::LabelSetLabel>::compose(const label::LabelSetLabel& data) { return ToXMLComposers::labelComposer.compose(data); } -label::LabelPairLabel api<label::LabelPairLabel>::parse(std::list<sax::Token>& input) { +label::LabelPairLabel xmlApi<label::LabelPairLabel>::parse(std::list<sax::Token>& input) { return FromXMLParsers::labelParser.parseLabelPairLabel(input); } -bool api<label::LabelPairLabel>::first(const std::list<sax::Token>& input) { +bool xmlApi<label::LabelPairLabel>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::LABEL_LABEL_PAIR_LABEL); } -std::list<sax::Token> api<label::LabelPairLabel>::compose(const label::LabelPairLabel& data) { +std::list<sax::Token> xmlApi<label::LabelPairLabel>::compose(const label::LabelPairLabel& data) { return ToXMLComposers::labelComposer.compose(data); } -label::UniqueLabel api<label::UniqueLabel>::parse(std::list<sax::Token>& input) { +label::UniqueLabel xmlApi<label::UniqueLabel>::parse(std::list<sax::Token>& input) { return FromXMLParsers::labelParser.parseUniqueLabel(input); } -bool api<label::UniqueLabel>::first(const std::list<sax::Token>& input) { +bool xmlApi<label::UniqueLabel>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::LABEL_UNIQUE_LABEL); } -std::list<sax::Token> api<label::UniqueLabel>::compose(const label::UniqueLabel& data) { +std::list<sax::Token> xmlApi<label::UniqueLabel>::compose(const label::UniqueLabel& data) { return ToXMLComposers::labelComposer.compose(data); } -regexp::RegExp api<regexp::RegExp>::parse(std::list<sax::Token>& input) { +regexp::RegExp xmlApi<regexp::RegExp>::parse(std::list<sax::Token>& input) { return FromXMLParsers::regexpParser.parseRegExp(input); } -bool api<regexp::RegExp>::first(const std::list<sax::Token>& input) { +bool xmlApi<regexp::RegExp>::first(const std::list<sax::Token>& input) { return FromXMLParsers::regexpParser.first(input); } -std::list<sax::Token> api<regexp::RegExp>::compose(const regexp::RegExp& data) { +std::list<sax::Token> xmlApi<regexp::RegExp>::compose(const regexp::RegExp& data) { return ToXMLComposers::regexpComposer.compose(data); } -regexp::UnboundedRegExp api<regexp::UnboundedRegExp>::parse(std::list<sax::Token>& input) { +regexp::UnboundedRegExp xmlApi<regexp::UnboundedRegExp>::parse(std::list<sax::Token>& input) { return FromXMLParsers::regexpParser.parseUnboundedRegExp(input); } -bool api<regexp::UnboundedRegExp>::first(const std::list<sax::Token>& input) { +bool xmlApi<regexp::UnboundedRegExp>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::REGEXP_UNBOUNDED_REGEXP); } -std::list<sax::Token> api<regexp::UnboundedRegExp>::compose(const regexp::UnboundedRegExp& data) { +std::list<sax::Token> xmlApi<regexp::UnboundedRegExp>::compose(const regexp::UnboundedRegExp& data) { return ToXMLComposers::regexpComposer.compose(data); } -regexp::FormalRegExp api<regexp::FormalRegExp>::parse(std::list<sax::Token>& input) { +regexp::FormalRegExp xmlApi<regexp::FormalRegExp>::parse(std::list<sax::Token>& input) { return FromXMLParsers::regexpParser.parseFormalRegExp(input); } -bool api<regexp::FormalRegExp>::first(const std::list<sax::Token>& input) { +bool xmlApi<regexp::FormalRegExp>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::REGEXP_FORMAL_REGEXP); } -std::list<sax::Token> api<regexp::FormalRegExp>::compose(const regexp::FormalRegExp& data) { +std::list<sax::Token> xmlApi<regexp::FormalRegExp>::compose(const regexp::FormalRegExp& data) { return ToXMLComposers::regexpComposer.compose(data); } -string::String api<string::String>::parse(std::list<sax::Token>& input) { +string::String xmlApi<string::String>::parse(std::list<sax::Token>& input) { return FromXMLParsers::stringParser.parseString(input); } -bool api<string::String>::first(const std::list<sax::Token>& input) { +bool xmlApi<string::String>::first(const std::list<sax::Token>& input) { return FromXMLParsers::stringParser.first(input); } -std::list<sax::Token> api<string::String>::compose(const string::String& data) { +std::list<sax::Token> xmlApi<string::String>::compose(const string::String& data) { return ToXMLComposers::stringComposer.compose(data); } -string::LinearString api<string::LinearString>::parse(std::list<sax::Token>& input) { +string::LinearString xmlApi<string::LinearString>::parse(std::list<sax::Token>& input) { return FromXMLParsers::stringParser.parseLinearString(input); } -bool api<string::LinearString>::first(const std::list<sax::Token>& input) { +bool xmlApi<string::LinearString>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::STRING_LINEAR_STRING); } -std::list<sax::Token> api<string::LinearString>::compose(const string::LinearString& data) { +std::list<sax::Token> xmlApi<string::LinearString>::compose(const string::LinearString& data) { return ToXMLComposers::stringComposer.compose(data); } -string::CyclicString api<string::CyclicString>::parse(std::list<sax::Token>& input) { +string::CyclicString xmlApi<string::CyclicString>::parse(std::list<sax::Token>& input) { return FromXMLParsers::stringParser.parseCyclicString(input); } -bool api<string::CyclicString>::first(const std::list<sax::Token>& input) { +bool xmlApi<string::CyclicString>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::STRING_CYCLIC_STRING); } -std::list<sax::Token> api<string::CyclicString>::compose(const string::CyclicString& data) { +std::list<sax::Token> xmlApi<string::CyclicString>::compose(const string::CyclicString& data) { return ToXMLComposers::stringComposer.compose(data); } -string::Epsilon api<string::Epsilon>::parse(std::list<sax::Token>& input) { +string::Epsilon xmlApi<string::Epsilon>::parse(std::list<sax::Token>& input) { return FromXMLParsers::stringParser.parseEpsilon(input); } -bool api<string::Epsilon>::first(const std::list<sax::Token>& input) { +bool xmlApi<string::Epsilon>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::STRING_EPSILON); } -std::list<sax::Token> api<string::Epsilon>::compose(const string::Epsilon& data) { +std::list<sax::Token> xmlApi<string::Epsilon>::compose(const string::Epsilon& data) { return ToXMLComposers::stringComposer.compose(data); } -primitive::Primitive api<primitive::Primitive>::parse(std::list<sax::Token>& input) { +primitive::Primitive xmlApi<primitive::Primitive>::parse(std::list<sax::Token>& input) { return FromXMLParsers::primitiveParser.parsePrimitive(input); } -bool api<primitive::Primitive>::first(const std::list<sax::Token>& input) { +bool xmlApi<primitive::Primitive>::first(const std::list<sax::Token>& input) { return FromXMLParsers::primitiveParser.first(input); } -std::list<sax::Token> api<primitive::Primitive>::compose(const primitive::Primitive& data) { +std::list<sax::Token> xmlApi<primitive::Primitive>::compose(const primitive::Primitive& data) { return ToXMLComposers::primitiveComposer.compose(data); } -primitive::String api<primitive::String>::parse(std::list<sax::Token>& input) { +primitive::String xmlApi<primitive::String>::parse(std::list<sax::Token>& input) { return FromXMLParsers::primitiveParser.parseString(input); } -bool api<primitive::String>::first(const std::list<sax::Token>& input) { +bool xmlApi<primitive::String>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::PRIMITIVE_STRING); } -std::list<sax::Token> api<primitive::String>::compose(const primitive::String& data) { +std::list<sax::Token> xmlApi<primitive::String>::compose(const primitive::String& data) { return ToXMLComposers::primitiveComposer.compose(data); } -std::string api<std::string>::parse(std::list<sax::Token>& input) { +std::string xmlApi<std::string>::parse(std::list<sax::Token>& input) { return FromXMLParsers::primitiveParser.parseStringRaw(input); } -bool api<std::string>::first(const std::list<sax::Token>& input) { +bool xmlApi<std::string>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::PRIMITIVE_STRING); } -std::list<sax::Token> api<std::string>::compose(const std::string& data) { +std::list<sax::Token> xmlApi<std::string>::compose(const std::string& data) { return ToXMLComposers::primitiveComposer.compose(data); } -primitive::Integer api<primitive::Integer>::parse(std::list<sax::Token>& input) { +primitive::Integer xmlApi<primitive::Integer>::parse(std::list<sax::Token>& input) { return FromXMLParsers::primitiveParser.parseInteger(input); } -bool api<primitive::Integer>::first(const std::list<sax::Token>& input) { +bool xmlApi<primitive::Integer>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::PRIMITIVE_INTEGER); } -std::list<sax::Token> api<primitive::Integer>::compose(const primitive::Integer& data) { +std::list<sax::Token> xmlApi<primitive::Integer>::compose(const primitive::Integer& data) { return ToXMLComposers::primitiveComposer.compose(data); } -int api<int>::parse(std::list<sax::Token>& input) { +int xmlApi<int>::parse(std::list<sax::Token>& input) { return FromXMLParsers::primitiveParser.parseIntegerRaw(input); } -bool api<int>::first(const std::list<sax::Token>& input) { +bool xmlApi<int>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::PRIMITIVE_INTEGER); } -std::list<sax::Token> api<int>::compose(int data) { +std::list<sax::Token> xmlApi<int>::compose(int data) { return ToXMLComposers::primitiveComposer.compose(data); } -primitive::Character api<primitive::Character>::parse(std::list<sax::Token>& input) { +primitive::Character xmlApi<primitive::Character>::parse(std::list<sax::Token>& input) { return FromXMLParsers::primitiveParser.parseCharacter(input); } -bool api<primitive::Character>::first(const std::list<sax::Token>& input) { +bool xmlApi<primitive::Character>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::PRIMITIVE_CHARACTER); } -std::list<sax::Token> api<primitive::Character>::compose(const primitive::Character& data) { +std::list<sax::Token> xmlApi<primitive::Character>::compose(const primitive::Character& data) { return ToXMLComposers::primitiveComposer.compose(data); } -char api<char>::parse(std::list<sax::Token>& input) { +char xmlApi<char>::parse(std::list<sax::Token>& input) { return FromXMLParsers::primitiveParser.parseCharacterRaw(input); } -bool api<char>::first(const std::list<sax::Token>& input) { +bool xmlApi<char>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::PRIMITIVE_CHARACTER); } -std::list<sax::Token> api<char>::compose(char data) { +std::list<sax::Token> xmlApi<char>::compose(char data) { return ToXMLComposers::primitiveComposer.compose(data); } -unsigned api<unsigned>::parse(std::list<sax::Token>& input) { +unsigned xmlApi<unsigned>::parse(std::list<sax::Token>& input) { return FromXMLParsers::primitiveParser.parseCharacterRaw(input); } -bool api<unsigned>::first(const std::list<sax::Token>& input) { +bool xmlApi<unsigned>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::PRIMITIVE_CHARACTER); } -std::list<sax::Token> api<unsigned>::compose(unsigned data) { +std::list<sax::Token> xmlApi<unsigned>::compose(unsigned data) { return ToXMLComposers::primitiveComposer.compose(data); } -bool api<bool>::parse(std::list<sax::Token>& input) { +bool xmlApi<bool>::parse(std::list<sax::Token>& input) { return FromXMLParsers::primitiveParser.parseCharacterRaw(input); } -bool api<bool>::first(const std::list<sax::Token>& input) { +bool xmlApi<bool>::first(const std::list<sax::Token>& input) { return sax::FromXMLParserHelper::isToken(input, sax::Token::TokenType::START_ELEMENT, Names::PRIMITIVE_CHARACTER); } -std::list<sax::Token> api<bool>::compose(bool data) { +std::list<sax::Token> xmlApi<bool>::compose(bool data) { return ToXMLComposers::primitiveComposer.compose(data); } void ToXMLComposers::Visit(void* data, const Void& voidObject) const { - *((std::list<sax::Token>*) data) = std::move(api<Void>::compose(voidObject)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<Void>::compose(voidObject)); } void ToXMLComposers::Visit(void* data, const container::ObjectsSet& container) const { - *((std::list<sax::Token>*) data) = std::move(api<container::ObjectsSet>::compose(container)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<container::ObjectsSet>::compose(container)); } void ToXMLComposers::Visit(void* data, const container::ObjectsVector& container) const { - *((std::list<sax::Token>*) data) = std::move(api<container::ObjectsVector>::compose(container)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<container::ObjectsVector>::compose(container)); } void ToXMLComposers::Visit(void* data, const container::ObjectsPair& container) const { - *((std::list<sax::Token>*) data) = std::move(api<container::ObjectsPair>::compose(container)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<container::ObjectsPair>::compose(container)); } void ToXMLComposers::Visit(void* data, const container::ObjectsMap& container) const { - *((std::list<sax::Token>*) data) = std::move(api<container::ObjectsMap>::compose(container)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<container::ObjectsMap>::compose(container)); } void ToXMLComposers::Visit(void* data, const exception::AlibException& symbol) const { - *((std::list<sax::Token>*) data) = std::move(api<exception::AlibException>::compose(symbol)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<exception::AlibException>::compose(symbol)); } void ToXMLComposers::Visit(void* data, const alphabet::BlankSymbol& symbol) const { - *((std::list<sax::Token>*) data) = std::move(api<alphabet::BlankSymbol>::compose(symbol)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<alphabet::BlankSymbol>::compose(symbol)); } void ToXMLComposers::Visit(void* data, const alphabet::BottomOfTheStackSymbol& symbol) const { - *((std::list<sax::Token>*) data) = std::move(api<alphabet::BottomOfTheStackSymbol>::compose(symbol)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<alphabet::BottomOfTheStackSymbol>::compose(symbol)); } void ToXMLComposers::Visit(void* data, const alphabet::EndSymbol& symbol) const { - *((std::list<sax::Token>*) data) = std::move(api<alphabet::EndSymbol>::compose(symbol)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<alphabet::EndSymbol>::compose(symbol)); } void ToXMLComposers::Visit(void* data, const alphabet::StartSymbol& symbol) const { - *((std::list<sax::Token>*) data) = std::move(api<alphabet::StartSymbol>::compose(symbol)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<alphabet::StartSymbol>::compose(symbol)); } void ToXMLComposers::Visit(void* data, const alphabet::RankedSymbol& symbol) const { - *((std::list<sax::Token>*) data) = std::move(api<alphabet::RankedSymbol>::compose(symbol)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<alphabet::RankedSymbol>::compose(symbol)); } void ToXMLComposers::Visit(void* data, const alphabet::BarSymbol& symbol) const { - *((std::list<sax::Token>*) data) = std::move(api<alphabet::BarSymbol>::compose(symbol)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<alphabet::BarSymbol>::compose(symbol)); } void ToXMLComposers::Visit(void* data, const alphabet::RankedBarSymbol& symbol) const { - *((std::list<sax::Token>*) data) = std::move(api<alphabet::RankedBarSymbol>::compose(symbol)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<alphabet::RankedBarSymbol>::compose(symbol)); } void ToXMLComposers::Visit(void* data, const alphabet::SubtreeWildcardSymbol& symbol) const { - *((std::list<sax::Token>*) data) = std::move(api<alphabet::SubtreeWildcardSymbol>::compose(symbol)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<alphabet::SubtreeWildcardSymbol>::compose(symbol)); } void ToXMLComposers::Visit(void* data, const alphabet::LabeledSymbol& symbol) const { - *((std::list<sax::Token>*) data) = std::move(api<alphabet::LabeledSymbol>::compose(symbol)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<alphabet::LabeledSymbol>::compose(symbol)); } void ToXMLComposers::Visit(void* data, const alphabet::SymbolSetSymbol& symbol) const { - *((std::list<sax::Token>*) data) = std::move(api<alphabet::SymbolSetSymbol>::compose(symbol)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<alphabet::SymbolSetSymbol>::compose(symbol)); } void ToXMLComposers::Visit(void* data, const alphabet::SymbolPairSymbol& symbol) const { - *((std::list<sax::Token>*) data) = std::move(api<alphabet::SymbolPairSymbol>::compose(symbol)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<alphabet::SymbolPairSymbol>::compose(symbol)); } void ToXMLComposers::Visit(void* data, const alphabet::UniqueSymbol& symbol) const { - *((std::list<sax::Token>*) data) = std::move(api<alphabet::UniqueSymbol>::compose(symbol)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<alphabet::UniqueSymbol>::compose(symbol)); } void ToXMLComposers::Visit(void* data, const automaton::EpsilonNFA& automaton) const { - *((std::list<sax::Token>*) data) = std::move(api<automaton::EpsilonNFA>::compose(automaton)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<automaton::EpsilonNFA>::compose(automaton)); } void ToXMLComposers::Visit(void* data, const automaton::MultiInitialStateNFA& automaton) const { - *((std::list<sax::Token>*) data) = std::move(api<automaton::MultiInitialStateNFA>::compose(automaton)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<automaton::MultiInitialStateNFA>::compose(automaton)); } void ToXMLComposers::Visit(void* data, const automaton::NFA& automaton) const { - *((std::list<sax::Token>*) data) = std::move(api<automaton::NFA>::compose(automaton)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<automaton::NFA>::compose(automaton)); } void ToXMLComposers::Visit(void* data, const automaton::DFA& automaton) const { - *((std::list<sax::Token>*) data) = std::move(api<automaton::DFA>::compose(automaton)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<automaton::DFA>::compose(automaton)); } void ToXMLComposers::Visit(void* data, const automaton::ExtendedNFA& automaton) const { - *((std::list<sax::Token>*) data) = std::move(api<automaton::ExtendedNFA>::compose(automaton)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<automaton::ExtendedNFA>::compose(automaton)); } void ToXMLComposers::Visit(void* data, const automaton::CompactNFA& automaton) const { - *((std::list<sax::Token>*) data) = std::move(api<automaton::CompactNFA>::compose(automaton)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<automaton::CompactNFA>::compose(automaton)); } void ToXMLComposers::Visit(void* data, const automaton::DPDA& automaton) const { - *((std::list<sax::Token>*) data) = std::move(api<automaton::DPDA>::compose(automaton)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<automaton::DPDA>::compose(automaton)); } void ToXMLComposers::Visit(void* data, const automaton::SinglePopDPDA& automaton) const { - *((std::list<sax::Token>*) data) = std::move(api<automaton::SinglePopDPDA>::compose(automaton)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<automaton::SinglePopDPDA>::compose(automaton)); } void ToXMLComposers::Visit(void* data, const automaton::InputDrivenNPDA& automaton) const { - *((std::list<sax::Token>*) data) = std::move(api<automaton::InputDrivenNPDA>::compose(automaton)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<automaton::InputDrivenNPDA>::compose(automaton)); } void ToXMLComposers::Visit(void* data, const automaton::VisiblyPushdownDPDA& automaton) const { - *((std::list<sax::Token>*) data) = std::move(api<automaton::VisiblyPushdownDPDA>::compose(automaton)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<automaton::VisiblyPushdownDPDA>::compose(automaton)); } void ToXMLComposers::Visit(void* data, const automaton::VisiblyPushdownNPDA& automaton) const { - *((std::list<sax::Token>*) data) = std::move(api<automaton::VisiblyPushdownNPDA>::compose(automaton)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<automaton::VisiblyPushdownNPDA>::compose(automaton)); } void ToXMLComposers::Visit(void* data, const automaton::RealTimeHeightDeterministicDPDA& automaton) const { - *((std::list<sax::Token>*) data) = std::move(api<automaton::RealTimeHeightDeterministicDPDA>::compose(automaton)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<automaton::RealTimeHeightDeterministicDPDA>::compose(automaton)); } void ToXMLComposers::Visit(void* data, const automaton::RealTimeHeightDeterministicNPDA& automaton) const { - *((std::list<sax::Token>*) data) = std::move(api<automaton::RealTimeHeightDeterministicNPDA>::compose(automaton)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<automaton::RealTimeHeightDeterministicNPDA>::compose(automaton)); } void ToXMLComposers::Visit(void* data, const automaton::NPDA& automaton) const { - *((std::list<sax::Token>*) data) = std::move(api<automaton::NPDA>::compose(automaton)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<automaton::NPDA>::compose(automaton)); } void ToXMLComposers::Visit(void* data, const automaton::SinglePopNPDA& automaton) const { - *((std::list<sax::Token>*) data) = std::move(api<automaton::SinglePopNPDA>::compose(automaton)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<automaton::SinglePopNPDA>::compose(automaton)); } void ToXMLComposers::Visit(void* data, const automaton::OneTapeDTM& automaton) const { - *((std::list<sax::Token>*) data) = std::move(api<automaton::OneTapeDTM>::compose(automaton)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<automaton::OneTapeDTM>::compose(automaton)); } void ToXMLComposers::Visit(void* data, const grammar::LeftLG& grammar) const { - *((std::list<sax::Token>*) data) = std::move(api<grammar::LeftLG>::compose(grammar)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<grammar::LeftLG>::compose(grammar)); } void ToXMLComposers::Visit(void* data, const grammar::LeftRG& grammar) const { - *((std::list<sax::Token>*) data) = std::move(api<grammar::LeftRG>::compose(grammar)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<grammar::LeftRG>::compose(grammar)); } void ToXMLComposers::Visit(void* data, const grammar::RightLG& grammar) const { - *((std::list<sax::Token>*) data) = std::move(api<grammar::RightLG>::compose(grammar)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<grammar::RightLG>::compose(grammar)); } void ToXMLComposers::Visit(void* data, const grammar::RightRG& grammar) const { - *((std::list<sax::Token>*) data) = std::move(api<grammar::RightRG>::compose(grammar)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<grammar::RightRG>::compose(grammar)); } void ToXMLComposers::Visit(void* data, const grammar::LG& grammar) const { - *((std::list<sax::Token>*) data) = std::move(api<grammar::LG>::compose(grammar)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<grammar::LG>::compose(grammar)); } void ToXMLComposers::Visit(void* data, const grammar::CFG& grammar) const { - *((std::list<sax::Token>*) data) = std::move(api<grammar::CFG>::compose(grammar)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<grammar::CFG>::compose(grammar)); } void ToXMLComposers::Visit(void* data, const grammar::EpsilonFreeCFG& grammar) const { - *((std::list<sax::Token>*) data) = std::move(api<grammar::EpsilonFreeCFG>::compose(grammar)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<grammar::EpsilonFreeCFG>::compose(grammar)); } void ToXMLComposers::Visit(void* data, const grammar::CNF& grammar) const { - *((std::list<sax::Token>*) data) = std::move(api<grammar::CNF>::compose(grammar)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<grammar::CNF>::compose(grammar)); } void ToXMLComposers::Visit(void* data, const grammar::GNF& grammar) const { - *((std::list<sax::Token>*) data) = std::move(api<grammar::GNF>::compose(grammar)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<grammar::GNF>::compose(grammar)); } void ToXMLComposers::Visit(void* data, const grammar::CSG& grammar) const { - *((std::list<sax::Token>*) data) = std::move(api<grammar::CSG>::compose(grammar)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<grammar::CSG>::compose(grammar)); } void ToXMLComposers::Visit(void* data, const grammar::NonContractingGrammar& grammar) const { - *((std::list<sax::Token>*) data) = std::move(api<grammar::NonContractingGrammar>::compose(grammar)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<grammar::NonContractingGrammar>::compose(grammar)); } void ToXMLComposers::Visit(void* data, const grammar::ContextPreservingUnrestrictedGrammar& grammar) const { - *((std::list<sax::Token>*) data) = std::move(api<grammar::ContextPreservingUnrestrictedGrammar>::compose(grammar)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<grammar::ContextPreservingUnrestrictedGrammar>::compose(grammar)); } void ToXMLComposers::Visit(void* data, const grammar::UnrestrictedGrammar& grammar) const { - *((std::list<sax::Token>*) data) = std::move(api<grammar::UnrestrictedGrammar>::compose(grammar)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<grammar::UnrestrictedGrammar>::compose(grammar)); } void ToXMLComposers::Visit(void* data, const label::PrimitiveLabel& label) const { - *((std::list<sax::Token>*) data) = std::move(api<label::PrimitiveLabel>::compose(label)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<label::PrimitiveLabel>::compose(label)); } void ToXMLComposers::Visit(void* data, const label::HexavigesimalLabel& label) const { - *((std::list<sax::Token>*) data) = std::move(api<label::HexavigesimalLabel>::compose(label)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<label::HexavigesimalLabel>::compose(label)); } void ToXMLComposers::Visit(void* data, const label::ObjectLabel& label) const { - *((std::list<sax::Token>*) data) = std::move(api<label::ObjectLabel>::compose(label)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<label::ObjectLabel>::compose(label)); } void ToXMLComposers::Visit(void* data, const label::LabelSetLabel& label) const { - *((std::list<sax::Token>*) data) = std::move(api<label::LabelSetLabel>::compose(label)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<label::LabelSetLabel>::compose(label)); } void ToXMLComposers::Visit(void* data, const label::LabelPairLabel& label) const { - *((std::list<sax::Token>*) data) = std::move(api<label::LabelPairLabel>::compose(label)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<label::LabelPairLabel>::compose(label)); } void ToXMLComposers::Visit(void* data, const label::UniqueLabel& label) const { - *((std::list<sax::Token>*) data) = std::move(api<label::UniqueLabel>::compose(label)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<label::UniqueLabel>::compose(label)); } void ToXMLComposers::Visit(void* data, const regexp::UnboundedRegExp& regexp) const { - *((std::list<sax::Token>*) data) = std::move(api<regexp::UnboundedRegExp>::compose(regexp)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<regexp::UnboundedRegExp>::compose(regexp)); } void ToXMLComposers::Visit(void* data, const regexp::FormalRegExp& regexp) const { - *((std::list<sax::Token>*) data) = std::move(api<regexp::FormalRegExp>::compose(regexp)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<regexp::FormalRegExp>::compose(regexp)); } void ToXMLComposers::Visit(void* data, const string::Epsilon& string) const { - *((std::list<sax::Token>*) data) = std::move(api<string::Epsilon>::compose(string)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<string::Epsilon>::compose(string)); } void ToXMLComposers::Visit(void* data, const string::CyclicString& string) const { - *((std::list<sax::Token>*) data) = std::move(api<string::CyclicString>::compose(string)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<string::CyclicString>::compose(string)); } void ToXMLComposers::Visit(void* data, const string::LinearString& string) const { - *((std::list<sax::Token>*) data) = std::move(api<string::LinearString>::compose(string)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<string::LinearString>::compose(string)); } void ToXMLComposers::Visit(void* data, const primitive::String& primitive) const { - *((std::list<sax::Token>*) data) = std::move(api<primitive::String>::compose(primitive)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<primitive::String>::compose(primitive)); } void ToXMLComposers::Visit(void* data, const primitive::Integer& primitive) const { - *((std::list<sax::Token>*) data) = std::move(api<primitive::Integer>::compose(primitive)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<primitive::Integer>::compose(primitive)); } void ToXMLComposers::Visit(void* data, const primitive::Character& primitive) const { - *((std::list<sax::Token>*) data) = std::move(api<primitive::Character>::compose(primitive)); + *((std::list<sax::Token>*) data) = std::move(xmlApi<primitive::Character>::compose(primitive)); } } /* namespace alib */ diff --git a/alib2data/src/Api.hpp b/alib2data/src/XmlApi.hpp similarity index 87% rename from alib2data/src/Api.hpp rename to alib2data/src/XmlApi.hpp index 52ea189398..05566a23bd 100644 --- a/alib2data/src/Api.hpp +++ b/alib2data/src/XmlApi.hpp @@ -1,12 +1,12 @@ /* - * FromXMLParsers.hpp + * XmlApi.hpp * * Created on: Apr 1, 2013 * Author: Jan Travnicek */ -#ifndef FROM_XML_PARSERS_HPP_ -#define FROM_XML_PARSERS_HPP_ +#ifndef XML_API_HPP_ +#define XML_API_HPP_ #include "label/LabelFromXMLParser.h" #include "alphabet/SymbolFromXMLParser.h" @@ -103,70 +103,70 @@ public: }; template<typename T> -struct api { +struct xmlApi { static T parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const T& data); }; template<> -struct api<Void> { +struct xmlApi<Void> { static Void parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const Void& data); }; template<typename T> -struct api<std::set<T>> { +struct xmlApi<std::set<T>> { static std::set<T> parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const std::set<T>& data); }; template<> -struct api<container::ObjectsSet> { +struct xmlApi<container::ObjectsSet> { static container::ObjectsSet parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const container::ObjectsSet& data); }; template<typename T> -struct api<std::vector<T>> { +struct xmlApi<std::vector<T>> { static std::vector<T> parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const std::vector<T>& data); }; template<> -struct api<container::ObjectsVector> { +struct xmlApi<container::ObjectsVector> { static container::ObjectsVector parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const container::ObjectsVector& data); }; template<typename T, typename R> -struct api<std::pair<T, R>> { +struct xmlApi<std::pair<T, R>> { static std::pair<T, R> parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const std::pair<T, R>& data); }; template<> -struct api<container::ObjectsPair> { +struct xmlApi<container::ObjectsPair> { static container::ObjectsPair parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const container::ObjectsPair& data); }; template<typename T, typename R> -struct api<std::map<T, R>> { +struct xmlApi<std::map<T, R>> { static std::map<T, R> parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const std::map<T, R>& data); }; template<> -struct api<container::ObjectsMap> { +struct xmlApi<container::ObjectsMap> { static container::ObjectsMap parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const container::ObjectsMap& data); @@ -174,7 +174,7 @@ struct api<container::ObjectsMap> { /* TODO for gcc-4.9 uncomment template<typename ... Ts> -struct api<std::variant<Ts...>> { +struct xmlApi<std::variant<Ts...>> { static std::variant<Ts...> parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const std::variant<Ts...>& data); @@ -186,7 +186,7 @@ TODO tuple template<> -struct api<Object> { +struct xmlApi<Object> { static Object parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const Object& data); @@ -194,7 +194,7 @@ struct api<Object> { template<> -struct api<exception::AlibException> { +struct xmlApi<exception::AlibException> { static exception::AlibException parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const exception::AlibException& data); @@ -202,91 +202,91 @@ struct api<exception::AlibException> { template<> -struct api<alphabet::Symbol> { +struct xmlApi<alphabet::Symbol> { static alphabet::Symbol parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const alphabet::Symbol& data); }; template<> -struct api<alphabet::LabeledSymbol> { +struct xmlApi<alphabet::LabeledSymbol> { static alphabet::LabeledSymbol parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const alphabet::LabeledSymbol& data); }; template<> -struct api<alphabet::BlankSymbol> { +struct xmlApi<alphabet::BlankSymbol> { static alphabet::BlankSymbol parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const alphabet::BlankSymbol& data); }; template<> -struct api<alphabet::BottomOfTheStackSymbol> { +struct xmlApi<alphabet::BottomOfTheStackSymbol> { static alphabet::BottomOfTheStackSymbol parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const alphabet::BottomOfTheStackSymbol& data); }; template<> -struct api<alphabet::EndSymbol> { +struct xmlApi<alphabet::EndSymbol> { static alphabet::EndSymbol parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const alphabet::EndSymbol& data); }; template<> -struct api<alphabet::StartSymbol> { +struct xmlApi<alphabet::StartSymbol> { static alphabet::StartSymbol parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const alphabet::StartSymbol& data); }; template<> -struct api<alphabet::RankedSymbol> { +struct xmlApi<alphabet::RankedSymbol> { static alphabet::RankedSymbol parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const alphabet::RankedSymbol& data); }; template<> -struct api<alphabet::BarSymbol> { +struct xmlApi<alphabet::BarSymbol> { static alphabet::BarSymbol parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const alphabet::BarSymbol& data); }; template<> -struct api<alphabet::RankedBarSymbol> { +struct xmlApi<alphabet::RankedBarSymbol> { static alphabet::RankedBarSymbol parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const alphabet::RankedBarSymbol& data); }; template<> -struct api<alphabet::SubtreeWildcardSymbol> { +struct xmlApi<alphabet::SubtreeWildcardSymbol> { static alphabet::SubtreeWildcardSymbol parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const alphabet::SubtreeWildcardSymbol& data); }; template<> -struct api<alphabet::SymbolSetSymbol> { +struct xmlApi<alphabet::SymbolSetSymbol> { static alphabet::SymbolSetSymbol parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const alphabet::SymbolSetSymbol& data); }; template<> -struct api<alphabet::SymbolPairSymbol> { +struct xmlApi<alphabet::SymbolPairSymbol> { static alphabet::SymbolPairSymbol parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const alphabet::SymbolPairSymbol& data); }; template<> -struct api<alphabet::UniqueSymbol> { +struct xmlApi<alphabet::UniqueSymbol> { static alphabet::UniqueSymbol parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const alphabet::UniqueSymbol& data); @@ -294,224 +294,224 @@ struct api<alphabet::UniqueSymbol> { template<> -struct api<automaton::Automaton> { +struct xmlApi<automaton::Automaton> { static automaton::Automaton parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const automaton::Automaton& data); }; template<> -struct api<automaton::EpsilonNFA> { +struct xmlApi<automaton::EpsilonNFA> { static automaton::EpsilonNFA parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const automaton::EpsilonNFA& data); }; template<> -struct api<automaton::MultiInitialStateNFA> { +struct xmlApi<automaton::MultiInitialStateNFA> { static automaton::MultiInitialStateNFA parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const automaton::MultiInitialStateNFA& data); }; template<> -struct api<automaton::NFA> { +struct xmlApi<automaton::NFA> { static automaton::NFA parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const automaton::NFA& data); }; template<> -struct api<automaton::DFA> { +struct xmlApi<automaton::DFA> { static automaton::DFA parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const automaton::DFA& data); }; template<> -struct api<automaton::ExtendedNFA> { +struct xmlApi<automaton::ExtendedNFA> { static automaton::ExtendedNFA parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const automaton::ExtendedNFA& data); }; template<> -struct api<automaton::CompactNFA> { +struct xmlApi<automaton::CompactNFA> { static automaton::CompactNFA parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const automaton::CompactNFA& data); }; template<> -struct api<automaton::DPDA> { +struct xmlApi<automaton::DPDA> { static automaton::DPDA parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const automaton::DPDA& data); }; template<> -struct api<automaton::SinglePopDPDA> { +struct xmlApi<automaton::SinglePopDPDA> { static automaton::SinglePopDPDA parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const automaton::SinglePopDPDA& data); }; template<> -struct api<automaton::InputDrivenNPDA> { +struct xmlApi<automaton::InputDrivenNPDA> { static automaton::InputDrivenNPDA parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const automaton::InputDrivenNPDA& data); }; template<> -struct api<automaton::VisiblyPushdownDPDA> { +struct xmlApi<automaton::VisiblyPushdownDPDA> { static automaton::VisiblyPushdownDPDA parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const automaton::VisiblyPushdownDPDA& data); }; template<> -struct api<automaton::VisiblyPushdownNPDA> { +struct xmlApi<automaton::VisiblyPushdownNPDA> { static automaton::VisiblyPushdownNPDA parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const automaton::VisiblyPushdownNPDA& data); }; template<> -struct api<automaton::RealTimeHeightDeterministicDPDA> { +struct xmlApi<automaton::RealTimeHeightDeterministicDPDA> { static automaton::RealTimeHeightDeterministicDPDA parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const automaton::RealTimeHeightDeterministicDPDA& data); }; template<> -struct api<automaton::RealTimeHeightDeterministicNPDA> { +struct xmlApi<automaton::RealTimeHeightDeterministicNPDA> { static automaton::RealTimeHeightDeterministicNPDA parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const automaton::RealTimeHeightDeterministicNPDA& data); }; template<> -struct api<automaton::NPDA> { +struct xmlApi<automaton::NPDA> { static automaton::NPDA parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const automaton::NPDA& data); }; template<> -struct api<automaton::SinglePopNPDA> { +struct xmlApi<automaton::SinglePopNPDA> { static automaton::SinglePopNPDA parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const automaton::SinglePopNPDA& data); }; template<> -struct api<automaton::OneTapeDTM> { +struct xmlApi<automaton::OneTapeDTM> { static automaton::OneTapeDTM parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const automaton::OneTapeDTM& data); }; template<> -struct api<automaton::State> { +struct xmlApi<automaton::State> { static automaton::State parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const automaton::State& data); }; template<> -struct api<grammar::Grammar> { +struct xmlApi<grammar::Grammar> { static grammar::Grammar parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const grammar::Grammar& data); }; template<> -struct api<grammar::LeftLG> { +struct xmlApi<grammar::LeftLG> { static grammar::LeftLG parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const grammar::LeftLG& data); }; template<> -struct api<grammar::LeftRG> { +struct xmlApi<grammar::LeftRG> { static grammar::LeftRG parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const grammar::LeftRG& data); }; template<> -struct api<grammar::RightLG> { +struct xmlApi<grammar::RightLG> { static grammar::RightLG parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const grammar::RightLG& data); }; template<> -struct api<grammar::RightRG> { +struct xmlApi<grammar::RightRG> { static grammar::RightRG parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const grammar::RightRG& data); }; template<> -struct api<grammar::LG> { +struct xmlApi<grammar::LG> { static grammar::LG parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const grammar::LG& data); }; template<> -struct api<grammar::CFG> { +struct xmlApi<grammar::CFG> { static grammar::CFG parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const grammar::CFG& data); }; template<> -struct api<grammar::EpsilonFreeCFG> { +struct xmlApi<grammar::EpsilonFreeCFG> { static grammar::EpsilonFreeCFG parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const grammar::EpsilonFreeCFG& data); }; template<> -struct api<grammar::CNF> { +struct xmlApi<grammar::CNF> { static grammar::CNF parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const grammar::CNF& data); }; template<> -struct api<grammar::GNF> { +struct xmlApi<grammar::GNF> { static grammar::GNF parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const grammar::GNF& data); }; template<> -struct api<grammar::CSG> { +struct xmlApi<grammar::CSG> { static grammar::CSG parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const grammar::CSG& data); }; template<> -struct api<grammar::NonContractingGrammar> { +struct xmlApi<grammar::NonContractingGrammar> { static grammar::NonContractingGrammar parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const grammar::NonContractingGrammar& data); }; template<> -struct api<grammar::ContextPreservingUnrestrictedGrammar> { +struct xmlApi<grammar::ContextPreservingUnrestrictedGrammar> { static grammar::ContextPreservingUnrestrictedGrammar parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const grammar::ContextPreservingUnrestrictedGrammar& data); }; template<> -struct api<grammar::UnrestrictedGrammar> { +struct xmlApi<grammar::UnrestrictedGrammar> { static grammar::UnrestrictedGrammar parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const grammar::UnrestrictedGrammar& data); @@ -519,49 +519,49 @@ struct api<grammar::UnrestrictedGrammar> { template<> -struct api<label::Label> { +struct xmlApi<label::Label> { static label::Label parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const label::Label& data); }; template<> -struct api<label::PrimitiveLabel> { +struct xmlApi<label::PrimitiveLabel> { static label::PrimitiveLabel parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const label::PrimitiveLabel& data); }; template<> -struct api<label::HexavigesimalLabel> { +struct xmlApi<label::HexavigesimalLabel> { static label::HexavigesimalLabel parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const label::HexavigesimalLabel& data); }; template<> -struct api<label::ObjectLabel> { +struct xmlApi<label::ObjectLabel> { static label::ObjectLabel parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const label::ObjectLabel& data); }; template<> -struct api<label::LabelSetLabel> { +struct xmlApi<label::LabelSetLabel> { static label::LabelSetLabel parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const label::LabelSetLabel& data); }; template<> -struct api<label::LabelPairLabel> { +struct xmlApi<label::LabelPairLabel> { static label::LabelPairLabel parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const label::LabelPairLabel& data); }; template<> -struct api<label::UniqueLabel> { +struct xmlApi<label::UniqueLabel> { static label::UniqueLabel parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const label::UniqueLabel& data); @@ -569,21 +569,21 @@ struct api<label::UniqueLabel> { template<> -struct api<regexp::RegExp> { +struct xmlApi<regexp::RegExp> { static regexp::RegExp parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const regexp::RegExp& data); }; template<> -struct api<regexp::UnboundedRegExp> { +struct xmlApi<regexp::UnboundedRegExp> { static regexp::UnboundedRegExp parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const regexp::UnboundedRegExp& data); }; template<> -struct api<regexp::FormalRegExp> { +struct xmlApi<regexp::FormalRegExp> { static regexp::FormalRegExp parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const regexp::FormalRegExp& data); @@ -591,28 +591,28 @@ struct api<regexp::FormalRegExp> { template<> -struct api<string::String> { +struct xmlApi<string::String> { static string::String parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const string::String& data); }; template<> -struct api<string::LinearString> { +struct xmlApi<string::LinearString> { static string::LinearString parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const string::LinearString& data); }; template<> -struct api<string::CyclicString> { +struct xmlApi<string::CyclicString> { static string::CyclicString parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const string::CyclicString& data); }; template<> -struct api<string::Epsilon> { +struct xmlApi<string::Epsilon> { static string::Epsilon parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const string::Epsilon& data); @@ -620,63 +620,63 @@ struct api<string::Epsilon> { template<> -struct api<primitive::Primitive> { +struct xmlApi<primitive::Primitive> { static primitive::Primitive parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const primitive::Primitive& data); }; template<> -struct api<primitive::String> { +struct xmlApi<primitive::String> { static primitive::String parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const primitive::String& data); }; template<> -struct api<std::string> { +struct xmlApi<std::string> { static std::string parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const std::string& data); }; template<> -struct api<primitive::Integer> { +struct xmlApi<primitive::Integer> { static primitive::Integer parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const primitive::Integer& data); }; template<> -struct api<int> { +struct xmlApi<int> { static int parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(int data); }; template<> -struct api<primitive::Character> { +struct xmlApi<primitive::Character> { static primitive::Character parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const primitive::Character& data); }; template<> -struct api<char> { +struct xmlApi<char> { static char parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(char data); }; template<> -struct api<unsigned> { +struct xmlApi<unsigned> { static unsigned parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(unsigned data); }; template<> -struct api<bool> { +struct xmlApi<bool> { static bool parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(bool data); @@ -691,7 +691,7 @@ struct api<bool> { namespace alib { template<> -struct api<container::Container> { +struct xmlApi<container::Container> { static container::Container parse(std::list<sax::Token>& input); static bool first(const std::list<sax::Token>& input); static std::list<sax::Token> compose(const container::Container& data); @@ -804,78 +804,78 @@ public: }; template<typename T> -std::set<T> api<std::set<T>>::parse(std::list<sax::Token>& input) { +std::set<T> xmlApi<std::set<T>>::parse(std::list<sax::Token>& input) { return FromXMLParsers::containerParser.parseSet<T>(input); } template<typename T> -bool api<std::set<T>>::first(const std::list<sax::Token>& input) { +bool xmlApi<std::set<T>>::first(const std::list<sax::Token>& input) { return input.front().getType() == sax::Token::TokenType::START_ELEMENT && input.front().getData() == Names::CONTAINER_OBJECTS_SET; } template<typename T> -std::list<sax::Token> api<std::set<T>>::compose(const std::set<T>& input) { +std::list<sax::Token> xmlApi<std::set<T>>::compose(const std::set<T>& input) { return ToXMLComposers::containerComposer.compose<T>(input); } template<typename T> -std::vector<T> api<std::vector<T>>::parse(std::list<sax::Token>& input) { +std::vector<T> xmlApi<std::vector<T>>::parse(std::list<sax::Token>& input) { return FromXMLParsers::containerParser.parseVector<T>(input); } template<typename T> -bool api<std::vector<T>>::first(const std::list<sax::Token>& input) { +bool xmlApi<std::vector<T>>::first(const std::list<sax::Token>& input) { return input.front().getType() == sax::Token::TokenType::START_ELEMENT && input.front().getData() == Names::CONTAINER_OBJECTS_VECTOR; } template<typename T> -std::list<sax::Token> api<std::vector<T>>::compose(const std::vector<T>& input) { +std::list<sax::Token> xmlApi<std::vector<T>>::compose(const std::vector<T>& input) { return ToXMLComposers::containerComposer.compose<T>(input); } template<typename T, typename R> -std::pair<T, R> api<std::pair<T, R>>::parse(std::list<sax::Token>& input) { +std::pair<T, R> xmlApi<std::pair<T, R>>::parse(std::list<sax::Token>& input) { return FromXMLParsers::containerParser.parsePair<T, R>(input); } template<typename T, typename R> -bool api<std::pair<T, R>>::first(const std::list<sax::Token>& input) { +bool xmlApi<std::pair<T, R>>::first(const std::list<sax::Token>& input) { return input.front().getType() == sax::Token::TokenType::START_ELEMENT && input.front().getData() == Names::CONTAINER_OBJECTS_PAIR; } template<typename T, typename R> -std::list<sax::Token> api<std::pair<T, R>>::compose(const std::pair<T, R>& input) { +std::list<sax::Token> xmlApi<std::pair<T, R>>::compose(const std::pair<T, R>& input) { return ToXMLComposers::containerComposer.compose<T, R>(input); } template<typename T, typename R> -std::map<T, R> api<std::map<T, R>>::parse(std::list<sax::Token>& input) { +std::map<T, R> xmlApi<std::map<T, R>>::parse(std::list<sax::Token>& input) { return FromXMLParsers::containerParser.parseMap<T, R>(input); } template<typename T, typename R> -bool api<std::map<T, R>>::first(const std::list<sax::Token>& input) { +bool xmlApi<std::map<T, R>>::first(const std::list<sax::Token>& input) { return input.front().getType() == sax::Token::TokenType::START_ELEMENT && input.front().getData() == Names::CONTAINER_OBJECTS_MAP; } template<typename T, typename R> -std::list<sax::Token> api<std::map<T, R>>::compose(const std::map<T, R>& input) { +std::list<sax::Token> xmlApi<std::map<T, R>>::compose(const std::map<T, R>& input) { return ToXMLComposers::containerComposer.compose<T, R>(input); } /* TODO For gcc-4.9 uncomment template<typename ... Ts> -std::variant<Ts...> api<std::variant<Ts...>>::parse(std::list<sax::Token>& input) { +std::variant<Ts...> xmlApi<std::variant<Ts...>>::parse(std::list<sax::Token>& input) { return FromXMLParsers::containerParser.parseVariant<Ts...>(input); } template<typename ... Ts> -bool api<std::variant<Ts...>>::first(const std::list<sax::Token>& input) { +bool xmlApi<std::variant<Ts...>>::first(const std::list<sax::Token>& input) { return input.front().getType() == sax::Token::TokenType::START_ELEMENT && input.front().getData() == Names::CONTAINER_OBJECTS_VARIANT; } template<typename ... Ts> -std::list<sax::Token> api<std::variant<Ts...>>::compose(const std::variant<Ts...>& input) { +std::list<sax::Token> xmlApi<std::variant<Ts...>>::compose(const std::variant<Ts...>& input) { return ToXMLComposers::containerComposer.compose<Ts...>(input); } */ diff --git a/alib2data/src/alphabet/SymbolFromXMLParser.cpp b/alib2data/src/alphabet/SymbolFromXMLParser.cpp index eaf72bbf1e..48fe89007c 100644 --- a/alib2data/src/alphabet/SymbolFromXMLParser.cpp +++ b/alib2data/src/alphabet/SymbolFromXMLParser.cpp @@ -10,7 +10,7 @@ #include "../sax/ParserException.h" #include "../label/Label.h" -#include "../Api.hpp" +#include "../XmlApi.hpp" namespace alphabet { @@ -19,40 +19,40 @@ Symbol SymbolFromXMLParser::parseSymbol(std::list<sax::Token>& input) const { } Symbol SymbolFromXMLParser::parseSymbol(std::list<sax::Token>& input, const std::set<FEATURES>& features) const { - if(alib::api<LabeledSymbol>::first(input)) { + if(alib::xmlApi<LabeledSymbol>::first(input)) { if(!features.count(FEATURES::LABELED)) throw exception::AlibException(); return Symbol(parseLabeledSymbol(input)); - } else if(alib::api<BlankSymbol>::first(input)) { + } else if(alib::xmlApi<BlankSymbol>::first(input)) { if(!features.count(FEATURES::BLANK)) throw exception::AlibException(); return Symbol(parseBlankSymbol(input)); - } else if(alib::api<BottomOfTheStackSymbol>::first(input)) { + } else if(alib::xmlApi<BottomOfTheStackSymbol>::first(input)) { if(!features.count(FEATURES::BOTTOM)) throw exception::AlibException(); return Symbol(parseBottomOfTheStackSymbol(input)); - } else if(alib::api<EndSymbol>::first(input)) { + } else if(alib::xmlApi<EndSymbol>::first(input)) { if(!features.count(FEATURES::END)) throw exception::AlibException(); return Symbol(parseEndSymbol(input)); - } else if(alib::api<StartSymbol>::first(input)) { + } else if(alib::xmlApi<StartSymbol>::first(input)) { if(!features.count(FEATURES::START)) throw exception::AlibException(); return Symbol(parseStartSymbol(input)); - } else if(alib::api<RankedSymbol>::first(input)) { + } else if(alib::xmlApi<RankedSymbol>::first(input)) { if(!features.count(FEATURES::RANKED)) throw exception::AlibException(); return Symbol(parseRankedSymbol(input)); - } else if(alib::api<BarSymbol>::first(input)) { + } else if(alib::xmlApi<BarSymbol>::first(input)) { if(!features.count(FEATURES::BAR)) throw exception::AlibException(); return Symbol(parseBarSymbol(input)); - } else if(alib::api<RankedBarSymbol>::first(input)) { + } else if(alib::xmlApi<RankedBarSymbol>::first(input)) { if(!features.count(FEATURES::RANKED_BAR)) throw exception::AlibException(); return Symbol(parseRankedBarSymbol(input)); - } else if(alib::api<SubtreeWildcardSymbol>::first(input)) { + } else if(alib::xmlApi<SubtreeWildcardSymbol>::first(input)) { if(!features.count(FEATURES::SUBTREE_WILDCARD)) throw exception::AlibException(); return Symbol(parseSubtreeWildcardSymbol(input)); - } else if(alib::api<SymbolPairSymbol>::first(input)) { + } else if(alib::xmlApi<SymbolPairSymbol>::first(input)) { if(!features.count(FEATURES::SYMBOL_PAIR_SYMBOL)) throw exception::AlibException(); return Symbol(parseSymbolPairSymbol(input)); - } else if(alib::api<SymbolSetSymbol>::first(input)) { + } else if(alib::xmlApi<SymbolSetSymbol>::first(input)) { if(!features.count(FEATURES::SYMBOL_SET_SYMBOL)) throw exception::AlibException(); return Symbol(parseSymbolSetSymbol(input)); - } else if(alib::api<UniqueSymbol>::first(input)) { + } else if(alib::xmlApi<UniqueSymbol>::first(input)) { if(!features.count(FEATURES::UNIQUE_SYMBOL)) throw exception::AlibException(); return Symbol(parseUniqueSymbol(input)); } else { @@ -61,7 +61,7 @@ Symbol SymbolFromXMLParser::parseSymbol(std::list<sax::Token>& input, const std: } bool SymbolFromXMLParser::first(const std::list<sax::Token>& input) const { - if(alib::api<LabeledSymbol>::first(input) || alib::api<BlankSymbol>::first(input) || alib::api<BottomOfTheStackSymbol>::first(input) || alib::api<EndSymbol>::first(input) || alib::api<StartSymbol>::first(input) || alib::api<RankedSymbol>::first(input) || alib::api<BarSymbol>::first(input) || alib::api<RankedBarSymbol>::first(input) || alib::api<SubtreeWildcardSymbol>::first(input) || alib::api<SymbolPairSymbol>::first(input) || alib::api<SymbolSetSymbol>::first(input)) { + if(alib::xmlApi<LabeledSymbol>::first(input) || alib::xmlApi<BlankSymbol>::first(input) || alib::xmlApi<BottomOfTheStackSymbol>::first(input) || alib::xmlApi<EndSymbol>::first(input) || alib::xmlApi<StartSymbol>::first(input) || alib::xmlApi<RankedSymbol>::first(input) || alib::xmlApi<BarSymbol>::first(input) || alib::xmlApi<RankedBarSymbol>::first(input) || alib::xmlApi<SubtreeWildcardSymbol>::first(input) || alib::xmlApi<SymbolPairSymbol>::first(input) || alib::xmlApi<SymbolSetSymbol>::first(input)) { return true; } else { return false; @@ -70,7 +70,7 @@ bool SymbolFromXMLParser::first(const std::list<sax::Token>& input) const { LabeledSymbol SymbolFromXMLParser::parseLabeledSymbol(std::list<sax::Token>& input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, alib::Names::ALPHABET_LABELED_SYMBOL); - label::Label data = alib::api<label::Label>::parse(input); + label::Label data = alib::xmlApi<label::Label>::parse(input); popToken(input, sax::Token::TokenType::END_ELEMENT, alib::Names::ALPHABET_LABELED_SYMBOL); return LabeledSymbol(data); } @@ -101,8 +101,8 @@ StartSymbol SymbolFromXMLParser::parseStartSymbol(std::list<sax::Token>& input) RankedSymbol SymbolFromXMLParser::parseRankedSymbol(std::list<sax::Token>& input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, alib::Names::ALPHABET_RANKED_SYMBOL); - label::Label data = alib::api<label::Label>::parse(input); - primitive::Integer rank = alib::api<primitive::Integer>::parse(input); + label::Label data = alib::xmlApi<label::Label>::parse(input); + primitive::Integer rank = alib::xmlApi<primitive::Integer>::parse(input); popToken(input, sax::Token::TokenType::END_ELEMENT, alib::Names::ALPHABET_RANKED_SYMBOL); return RankedSymbol(data, rank); } @@ -115,7 +115,7 @@ BarSymbol SymbolFromXMLParser::parseBarSymbol(std::list<sax::Token>& input) cons RankedBarSymbol SymbolFromXMLParser::parseRankedBarSymbol(std::list<sax::Token>& input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, alib::Names::ALPHABET_RANKED_BAR_SYMBOL); - primitive::Integer rank = alib::api<primitive::Integer>::parse(input); + primitive::Integer rank = alib::xmlApi<primitive::Integer>::parse(input); popToken(input, sax::Token::TokenType::END_ELEMENT, alib::Names::ALPHABET_RANKED_BAR_SYMBOL); return RankedBarSymbol(rank); } @@ -152,7 +152,7 @@ UniqueSymbol SymbolFromXMLParser::parseUniqueSymbol(std::list<sax::Token>& input popToken(input, sax::Token::TokenType::START_ELEMENT, alib::Names::ALPHABET_UNIQUE_SYMBOL); Symbol firstSymbol = parseSymbol(input); - primitive::Integer secondSymbol = alib::api<primitive::Integer>::parse(input); + primitive::Integer secondSymbol = alib::xmlApi<primitive::Integer>::parse(input); UniqueSymbol data(firstSymbol, secondSymbol); popToken(input, sax::Token::TokenType::END_ELEMENT, alib::Names::ALPHABET_UNIQUE_SYMBOL); diff --git a/alib2data/src/alphabet/SymbolFromXMLParser.h b/alib2data/src/alphabet/SymbolFromXMLParser.h index 6be6f4a93e..5553de2b2b 100644 --- a/alib2data/src/alphabet/SymbolFromXMLParser.h +++ b/alib2data/src/alphabet/SymbolFromXMLParser.h @@ -32,7 +32,7 @@ namespace alib { template<typename T> -struct api; +struct xmlApi; } /* namespace alib */ @@ -58,7 +58,7 @@ class SymbolFromXMLParser : public sax::FromXMLParserHelper { SymbolSetSymbol parseSymbolSetSymbol(std::list<sax::Token>& input) const; UniqueSymbol parseUniqueSymbol(std::list<sax::Token>& input) const; - template<typename T> friend class alib::api; + template<typename T> friend class alib::xmlApi; public: bool first(const std::list<sax::Token>& input) const; }; diff --git a/alib2data/src/alphabet/SymbolToXMLComposer.cpp b/alib2data/src/alphabet/SymbolToXMLComposer.cpp index b4f0ebfc95..9ab1b44f40 100644 --- a/alib2data/src/alphabet/SymbolToXMLComposer.cpp +++ b/alib2data/src/alphabet/SymbolToXMLComposer.cpp @@ -7,7 +7,7 @@ #include "SymbolToXMLComposer.h" -#include "../Api.hpp" +#include "../XmlApi.hpp" namespace alphabet { @@ -26,7 +26,7 @@ std::list<sax::Token> SymbolToXMLComposer::compose(const SymbolBase& symbol) con std::list<sax::Token> SymbolToXMLComposer::compose(const LabeledSymbol& symbol) const { std::list<sax::Token> out; out.push_back(sax::Token(alib::Names::ALPHABET_LABELED_SYMBOL, sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<label::Label>::compose(symbol.getLabel())); + out.splice(out.end(), alib::xmlApi<label::Label>::compose(symbol.getLabel())); out.push_back(sax::Token(alib::Names::ALPHABET_LABELED_SYMBOL, sax::Token::TokenType::END_ELEMENT)); return out; } @@ -62,8 +62,8 @@ std::list<sax::Token> SymbolToXMLComposer::compose(const StartSymbol&) const { std::list<sax::Token> SymbolToXMLComposer::compose(const RankedSymbol& symbol) const { std::list<sax::Token> out; out.push_back(sax::Token(alib::Names::ALPHABET_RANKED_SYMBOL, sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<label::Label>::compose(symbol.getLabel())); - out.splice(out.end(), alib::api<primitive::Integer>::compose(symbol.getRank())); + out.splice(out.end(), alib::xmlApi<label::Label>::compose(symbol.getLabel())); + out.splice(out.end(), alib::xmlApi<primitive::Integer>::compose(symbol.getRank())); out.push_back(sax::Token(alib::Names::ALPHABET_RANKED_SYMBOL, sax::Token::TokenType::END_ELEMENT)); return out; } @@ -78,7 +78,7 @@ std::list<sax::Token> SymbolToXMLComposer::compose(const BarSymbol&) const { std::list<sax::Token> SymbolToXMLComposer::compose(const RankedBarSymbol& symbol) const { std::list<sax::Token> out; out.push_back(sax::Token(alib::Names::ALPHABET_RANKED_BAR_SYMBOL, sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<primitive::Integer>::compose(symbol.getRank())); + out.splice(out.end(), alib::xmlApi<primitive::Integer>::compose(symbol.getRank())); out.push_back(sax::Token(alib::Names::ALPHABET_RANKED_BAR_SYMBOL, sax::Token::TokenType::END_ELEMENT)); return out; } @@ -94,7 +94,7 @@ std::list<sax::Token> SymbolToXMLComposer::compose(const SymbolSetSymbol& symbol std::list<sax::Token> out; out.push_back(sax::Token(alib::Names::ALPHABET_SYMBOL_SET_SYMBOL, sax::Token::TokenType::START_ELEMENT)); for(const Symbol& innerSymbol : symbol.getData()) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(innerSymbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(innerSymbol)); } out.push_back(sax::Token(alib::Names::ALPHABET_SYMBOL_SET_SYMBOL, sax::Token::TokenType::END_ELEMENT)); return out; @@ -103,8 +103,8 @@ std::list<sax::Token> SymbolToXMLComposer::compose(const SymbolSetSymbol& symbol std::list<sax::Token> SymbolToXMLComposer::compose(const SymbolPairSymbol& symbol) const { std::list<sax::Token> out; out.push_back(sax::Token(alib::Names::ALPHABET_SYMBOL_PAIR_SYMBOL, sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol.getData().first)); - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol.getData().second)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol.getData().first)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol.getData().second)); out.push_back(sax::Token(alib::Names::ALPHABET_SYMBOL_PAIR_SYMBOL, sax::Token::TokenType::END_ELEMENT)); return out; } @@ -112,8 +112,8 @@ std::list<sax::Token> SymbolToXMLComposer::compose(const SymbolPairSymbol& symbo std::list<sax::Token> SymbolToXMLComposer::compose(const UniqueSymbol& symbol) const { std::list<sax::Token> out; out.push_back(sax::Token(alib::Names::LABEL_UNIQUE_LABEL, sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol.getSymbol())); - out.splice(out.end(), alib::api<primitive::Integer>::compose(symbol.getId())); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol.getSymbol())); + out.splice(out.end(), alib::xmlApi<primitive::Integer>::compose(symbol.getId())); out.push_back(sax::Token(alib::Names::LABEL_UNIQUE_LABEL, sax::Token::TokenType::END_ELEMENT)); return out; } diff --git a/alib2data/src/alphabet/SymbolToXMLComposer.h b/alib2data/src/alphabet/SymbolToXMLComposer.h index 090a3fa1b3..1b851eee07 100644 --- a/alib2data/src/alphabet/SymbolToXMLComposer.h +++ b/alib2data/src/alphabet/SymbolToXMLComposer.h @@ -16,7 +16,7 @@ namespace alib { template<typename T> -struct api; +struct xmlApi; } /* namespace alib */ @@ -53,7 +53,7 @@ class SymbolToXMLComposer { std::list<sax::Token> compose(const SymbolSetSymbol& symbol) const; std::list<sax::Token> compose(const UniqueSymbol& symbol) const; - template<typename T> friend class alib::api; + template<typename T> friend class alib::xmlApi; }; } /* namespace alphabet */ diff --git a/alib2data/src/automaton/AutomatonFromXMLParser.cpp b/alib2data/src/automaton/AutomatonFromXMLParser.cpp index b54b892fc7..088ccae85a 100644 --- a/alib2data/src/automaton/AutomatonFromXMLParser.cpp +++ b/alib2data/src/automaton/AutomatonFromXMLParser.cpp @@ -11,7 +11,7 @@ #include "../alphabet/BlankSymbol.h" #include "../label/Label.h" -#include "../Api.hpp" +#include "../XmlApi.hpp" namespace automaton { @@ -20,52 +20,52 @@ Automaton AutomatonFromXMLParser::parseAutomaton(std::list<sax::Token> &input) c } Automaton AutomatonFromXMLParser::parseAutomaton(std::list<sax::Token>& input, const std::set<FEATURES>& features) const { - if(alib::api<EpsilonNFA>::first(input)) { + if(alib::xmlApi<EpsilonNFA>::first(input)) { if(!features.count(FEATURES::EPSILON_NFA)) throw exception::AlibException(); return Automaton(parseEpsilonNFA(input)); - } else if(alib::api<MultiInitialStateNFA>::first(input)) { + } else if(alib::xmlApi<MultiInitialStateNFA>::first(input)) { if(!features.count(FEATURES::MULTI_INITIAL_STATE_NFA)) throw exception::AlibException(); return Automaton(parseMultiInitialStateNFA(input)); - } else if(alib::api<NFA>::first(input)) { + } else if(alib::xmlApi<NFA>::first(input)) { if(!features.count(FEATURES::NFA)) throw exception::AlibException(); return Automaton(parseNFA(input)); - } else if(alib::api<DFA>::first(input)) { + } else if(alib::xmlApi<DFA>::first(input)) { if(!features.count(FEATURES::DFA)) throw exception::AlibException(); return Automaton(parseDFA(input)); - } else if(alib::api<CompactNFA>::first(input)) { + } else if(alib::xmlApi<CompactNFA>::first(input)) { if(!features.count(FEATURES::COMPACT_NFA)) throw exception::AlibException(); return Automaton(parseCompactNFA(input)); - } else if(alib::api<ExtendedNFA>::first(input)) { + } else if(alib::xmlApi<ExtendedNFA>::first(input)) { if(!features.count(FEATURES::EXTENDED_NFA)) throw exception::AlibException(); return Automaton(parseExtendedNFA(input)); - } else if(alib::api<DPDA>::first(input)) { + } else if(alib::xmlApi<DPDA>::first(input)) { if(!features.count(FEATURES::DPDA)) throw exception::AlibException(); return Automaton(parseDPDA(input)); - } else if(alib::api<SinglePopDPDA>::first(input)) { + } else if(alib::xmlApi<SinglePopDPDA>::first(input)) { if(!features.count(FEATURES::SINGLE_POP_DPDA)) throw exception::AlibException(); return Automaton(parseSinglePopDPDA(input)); - } else if(alib::api<InputDrivenNPDA>::first(input)) { + } else if(alib::xmlApi<InputDrivenNPDA>::first(input)) { if(!features.count(FEATURES::INPUT_DRIVEN_NPDA)) throw exception::AlibException(); return Automaton(parseInputDrivenNPDA(input)); - } else if(alib::api<VisiblyPushdownDPDA>::first(input)) { + } else if(alib::xmlApi<VisiblyPushdownDPDA>::first(input)) { if(!features.count(FEATURES::VISIBLY_PUSHDOWN_DPDA)) throw exception::AlibException(); return Automaton(parseVisiblyPushdownDPDA(input)); - } else if(alib::api<VisiblyPushdownNPDA>::first(input)) { + } else if(alib::xmlApi<VisiblyPushdownNPDA>::first(input)) { if(!features.count(FEATURES::VISIBLY_PUSHDOWN_NPDA)) throw exception::AlibException(); return Automaton(parseVisiblyPushdownNPDA(input)); - } else if(alib::api<RealTimeHeightDeterministicDPDA>::first(input)) { + } else if(alib::xmlApi<RealTimeHeightDeterministicDPDA>::first(input)) { if(!features.count(FEATURES::REAL_TIME_HEIGHT_DETERMINISTIC_DPDA)) throw exception::AlibException(); return Automaton(parseRealTimeHeightDeterministicDPDA(input)); - } else if(alib::api<RealTimeHeightDeterministicNPDA>::first(input)) { + } else if(alib::xmlApi<RealTimeHeightDeterministicNPDA>::first(input)) { if(!features.count(FEATURES::REAL_TIME_HEIGHT_DETERMINISTIC_NPDA)) throw exception::AlibException(); return Automaton(parseRealTimeHeightDeterministicNPDA(input)); - } else if(alib::api<NPDA>::first(input)) { + } else if(alib::xmlApi<NPDA>::first(input)) { if(!features.count(FEATURES::NPDA)) throw exception::AlibException(); return Automaton(parseNPDA(input)); - } else if(alib::api<SinglePopNPDA>::first(input)) { + } else if(alib::xmlApi<SinglePopNPDA>::first(input)) { if(!features.count(FEATURES::SINGLE_POP_NPDA)) throw exception::AlibException(); return Automaton(parseSinglePopNPDA(input)); - } else if(alib::api<OneTapeDTM>::first(input)) { + } else if(alib::xmlApi<OneTapeDTM>::first(input)) { if(!features.count(FEATURES::ONE_TAPE_DTM)) throw exception::AlibException(); return Automaton(parseOneTapeDTM(input)); } else @@ -73,7 +73,7 @@ Automaton AutomatonFromXMLParser::parseAutomaton(std::list<sax::Token>& input, c } bool AutomatonFromXMLParser::first(const std::list<sax::Token>& input) const { - if(alib::api<EpsilonNFA>::first(input) || alib::api<NFA>::first(input) || alib::api<DFA>::first(input) || alib::api<CompactNFA>::first(input) || alib::api<ExtendedNFA>::first(input) || alib::api<DPDA>::first(input) || alib::api<SinglePopDPDA>::first(input) || alib::api<InputDrivenNPDA>::first(input) || alib::api<VisiblyPushdownDPDA>::first(input) || alib::api<VisiblyPushdownNPDA>::first(input) || alib::api<RealTimeHeightDeterministicDPDA>::first(input) || alib::api<RealTimeHeightDeterministicNPDA>::first(input) || alib::api<NPDA>::first(input) || alib::api<SinglePopNPDA>::first(input) || alib::api<OneTapeDTM>::first(input)) { + if(alib::xmlApi<EpsilonNFA>::first(input) || alib::xmlApi<NFA>::first(input) || alib::xmlApi<DFA>::first(input) || alib::xmlApi<CompactNFA>::first(input) || alib::xmlApi<ExtendedNFA>::first(input) || alib::xmlApi<DPDA>::first(input) || alib::xmlApi<SinglePopDPDA>::first(input) || alib::xmlApi<InputDrivenNPDA>::first(input) || alib::xmlApi<VisiblyPushdownDPDA>::first(input) || alib::xmlApi<VisiblyPushdownNPDA>::first(input) || alib::xmlApi<RealTimeHeightDeterministicDPDA>::first(input) || alib::xmlApi<RealTimeHeightDeterministicNPDA>::first(input) || alib::xmlApi<NPDA>::first(input) || alib::xmlApi<SinglePopNPDA>::first(input) || alib::xmlApi<OneTapeDTM>::first(input)) { return true; } else { return false; @@ -461,14 +461,14 @@ std::set<State> AutomatonFromXMLParser::parseStates(std::list<sax::Token> &input } State AutomatonFromXMLParser::parseState(std::list<sax::Token> &input) const { - return State(alib::api<label::Label>::parse(input)); + return State(alib::xmlApi<label::Label>::parse(input)); } std::set<alphabet::Symbol> AutomatonFromXMLParser::parseCallInputAlphabet(std::list<sax::Token> &input) const { std::set<alphabet::Symbol> inputSymbols; popToken(input, sax::Token::TokenType::START_ELEMENT, "callInputAlphabet"); while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - inputSymbols.insert(alib::api<alphabet::Symbol>::parse(input)); + inputSymbols.insert(alib::xmlApi<alphabet::Symbol>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, "callInputAlphabet"); return inputSymbols; @@ -478,7 +478,7 @@ std::set<alphabet::Symbol> AutomatonFromXMLParser::parseReturnInputAlphabet(std: std::set<alphabet::Symbol> inputSymbols; popToken(input, sax::Token::TokenType::START_ELEMENT, "returnInputAlphabet"); while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - inputSymbols.insert(alib::api<alphabet::Symbol>::parse(input)); + inputSymbols.insert(alib::xmlApi<alphabet::Symbol>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, "returnInputAlphabet"); return inputSymbols; @@ -488,7 +488,7 @@ std::set<alphabet::Symbol> AutomatonFromXMLParser::parseLocalInputAlphabet(std:: std::set<alphabet::Symbol> inputSymbols; popToken(input, sax::Token::TokenType::START_ELEMENT, "localInputAlphabet"); while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - inputSymbols.insert(alib::api<alphabet::Symbol>::parse(input)); + inputSymbols.insert(alib::xmlApi<alphabet::Symbol>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, "localInputAlphabet"); return inputSymbols; @@ -498,7 +498,7 @@ std::set<alphabet::Symbol> AutomatonFromXMLParser::parseInputAlphabet(std::list< std::set<alphabet::Symbol> inputSymbols; popToken(input, sax::Token::TokenType::START_ELEMENT, "inputAlphabet"); while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - inputSymbols.insert(alib::api<alphabet::Symbol>::parse(input)); + inputSymbols.insert(alib::xmlApi<alphabet::Symbol>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, "inputAlphabet"); return inputSymbols; @@ -506,7 +506,7 @@ std::set<alphabet::Symbol> AutomatonFromXMLParser::parseInputAlphabet(std::list< State AutomatonFromXMLParser::parseInitialState(std::list<sax::Token> &input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, "initialState"); - State state(alib::api<label::Label>::parse(input)); + State state(alib::xmlApi<label::Label>::parse(input)); popToken(input, sax::Token::TokenType::END_ELEMENT, "initialState"); return state; } @@ -515,7 +515,7 @@ std::set<State> AutomatonFromXMLParser::parseInitialStates(std::list<sax::Token> std::set<State> initialStates; popToken(input, sax::Token::TokenType::START_ELEMENT, "initialStates"); while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - initialStates.insert(State(alib::api<label::Label>::parse(input))); + initialStates.insert(State(alib::xmlApi<label::Label>::parse(input))); } popToken(input, sax::Token::TokenType::END_ELEMENT, "initialStates"); return initialStates; @@ -525,7 +525,7 @@ std::set<State> AutomatonFromXMLParser::parseFinalStates(std::list<sax::Token> & std::set<State> finalStates; popToken(input, sax::Token::TokenType::START_ELEMENT, "finalStates"); while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - finalStates.insert(State(alib::api<label::Label>::parse(input))); + finalStates.insert(State(alib::xmlApi<label::Label>::parse(input))); } popToken(input, sax::Token::TokenType::END_ELEMENT, "finalStates"); return finalStates; @@ -535,7 +535,7 @@ std::set<alphabet::Symbol> AutomatonFromXMLParser::parseStackAlphabet(std::list< std::set<alphabet::Symbol> stackSymbols; popToken(input, sax::Token::TokenType::START_ELEMENT, "stackAlphabet"); while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - stackSymbols.insert(alib::api<alphabet::Symbol>::parse(input)); + stackSymbols.insert(alib::xmlApi<alphabet::Symbol>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, "stackAlphabet"); return stackSymbols; @@ -545,7 +545,7 @@ std::set<alphabet::Symbol> AutomatonFromXMLParser::parseInitialStackSymbols(std: std::set<alphabet::Symbol> initialSymbols; popToken(input, sax::Token::TokenType::START_ELEMENT, "initialStackSymbols"); while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - initialSymbols.insert(alib::api<alphabet::Symbol>::parse(input)); + initialSymbols.insert(alib::xmlApi<alphabet::Symbol>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, "initialStackSymbols"); return initialSymbols; @@ -553,7 +553,7 @@ std::set<alphabet::Symbol> AutomatonFromXMLParser::parseInitialStackSymbols(std: alphabet::Symbol AutomatonFromXMLParser::parseInitialStackSymbol(std::list<sax::Token> &input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, "initialStackSymbol"); - alphabet::Symbol initialSymbol(alib::api<alphabet::Symbol>::parse(input)); + alphabet::Symbol initialSymbol(alib::xmlApi<alphabet::Symbol>::parse(input)); popToken(input, sax::Token::TokenType::END_ELEMENT, "initialStackSymbol"); return initialSymbol; } @@ -562,7 +562,7 @@ std::set<alphabet::Symbol> AutomatonFromXMLParser::parseTapeAlphabet(std::list<s std::set<alphabet::Symbol> tapeSymbols; popToken(input, sax::Token::TokenType::START_ELEMENT, "tapeAlphabet"); while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - tapeSymbols.insert(alib::api<alphabet::Symbol>::parse(input)); + tapeSymbols.insert(alib::xmlApi<alphabet::Symbol>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, "tapeAlphabet"); return tapeSymbols; @@ -570,14 +570,14 @@ std::set<alphabet::Symbol> AutomatonFromXMLParser::parseTapeAlphabet(std::list<s alphabet::Symbol AutomatonFromXMLParser::parseBlankSymbol(std::list<sax::Token>& input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, "blankSymbol"); - alphabet::Symbol blank(alib::api<alphabet::Symbol>::parse(input)); + alphabet::Symbol blank(alib::xmlApi<alphabet::Symbol>::parse(input)); popToken(input, sax::Token::TokenType::END_ELEMENT, "blankSymbol"); return blank; } alphabet::Symbol AutomatonFromXMLParser::parseBottomOfTheStackSymbol(std::list<sax::Token>& input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, "bottomOfTheStackSymbol"); - alphabet::Symbol blank(alib::api<alphabet::Symbol>::parse(input)); + alphabet::Symbol blank(alib::xmlApi<alphabet::Symbol>::parse(input)); popToken(input, sax::Token::TokenType::END_ELEMENT, "bottomOfTheStackSymbol"); return blank; } @@ -587,7 +587,7 @@ void AutomatonFromXMLParser::parseInputToPushdownStoreOperation(std::list<sax::T while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { popToken(input, sax::Token::TokenType::START_ELEMENT, "operation"); - alphabet::Symbol inputSymbol(alib::api<alphabet::Symbol>::parse(input)); + alphabet::Symbol inputSymbol(alib::xmlApi<alphabet::Symbol>::parse(input)); std::vector<alphabet::Symbol> pop = parseTransitionPop(input); std::vector<alphabet::Symbol> push = parseTransitionPush(input); @@ -851,14 +851,14 @@ void AutomatonFromXMLParser::parseTransition(std::list<sax::Token>& input, OneTa State AutomatonFromXMLParser::parseTransitionTo(std::list<sax::Token> &input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, "to"); - State state(alib::api<label::Label>::parse(input)); + State state(alib::xmlApi<label::Label>::parse(input)); popToken(input, sax::Token::TokenType::END_ELEMENT, "to"); return state; } State AutomatonFromXMLParser::parseTransitionFrom(std::list<sax::Token> &input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, "from"); - State state(alib::api<label::Label>::parse(input)); + State state(alib::xmlApi<label::Label>::parse(input)); popToken(input, sax::Token::TokenType::END_ELEMENT, "from"); return state; } @@ -886,7 +886,7 @@ std::vector<alphabet::Symbol> AutomatonFromXMLParser::parseTransitionPop(std::li std::vector<alphabet::Symbol> pops; popToken(input, sax::Token::TokenType::START_ELEMENT, "pop"); while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - pops.push_back(alib::api<alphabet::Symbol>::parse(input)); + pops.push_back(alib::xmlApi<alphabet::Symbol>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, "pop"); return pops; @@ -894,7 +894,7 @@ std::vector<alphabet::Symbol> AutomatonFromXMLParser::parseTransitionPop(std::li alphabet::Symbol AutomatonFromXMLParser::parseTransitionSinglePop(std::list<sax::Token>& input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, "pop"); - alphabet::Symbol pop = alib::api<alphabet::Symbol>::parse(input); + alphabet::Symbol pop = alib::xmlApi<alphabet::Symbol>::parse(input); popToken(input, sax::Token::TokenType::END_ELEMENT, "pop"); return pop; } @@ -903,7 +903,7 @@ std::vector<alphabet::Symbol> AutomatonFromXMLParser::parseTransitionPush(std::l std::vector<alphabet::Symbol> pushes; popToken(input, sax::Token::TokenType::START_ELEMENT, "push"); while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - pushes.push_back(alib::api<alphabet::Symbol>::parse(input)); + pushes.push_back(alib::xmlApi<alphabet::Symbol>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, "push"); return pushes; @@ -911,21 +911,21 @@ std::vector<alphabet::Symbol> AutomatonFromXMLParser::parseTransitionPush(std::l alphabet::Symbol AutomatonFromXMLParser::parseTransitionSinglePush(std::list<sax::Token>& input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, "push"); - alphabet::Symbol push = alib::api<alphabet::Symbol>::parse(input); + alphabet::Symbol push = alib::xmlApi<alphabet::Symbol>::parse(input); popToken(input, sax::Token::TokenType::END_ELEMENT, "push"); return push; } alphabet::Symbol AutomatonFromXMLParser::parseTransitionInputSymbol(std::list<sax::Token>& input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, "input"); - alphabet::Symbol result(alib::api<alphabet::Symbol>::parse(input)); + alphabet::Symbol result(alib::xmlApi<alphabet::Symbol>::parse(input)); popToken(input, sax::Token::TokenType::END_ELEMENT, "input"); return result; } alphabet::Symbol AutomatonFromXMLParser::parseTransitionOutputSymbol(std::list<sax::Token>& input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, "output"); - alphabet::Symbol result(alib::api<alphabet::Symbol>::parse(input)); + alphabet::Symbol result(alib::xmlApi<alphabet::Symbol>::parse(input)); popToken(input, sax::Token::TokenType::END_ELEMENT, "output"); return result; } @@ -940,7 +940,7 @@ std::variant<string::Epsilon, alphabet::Symbol> AutomatonFromXMLParser::parseTra popToken(input, sax::Token::TokenType::END_ELEMENT, "input"); return result; } else { - std::variant<string::Epsilon, alphabet::Symbol> result(alib::api<alphabet::Symbol>::parse(input)); + std::variant<string::Epsilon, alphabet::Symbol> result(alib::xmlApi<alphabet::Symbol>::parse(input)); popToken(input, sax::Token::TokenType::END_ELEMENT, "input"); return result; } @@ -956,7 +956,7 @@ std::variant<string::Epsilon, alphabet::Symbol> AutomatonFromXMLParser::parseTra popToken(input, sax::Token::TokenType::END_ELEMENT, "output"); return result; } else { - std::variant<string::Epsilon, alphabet::Symbol> result(alib::api<alphabet::Symbol>::parse(input)); + std::variant<string::Epsilon, alphabet::Symbol> result(alib::xmlApi<alphabet::Symbol>::parse(input)); popToken(input, sax::Token::TokenType::END_ELEMENT, "output"); return result; } @@ -964,14 +964,14 @@ std::variant<string::Epsilon, alphabet::Symbol> AutomatonFromXMLParser::parseTra string::LinearString AutomatonFromXMLParser::parseTransitionInputString(std::list<sax::Token>& input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, "input"); - string::LinearString result(alib::api<string::LinearString>::parse(input)); + string::LinearString result(alib::xmlApi<string::LinearString>::parse(input)); popToken(input, sax::Token::TokenType::END_ELEMENT, "input"); return result; } regexp::RegExp AutomatonFromXMLParser::parseTransitionInputRegexp(std::list<sax::Token>& input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, "input"); - regexp::RegExp result(alib::api<regexp::RegExp>::parse(input)); + regexp::RegExp result(alib::xmlApi<regexp::RegExp>::parse(input)); popToken(input, sax::Token::TokenType::END_ELEMENT, "input"); return result; } diff --git a/alib2data/src/automaton/AutomatonFromXMLParser.h b/alib2data/src/automaton/AutomatonFromXMLParser.h index ca58eb5db5..22dda04d42 100644 --- a/alib2data/src/automaton/AutomatonFromXMLParser.h +++ b/alib2data/src/automaton/AutomatonFromXMLParser.h @@ -36,7 +36,7 @@ namespace alib { template<typename T> -struct api; +struct xmlApi; } /* namespace alib */ @@ -124,7 +124,7 @@ class AutomatonFromXMLParser : public sax::FromXMLParserHelper { SinglePopNPDA parseSinglePopNPDA(std::list<sax::Token>& input) const; OneTapeDTM parseOneTapeDTM(std::list<sax::Token>& input) const; - template<typename T> friend class alib::api; + template<typename T> friend class alib::xmlApi; public: bool first(const std::list<sax::Token>& input) const; }; diff --git a/alib2data/src/automaton/AutomatonToXMLComposer.cpp b/alib2data/src/automaton/AutomatonToXMLComposer.cpp index 2f96ee7154..4457f6191f 100644 --- a/alib2data/src/automaton/AutomatonToXMLComposer.cpp +++ b/alib2data/src/automaton/AutomatonToXMLComposer.cpp @@ -8,14 +8,14 @@ #include "AutomatonToXMLComposer.h" #include "../alphabet/BlankSymbol.h" -#include "../Api.hpp" +#include "../XmlApi.hpp" namespace automaton { void AutomatonToXMLComposer::composeStates(std::list<sax::Token>& out, const std::set<State>& states) const { out.push_back(sax::Token("states", sax::Token::TokenType::START_ELEMENT)); for (const auto& state : states) { - out.splice(out.end(), alib::api<label::Label>::compose(state.getName())); + out.splice(out.end(), alib::xmlApi<label::Label>::compose(state.getName())); } out.push_back(sax::Token("states", sax::Token::TokenType::END_ELEMENT)); } @@ -23,7 +23,7 @@ void AutomatonToXMLComposer::composeStates(std::list<sax::Token>& out, const std void AutomatonToXMLComposer::composeInputAlphabet(std::list<sax::Token>& out, const std::set<alphabet::Symbol>& symbols) const { out.push_back(sax::Token("inputAlphabet", sax::Token::TokenType::START_ELEMENT)); for (const auto& symbol : symbols) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } out.push_back(sax::Token("inputAlphabet", sax::Token::TokenType::END_ELEMENT)); } @@ -31,7 +31,7 @@ void AutomatonToXMLComposer::composeInputAlphabet(std::list<sax::Token>& out, co void AutomatonToXMLComposer::composeCallInputAlphabet(std::list<sax::Token>& out, const std::set<alphabet::Symbol>& symbols) const { out.push_back(sax::Token("callInputAlphabet", sax::Token::TokenType::START_ELEMENT)); for (const auto& symbol : symbols) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } out.push_back(sax::Token("callInputAlphabet", sax::Token::TokenType::END_ELEMENT)); } @@ -39,7 +39,7 @@ void AutomatonToXMLComposer::composeCallInputAlphabet(std::list<sax::Token>& out void AutomatonToXMLComposer::composeReturnInputAlphabet(std::list<sax::Token>& out, const std::set<alphabet::Symbol>& symbols) const { out.push_back(sax::Token("returnInputAlphabet", sax::Token::TokenType::START_ELEMENT)); for (const auto& symbol : symbols) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } out.push_back(sax::Token("returnInputAlphabet", sax::Token::TokenType::END_ELEMENT)); } @@ -47,7 +47,7 @@ void AutomatonToXMLComposer::composeReturnInputAlphabet(std::list<sax::Token>& o void AutomatonToXMLComposer::composeLocalInputAlphabet(std::list<sax::Token>& out, const std::set<alphabet::Symbol>& symbols) const { out.push_back(sax::Token("localInputAlphabet", sax::Token::TokenType::START_ELEMENT)); for (const auto& symbol : symbols) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } out.push_back(sax::Token("localInputAlphabet", sax::Token::TokenType::END_ELEMENT)); } @@ -55,21 +55,21 @@ void AutomatonToXMLComposer::composeLocalInputAlphabet(std::list<sax::Token>& ou void AutomatonToXMLComposer::composeInitialStates(std::list<sax::Token>& out, const std::set<State>& states) const { out.push_back(sax::Token("initialStates", sax::Token::TokenType::START_ELEMENT)); for (const auto& state : states) { - out.splice(out.end(), alib::api<label::Label>::compose(state.getName())); + out.splice(out.end(), alib::xmlApi<label::Label>::compose(state.getName())); } out.push_back(sax::Token("initialStates", sax::Token::TokenType::END_ELEMENT)); } void AutomatonToXMLComposer::composeInitialState(std::list<sax::Token>& out, const State& state) const { out.push_back(sax::Token("initialState", sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<label::Label>::compose(state.getName())); + out.splice(out.end(), alib::xmlApi<label::Label>::compose(state.getName())); out.push_back(sax::Token("initialState", sax::Token::TokenType::END_ELEMENT)); } void AutomatonToXMLComposer::composeFinalStates(std::list<sax::Token>& out, const std::set<State>& states) const { out.push_back(sax::Token("finalStates", sax::Token::TokenType::START_ELEMENT)); for (const auto& state : states) { - out.splice(out.end(), alib::api<label::Label>::compose(state.getName())); + out.splice(out.end(), alib::xmlApi<label::Label>::compose(state.getName())); } out.push_back(sax::Token("finalStates", sax::Token::TokenType::END_ELEMENT)); } @@ -77,7 +77,7 @@ void AutomatonToXMLComposer::composeFinalStates(std::list<sax::Token>& out, cons void AutomatonToXMLComposer::composeStackAlphabet(std::list<sax::Token>& out, const std::set<alphabet::Symbol>& symbols) const { out.push_back(sax::Token("stackAlphabet", sax::Token::TokenType::START_ELEMENT)); for (const auto& symbol : symbols) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } out.push_back(sax::Token("stackAlphabet", sax::Token::TokenType::END_ELEMENT)); } @@ -85,34 +85,34 @@ void AutomatonToXMLComposer::composeStackAlphabet(std::list<sax::Token>& out, co void AutomatonToXMLComposer::composeInitialStackSymbols(std::list<sax::Token>& out, const std::set<alphabet::Symbol>& symbols) const { out.push_back(sax::Token("initialStackSymbols", sax::Token::TokenType::START_ELEMENT)); for (const auto& symbol : symbols) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } out.push_back(sax::Token("initialStackSymbols", sax::Token::TokenType::END_ELEMENT)); } void AutomatonToXMLComposer::composeInitialStackSymbol(std::list<sax::Token>& out, const alphabet::Symbol& symbol) const { out.push_back(sax::Token("initialStackSymbol", sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); out.push_back(sax::Token("initialStackSymbol", sax::Token::TokenType::END_ELEMENT)); } void AutomatonToXMLComposer::composeTapeAlphabet(std::list<sax::Token>& out, const std::set<alphabet::Symbol>& symbols) const { out.push_back(sax::Token("tapeAlphabet", sax::Token::TokenType::START_ELEMENT)); for (const auto& symbol : symbols) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } out.push_back(sax::Token("tapeAlphabet", sax::Token::TokenType::END_ELEMENT)); } void AutomatonToXMLComposer::composeBlankSymbol(std::list<sax::Token>& out, const alphabet::Symbol& symbol) const { out.push_back(sax::Token("blankSymbol", sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); out.push_back(sax::Token("blankSymbol", sax::Token::TokenType::END_ELEMENT)); } void AutomatonToXMLComposer::composeBottomOfTheStackSymbol(std::list<sax::Token>& out, const alphabet::Symbol& symbol) const { out.push_back(sax::Token("bottomOfTheStackSymbol", sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); out.push_back(sax::Token("bottomOfTheStackSymbol", sax::Token::TokenType::END_ELEMENT)); } @@ -122,7 +122,7 @@ void AutomatonToXMLComposer::composeInputToPushdownStoreOperation(std::list<sax: for(const auto& pushdownStoreOperation : automaton.getPushdownStoreOperations()) { out.push_back(sax::Token("operation", sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(pushdownStoreOperation.first)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(pushdownStoreOperation.first)); composeTransitionPop(out, pushdownStoreOperation.second.first); composeTransitionPush(out, pushdownStoreOperation.second.second); @@ -488,13 +488,13 @@ void AutomatonToXMLComposer::composeTransitions(std::list<sax::Token>& out, cons void AutomatonToXMLComposer::composeTransitionTo(std::list<sax::Token>& out, const State& state) const { out.push_back(sax::Token("to", sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<label::Label>::compose(state.getName())); + out.splice(out.end(), alib::xmlApi<label::Label>::compose(state.getName())); out.push_back(sax::Token("to", sax::Token::TokenType::END_ELEMENT)); } void AutomatonToXMLComposer::composeTransitionFrom(std::list<sax::Token>& out, const State& state) const { out.push_back(sax::Token("from", sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<label::Label>::compose(state.getName())); + out.splice(out.end(), alib::xmlApi<label::Label>::compose(state.getName())); out.push_back(sax::Token("from", sax::Token::TokenType::END_ELEMENT)); } @@ -507,40 +507,40 @@ void AutomatonToXMLComposer::composeTransitionShift(std::list<sax::Token>& out, void AutomatonToXMLComposer::composeTransitionPop(std::list<sax::Token>& out, const std::vector<alphabet::Symbol>& symbols) const { out.push_back(sax::Token("pop", sax::Token::TokenType::START_ELEMENT)); for (const auto& symbol : symbols) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } out.push_back(sax::Token("pop", sax::Token::TokenType::END_ELEMENT)); } void AutomatonToXMLComposer::composeTransitionSinglePop(std::list<sax::Token>& out, const alphabet::Symbol& symbol) const { out.push_back(sax::Token("pop", sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); out.push_back(sax::Token("pop", sax::Token::TokenType::END_ELEMENT)); } void AutomatonToXMLComposer::composeTransitionPush(std::list<sax::Token>& out, const std::vector<alphabet::Symbol>& symbols) const { out.push_back(sax::Token("push", sax::Token::TokenType::START_ELEMENT)); for (const auto& symbol : symbols) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } out.push_back(sax::Token("push", sax::Token::TokenType::END_ELEMENT)); } void AutomatonToXMLComposer::composeTransitionSinglePush(std::list<sax::Token>& out, const alphabet::Symbol& symbol) const { out.push_back(sax::Token("push", sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); out.push_back(sax::Token("push", sax::Token::TokenType::END_ELEMENT)); } void AutomatonToXMLComposer::composeTransitionInputSymbol(std::list<sax::Token>& out, const alphabet::Symbol& symbol) const { out.push_back(sax::Token("input", sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); out.push_back(sax::Token("input", sax::Token::TokenType::END_ELEMENT)); } void AutomatonToXMLComposer::composeTransitionOutputSymbol(std::list<sax::Token>& out, const alphabet::Symbol& symbol) const { out.push_back(sax::Token("output", sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); out.push_back(sax::Token("output", sax::Token::TokenType::END_ELEMENT)); } @@ -550,7 +550,7 @@ void AutomatonToXMLComposer::composeTransitionInputEpsilonSymbol(std::list<sax:: out.push_back(sax::Token("epsilon", sax::Token::TokenType::START_ELEMENT)); out.push_back(sax::Token("epsilon", sax::Token::TokenType::END_ELEMENT)); } else { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol.get<alphabet::Symbol>())); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol.get<alphabet::Symbol>())); } out.push_back(sax::Token("input", sax::Token::TokenType::END_ELEMENT)); } @@ -561,20 +561,20 @@ void AutomatonToXMLComposer::composeTransitionOutputEpsilonSymbol(std::list<sax: out.push_back(sax::Token("epsilon", sax::Token::TokenType::START_ELEMENT)); out.push_back(sax::Token("epsilon", sax::Token::TokenType::END_ELEMENT)); } else { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol.get<alphabet::Symbol>())); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol.get<alphabet::Symbol>())); } out.push_back(sax::Token("output", sax::Token::TokenType::END_ELEMENT)); } void AutomatonToXMLComposer::composeTransitionInputString(std::list<sax::Token>& out, const string::LinearString& string) const { out.push_back(sax::Token("input", sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<string::LinearString>::compose(string)); + out.splice(out.end(), alib::xmlApi<string::LinearString>::compose(string)); out.push_back(sax::Token("input", sax::Token::TokenType::END_ELEMENT)); } void AutomatonToXMLComposer::composeTransitionInputRegexp(std::list<sax::Token>& out, const regexp::RegExp& regexp) const { out.push_back(sax::Token("input", sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<regexp::RegExp>::compose(regexp)); + out.splice(out.end(), alib::xmlApi<regexp::RegExp>::compose(regexp)); out.push_back(sax::Token("input", sax::Token::TokenType::END_ELEMENT)); } @@ -841,7 +841,7 @@ std::list<sax::Token> AutomatonToXMLComposer::compose(const OneTapeDTM& automato std::list<sax::Token> AutomatonToXMLComposer::compose(const State& state) const { std::list<sax::Token> out; - out.splice(out.end(), alib::api<label::Label>::compose(state.getName())); + out.splice(out.end(), alib::xmlApi<label::Label>::compose(state.getName())); return out; } diff --git a/alib2data/src/automaton/AutomatonToXMLComposer.h b/alib2data/src/automaton/AutomatonToXMLComposer.h index 9a6db5ad70..f99ce677aa 100644 --- a/alib2data/src/automaton/AutomatonToXMLComposer.h +++ b/alib2data/src/automaton/AutomatonToXMLComposer.h @@ -30,7 +30,7 @@ namespace alib { template<typename T> -struct api; +struct xmlApi; } /* namespace alib */ @@ -115,7 +115,7 @@ class AutomatonToXMLComposer { std::list<sax::Token> compose(const State& state) const; - template<typename T> friend class alib::api; + template<typename T> friend class alib::xmlApi; }; } /* namespace automaton */ diff --git a/alib2data/src/container/ContainerFromXMLParser.cpp b/alib2data/src/container/ContainerFromXMLParser.cpp index 540532b430..61c991a351 100644 --- a/alib2data/src/container/ContainerFromXMLParser.cpp +++ b/alib2data/src/container/ContainerFromXMLParser.cpp @@ -15,16 +15,16 @@ Container ContainerFromXMLParser::parseContainer(std::list<sax::Token>& input) c } Container ContainerFromXMLParser::parseContainer(std::list<sax::Token>& input, const std::set<FEATURES>& features) const { - if(alib::api<ObjectsSet>::first(input)) { + if(alib::xmlApi<ObjectsSet>::first(input)) { if(!features.count(FEATURES::SET)) throw exception::AlibException(); return Container(parseObjectsSet(input)); - } else if(alib::api<ObjectsVector>::first(input)) { + } else if(alib::xmlApi<ObjectsVector>::first(input)) { if(!features.count(FEATURES::VECTOR)) throw exception::AlibException(); return Container(parseObjectsVector(input)); - } else if(alib::api<ObjectsPair>::first(input)) { + } else if(alib::xmlApi<ObjectsPair>::first(input)) { if(!features.count(FEATURES::PAIR)) throw exception::AlibException(); return Container(parseObjectsPair(input)); - } else if(alib::api<ObjectsMap>::first(input)) { + } else if(alib::xmlApi<ObjectsMap>::first(input)) { if(!features.count(FEATURES::MAP)) throw exception::AlibException(); return Container(parseObjectsMap(input)); } else { @@ -33,7 +33,7 @@ Container ContainerFromXMLParser::parseContainer(std::list<sax::Token>& input, c } bool ContainerFromXMLParser::first(const std::list<sax::Token>& input) const { - if(alib::api<ObjectsSet>::first(input) || alib::api<ObjectsVector>::first(input) || alib::api<ObjectsPair>::first(input) || alib::api<ObjectsMap>::first(input)) { + if(alib::xmlApi<ObjectsSet>::first(input) || alib::xmlApi<ObjectsVector>::first(input) || alib::xmlApi<ObjectsPair>::first(input) || alib::xmlApi<ObjectsMap>::first(input)) { return true; } else { return false; @@ -46,7 +46,7 @@ ObjectsSet ContainerFromXMLParser::parseObjectsSet(std::list<sax::Token>& input) ObjectsSet set; while(isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - set.insert(alib::api<alib::Object>::parse(input)); + set.insert(alib::xmlApi<alib::Object>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, alib::Names::CONTAINER_OBJECTS_SET); @@ -59,7 +59,7 @@ ObjectsVector ContainerFromXMLParser::parseObjectsVector(std::list<sax::Token>& ObjectsVector vector; while(isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - vector.push_back(alib::api<alib::Object>::parse(input)); + vector.push_back(alib::xmlApi<alib::Object>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, alib::Names::CONTAINER_OBJECTS_VECTOR); @@ -69,8 +69,8 @@ ObjectsVector ContainerFromXMLParser::parseObjectsVector(std::list<sax::Token>& ObjectsPair ContainerFromXMLParser::parseObjectsPair(std::list<sax::Token>& input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, alib::Names::CONTAINER_OBJECTS_PAIR); - alib::Object first = alib::api<alib::Object>::parse(input); - alib::Object second = alib::api<alib::Object>::parse(input); + alib::Object first = alib::xmlApi<alib::Object>::parse(input); + alib::Object second = alib::xmlApi<alib::Object>::parse(input); ObjectsPair pair(first, second); @@ -83,7 +83,7 @@ ObjectsMap ContainerFromXMLParser::parseObjectsMap(std::list<sax::Token>& input) ObjectsMap map; while(isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - map.insert(alib::api<std::pair<alib::Object, alib::Object>>::parse(input)); + map.insert(alib::xmlApi<std::pair<alib::Object, alib::Object>>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, alib::Names::CONTAINER_OBJECTS_MAP); diff --git a/alib2data/src/container/ContainerFromXMLParser.hpp b/alib2data/src/container/ContainerFromXMLParser.hpp index 3c1c7b6433..4005eac17b 100644 --- a/alib2data/src/container/ContainerFromXMLParser.hpp +++ b/alib2data/src/container/ContainerFromXMLParser.hpp @@ -24,7 +24,7 @@ namespace alib { template<typename T> -struct api; +struct xmlApi; } /* namespace alib */ @@ -60,7 +60,7 @@ class ContainerFromXMLParser : public sax::FromXMLParserHelper { template<typename ... Ts> std::variant<Ts...> parseVariant(std::list<sax::Token>& input) const; - template<typename T> friend class alib::api; + template<typename T> friend class alib::xmlApi; public: bool first(const std::list<sax::Token>& input) const; @@ -68,7 +68,7 @@ public: } /* namespace container */ -#include "../Api.hpp" +#include "../XmlApi.hpp" namespace container { @@ -79,7 +79,7 @@ std::set<T> ContainerFromXMLParser::parseSet(std::list<sax::Token>& input) const std::set<T> set; while(isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - set.insert(alib::api<T>::parse(input)); + set.insert(alib::xmlApi<T>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, alib::Names::CONTAINER_OBJECTS_SET); @@ -93,7 +93,7 @@ std::vector<T> ContainerFromXMLParser::parseVector(std::list<sax::Token>& input) std::vector<T> vector; while(isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - vector.push_back(alib::api<T>::parse(input)); + vector.push_back(alib::xmlApi<T>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, alib::Names::CONTAINER_OBJECTS_VECTOR); @@ -104,8 +104,8 @@ template<typename T, typename R> std::pair<T, R> ContainerFromXMLParser::parsePair(std::list<sax::Token>& input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, alib::Names::CONTAINER_OBJECTS_PAIR); - T first = alib::api<T>::parse(input); - R second = alib::api<R>::parse(input); + T first = alib::xmlApi<T>::parse(input); + R second = alib::xmlApi<R>::parse(input); popToken(input, sax::Token::TokenType::END_ELEMENT, alib::Names::CONTAINER_OBJECTS_PAIR); return std::make_pair(first, second); @@ -118,7 +118,7 @@ std::map<T, R> ContainerFromXMLParser::parseMap(std::list<sax::Token>& input) co std::map<T, R> map; while(isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - map.insert(alib::api<std::pair<T, R>>::parse(input)); + map.insert(alib::xmlApi<std::pair<T, R>>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, alib::Names::CONTAINER_OBJECTS_MAP); @@ -133,7 +133,7 @@ T parseVariantHelper(std::list<sax::Token>&) { template<typename T, typename R, typename ... Ts> T parseVariantHelper(std::list<sax::Token>& input) { - if(alib::api<R>::first(input)) return T(alib::api<R>::parse(input)); + if(alib::xmlApi<R>::first(input)) return T(alib::xmlApi<R>::parse(input)); return parseVariantHelper<T, Ts...>(input); } diff --git a/alib2data/src/container/ContainerToXMLComposer.cpp b/alib2data/src/container/ContainerToXMLComposer.cpp index e6a5cee318..04f42e4b27 100644 --- a/alib2data/src/container/ContainerToXMLComposer.cpp +++ b/alib2data/src/container/ContainerToXMLComposer.cpp @@ -26,7 +26,7 @@ std::list<sax::Token> ContainerToXMLComposer::compose(const ObjectsSet& containe out.push_back(sax::Token(alib::Names::CONTAINER_OBJECTS_SET, sax::Token::TokenType::START_ELEMENT)); for(const alib::Object& item : container) { - out.splice(out.end(), alib::api<alib::Object>::compose(item)); + out.splice(out.end(), alib::xmlApi<alib::Object>::compose(item)); } out.push_back(sax::Token(alib::Names::CONTAINER_OBJECTS_SET, sax::Token::TokenType::END_ELEMENT)); @@ -38,7 +38,7 @@ std::list<sax::Token> ContainerToXMLComposer::compose(const ObjectsVector& conta out.push_back(sax::Token(alib::Names::CONTAINER_OBJECTS_VECTOR, sax::Token::TokenType::START_ELEMENT)); for(const alib::Object& item : container) { - out.splice(out.end(), alib::api<alib::Object>::compose(item)); + out.splice(out.end(), alib::xmlApi<alib::Object>::compose(item)); } out.push_back(sax::Token(alib::Names::CONTAINER_OBJECTS_VECTOR, sax::Token::TokenType::END_ELEMENT)); @@ -49,8 +49,8 @@ std::list<sax::Token> ContainerToXMLComposer::compose(const ObjectsPair& contain std::list<sax::Token> out; out.push_back(sax::Token(alib::Names::CONTAINER_OBJECTS_PAIR, sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<alib::Object>::compose(container.first)); - out.splice(out.end(), alib::api<alib::Object>::compose(container.second)); + out.splice(out.end(), alib::xmlApi<alib::Object>::compose(container.first)); + out.splice(out.end(), alib::xmlApi<alib::Object>::compose(container.second)); out.push_back(sax::Token(alib::Names::CONTAINER_OBJECTS_PAIR, sax::Token::TokenType::END_ELEMENT)); return out; @@ -61,7 +61,7 @@ std::list<sax::Token> ContainerToXMLComposer::compose(const ObjectsMap& containe out.push_back(sax::Token(alib::Names::CONTAINER_OBJECTS_MAP, sax::Token::TokenType::START_ELEMENT)); for(const std::pair<alib::Object, alib::Object>& item : container) { - out.splice(out.end(), alib::api<std::pair<alib::Object, alib::Object>>::compose(item)); + out.splice(out.end(), alib::xmlApi<std::pair<alib::Object, alib::Object>>::compose(item)); } out.push_back(sax::Token(alib::Names::CONTAINER_OBJECTS_MAP, sax::Token::TokenType::END_ELEMENT)); diff --git a/alib2data/src/container/ContainerToXMLComposer.hpp b/alib2data/src/container/ContainerToXMLComposer.hpp index 83bf6432bf..34af337d99 100644 --- a/alib2data/src/container/ContainerToXMLComposer.hpp +++ b/alib2data/src/container/ContainerToXMLComposer.hpp @@ -20,7 +20,7 @@ namespace alib { template<typename T> -struct api; +struct xmlApi; } /* namespace alib */ @@ -67,12 +67,12 @@ class ContainerToXMLComposer { template<typename ... Ts> std::list<sax::Token> compose(const std::variant<Ts...>& container) const; - template<typename T> friend class alib::api; + template<typename T> friend class alib::xmlApi; }; } /* namespace container */ -#include "../Api.hpp" +#include "../XmlApi.hpp" namespace container { @@ -82,7 +82,7 @@ std::list<sax::Token> ContainerToXMLComposer::compose(const std::set<T>& contain out.push_back(sax::Token(alib::Names::CONTAINER_OBJECTS_SET, sax::Token::TokenType::START_ELEMENT)); for(const T& item : container) { - out.splice(out.end(), alib::api<T>::compose(item)); + out.splice(out.end(), alib::xmlApi<T>::compose(item)); } out.push_back(sax::Token(alib::Names::CONTAINER_OBJECTS_SET, sax::Token::TokenType::END_ELEMENT)); @@ -95,7 +95,7 @@ std::list<sax::Token> ContainerToXMLComposer::compose(const std::vector<T>& cont out.push_back(sax::Token(alib::Names::CONTAINER_OBJECTS_VECTOR, sax::Token::TokenType::START_ELEMENT)); for(const T& item : container) { - out.splice(out.end(), alib::api<T>::compose(item)); + out.splice(out.end(), alib::xmlApi<T>::compose(item)); } out.push_back(sax::Token(alib::Names::CONTAINER_OBJECTS_VECTOR, sax::Token::TokenType::END_ELEMENT)); @@ -107,8 +107,8 @@ std::list<sax::Token> ContainerToXMLComposer::compose(const std::pair<T, R>& con std::list<sax::Token> out; out.push_back(sax::Token(alib::Names::CONTAINER_OBJECTS_PAIR, sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<T>::compose(container.first)); - out.splice(out.end(), alib::api<R>::compose(container.second)); + out.splice(out.end(), alib::xmlApi<T>::compose(container.first)); + out.splice(out.end(), alib::xmlApi<R>::compose(container.second)); out.push_back(sax::Token(alib::Names::CONTAINER_OBJECTS_PAIR, sax::Token::TokenType::END_ELEMENT)); return out; @@ -120,7 +120,7 @@ std::list<sax::Token> ContainerToXMLComposer::compose(const std::map<T, R>& cont out.push_back(sax::Token(alib::Names::CONTAINER_OBJECTS_MAP, sax::Token::TokenType::START_ELEMENT)); for(const std::pair<T, R>& item : container) { - out.splice(out.end(), alib::api<std::pair<T, R>>::compose(item)); + out.splice(out.end(), alib::xmlApi<std::pair<T, R>>::compose(item)); } out.push_back(sax::Token(alib::Names::CONTAINER_OBJECTS_MAP, sax::Token::TokenType::END_ELEMENT)); @@ -135,7 +135,7 @@ std::list<sax::Token> composeVariantHelper(const T&) { template<typename T, typename R, typename ... Ts> std::list<sax::Token> composeVariantHelper(const T& container) { - if(container.template is<R>()) return alib::api<R>::compose(container.template get<R>()); + if(container.template is<R>()) return alib::xmlApi<R>::compose(container.template get<R>()); return composeVariantHelper<T, Ts...>(container); } diff --git a/alib2data/src/exception/ExceptionFromXMLParser.cpp b/alib2data/src/exception/ExceptionFromXMLParser.cpp index 6ee369c7ce..9bf3a21694 100644 --- a/alib2data/src/exception/ExceptionFromXMLParser.cpp +++ b/alib2data/src/exception/ExceptionFromXMLParser.cpp @@ -9,7 +9,7 @@ #include "../sax/ParserException.h" #include <string> -#include "../Api.hpp" +#include "../XmlApi.hpp" namespace exception { @@ -39,7 +39,7 @@ AlibException ExceptionFromXMLParser::parseException(std::list<sax::Token>& inpu } bool ExceptionFromXMLParser::first(const std::list<sax::Token>& input) const { - if(alib::api<AlibException>::first(input)) { + if(alib::xmlApi<AlibException>::first(input)) { return true; } else { return false; diff --git a/alib2data/src/exception/ExceptionFromXMLParser.h b/alib2data/src/exception/ExceptionFromXMLParser.h index 10dacf6c22..5ca438f0a3 100644 --- a/alib2data/src/exception/ExceptionFromXMLParser.h +++ b/alib2data/src/exception/ExceptionFromXMLParser.h @@ -17,7 +17,7 @@ namespace alib { template<typename T> -struct api; +struct xmlApi; } /* namespace alib */ @@ -33,7 +33,7 @@ class ExceptionFromXMLParser : public sax::FromXMLParserHelper { public: bool first(const std::list<sax::Token>& input) const; - template<typename T> friend class alib::api; + template<typename T> friend class alib::xmlApi; }; } /* namespace exception */ diff --git a/alib2data/src/exception/ExceptionToXMLComposer.cpp b/alib2data/src/exception/ExceptionToXMLComposer.cpp index f7fa294652..d95599ad15 100644 --- a/alib2data/src/exception/ExceptionToXMLComposer.cpp +++ b/alib2data/src/exception/ExceptionToXMLComposer.cpp @@ -7,7 +7,7 @@ #include "ExceptionToXMLComposer.h" -#include "../Api.hpp" +#include "../XmlApi.hpp" namespace exception { diff --git a/alib2data/src/exception/ExceptionToXMLComposer.h b/alib2data/src/exception/ExceptionToXMLComposer.h index 0a6ccc9308..4bb64d20d3 100644 --- a/alib2data/src/exception/ExceptionToXMLComposer.h +++ b/alib2data/src/exception/ExceptionToXMLComposer.h @@ -15,7 +15,7 @@ namespace alib { template<typename T> -struct api; +struct xmlApi; } /* namespace alib */ @@ -32,7 +32,7 @@ class ExceptionToXMLComposer { */ std::list<sax::Token> compose(const AlibException& exception) const; - template<typename T> friend class alib::api; + template<typename T> friend class alib::xmlApi; }; } /* namespace exception */ diff --git a/alib2data/src/factory/DataFactory.hpp b/alib2data/src/factory/XmlDataFactory.hpp similarity index 82% rename from alib2data/src/factory/DataFactory.hpp rename to alib2data/src/factory/XmlDataFactory.hpp index d9789c876e..22f422f62b 100644 --- a/alib2data/src/factory/DataFactory.hpp +++ b/alib2data/src/factory/XmlDataFactory.hpp @@ -1,5 +1,5 @@ /* - * DataFactory.hpp + * XmlDataFactory.hpp * * Created on: Jan 1, 2014 * Author: Jan Travnicek @@ -14,14 +14,14 @@ #include "../sax/Token.h" #include "../sax/SaxParseInterface.h" #include "../sax/SaxComposeInterface.h" -#include "../Api.hpp" +#include "../XmlApi.hpp" namespace alib { /** * Data builder. */ -class DataFactory { +class XmlDataFactory { public: /** * Parses the XML in file and returns the String. @@ -75,9 +75,9 @@ public: static T fromTokens(std::list<sax::Token>& tokens) { if(tokens.size() == 0) throw exception::AlibException("Empty tokens list"); - if(alib::api<exception::AlibException>::first(tokens)) throw alib::api<exception::AlibException>::parse(tokens); + if(alib::xmlApi<exception::AlibException>::first(tokens)) throw alib::xmlApi<exception::AlibException>::parse(tokens); - T res = alib::api<T>::parse(tokens); + T res = alib::xmlApi<T>::parse(tokens); if(tokens.size() != 0) throw exception::AlibException("Unexpeted tokens at the end of the xml"); return res; } @@ -89,7 +89,7 @@ public: */ template<class T> static bool first(const std::list<sax::Token>& tokens) { - return alib::api<exception::AlibException>::first(tokens) || alib::api<T>::first(tokens); + return alib::xmlApi<exception::AlibException>::first(tokens) || alib::xmlApi<T>::first(tokens); } /** @@ -142,21 +142,21 @@ public: */ template<class T> static std::list<sax::Token> toTokens(const T& data) { - return alib::api<T>::compose(data); + return alib::xmlApi<T>::compose(data); } }; template<> -inline bool DataFactory::first<exception::AlibException>(const std::list<sax::Token>& tokens) { - return alib::api<exception::AlibException>::first(tokens); +inline bool XmlDataFactory::first<exception::AlibException>(const std::list<sax::Token>& tokens) { + return alib::xmlApi<exception::AlibException>::first(tokens); } template<> -inline exception::AlibException DataFactory::fromTokens<exception::AlibException>(std::list<sax::Token>& tokens) { +inline exception::AlibException XmlDataFactory::fromTokens<exception::AlibException>(std::list<sax::Token>& tokens) { if(tokens.size() == 0) throw exception::AlibException("Empty tokens list"); - exception::AlibException res = alib::api<exception::AlibException>::parse(tokens); + exception::AlibException res = alib::xmlApi<exception::AlibException>::parse(tokens); if(tokens.size() != 0) throw exception::AlibException("Unexpeted tokens at the end of the xml"); return res; } diff --git a/alib2data/src/grammar/GrammarFromXMLParser.cpp b/alib2data/src/grammar/GrammarFromXMLParser.cpp index fbbe2a5e82..e78391b203 100644 --- a/alib2data/src/grammar/GrammarFromXMLParser.cpp +++ b/alib2data/src/grammar/GrammarFromXMLParser.cpp @@ -10,7 +10,7 @@ #include "../sax/ParserException.h" #include "../alphabet/LabeledSymbol.h" -#include "../Api.hpp" +#include "../XmlApi.hpp" namespace grammar { @@ -19,43 +19,43 @@ Grammar GrammarFromXMLParser::parseGrammar(std::list<sax::Token> &input) const { } Grammar GrammarFromXMLParser::parseGrammar(std::list<sax::Token>& input, const std::set<FEATURES>& features) const { - if(alib::api<UnrestrictedGrammar>::first(input)) { + if(alib::xmlApi<UnrestrictedGrammar>::first(input)) { if(!features.count(FEATURES::UNRESTRICTED_GRAMMAR)) throw exception::AlibException(); return Grammar(parseUnrestrictedGrammar(input)); - } else if(alib::api<ContextPreservingUnrestrictedGrammar>::first(input)) { + } else if(alib::xmlApi<ContextPreservingUnrestrictedGrammar>::first(input)) { if(!features.count(FEATURES::CONTEXT_PRESERVING_UNRESTRICTED_GRAMMAR)) throw exception::AlibException(); return Grammar(parseContextPreservingUnrestrictedGrammar(input)); - } else if(alib::api<NonContractingGrammar>::first(input)) { + } else if(alib::xmlApi<NonContractingGrammar>::first(input)) { if(!features.count(FEATURES::NON_CONTRACTING_GRAMMAR)) throw exception::AlibException(); return Grammar(parseNonContractingGrammar(input)); - } else if(alib::api<CSG>::first(input)) { + } else if(alib::xmlApi<CSG>::first(input)) { if(!features.count(FEATURES::CSG)) throw exception::AlibException(); return Grammar(parseCSG(input)); - } else if(alib::api<GNF>::first(input)) { + } else if(alib::xmlApi<GNF>::first(input)) { if(!features.count(FEATURES::GNF)) throw exception::AlibException(); return Grammar(parseGNF(input)); - } else if(alib::api<CNF>::first(input)) { + } else if(alib::xmlApi<CNF>::first(input)) { if(!features.count(FEATURES::CNF)) throw exception::AlibException(); return Grammar(parseCNF(input)); - } else if(alib::api<EpsilonFreeCFG>::first(input)) { + } else if(alib::xmlApi<EpsilonFreeCFG>::first(input)) { if(!features.count(FEATURES::EPSILON_FREE_CFG)) throw exception::AlibException(); return Grammar(parseEpsilonFreeCFG(input)); - } else if(alib::api<CFG>::first(input)) { + } else if(alib::xmlApi<CFG>::first(input)) { if(!features.count(FEATURES::CFG)) throw exception::AlibException(); return Grammar(parseCFG(input)); - } else if(alib::api<LG>::first(input)) { + } else if(alib::xmlApi<LG>::first(input)) { if(!features.count(FEATURES::LG)) throw exception::AlibException(); return Grammar(parseLG(input)); - } else if(alib::api<RightRG>::first(input)) { + } else if(alib::xmlApi<RightRG>::first(input)) { if(!features.count(FEATURES::RIGHT_RG)) throw exception::AlibException(); return Grammar(parseRightRG(input)); - } else if(alib::api<RightLG>::first(input)) { + } else if(alib::xmlApi<RightLG>::first(input)) { if(!features.count(FEATURES::RIGHT_LG)) throw exception::AlibException(); return Grammar(parseRightLG(input)); - } else if(alib::api<LeftRG>::first(input)) { + } else if(alib::xmlApi<LeftRG>::first(input)) { if(!features.count(FEATURES::LEFT_RG)) throw exception::AlibException(); return Grammar(parseLeftRG(input)); - } else if(alib::api<LeftLG>::first(input)) { + } else if(alib::xmlApi<LeftLG>::first(input)) { if(!features.count(FEATURES::LEFT_LG)) throw exception::AlibException(); return Grammar(parseLeftLG(input)); } else @@ -63,7 +63,7 @@ Grammar GrammarFromXMLParser::parseGrammar(std::list<sax::Token>& input, const s } bool GrammarFromXMLParser::first(const std::list<sax::Token>& input) const { - if(alib::api<UnrestrictedGrammar>::first(input) || alib::api<ContextPreservingUnrestrictedGrammar>::first(input) || alib::api<NonContractingGrammar>::first(input) || alib::api<CSG>::first(input) || alib::api<GNF>::first(input) || alib::api<CNF>::first(input) || alib::api<EpsilonFreeCFG>::first(input) || alib::api<CFG>::first(input) || alib::api<LG>::first(input) || alib::api<RightRG>::first(input) || alib::api<RightLG>::first(input) || alib::api<LeftLG>::first(input) || alib::api<LeftRG>::first(input)) { + if(alib::xmlApi<UnrestrictedGrammar>::first(input) || alib::xmlApi<ContextPreservingUnrestrictedGrammar>::first(input) || alib::xmlApi<NonContractingGrammar>::first(input) || alib::xmlApi<CSG>::first(input) || alib::xmlApi<GNF>::first(input) || alib::xmlApi<CNF>::first(input) || alib::xmlApi<EpsilonFreeCFG>::first(input) || alib::xmlApi<CFG>::first(input) || alib::xmlApi<LG>::first(input) || alib::xmlApi<RightRG>::first(input) || alib::xmlApi<RightLG>::first(input) || alib::xmlApi<LeftLG>::first(input) || alib::xmlApi<LeftRG>::first(input)) { return true; } else { return false; @@ -317,7 +317,7 @@ std::set<alphabet::Symbol> GrammarFromXMLParser::parseNonterminalAlphabet(std::l std::set<alphabet::Symbol> inputSymbols; popToken(input, sax::Token::TokenType::START_ELEMENT, "nonterminalAlphabet"); while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - inputSymbols.insert(alib::api<alphabet::Symbol>::parse(input)); + inputSymbols.insert(alib::xmlApi<alphabet::Symbol>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, "nonterminalAlphabet"); return inputSymbols; @@ -327,7 +327,7 @@ std::set<alphabet::Symbol> GrammarFromXMLParser::parseTerminalAlphabet(std::list std::set<alphabet::Symbol> inputSymbols; popToken(input, sax::Token::TokenType::START_ELEMENT, "terminalAlphabet"); while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - inputSymbols.insert(alib::api<alphabet::Symbol>::parse(input)); + inputSymbols.insert(alib::xmlApi<alphabet::Symbol>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, "terminalAlphabet"); return inputSymbols; @@ -335,7 +335,7 @@ std::set<alphabet::Symbol> GrammarFromXMLParser::parseTerminalAlphabet(std::list alphabet::Symbol GrammarFromXMLParser::parseInitialSymbol(std::list<sax::Token>& input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, "initialSymbol"); - alphabet::Symbol blank(alib::api<alphabet::Symbol>::parse(input)); + alphabet::Symbol blank(alib::xmlApi<alphabet::Symbol>::parse(input)); popToken(input, sax::Token::TokenType::END_ELEMENT, "initialSymbol"); return blank; } @@ -457,7 +457,7 @@ std::vector<alphabet::Symbol> GrammarFromXMLParser::parseRuleLContext(std::list< input.pop_front(); popToken(input, sax::Token::TokenType::END_ELEMENT, "epsilon"); } else while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - lContext.push_back(alib::api<alphabet::Symbol>::parse(input)); + lContext.push_back(alib::xmlApi<alphabet::Symbol>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, "lContext"); return lContext; @@ -470,7 +470,7 @@ std::vector<alphabet::Symbol> GrammarFromXMLParser::parseRuleLHS(std::list<sax:: input.pop_front(); popToken(input, sax::Token::TokenType::END_ELEMENT, "epsilon"); } else while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - lhs.push_back(alib::api<alphabet::Symbol>::parse(input)); + lhs.push_back(alib::xmlApi<alphabet::Symbol>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, "lhs"); return lhs; @@ -478,7 +478,7 @@ std::vector<alphabet::Symbol> GrammarFromXMLParser::parseRuleLHS(std::list<sax:: alphabet::Symbol GrammarFromXMLParser::parseRuleSingleSymbolLHS(std::list<sax::Token>& input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, "lhs"); - alphabet::Symbol lhs = alib::api<alphabet::Symbol>::parse(input); + alphabet::Symbol lhs = alib::xmlApi<alphabet::Symbol>::parse(input); popToken(input, sax::Token::TokenType::END_ELEMENT, "lhs"); return lhs; } @@ -490,7 +490,7 @@ std::vector<alphabet::Symbol> GrammarFromXMLParser::parseRuleRContext(std::list< input.pop_front(); popToken(input, sax::Token::TokenType::END_ELEMENT, "epsilon"); } else while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - rContext.push_back(alib::api<alphabet::Symbol>::parse(input)); + rContext.push_back(alib::xmlApi<alphabet::Symbol>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, "rContext"); return rContext; @@ -498,10 +498,10 @@ std::vector<alphabet::Symbol> GrammarFromXMLParser::parseRuleRContext(std::list< std::pair<alphabet::Symbol, std::vector<alphabet::Symbol>> GrammarFromXMLParser::parseRuleGNFRHS(std::list<sax::Token>& input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, "rhs"); - alphabet::Symbol first = alib::api<alphabet::Symbol>::parse(input); + alphabet::Symbol first = alib::xmlApi<alphabet::Symbol>::parse(input); std::vector<alphabet::Symbol> second; while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - second.push_back(alib::api<alphabet::Symbol>::parse(input)); + second.push_back(alib::xmlApi<alphabet::Symbol>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, "rhs"); return std::make_pair(first, second); @@ -514,7 +514,7 @@ std::vector<alphabet::Symbol> GrammarFromXMLParser::parseRuleRHS(std::list<sax:: input.pop_front(); popToken(input, sax::Token::TokenType::END_ELEMENT, "epsilon"); } else while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - rhs.push_back(alib::api<alphabet::Symbol>::parse(input)); + rhs.push_back(alib::xmlApi<alphabet::Symbol>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, "rhs"); return rhs; @@ -522,9 +522,9 @@ std::vector<alphabet::Symbol> GrammarFromXMLParser::parseRuleRHS(std::list<sax:: std::variant<alphabet::Symbol, std::pair<alphabet::Symbol, alphabet::Symbol>> GrammarFromXMLParser::parseRuleOneOrTwoSymbolsRHS(std::list<sax::Token>& input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, "rhs"); - alphabet::Symbol first = alib::api<alphabet::Symbol>::parse(input); + alphabet::Symbol first = alib::xmlApi<alphabet::Symbol>::parse(input); if(isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - alphabet::Symbol second = alib::api<alphabet::Symbol>::parse(input); + alphabet::Symbol second = alib::xmlApi<alphabet::Symbol>::parse(input); popToken(input, sax::Token::TokenType::END_ELEMENT, "rhs"); return std::variant<alphabet::Symbol, std::pair<alphabet::Symbol, alphabet::Symbol>>(std::make_pair(first, second)); } else { diff --git a/alib2data/src/grammar/GrammarFromXMLParser.h b/alib2data/src/grammar/GrammarFromXMLParser.h index 13fb785df0..b900ef188b 100644 --- a/alib2data/src/grammar/GrammarFromXMLParser.h +++ b/alib2data/src/grammar/GrammarFromXMLParser.h @@ -33,7 +33,7 @@ namespace alib { template<typename T> -struct api; +struct xmlApi; } /* namespace alib */ @@ -90,7 +90,7 @@ class GrammarFromXMLParser : public sax::FromXMLParserHelper { LeftRG parseLeftRG(std::list<sax::Token>& input) const; LeftLG parseLeftLG(std::list<sax::Token>& input) const; - template<typename T> friend class alib::api; + template<typename T> friend class alib::xmlApi; public: bool first(const std::list<sax::Token>& input) const; }; diff --git a/alib2data/src/grammar/GrammarToXMLComposer.cpp b/alib2data/src/grammar/GrammarToXMLComposer.cpp index 31c1e6de53..b7c4ff1829 100644 --- a/alib2data/src/grammar/GrammarToXMLComposer.cpp +++ b/alib2data/src/grammar/GrammarToXMLComposer.cpp @@ -8,7 +8,7 @@ #include "GrammarToXMLComposer.h" #include "../alphabet/BlankSymbol.h" -#include "../Api.hpp" +#include "../XmlApi.hpp" namespace grammar { @@ -203,7 +203,7 @@ std::list<sax::Token> GrammarToXMLComposer::compose(const UnrestrictedGrammar& g void GrammarToXMLComposer::composeNonterminalAlphabet(std::list<sax::Token>& out, const std::set<alphabet::Symbol>& symbols) const { out.push_back(sax::Token("nonterminalAlphabet", sax::Token::TokenType::START_ELEMENT)); for (const auto& symbol : symbols) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } out.push_back(sax::Token("nonterminalAlphabet", sax::Token::TokenType::END_ELEMENT)); } @@ -211,14 +211,14 @@ void GrammarToXMLComposer::composeNonterminalAlphabet(std::list<sax::Token>& out void GrammarToXMLComposer::composeTerminalAlphabet(std::list<sax::Token>& out, const std::set<alphabet::Symbol>& symbols) const { out.push_back(sax::Token("terminalAlphabet", sax::Token::TokenType::START_ELEMENT)); for (const auto& symbol : symbols) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } out.push_back(sax::Token("terminalAlphabet", sax::Token::TokenType::END_ELEMENT)); } void GrammarToXMLComposer::composeInitialSymbol(std::list<sax::Token>& out, const alphabet::Symbol& symbol) const { out.push_back(sax::Token("initialSymbol", sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); out.push_back(sax::Token("initialSymbol", sax::Token::TokenType::END_ELEMENT)); } @@ -466,7 +466,7 @@ void GrammarToXMLComposer::composeRuleLContext(std::list<sax::Token>& out, const out.push_back(sax::Token("epsilon", sax::Token::TokenType::START_ELEMENT)); out.push_back(sax::Token("epsilon", sax::Token::TokenType::END_ELEMENT)); } else for (const auto& symbol : symbols) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } out.push_back(sax::Token("lContext", sax::Token::TokenType::END_ELEMENT)); } @@ -477,7 +477,7 @@ void GrammarToXMLComposer::composeRuleLHS(std::list<sax::Token>& out, const std: out.push_back(sax::Token("epsilon", sax::Token::TokenType::START_ELEMENT)); out.push_back(sax::Token("epsilon", sax::Token::TokenType::END_ELEMENT)); } else for (const auto& symbol : symbols) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } out.push_back(sax::Token("lhs", sax::Token::TokenType::END_ELEMENT)); } @@ -488,14 +488,14 @@ void GrammarToXMLComposer::composeRuleRContext(std::list<sax::Token>& out, const out.push_back(sax::Token("epsilon", sax::Token::TokenType::START_ELEMENT)); out.push_back(sax::Token("epsilon", sax::Token::TokenType::END_ELEMENT)); } else for (const auto& symbol : symbols) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } out.push_back(sax::Token("rContext", sax::Token::TokenType::END_ELEMENT)); } void GrammarToXMLComposer::composeRuleSingleSymbolLHS(std::list<sax::Token>& out, const alphabet::Symbol& symbol) const { out.push_back(sax::Token("lhs", sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); out.push_back(sax::Token("lhs", sax::Token::TokenType::END_ELEMENT)); } @@ -505,7 +505,7 @@ void GrammarToXMLComposer::composeRuleRHS(std::list<sax::Token>& out, const std: out.push_back(sax::Token("epsilon", sax::Token::TokenType::START_ELEMENT)); out.push_back(sax::Token("epsilon", sax::Token::TokenType::END_ELEMENT)); } else for (const auto& symbol : symbols) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } out.push_back(sax::Token("rhs", sax::Token::TokenType::END_ELEMENT)); } @@ -513,11 +513,11 @@ void GrammarToXMLComposer::composeRuleRHS(std::list<sax::Token>& out, const std: void GrammarToXMLComposer::composeRuleOneOrTwoSymbolsRHS(std::list<sax::Token>& out, const std::variant<alphabet::Symbol, std::pair<alphabet::Symbol, alphabet::Symbol>>& symbols) const { out.push_back(sax::Token("rhs", sax::Token::TokenType::START_ELEMENT)); if(symbols.is<alphabet::Symbol>()) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbols.get<alphabet::Symbol>())); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbols.get<alphabet::Symbol>())); } else { const std::pair<alphabet::Symbol, alphabet::Symbol>& rhs = symbols.get<std::pair<alphabet::Symbol, alphabet::Symbol>>(); - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(rhs.first)); - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(rhs.second)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(rhs.first)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(rhs.second)); } out.push_back(sax::Token("rhs", sax::Token::TokenType::END_ELEMENT)); } @@ -525,10 +525,10 @@ void GrammarToXMLComposer::composeRuleOneOrTwoSymbolsRHS(std::list<sax::Token>& void GrammarToXMLComposer::composeRuleGNFRHS(std::list<sax::Token>& out, const std::pair<alphabet::Symbol, std::vector<alphabet::Symbol>>& symbols) const { out.push_back(sax::Token("rhs", sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbols.first)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbols.first)); for (const auto& symbol : symbols.second) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } out.push_back(sax::Token("rhs", sax::Token::TokenType::END_ELEMENT)); @@ -542,16 +542,16 @@ void GrammarToXMLComposer::composeRuleLGRHS(std::list<sax::Token>& out, const st out.push_back(sax::Token("epsilon", sax::Token::TokenType::START_ELEMENT)); out.push_back(sax::Token("epsilon", sax::Token::TokenType::END_ELEMENT)); } else for (const auto& symbol : symbols.get<std::vector<alphabet::Symbol>>()) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } } else { const std::tuple<std::vector<alphabet::Symbol>, alphabet::Symbol, std::vector<alphabet::Symbol>>& rhs = symbols.get<std::tuple<std::vector<alphabet::Symbol>, alphabet::Symbol, std::vector<alphabet::Symbol>>>(); for (const auto& symbol : std::get<0>(rhs)) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(std::get<1>(rhs))); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(std::get<1>(rhs))); for (const auto& symbol : std::get<2>(rhs)) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } } out.push_back(sax::Token("rhs", sax::Token::TokenType::END_ELEMENT)); @@ -565,13 +565,13 @@ void GrammarToXMLComposer::composeRuleLeftLGRHS(std::list<sax::Token>& out, cons out.push_back(sax::Token("epsilon", sax::Token::TokenType::START_ELEMENT)); out.push_back(sax::Token("epsilon", sax::Token::TokenType::END_ELEMENT)); } else for (const auto& symbol : symbols.get<std::vector<alphabet::Symbol>>()) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } } else { const std::pair<alphabet::Symbol, std::vector<alphabet::Symbol>>& rhs = symbols.get<std::pair<alphabet::Symbol, std::vector<alphabet::Symbol>>>(); - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(rhs.first)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(rhs.first)); for (const auto& symbol : rhs.second) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } } out.push_back(sax::Token("rhs", sax::Token::TokenType::END_ELEMENT)); @@ -586,15 +586,15 @@ void GrammarToXMLComposer::composeRuleRightLGRHS(std::list<sax::Token>& out, con out.push_back(sax::Token("epsilon", sax::Token::TokenType::END_ELEMENT)); } else { for (const auto& symbol : symbols.get<std::vector<alphabet::Symbol>>()) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } } } else { const std::pair<std::vector<alphabet::Symbol>, alphabet::Symbol>& rhs = symbols.get<std::pair<std::vector<alphabet::Symbol>, alphabet::Symbol>>(); for (const auto& symbol : rhs.first) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(rhs.second)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(rhs.second)); } out.push_back(sax::Token("rhs", sax::Token::TokenType::END_ELEMENT)); } diff --git a/alib2data/src/grammar/GrammarToXMLComposer.h b/alib2data/src/grammar/GrammarToXMLComposer.h index 254589a102..0e512c6543 100644 --- a/alib2data/src/grammar/GrammarToXMLComposer.h +++ b/alib2data/src/grammar/GrammarToXMLComposer.h @@ -29,7 +29,7 @@ namespace alib { template<typename T> -struct api; +struct xmlApi; } /* namespace alib */ @@ -92,7 +92,7 @@ class GrammarToXMLComposer { std::list<sax::Token> compose(const ContextPreservingUnrestrictedGrammar& grammar) const; std::list<sax::Token> compose(const UnrestrictedGrammar& grammar) const; - template<typename T> friend class alib::api; + template<typename T> friend class alib::xmlApi; }; } /* namespace grammar */ diff --git a/alib2data/src/label/LabelFromXMLParser.cpp b/alib2data/src/label/LabelFromXMLParser.cpp index d6faa56290..0da6f99a8f 100644 --- a/alib2data/src/label/LabelFromXMLParser.cpp +++ b/alib2data/src/label/LabelFromXMLParser.cpp @@ -7,7 +7,7 @@ #include "LabelFromXMLParser.h" #include "../sax/ParserException.h" -#include "../Api.hpp" +#include "../XmlApi.hpp" #include <algorithm> namespace label { @@ -17,22 +17,22 @@ Label LabelFromXMLParser::parseLabel(std::list<sax::Token>& input) const { } Label LabelFromXMLParser::parseLabel(std::list<sax::Token>& input, const std::set<FEATURES>& features) const { - if(alib::api<PrimitiveLabel>::first(input)) { + if(alib::xmlApi<PrimitiveLabel>::first(input)) { if(!features.count(FEATURES::PRIMITIVE)) throw exception::AlibException(); return Label(parsePrimitiveLabel(input)); - } else if(alib::api<HexavigesimalLabel>::first(input)) { + } else if(alib::xmlApi<HexavigesimalLabel>::first(input)) { if(!features.count(FEATURES::HEXAVIGESIMAL)) throw exception::AlibException(); return Label(parseHexavigesimalLabel(input)); - } else if(alib::api<ObjectLabel>::first(input)) { + } else if(alib::xmlApi<ObjectLabel>::first(input)) { if(!features.count(FEATURES::OBJECT)) throw exception::AlibException(); return Label(parseObjectLabel(input)); - } else if(alib::api<LabelSetLabel>::first(input)) { + } else if(alib::xmlApi<LabelSetLabel>::first(input)) { if(!features.count(FEATURES::LABEL_SET)) throw exception::AlibException(); return Label(parseLabelSetLabel(input)); - } else if(alib::api<LabelPairLabel>::first(input)) { + } else if(alib::xmlApi<LabelPairLabel>::first(input)) { if(!features.count(FEATURES::LABEL_PAIR)) throw exception::AlibException(); return Label(parseLabelPairLabel(input)); - } else if(alib::api<UniqueLabel>::first(input)) { + } else if(alib::xmlApi<UniqueLabel>::first(input)) { if(!features.count(FEATURES::UNIQUE_LABEL)) throw exception::AlibException(); return Label(parseUniqueLabel(input)); } else { @@ -41,7 +41,7 @@ Label LabelFromXMLParser::parseLabel(std::list<sax::Token>& input, const std::se } bool LabelFromXMLParser::first(const std::list<sax::Token>& input) const { - if(alib::api<PrimitiveLabel>::first(input) || alib::api<ObjectLabel>::first(input) || alib::api<LabelSetLabel>::first(input) || alib::api<LabelPairLabel>::first(input)) { + if(alib::xmlApi<PrimitiveLabel>::first(input) || alib::xmlApi<ObjectLabel>::first(input) || alib::xmlApi<LabelSetLabel>::first(input) || alib::xmlApi<LabelPairLabel>::first(input)) { return true; } else { return false; @@ -50,7 +50,7 @@ bool LabelFromXMLParser::first(const std::list<sax::Token>& input) const { PrimitiveLabel LabelFromXMLParser::parsePrimitiveLabel(std::list<sax::Token>& input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, alib::Names::LABEL_PRIMITIVE_LABEL); - PrimitiveLabel data(alib::api<primitive::Primitive>::parse(input)); + PrimitiveLabel data(alib::xmlApi<primitive::Primitive>::parse(input)); popToken(input, sax::Token::TokenType::END_ELEMENT, alib::Names::LABEL_PRIMITIVE_LABEL); return data; } @@ -64,7 +64,7 @@ HexavigesimalLabel LabelFromXMLParser::parseHexavigesimalLabel(std::list<sax::To ObjectLabel LabelFromXMLParser::parseObjectLabel(std::list<sax::Token>& input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, alib::Names::LABEL_OBJECT_LABEL); - ObjectLabel data(alib::api<alib::Object>::parse(input)); + ObjectLabel data(alib::xmlApi<alib::Object>::parse(input)); popToken(input, sax::Token::TokenType::END_ELEMENT, alib::Names::LABEL_OBJECT_LABEL); return data; } @@ -82,7 +82,7 @@ LabelSetLabel LabelFromXMLParser::parseLabelSetLabel(std::list<sax::Token>& inpu LabelPairLabel LabelFromXMLParser::parseLabelPairLabel(std::list<sax::Token>& input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, alib::Names::LABEL_LABEL_PAIR_LABEL); - + Label firstLabel = parseLabel(input); Label secondLabel = parseLabel(input); @@ -93,9 +93,9 @@ LabelPairLabel LabelFromXMLParser::parseLabelPairLabel(std::list<sax::Token>& in UniqueLabel LabelFromXMLParser::parseUniqueLabel(std::list<sax::Token>& input) const { popToken(input, sax::Token::TokenType::START_ELEMENT, alib::Names::LABEL_UNIQUE_LABEL); - + Label firstLabel = parseLabel(input); - primitive::Integer secondLabel = alib::api<primitive::Integer>::parse(input); + primitive::Integer secondLabel = alib::xmlApi<primitive::Integer>::parse(input); UniqueLabel data(firstLabel, secondLabel); popToken(input, sax::Token::TokenType::END_ELEMENT, alib::Names::LABEL_UNIQUE_LABEL); diff --git a/alib2data/src/label/LabelFromXMLParser.h b/alib2data/src/label/LabelFromXMLParser.h index f2f2eac5c2..4f9382a66f 100644 --- a/alib2data/src/label/LabelFromXMLParser.h +++ b/alib2data/src/label/LabelFromXMLParser.h @@ -24,7 +24,7 @@ namespace alib { template<typename T> -struct api; +struct xmlApi; } /* namespace alib */ @@ -44,7 +44,7 @@ class LabelFromXMLParser : public sax::FromXMLParserHelper { LabelPairLabel parseLabelPairLabel(std::list<sax::Token>& input) const; UniqueLabel parseUniqueLabel(std::list<sax::Token>& input) const; - template<typename T> friend class alib::api; + template<typename T> friend class alib::xmlApi; public: bool first(const std::list<sax::Token>& input) const; }; diff --git a/alib2data/src/label/LabelToXMLComposer.cpp b/alib2data/src/label/LabelToXMLComposer.cpp index b517f56d29..2ab3cd2e11 100644 --- a/alib2data/src/label/LabelToXMLComposer.cpp +++ b/alib2data/src/label/LabelToXMLComposer.cpp @@ -8,7 +8,7 @@ #include "LabelToXMLComposer.h" #include "../std/itos.h" -#include "../Api.hpp" +#include "../XmlApi.hpp" namespace label { @@ -27,7 +27,7 @@ std::list<sax::Token> LabelToXMLComposer::compose(const LabelBase& label) const std::list<sax::Token> LabelToXMLComposer::compose(const PrimitiveLabel& label) const { std::list<sax::Token> out; out.push_back(sax::Token(alib::Names::LABEL_PRIMITIVE_LABEL, sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<primitive::Primitive>::compose(label.getData())); + out.splice(out.end(), alib::xmlApi<primitive::Primitive>::compose(label.getData())); out.push_back(sax::Token(alib::Names::LABEL_PRIMITIVE_LABEL, sax::Token::TokenType::END_ELEMENT)); return out; } @@ -43,7 +43,7 @@ std::list<sax::Token> LabelToXMLComposer::compose(const HexavigesimalLabel& labe std::list<sax::Token> LabelToXMLComposer::compose(const ObjectLabel& label) const { std::list<sax::Token> out; out.push_back(sax::Token(alib::Names::LABEL_OBJECT_LABEL, sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<alib::Object>::compose(label.getData())); + out.splice(out.end(), alib::xmlApi<alib::Object>::compose(label.getData())); out.push_back(sax::Token(alib::Names::LABEL_OBJECT_LABEL, sax::Token::TokenType::END_ELEMENT)); return out; } @@ -52,7 +52,7 @@ std::list<sax::Token> LabelToXMLComposer::compose(const LabelSetLabel& label) co std::list<sax::Token> out; out.push_back(sax::Token(alib::Names::LABEL_LABEL_SET_LABEL, sax::Token::TokenType::START_ELEMENT)); for(const Label& innerLabel : label.getData()) { - out.splice(out.end(), alib::api<label::Label>::compose(innerLabel)); + out.splice(out.end(), alib::xmlApi<label::Label>::compose(innerLabel)); } out.push_back(sax::Token(alib::Names::LABEL_LABEL_SET_LABEL, sax::Token::TokenType::END_ELEMENT)); return out; @@ -61,8 +61,8 @@ std::list<sax::Token> LabelToXMLComposer::compose(const LabelSetLabel& label) co std::list<sax::Token> LabelToXMLComposer::compose(const LabelPairLabel& label) const { std::list<sax::Token> out; out.push_back(sax::Token(alib::Names::LABEL_LABEL_PAIR_LABEL, sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<label::Label>::compose(label.getData().first)); - out.splice(out.end(), alib::api<label::Label>::compose(label.getData().second)); + out.splice(out.end(), alib::xmlApi<label::Label>::compose(label.getData().first)); + out.splice(out.end(), alib::xmlApi<label::Label>::compose(label.getData().second)); out.push_back(sax::Token(alib::Names::LABEL_LABEL_PAIR_LABEL, sax::Token::TokenType::END_ELEMENT)); return out; } @@ -70,8 +70,8 @@ std::list<sax::Token> LabelToXMLComposer::compose(const LabelPairLabel& label) c std::list<sax::Token> LabelToXMLComposer::compose(const UniqueLabel& label) const { std::list<sax::Token> out; out.push_back(sax::Token(alib::Names::LABEL_UNIQUE_LABEL, sax::Token::TokenType::START_ELEMENT)); - out.splice(out.end(), alib::api<label::Label>::compose(label.getLabel())); - out.splice(out.end(), alib::api<primitive::Integer>::compose(label.getId())); + out.splice(out.end(), alib::xmlApi<label::Label>::compose(label.getLabel())); + out.splice(out.end(), alib::xmlApi<primitive::Integer>::compose(label.getId())); out.push_back(sax::Token(alib::Names::LABEL_UNIQUE_LABEL, sax::Token::TokenType::END_ELEMENT)); return out; } diff --git a/alib2data/src/label/LabelToXMLComposer.h b/alib2data/src/label/LabelToXMLComposer.h index cf165f99b2..274e62ae38 100644 --- a/alib2data/src/label/LabelToXMLComposer.h +++ b/alib2data/src/label/LabelToXMLComposer.h @@ -15,7 +15,7 @@ namespace alib { template<typename T> -struct api; +struct xmlApi; } /* namespace alib */ @@ -46,7 +46,7 @@ class LabelToXMLComposer { std::list<sax::Token> compose(const LabelPairLabel& label) const; std::list<sax::Token> compose(const UniqueLabel& label) const; - template<typename T> friend class alib::api; + template<typename T> friend class alib::xmlApi; }; } /* namespace label */ diff --git a/alib2data/src/object/ObjectFromXMLParser.cpp b/alib2data/src/object/ObjectFromXMLParser.cpp index cde302e079..d5c7732c8d 100644 --- a/alib2data/src/object/ObjectFromXMLParser.cpp +++ b/alib2data/src/object/ObjectFromXMLParser.cpp @@ -9,49 +9,49 @@ #include "../sax/ParserException.h" -#include "../Api.hpp" +#include "../XmlApi.hpp" #include <iostream> namespace alib { Object ObjectFromXMLParser::parseObject(std::list<sax::Token>& input) const { if(alib::FromXMLParsers::symbolParser.first(input)) { - alphabet::Symbol symbol = alib::api<alphabet::Symbol>::parse(input); + alphabet::Symbol symbol = alib::xmlApi<alphabet::Symbol>::parse(input); Object res(std::move(symbol.getData())); return res; } else if(alib::FromXMLParsers::exceptionParser.first(input)) { - exception::AlibException exception = alib::api<exception::AlibException>::parse(input); + exception::AlibException exception = alib::xmlApi<exception::AlibException>::parse(input); Object res(std::move(exception)); return res; } else if(alib::FromXMLParsers::labelParser.first(input)) { - label::Label label = alib::api<label::Label>::parse(input); + label::Label label = alib::xmlApi<label::Label>::parse(input); Object res(std::move(label.getData())); return res; } else if(alib::FromXMLParsers::regexpParser.first(input)) { - regexp::RegExp regexp = alib::api<regexp::RegExp>::parse(input); + regexp::RegExp regexp = alib::xmlApi<regexp::RegExp>::parse(input); Object res(std::move(regexp.getData())); return res; } else if(alib::FromXMLParsers::stringParser.first(input)) { - string::String string = alib::api<string::String>::parse(input); + string::String string = alib::xmlApi<string::String>::parse(input); Object res(std::move(string.getData())); return res; } else if(alib::FromXMLParsers::automatonParser.first(input)) { - automaton::Automaton automaton = alib::api<automaton::Automaton>::parse(input); + automaton::Automaton automaton = alib::xmlApi<automaton::Automaton>::parse(input); Object res(std::move(automaton.getData())); return res; } else if(alib::FromXMLParsers::grammarParser.first(input)) { - grammar::Grammar grammar = alib::api<grammar::Grammar>::parse(input); + grammar::Grammar grammar = alib::xmlApi<grammar::Grammar>::parse(input); Object res(std::move(grammar.getData())); return res; } else if(alib::FromXMLParsers::containerParser.first(input)) { - container::Container container = alib::api<container::Container>::parse(input); + container::Container container = alib::xmlApi<container::Container>::parse(input); Object res(std::move(container.getData())); return res; } else if(alib::FromXMLParsers::primitiveParser.first(input)) { - primitive::Primitive primitive = alib::api<primitive::Primitive>::parse(input); + primitive::Primitive primitive = alib::xmlApi<primitive::Primitive>::parse(input); Object res(std::move(primitive.getData())); return res; - } else if(alib::api<Void>::first(input)) { + } else if(alib::xmlApi<Void>::first(input)) { Object res(std::move(parseVoid(input))); return res; } else { @@ -67,7 +67,7 @@ Void ObjectFromXMLParser::parseVoid(std::list<sax::Token>& input) const { } bool ObjectFromXMLParser::first(const std::list<sax::Token>& input) const { - return alib::FromXMLParsers::symbolParser.first(input) || alib::FromXMLParsers::exceptionParser.first(input) || alib::FromXMLParsers::labelParser.first(input) || alib::FromXMLParsers::regexpParser.first(input) || alib::FromXMLParsers::stringParser.first(input) || alib::FromXMLParsers::automatonParser.first(input) || alib::FromXMLParsers::grammarParser.first(input) || alib::FromXMLParsers::containerParser.first(input) || alib::api<Void>::first(input); + return alib::FromXMLParsers::symbolParser.first(input) || alib::FromXMLParsers::exceptionParser.first(input) || alib::FromXMLParsers::labelParser.first(input) || alib::FromXMLParsers::regexpParser.first(input) || alib::FromXMLParsers::stringParser.first(input) || alib::FromXMLParsers::automatonParser.first(input) || alib::FromXMLParsers::grammarParser.first(input) || alib::FromXMLParsers::containerParser.first(input) || alib::xmlApi<Void>::first(input); } } /* namespace alib */ diff --git a/alib2data/src/object/ObjectFromXMLParser.h b/alib2data/src/object/ObjectFromXMLParser.h index 85b5ac4626..bf8401a97e 100644 --- a/alib2data/src/object/ObjectFromXMLParser.h +++ b/alib2data/src/object/ObjectFromXMLParser.h @@ -17,7 +17,7 @@ namespace alib { template<typename T> -struct api; +struct xmlApi; } /* namespace alib */ @@ -30,7 +30,7 @@ class ObjectFromXMLParser : public sax::FromXMLParserHelper { Object parseObject(std::list<sax::Token>& input) const; Void parseVoid(std::list<sax::Token>& input) const; - template<typename T> friend class alib::api; + template<typename T> friend class alib::xmlApi; public: bool first(const std::list<sax::Token>& input) const; }; diff --git a/alib2data/src/object/ObjectToXMLComposer.cpp b/alib2data/src/object/ObjectToXMLComposer.cpp index 77a5915c98..5b80776bf1 100644 --- a/alib2data/src/object/ObjectToXMLComposer.cpp +++ b/alib2data/src/object/ObjectToXMLComposer.cpp @@ -7,7 +7,7 @@ #include "ObjectToXMLComposer.h" -#include "../Api.hpp" +#include "../XmlApi.hpp" namespace alib { diff --git a/alib2data/src/object/ObjectToXMLComposer.h b/alib2data/src/object/ObjectToXMLComposer.h index ac298206ca..b0855b9700 100644 --- a/alib2data/src/object/ObjectToXMLComposer.h +++ b/alib2data/src/object/ObjectToXMLComposer.h @@ -17,7 +17,7 @@ namespace alib { template<typename T> -struct api; +struct xmlApi; } /* namespace alib */ @@ -48,7 +48,7 @@ class ObjectToXMLComposer { */ std::list<sax::Token> compose(const Void& voidObject) const; - template<typename T> friend class alib::api; + template<typename T> friend class alib::xmlApi; }; } /* namespace alib */ diff --git a/alib2data/src/primitive/PrimitiveFromXMLParser.cpp b/alib2data/src/primitive/PrimitiveFromXMLParser.cpp index 83dca2a06b..bf4278b94d 100644 --- a/alib2data/src/primitive/PrimitiveFromXMLParser.cpp +++ b/alib2data/src/primitive/PrimitiveFromXMLParser.cpp @@ -10,7 +10,7 @@ #include <algorithm> #include "../std/stou.h" -#include "../Api.hpp" +#include "../XmlApi.hpp" namespace primitive { @@ -19,13 +19,13 @@ Primitive PrimitiveFromXMLParser::parsePrimitive(std::list<sax::Token>& input) c } Primitive PrimitiveFromXMLParser::parsePrimitive(std::list<sax::Token>& input, const std::set<FEATURES>& features) const { - if(alib::api<Integer>::first(input)) { + if(alib::xmlApi<Integer>::first(input)) { if(!features.count(FEATURES::INTEGER)) throw exception::AlibException(); return Primitive(parseInteger(input)); - } else if(alib::api<String>::first(input)) { + } else if(alib::xmlApi<String>::first(input)) { if(!features.count(FEATURES::STRING)) throw exception::AlibException(); return Primitive(parseString(input)); - } else if(alib::api<Character>::first(input)) { + } else if(alib::xmlApi<Character>::first(input)) { if(!features.count(FEATURES::CHAR)) throw exception::AlibException(); return Primitive(parseCharacter(input)); } else { @@ -34,7 +34,7 @@ Primitive PrimitiveFromXMLParser::parsePrimitive(std::list<sax::Token>& input, c } bool PrimitiveFromXMLParser::first(const std::list<sax::Token>& input) const { - if(alib::api<Integer>::first(input) || alib::api<String>::first(input) || alib::api<Character>::first(input)) { + if(alib::xmlApi<Integer>::first(input) || alib::xmlApi<String>::first(input) || alib::xmlApi<Character>::first(input)) { return true; } else { return false; diff --git a/alib2data/src/primitive/PrimitiveFromXMLParser.h b/alib2data/src/primitive/PrimitiveFromXMLParser.h index b0538c5390..ea33caba1a 100644 --- a/alib2data/src/primitive/PrimitiveFromXMLParser.h +++ b/alib2data/src/primitive/PrimitiveFromXMLParser.h @@ -20,7 +20,7 @@ namespace alib { template<typename T> -struct api; +struct xmlApi; } /* namespace alib */ @@ -43,7 +43,7 @@ class PrimitiveFromXMLParser : public sax::FromXMLParserHelper { unsigned parseUnsignedRaw(std::list<sax::Token>& input) const; bool parseBoolRaw(std::list<sax::Token>& input) const; - template<typename T> friend class alib::api; + template<typename T> friend class alib::xmlApi; public: bool first(const std::list<sax::Token>& input) const; }; diff --git a/alib2data/src/primitive/PrimitiveToXMLComposer.cpp b/alib2data/src/primitive/PrimitiveToXMLComposer.cpp index f38ad7759d..6cfa205031 100644 --- a/alib2data/src/primitive/PrimitiveToXMLComposer.cpp +++ b/alib2data/src/primitive/PrimitiveToXMLComposer.cpp @@ -12,7 +12,7 @@ #include "../std/itos.h" #include "../std/utos.h" -#include "../Api.hpp" +#include "../XmlApi.hpp" namespace primitive { diff --git a/alib2data/src/primitive/PrimitiveToXMLComposer.h b/alib2data/src/primitive/PrimitiveToXMLComposer.h index 9c26fefd02..0a83a0431d 100644 --- a/alib2data/src/primitive/PrimitiveToXMLComposer.h +++ b/alib2data/src/primitive/PrimitiveToXMLComposer.h @@ -16,7 +16,7 @@ namespace alib { template<typename T> -struct api; +struct xmlApi; } /* namespace alib */ @@ -51,7 +51,7 @@ class PrimitiveToXMLComposer { std::list<sax::Token> compose(unsigned primitive) const; std::list<sax::Token> compose(bool primitive) const; - template<typename T> friend class alib::api; + template<typename T> friend class alib::xmlApi; }; } /* namespace primitive */ diff --git a/alib2data/src/regexp/RegExpFromXMLParser.cpp b/alib2data/src/regexp/RegExpFromXMLParser.cpp index 47a410d354..1736eb77e8 100644 --- a/alib2data/src/regexp/RegExpFromXMLParser.cpp +++ b/alib2data/src/regexp/RegExpFromXMLParser.cpp @@ -8,7 +8,7 @@ #include "RegExpFromXMLParser.h" #include "../sax/ParserException.h" -#include "../Api.hpp" +#include "../XmlApi.hpp" namespace regexp { @@ -17,10 +17,10 @@ RegExp RegExpFromXMLParser::parseRegExp(std::list<sax::Token>& input) const { } RegExp RegExpFromXMLParser::parseRegExp(std::list<sax::Token>& input, const std::set<FEATURES>& features) const { - if(alib::api<UnboundedRegExp>::first(input)) { + if(alib::xmlApi<UnboundedRegExp>::first(input)) { if(!features.count(FEATURES::UNBOUNDED)) throw exception::AlibException(); return RegExp(parseUnboundedRegExp(input)); - } else if(alib::api<FormalRegExp>::first(input)) { + } else if(alib::xmlApi<FormalRegExp>::first(input)) { if(!features.count(FEATURES::FORMAL)) throw exception::AlibException(); return RegExp(parseFormalRegExp(input)); } @@ -28,7 +28,7 @@ RegExp RegExpFromXMLParser::parseRegExp(std::list<sax::Token>& input, const std: } bool RegExpFromXMLParser::first(const std::list<sax::Token>& input) const { - if(alib::api<UnboundedRegExp>::first(input) || alib::api<FormalRegExp>::first(input)) { + if(alib::xmlApi<UnboundedRegExp>::first(input) || alib::xmlApi<FormalRegExp>::first(input)) { return true; } else { return false; @@ -66,7 +66,7 @@ FormalRegExp RegExpFromXMLParser::parseFormalRegExp(std::list<sax::Token>& input void RegExpFromXMLParser::parseAlphabet(std::list<sax::Token> &input, UnboundedRegExp& regexp) const { popToken(input, sax::Token::TokenType::START_ELEMENT, "alphabet"); while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - regexp.addSymbolToAlphabet(alib::api<alphabet::Symbol>::parse(input)); + regexp.addSymbolToAlphabet(alib::xmlApi<alphabet::Symbol>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, "alphabet"); } @@ -74,7 +74,7 @@ void RegExpFromXMLParser::parseAlphabet(std::list<sax::Token> &input, UnboundedR void RegExpFromXMLParser::parseAlphabet(std::list<sax::Token> &input, FormalRegExp& regexp) const { popToken(input, sax::Token::TokenType::START_ELEMENT, "alphabet"); while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - regexp.addSymbolToAlphabet(alib::api<alphabet::Symbol>::parse(input)); + regexp.addSymbolToAlphabet(alib::xmlApi<alphabet::Symbol>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, "alphabet"); } @@ -91,7 +91,7 @@ UnboundedRegExpElement* RegExpFromXMLParser::parseUnboundedRegExpElement(std::li } else if (isToken(input, sax::Token::TokenType::START_ELEMENT, "concatenation")) { return parseUnboundedRegExpConcatenation(input); } else { - return new UnboundedRegExpSymbol(alib::api<alphabet::Symbol>::parse(input)); + return new UnboundedRegExpSymbol(alib::xmlApi<alphabet::Symbol>::parse(input)); } } @@ -167,7 +167,7 @@ FormalRegExpElement* RegExpFromXMLParser::parseFormalRegExpElement(std::list<sax } else if (isToken(input, sax::Token::TokenType::START_ELEMENT, "concatenation")) { return parseFormalRegExpConcatenation(input); } else { - return new FormalRegExpSymbol(alib::api<alphabet::Symbol>::parse(input)); + return new FormalRegExpSymbol(alib::xmlApi<alphabet::Symbol>::parse(input)); } } diff --git a/alib2data/src/regexp/RegExpFromXMLParser.h b/alib2data/src/regexp/RegExpFromXMLParser.h index bc853497e9..6e5fffdc72 100644 --- a/alib2data/src/regexp/RegExpFromXMLParser.h +++ b/alib2data/src/regexp/RegExpFromXMLParser.h @@ -19,7 +19,7 @@ namespace alib { template<typename T> -struct api; +struct xmlApi; } /* namespace alib */ @@ -54,7 +54,7 @@ class RegExpFromXMLParser : public sax::FromXMLParserHelper { UnboundedRegExp parseUnboundedRegExp(std::list<sax::Token>& input) const; FormalRegExp parseFormalRegExp(std::list<sax::Token>& input) const; - template<typename T> friend class alib::api; + template<typename T> friend class alib::xmlApi; public: bool first(const std::list<sax::Token>& input) const; }; diff --git a/alib2data/src/regexp/RegExpToXMLComposer.cpp b/alib2data/src/regexp/RegExpToXMLComposer.cpp index 682e34053f..5a2a93339c 100644 --- a/alib2data/src/regexp/RegExpToXMLComposer.cpp +++ b/alib2data/src/regexp/RegExpToXMLComposer.cpp @@ -7,7 +7,7 @@ #include "RegExpToXMLComposer.h" -#include "../Api.hpp" +#include "../XmlApi.hpp" namespace regexp { @@ -46,7 +46,7 @@ void RegExpToXMLComposer::Visit(void* userData, const UnboundedRegExpIteration& void RegExpToXMLComposer::Visit(void* userData, const UnboundedRegExpSymbol& symbol) const { std::list<sax::Token> &out = *((std::list<sax::Token>*) userData); - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol.getSymbol())); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol.getSymbol())); } void RegExpToXMLComposer::Visit(void* userData, const UnboundedRegExpEpsilon&) const { @@ -110,7 +110,7 @@ void RegExpToXMLComposer::Visit(void* userData, const FormalRegExpIteration& ite void RegExpToXMLComposer::Visit(void* userData, const FormalRegExpSymbol& symbol) const { std::list<sax::Token> &out = *((std::list<sax::Token>*) userData); - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol.getSymbol())); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol.getSymbol())); } void RegExpToXMLComposer::Visit(void* userData, const FormalRegExpEpsilon&) const { @@ -145,7 +145,7 @@ std::list<sax::Token> RegExpToXMLComposer::compose(const UnboundedRegExp& regexp { out.push_back(sax::Token("alphabet", sax::Token::TokenType::START_ELEMENT)); for (const auto& symbol: regexp.getAlphabet()) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } out.push_back(sax::Token("alphabet", sax::Token::TokenType::END_ELEMENT)); } @@ -160,7 +160,7 @@ std::list<sax::Token> RegExpToXMLComposer::compose(const FormalRegExp& regexp) c { out.push_back(sax::Token("alphabet", sax::Token::TokenType::START_ELEMENT)); for (const auto& symbol: regexp.getAlphabet()) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } out.push_back(sax::Token("alphabet", sax::Token::TokenType::END_ELEMENT)); } diff --git a/alib2data/src/regexp/RegExpToXMLComposer.h b/alib2data/src/regexp/RegExpToXMLComposer.h index 3ec0aed7b5..73caddf293 100644 --- a/alib2data/src/regexp/RegExpToXMLComposer.h +++ b/alib2data/src/regexp/RegExpToXMLComposer.h @@ -17,7 +17,7 @@ namespace alib { template<typename T> -struct api; +struct xmlApi; } /* namespace alib */ @@ -60,7 +60,7 @@ class RegExpToXMLComposer :public UnboundedRegExpElement::const_visitor_type, pu std::list<sax::Token> compose(const UnboundedRegExp& regexp) const; std::list<sax::Token> compose(const FormalRegExp& regexp) const; - template<typename T> friend class alib::api; + template<typename T> friend class alib::xmlApi; }; } /* namespace regexp */ diff --git a/alib2data/src/string/StringFromXMLParser.cpp b/alib2data/src/string/StringFromXMLParser.cpp index 7ac495e7ab..03490733be 100644 --- a/alib2data/src/string/StringFromXMLParser.cpp +++ b/alib2data/src/string/StringFromXMLParser.cpp @@ -8,7 +8,7 @@ #include "StringFromXMLParser.h" #include "../sax/ParserException.h" -#include "../Api.hpp" +#include "../XmlApi.hpp" namespace string { @@ -17,13 +17,13 @@ String StringFromXMLParser::parseString(std::list<sax::Token>& input) const { } String StringFromXMLParser::parseString(std::list<sax::Token>& input, const std::set<FEATURES>& features) const { - if(alib::api<Epsilon>::first(input)) { + if(alib::xmlApi<Epsilon>::first(input)) { if(!features.count(FEATURES::EPSILON)) throw exception::AlibException(); return String(parseEpsilon(input)); - } else if(alib::api<LinearString>::first(input)) { + } else if(alib::xmlApi<LinearString>::first(input)) { if(!features.count(FEATURES::LINEAR)) throw exception::AlibException(); return String(parseLinearString(input)); - } else if(alib::api<CyclicString>::first(input)) { + } else if(alib::xmlApi<CyclicString>::first(input)) { if(!features.count(FEATURES::CYCLIC)) throw exception::AlibException(); return String(parseCyclicString(input)); } else { @@ -32,7 +32,7 @@ String StringFromXMLParser::parseString(std::list<sax::Token>& input, const std: } bool StringFromXMLParser::first(const std::list<sax::Token>& input) const { - if(alib::api<Epsilon>::first(input) || alib::api<LinearString>::first(input) || alib::api<CyclicString>::first(input)) { + if(alib::xmlApi<Epsilon>::first(input) || alib::xmlApi<LinearString>::first(input) || alib::xmlApi<CyclicString>::first(input)) { return true; } else { return false; @@ -82,7 +82,7 @@ std::set<alphabet::Symbol> StringFromXMLParser::parseAlphabet(std::list<sax::Tok std::set<alphabet::Symbol> alphabet; popToken(input, sax::Token::TokenType::START_ELEMENT, "alphabet"); while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - alphabet.insert(alib::api<alphabet::Symbol>::parse(input)); + alphabet.insert(alib::xmlApi<alphabet::Symbol>::parse(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, "alphabet"); return alphabet; @@ -91,7 +91,7 @@ std::set<alphabet::Symbol> StringFromXMLParser::parseAlphabet(std::list<sax::Tok std::vector<alphabet::Symbol> StringFromXMLParser::parseContentData(std::list<sax::Token>& input) const { std::vector<alphabet::Symbol> data; while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - data.push_back(alib::api<alphabet::Symbol>::parse(input)); + data.push_back(alib::xmlApi<alphabet::Symbol>::parse(input)); } return data; } diff --git a/alib2data/src/string/StringFromXMLParser.h b/alib2data/src/string/StringFromXMLParser.h index ea0663380e..a0fee62b61 100644 --- a/alib2data/src/string/StringFromXMLParser.h +++ b/alib2data/src/string/StringFromXMLParser.h @@ -22,7 +22,7 @@ namespace alib { template<typename T> -struct api; +struct xmlApi; } /* namespace alib */ @@ -42,7 +42,7 @@ class StringFromXMLParser : public sax::FromXMLParserHelper { CyclicString parseCyclicString(std::list<sax::Token>& input) const; Epsilon parseEpsilon(std::list<sax::Token>& input) const; - template<typename T> friend class alib::api; + template<typename T> friend class alib::xmlApi; public: bool first(const std::list<sax::Token>& input) const; }; diff --git a/alib2data/src/string/StringToXMLComposer.cpp b/alib2data/src/string/StringToXMLComposer.cpp index 240a4bccb5..b355c09753 100644 --- a/alib2data/src/string/StringToXMLComposer.cpp +++ b/alib2data/src/string/StringToXMLComposer.cpp @@ -10,7 +10,7 @@ #include "LinearString.h" #include "Epsilon.h" -#include "../Api.hpp" +#include "../XmlApi.hpp" namespace string { @@ -31,12 +31,12 @@ std::list<sax::Token> StringToXMLComposer::compose(const LinearString& string) c out.push_back(sax::Token(alib::Names::STRING_LINEAR_STRING, sax::Token::TokenType::START_ELEMENT)); out.push_back(sax::Token("alphabet", sax::Token::TokenType::START_ELEMENT)); for (const auto& symbol: string.getAlphabet()) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } out.push_back(sax::Token("alphabet", sax::Token::TokenType::END_ELEMENT)); for(const auto& symbol : string.getContent()) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } out.push_back(sax::Token(alib::Names::STRING_LINEAR_STRING, sax::Token::TokenType::END_ELEMENT)); return out; @@ -47,12 +47,12 @@ std::list<sax::Token> StringToXMLComposer::compose(const CyclicString& string) c out.push_back(sax::Token(alib::Names::STRING_CYCLIC_STRING, sax::Token::TokenType::START_ELEMENT)); out.push_back(sax::Token("alphabet", sax::Token::TokenType::START_ELEMENT)); for (const auto& symbol: string.getAlphabet()) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } out.push_back(sax::Token("alphabet", sax::Token::TokenType::END_ELEMENT)); for(const auto& symbol : string.getContent()) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } out.push_back(sax::Token(alib::Names::STRING_CYCLIC_STRING, sax::Token::TokenType::END_ELEMENT)); return out; @@ -63,7 +63,7 @@ std::list<sax::Token> StringToXMLComposer::compose(const Epsilon& string) const out.push_back(sax::Token(alib::Names::STRING_EPSILON, sax::Token::TokenType::START_ELEMENT)); out.push_back(sax::Token("alphabet", sax::Token::TokenType::START_ELEMENT)); for (const auto& symbol: string.getAlphabet()) { - out.splice(out.end(), alib::api<alphabet::Symbol>::compose(symbol)); + out.splice(out.end(), alib::xmlApi<alphabet::Symbol>::compose(symbol)); } out.push_back(sax::Token("alphabet", sax::Token::TokenType::END_ELEMENT)); out.push_back(sax::Token(alib::Names::STRING_EPSILON, sax::Token::TokenType::END_ELEMENT)); diff --git a/alib2data/src/string/StringToXMLComposer.h b/alib2data/src/string/StringToXMLComposer.h index b2d81bd019..d14ecc759e 100644 --- a/alib2data/src/string/StringToXMLComposer.h +++ b/alib2data/src/string/StringToXMLComposer.h @@ -16,7 +16,7 @@ namespace alib { template<typename T> -struct api; +struct xmlApi; } /* namespace alib */ @@ -44,7 +44,7 @@ class StringToXMLComposer { std::list<sax::Token> compose(const CyclicString& string) const; std::list<sax::Token> compose(const Epsilon& string) const; - template<typename T> friend class alib::api; + template<typename T> friend class alib::xmlApi; }; } /* namespace string */ diff --git a/alib2data/test-src/alphabet/SymbolTest.cpp b/alib2data/test-src/alphabet/SymbolTest.cpp index 5c5ba508a9..7054cc3cda 100644 --- a/alib2data/test-src/alphabet/SymbolTest.cpp +++ b/alib2data/test-src/alphabet/SymbolTest.cpp @@ -8,7 +8,7 @@ #include "alphabet/LabeledSymbol.h" #include "alphabet/BlankSymbol.h" -#include "factory/DataFactory.hpp" +#include "factory/XmlDataFactory.hpp" #include "factory/StringDataFactory.hpp" #define CPPUNIT_IMPLY(x, y) CPPUNIT_ASSERT(!(x) || (y)) @@ -78,19 +78,19 @@ void SymbolTest::testXMLParser() { alphabet::Symbol symbol = alphabet::symbolFrom("1"); { - std::list<sax::Token> tokens = alib::DataFactory::toTokens(symbol); + std::list<sax::Token> tokens = alib::XmlDataFactory::toTokens(symbol); std::string tmp; sax::SaxComposeInterface::printMemory(tmp, tokens); std::list<sax::Token> tokens2; sax::SaxParseInterface::parseMemory(tmp, tokens2); - alphabet::Symbol symbol2 = alib::DataFactory::fromTokens<alphabet::Symbol>(tokens2); + alphabet::Symbol symbol2 = alib::XmlDataFactory::fromTokens<alphabet::Symbol>(tokens2); CPPUNIT_ASSERT( symbol == symbol2 ); } { - std::string tmp = alib::DataFactory::toString(symbol); - alphabet::Symbol symbol2 = alib::DataFactory::fromString<alphabet::Symbol>(tmp); + std::string tmp = alib::XmlDataFactory::toString(symbol); + alphabet::Symbol symbol2 = alib::XmlDataFactory::fromString<alphabet::Symbol>(tmp); CPPUNIT_ASSERT( symbol == symbol2 ); } diff --git a/alib2data/test-src/automaton/AutomatonTest.cpp b/alib2data/test-src/automaton/AutomatonTest.cpp index 666dd62ae4..79c4cd7e9e 100644 --- a/alib2data/test-src/automaton/AutomatonTest.cpp +++ b/alib2data/test-src/automaton/AutomatonTest.cpp @@ -11,7 +11,7 @@ #include "automaton/AutomatonException.h" -#include "factory/DataFactory.hpp" +#include "factory/XmlDataFactory.hpp" #include "factory/StringDataFactory.hpp" #include "alphabet/LabeledSymbol.h" @@ -46,13 +46,13 @@ void AutomatonTest::testDFAParser() { CPPUNIT_ASSERT( automaton == automaton ); { - std::list<sax::Token> tokens = alib::DataFactory::toTokens(automaton); + std::list<sax::Token> tokens = alib::XmlDataFactory::toTokens(automaton); std::string tmp; sax::SaxComposeInterface::printMemory(tmp, tokens); std::list<sax::Token> tokens2; sax::SaxParseInterface::parseMemory(tmp, tokens2); - automaton::DFA automaton2 = alib::DataFactory::fromTokens<automaton::DFA>(tokens2); + automaton::DFA automaton2 = alib::XmlDataFactory::fromTokens<automaton::DFA>(tokens2); CPPUNIT_ASSERT( automaton == automaton2 ); } @@ -284,7 +284,7 @@ void AutomatonTest::testNPDATransitions() { automaton.addTransition(automaton::State(3), alphabet::symbolFrom("a0"), {alphabet::symbolFrom("R")}, automaton::State(4), {}); automaton.setFinalStates({automaton::State(4)}); - alib::DataFactory::toStdout(automaton); + alib::XmlDataFactory::toStdout(automaton); CPPUNIT_ASSERT(!(automaton < automaton)); CPPUNIT_ASSERT(automaton == automaton); @@ -303,7 +303,7 @@ void AutomatonTest::testRHPDATransitions() { automaton.addReturnTransition(automaton::State(3), alphabet::symbolFrom("Y"), automaton::State(1)); automaton.setFinalStates({automaton::State(3)}); - alib::DataFactory::toStdout(automaton); + alib::XmlDataFactory::toStdout(automaton); CPPUNIT_ASSERT(!(automaton < automaton)); CPPUNIT_ASSERT(automaton == automaton); diff --git a/alib2data/test-src/container/ContainerTest.cpp b/alib2data/test-src/container/ContainerTest.cpp index 5ee7052069..a1dcab797e 100644 --- a/alib2data/test-src/container/ContainerTest.cpp +++ b/alib2data/test-src/container/ContainerTest.cpp @@ -8,7 +8,7 @@ #include "container/ObjectsSet.h" #include "alphabet/LabeledSymbol.h" -#include "factory/DataFactory.hpp" +#include "factory/XmlDataFactory.hpp" #define CPPUNIT_IMPLY(x, y) CPPUNIT_ASSERT(!(x) || (y)) #define CPPUNIT_EXCLUSIVE_OR(x, y) CPPUNIT_ASSERT((!(x) && (y)) || ((x) && !(y))) @@ -31,13 +31,13 @@ void ContainerTest::testXMLParser() { alib::Object object(set); { - std::string tmp = alib::DataFactory::toString(object); - alib::Object object2 = alib::DataFactory::fromString<alib::Object>(tmp); + std::string tmp = alib::XmlDataFactory::toString(object); + alib::Object object2 = alib::XmlDataFactory::fromString<alib::Object>(tmp); CPPUNIT_ASSERT( object == object2 ); - std::set<alphabet::LabeledSymbol> concrete = alib::DataFactory::fromString<std::set<alphabet::LabeledSymbol>>(tmp); - std::string tmp2 = alib::DataFactory::toString(concrete); + std::set<alphabet::LabeledSymbol> concrete = alib::XmlDataFactory::fromString<std::set<alphabet::LabeledSymbol>>(tmp); + std::string tmp2 = alib::XmlDataFactory::toString(concrete); CPPUNIT_ASSERT( tmp == tmp2 ); } @@ -47,13 +47,13 @@ void ContainerTest::testXMLParser() { void ContainerTest::testVariantParsing() { { std::string string = "<String>aaa</String>"; - std::variant<int, std::string> object = alib::DataFactory::fromString<std::variant<int, std::string>>(string); + std::variant<int, std::string> object = alib::XmlDataFactory::fromString<std::variant<int, std::string>>(string); CPPUNIT_ASSERT( "aaa" == object.get<std::string>()); - std::string string2 = alib::DataFactory::toString(object); + std::string string2 = alib::XmlDataFactory::toString(object); - std::variant<int, std::string> object2 = alib::DataFactory::fromString<std::variant<int, std::string>>(string2); + std::variant<int, std::string> object2 = alib::XmlDataFactory::fromString<std::variant<int, std::string>>(string2); CPPUNIT_ASSERT( object == object2 ); } diff --git a/alib2data/test-src/grammar/GrammarTest.cpp b/alib2data/test-src/grammar/GrammarTest.cpp index 66b0c2c9f3..594da58a51 100644 --- a/alib2data/test-src/grammar/GrammarTest.cpp +++ b/alib2data/test-src/grammar/GrammarTest.cpp @@ -6,7 +6,7 @@ #include "grammar/Unrestricted/UnrestrictedGrammar.h" -#include "factory/DataFactory.hpp" +#include "factory/XmlDataFactory.hpp" #include "alphabet/LabeledSymbol.h" @@ -39,13 +39,13 @@ void GrammarTest::testUnrestrictedParser() { CPPUNIT_ASSERT( grammar == grammar ); { - std::list<sax::Token> tokens = alib::DataFactory::toTokens(grammar); + std::list<sax::Token> tokens = alib::XmlDataFactory::toTokens(grammar); std::string tmp; sax::SaxComposeInterface::printMemory(tmp, tokens); std::list<sax::Token> tokens2; sax::SaxParseInterface::parseMemory(tmp, tokens2); - grammar::UnrestrictedGrammar grammar2 = alib::DataFactory::fromTokens<grammar::UnrestrictedGrammar>(tokens2); + grammar::UnrestrictedGrammar grammar2 = alib::XmlDataFactory::fromTokens<grammar::UnrestrictedGrammar>(tokens2); CPPUNIT_ASSERT( grammar == grammar2 ); } @@ -65,13 +65,13 @@ void GrammarTest::testUnrestrictedParser() { grammar.addRule(std::vector<alphabet::Symbol> {}, alphabet::symbolFrom(2), std::vector<alphabet::Symbol> {}, std::vector<alphabet::Symbol> {}); CPPUNIT_ASSERT( grammar == grammar ); { - std::list<sax::Token> tokens = alib::DataFactory::toTokens(grammar); + std::list<sax::Token> tokens = alib::XmlDataFactory::toTokens(grammar); std::string tmp; sax::SaxComposeInterface::printMemory(tmp, tokens); std::list<sax::Token> tokens2; sax::SaxParseInterface::parseMemory(tmp, tokens2); - grammar::ContextPreservingUnrestrictedGrammar grammar2 = alib::DataFactory::fromTokens<grammar::ContextPreservingUnrestrictedGrammar>(tokens2); + grammar::ContextPreservingUnrestrictedGrammar grammar2 = alib::XmlDataFactory::fromTokens<grammar::ContextPreservingUnrestrictedGrammar>(tokens2); CPPUNIT_ASSERT( grammar == grammar2 ); } @@ -93,13 +93,13 @@ void GrammarTest::testRegularParser() { CPPUNIT_ASSERT( grammar == grammar ); { - std::list<sax::Token> tokens = alib::DataFactory::toTokens(grammar); + std::list<sax::Token> tokens = alib::XmlDataFactory::toTokens(grammar); std::string tmp; sax::SaxComposeInterface::printMemory(tmp, tokens); std::list<sax::Token> tokens2; sax::SaxParseInterface::parseMemory(tmp, tokens2); - grammar::RightRG grammar2 = alib::DataFactory::fromTokens<grammar::RightRG>(tokens2); + grammar::RightRG grammar2 = alib::XmlDataFactory::fromTokens<grammar::RightRG>(tokens2); CPPUNIT_ASSERT( grammar == grammar2 ); } @@ -121,13 +121,13 @@ void GrammarTest::testRegularParser() { CPPUNIT_ASSERT( grammar == grammar ); { - std::list<sax::Token> tokens = alib::DataFactory::toTokens(grammar); + std::list<sax::Token> tokens = alib::XmlDataFactory::toTokens(grammar); std::string tmp; sax::SaxComposeInterface::printMemory(tmp, tokens); std::list<sax::Token> tokens2; sax::SaxParseInterface::parseMemory(tmp, tokens2); - grammar::RightLG grammar2 = alib::DataFactory::fromTokens<grammar::RightLG>(tokens2); + grammar::RightLG grammar2 = alib::XmlDataFactory::fromTokens<grammar::RightLG>(tokens2); CPPUNIT_ASSERT( grammar == grammar2 ); } @@ -151,13 +151,13 @@ void GrammarTest::testContextFreeParser() { CPPUNIT_ASSERT( grammar == grammar ); { - std::list<sax::Token> tokens = alib::DataFactory::toTokens(grammar); + std::list<sax::Token> tokens = alib::XmlDataFactory::toTokens(grammar); std::string tmp; sax::SaxComposeInterface::printMemory(tmp, tokens); std::list<sax::Token> tokens2; sax::SaxParseInterface::parseMemory(tmp, tokens2); - grammar::LG grammar2 = alib::DataFactory::fromTokens<grammar::LG>(tokens2); + grammar::LG grammar2 = alib::XmlDataFactory::fromTokens<grammar::LG>(tokens2); CPPUNIT_ASSERT( grammar == grammar2 ); } @@ -179,13 +179,13 @@ void GrammarTest::testContextFreeParser() { CPPUNIT_ASSERT( grammar == grammar ); { - std::list<sax::Token> tokens = alib::DataFactory::toTokens(grammar); + std::list<sax::Token> tokens = alib::XmlDataFactory::toTokens(grammar); std::string tmp; sax::SaxComposeInterface::printMemory(tmp, tokens); std::list<sax::Token> tokens2; sax::SaxParseInterface::parseMemory(tmp, tokens2); - grammar::EpsilonFreeCFG grammar2 = alib::DataFactory::fromTokens<grammar::EpsilonFreeCFG>(tokens2); + grammar::EpsilonFreeCFG grammar2 = alib::XmlDataFactory::fromTokens<grammar::EpsilonFreeCFG>(tokens2); CPPUNIT_ASSERT( grammar == grammar2 ); } @@ -207,13 +207,13 @@ void GrammarTest::testContextFreeParser() { CPPUNIT_ASSERT( grammar == grammar ); { - std::list<sax::Token> tokens = alib::DataFactory::toTokens(grammar); + std::list<sax::Token> tokens = alib::XmlDataFactory::toTokens(grammar); std::string tmp; sax::SaxComposeInterface::printMemory(tmp, tokens); std::list<sax::Token> tokens2; sax::SaxParseInterface::parseMemory(tmp, tokens2); - grammar::CFG grammar2 = alib::DataFactory::fromTokens<grammar::CFG>(tokens2); + grammar::CFG grammar2 = alib::XmlDataFactory::fromTokens<grammar::CFG>(tokens2); CPPUNIT_ASSERT( grammar == grammar2 ); } @@ -235,13 +235,13 @@ void GrammarTest::testContextFreeParser() { CPPUNIT_ASSERT( grammar == grammar ); { - std::list<sax::Token> tokens = alib::DataFactory::toTokens(grammar); + std::list<sax::Token> tokens = alib::XmlDataFactory::toTokens(grammar); std::string tmp; sax::SaxComposeInterface::printMemory(tmp, tokens); std::list<sax::Token> tokens2; sax::SaxParseInterface::parseMemory(tmp, tokens2); - grammar::CNF grammar2 = alib::DataFactory::fromTokens<grammar::CNF>(tokens2); + grammar::CNF grammar2 = alib::XmlDataFactory::fromTokens<grammar::CNF>(tokens2); CPPUNIT_ASSERT( grammar == grammar2 ); } @@ -263,13 +263,13 @@ void GrammarTest::testContextFreeParser() { CPPUNIT_ASSERT( grammar == grammar ); { - std::list<sax::Token> tokens = alib::DataFactory::toTokens(grammar); + std::list<sax::Token> tokens = alib::XmlDataFactory::toTokens(grammar); std::string tmp; sax::SaxComposeInterface::printMemory(tmp, tokens); std::list<sax::Token> tokens2; sax::SaxParseInterface::parseMemory(tmp, tokens2); - grammar::GNF grammar2 = alib::DataFactory::fromTokens<grammar::GNF>(tokens2); + grammar::GNF grammar2 = alib::XmlDataFactory::fromTokens<grammar::GNF>(tokens2); CPPUNIT_ASSERT( grammar == grammar2 ); } @@ -293,13 +293,13 @@ void GrammarTest::testContextSensitiveParser() { CPPUNIT_ASSERT( grammar == grammar ); { - std::list<sax::Token> tokens = alib::DataFactory::toTokens(grammar); + std::list<sax::Token> tokens = alib::XmlDataFactory::toTokens(grammar); std::string tmp; sax::SaxComposeInterface::printMemory(tmp, tokens); std::list<sax::Token> tokens2; sax::SaxParseInterface::parseMemory(tmp, tokens2); - grammar::CSG grammar2 = alib::DataFactory::fromTokens<grammar::CSG>(tokens2); + grammar::CSG grammar2 = alib::XmlDataFactory::fromTokens<grammar::CSG>(tokens2); CPPUNIT_ASSERT( grammar == grammar2 ); } @@ -320,13 +320,13 @@ void GrammarTest::testContextSensitiveParser() { CPPUNIT_ASSERT( grammar == grammar ); { - std::list<sax::Token> tokens = alib::DataFactory::toTokens(grammar); + std::list<sax::Token> tokens = alib::XmlDataFactory::toTokens(grammar); std::string tmp; sax::SaxComposeInterface::printMemory(tmp, tokens); std::list<sax::Token> tokens2; sax::SaxParseInterface::parseMemory(tmp, tokens2); - grammar::NonContractingGrammar grammar2 = alib::DataFactory::fromTokens<grammar::NonContractingGrammar>(tokens2); + grammar::NonContractingGrammar grammar2 = alib::XmlDataFactory::fromTokens<grammar::NonContractingGrammar>(tokens2); CPPUNIT_ASSERT( grammar == grammar2 ); } diff --git a/alib2data/test-src/label/LabelTest.cpp b/alib2data/test-src/label/LabelTest.cpp index 3e9fcb426c..226660e9e5 100644 --- a/alib2data/test-src/label/LabelTest.cpp +++ b/alib2data/test-src/label/LabelTest.cpp @@ -11,7 +11,7 @@ #include "primitive/Character.h" #include "primitive/String.h" -#include "factory/DataFactory.hpp" +#include "factory/XmlDataFactory.hpp" #include "factory/StringDataFactory.hpp" #include <algorithm> @@ -93,19 +93,19 @@ void LabelTest::testXMLParser() { label::Label label = label::labelFrom("1"); { - std::list<sax::Token> tokens = alib::DataFactory::toTokens(label); + std::list<sax::Token> tokens = alib::XmlDataFactory::toTokens(label); std::string tmp; sax::SaxComposeInterface::printMemory(tmp, tokens); std::list<sax::Token> tokens2; sax::SaxParseInterface::parseMemory(tmp, tokens2); - label::Label label2 = alib::DataFactory::fromTokens<label::Label>(tokens2); + label::Label label2 = alib::XmlDataFactory::fromTokens<label::Label>(tokens2); CPPUNIT_ASSERT( label == label2 ); } { - std::string tmp = alib::DataFactory::toString(label); - label::Label label2 = alib::DataFactory::fromString<label::Label>(tmp); + std::string tmp = alib::XmlDataFactory::toString(label); + label::Label label2 = alib::XmlDataFactory::fromString<label::Label>(tmp); CPPUNIT_ASSERT( label == label2 ); } diff --git a/alib2data/test-src/regexp/RegExpTest.cpp b/alib2data/test-src/regexp/RegExpTest.cpp index 06dcc5f7e9..95d268a08f 100644 --- a/alib2data/test-src/regexp/RegExpTest.cpp +++ b/alib2data/test-src/regexp/RegExpTest.cpp @@ -6,7 +6,7 @@ #include "regexp/unbounded/UnboundedRegExp.h" -#include "factory/DataFactory.hpp" +#include "factory/XmlDataFactory.hpp" #include "factory/StringDataFactory.hpp" #define CPPUNIT_IMPLY(x, y) CPPUNIT_ASSERT(!(x) || (y)) @@ -134,19 +134,19 @@ void RegExpTest::testXMLParser() { regexp::RegExp regexp(unboundedRegexp); { - std::list<sax::Token> tokens = alib::DataFactory::toTokens(regexp); + std::list<sax::Token> tokens = alib::XmlDataFactory::toTokens(regexp); std::string tmp; sax::SaxComposeInterface::printMemory(tmp, tokens); std::list<sax::Token> tokens2; sax::SaxParseInterface::parseMemory(tmp, tokens2); - regexp::RegExp regexp2 = alib::DataFactory::fromTokens<regexp::RegExp>(tokens2); + regexp::RegExp regexp2 = alib::XmlDataFactory::fromTokens<regexp::RegExp>(tokens2); CPPUNIT_ASSERT( regexp == regexp2 ); } { - std::string tmp = alib::DataFactory::toString(regexp); - regexp::RegExp regexp2 = alib::DataFactory::fromString<regexp::RegExp>(tmp); + std::string tmp = alib::XmlDataFactory::toString(regexp); + regexp::RegExp regexp2 = alib::XmlDataFactory::fromString<regexp::RegExp>(tmp); CPPUNIT_ASSERT( regexp == regexp2 ); } diff --git a/alib2data/test-src/string/StringTest.cpp b/alib2data/test-src/string/StringTest.cpp index bb8e086564..00bdc5797a 100644 --- a/alib2data/test-src/string/StringTest.cpp +++ b/alib2data/test-src/string/StringTest.cpp @@ -9,7 +9,7 @@ #include "string/CyclicString.h" #include "string/Epsilon.h" -#include "factory/DataFactory.hpp" +#include "factory/XmlDataFactory.hpp" #include "factory/StringDataFactory.hpp" #include "alphabet/Symbol.h" @@ -87,19 +87,19 @@ void StringTest::testXMLParser() { string::String string(linearString); { - std::list<sax::Token> tokens = alib::DataFactory::toTokens(string); + std::list<sax::Token> tokens = alib::XmlDataFactory::toTokens(string); std::string tmp; sax::SaxComposeInterface::printMemory(tmp, tokens); std::list<sax::Token> tokens2; sax::SaxParseInterface::parseMemory(tmp, tokens2); - string::String string2 = alib::DataFactory::fromTokens<string::String>(tokens2); + string::String string2 = alib::XmlDataFactory::fromTokens<string::String>(tokens2); CPPUNIT_ASSERT( string == string2 ); } { - std::string tmp = alib::DataFactory::toString(string); - string::String string2 = alib::DataFactory::fromString<string::String>(tmp); + std::string tmp = alib::XmlDataFactory::toString(string); + string::String string2 = alib::XmlDataFactory::fromString<string::String>(tmp); CPPUNIT_ASSERT( string == string2 ); } diff --git a/aminimize2/src/aminimize.cpp b/aminimize2/src/aminimize.cpp index c2e935a739..14ca9a8e62 100644 --- a/aminimize2/src/aminimize.cpp +++ b/aminimize2/src/aminimize.cpp @@ -8,7 +8,7 @@ #include <tclap/CmdLine.h> #include <exception/AlibException.h> -#include <factory/DataFactory.hpp> +#include <factory/XmlDataFactory.hpp> #include "automaton/simplify/Minimize.h" #include "automaton/simplify/MinimizeBrzozowski.h" @@ -40,9 +40,9 @@ int main(int argc, char** argv) { } if(algorithm.getValue() == "hopcroft") { - alib::DataFactory::toStdout(automaton::simplify::Minimize::minimize(alib::DataFactory::fromTokens<automaton::Automaton>(tokens))); + alib::XmlDataFactory::toStdout(automaton::simplify::Minimize::minimize(alib::XmlDataFactory::fromTokens<automaton::Automaton>(tokens))); } else if(algorithm.getValue() == "brzozowski") { - alib::DataFactory::toStdout(automaton::simplify::MinimizeBrzozowski::minimize(alib::DataFactory::fromTokens<automaton::Automaton>(tokens))); + alib::XmlDataFactory::toStdout(automaton::simplify::MinimizeBrzozowski::minimize(alib::XmlDataFactory::fromTokens<automaton::Automaton>(tokens))); } else { throw exception::AlibException("Unknown algorithm selected."); } @@ -50,7 +50,7 @@ int main(int argc, char** argv) { return 0; } catch (const exception::AlibException& exception) { - alib::DataFactory::toStdout(exception); + alib::XmlDataFactory::toStdout(exception); return 1; } catch (const TCLAP::ArgException& exception) { std::cout << exception.error() << std::endl; diff --git a/anormalize2/src/anormalize.cpp b/anormalize2/src/anormalize.cpp index dfbae919cf..67a1eca73d 100644 --- a/anormalize2/src/anormalize.cpp +++ b/anormalize2/src/anormalize.cpp @@ -8,7 +8,7 @@ #include <tclap/CmdLine.h> #include "exception/AlibException.h" -#include "factory/DataFactory.hpp" +#include "factory/XmlDataFactory.hpp" #include "automaton/simplify/Normalize.h" #include "automaton/simplify/SingleInitialState.h" #include "grammar/convert/ToGrammarLeftRG.h" @@ -48,25 +48,25 @@ int main(int argc, char** argv) { } if(labels.getValue() == "automaton") { - alib::DataFactory::toStdout(automaton::simplify::Normalize::normalize(alib::DataFactory::fromTokens<automaton::Automaton>(tokens))); + alib::XmlDataFactory::toStdout(automaton::simplify::Normalize::normalize(alib::XmlDataFactory::fromTokens<automaton::Automaton>(tokens))); return 0; } else if(labels.getValue() == "grammar") { -// alib::DataFactory::toStdout(automaton::simplify::Normalize::normalize(alib::DataFactory::fromTokens<automaton::Automaton>(tokens))); +// alib::XmlDataFactory::toStdout(automaton::simplify::Normalize::normalize(alib::XmlDataFactory::fromTokens<automaton::Automaton>(tokens))); return 0; } else if(form.getValue() == "leftRG") { - alib::DataFactory::toStdout(grammar::convert::ToGrammarLeftRG::convert(alib::DataFactory::fromTokens<grammar::Grammar>( tokens ))); + alib::XmlDataFactory::toStdout(grammar::convert::ToGrammarLeftRG::convert(alib::XmlDataFactory::fromTokens<grammar::Grammar>( tokens ))); return 0; } else if(form.getValue() == "rightRG") { - alib::DataFactory::toStdout(grammar::convert::ToGrammarRightRG::convert(alib::DataFactory::fromTokens<grammar::Grammar>( tokens ))); + alib::XmlDataFactory::toStdout(grammar::convert::ToGrammarRightRG::convert(alib::XmlDataFactory::fromTokens<grammar::Grammar>( tokens ))); return 0; } else if(form.getValue() == "singleInitialState") { - alib::DataFactory::toStdout(automaton::simplify::SingleInitialState::convert(alib::DataFactory::fromTokens<automaton::Automaton>(tokens))); + alib::XmlDataFactory::toStdout(automaton::simplify::SingleInitialState::convert(alib::XmlDataFactory::fromTokens<automaton::Automaton>(tokens))); return 0; } else { throw exception::AlibException("Invalid normalize command"); } } catch (const exception::AlibException& exception) { - alib::DataFactory::toStdout(exception); + alib::XmlDataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { std::cout << exception.error() << std::endl; diff --git a/arand2/src/arand.cpp b/arand2/src/arand.cpp index 12da4087e3..9e2f41959e 100644 --- a/arand2/src/arand.cpp +++ b/arand2/src/arand.cpp @@ -9,7 +9,7 @@ #include <automaton/FSM/NFA.h> #include <regexp/unbounded/UnboundedRegExp.h> -#include <factory/DataFactory.hpp> +#include <factory/XmlDataFactory.hpp> #include "automaton/generate/RandomAutomatonFactory.h" #include "regexp/generate/RandomRegExpFactory.h" @@ -57,7 +57,7 @@ int main(int argc, char* argv[]) { if(!alphabetSize.isSet()) throw exception::AlibException("Alphabet size is not defined."); automaton::NFA res = automaton::generate::RandomAutomatonFactory::generateNFA( nodes.getValue(), alphabetSize.getValue(), density.getValue() ); - alib::DataFactory::toStdout(res); + alib::XmlDataFactory::toStdout(res); } else if( type.getValue() == "RE" ) { if(!depth.isSet()) throw exception::AlibException("Depth is not defined."); @@ -66,14 +66,14 @@ int main(int argc, char* argv[]) { if(!alphabetSize.isSet()) throw exception::AlibException("Alphabet size is not defined."); regexp::UnboundedRegExp res = regexp::generate::RandomRegExpFactory::generateUnboundedRegExp(leafNodes.getValue(), depth.getValue(), alphabetSize.getValue() ); - alib::DataFactory::toStdout(res); + alib::XmlDataFactory::toStdout(res); } else { throw exception::AlibException("Invalid type."); } return 0; } catch( const exception::AlibException & exception ) { - alib::DataFactory::toStdout( exception ); + alib::XmlDataFactory::toStdout( exception ); return 1; } catch(const TCLAP::ArgException& exception) { std::cout << exception.error() << std::endl; diff --git a/arename2/src/arename.cpp b/arename2/src/arename.cpp index 2dccf99803..c397faeb96 100644 --- a/arename2/src/arename.cpp +++ b/arename2/src/arename.cpp @@ -8,7 +8,7 @@ #include <tclap/CmdLine.h> #include "exception/AlibException.h" -#include "factory/DataFactory.hpp" +#include "factory/XmlDataFactory.hpp" #include "automaton/simplify/Rename.h" int main(int argc, char** argv) { @@ -32,11 +32,11 @@ int main(int argc, char** argv) { sax::SaxParseInterface::parseStdin(tokens); } - alib::DataFactory::toStdout(automaton::simplify::Rename::rename(alib::DataFactory::fromTokens<automaton::Automaton>(tokens))); + alib::XmlDataFactory::toStdout(automaton::simplify::Rename::rename(alib::XmlDataFactory::fromTokens<automaton::Automaton>(tokens))); return 0; } catch (const exception::AlibException& exception) { - alib::DataFactory::toStdout(exception); + alib::XmlDataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { std::cout << exception.error() << std::endl; diff --git a/areverse2/src/areverse.cpp b/areverse2/src/areverse.cpp index b74d920f62..40ace10aae 100644 --- a/areverse2/src/areverse.cpp +++ b/areverse2/src/areverse.cpp @@ -9,7 +9,7 @@ #include <tclap/CmdLine.h> #include "exception/AlibException.h" -#include "factory/DataFactory.hpp" +#include "factory/XmlDataFactory.hpp" #include "automaton/transform/ReverseFSM.h" int main(int argc, char** argv) { @@ -33,11 +33,11 @@ int main(int argc, char** argv) { sax::SaxParseInterface::parseStdin(tokens); } - alib::DataFactory::toStdout(automaton::transform::ReverseFSM::convert(alib::DataFactory::fromTokens<automaton::Automaton>(tokens))); + alib::XmlDataFactory::toStdout(automaton::transform::ReverseFSM::convert(alib::XmlDataFactory::fromTokens<automaton::Automaton>(tokens))); return 0; } catch (const exception::AlibException& exception) { - alib::DataFactory::toStdout(exception); + alib::XmlDataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { std::cout << exception.error() << std::endl; diff --git a/arun2/src/arun.cpp b/arun2/src/arun.cpp index c56ab39b0c..660eae9498 100644 --- a/arun2/src/arun.cpp +++ b/arun2/src/arun.cpp @@ -8,7 +8,7 @@ #include <tclap/CmdLine.h> #include <vector> -#include <factory/DataFactory.hpp> +#include <factory/XmlDataFactory.hpp> #include <exception/AlibException.h> #include <string/String.h> #include <automaton/Automaton.h> @@ -58,22 +58,22 @@ int main(int argc, char* argv[]) { } if( type.getValue() == "occurrences") { - string::LinearString input = alib::DataFactory::fromTokens<string::LinearString>(inputTokens); - automaton::Automaton automaton = alib::DataFactory::fromTokens<automaton::Automaton>(automatonTokens); + string::LinearString input = alib::XmlDataFactory::fromTokens<string::LinearString>(inputTokens); + automaton::Automaton automaton = alib::XmlDataFactory::fromTokens<automaton::Automaton>(automatonTokens); std::set<unsigned> res = automaton::run::Occurrences::occurrences(automaton, input); - alib::DataFactory::toStdout( res ); + alib::XmlDataFactory::toStdout( res ); return 0; } else if( type.getValue() == "accept") { - string::LinearString input = alib::DataFactory::fromTokens<string::LinearString>(inputTokens); - automaton::Automaton automaton = alib::DataFactory::fromTokens<automaton::Automaton>(automatonTokens); + string::LinearString input = alib::XmlDataFactory::fromTokens<string::LinearString>(inputTokens); + automaton::Automaton automaton = alib::XmlDataFactory::fromTokens<automaton::Automaton>(automatonTokens); bool res = automaton::run::Accept::accept(automaton, input); - alib::DataFactory::toStdout( res ); + alib::XmlDataFactory::toStdout( res ); } else { throw exception::AlibException( "Invalid run type" ); return 1; } } catch ( const exception::AlibException & exception ) { - alib::DataFactory::toStdout( exception ); + alib::XmlDataFactory::toStdout( exception ); return 1; } catch (const TCLAP::ArgException& exception) { std::cout << exception.error() << std::endl; diff --git a/astat2/src/AutomataStat.cpp b/astat2/src/AutomataStat.cpp index 64a10629b8..684805b344 100644 --- a/astat2/src/AutomataStat.cpp +++ b/astat2/src/AutomataStat.cpp @@ -12,7 +12,7 @@ #include <automaton/FSM/NFA.h> #include <automaton/FSM/DFA.h> -#include <factory/DataFactory.hpp> +#include <factory/XmlDataFactory.hpp> void AutomataStat::stat(const automaton::Automaton& automaton, const Settings& settings) { automaton.getData().Accept((void*) &settings, AutomataStat::AUTOMATA_STAT); @@ -21,14 +21,14 @@ void AutomataStat::stat(const automaton::Automaton& automaton, const Settings& s void AutomataStat::stat(const automaton::NFA& automaton, const Settings& settings) { switch(settings.states) { case PrintOptions::PRINT: - alib::DataFactory::toStdout(automaton.getStates()); + alib::XmlDataFactory::toStdout(automaton.getStates()); break; case PrintOptions::QUANTITY: std::cout << automaton.getStates().size() << std::endl; break; case PrintOptions::BOTH: std::cout << automaton.getStates().size() << std::endl; - alib::DataFactory::toStdout(automaton.getStates()); + alib::XmlDataFactory::toStdout(automaton.getStates()); break; case PrintOptions::NOOP: break; @@ -36,14 +36,14 @@ void AutomataStat::stat(const automaton::NFA& automaton, const Settings& setting switch(settings.finalStates) { case PrintOptions::PRINT: - alib::DataFactory::toStdout(automaton.getFinalStates()); + alib::XmlDataFactory::toStdout(automaton.getFinalStates()); break; case PrintOptions::QUANTITY: std::cout << automaton.getFinalStates().size() << std::endl; break; case PrintOptions::BOTH: std::cout << automaton.getFinalStates().size() << std::endl; - alib::DataFactory::toStdout(automaton.getFinalStates()); + alib::XmlDataFactory::toStdout(automaton.getFinalStates()); break; case PrintOptions::NOOP: break; @@ -51,14 +51,14 @@ void AutomataStat::stat(const automaton::NFA& automaton, const Settings& setting switch(settings.initialStates) { case PrintOptions::PRINT: - alib::DataFactory::toStdout(automaton.getInitialState()); + alib::XmlDataFactory::toStdout(automaton.getInitialState()); break; case PrintOptions::QUANTITY: std::cout << 1 << std::endl; break; case PrintOptions::BOTH: std::cout << 1 << std::endl; - alib::DataFactory::toStdout(automaton.getInitialState()); + alib::XmlDataFactory::toStdout(automaton.getInitialState()); break; case PrintOptions::NOOP: break; @@ -66,14 +66,14 @@ void AutomataStat::stat(const automaton::NFA& automaton, const Settings& setting switch(settings.alphabet) { case PrintOptions::PRINT: - alib::DataFactory::toStdout(automaton.getInputAlphabet()); + alib::XmlDataFactory::toStdout(automaton.getInputAlphabet()); break; case PrintOptions::QUANTITY: std::cout << automaton.getInputAlphabet().size() << std::endl; break; case PrintOptions::BOTH: std::cout << automaton.getInputAlphabet().size() << std::endl; - alib::DataFactory::toStdout(automaton.getInputAlphabet()); + alib::XmlDataFactory::toStdout(automaton.getInputAlphabet()); break; case PrintOptions::NOOP: break; @@ -81,14 +81,14 @@ void AutomataStat::stat(const automaton::NFA& automaton, const Settings& setting switch(settings.transitions) { case PrintOptions::PRINT: - alib::DataFactory::toStdout(automaton.getTransitions()); + alib::XmlDataFactory::toStdout(automaton.getTransitions()); break; case PrintOptions::QUANTITY: std::cout << automaton.getTransitions().size() << std::endl; break; case PrintOptions::BOTH: std::cout << automaton.getTransitions().size() << std::endl; - alib::DataFactory::toStdout(automaton.getTransitions()); + alib::XmlDataFactory::toStdout(automaton.getTransitions()); break; case PrintOptions::NOOP: break; @@ -98,14 +98,14 @@ void AutomataStat::stat(const automaton::NFA& automaton, const Settings& setting void AutomataStat::stat(const automaton::DFA& automaton, const Settings& settings) { switch(settings.states) { case PrintOptions::PRINT: - alib::DataFactory::toStdout(automaton.getStates()); + alib::XmlDataFactory::toStdout(automaton.getStates()); break; case PrintOptions::QUANTITY: std::cout << automaton.getStates().size() << std::endl; break; case PrintOptions::BOTH: std::cout << automaton.getStates().size() << std::endl; - alib::DataFactory::toStdout(automaton.getStates()); + alib::XmlDataFactory::toStdout(automaton.getStates()); break; case PrintOptions::NOOP: break; @@ -113,14 +113,14 @@ void AutomataStat::stat(const automaton::DFA& automaton, const Settings& setting switch(settings.finalStates) { case PrintOptions::PRINT: - alib::DataFactory::toStdout(automaton.getFinalStates()); + alib::XmlDataFactory::toStdout(automaton.getFinalStates()); break; case PrintOptions::QUANTITY: std::cout << automaton.getFinalStates().size() << std::endl; break; case PrintOptions::BOTH: std::cout << automaton.getFinalStates().size() << std::endl; - alib::DataFactory::toStdout(automaton.getFinalStates()); + alib::XmlDataFactory::toStdout(automaton.getFinalStates()); break; case PrintOptions::NOOP: break; @@ -128,14 +128,14 @@ void AutomataStat::stat(const automaton::DFA& automaton, const Settings& setting switch(settings.initialStates) { case PrintOptions::PRINT: - alib::DataFactory::toStdout(automaton.getInitialState()); + alib::XmlDataFactory::toStdout(automaton.getInitialState()); break; case PrintOptions::QUANTITY: std::cout << 1 << std::endl; break; case PrintOptions::BOTH: std::cout << 1 << std::endl; - alib::DataFactory::toStdout(automaton.getInitialState()); + alib::XmlDataFactory::toStdout(automaton.getInitialState()); break; case PrintOptions::NOOP: break; @@ -143,14 +143,14 @@ void AutomataStat::stat(const automaton::DFA& automaton, const Settings& setting switch(settings.alphabet) { case PrintOptions::PRINT: - alib::DataFactory::toStdout(automaton.getInputAlphabet()); + alib::XmlDataFactory::toStdout(automaton.getInputAlphabet()); break; case PrintOptions::QUANTITY: std::cout << automaton.getInputAlphabet().size() << std::endl; break; case PrintOptions::BOTH: std::cout << automaton.getInputAlphabet().size() << std::endl; - alib::DataFactory::toStdout(automaton.getInputAlphabet()); + alib::XmlDataFactory::toStdout(automaton.getInputAlphabet()); break; case PrintOptions::NOOP: break; @@ -158,14 +158,14 @@ void AutomataStat::stat(const automaton::DFA& automaton, const Settings& setting switch(settings.transitions) { case PrintOptions::PRINT: - alib::DataFactory::toStdout(automaton.getTransitions()); + alib::XmlDataFactory::toStdout(automaton.getTransitions()); break; case PrintOptions::QUANTITY: std::cout << automaton.getTransitions().size() << std::endl; break; case PrintOptions::BOTH: std::cout << automaton.getTransitions().size() << std::endl; - alib::DataFactory::toStdout(automaton.getTransitions()); + alib::XmlDataFactory::toStdout(automaton.getTransitions()); break; case PrintOptions::NOOP: break; diff --git a/astat2/src/astat.cpp b/astat2/src/astat.cpp index bf357359f7..8905e0ee8b 100644 --- a/astat2/src/astat.cpp +++ b/astat2/src/astat.cpp @@ -8,7 +8,7 @@ #include <tclap/CmdLine.h> #include <vector> -#include <factory/DataFactory.hpp> +#include <factory/XmlDataFactory.hpp> #include <exception/AlibException.h> #include "Settings.h" @@ -118,18 +118,18 @@ int main(int argc, char* argv[]) { sax::SaxParseInterface::parseStdin(tokens); } - if( alib::DataFactory::first<automaton::Automaton>(tokens)) { - automaton::Automaton automaton = alib::DataFactory::fromTokens<automaton::Automaton>(tokens); + if( alib::XmlDataFactory::first<automaton::Automaton>(tokens)) { + automaton::Automaton automaton = alib::XmlDataFactory::fromTokens<automaton::Automaton>(tokens); AutomataStat::stat(automaton, settings); return 0; - } else if( alib::DataFactory::first<grammar::Grammar>(tokens)) { - grammar::Grammar grammar = alib::DataFactory::fromTokens<grammar::Grammar>(tokens); + } else if( alib::XmlDataFactory::first<grammar::Grammar>(tokens)) { + grammar::Grammar grammar = alib::XmlDataFactory::fromTokens<grammar::Grammar>(tokens); return 0; - } else if( alib::DataFactory::first<regexp::RegExp>(tokens)) { - regexp::RegExp regexp = alib::DataFactory::fromTokens<regexp::RegExp>(tokens); + } else if( alib::XmlDataFactory::first<regexp::RegExp>(tokens)) { + regexp::RegExp regexp = alib::XmlDataFactory::fromTokens<regexp::RegExp>(tokens); return 0; } else { @@ -137,7 +137,7 @@ int main(int argc, char* argv[]) { return 1; } } catch ( const exception::AlibException & exception ) { - alib::DataFactory::toStdout( exception ); + alib::XmlDataFactory::toStdout( exception ); return 1; } catch (const TCLAP::ArgException& exception) { std::cout << exception.error() << std::endl; diff --git a/astringology2/src/astringology.cpp b/astringology2/src/astringology.cpp index 65029862d9..c5f9a00f34 100644 --- a/astringology2/src/astringology.cpp +++ b/astringology2/src/astringology.cpp @@ -8,7 +8,7 @@ #include <tclap/CmdLine.h> #include <vector> -#include <factory/DataFactory.hpp> +#include <factory/XmlDataFactory.hpp> #include <exception/AlibException.h> #include <string/String.h> #include <automaton/Automaton.h> @@ -58,22 +58,22 @@ int main(int argc, char* argv[]) { } if( algorithm.getValue() == "exactMatch") { - string::String subject = alib::DataFactory::fromTokens<string::String>(subjectTokens); - string::String pattern = alib::DataFactory::fromTokens<string::String>(patternTokens); + string::String subject = alib::XmlDataFactory::fromTokens<string::String>(subjectTokens); + string::String pattern = alib::XmlDataFactory::fromTokens<string::String>(patternTokens); std::set<unsigned> res = string::naive::ExactMatch::match(subject, pattern); - alib::DataFactory::toStdout(res); + alib::XmlDataFactory::toStdout(res); return 0; } else if( algorithm.getValue() == "exactMatchingAutomaton") { - string::String pattern = alib::DataFactory::fromTokens<string::String>(patternTokens); + string::String pattern = alib::XmlDataFactory::fromTokens<string::String>(patternTokens); automaton::Automaton automaton = stringology::exact::ExactMatchingAutomaton::construct(pattern); - alib::DataFactory::toStdout(automaton); + alib::XmlDataFactory::toStdout(automaton); return 0; } else { throw exception::AlibException( "Invalid algorithm" ); return 1; } } catch( const exception::AlibException & exception ) { - alib::DataFactory::toStdout( exception ); + alib::XmlDataFactory::toStdout( exception ); return 1; } catch(const TCLAP::ArgException& exception) { std::cout << exception.error() << std::endl; diff --git a/atrim2/src/atrim.cpp b/atrim2/src/atrim.cpp index c0f4ef7736..86cb4dd4f3 100644 --- a/atrim2/src/atrim.cpp +++ b/atrim2/src/atrim.cpp @@ -7,7 +7,7 @@ #include <tclap/CmdLine.h> -#include <factory/DataFactory.hpp> +#include <factory/XmlDataFactory.hpp> #include <exception/AlibException.h> #include "grammar/simplify/Trim.h" @@ -71,33 +71,33 @@ int main(int argc, char* argv[]) { sax::SaxParseInterface::parseStdin(tokens); } - if( alib::DataFactory::first<automaton::Automaton>(tokens)) { - automaton::Automaton automaton = alib::DataFactory::fromTokens<automaton::Automaton>(tokens); + if( alib::XmlDataFactory::first<automaton::Automaton>(tokens)) { + automaton::Automaton automaton = alib::XmlDataFactory::fromTokens<automaton::Automaton>(tokens); automaton::Automaton res = trimAutomaton(automaton, unreachable.getValue(), useless.getValue() ); - alib::DataFactory::toStdout( res ); + alib::XmlDataFactory::toStdout( res ); return 0; - } else if( alib::DataFactory::first<grammar::Grammar>(tokens)) { - grammar::Grammar grammar = alib::DataFactory::fromTokens<grammar::Grammar>(tokens); + } else if( alib::XmlDataFactory::first<grammar::Grammar>(tokens)) { + grammar::Grammar grammar = alib::XmlDataFactory::fromTokens<grammar::Grammar>(tokens); grammar::Grammar res = trimGrammar(grammar, unreachable.getValue(), useless.getValue() ); - alib::DataFactory::toStdout( res ); + alib::XmlDataFactory::toStdout( res ); return 0; - } else if( alib::DataFactory::first<regexp::RegExp>(tokens)) { - regexp::RegExp regexp = alib::DataFactory::fromTokens<regexp::RegExp>(tokens); + } else if( alib::XmlDataFactory::first<regexp::RegExp>(tokens)) { + regexp::RegExp regexp = alib::XmlDataFactory::fromTokens<regexp::RegExp>(tokens); regexp::RegExp res = optimizeRegExp(regexp ); - alib::DataFactory::toStdout( res ); + alib::XmlDataFactory::toStdout( res ); return 0; } else { throw exception::AlibException( "Input not recognized." ); return 1; } } catch( const exception::AlibException & exception ) { - alib::DataFactory::toStdout( exception ); + alib::XmlDataFactory::toStdout( exception ); return 1; } catch(const TCLAP::ArgException& exception) { std::cout << exception.error() << std::endl; -- GitLab