From 062187dfe977eb780010a2b967e96e54522951aa Mon Sep 17 00:00:00 2001
From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz>
Date: Tue, 12 Aug 2014 20:33:34 +0200
Subject: [PATCH] templated symbol wrapper

---
 alib2data/src/alphabet/Symbol.cpp             | 81 +------------------
 alib2data/src/alphabet/Symbol.h               | 49 +++--------
 .../src/alphabet/SymbolToStringComposer.cpp   |  2 +-
 .../src/alphabet/SymbolToXMLComposer.cpp      |  2 +-
 alib2data/src/common/wrapper.hpp              | 16 ++++
 alib2data/src/grammar/ContextFree/CFG.cpp     | 10 +--
 alib2data/src/grammar/ContextFree/CNF.cpp     | 12 +--
 .../grammar/ContextFree/EpsilonFreeCFG.cpp    | 10 +--
 alib2data/src/grammar/ContextFree/GNF.cpp     | 10 +--
 alib2data/src/grammar/ContextFree/LG.cpp      | 20 ++---
 .../src/grammar/ContextSensitive/CSG.cpp      | 22 ++---
 .../NonContractingGrammar.cpp                 | 14 ++--
 alib2data/src/grammar/Regular/LeftLG.cpp      | 16 ++--
 alib2data/src/grammar/Regular/LeftRG.cpp      |  8 +-
 alib2data/src/grammar/Regular/RightLG.cpp     | 16 ++--
 alib2data/src/grammar/Regular/RightRG.cpp     |  8 +-
 alib2data/src/grammar/UnknownRule.cpp         |  4 +-
 .../ContextPreservingUnrestrictedGrammar.cpp  | 22 ++---
 .../Unrestricted/UnrestrictedGrammar.cpp      | 14 ++--
 ...rminalNonterminalAlphabetInitialSymbol.cpp |  6 +-
 20 files changed, 130 insertions(+), 212 deletions(-)

diff --git a/alib2data/src/alphabet/Symbol.cpp b/alib2data/src/alphabet/Symbol.cpp
index b6e64a111c..aa676f4988 100644
--- a/alib2data/src/alphabet/Symbol.cpp
+++ b/alib2data/src/alphabet/Symbol.cpp
@@ -13,85 +13,12 @@
 
 namespace alphabet {
 
-Symbol::Symbol(const SymbolBase& symbol) : symbol(symbol.clone()) {
-
-}
-
-Symbol::Symbol(SymbolBase&& symbol) : symbol(std::move(symbol).plunder()) {
-
-}
-
-Symbol::Symbol(const Symbol& other) : symbol(other.getSymbol().clone()) {
-
-}
-
-Symbol::Symbol(Symbol&& other) noexcept : symbol(other.symbol) {
-	other.symbol = NULL;
-}
-
-Symbol& Symbol::operator=(const Symbol& other) {
-	if(this == &other) return *this;
-
-	delete symbol;
-	symbol = other.getSymbol().clone();
-
-	return *this;
-}
-
-Symbol& Symbol::operator=(Symbol&& other) noexcept {
-	std::swap(this->symbol, other.symbol);
-	return *this;
-}
-
-Symbol::~Symbol() {
-	delete symbol;
-}
-
-const SymbolBase& Symbol::getSymbol() const {
-	return *symbol;
-}
-
-SymbolBase& Symbol::getSymbol() {
-	return *symbol;
-}
-
-void Symbol::setSymbol(const SymbolBase& symbol) {
-	delete this->symbol;
-	this->symbol = symbol.clone();
-}
-
-void Symbol::setSymbol(SymbolBase&& symbol) {
-	delete this->symbol;
-	this->symbol = std::move(symbol).plunder();
-}
-
-bool Symbol::operator<(const Symbol& other) const {
-	return *symbol < *other.symbol;
-}
-
-bool Symbol::operator!=(const Symbol& other) const {
-	return !(*this == other);
-}
-
-bool Symbol::operator==(const Symbol& other) const {
-	return *symbol == *other.symbol;
-}
-
-std::ostream& operator<<(std::ostream& os, const Symbol& symbol) {
-	os << symbol.getSymbol();
-	return os;
-}
-
-Symbol::operator std::string() const {
-	return (std::string) *symbol;
-}
-
-alphabet::Symbol Symbol::createUniqueSymbol(const alphabet::Symbol& base, const std::set<alphabet::Symbol>& terminalAlphabet, const std::set<alphabet::Symbol>& nonterminalAlphabet) {
+alphabet::Symbol createUniqueSymbol(const alphabet::Symbol& base, const std::set<alphabet::Symbol>& terminalAlphabet, const std::set<alphabet::Symbol>& nonterminalAlphabet) {
 	label::NextLabel nextLabelCreator;
 
-	const alphabet::LabeledSymbol* baseSymbol = dynamic_cast<const alphabet::LabeledSymbol*>(&(base.getSymbol()));
+	const alphabet::LabeledSymbol* baseSymbol = dynamic_cast<const alphabet::LabeledSymbol*>(&(base.getData()));
 	if(baseSymbol == NULL)
-		throw exception::AlibException("Could not create unique symbol with nonlabeled base symbol " + (std::string) base.getSymbol() + "." );
+		throw exception::AlibException("Could not create unique symbol with nonlabeled base symbol " + (std::string) base + "." );
 
 	label::Label nextLabel = baseSymbol->getLabel();
 
@@ -103,7 +30,7 @@ alphabet::Symbol Symbol::createUniqueSymbol(const alphabet::Symbol& base, const
 			return attempt;
 	} while(++i < INT_MAX);
 
-	throw exception::AlibException("Could not create unique symbol with base symbol " + (std::string) base.getSymbol() + "." );
+	throw exception::AlibException("Could not create unique symbol with base symbol " + (std::string) base + "." );
 }
 
 } /* namespace alphabet */
diff --git a/alib2data/src/alphabet/Symbol.h b/alib2data/src/alphabet/Symbol.h
index 3b9499efb5..e7f3fa355b 100644
--- a/alib2data/src/alphabet/Symbol.h
+++ b/alib2data/src/alphabet/Symbol.h
@@ -10,6 +10,8 @@
 
 #include "../std/visitor.hpp"
 #include "SymbolBase.h"
+#include "../common/wrapper.hpp"
+
 #include <set>
 
 namespace alphabet {
@@ -17,43 +19,16 @@ namespace alphabet {
 /**
  * Wrapper around automata.
  */
-class Symbol { //TODO toto udělat v std templatované
-protected:
-	SymbolBase* symbol;
-public:
-	explicit Symbol(const SymbolBase& symbol);
-	explicit Symbol(SymbolBase&& symbol);
-	Symbol(const Symbol& other);
-	Symbol(Symbol&&) noexcept;
-	Symbol& operator=(const Symbol& other);
-	Symbol& operator=(Symbol&& other) noexcept;
-	virtual ~Symbol() noexcept;
-
-	const SymbolBase& getSymbol() const;
-	SymbolBase& getSymbol();
-
-	void setSymbol(const SymbolBase& symbol);
-	void setSymbol(SymbolBase&& symbol);
-	
-	bool operator<(const Symbol& other) const;
-
-	bool operator!=(const Symbol& other) const;
-
-	bool operator==(const Symbol& other) const;
-
-	friend std::ostream& operator<<(std::ostream& os, const Symbol& symbol);
-
-	operator std::string () const;
-
-	/**
-	 * Creates and adds unique state to grammar. If given state name is
-	 * already used, appends apostrophe or integer suffix
-	 * @param name name of the state
-	 * @throws AutomatonException if symbol could not be created
-	 * @return created symbol
-	 */
-	static alphabet::Symbol createUniqueSymbol(const alphabet::Symbol& base, const std::set<alphabet::Symbol>& Terminals, const std::set<alphabet::Symbol>& nonterminals);
-};
+typedef alib::wrapper<SymbolBase> Symbol;
+
+/**
+ * Creates and adds unique state to grammar. If given state name is
+ * already used, appends apostrophe or integer suffix
+ * @param name name of the state
+ * @throws AutomatonException if symbol could not be created
+ * @return created symbol
+ */
+alphabet::Symbol createUniqueSymbol(const alphabet::Symbol& base, const std::set<alphabet::Symbol>& Terminals, const std::set<alphabet::Symbol>& nonterminals);
 
 } /* namespace alphabet */
 
diff --git a/alib2data/src/alphabet/SymbolToStringComposer.cpp b/alib2data/src/alphabet/SymbolToStringComposer.cpp
index 48ea246c22..610052de86 100644
--- a/alib2data/src/alphabet/SymbolToStringComposer.cpp
+++ b/alib2data/src/alphabet/SymbolToStringComposer.cpp
@@ -38,7 +38,7 @@ void SymbolToStringComposer::Visit(void* userData, const EndSymbol&) {
 }
 
 void SymbolToStringComposer::Visit(void* userData, const Symbol& symbol) {
-	symbol.getSymbol().Accept(userData, *this);
+	symbol.getData().Accept(userData, *this);
 
 }
 
diff --git a/alib2data/src/alphabet/SymbolToXMLComposer.cpp b/alib2data/src/alphabet/SymbolToXMLComposer.cpp
index 9db9866913..13b01b8734 100644
--- a/alib2data/src/alphabet/SymbolToXMLComposer.cpp
+++ b/alib2data/src/alphabet/SymbolToXMLComposer.cpp
@@ -41,7 +41,7 @@ void SymbolToXMLComposer::Visit(void* userData, const LabeledSymbol& symbol) con
 }
 
 void SymbolToXMLComposer::Visit(void* userData, const Symbol& symbol) const {
-	symbol.getSymbol().Accept(userData, *this);
+	symbol.getData().Accept(userData, *this);
 
 }
 
diff --git a/alib2data/src/common/wrapper.hpp b/alib2data/src/common/wrapper.hpp
index 3b674f9bb2..fb053875c0 100644
--- a/alib2data/src/common/wrapper.hpp
+++ b/alib2data/src/common/wrapper.hpp
@@ -70,10 +70,26 @@ public:
 		this->data = std::move(data).plunder();
 	}
 
