diff --git a/alib2/src/alphabet/BlankSymbol.cpp b/alib2/src/alphabet/BlankSymbol.cpp index c669f71ca99ec097ad2fafe8e8d60373234632ad..2f4f17821ec8f432e4a3e88ab35ea5996237fa84 100644 --- a/alib2/src/alphabet/BlankSymbol.cpp +++ b/alib2/src/alphabet/BlankSymbol.cpp @@ -9,7 +9,7 @@ namespace alphabet { -BlankSymbol::BlankSymbol() : SymbolBase() { +BlankSymbol::BlankSymbol() { } diff --git a/alib2/src/alphabet/BlankSymbol.h b/alib2/src/alphabet/BlankSymbol.h index 671e7a887d723d274dcc686194f3e4fef3db3e88..25bfcb4a3426683348fae384140d7535de097256 100644 --- a/alib2/src/alphabet/BlankSymbol.h +++ b/alib2/src/alphabet/BlankSymbol.h @@ -15,7 +15,7 @@ namespace alphabet { /** * Represents blank symbol in an alphabet. */ -class BlankSymbol : virtual public SymbolBase, public std::element<BlankSymbol, SymbolBase> { +class BlankSymbol : public std::element<BlankSymbol, SymbolBase> { public: /** * Creates a blank symbol. diff --git a/alib2/src/alphabet/LabeledSymbol.h b/alib2/src/alphabet/LabeledSymbol.h index 4e8b236ccb1d24a9e8c886b7b905eafcf4933db8..2bc0ffc66149425a82f6a968a0c0a6dfc2207c1a 100644 --- a/alib2/src/alphabet/LabeledSymbol.h +++ b/alib2/src/alphabet/LabeledSymbol.h @@ -17,7 +17,7 @@ namespace alphabet { /** * Represents symbol in an alphabet. */ -class LabeledSymbol : virtual public SymbolBase, public std::element<LabeledSymbol, SymbolBase> { +class LabeledSymbol : public std::element<LabeledSymbol, SymbolBase> { protected: label::Label label; diff --git a/alib2/src/alphabet/SymbolBase.h b/alib2/src/alphabet/SymbolBase.h index 717d2e80f626a109312bc07f736ade51594d882c..8b61aa1e2a13e5a5a79e7d7d89c8a0dd8e7d6f01 100644 --- a/alib2/src/alphabet/SymbolBase.h +++ b/alib2/src/alphabet/SymbolBase.h @@ -19,7 +19,7 @@ class BlankSymbol; /** * Represents symbol in an alphabet. */ -class SymbolBase : virtual public std::elementBase<LabeledSymbol, BlankSymbol> { +class SymbolBase : public std::elementBase<LabeledSymbol, BlankSymbol> { public: virtual ~SymbolBase() noexcept; diff --git a/alib2/src/automaton/AutomatonBase.h b/alib2/src/automaton/AutomatonBase.h index bc669805ea060e066e02b2cfa80f3d90b7b012c7..cc2b51e4b7a077309ce0b4ed5076fc0b17ead2f0 100644 --- a/alib2/src/automaton/AutomatonBase.h +++ b/alib2/src/automaton/AutomatonBase.h @@ -25,7 +25,7 @@ class OneTapeDTM; /** * Abstract base class for all automata. */ -class AutomatonBase : virtual public std::elementBase<UnknownAutomaton, DFA, NFA, EpsilonNFA, CompactNFA, ExtendedNFA, PDA, OneTapeDTM> { +class AutomatonBase : public std::elementBase<UnknownAutomaton, DFA, NFA, EpsilonNFA, CompactNFA, ExtendedNFA, PDA, OneTapeDTM> { public: virtual AutomatonBase* clone() const = 0; diff --git a/alib2/src/automaton/FSM/CompactNFA.h b/alib2/src/automaton/FSM/CompactNFA.h index 9c257058818a0ffc74c1a1f8323c31792942c370..3ec1959049fca8c6aac2057c9c5889fcdfe89671 100644 --- a/alib2/src/automaton/FSM/CompactNFA.h +++ b/alib2/src/automaton/FSM/CompactNFA.h @@ -20,7 +20,7 @@ namespace automaton { * Represents Finite Automaton. * Can store nondeterministic finite automaton without epsilon transitions. */ -class CompactNFA : virtual public AutomatonBase, public std::element<CompactNFA, AutomatonBase>, public MultiInitialStates, public InputAlphabet { +class CompactNFA : public std::element<CompactNFA, AutomatonBase>, public MultiInitialStates, public InputAlphabet { protected: std::map<std::pair<State, string::String>, std::set<State> > transitions; public: diff --git a/alib2/src/automaton/FSM/DFA.h b/alib2/src/automaton/FSM/DFA.h index 03a2a203da2deddf750f477c2561494ae04993f3..ec5a9795394e4d7feffd37b9b348cfcad04edaba 100644 --- a/alib2/src/automaton/FSM/DFA.h +++ b/alib2/src/automaton/FSM/DFA.h @@ -20,7 +20,7 @@ namespace automaton { * Represents Finite Automaton. * Can store nondeterministic finite automaton without epsilon transitions. */ -class DFA : virtual public AutomatonBase, public std::element<DFA, AutomatonBase>, public SingleInitialState, public InputAlphabet { +class DFA : public std::element<DFA, AutomatonBase>, public SingleInitialState, public InputAlphabet { protected: std::map<std::pair<State, alphabet::Symbol>, State> transitions; public: diff --git a/alib2/src/automaton/FSM/EpsilonNFA.h b/alib2/src/automaton/FSM/EpsilonNFA.h index 61fa4c44fc7df0dc725c4517dfc1aa0db04a8fe3..f21d59a52cb300003d7621f8b0435dd14184329b 100644 --- a/alib2/src/automaton/FSM/EpsilonNFA.h +++ b/alib2/src/automaton/FSM/EpsilonNFA.h @@ -22,7 +22,7 @@ namespace automaton { * Represents Finite Automaton. * Can store nondeterministic finite automaton with epsilon transitions. */ -class EpsilonNFA : virtual public AutomatonBase, public std::element<EpsilonNFA, AutomatonBase>, public MultiInitialStates, public InputAlphabet { +class EpsilonNFA : public std::element<EpsilonNFA, AutomatonBase>, public MultiInitialStates, public InputAlphabet { protected: std::map<std::pair<State, std::variant<string::Epsilon, alphabet::Symbol> >, std::set<State> > transitions; public: diff --git a/alib2/src/automaton/FSM/ExtendedNFA.h b/alib2/src/automaton/FSM/ExtendedNFA.h index b3715bd4f858cfd903f68efcb66687d55cc17284..d0847d82e24b03567cebbdcdb54d45d76875c3df 100644 --- a/alib2/src/automaton/FSM/ExtendedNFA.h +++ b/alib2/src/automaton/FSM/ExtendedNFA.h @@ -20,7 +20,7 @@ namespace automaton { * Represents Finite Automaton. * Can store nondeterministic finite automaton without epsilon transitions. */ -class ExtendedNFA : virtual public AutomatonBase, public std::element<ExtendedNFA, AutomatonBase>, public MultiInitialStates, public InputAlphabet { +class ExtendedNFA : public std::element<ExtendedNFA, AutomatonBase>, public MultiInitialStates, public InputAlphabet { protected: std::map<std::pair<State, regexp::RegExp>, std::set<State> > transitions; public: diff --git a/alib2/src/automaton/FSM/NFA.h b/alib2/src/automaton/FSM/NFA.h index 6ac9bca3afc4c0a97e181b63775eaf0c788bf126..e3efb77104e7883db6f3758224dd18e511be5086 100644 --- a/alib2/src/automaton/FSM/NFA.h +++ b/alib2/src/automaton/FSM/NFA.h @@ -21,7 +21,7 @@ namespace automaton { * Represents Finite Automaton. * Can store nondeterministic finite automaton without epsilon transitions. */ -class NFA : virtual public AutomatonBase, public std::element<NFA, AutomatonBase>, public MultiInitialStates, public InputAlphabet { +class NFA : public std::element<NFA, AutomatonBase>, public MultiInitialStates, public InputAlphabet { protected: std::map<std::pair<State, alphabet::Symbol>, std::set<State> > transitions; public: diff --git a/alib2/src/automaton/PDA/PDA.h b/alib2/src/automaton/PDA/PDA.h index 125097599decf844a25be9c26ced46f9575033e1..ca03be482dd35d02b7d5901fe5be6785bf46e00b 100644 --- a/alib2/src/automaton/PDA/PDA.h +++ b/alib2/src/automaton/PDA/PDA.h @@ -23,7 +23,7 @@ namespace automaton { /** * Push Down Automaton */ -class PDA: virtual public AutomatonBase, public std::element<PDA, AutomatonBase>, public MultiInitialStates, public InputAlphabet { +class PDA: public std::element<PDA, AutomatonBase>, public MultiInitialStates, public InputAlphabet { protected: std::set<alphabet::Symbol> stackAlphabet; std::map<std::tuple<State, std::variant<string::Epsilon, alphabet::Symbol>, std::vector<alphabet::Symbol> >, std::set<std::pair<State, std::vector<alphabet::Symbol> > > > transitions; diff --git a/alib2/src/automaton/TM/OneTapeDTM.h b/alib2/src/automaton/TM/OneTapeDTM.h index ae9b995a0aa7ec92c48ba0b49aadfae27e7ac3f8..805ad654883a536f1cb6efc4a417c8016865145b 100644 --- a/alib2/src/automaton/TM/OneTapeDTM.h +++ b/alib2/src/automaton/TM/OneTapeDTM.h @@ -22,7 +22,7 @@ namespace automaton { /** * One tape turing machine */ -class OneTapeDTM : virtual public AutomatonBase, public std::element<OneTapeDTM, AutomatonBase>, public SingleInitialState, public BlankSymbolInputTapeAlphabet { +class OneTapeDTM : public std::element<OneTapeDTM, AutomatonBase>, public SingleInitialState, public BlankSymbolInputTapeAlphabet { protected: std::map<std::pair<State, alphabet::Symbol>, std::tuple<State, alphabet::Symbol, Shift> > transitions; diff --git a/alib2/src/automaton/UnknownAutomaton.h b/alib2/src/automaton/UnknownAutomaton.h index 63ddcc95bc5a91efccb937280cf3b9a58cdc7919..6b7f65fa312460435534d9ccb3cf566cf8e3454e 100644 --- a/alib2/src/automaton/UnknownAutomaton.h +++ b/alib2/src/automaton/UnknownAutomaton.h @@ -21,7 +21,7 @@ namespace automaton { /** * Class representing unknown automaton parsed from XML. */ -class UnknownAutomaton : virtual public AutomatonBase, public std::element<UnknownAutomaton, AutomatonBase> { +class UnknownAutomaton : public std::element<UnknownAutomaton, AutomatonBase> { protected: std::set<State> states; std::set<State> initialStates; diff --git a/alib2/src/label/IntegerLabel.h b/alib2/src/label/IntegerLabel.h index e18da16d5c40154479cfda6f221ac3e3ffbcd755..59794b6b38e0aa38b62461d2a6cd67660f9f61a9 100644 --- a/alib2/src/label/IntegerLabel.h +++ b/alib2/src/label/IntegerLabel.h @@ -17,7 +17,7 @@ namespace label { /** * Represents symbol in an alphabet. */ -class IntegerLabel : virtual public LabelBase, public std::element<IntegerLabel, LabelBase>{ +class IntegerLabel : public std::element<IntegerLabel, LabelBase> { protected: int label; public: diff --git a/alib2/src/label/StringLabel.h b/alib2/src/label/StringLabel.h index 925a79781fda3928c71f4e69e104c1f4f7353579..e4824063f3e7be647cd72e758ac4c55f43ab1593 100644 --- a/alib2/src/label/StringLabel.h +++ b/alib2/src/label/StringLabel.h @@ -18,7 +18,7 @@ namespace label { /** * Represents symbol in an alphabet. */ -class StringLabel : virtual public LabelBase, public std::element<StringLabel, LabelBase>{ +class StringLabel : public std::element<StringLabel, LabelBase> { protected: std::string label; public: diff --git a/alib2/src/regexp/Alternation.h b/alib2/src/regexp/Alternation.h index 26fb5df53860cac7d3c8c54b64a382c11b9fc968..7a8dfcea7b6d81c327d20bd2a120e15a71b8122a 100644 --- a/alib2/src/regexp/Alternation.h +++ b/alib2/src/regexp/Alternation.h @@ -17,7 +17,7 @@ namespace regexp { * Represents alternation operator in the regular expression. Contains list of RegExpElement * as operands of the operator. */ -class Alternation: virtual public RegExpElement, public std::element<Alternation, RegExpElement> { +class Alternation: public std::element<Alternation, RegExpElement> { protected: /** * @copydoc RegExpElement::clone() const diff --git a/alib2/src/regexp/Concatenation.h b/alib2/src/regexp/Concatenation.h index 7aad061167a961c7f0134355842b9f25cdbf474e..fd78e94269ca9f583b792b4de77c19f7b42a849c 100644 --- a/alib2/src/regexp/Concatenation.h +++ b/alib2/src/regexp/Concatenation.h @@ -17,7 +17,7 @@ namespace regexp { * Represents concatenation operator in the regular expression. Contains list of RegExpElement * as operands of the operator. */ -class Concatenation: virtual public RegExpElement, public std::element<Concatenation, RegExpElement> { +class Concatenation: public std::element<Concatenation, RegExpElement> { protected: /** * @copydoc RegExpElement::clone() const diff --git a/alib2/src/regexp/Iteration.h b/alib2/src/regexp/Iteration.h index fb3ef21d3f14e68a80018bef5b7be32535873820..68f59a740b52569f2d44d806fbec020ad9356dc3 100644 --- a/alib2/src/regexp/Iteration.h +++ b/alib2/src/regexp/Iteration.h @@ -17,7 +17,7 @@ namespace regexp { * Represents iteration operator in the regular expression. Contains one RegExpElement * as operand. */ -class Iteration: virtual public RegExpElement, public std::element<Iteration, RegExpElement> { +class Iteration: public std::element<Iteration, RegExpElement> { protected: RegExpElement* element; diff --git a/alib2/src/regexp/RegExpElement.h b/alib2/src/regexp/RegExpElement.h index 7aca59838f6a28e5272773dc5e4a714fbf53cc93..12981564a4005b30e8dabcefbbc5ff3ff65eea5c 100644 --- a/alib2/src/regexp/RegExpElement.h +++ b/alib2/src/regexp/RegExpElement.h @@ -27,7 +27,7 @@ class RegExpEpsilon; /** * Abstract class representing element in the regular expression. Can be operator or symbol. */ -class RegExpElement : virtual public std::elementBase<Alternation, Concatenation, Iteration, RegExpSymbol, RegExpEmpty, RegExpEpsilon> { +class RegExpElement : public std::elementBase<Alternation, Concatenation, Iteration, RegExpSymbol, RegExpEmpty, RegExpEpsilon> { protected: /* * Parent regexp contanining this instance of RegExpElement diff --git a/alib2/src/regexp/RegExpEmpty.h b/alib2/src/regexp/RegExpEmpty.h index bd5466f445f832c92470ce967ca826772ff97d47..c87739ecc1dc7bc57f3fd98120f4f0317dda7578 100644 --- a/alib2/src/regexp/RegExpEmpty.h +++ b/alib2/src/regexp/RegExpEmpty.h @@ -15,7 +15,7 @@ namespace regexp { /** * Represents empty regular expression in the regular expression. */ -class RegExpEmpty: virtual public RegExpElement, public std::element<RegExpEmpty, RegExpElement> { +class RegExpEmpty: public std::element<RegExpEmpty, RegExpElement> { protected: /** * @copydoc RegExpElement::clone() const diff --git a/alib2/src/regexp/RegExpEpsilon.h b/alib2/src/regexp/RegExpEpsilon.h index bb4b7406a30c49a1bf8fec920576c4e1fdb3c33f..96ed05db09457d49696523701cec06c89e0485e6 100644 --- a/alib2/src/regexp/RegExpEpsilon.h +++ b/alib2/src/regexp/RegExpEpsilon.h @@ -15,7 +15,7 @@ namespace regexp { /** * Represents epsilon in the regular expression. */ -class RegExpEpsilon: virtual public RegExpElement, public std::element<RegExpEpsilon, RegExpElement> { +class RegExpEpsilon: public std::element<RegExpEpsilon, RegExpElement> { protected: /** * @copydoc RegExpElement::clone() const diff --git a/alib2/src/regexp/RegExpSymbol.h b/alib2/src/regexp/RegExpSymbol.h index b4c9e00d1fe5108339fd1bf2dae439f080b6fc2a..2939172ee507b3201a4b95d76a41a7c570b928be 100644 --- a/alib2/src/regexp/RegExpSymbol.h +++ b/alib2/src/regexp/RegExpSymbol.h @@ -17,7 +17,7 @@ namespace regexp { /** * Represents symbol in the regular expression. Contains name of the symbol. */ -class RegExpSymbol : virtual public RegExpElement, public std::element<RegExpSymbol, RegExpElement> { +class RegExpSymbol : public std::element<RegExpSymbol, RegExpElement> { protected: alphabet::Symbol symbol; diff --git a/alib2/src/std/visitor.hpp b/alib2/src/std/visitor.hpp index ded39b2bdc052c4216aa71fcee5d11450be5d88a..91305333375cde62ba3002956e7a9ee12d58e51d 100644 --- a/alib2/src/std/visitor.hpp +++ b/alib2/src/std/visitor.hpp @@ -65,7 +65,7 @@ public: }; template<typename Derived, typename Base> -class element : virtual public Base { +class element : public Base { public: virtual void Accept(void* userData, typename Base::visitor_type& visitor) const { visitor.Visit(userData, static_cast<const Derived&>(*this)); diff --git a/alib2/src/string/CyclicString.h b/alib2/src/string/CyclicString.h index 2444eaa70e5b3acad22785214594a2f573725cf4..048efd95b1ac8f04b980f4437acd0023847bf06a 100644 --- a/alib2/src/string/CyclicString.h +++ b/alib2/src/string/CyclicString.h @@ -22,7 +22,7 @@ namespace string { * Represents regular expression parsed from the XML. Regular expression is stored * as a tree of CyclicStringElement. */ -class CyclicString : virtual public StringBase, public std::element<CyclicString, StringBase> { +class CyclicString : public std::element<CyclicString, StringBase> { protected: std::vector<alphabet::Symbol> m_Data; diff --git a/alib2/src/string/Epsilon.h b/alib2/src/string/Epsilon.h index 2d42d13dbb6f5faf4db7b3078b0f3b2d45d69f0a..ed0f5bde12abdcf8efa9fb93e80ec85536624593 100644 --- a/alib2/src/string/Epsilon.h +++ b/alib2/src/string/Epsilon.h @@ -22,7 +22,7 @@ namespace string { * Represents epsilon. Regular expression is stored * as a tree of EpsilonElement. */ -class Epsilon : virtual public StringBase, public std::element<Epsilon, StringBase> { +class Epsilon : public std::element<Epsilon, StringBase> { protected: virtual bool testSymbol( const alphabet::Symbol & symbol ) const; diff --git a/alib2/src/string/LinearString.h b/alib2/src/string/LinearString.h index 4fb4b0ffdce78cf9da8a0fd2ceedcbd90ac96f7e..9af1abe97188e99baa3cc3a1b7ded2bd46c0c4f8 100644 --- a/alib2/src/string/LinearString.h +++ b/alib2/src/string/LinearString.h @@ -22,7 +22,7 @@ namespace string { * Represents regular expression parsed from the XML. Regular expression is stored * as a tree of LinearStringElement. */ -class LinearString : virtual public StringBase, public std::element<LinearString, StringBase> { +class LinearString : public std::element<LinearString, StringBase> { protected: std::vector<alphabet::Symbol> m_Data; diff --git a/alib2/src/string/StringBase.h b/alib2/src/string/StringBase.h index 45885a3891034601fed1a4772067be872208704c..46850570c2c6bb192786e79bef0280266b976c51 100644 --- a/alib2/src/string/StringBase.h +++ b/alib2/src/string/StringBase.h @@ -25,7 +25,7 @@ class Epsilon; /** * Represents string in an alphabet. */ -class StringBase : virtual public std::elementBase<Epsilon, LinearString, CyclicString> { +class StringBase : public std::elementBase<Epsilon, LinearString, CyclicString> { protected: const String* parentString;