diff --git a/alib2data/src/Api.cpp b/alib2data/src/Api.cpp index 22d1416d4b9a97106dad6df54b2786c50e6a5b9a..bc951570b7828a0ff35eda2c5217c05395f9515d 100644 --- a/alib2data/src/Api.cpp +++ b/alib2data/src/Api.cpp @@ -250,6 +250,14 @@ std::list<sax::Token> api<automaton::OneTapeDTM>::compose(const automaton::OneTa return ToXMLComposers::automatonComposer.compose(data); } +automaton::State api<automaton::State>::parse(std::list<sax::Token>& input) { + return FromXMLParsers::automatonParser.parseState(input); +} + +std::list<sax::Token> api<automaton::State>::compose(const automaton::State& data) { + return ToXMLComposers::automatonComposer.compose(data); +} + grammar::Grammar api<grammar::Grammar>::parse(std::list<sax::Token>& input) { return FromXMLParsers::grammarParser.parseGrammar(input); diff --git a/alib2data/src/Api.hpp b/alib2data/src/Api.hpp index 28dfdc7df109412ea631f3f580d59b5f632a9dc8..9fa47bb61f1b3bd31a0e317e2617b88b5dd766cd 100644 --- a/alib2data/src/Api.hpp +++ b/alib2data/src/Api.hpp @@ -222,6 +222,11 @@ struct api<automaton::OneTapeDTM> { static std::list<sax::Token> compose(const automaton::OneTapeDTM& data); }; +template<> +struct api<automaton::State> { + static automaton::State parse(std::list<sax::Token>& input); + static std::list<sax::Token> compose(const automaton::State& data); +}; template<> struct api<grammar::Grammar> { diff --git a/alib2data/src/alphabet/BlankSymbol.h b/alib2data/src/alphabet/BlankSymbol.h index 7425b628bf89af48e4084f041fa07c1b3f02633b..f67dc359e638c5e635e6b4ba6ec1608a5dbab5db 100644 --- a/alib2data/src/alphabet/BlankSymbol.h +++ b/alib2data/src/alphabet/BlankSymbol.h @@ -21,7 +21,7 @@ public: * Creates a blank symbol. * @param symbol name of the symbol */ - BlankSymbol(); + explicit BlankSymbol(); virtual SymbolBase* clone() const; virtual SymbolBase* plunder() &&; diff --git a/alib2data/src/alphabet/BottomOfTheStackSymbol.h b/alib2data/src/alphabet/BottomOfTheStackSymbol.h index 0a536a0bafa4db9508d51d672f186c9c34bb67c9..f18851e480a40a61362a5a11e68bf6e1444599ce 100644 --- a/alib2data/src/alphabet/BottomOfTheStackSymbol.h +++ b/alib2data/src/alphabet/BottomOfTheStackSymbol.h @@ -21,7 +21,7 @@ public: * Creates a blank symbol. * @param symbol name of the symbol */ - BottomOfTheStackSymbol(); + explicit BottomOfTheStackSymbol(); virtual SymbolBase* clone() const; virtual SymbolBase* plunder() &&; diff --git a/alib2data/src/alphabet/EndSymbol.h b/alib2data/src/alphabet/EndSymbol.h index 0941ad114b01b89e820e89c7c8664bd85c0722c6..8a69354bd6f8ff328f921a39c86c206f3b5eb81a 100644 --- a/alib2data/src/alphabet/EndSymbol.h +++ b/alib2data/src/alphabet/EndSymbol.h @@ -21,7 +21,7 @@ public: * Creates a blank symbol. * @param symbol name of the symbol */ - EndSymbol(); + explicit EndSymbol(); virtual SymbolBase* clone() const; virtual SymbolBase* plunder() &&; diff --git a/alib2data/src/automaton/AutomatonFromXMLParser.cpp b/alib2data/src/automaton/AutomatonFromXMLParser.cpp index 12cd8ea13a0fa99a15118e4906ad7278a4c25ae0..7d7d4fa8e71d25eb32dca2548171f69190d85df4 100644 --- a/alib2data/src/automaton/AutomatonFromXMLParser.cpp +++ b/alib2data/src/automaton/AutomatonFromXMLParser.cpp @@ -435,12 +435,16 @@ std::set<State> AutomatonFromXMLParser::parseStates(std::list<sax::Token> &input std::set<State> states; popToken(input, sax::Token::TokenType::START_ELEMENT, "states"); while (isTokenType(input, sax::Token::TokenType::START_ELEMENT)) { - states.insert(State(alib::api<label::Label>::parse(input))); + states.insert(parseState(input)); } popToken(input, sax::Token::TokenType::END_ELEMENT, "states"); return states; } +State AutomatonFromXMLParser::parseState(std::list<sax::Token> &input) const { + return State(alib::api<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"); diff --git a/alib2data/src/automaton/AutomatonFromXMLParser.h b/alib2data/src/automaton/AutomatonFromXMLParser.h index a1aa4e012b452ab07376ac4c09a1741d792c0b16..14cd31f3997e3eb8b117eeb57dc2bcdafbdc1ae0 100644 --- a/alib2data/src/automaton/AutomatonFromXMLParser.h +++ b/alib2data/src/automaton/AutomatonFromXMLParser.h @@ -45,6 +45,7 @@ namespace automaton { */ class AutomatonFromXMLParser : public sax::FromXMLParserHelper { std::set<State> parseStates(std::list<sax::Token> &input) const; + State parseState(std::list<sax::Token> &input) const; std::set<alphabet::Symbol> parseInputAlphabet(std::list<sax::Token> &input) const; std::set<alphabet::Symbol> parseCallInputAlphabet(std::list<sax::Token> &input) const; std::set<alphabet::Symbol> parseReturnInputAlphabet(std::list<sax::Token> &input) const; diff --git a/alib2data/src/automaton/AutomatonToXMLComposer.cpp b/alib2data/src/automaton/AutomatonToXMLComposer.cpp index 8b4fd75125e8964b0da024b24af472d52ecf6978..fcd7096ce816b8ffe35ee8f947f5c1afef7e97d6 100644 --- a/alib2data/src/automaton/AutomatonToXMLComposer.cpp +++ b/alib2data/src/automaton/AutomatonToXMLComposer.cpp @@ -776,5 +776,11 @@ std::list<sax::Token> AutomatonToXMLComposer::compose(const OneTapeDTM& automato return out; } +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())); + return out; +} + } /* namespace automaton */ diff --git a/alib2data/src/automaton/AutomatonToXMLComposer.h b/alib2data/src/automaton/AutomatonToXMLComposer.h index 5b10c1eb081a9cd3e2259bc10180a4c0b464deb6..79da04ae103e11f62531e46a3f3ee4d7eba62e26 100644 --- a/alib2data/src/automaton/AutomatonToXMLComposer.h +++ b/alib2data/src/automaton/AutomatonToXMLComposer.h @@ -106,6 +106,8 @@ class AutomatonToXMLComposer { std::list<sax::Token> compose(const SinglePopNPDA& automaton) const; std::list<sax::Token> compose(const OneTapeDTM& automaton) const; + std::list<sax::Token> compose(const State& state) const; + template<typename T> friend class alib::api; }; diff --git a/alib2data/src/automaton/FSM/DFA.h b/alib2data/src/automaton/FSM/DFA.h index 3749c9310fd342e9119232d846ae92b252f24935..6aae39ba6804d526825a1684d310c0af2652fc15 100644 --- a/alib2data/src/automaton/FSM/DFA.h +++ b/alib2data/src/automaton/FSM/DFA.h @@ -24,7 +24,7 @@ class DFA : public std::acceptor<DFA, VisitableAutomatonBase, std::acceptor<DFA, protected: std::map<std::pair<State, alphabet::Symbol>, State> transitions; public: - DFA(const State& initialState); + explicit DFA(const State& initialState); virtual AutomatonBase* clone() const; diff --git a/alib2data/src/automaton/PDA/DPDA.h b/alib2data/src/automaton/PDA/DPDA.h index bd80861563b86b86b25baf8c7634998950e118cc..0605585360f4e71a3a045b071c9f7bceaea37d9e 100644 --- a/alib2data/src/automaton/PDA/DPDA.h +++ b/alib2data/src/automaton/PDA/DPDA.h @@ -32,7 +32,7 @@ class DPDA : public std::acceptor<DPDA, VisitableAutomatonBase, std::acceptor<DP protected: std::map<std::tuple<State, std::variant<string::Epsilon, alphabet::Symbol>, std::vector<alphabet::Symbol> >, std::pair<State, std::vector<alphabet::Symbol> > > transitions; public: - DPDA(const State& initialState, const alphabet::Symbol& initialPushdownSymbol); + explicit DPDA(const State& initialState, const alphabet::Symbol& initialPushdownSymbol); virtual AutomatonBase* clone() const; diff --git a/alib2data/src/automaton/PDA/InputDrivenNPDA.h b/alib2data/src/automaton/PDA/InputDrivenNPDA.h index 8474cca0b3b29adbe867244006b46f948f3be1b2..ce9ad393b98cf052e9f7076984caad8543c6b0f5 100644 --- a/alib2data/src/automaton/PDA/InputDrivenNPDA.h +++ b/alib2data/src/automaton/PDA/InputDrivenNPDA.h @@ -27,7 +27,7 @@ protected: std::map<std::pair<State, alphabet::Symbol>, std::set<State> > transitions; std::map<alphabet::Symbol, std::pair<std::vector<alphabet::Symbol>, std::vector<alphabet::Symbol>>> inputSymbolToPushdownStoreOperation; public: - InputDrivenNPDA(const alphabet::Symbol& initialPushdownSymbol); + explicit InputDrivenNPDA(const alphabet::Symbol& initialPushdownSymbol); virtual AutomatonBase* clone() const; diff --git a/alib2data/src/automaton/PDA/RealTimeHeightDeterministicNPDA.h b/alib2data/src/automaton/PDA/RealTimeHeightDeterministicNPDA.h index d9ed4eeaa0b4241d08b3e230b0ebabf9c44fdc21..4db20c948d6dc6e0a87dced9ca5877edd492e4c1 100644 --- a/alib2data/src/automaton/PDA/RealTimeHeightDeterministicNPDA.h +++ b/alib2data/src/automaton/PDA/RealTimeHeightDeterministicNPDA.h @@ -31,7 +31,7 @@ protected: std::map<std::tuple<State, std::variant<string::Epsilon, alphabet::Symbol>, alphabet::Symbol>, std::set<State> > returnTransitions; std::map<std::pair<State, std::variant<string::Epsilon, alphabet::Symbol>>, std::set<State> > localTransitions; public: - RealTimeHeightDeterministicNPDA(const alphabet::Symbol& bottomOfTheStackSymbol); + explicit RealTimeHeightDeterministicNPDA(const alphabet::Symbol& bottomOfTheStackSymbol); virtual AutomatonBase* clone() const; diff --git a/alib2data/src/automaton/PDA/SinglePopDPDA.h b/alib2data/src/automaton/PDA/SinglePopDPDA.h index f6f663dc1148cdf23fedf4d039062968a665a221..48ec8b9e89ec88fb1fb97958d9431ffc08948367 100644 --- a/alib2data/src/automaton/PDA/SinglePopDPDA.h +++ b/alib2data/src/automaton/PDA/SinglePopDPDA.h @@ -32,7 +32,7 @@ class SinglePopDPDA: public std::acceptor<SinglePopDPDA, VisitableAutomatonBase, protected: std::map<std::tuple<State, std::variant<string::Epsilon, alphabet::Symbol>, alphabet::Symbol>, std::pair<State, std::vector<alphabet::Symbol> > > transitions; public: - SinglePopDPDA(const State& initialState, const alphabet::Symbol& initialPushdownSymbol); + explicit SinglePopDPDA(const State& initialState, const alphabet::Symbol& initialPushdownSymbol); virtual AutomatonBase* clone() const; diff --git a/alib2data/src/automaton/PDA/VisiblyPushdownNPDA.h b/alib2data/src/automaton/PDA/VisiblyPushdownNPDA.h index 77926c24fbe90554c248d09ae3f2928c63adcd87..f63db90f3887a2177253ab544cc6974efd2af86d 100644 --- a/alib2data/src/automaton/PDA/VisiblyPushdownNPDA.h +++ b/alib2data/src/automaton/PDA/VisiblyPushdownNPDA.h @@ -29,7 +29,7 @@ protected: std::map<std::tuple<State, alphabet::Symbol, alphabet::Symbol>, std::set<State> > returnTransitions; std::map<std::pair<State, alphabet::Symbol>, std::set<State> > localTransitions; public: - VisiblyPushdownNPDA(const alphabet::Symbol& bottomOfTheStackSymbol); + explicit VisiblyPushdownNPDA(const alphabet::Symbol& bottomOfTheStackSymbol); virtual AutomatonBase* clone() const; diff --git a/alib2data/src/automaton/TM/OneTapeDTM.h b/alib2data/src/automaton/TM/OneTapeDTM.h index a38ddca852f104ae74f6b7f2f9075ed0b90c4a06..5cd77dbbcc744f4f9efe9a810a1e1ffce9632e16 100644 --- a/alib2data/src/automaton/TM/OneTapeDTM.h +++ b/alib2data/src/automaton/TM/OneTapeDTM.h @@ -27,11 +27,11 @@ protected: std::map<std::pair<State, alphabet::Symbol>, std::tuple<State, alphabet::Symbol, Shift> > transitions; public: + explicit OneTapeDTM(const State& initialState, const alphabet::Symbol& blank); + virtual AutomatonBase* clone() const; - - virtual AutomatonBase* plunder() &&; - OneTapeDTM(const State& initialState, const alphabet::Symbol& blank); + virtual AutomatonBase* plunder() &&; /** * @copydoc Automaton::removeState(const State&) diff --git a/alib2data/src/automaton/UnknownAutomaton.h b/alib2data/src/automaton/UnknownAutomaton.h index 716f78fc3c4b9e478a265f00021ea31d83d36732..c9151c3ed7fc3567984a10260e0090cbc27c2325 100644 --- a/alib2data/src/automaton/UnknownAutomaton.h +++ b/alib2data/src/automaton/UnknownAutomaton.h @@ -34,7 +34,8 @@ protected: std::set<UnknownTransition> transitions; public: - UnknownAutomaton(); + explicit UnknownAutomaton(); + //TODO destructor and operator= and copy constructor ~UnknownAutomaton() noexcept; diff --git a/alib2data/src/automaton/UnknownTransition.h b/alib2data/src/automaton/UnknownTransition.h index 8c77a8fbaac634ec687435550735f37da8a303ba..4a6517d330e074ed3cd3595e2c56cceebb896c83 100644 --- a/alib2data/src/automaton/UnknownTransition.h +++ b/alib2data/src/automaton/UnknownTransition.h @@ -35,9 +35,10 @@ protected: Shift shift; public: - UnknownTransition(); - - UnknownTransition(const State& from, const State& to, const std::vector<alphabet::Symbol>& pop, const std::vector<alphabet::Symbol>& push, const std::variant<string::Epsilon, alphabet::Symbol>& input, const std::variant<string::Epsilon, alphabet::Symbol>& output, Shift shift); + explicit UnknownTransition(); + + explicit UnknownTransition(const State& from, const State& to, const std::vector<alphabet::Symbol>& pop, const std::vector<alphabet::Symbol>& push, const std::variant<string::Epsilon, alphabet::Symbol>& input, const std::variant<string::Epsilon, alphabet::Symbol>& output, Shift shift); + ~UnknownTransition(); /** diff --git a/alib2data/src/container/ObjectsPair.h b/alib2data/src/container/ObjectsPair.h index e65e56f491a9c1422d88083047534448ade01f4b..fe8691ab17f604c7a82822ce10036690d376c94a 100644 --- a/alib2data/src/container/ObjectsPair.h +++ b/alib2data/src/container/ObjectsPair.h @@ -22,7 +22,7 @@ namespace container { */ class ObjectsPair : public std::pair<alib::Object, alib::Object>, public std::acceptor<ObjectsPair, VisitableContainerBase, std::acceptor<ObjectsPair, alib::VisitableObjectBase, ContainerBase> > { public: - ObjectsPair(const alib::Object& first, const alib::Object& second); + explicit ObjectsPair(const alib::Object& first, const alib::Object& second); virtual ContainerBase* clone() const; diff --git a/alib2data/src/exception/AlibException.cpp b/alib2data/src/exception/AlibException.cpp index fd8645fd9043ac039f8722e1066e144d075635d8..c3174e2f543968ac92b743778c50be8419784804 100644 --- a/alib2data/src/exception/AlibException.cpp +++ b/alib2data/src/exception/AlibException.cpp @@ -23,7 +23,7 @@ AlibException::AlibException ( ) { this->whatMessage += this->backtrace; } -AlibException::AlibException ( const std::string & cause ) : AlibException() { +AlibException::AlibException ( const std::string & cause ) : AlibException { } { this->cause = cause; this->whatMessage += this->cause; diff --git a/alib2data/src/exception/AlibException.h b/alib2data/src/exception/AlibException.h index 9de47eb039f506a7536f1e0a8f27d8e2b31ae9a2..4b90853c48e28cce47d7b5cd4dbfba502dbade5a 100644 --- a/alib2data/src/exception/AlibException.h +++ b/alib2data/src/exception/AlibException.h @@ -21,14 +21,15 @@ namespace exception { */ class AlibException : public std::exception, public std::acceptor<AlibException, alib::VisitableObjectBase, alib::ObjectBase> { protected: - std::string cause; std::string backtrace; std::string whatMessage; + public: + explicit AlibException ( ); - AlibException ( ); explicit AlibException ( const std::string & cause ); + virtual ~AlibException ( ) noexcept; virtual alib::ObjectBase* clone() const; diff --git a/alib2data/src/grammar/ContextFree/CFG.h b/alib2data/src/grammar/ContextFree/CFG.h index 0132bb083625aba3193a85d20adc5e5f838b0230..9e014389deb7822e45b8c8bfbf3bddac9ae50498 100644 --- a/alib2data/src/grammar/ContextFree/CFG.h +++ b/alib2data/src/grammar/ContextFree/CFG.h @@ -21,10 +21,11 @@ namespace grammar { */ class CFG : public std::acceptor<CFG, VisitableGrammarBase, std::acceptor<CFG, alib::VisitableObjectBase, GrammarBase> >, public TerminalNonterminalAlphabetInitialSymbol { std::map<alphabet::Symbol, std::set<std::vector<alphabet::Symbol>>> rules; + public: - CFG(const alphabet::Symbol& initialSymbol); + explicit CFG(const alphabet::Symbol& initialSymbol); - CFG(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); + explicit CFG(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); virtual GrammarBase* clone() const; diff --git a/alib2data/src/grammar/ContextFree/CNF.h b/alib2data/src/grammar/ContextFree/CNF.h index cd45d106e58eeb20fe44c2760599996841247c91..833b85e80c2c6cf41a3a6c1402a6b53f0716bd1b 100644 --- a/alib2data/src/grammar/ContextFree/CNF.h +++ b/alib2data/src/grammar/ContextFree/CNF.h @@ -23,10 +23,11 @@ namespace grammar { class CNF : public std::acceptor<CNF, VisitableGrammarBase, std::acceptor<CNF, alib::VisitableObjectBase, GrammarBase> >, public TerminalNonterminalAlphabetInitialSymbol { std::map<alphabet::Symbol, std::set<std::variant<alphabet::Symbol, std::pair<alphabet::Symbol, alphabet::Symbol>>>> rules; bool generatesEpsilon; + public: - CNF(const alphabet::Symbol& initialSymbol); + explicit CNF(const alphabet::Symbol& initialSymbol); - CNF(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); + explicit CNF(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); virtual GrammarBase* clone() const; diff --git a/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.h b/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.h index ee3b55546977cee482d1ed816da1e9fcd7a1285a..e2751e1e8dc3ca26b0ce0e366458bbfd01fef7d8 100644 --- a/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.h +++ b/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.h @@ -22,10 +22,11 @@ namespace grammar { class EpsilonFreeCFG : public std::acceptor<EpsilonFreeCFG, VisitableGrammarBase, std::acceptor<EpsilonFreeCFG, alib::VisitableObjectBase, GrammarBase> >, public TerminalNonterminalAlphabetInitialSymbol { std::map<alphabet::Symbol, std::set<std::vector<alphabet::Symbol>>> rules; bool generatesEpsilon; + public: - EpsilonFreeCFG(const alphabet::Symbol& initialSymbol); + explicit EpsilonFreeCFG(const alphabet::Symbol& initialSymbol); - EpsilonFreeCFG(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); + explicit EpsilonFreeCFG(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); virtual GrammarBase* clone() const; diff --git a/alib2data/src/grammar/ContextFree/GNF.h b/alib2data/src/grammar/ContextFree/GNF.h index b81535d0c15e1099cc120a18236c46f210404b7d..43134473fc746edb7acd1c64f75e8346d9ca4255 100644 --- a/alib2data/src/grammar/ContextFree/GNF.h +++ b/alib2data/src/grammar/ContextFree/GNF.h @@ -23,9 +23,9 @@ class GNF : public std::acceptor<GNF, VisitableGrammarBase, std::acceptor<GNF, a std::map<alphabet::Symbol, std::set<std::pair<alphabet::Symbol, std::vector<alphabet::Symbol> >> > rules; bool generatesEpsilon; public: - GNF(const alphabet::Symbol& initialSymbol); + explicit GNF(const alphabet::Symbol& initialSymbol); - GNF(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); + explicit GNF(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); virtual GrammarBase* clone() const; diff --git a/alib2data/src/grammar/ContextFree/LG.h b/alib2data/src/grammar/ContextFree/LG.h index 47374f1bba40581ad61528835da3028902297c1a..56b5d344421fedadb83ceb858ee0e185e334c405 100644 --- a/alib2data/src/grammar/ContextFree/LG.h +++ b/alib2data/src/grammar/ContextFree/LG.h @@ -24,9 +24,9 @@ namespace grammar { class LG : public std::acceptor<LG, VisitableGrammarBase, std::acceptor<LG, alib::VisitableObjectBase, GrammarBase> >, public TerminalNonterminalAlphabetInitialSymbol { std::map<alphabet::Symbol, std::set<std::variant<std::vector<alphabet::Symbol>, std::tuple<std::vector<alphabet::Symbol>, alphabet::Symbol, std::vector<alphabet::Symbol>> >> > rules; public: - LG(const alphabet::Symbol& initialSymbol); + explicit LG(const alphabet::Symbol& initialSymbol); - LG(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); + explicit LG(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); virtual GrammarBase* clone() const; diff --git a/alib2data/src/grammar/ContextSensitive/CSG.h b/alib2data/src/grammar/ContextSensitive/CSG.h index 0389c7ffe1ba7569ef24141bcdd7fcd2afbc5ed7..760a9319eb5ac6ae035c3fc139a10cc879b2a6ab 100644 --- a/alib2data/src/grammar/ContextSensitive/CSG.h +++ b/alib2data/src/grammar/ContextSensitive/CSG.h @@ -21,10 +21,11 @@ namespace grammar { class CSG : public std::acceptor<CSG, VisitableGrammarBase, std::acceptor<CSG, alib::VisitableObjectBase, GrammarBase> >, public TerminalNonterminalAlphabetInitialSymbol { std::map<std::tuple<std::vector<alphabet::Symbol>, alphabet::Symbol, std::vector<alphabet::Symbol>>, std::set<std::vector<alphabet::Symbol>>> rules; bool generatesEpsilon; + public: - CSG(const alphabet::Symbol& initialSymbol); + explicit CSG(const alphabet::Symbol& initialSymbol); - CSG(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); + explicit CSG(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); virtual GrammarBase* clone() const; diff --git a/alib2data/src/grammar/ContextSensitive/NonContractingGrammar.h b/alib2data/src/grammar/ContextSensitive/NonContractingGrammar.h index 1223f714b6ae2e28bec2e1bcbedb24a6b7ccaf9a..4b69b41aba6f09dba849d2123ba83f171184097b 100644 --- a/alib2data/src/grammar/ContextSensitive/NonContractingGrammar.h +++ b/alib2data/src/grammar/ContextSensitive/NonContractingGrammar.h @@ -21,10 +21,11 @@ namespace grammar { class NonContractingGrammar : public std::acceptor<NonContractingGrammar, VisitableGrammarBase, std::acceptor<NonContractingGrammar, alib::VisitableObjectBase, GrammarBase> >, public TerminalNonterminalAlphabetInitialSymbol { std::map<std::vector<alphabet::Symbol>, std::set<std::vector<alphabet::Symbol>>> rules; bool generatesEpsilon; + public: - NonContractingGrammar(const alphabet::Symbol& initialSymbol); + explicit NonContractingGrammar(const alphabet::Symbol& initialSymbol); - NonContractingGrammar(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); + explicit NonContractingGrammar(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); virtual GrammarBase* clone() const; diff --git a/alib2data/src/grammar/Regular/LeftLG.h b/alib2data/src/grammar/Regular/LeftLG.h index 00cc4eab633ba75073af5b36ba60c808c332acbc..a972d9aa55171a86e8a1546bbe581fa5259d75d1 100644 --- a/alib2data/src/grammar/Regular/LeftLG.h +++ b/alib2data/src/grammar/Regular/LeftLG.h @@ -21,10 +21,11 @@ namespace grammar { */ class LeftLG : public std::acceptor<LeftLG, VisitableGrammarBase, std::acceptor<LeftLG, alib::VisitableObjectBase, GrammarBase> >, public TerminalNonterminalAlphabetInitialSymbol { std::map<alphabet::Symbol, std::set<std::variant<std::vector<alphabet::Symbol>, std::pair<alphabet::Symbol, std::vector<alphabet::Symbol>> >> > rules; + public: - LeftLG(const alphabet::Symbol& initialSymbol); + explicit LeftLG(const alphabet::Symbol& initialSymbol); - LeftLG(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); + explicit LeftLG(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); virtual GrammarBase* clone() const; diff --git a/alib2data/src/grammar/Regular/LeftRG.h b/alib2data/src/grammar/Regular/LeftRG.h index e4c5470a89f7eeecfa8759dee0d16035b0e4d25d..aee1e8c96f3bc6548d08d2ff19c6a1cbe58621cf 100644 --- a/alib2data/src/grammar/Regular/LeftRG.h +++ b/alib2data/src/grammar/Regular/LeftRG.h @@ -38,16 +38,17 @@ class LeftRG : public std::acceptor<LeftRG, VisitableGrammarBase, std::acceptor< * Boolean signaling whether grammar generates empty string or don't. */ bool generatesEpsilon; + public: /** * Creates a new instance of Left regular grammar with concrete initial symbol */ - LeftRG(const alphabet::Symbol& initialSymbol); + explicit LeftRG(const alphabet::Symbol& initialSymbol); /** * Creates a new instance of Left regular grammar with concrete nonterminal, terminal alphabet and initial symbol */ - LeftRG(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); + explicit LeftRG(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); /** * @copydoc alib::base::clone() diff --git a/alib2data/src/grammar/Regular/RightLG.h b/alib2data/src/grammar/Regular/RightLG.h index ffe784f00c6f013cb68ea65bd27de98e28926597..b31d5476cc25bc12e0dc9de72ce0d25e3f2dbe4a 100644 --- a/alib2data/src/grammar/Regular/RightLG.h +++ b/alib2data/src/grammar/Regular/RightLG.h @@ -21,10 +21,11 @@ namespace grammar { */ class RightLG : public std::acceptor<RightLG, VisitableGrammarBase, std::acceptor<RightLG, alib::VisitableObjectBase, GrammarBase> >, public TerminalNonterminalAlphabetInitialSymbol { std::map<alphabet::Symbol, std::set<std::variant<std::vector<alphabet::Symbol>, std::pair<std::vector<alphabet::Symbol>, alphabet::Symbol> >> > rules; + public: - RightLG(const alphabet::Symbol& initialSymbol); + explicit RightLG(const alphabet::Symbol& initialSymbol); - RightLG(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); + explicit RightLG(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); virtual GrammarBase* clone() const; diff --git a/alib2data/src/grammar/Regular/RightRG.h b/alib2data/src/grammar/Regular/RightRG.h index 3182e4f4639caa9e8a1f518d084704480d680e13..eb173e4cb94972e9976b52fa15e081b965a43d21 100644 --- a/alib2data/src/grammar/Regular/RightRG.h +++ b/alib2data/src/grammar/Regular/RightRG.h @@ -38,10 +38,11 @@ class RightRG : public std::acceptor<RightRG, VisitableGrammarBase, std::accepto * Boolean signaling whether grammar generates empty string or don't. */ bool generatesEpsilon; + public: - RightRG(const alphabet::Symbol& initialSymbol); + explicit RightRG(const alphabet::Symbol& initialSymbol); - RightRG(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); + explicit RightRG(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); virtual GrammarBase* clone() const; diff --git a/alib2data/src/grammar/UnknownGrammar.h b/alib2data/src/grammar/UnknownGrammar.h index f52cd43bdf093dac0e691f5950a5f512af71a203..7bd44a975c135fa47334f6c592a62071a9dcba86 100644 --- a/alib2data/src/grammar/UnknownGrammar.h +++ b/alib2data/src/grammar/UnknownGrammar.h @@ -23,7 +23,7 @@ class UnknownGrammar : public std::acceptor<UnknownGrammar, VisitableGrammarBase std::set<UnknownRule> rules; alphabet::Symbol* initialSymbol; public: - UnknownGrammar(); + explicit UnknownGrammar(); //TODO destructor and operator= and copy constructor virtual GrammarBase* clone() const; diff --git a/alib2data/src/grammar/UnknownRule.h b/alib2data/src/grammar/UnknownRule.h index cef0bf85c08c0fac0ccd7a48beec0cb67f38c78b..d7e076fdacc5340c00ece25a1775f005c9a32de5 100644 --- a/alib2data/src/grammar/UnknownRule.h +++ b/alib2data/src/grammar/UnknownRule.h @@ -21,8 +21,8 @@ private: std::vector<alphabet::Symbol> leftSide; std::vector<alphabet::Symbol> rightSide; public: - UnknownRule(); - UnknownRule(const std::vector<alphabet::Symbol>& leftSide, const std::vector<alphabet::Symbol>& rightSide); + explicit UnknownRule(); + explicit UnknownRule(const std::vector<alphabet::Symbol>& leftSide, const std::vector<alphabet::Symbol>& rightSide); /** * Sets left side of the rule. diff --git a/alib2data/src/grammar/Unrestricted/ContextPreservingUnrestrictedGrammar.h b/alib2data/src/grammar/Unrestricted/ContextPreservingUnrestrictedGrammar.h index 958478e057ff4f304e02e46d4a2d3923084f93f6..c5c425f843bc89a2b29f70959affa06401aef553 100644 --- a/alib2data/src/grammar/Unrestricted/ContextPreservingUnrestrictedGrammar.h +++ b/alib2data/src/grammar/Unrestricted/ContextPreservingUnrestrictedGrammar.h @@ -20,10 +20,11 @@ namespace grammar { */ class ContextPreservingUnrestrictedGrammar : public std::acceptor<ContextPreservingUnrestrictedGrammar, VisitableGrammarBase, std::acceptor<ContextPreservingUnrestrictedGrammar, alib::VisitableObjectBase, GrammarBase> >, public TerminalNonterminalAlphabetInitialSymbol { std::map<std::tuple<std::vector<alphabet::Symbol>, alphabet::Symbol, std::vector<alphabet::Symbol>>, std::set<std::vector<alphabet::Symbol>>> rules; + public: - ContextPreservingUnrestrictedGrammar(const alphabet::Symbol& initialSymbol); + explicit ContextPreservingUnrestrictedGrammar(const alphabet::Symbol& initialSymbol); - ContextPreservingUnrestrictedGrammar(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); + explicit ContextPreservingUnrestrictedGrammar(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); virtual GrammarBase* clone() const; diff --git a/alib2data/src/grammar/Unrestricted/UnrestrictedGrammar.h b/alib2data/src/grammar/Unrestricted/UnrestrictedGrammar.h index bcb7f71437a0f3f3cc26cb2fbb9ada1c085544c5..9639bd92b52b0d5343eb9d0ae2e46f9366433168 100644 --- a/alib2data/src/grammar/Unrestricted/UnrestrictedGrammar.h +++ b/alib2data/src/grammar/Unrestricted/UnrestrictedGrammar.h @@ -22,9 +22,9 @@ class UnrestrictedGrammar : public std::acceptor<UnrestrictedGrammar, VisitableG std::map<std::vector<alphabet::Symbol>, std::set<std::vector<alphabet::Symbol>>> rules; public: - UnrestrictedGrammar(const alphabet::Symbol& initialSymbol); + explicit UnrestrictedGrammar(const alphabet::Symbol& initialSymbol); - UnrestrictedGrammar(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); + explicit UnrestrictedGrammar(const std::set<alphabet::Symbol>& nonTerminalSymbols, const std::set<alphabet::Symbol>& terminalSymbols, const alphabet::Symbol& initialSymbol); virtual GrammarBase* clone() const; diff --git a/alib2data/src/grammar/common/TerminalNonterminalAlphabetInitialSymbol.h b/alib2data/src/grammar/common/TerminalNonterminalAlphabetInitialSymbol.h index 321f647627ea1f7b93d265f8cc4a233752a4ee01..7c7a3ccaebc9591f9afd7821d80e49b92cf7dd7d 100644 --- a/alib2data/src/grammar/common/TerminalNonterminalAlphabetInitialSymbol.h +++ b/alib2data/src/grammar/common/TerminalNonterminalAlphabetInitialSymbol.h @@ -41,7 +41,7 @@ public: * Creates a new instance, initial symbol is included in the nonterminal alphabet * @param initialSymbol */ - TerminalNonterminalAlphabetInitialSymbol(const alphabet::Symbol& initialSymbol); + explicit TerminalNonterminalAlphabetInitialSymbol(const alphabet::Symbol& initialSymbol); /** * Adds terminal symbol to the terminal alphabet. diff --git a/alib2data/src/label/HexavigesimalLabel.h b/alib2data/src/label/HexavigesimalLabel.h index d0a883a77ed1a3a18bb105fd4a7c058cf033c6e6..206cce8c39580ed6c777f2a2cda2198062e4fb1c 100644 --- a/alib2data/src/label/HexavigesimalLabel.h +++ b/alib2data/src/label/HexavigesimalLabel.h @@ -21,17 +21,18 @@ namespace label { class HexavigesimalLabel : public std::acceptor<HexavigesimalLabel, VisitableLabelBase, std::acceptor<HexavigesimalLabel, alib::VisitableObjectBase, LabelBase> > { protected: int hexavigesimal; -public: - virtual LabelBase* clone() const; - - virtual LabelBase* plunder() &&; +public: /** * Creates new symbol with given name. * @param symbol name of the symbol */ explicit HexavigesimalLabel(int hexavigesimal); + virtual LabelBase* clone() const; + + virtual LabelBase* plunder() &&; + virtual bool operator<(const alib::ObjectBase& other) const; virtual bool operator>(const alib::ObjectBase& other) const; diff --git a/alib2data/src/label/LabelPairLabel.h b/alib2data/src/label/LabelPairLabel.h index eed88ccdce137cee81a78721b3174205207c0f2f..1bfa1c5a272c06babee0ed37143d6ad6f38e4476 100644 --- a/alib2data/src/label/LabelPairLabel.h +++ b/alib2data/src/label/LabelPairLabel.h @@ -23,18 +23,20 @@ namespace label { class LabelPairLabel : public std::acceptor<LabelPairLabel, VisitableLabelBase, std::acceptor<LabelPairLabel, alib::VisitableObjectBase, LabelBase> > { protected: std::pair<Label, Label> label; -public: - virtual LabelBase* clone() const; - - virtual LabelBase* plunder() &&; +public: /** * Creates new symbol with given name. * @param symbol name of the symbol */ explicit LabelPairLabel(const std::pair<Label, Label>& label); + explicit LabelPairLabel(std::pair<Label, Label>&& label); + virtual LabelBase* clone() const; + + virtual LabelBase* plunder() &&; + virtual bool operator<(const alib::ObjectBase& other) const; virtual bool operator>(const alib::ObjectBase& other) const; diff --git a/alib2data/src/label/LabelSetLabel.h b/alib2data/src/label/LabelSetLabel.h index d8866ea19726083693d1406b0badadcd519a0ce9..5d1bd413c9acd5fa38a2bef354fcd994e5346a11 100644 --- a/alib2data/src/label/LabelSetLabel.h +++ b/alib2data/src/label/LabelSetLabel.h @@ -23,18 +23,20 @@ namespace label { class LabelSetLabel : public std::acceptor<LabelSetLabel, VisitableLabelBase, std::acceptor<LabelSetLabel, alib::VisitableObjectBase, LabelBase> > { protected: std::set<Label> label; -public: - virtual LabelBase* clone() const; - - virtual LabelBase* plunder() &&; +public: /** * Creates new symbol with given name. * @param symbol name of the symbol */ explicit LabelSetLabel(const std::set<Label>& label); + explicit LabelSetLabel(std::set<Label>&& label); + virtual LabelBase* clone() const; + + virtual LabelBase* plunder() &&; + virtual bool operator<(const alib::ObjectBase& other) const; virtual bool operator>(const alib::ObjectBase& other) const; diff --git a/alib2data/src/label/ObjectLabel.h b/alib2data/src/label/ObjectLabel.h index fd6c1fe63370f519aeed30a313b29e5b0c02886b..e5bdc9ae0ec688d789de8fdba4d8f2a1037c8c27 100644 --- a/alib2data/src/label/ObjectLabel.h +++ b/alib2data/src/label/ObjectLabel.h @@ -21,11 +21,8 @@ namespace label { class ObjectLabel : public std::acceptor<ObjectLabel, VisitableLabelBase, std::acceptor<ObjectLabel, alib::VisitableObjectBase, LabelBase> > { protected: alib::Object label; -public: - virtual LabelBase* clone() const; - - virtual LabelBase* plunder() &&; +public: /** * Creates new symbol with given name. * @param symbol name of the symbol @@ -34,6 +31,10 @@ public: explicit ObjectLabel(alib::Object&& label); + virtual LabelBase* clone() const; + + virtual LabelBase* plunder() &&; + virtual bool operator<(const alib::ObjectBase& other) const; virtual bool operator>(const alib::ObjectBase& other) const; diff --git a/alib2data/src/label/PrimitiveLabel.h b/alib2data/src/label/PrimitiveLabel.h index 07ccbdff078b085a353ab4b500bb1cde098bb968..94498412245855a248bcf007f9758bee0eec66bb 100644 --- a/alib2data/src/label/PrimitiveLabel.h +++ b/alib2data/src/label/PrimitiveLabel.h @@ -21,18 +21,20 @@ namespace label { class PrimitiveLabel : public std::acceptor<PrimitiveLabel, VisitableLabelBase, std::acceptor<PrimitiveLabel, alib::VisitableObjectBase, LabelBase> > { protected: primitive::Primitive primitive; -public: - virtual LabelBase* clone() const; - - virtual LabelBase* plunder() &&; +public: /** * Creates new symbol with given name. * @param symbol name of the symbol */ explicit PrimitiveLabel(const primitive::Primitive& primitive); + explicit PrimitiveLabel(primitive::Primitive&& primitive); + virtual LabelBase* clone() const; + + virtual LabelBase* plunder() &&; + virtual bool operator<(const alib::ObjectBase& other) const; virtual bool operator>(const alib::ObjectBase& other) const; diff --git a/alib2data/src/primitive/Character.h b/alib2data/src/primitive/Character.h index 82d72d51fcd13b52476ae90f5775b9352b70d357..bfeae825b6cc4b58e29989df100dc448811d781f 100644 --- a/alib2data/src/primitive/Character.h +++ b/alib2data/src/primitive/Character.h @@ -21,17 +21,18 @@ namespace primitive { class Character : public std::acceptor<Character, VisitablePrimitiveBase, std::acceptor<Character, alib::VisitableObjectBase, PrimitiveBase> > { protected: char data; -public: - virtual PrimitiveBase* clone() const; - - virtual PrimitiveBase* plunder() &&; +public: /** * Creates new symbol with given name. * @param symbol name of the symbol */ explicit Character(char data); + virtual PrimitiveBase* clone() const; + + virtual PrimitiveBase* plunder() &&; + virtual bool operator<(const alib::ObjectBase& other) const; virtual bool operator>(const alib::ObjectBase& other) const; diff --git a/alib2data/src/primitive/Integer.h b/alib2data/src/primitive/Integer.h index c949a98e61d428de4800eaeb000c7891514e9bf3..0020f6942400c0058c2934f9a153091d554c079a 100644 --- a/alib2data/src/primitive/Integer.h +++ b/alib2data/src/primitive/Integer.h @@ -20,17 +20,18 @@ namespace primitive { class Integer : public std::acceptor<Integer, VisitablePrimitiveBase, std::acceptor<Integer, alib::VisitableObjectBase, PrimitiveBase> > { protected: int data; -public: - virtual PrimitiveBase* clone() const; - - virtual PrimitiveBase* plunder() &&; +public: /** * Creates new symbol with given name. * @param symbol name of the symbol */ explicit Integer(int data); + virtual PrimitiveBase* clone() const; + + virtual PrimitiveBase* plunder() &&; + virtual bool operator<(const alib::ObjectBase& other) const; virtual bool operator>(const alib::ObjectBase& other) const; diff --git a/alib2data/src/primitive/String.h b/alib2data/src/primitive/String.h index 499a23e8f7cc6f37a018dc12294e352f2de1f25f..297df0369c505bfbb1f917ee2c86924de9d6da68 100644 --- a/alib2data/src/primitive/String.h +++ b/alib2data/src/primitive/String.h @@ -21,11 +21,8 @@ namespace primitive { class String : public std::acceptor<String, VisitablePrimitiveBase, std::acceptor<String, alib::VisitableObjectBase, PrimitiveBase> > { protected: std::string data; -public: - virtual PrimitiveBase* clone() const; - - virtual PrimitiveBase* plunder() &&; +public: /** * Creates new symbol with given name. * @param symbol name of the symbol @@ -34,6 +31,10 @@ public: explicit String(std::string&& data); + virtual PrimitiveBase* clone() const; + + virtual PrimitiveBase* plunder() &&; + virtual bool operator<(const alib::ObjectBase& other) const; virtual bool operator>(const alib::ObjectBase& other) const; diff --git a/alib2data/src/regexp/formal/FormalRegExp.h b/alib2data/src/regexp/formal/FormalRegExp.h index e52d6c6ad289499f7c89a47341b837f307c6c2fa..c1df2695dbc7727a02301a8c6c205eb583f2540c 100644 --- a/alib2data/src/regexp/formal/FormalRegExp.h +++ b/alib2data/src/regexp/formal/FormalRegExp.h @@ -41,10 +41,10 @@ public: */ virtual RegExpBase* plunder() &&; - FormalRegExp(); + explicit FormalRegExp(); explicit FormalRegExp(const UnboundedRegExp& other); - FormalRegExp(const std::set<alphabet::Symbol>& alphabet, const FormalRegExpElement& regExp); - FormalRegExp(std::set<alphabet::Symbol>&& alphabet, FormalRegExpElement&& regExp); + explicit FormalRegExp(const std::set<alphabet::Symbol>& alphabet, const FormalRegExpElement& regExp); + explicit FormalRegExp(std::set<alphabet::Symbol>&& alphabet, FormalRegExpElement&& regExp); explicit FormalRegExp(const FormalRegExpElement& regExp); explicit FormalRegExp(FormalRegExpElement&& regExp); diff --git a/alib2data/src/regexp/formal/FormalRegExpElement.h b/alib2data/src/regexp/formal/FormalRegExpElement.h index d39e8adb2c6395ae22e25e47be53a066e3a60c8f..ac25ee31840c6a913e4823548b281feeccd8fd2f 100644 --- a/alib2data/src/regexp/formal/FormalRegExpElement.h +++ b/alib2data/src/regexp/formal/FormalRegExpElement.h @@ -60,7 +60,7 @@ protected: virtual void computeMinimalAlphabet( std::set<alphabet::Symbol>& alphabet ) const = 0; public: - FormalRegExpElement(); + explicit FormalRegExpElement(); /** * Creates copy of the element. diff --git a/alib2data/src/regexp/formal/FormalRegExpEmpty.h b/alib2data/src/regexp/formal/FormalRegExpEmpty.h index 036bdc40af223533696de967b25cdd86802e6827..e3417bb381e709221da982d46c1f331c9097b7de 100644 --- a/alib2data/src/regexp/formal/FormalRegExpEmpty.h +++ b/alib2data/src/regexp/formal/FormalRegExpEmpty.h @@ -38,7 +38,7 @@ protected: virtual void computeMinimalAlphabet( std::set<alphabet::Symbol>& alphabet ) const; public: - FormalRegExpEmpty(); + explicit FormalRegExpEmpty(); FormalRegExpEmpty(const FormalRegExpEmpty& other); FormalRegExpEmpty(FormalRegExpEmpty&& other) noexcept; FormalRegExpEmpty& operator =(const FormalRegExpEmpty& other); diff --git a/alib2data/src/regexp/formal/FormalRegExpEpsilon.h b/alib2data/src/regexp/formal/FormalRegExpEpsilon.h index 0b62f7b51875e3b51bde033c923274190f81549c..1666c23c501f031debc24ff4027c712c9bd9c61a 100644 --- a/alib2data/src/regexp/formal/FormalRegExpEpsilon.h +++ b/alib2data/src/regexp/formal/FormalRegExpEpsilon.h @@ -39,7 +39,7 @@ protected: public: - FormalRegExpEpsilon(); + explicit FormalRegExpEpsilon(); FormalRegExpEpsilon(const FormalRegExpEpsilon& other); FormalRegExpEpsilon(FormalRegExpEpsilon&& other) noexcept; FormalRegExpEpsilon& operator=(const FormalRegExpEpsilon& other); diff --git a/alib2data/src/regexp/unbounded/UnboundedRegExp.h b/alib2data/src/regexp/unbounded/UnboundedRegExp.h index 046a6a39f426e5edb7e5986f665a4c07395dd924..28964b5f73058ea08486eeae273a954f157bd558 100644 --- a/alib2data/src/regexp/unbounded/UnboundedRegExp.h +++ b/alib2data/src/regexp/unbounded/UnboundedRegExp.h @@ -41,10 +41,10 @@ public: */ virtual RegExpBase* plunder() &&; - UnboundedRegExp(); + explicit UnboundedRegExp(); explicit UnboundedRegExp(const FormalRegExp& other); - UnboundedRegExp(const std::set<alphabet::Symbol>& alphabet, const UnboundedRegExpElement& regExp); - UnboundedRegExp(std::set<alphabet::Symbol>&& alphabet, UnboundedRegExpElement&& regExp); + explicit UnboundedRegExp(const std::set<alphabet::Symbol>& alphabet, const UnboundedRegExpElement& regExp); + explicit UnboundedRegExp(std::set<alphabet::Symbol>&& alphabet, UnboundedRegExpElement&& regExp); explicit UnboundedRegExp(const UnboundedRegExpElement& regExp); explicit UnboundedRegExp(UnboundedRegExpElement&& regExp); diff --git a/alib2data/src/regexp/unbounded/UnboundedRegExpAlternation.h b/alib2data/src/regexp/unbounded/UnboundedRegExpAlternation.h index b8e0d32c2f7190aabe9f6e149da8fa735f87ac20..94d5ee5e47f1335487e14a418257c78f8c780a3d 100644 --- a/alib2data/src/regexp/unbounded/UnboundedRegExpAlternation.h +++ b/alib2data/src/regexp/unbounded/UnboundedRegExpAlternation.h @@ -44,7 +44,7 @@ protected: virtual void computeMinimalAlphabet( std::set<alphabet::Symbol>& alphabet ) const; public: - UnboundedRegExpAlternation(); + explicit UnboundedRegExpAlternation(); UnboundedRegExpAlternation(const UnboundedRegExpAlternation& other); UnboundedRegExpAlternation(UnboundedRegExpAlternation&& other) noexcept; diff --git a/alib2data/src/regexp/unbounded/UnboundedRegExpConcatenation.h b/alib2data/src/regexp/unbounded/UnboundedRegExpConcatenation.h index e23f776cd3a3d4e9fa8b47bc3e3d19c5dfdb8fef..7b47cb953347de851e608deb8943183195c8950a 100644 --- a/alib2data/src/regexp/unbounded/UnboundedRegExpConcatenation.h +++ b/alib2data/src/regexp/unbounded/UnboundedRegExpConcatenation.h @@ -45,7 +45,7 @@ protected: virtual void computeMinimalAlphabet( std::set<alphabet::Symbol>& alphabet ) const; public: - UnboundedRegExpConcatenation(); + explicit UnboundedRegExpConcatenation(); UnboundedRegExpConcatenation(const UnboundedRegExpConcatenation& other); UnboundedRegExpConcatenation(UnboundedRegExpConcatenation&& other) noexcept; diff --git a/alib2data/src/regexp/unbounded/UnboundedRegExpElement.h b/alib2data/src/regexp/unbounded/UnboundedRegExpElement.h index 6a2b715dfa7b3699eb3df565165f16ddb3aded8c..c0ce6c8f9f13d32f1a31f3de3d8f1bf68967c6bb 100644 --- a/alib2data/src/regexp/unbounded/UnboundedRegExpElement.h +++ b/alib2data/src/regexp/unbounded/UnboundedRegExpElement.h @@ -60,7 +60,7 @@ protected: virtual void computeMinimalAlphabet( std::set<alphabet::Symbol>& alphabet ) const = 0; public: - UnboundedRegExpElement(); + explicit UnboundedRegExpElement(); /** * Creates copy of the element. diff --git a/alib2data/src/regexp/unbounded/UnboundedRegExpEmpty.h b/alib2data/src/regexp/unbounded/UnboundedRegExpEmpty.h index a1f86bc84a8b14e39cd1ab52927c0eba2a341640..cdae30504c6f7d9736a3307b24e3c81f49d95ca6 100644 --- a/alib2data/src/regexp/unbounded/UnboundedRegExpEmpty.h +++ b/alib2data/src/regexp/unbounded/UnboundedRegExpEmpty.h @@ -38,7 +38,7 @@ protected: virtual void computeMinimalAlphabet( std::set<alphabet::Symbol>& alphabet ) const; public: - UnboundedRegExpEmpty(); + explicit UnboundedRegExpEmpty(); UnboundedRegExpEmpty(const UnboundedRegExpEmpty& other); UnboundedRegExpEmpty(UnboundedRegExpEmpty&& other) noexcept; UnboundedRegExpEmpty& operator =(const UnboundedRegExpEmpty& other); diff --git a/alib2data/src/regexp/unbounded/UnboundedRegExpEpsilon.h b/alib2data/src/regexp/unbounded/UnboundedRegExpEpsilon.h index d13242e3e027ab4dd25c70e4648312030c1fc8ee..50c45e81673e46c8fe83632133bd8dc64d5176d5 100644 --- a/alib2data/src/regexp/unbounded/UnboundedRegExpEpsilon.h +++ b/alib2data/src/regexp/unbounded/UnboundedRegExpEpsilon.h @@ -39,7 +39,7 @@ protected: public: - UnboundedRegExpEpsilon(); + explicit UnboundedRegExpEpsilon(); UnboundedRegExpEpsilon(const UnboundedRegExpEpsilon& other); UnboundedRegExpEpsilon(UnboundedRegExpEpsilon&& other) noexcept; UnboundedRegExpEpsilon& operator=(const UnboundedRegExpEpsilon& other); diff --git a/alib2data/src/string/CyclicString.h b/alib2data/src/string/CyclicString.h index f0571dc69555d276863a969d7aa83616fb05f397..8c641dc4dae89177a93f3e509f69c3afbee5b55d 100644 --- a/alib2data/src/string/CyclicString.h +++ b/alib2data/src/string/CyclicString.h @@ -26,7 +26,7 @@ namespace string { class CyclicString : public std::acceptor<CyclicString, VisitableStringBase, std::acceptor<CyclicString, alib::VisitableObjectBase, StringBase> >, public StringAlphabet { std::vector<alphabet::Symbol> m_Data; public: - CyclicString(); + explicit CyclicString(); explicit CyclicString(const std::set<alphabet::Symbol>& alphabet, const std::vector<alphabet::Symbol>& data); explicit CyclicString(std::set<alphabet::Symbol>&& alphabet, std::vector<alphabet::Symbol>&& data); explicit CyclicString(const std::vector<alphabet::Symbol>& data); diff --git a/alib2data/src/string/LinearString.h b/alib2data/src/string/LinearString.h index 2ed0ac78c768c9644292c107ea4b681927a6bdcc..82395fbf5b6415e6a9d6ecc97ca96f6382d61c83 100644 --- a/alib2data/src/string/LinearString.h +++ b/alib2data/src/string/LinearString.h @@ -27,7 +27,7 @@ class LinearString : public std::acceptor<LinearString, VisitableStringBase, std std::vector<alphabet::Symbol> m_Data; public: - LinearString(); + explicit LinearString(); explicit LinearString(const std::set<alphabet::Symbol>& alphabet, const std::vector<alphabet::Symbol>& data); explicit LinearString(std::set<alphabet::Symbol>&& alphabet, std::vector<alphabet::Symbol>&& data); explicit LinearString(const std::vector<alphabet::Symbol>& data);