+	bool operator>=(const wrapper& other) const {
+		return *(this->data) >= *(other.data);
+	}
+
+	bool operator<=(const wrapper& other) const {
+		return *(this->data) <= *(other.data);
+	}
+
+	bool operator>(const wrapper& other) const {
+		return *(this->data) > *(other.data);
+	}
+
 	bool operator<(const wrapper& other) const {
 		return *(this->data) < *(other.data);
 	}
 
+	bool operator!=(const wrapper& other) const {
+		return *(this->data) != *(other.data);
+	}
+
 	bool operator==(const wrapper& other) const {
 		return *(this->data) == *(other.data);
 	}
diff --git a/alib2data/src/grammar/ContextFree/CFG.cpp b/alib2data/src/grammar/ContextFree/CFG.cpp
index dc421d2144..2e391191f2 100644
--- a/alib2data/src/grammar/ContextFree/CFG.cpp
+++ b/alib2data/src/grammar/ContextFree/CFG.cpp
@@ -35,7 +35,7 @@ bool CFG::removeTerminalSymbol(const alphabet::Symbol& symbol) {
 	for(const std::pair<alphabet::Symbol, std::set<std::vector<alphabet::Symbol>>>& rule : rules) {
 		for(const std::vector<alphabet::Symbol>& rhs : rule.second)
 			if(std::find(rhs.begin(), rhs.end(), symbol) != rhs.end())
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 	}
 
 	return terminalAlphabet.erase(symbol);
@@ -44,15 +44,15 @@ bool CFG::removeTerminalSymbol(const alphabet::Symbol& symbol) {
 bool CFG::removeNonterminalSymbol(const alphabet::Symbol& symbol) {
 	for(const std::pair<alphabet::Symbol, std::set<std::vector<alphabet::Symbol>>>& rule : rules) {
 		if(rule.first == symbol)
-			throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+			throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 
 		for(const std::vector<alphabet::Symbol>& rhs : rule.second)
 			if(std::find(rhs.begin(), rhs.end(), symbol) != rhs.end())
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 	}
 
 	if(initialSymbol == symbol)
-		throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is initial symbol.");
+		throw GrammarException("Symbol \"" + (std::string) symbol + "\" is initial symbol.");
 
 
 	return nonterminalAlphabet.erase(symbol);
@@ -64,7 +64,7 @@ bool CFG::addRule(const alphabet::Symbol& leftHandSide, const std::vector<alphab
 
 	for(const alphabet::Symbol& symbol : rightHandSide)
 		if(terminalAlphabet.find(symbol) == terminalAlphabet.end() && nonterminalAlphabet.find(symbol) == nonterminalAlphabet.end())
-			throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is not neither terminal nor nonterminal symbol");
+			throw GrammarException("Symbol \"" + (std::string) symbol + "\" is not neither terminal nor nonterminal symbol");
 
 	return rules[leftHandSide].insert(rightHandSide).second;
 }
diff --git a/alib2data/src/grammar/ContextFree/CNF.cpp b/alib2data/src/grammar/ContextFree/CNF.cpp
index d6b39fff17..4abd662ffc 100644
--- a/alib2data/src/grammar/ContextFree/CNF.cpp
+++ b/alib2data/src/grammar/ContextFree/CNF.cpp
@@ -35,7 +35,7 @@ bool CNF::removeTerminalSymbol(const alphabet::Symbol& symbol) {
 	for(const std::pair<alphabet::Symbol, std::set<std::variant<alphabet::Symbol, std::pair<alphabet::Symbol, alphabet::Symbol>>>>& rule : rules) {
 		for(const std::variant<alphabet::Symbol, std::pair<alphabet::Symbol, alphabet::Symbol>>& rhs : rule.second) {
 			if((rhs.is<alphabet::Symbol>() && rhs.get<alphabet::Symbol>() == symbol) || (rhs.get<std::pair<alphabet::Symbol, alphabet::Symbol>>().first == symbol))
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 		}
 	}
 
@@ -45,15 +45,15 @@ bool CNF::removeTerminalSymbol(const alphabet::Symbol& symbol) {
 bool CNF::removeNonterminalSymbol(const alphabet::Symbol& symbol) {
 	for(const std::pair<alphabet::Symbol, std::set<std::variant<alphabet::Symbol, std::pair<alphabet::Symbol, alphabet::Symbol>>>>& rule : rules) {
 		if(rule.first == symbol)
-			throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+			throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 
 		for(const std::variant<alphabet::Symbol, std::pair<alphabet::Symbol, alphabet::Symbol>>& rhs : rule.second)
 			if(rhs.get<std::pair<alphabet::Symbol, alphabet::Symbol>>().second == symbol)
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 	}
 
 	if(initialSymbol == symbol)
-		throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is initial symbol.");
+		throw GrammarException("Symbol \"" + (std::string) symbol + "\" is initial symbol.");
 
 	return nonterminalAlphabet.erase(symbol);
 }
@@ -74,10 +74,10 @@ bool CNF::addRule(const alphabet::Symbol& leftHandSide, const std::variant<alpha
 			throw GrammarException("Rule must rewrite nonterminal symbol");
 
 		if(nonterminalAlphabet.find(rhs.first) == nonterminalAlphabet.end())
-			throw GrammarException("Symbol \"" + (std::string) rhs.first.getSymbol() + "\" is not a nonterminal symbol");
+			throw GrammarException("Symbol \"" + (std::string) rhs.first + "\" is not a nonterminal symbol");
 
 		if(nonterminalAlphabet.find(rhs.second) == nonterminalAlphabet.end())
-			throw GrammarException("Symbol \"" + (std::string) rhs.second.getSymbol() + "\" is not a nonterminal symbol");
+			throw GrammarException("Symbol \"" + (std::string) rhs.second + "\" is not a nonterminal symbol");
 
 		return rules[leftHandSide].insert(rightHandSide).second;
 	}
diff --git a/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.cpp b/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.cpp
index 3cd49c41e5..be29e4a054 100644
--- a/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.cpp
+++ b/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.cpp
@@ -35,7 +35,7 @@ bool EpsilonFreeCFG::removeTerminalSymbol(const alphabet::Symbol& symbol) {
 	for(const std::pair<alphabet::Symbol, std::set<std::vector<alphabet::Symbol>>>& rule : rules) {
 		for(const std::vector<alphabet::Symbol>& rhs : rule.second)
 			if(std::find(rhs.begin(), rhs.end(), symbol) != rhs.end())
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 	}
 
 	return terminalAlphabet.erase(symbol);
@@ -44,15 +44,15 @@ bool EpsilonFreeCFG::removeTerminalSymbol(const alphabet::Symbol& symbol) {
 bool EpsilonFreeCFG::removeNonterminalSymbol(const alphabet::Symbol& symbol) {
 	for(const std::pair<alphabet::Symbol, std::set<std::vector<alphabet::Symbol>>>& rule : rules) {
 		if(rule.first == symbol)
-			throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+			throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 
 		for(const std::vector<alphabet::Symbol>& rhs : rule.second)
 			if(std::find(rhs.begin(), rhs.end(), symbol) != rhs.end())
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 	}
 
 	if(initialSymbol == symbol)
-		throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is initial symbol.");
+		throw GrammarException("Symbol \"" + (std::string) symbol + "\" is initial symbol.");
 
 
 	return nonterminalAlphabet.erase(symbol);
@@ -69,7 +69,7 @@ bool EpsilonFreeCFG::addRule(const alphabet::Symbol& leftHandSide, const std::ve
 
 		for(const alphabet::Symbol& symbol : rightHandSide) {
 			if(terminalAlphabet.find(symbol) == terminalAlphabet.end() && nonterminalAlphabet.find(symbol) == nonterminalAlphabet.end())
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is not neither terminal nor nonterminal symbol");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is not neither terminal nor nonterminal symbol");
 		}
 
 		return rules[leftHandSide].insert(rightHandSide).second;
diff --git a/alib2data/src/grammar/ContextFree/GNF.cpp b/alib2data/src/grammar/ContextFree/GNF.cpp
index 6519eaa5fa..258f41162f 100644
--- a/alib2data/src/grammar/ContextFree/GNF.cpp
+++ b/alib2data/src/grammar/ContextFree/GNF.cpp
@@ -35,7 +35,7 @@ bool GNF::removeTerminalSymbol(const alphabet::Symbol& symbol) {
 	for(const std::pair<alphabet::Symbol, std::set<std::pair<alphabet::Symbol, std::vector<alphabet::Symbol> >> >& rule : rules) {
 		for(const std::pair<alphabet::Symbol, std::vector<alphabet::Symbol> >& rhs : rule.second)
 			if(rhs.first == symbol)
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 	}
 
 	return terminalAlphabet.erase(symbol);
@@ -44,15 +44,15 @@ bool GNF::removeTerminalSymbol(const alphabet::Symbol& symbol) {
 bool GNF::removeNonterminalSymbol(const alphabet::Symbol& symbol) {
 	for(const std::pair<alphabet::Symbol, std::set<std::pair<alphabet::Symbol, std::vector<alphabet::Symbol> >> >& rule : rules) {
 		if(rule.first == symbol)
-			throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+			throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 
 		for(const std::pair<alphabet::Symbol, std::vector<alphabet::Symbol> >& rhs : rule.second)
 			if(std::find(rhs.second.begin(), rhs.second.end(), symbol) != rhs.second.end())
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 	}
 
 	if(initialSymbol == symbol)
-		throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is initial symbol.");
+		throw GrammarException("Symbol \"" + (std::string) symbol + "\" is initial symbol.");
 
 
 	return nonterminalAlphabet.erase(symbol);
@@ -67,7 +67,7 @@ bool GNF::addRule(const alphabet::Symbol& leftHandSide, const std::pair<alphabet
 
 	for(const alphabet::Symbol& rhsNTs : rightHandSide.second)
 		if(nonterminalAlphabet.find(rhsNTs) == nonterminalAlphabet.end())
-			throw GrammarException("Symbol \"" + (std::string) rhsNTs.getSymbol() + "\" is not a nonterminal symbol");
+			throw GrammarException("Symbol \"" + (std::string) rhsNTs + "\" is not a nonterminal symbol");
 
 	return rules[leftHandSide].insert(rightHandSide).second;
 }
diff --git a/alib2data/src/grammar/ContextFree/LG.cpp b/alib2data/src/grammar/ContextFree/LG.cpp
index 6e75d796af..b6e1afa4c4 100644
--- a/alib2data/src/grammar/ContextFree/LG.cpp
+++ b/alib2data/src/grammar/ContextFree/LG.cpp
@@ -38,17 +38,17 @@ bool LG::removeTerminalSymbol(const alphabet::Symbol& symbol) {
 				const std::vector<alphabet::Symbol>& rhs = rhsTmp.get<std::vector<alphabet::Symbol>>();
 
 				if(std::find(rhs.begin(), rhs.end(), symbol) != rhs.end())
-					throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+					throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 			} else {
 				const std::tuple<std::vector<alphabet::Symbol>, alphabet::Symbol, std::vector<alphabet::Symbol>>& rhs = rhsTmp.get<std::tuple<std::vector<alphabet::Symbol>, alphabet::Symbol, std::vector<alphabet::Symbol>>>();
 
 				const std::vector<alphabet::Symbol>& lPart = std::get<0>(rhs);
 				if(std::find(lPart.begin(), lPart.end(), symbol) != lPart.end())
-					throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+					throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 				
 				const std::vector<alphabet::Symbol>& rPart = std::get<2>(rhs);
 				if(std::find(rPart.begin(), rPart.end(), symbol) != rPart.end())
-					throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+					throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 			}
 	}
 
@@ -58,19 +58,19 @@ bool LG::removeTerminalSymbol(const alphabet::Symbol& symbol) {
 bool LG::removeNonterminalSymbol(const alphabet::Symbol& symbol) {
 	for(const std::pair<alphabet::Symbol, std::set<std::variant<std::vector<alphabet::Symbol>, std::tuple<std::vector<alphabet::Symbol>, alphabet::Symbol, std::vector<alphabet::Symbol>> >> >& rule : rules) {
 		if(rule.first == symbol)
-			throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+			throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 
 		for(const std::variant<std::vector<alphabet::Symbol>, std::tuple<std::vector<alphabet::Symbol>, alphabet::Symbol, std::vector<alphabet::Symbol>> >& rhsTmp : rule.second)
 			if(rhsTmp.is<std::tuple<std::vector<alphabet::Symbol>, alphabet::Symbol, std::vector<alphabet::Symbol>>>()) {
 				const std::tuple<std::vector<alphabet::Symbol>, alphabet::Symbol, std::vector<alphabet::Symbol>>& rhs = rhsTmp.get<std::tuple<std::vector<alphabet::Symbol>, alphabet::Symbol, std::vector<alphabet::Symbol>>>();
 
 				if(std::get<1>(rhs) == symbol)
-					throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+					throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 			}
 	}
 
 	if(initialSymbol == symbol)
-		throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is initial symbol.");
+		throw GrammarException("Symbol \"" + (std::string) symbol + "\" is initial symbol.");
 
 
 	return nonterminalAlphabet.erase(symbol);
@@ -84,7 +84,7 @@ bool LG::addRule(const alphabet::Symbol& leftHandSide, const std::variant<std::v
 		const std::vector<alphabet::Symbol>& rhs = rightHandSide.get<std::vector<alphabet::Symbol>>();
 		for(const auto & symbol : rhs ) {
 			if(terminalAlphabet.find(symbol) == terminalAlphabet.end())
-				throw GrammarException("Symbol " + (std::string) symbol.getSymbol() + " is not a terminal symbol");
+				throw GrammarException("Symbol " + (std::string) symbol + " is not a terminal symbol");
 		}
 
 		return rules[leftHandSide].insert(rightHandSide).second;
@@ -93,14 +93,14 @@ bool LG::addRule(const alphabet::Symbol& leftHandSide, const std::variant<std::v
 
 		for(const auto & symbol : std::get<0>(rhs) )
 			if(terminalAlphabet.find(symbol) == terminalAlphabet.end())
-				throw GrammarException("Symbol " + (std::string) symbol.getSymbol() + " is not a terminal symbol");
+				throw GrammarException("Symbol " + (std::string) symbol + " is not a terminal symbol");
 
 		if(nonterminalAlphabet.find(std::get<1>(rhs)) == nonterminalAlphabet.end())
-			throw GrammarException("Symbol " + (std::string) std::get<1>(rhs).getSymbol() + " is not a nonterminal symbol");
+			throw GrammarException("Symbol " + (std::string) std::get<1>(rhs) + " is not a nonterminal symbol");
 
 		for(const auto & symbol : std::get<2>(rhs) ) {
 			if(terminalAlphabet.find(symbol) == terminalAlphabet.end())
-				throw GrammarException("Symbol " + (std::string) symbol.getSymbol() + " is not a terminal symbol");
+				throw GrammarException("Symbol " + (std::string) symbol + " is not a terminal symbol");
 		}
 
 		return rules[leftHandSide].insert(rightHandSide).second;
diff --git a/alib2data/src/grammar/ContextSensitive/CSG.cpp b/alib2data/src/grammar/ContextSensitive/CSG.cpp
index 5e9134aad2..196f3b4c53 100644
--- a/alib2data/src/grammar/ContextSensitive/CSG.cpp
+++ b/alib2data/src/grammar/ContextSensitive/CSG.cpp
@@ -36,15 +36,15 @@ bool CSG::removeTerminalSymbol(const alphabet::Symbol& symbol) {
 	for(const std::pair<std::tuple<std::vector<alphabet::Symbol>, alphabet::Symbol, std::vector<alphabet::Symbol>>, std::set<std::vector<alphabet::Symbol>>>& rule : rules) {
 		for(const alphabet::Symbol& lCont : std::get<0>(rule.first))
 			if(lCont == symbol)
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 
 		for(const alphabet::Symbol& rCont : std::get<2>(rule.first))
 			if(rCont == symbol)
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 
 		for(const std::vector<alphabet::Symbol>& rhs : rule.second)
 			if(std::find(rhs.begin(), rhs.end(), symbol) != rhs.end())
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 	}
 
 	return terminalAlphabet.erase(symbol);
@@ -54,22 +54,22 @@ bool CSG::removeNonterminalSymbol(const alphabet::Symbol& symbol) {
 	for(const std::pair<std::tuple<std::vector<alphabet::Symbol>, alphabet::Symbol, std::vector<alphabet::Symbol>>, std::set<std::vector<alphabet::Symbol>>>& rule : rules) {
 		for(const alphabet::Symbol& lCont : std::get<0>(rule.first))
 			if(lCont == symbol)
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 
 		if(std::get<1>(rule.first) == symbol)
-			throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+			throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 
 		for(const alphabet::Symbol& rCont : std::get<2>(rule.first))
 			if(rCont == symbol)
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 
 		for(const std::vector<alphabet::Symbol>& rhs : rule.second)
 			if(std::find(rhs.begin(), rhs.end(), symbol) != rhs.end())
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 	}
 
 	if(initialSymbol == symbol)
-		throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is initial symbol.");
+		throw GrammarException("Symbol \"" + (std::string) symbol + "\" is initial symbol.");
 
 
 	return nonterminalAlphabet.erase(symbol);
@@ -83,7 +83,7 @@ bool CSG::addRule(const std::vector<alphabet::Symbol>& lContext, const alphabet:
 	} else {
 		for(const alphabet::Symbol& symbol : lContext) {
 			if(terminalAlphabet.find(symbol) == terminalAlphabet.end() && nonterminalAlphabet.find(symbol) == nonterminalAlphabet.end())
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is not neither terminal nor nonterminal symbol");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is not neither terminal nor nonterminal symbol");
 		}
 
 		if(!nonterminalAlphabet.count(leftHandSide))
@@ -91,12 +91,12 @@ bool CSG::addRule(const std::vector<alphabet::Symbol>& lContext, const alphabet:
 
 		for(const alphabet::Symbol& symbol : rContext) {
 			if(terminalAlphabet.find(symbol) == terminalAlphabet.end() && nonterminalAlphabet.find(symbol) == nonterminalAlphabet.end())
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is not neither terminal nor nonterminal symbol");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is not neither terminal nor nonterminal symbol");
 		}
 
 		for(const alphabet::Symbol& symbol : rightHandSide) {
 			if(terminalAlphabet.find(symbol) == terminalAlphabet.end() && nonterminalAlphabet.find(symbol) == nonterminalAlphabet.end())
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is not neither terminal nor nonterminal symbol");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is not neither terminal nor nonterminal symbol");
 		}
 
 		return rules[make_tuple(lContext, leftHandSide, rContext)].insert(rightHandSide).second;
diff --git a/alib2data/src/grammar/ContextSensitive/NonContractingGrammar.cpp b/alib2data/src/grammar/ContextSensitive/NonContractingGrammar.cpp
index b2609ce18f..7b6262a911 100644
--- a/alib2data/src/grammar/ContextSensitive/NonContractingGrammar.cpp
+++ b/alib2data/src/grammar/ContextSensitive/NonContractingGrammar.cpp
@@ -35,11 +35,11 @@ GrammarBase* NonContractingGrammar::plunder() && {
 bool NonContractingGrammar::removeTerminalSymbol(const alphabet::Symbol& symbol) {
 	for(const std::pair<std::vector<alphabet::Symbol>, std::set<std::vector<alphabet::Symbol>>>& rule : rules) {
 		if(std::find(rule.first.begin(), rule.first.end(), symbol) != rule.first.end())
-			throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+			throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 
 		for(const std::vector<alphabet::Symbol>& rhs : rule.second)
 			if(std::find(rhs.begin(), rhs.end(), symbol) != rhs.end())
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 	}
 
 	return terminalAlphabet.erase(symbol);
@@ -48,15 +48,15 @@ bool NonContractingGrammar::removeTerminalSymbol(const alphabet::Symbol& symbol)
 bool NonContractingGrammar::removeNonterminalSymbol(const alphabet::Symbol& symbol) {
 	for(const std::pair<std::vector<alphabet::Symbol>, std::set<std::vector<alphabet::Symbol>>>& rule : rules) {
 		if(std::find(rule.first.begin(), rule.first.end(), symbol) != rule.first.end())
-			throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+			throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 
 		for(const std::vector<alphabet::Symbol>& rhs : rule.second)
 			if(std::find(rhs.begin(), rhs.end(), symbol) != rhs.end())
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 	}
 
 	if(initialSymbol == symbol)
-		throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is initial symbol.");
+		throw GrammarException("Symbol \"" + (std::string) symbol + "\" is initial symbol.");
 
 
 	return nonterminalAlphabet.erase(symbol);
@@ -74,11 +74,11 @@ bool NonContractingGrammar::addRule(const std::vector<alphabet::Symbol>& leftHan
 
 	for(const alphabet::Symbol& symbol : leftHandSide)
 		if(terminalAlphabet.find(symbol) == terminalAlphabet.end() && nonterminalAlphabet.find(symbol) == nonterminalAlphabet.end())
-			throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is not neither terminal nor nonterminal symbol");
+			throw GrammarException("Symbol \"" + (std::string) symbol + "\" is not neither terminal nor nonterminal symbol");
 
 	for(const alphabet::Symbol& symbol : rightHandSide) {
 		if(terminalAlphabet.find(symbol) == terminalAlphabet.end() && nonterminalAlphabet.find(symbol) == nonterminalAlphabet.end())
-			throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is not neither terminal nor nonterminal symbol");
+			throw GrammarException("Symbol \"" + (std::string) symbol + "\" is not neither terminal nor nonterminal symbol");
 	}
 
 	return rules[leftHandSide].insert(rightHandSide).second;
diff --git a/alib2data/src/grammar/Regular/LeftLG.cpp b/alib2data/src/grammar/Regular/LeftLG.cpp
index 50c84ce8e7..45aef55602 100644
--- a/alib2data/src/grammar/Regular/LeftLG.cpp
+++ b/alib2data/src/grammar/Regular/LeftLG.cpp
@@ -39,12 +39,12 @@ bool LeftLG::removeTerminalSymbol(const alphabet::Symbol& symbol) {
 				const std::vector<alphabet::Symbol>& rhs = rhsTmp.get<std::vector<alphabet::Symbol>>();
 
 				if(std::find(rhs.begin(), rhs.end(), symbol) != rhs.end())
-					throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+					throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 			} else {
 				const std::pair<alphabet::Symbol, std::vector<alphabet::Symbol>>& rhs = rhsTmp.get<std::pair<alphabet::Symbol, std::vector<alphabet::Symbol>>>();
 
 				if(std::find(rhs.second.begin(), rhs.second.end(), symbol) != rhs.second.end())
-					throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+					throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 			}
 	}
 
@@ -54,19 +54,19 @@ bool LeftLG::removeTerminalSymbol(const alphabet::Symbol& symbol) {
 bool LeftLG::removeNonterminalSymbol(const alphabet::Symbol& symbol) {
 	for(const std::pair<alphabet::Symbol, std::set<std::variant<std::vector<alphabet::Symbol>, std::pair<alphabet::Symbol, std::vector<alphabet::Symbol>> >> >& rule : rules) {
 		if(rule.first == symbol)
-			throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+			throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 
 		for(const std::variant<std::vector<alphabet::Symbol>, std::pair<alphabet::Symbol, std::vector<alphabet::Symbol>> >& rhsTmp : rule.second)
 			if(rhsTmp.is<std::pair<alphabet::Symbol, std::vector<alphabet::Symbol>>>()) {
 				const std::pair<alphabet::Symbol, std::vector<alphabet::Symbol>>& rhs = rhsTmp.get<std::pair<alphabet::Symbol, std::vector<alphabet::Symbol>>>();
 
 				if(rhs.first == symbol)
-					throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+					throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 			}
 	}
 
 	if(initialSymbol == symbol)
-		throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is initial symbol.");
+		throw GrammarException("Symbol \"" + (std::string) symbol + "\" is initial symbol.");
 
 
 	return nonterminalAlphabet.erase(symbol);
@@ -80,7 +80,7 @@ bool LeftLG::addRule(const alphabet::Symbol& leftHandSide, const std::variant<st
 		const std::vector<alphabet::Symbol>& rhs = rightHandSide.get<std::vector<alphabet::Symbol>>();
 		for(const auto & symbol : rhs ) {
 			if(terminalAlphabet.find(symbol) == terminalAlphabet.end())
-				throw GrammarException("Symbol " + (std::string) symbol.getSymbol() + " is not a terminal symbol");
+				throw GrammarException("Symbol " + (std::string) symbol + " is not a terminal symbol");
 		}
 
 		return rules[leftHandSide].insert(rightHandSide).second;
@@ -88,11 +88,11 @@ bool LeftLG::addRule(const alphabet::Symbol& leftHandSide, const std::variant<st
 		const std::pair<alphabet::Symbol, std::vector<alphabet::Symbol>>& rhs = rightHandSide.get<std::pair<alphabet::Symbol, std::vector<alphabet::Symbol>>>();
 
 		if(nonterminalAlphabet.find(rhs.first) == nonterminalAlphabet.end())
-			throw GrammarException("Symbol " + (std::string) rhs.first.getSymbol() + " is not a nonterminal symbol");
+			throw GrammarException("Symbol " + (std::string) rhs.first + " is not a nonterminal symbol");
 
 		for(const auto & symbol : rhs.second ) {
 			if(terminalAlphabet.find(symbol) == terminalAlphabet.end())
-				throw GrammarException("Symbol " + (std::string) symbol.getSymbol() + " is not a terminal symbol");
+				throw GrammarException("Symbol " + (std::string) symbol + " is not a terminal symbol");
 		}
 
 		return rules[leftHandSide].insert(rightHandSide).second;
diff --git a/alib2data/src/grammar/Regular/LeftRG.cpp b/alib2data/src/grammar/Regular/LeftRG.cpp
index 4b919635ef..b337d4e7d7 100644
--- a/alib2data/src/grammar/Regular/LeftRG.cpp
+++ b/alib2data/src/grammar/Regular/LeftRG.cpp
@@ -36,7 +36,7 @@ bool LeftRG::removeTerminalSymbol(const alphabet::Symbol& symbol) {
 	for(const std::pair<alphabet::Symbol, std::set<std::variant<alphabet::Symbol, std::pair<alphabet::Symbol, alphabet::Symbol>>>>& rule : rules) {
 		for(const std::variant<alphabet::Symbol, std::pair<alphabet::Symbol, alphabet::Symbol>>& rhs : rule.second) {
 			if((rhs.is<alphabet::Symbol>() && rhs.get<alphabet::Symbol>() == symbol) || (rhs.get<std::pair<alphabet::Symbol, alphabet::Symbol>>().first == symbol))
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 		}
 	}
 
@@ -46,15 +46,15 @@ bool LeftRG::removeTerminalSymbol(const alphabet::Symbol& symbol) {
 bool LeftRG::removeNonterminalSymbol(const alphabet::Symbol& symbol) {
 	for(const std::pair<alphabet::Symbol, std::set<std::variant<alphabet::Symbol, std::pair<alphabet::Symbol, alphabet::Symbol>>>>& rule : rules) {
 		if(rule.first == symbol)
-			throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+			throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 
 		for(const std::variant<alphabet::Symbol, std::pair<alphabet::Symbol, alphabet::Symbol>>& rhs : rule.second)
 			if(rhs.get<std::pair<alphabet::Symbol, alphabet::Symbol>>().second == symbol)
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 	}
 
 	if(initialSymbol == symbol)
-		throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is initial symbol.");
+		throw GrammarException("Symbol \"" + (std::string) symbol + "\" is initial symbol.");
 
 	return nonterminalAlphabet.erase(symbol);
 }
diff --git a/alib2data/src/grammar/Regular/RightLG.cpp b/alib2data/src/grammar/Regular/RightLG.cpp
index 53fdb3466a..f347252e0b 100644
--- a/alib2data/src/grammar/Regular/RightLG.cpp
+++ b/alib2data/src/grammar/Regular/RightLG.cpp
@@ -39,12 +39,12 @@ bool RightLG::removeTerminalSymbol(const alphabet::Symbol& symbol) {
 				const std::vector<alphabet::Symbol>& rhs = rhsTmp.get<std::vector<alphabet::Symbol>>();
 
 				if(std::find(rhs.begin(), rhs.end(), symbol) != rhs.end())
-					throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+					throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 			} else {
 				const std::pair<std::vector<alphabet::Symbol>, alphabet::Symbol>& rhs = rhsTmp.get<std::pair<std::vector<alphabet::Symbol>, alphabet::Symbol>>();
 
 				if(std::find(rhs.first.begin(), rhs.first.end(), symbol) != rhs.first.end())
-					throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+					throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 			}
 	}
 
@@ -54,19 +54,19 @@ bool RightLG::removeTerminalSymbol(const alphabet::Symbol& symbol) {
 bool RightLG::removeNonterminalSymbol(const alphabet::Symbol& symbol) {
 	for(const std::pair<alphabet::Symbol, std::set<std::variant<std::vector<alphabet::Symbol>, std::pair<std::vector<alphabet::Symbol>, alphabet::Symbol> >> >& rule : rules) {
 		if(rule.first == symbol)
-			throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+			throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 
 		for(const std::variant<std::vector<alphabet::Symbol>, std::pair<std::vector<alphabet::Symbol>, alphabet::Symbol> >& rhsTmp : rule.second)
 			if(rhsTmp.is<std::pair<std::vector<alphabet::Symbol>, alphabet::Symbol>>()) {
 				const std::pair<std::vector<alphabet::Symbol>, alphabet::Symbol>& rhs = rhsTmp.get<std::pair<std::vector<alphabet::Symbol>, alphabet::Symbol>>();
 
 				if(rhs.second == symbol)
-					throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+					throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 			}
 	}
 
 	if(initialSymbol == symbol)
-		throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is initial symbol.");
+		throw GrammarException("Symbol \"" + (std::string) symbol + "\" is initial symbol.");
 
 
 	return nonterminalAlphabet.erase(symbol);
@@ -80,7 +80,7 @@ bool RightLG::addRule(const alphabet::Symbol& leftHandSide, const std::variant<s
 		const std::vector<alphabet::Symbol>& rhs = rightHandSide.get<std::vector<alphabet::Symbol>>();
 		for(const auto & symbol : rhs ) {
 			if(terminalAlphabet.find(symbol) == terminalAlphabet.end())
-				throw GrammarException("Symbol " + (std::string) symbol.getSymbol() + " is not a terminal symbol");
+				throw GrammarException("Symbol " + (std::string) symbol + " is not a terminal symbol");
 		}
 
 		return rules[leftHandSide].insert(rightHandSide).second;
@@ -88,11 +88,11 @@ bool RightLG::addRule(const alphabet::Symbol& leftHandSide, const std::variant<s
 		const std::pair<std::vector<alphabet::Symbol>, alphabet::Symbol>& rhs = rightHandSide.get<std::pair<std::vector<alphabet::Symbol>, alphabet::Symbol>>();
 
 		if(nonterminalAlphabet.find(rhs.second) == nonterminalAlphabet.end())
-			throw GrammarException("Symbol " + (std::string) rhs.second.getSymbol() + " is not a nonterminal symbol");
+			throw GrammarException("Symbol " + (std::string) rhs.second + " is not a nonterminal symbol");
 
 		for(const auto & symbol : rhs.first ) {
 			if(terminalAlphabet.find(symbol) == terminalAlphabet.end())
-				throw GrammarException("Symbol " + (std::string) symbol.getSymbol() + " is not a terminal symbol");
+				throw GrammarException("Symbol " + (std::string) symbol + " is not a terminal symbol");
 		}
 
 		return rules[leftHandSide].insert(rightHandSide).second;
diff --git a/alib2data/src/grammar/Regular/RightRG.cpp b/alib2data/src/grammar/Regular/RightRG.cpp
index 2a203c073d..a21b1aa265 100644
--- a/alib2data/src/grammar/Regular/RightRG.cpp
+++ b/alib2data/src/grammar/Regular/RightRG.cpp
@@ -36,7 +36,7 @@ bool RightRG::removeTerminalSymbol(const alphabet::Symbol& symbol) {
 	for(const std::pair<alphabet::Symbol, std::set<std::variant<alphabet::Symbol, std::pair<alphabet::Symbol, alphabet::Symbol>>>>& rule : rules) {
 		for(const std::variant<alphabet::Symbol, std::pair<alphabet::Symbol, alphabet::Symbol>>& rhs : rule.second) {
 			if((rhs.is<alphabet::Symbol>() && rhs.get<alphabet::Symbol>() == symbol) || (rhs.get<std::pair<alphabet::Symbol, alphabet::Symbol>>().first == symbol))
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 		}
 	}
 
@@ -46,15 +46,15 @@ bool RightRG::removeTerminalSymbol(const alphabet::Symbol& symbol) {
 bool RightRG::removeNonterminalSymbol(const alphabet::Symbol& symbol) {
 	for(const std::pair<alphabet::Symbol, std::set<std::variant<alphabet::Symbol, std::pair<alphabet::Symbol, alphabet::Symbol>>>>& rule : rules) {
 		if(rule.first == symbol)
-			throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+			throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 
 		for(const std::variant<alphabet::Symbol, std::pair<alphabet::Symbol, alphabet::Symbol>>& rhs : rule.second)
 			if(rhs.get<std::pair<alphabet::Symbol, alphabet::Symbol>>().second == symbol)
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 	}
 
 	if(initialSymbol == symbol)
-		throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is initial symbol.");
+		throw GrammarException("Symbol \"" + (std::string) symbol + "\" is initial symbol.");
 
 	return nonterminalAlphabet.erase(symbol);
 }
diff --git a/alib2data/src/grammar/UnknownRule.cpp b/alib2data/src/grammar/UnknownRule.cpp
index 37c1e6fabe..07884ca6d8 100644
--- a/alib2data/src/grammar/UnknownRule.cpp
+++ b/alib2data/src/grammar/UnknownRule.cpp
@@ -38,11 +38,11 @@ std::string UnknownRule::toString() const {
 	std::string output;
 	output += "[";
 	for(auto const& symbol : leftSide) {
-		output += " " + (std::string) symbol.getSymbol();
+		output += " " + (std::string) symbol;
 	}
 	output += " -> ";
 	for(auto const& symbol : rightSide) {
-		output += " " + (std::string) symbol.getSymbol();
+		output += " " + (std::string) symbol;
 	}
 
 	output += "]";
diff --git a/alib2data/src/grammar/Unrestricted/ContextPreservingUnrestrictedGrammar.cpp b/alib2data/src/grammar/Unrestricted/ContextPreservingUnrestrictedGrammar.cpp
index 1bd96b3a99..667f24fae0 100644
--- a/alib2data/src/grammar/Unrestricted/ContextPreservingUnrestrictedGrammar.cpp
+++ b/alib2data/src/grammar/Unrestricted/ContextPreservingUnrestrictedGrammar.cpp
@@ -36,15 +36,15 @@ bool ContextPreservingUnrestrictedGrammar::removeTerminalSymbol(const alphabet::
 	for(const std::pair<std::tuple<std::vector<alphabet::Symbol>, alphabet::Symbol, std::vector<alphabet::Symbol>>, std::set<std::vector<alphabet::Symbol>>>& rule : rules) {
 		for(const alphabet::Symbol& lCont : std::get<0>(rule.first))
 			if(lCont == symbol)
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 
 		for(const alphabet::Symbol& rCont : std::get<2>(rule.first))
 			if(rCont == symbol)
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 
 		for(const std::vector<alphabet::Symbol>& rhs : rule.second)
 			if(std::find(rhs.begin(), rhs.end(), symbol) != rhs.end())
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 	}
 
 	return terminalAlphabet.erase(symbol);
@@ -54,22 +54,22 @@ bool ContextPreservingUnrestrictedGrammar::removeNonterminalSymbol(const alphabe
 	for(const std::pair<std::tuple<std::vector<alphabet::Symbol>, alphabet::Symbol, std::vector<alphabet::Symbol>>, std::set<std::vector<alphabet::Symbol>>>& rule : rules) {
 		for(const alphabet::Symbol& lCont : std::get<0>(rule.first))
 			if(lCont == symbol)
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 
 		if(std::get<1>(rule.first) == symbol)
-			throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+			throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 
 		for(const alphabet::Symbol& rCont : std::get<2>(rule.first))
 			if(rCont == symbol)
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 
 		for(const std::vector<alphabet::Symbol>& rhs : rule.second)
 			if(std::find(rhs.begin(), rhs.end(), symbol) != rhs.end())
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 	}
 
 	if(initialSymbol == symbol)
-		throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is initial symbol.");
+		throw GrammarException("Symbol \"" + (std::string) symbol + "\" is initial symbol.");
 
 
 	return nonterminalAlphabet.erase(symbol);
@@ -78,7 +78,7 @@ bool ContextPreservingUnrestrictedGrammar::removeNonterminalSymbol(const alphabe
 bool ContextPreservingUnrestrictedGrammar::addRule(const std::vector<alphabet::Symbol>& lContext, const alphabet::Symbol& leftHandSide, const std::vector<alphabet::Symbol>& rContext, const std::vector<alphabet::Symbol>& rightHandSide) {
 	for(const alphabet::Symbol& symbol : lContext) {
 		if(terminalAlphabet.find(symbol) == terminalAlphabet.end() && nonterminalAlphabet.find(symbol) == nonterminalAlphabet.end())
-			throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is not neither terminal nor nonterminal symbol");
+			throw GrammarException("Symbol \"" + (std::string) symbol + "\" is not neither terminal nor nonterminal symbol");
 	}
 
 	if(!nonterminalAlphabet.count(leftHandSide))
@@ -86,12 +86,12 @@ bool ContextPreservingUnrestrictedGrammar::addRule(const std::vector<alphabet::S
 
 	for(const alphabet::Symbol& symbol : rContext) {
 		if(terminalAlphabet.find(symbol) == terminalAlphabet.end() && nonterminalAlphabet.find(symbol) == nonterminalAlphabet.end())
-			throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is not neither terminal nor nonterminal symbol");
+			throw GrammarException("Symbol \"" + (std::string) symbol + "\" is not neither terminal nor nonterminal symbol");
 	}
 
 	for(const alphabet::Symbol& symbol : rightHandSide) {
 		if(terminalAlphabet.find(symbol) == terminalAlphabet.end() && nonterminalAlphabet.find(symbol) == nonterminalAlphabet.end())
-			throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is not neither terminal nor nonterminal symbol");
+			throw GrammarException("Symbol \"" + (std::string) symbol + "\" is not neither terminal nor nonterminal symbol");
 	}
 
 	return rules[make_tuple(lContext, leftHandSide, rContext)].insert(rightHandSide).second;
diff --git a/alib2data/src/grammar/Unrestricted/UnrestrictedGrammar.cpp b/alib2data/src/grammar/Unrestricted/UnrestrictedGrammar.cpp
index 90786844b0..fda7e4982c 100644
--- a/alib2data/src/grammar/Unrestricted/UnrestrictedGrammar.cpp
+++ b/alib2data/src/grammar/Unrestricted/UnrestrictedGrammar.cpp
@@ -35,11 +35,11 @@ GrammarBase* UnrestrictedGrammar::plunder() && {
 bool UnrestrictedGrammar::removeTerminalSymbol(const alphabet::Symbol& symbol) {
 	for(const std::pair<std::vector<alphabet::Symbol>, std::set<std::vector<alphabet::Symbol>>>& rule : rules) {
 		if(std::find(rule.first.begin(), rule.first.end(), symbol) != rule.first.end())
-			throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+			throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 
 		for(const std::vector<alphabet::Symbol>& rhs : rule.second)
 			if(std::find(rhs.begin(), rhs.end(), symbol) != rhs.end())
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 	}
 
 	return terminalAlphabet.erase(symbol);
@@ -48,15 +48,15 @@ bool UnrestrictedGrammar::removeTerminalSymbol(const alphabet::Symbol& symbol) {
 bool UnrestrictedGrammar::removeNonterminalSymbol(const alphabet::Symbol& symbol) {
 	for(const std::pair<std::vector<alphabet::Symbol>, std::set<std::vector<alphabet::Symbol>>>& rule : rules) {
 		if(std::find(rule.first.begin(), rule.first.end(), symbol) != rule.first.end())
-			throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+			throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 
 		for(const std::vector<alphabet::Symbol>& rhs : rule.second)
 			if(std::find(rhs.begin(), rhs.end(), symbol) != rhs.end())
-				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
+				throw GrammarException("Symbol \"" + (std::string) symbol + "\" is used in rule.");
 	}
 
 	if(initialSymbol == symbol)
-		throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is initial symbol.");
+		throw GrammarException("Symbol \"" + (std::string) symbol + "\" is initial symbol.");
 
 
 	return nonterminalAlphabet.erase(symbol);
@@ -69,11 +69,11 @@ bool UnrestrictedGrammar::addRule(const std::vector<alphabet::Symbol>& leftHandS
 
 	for(const alphabet::Symbol& symbol : leftHandSide)
 		if(terminalAlphabet.find(symbol) == terminalAlphabet.end() && nonterminalAlphabet.find(symbol) == nonterminalAlphabet.end())
-			throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is not neither terminal nor nonterminal symbol");
+			throw GrammarException("Symbol \"" + (std::string) symbol + "\" is not neither terminal nor nonterminal symbol");
 
 	for(const alphabet::Symbol& symbol : rightHandSide)
 		if(terminalAlphabet.find(symbol) == terminalAlphabet.end() && nonterminalAlphabet.find(symbol) == nonterminalAlphabet.end())
-			throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is not neither terminal nor nonterminal symbol");
+			throw GrammarException("Symbol \"" + (std::string) symbol + "\" is not neither terminal nor nonterminal symbol");
 
 	return rules[leftHandSide].insert(rightHandSide).second;
 }
diff --git a/alib2data/src/grammar/common/TerminalNonterminalAlphabetInitialSymbol.cpp b/alib2data/src/grammar/common/TerminalNonterminalAlphabetInitialSymbol.cpp
index 5bb1f15fda..03295dc7d9 100644
--- a/alib2data/src/grammar/common/TerminalNonterminalAlphabetInitialSymbol.cpp
+++ b/alib2data/src/grammar/common/TerminalNonterminalAlphabetInitialSymbol.cpp
@@ -22,7 +22,7 @@ TerminalNonterminalAlphabetInitialSymbol::TerminalNonterminalAlphabetInitialSymb
 
 bool TerminalNonterminalAlphabetInitialSymbol::addTerminalSymbol(const alphabet::Symbol& symbol) {
 	if(nonterminalAlphabet.find(symbol) != nonterminalAlphabet.end()){
-		throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is nonterminal symbol.");
+		throw GrammarException("Symbol \"" + (std::string) symbol + "\" is nonterminal symbol.");
 	}
 
 	return terminalAlphabet.insert(symbol).second;
@@ -50,7 +50,7 @@ void TerminalNonterminalAlphabetInitialSymbol::setTerminalAlphabet(const std::se
 
 bool TerminalNonterminalAlphabetInitialSymbol::addNonterminalSymbol(const alphabet::Symbol& symbol) {
 	if(terminalAlphabet.find(symbol) != terminalAlphabet.end()){
-		throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is terminal symbol.");
+		throw GrammarException("Symbol \"" + (std::string) symbol + "\" is terminal symbol.");
 	}
 
 	return nonterminalAlphabet.insert(symbol).second;
@@ -82,7 +82,7 @@ const alphabet::Symbol& TerminalNonterminalAlphabetInitialSymbol::getInitialSymb
 
 void TerminalNonterminalAlphabetInitialSymbol::setInitialSymbol(const alphabet::Symbol& symbol) {
 	if(nonterminalAlphabet.find(symbol) == nonterminalAlphabet.end()) {
-		throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" isn't nonterminal symbol.");
+		throw GrammarException("Symbol \"" + (std::string) symbol + "\" isn't nonterminal symbol.");
 	}
 
 	initialSymbol = symbol;
-- 
GitLab