From 51e668bf61e52cf8771efb3dc885b03d59041987 Mon Sep 17 00:00:00 2001
From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz>
Date: Tue, 2 Oct 2018 09:51:58 +0200
Subject: [PATCH] remove Grammar wrapper

---
 alib2data/src/grammar/Grammar.h                           | 8 +-------
 alib2data/src/grammar/xml/ContextFree/CFG.cpp             | 3 +--
 alib2data/src/grammar/xml/ContextFree/CNF.cpp             | 3 +--
 alib2data/src/grammar/xml/ContextFree/EpsilonFreeCFG.cpp  | 5 ++---
 alib2data/src/grammar/xml/ContextFree/GNF.cpp             | 3 +--
 alib2data/src/grammar/xml/ContextFree/LG.cpp              | 3 +--
 alib2data/src/grammar/xml/ContextSensitive/CSG.cpp        | 3 +--
 .../xml/ContextSensitive/NonContractingGrammar.cpp        | 3 +--
 alib2data/src/grammar/xml/Regular/LeftLG.cpp              | 3 +--
 alib2data/src/grammar/xml/Regular/LeftRG.cpp              | 3 +--
 alib2data/src/grammar/xml/Regular/RightLG.cpp             | 3 +--
 alib2data/src/grammar/xml/Regular/RightRG.cpp             | 3 +--
 .../Unrestricted/ContextPreservingUnrestrictedGrammar.cpp | 3 +--
 .../src/grammar/xml/Unrestricted/UnrestrictedGrammar.cpp  | 3 +--
 14 files changed, 15 insertions(+), 34 deletions(-)

diff --git a/alib2data/src/grammar/Grammar.h b/alib2data/src/grammar/Grammar.h
index df680b48f2..5bc5e0a601 100644
--- a/alib2data/src/grammar/Grammar.h
+++ b/alib2data/src/grammar/Grammar.h
@@ -8,9 +8,6 @@
 #ifndef GRAMMAR_H_
 #define GRAMMAR_H_
 
-#include <base/WrapperBase.hpp>
-#include "GrammarBase.h"
-
 #include <alib/type_traits>
 
 namespace grammar {
@@ -18,10 +15,7 @@ namespace grammar {
 /**
  * Wrapper around grammars.
  */
-class Grammar : public base::WrapperBase < GrammarBase > {
-	using base::WrapperBase < GrammarBase >::WrapperBase;
-
-};
+class Grammar;
 
 template < class T >
 using TerminalSymbolTypeOfGrammar = typename std::decay < decltype (std::declval<T>().getTerminalAlphabet()) >::type::value_type;
diff --git a/alib2data/src/grammar/xml/ContextFree/CFG.cpp b/alib2data/src/grammar/xml/ContextFree/CFG.cpp
index da44b4a175..4a45a2c4f7 100644
--- a/alib2data/src/grammar/xml/ContextFree/CFG.cpp
+++ b/alib2data/src/grammar/xml/ContextFree/CFG.cpp
@@ -16,7 +16,6 @@ namespace {
 static auto xmlWrite = registration::XmlWriterRegister < grammar::CFG < > > ( );
 static auto xmlRead = registration::XmlReaderRegister < grammar::CFG < > > ( );
 
-static auto xmlGroup1 = registration::XmlRegisterTypeInGroup < grammar::Grammar, grammar::CFG < > > ( );
-static auto xmlGroup2 = registration::XmlRegisterTypeInGroup < object::Object, grammar::CFG < > > ( );
+static auto xmlGroup = registration::XmlRegisterTypeInGroup < object::Object, grammar::CFG < > > ( );
 
 } /* namespace */
diff --git a/alib2data/src/grammar/xml/ContextFree/CNF.cpp b/alib2data/src/grammar/xml/ContextFree/CNF.cpp
index a6ca54e89d..fbeeaa90e5 100644
--- a/alib2data/src/grammar/xml/ContextFree/CNF.cpp
+++ b/alib2data/src/grammar/xml/ContextFree/CNF.cpp
@@ -16,7 +16,6 @@ namespace {
 static auto xmlWrite = registration::XmlWriterRegister < grammar::CNF < > > ( );
 static auto xmlRead = registration::XmlReaderRegister < grammar::CNF < > > ( );
 
-static auto xmlGroup1 = registration::XmlRegisterTypeInGroup < grammar::Grammar, grammar::CNF < > > ( );
-static auto xmlGroup2 = registration::XmlRegisterTypeInGroup < object::Object, grammar::CNF < > > ( );
+static auto xmlGroup = registration::XmlRegisterTypeInGroup < object::Object, grammar::CNF < > > ( );
 
 } /* namespace */
diff --git a/alib2data/src/grammar/xml/ContextFree/EpsilonFreeCFG.cpp b/alib2data/src/grammar/xml/ContextFree/EpsilonFreeCFG.cpp
index 7ace9f5751..bc472e3ede 100644
--- a/alib2data/src/grammar/xml/ContextFree/EpsilonFreeCFG.cpp
+++ b/alib2data/src/grammar/xml/ContextFree/EpsilonFreeCFG.cpp
@@ -14,9 +14,8 @@
 namespace {
 
 static auto xmlWrite = registration::XmlWriterRegister < grammar::EpsilonFreeCFG < > > ( );
-static auto xmlGroup = registration::XmlReaderRegister < grammar::EpsilonFreeCFG < > > ( );
+static auto xmlRead = registration::XmlReaderRegister < grammar::EpsilonFreeCFG < > > ( );
 
-static auto xmlGroup1 = registration::XmlRegisterTypeInGroup < grammar::Grammar, grammar::EpsilonFreeCFG < > > ( );
-static auto xmlGroup2 = registration::XmlRegisterTypeInGroup < object::Object, grammar::EpsilonFreeCFG < > > ( );
+static auto xmlGroup = registration::XmlRegisterTypeInGroup < object::Object, grammar::EpsilonFreeCFG < > > ( );
 
 } /* namespace */
diff --git a/alib2data/src/grammar/xml/ContextFree/GNF.cpp b/alib2data/src/grammar/xml/ContextFree/GNF.cpp
index 590b4e0253..884bc8094c 100644
--- a/alib2data/src/grammar/xml/ContextFree/GNF.cpp
+++ b/alib2data/src/grammar/xml/ContextFree/GNF.cpp
@@ -16,7 +16,6 @@ namespace {
 static auto xmlWrite = registration::XmlWriterRegister < grammar::GNF < > > ( );
 static auto xmlRead = registration::XmlReaderRegister < grammar::GNF < > > ( );
 
-static auto xmlGroup1 = registration::XmlRegisterTypeInGroup < grammar::Grammar, grammar::GNF < > > ( );
-static auto xmlGroup2 = registration::XmlRegisterTypeInGroup < object::Object, grammar::GNF < > > ( );
+static auto xmlGroup = registration::XmlRegisterTypeInGroup < object::Object, grammar::GNF < > > ( );
 
 } /* namespace */
diff --git a/alib2data/src/grammar/xml/ContextFree/LG.cpp b/alib2data/src/grammar/xml/ContextFree/LG.cpp
index 350dc2af23..4c4dfbe4a4 100644
--- a/alib2data/src/grammar/xml/ContextFree/LG.cpp
+++ b/alib2data/src/grammar/xml/ContextFree/LG.cpp
@@ -16,7 +16,6 @@ namespace {
 static auto xmlWrite = registration::XmlWriterRegister < grammar::LG < > > ( );
 static auto xmlRead = registration::XmlReaderRegister < grammar::LG < > > ( );
 
-static auto xmlGroup1 = registration::XmlRegisterTypeInGroup < grammar::Grammar, grammar::LG < > > ( );
-static auto xmlGroup2 = registration::XmlRegisterTypeInGroup < object::Object, grammar::LG < > > ( );
+static auto xmlGroup = registration::XmlRegisterTypeInGroup < object::Object, grammar::LG < > > ( );
 
 } /* namespace */
diff --git a/alib2data/src/grammar/xml/ContextSensitive/CSG.cpp b/alib2data/src/grammar/xml/ContextSensitive/CSG.cpp
index acdceade10..ea1b330cab 100644
--- a/alib2data/src/grammar/xml/ContextSensitive/CSG.cpp
+++ b/alib2data/src/grammar/xml/ContextSensitive/CSG.cpp
@@ -16,7 +16,6 @@ namespace {
 static auto xmlWrite = registration::XmlWriterRegister < grammar::CSG < > > ( );
 static auto xmlRead = registration::XmlReaderRegister < grammar::CSG < > > ( );
 
-static auto xmlGroup1 = registration::XmlRegisterTypeInGroup < grammar::Grammar, grammar::CSG < > > ( );
-static auto xmlGroup2 = registration::XmlRegisterTypeInGroup < object::Object, grammar::CSG < > > ( );
+static auto xmlGroup = registration::XmlRegisterTypeInGroup < object::Object, grammar::CSG < > > ( );
 
 } /* namespace */
diff --git a/alib2data/src/grammar/xml/ContextSensitive/NonContractingGrammar.cpp b/alib2data/src/grammar/xml/ContextSensitive/NonContractingGrammar.cpp
index c826c3895a..ddbf0f8d27 100644
--- a/alib2data/src/grammar/xml/ContextSensitive/NonContractingGrammar.cpp
+++ b/alib2data/src/grammar/xml/ContextSensitive/NonContractingGrammar.cpp
@@ -16,7 +16,6 @@ namespace {
 static auto xmlWrite = registration::XmlWriterRegister < grammar::NonContractingGrammar < > > ( );
 static auto xmlRead = registration::XmlReaderRegister < grammar::NonContractingGrammar < > > ( );
 
-static auto xmlGroup1 = registration::XmlRegisterTypeInGroup < grammar::Grammar, grammar::NonContractingGrammar < > > ( );
-static auto xmlGroup2 = registration::XmlRegisterTypeInGroup < object::Object, grammar::NonContractingGrammar < > > ( );
+static auto xmlGroup = registration::XmlRegisterTypeInGroup < object::Object, grammar::NonContractingGrammar < > > ( );
 
 } /* namespace */
diff --git a/alib2data/src/grammar/xml/Regular/LeftLG.cpp b/alib2data/src/grammar/xml/Regular/LeftLG.cpp
index d57216e170..1fa066646c 100644
--- a/alib2data/src/grammar/xml/Regular/LeftLG.cpp
+++ b/alib2data/src/grammar/xml/Regular/LeftLG.cpp
@@ -16,7 +16,6 @@ namespace {
 static auto xmlWrite = registration::XmlWriterRegister < grammar::LeftLG < > > ( );
 static auto xmlRead = registration::XmlReaderRegister < grammar::LeftLG < > > ( );
 
-static auto xmlGroup1 = registration::XmlRegisterTypeInGroup < grammar::Grammar, grammar::LeftLG < > > ( );
-static auto xmlGroup2 = registration::XmlRegisterTypeInGroup < object::Object, grammar::LeftLG < > > ( );
+static auto xmlGroup = registration::XmlRegisterTypeInGroup < object::Object, grammar::LeftLG < > > ( );
 
 } /* namespace */
diff --git a/alib2data/src/grammar/xml/Regular/LeftRG.cpp b/alib2data/src/grammar/xml/Regular/LeftRG.cpp
index 33071082fb..b34f182323 100644
--- a/alib2data/src/grammar/xml/Regular/LeftRG.cpp
+++ b/alib2data/src/grammar/xml/Regular/LeftRG.cpp
@@ -16,7 +16,6 @@ namespace {
 static auto xmlWrite = registration::XmlWriterRegister < grammar::LeftRG < > > ( );
 static auto xmlRead = registration::XmlReaderRegister < grammar::LeftRG < > > ( );
 
-static auto xmlGroup1 = registration::XmlRegisterTypeInGroup < grammar::Grammar, grammar::LeftRG < > > ( );
-static auto xmlGroup2 = registration::XmlRegisterTypeInGroup < object::Object, grammar::LeftRG < > > ( );
+static auto xmlGroup = registration::XmlRegisterTypeInGroup < object::Object, grammar::LeftRG < > > ( );
 
 } /* namespace */
diff --git a/alib2data/src/grammar/xml/Regular/RightLG.cpp b/alib2data/src/grammar/xml/Regular/RightLG.cpp
index 8ef938812c..fbad2cc2b7 100644
--- a/alib2data/src/grammar/xml/Regular/RightLG.cpp
+++ b/alib2data/src/grammar/xml/Regular/RightLG.cpp
@@ -16,7 +16,6 @@ namespace {
 static auto xmlWrite = registration::XmlWriterRegister < grammar::RightLG < > > ( );
 static auto xmlRead = registration::XmlReaderRegister < grammar::RightLG < > > ( );
 
-static auto xmlGroup1 = registration::XmlRegisterTypeInGroup < grammar::Grammar, grammar::RightLG < > > ( );
-static auto xmlGroup2 = registration::XmlRegisterTypeInGroup < object::Object, grammar::RightLG < > > ( );
+static auto xmlGroup = registration::XmlRegisterTypeInGroup < object::Object, grammar::RightLG < > > ( );
 
 } /* namespace */
diff --git a/alib2data/src/grammar/xml/Regular/RightRG.cpp b/alib2data/src/grammar/xml/Regular/RightRG.cpp
index bda30df914..fc0715b86e 100644
--- a/alib2data/src/grammar/xml/Regular/RightRG.cpp
+++ b/alib2data/src/grammar/xml/Regular/RightRG.cpp
@@ -16,7 +16,6 @@ namespace {
 static auto xmlWrite = registration::XmlWriterRegister < grammar::RightRG < > > ( );
 static auto xmlRead = registration::XmlReaderRegister < grammar::RightRG < > > ( );
 
-static auto xmlGroup1 = registration::XmlRegisterTypeInGroup < grammar::Grammar, grammar::RightRG < > > ( );
-static auto xmlGroup2 = registration::XmlRegisterTypeInGroup < object::Object, grammar::RightRG < > > ( );
+static auto xmlGroup = registration::XmlRegisterTypeInGroup < object::Object, grammar::RightRG < > > ( );
 
 } /* namespace */
diff --git a/alib2data/src/grammar/xml/Unrestricted/ContextPreservingUnrestrictedGrammar.cpp b/alib2data/src/grammar/xml/Unrestricted/ContextPreservingUnrestrictedGrammar.cpp
index 2911cd1e4c..960a42b0a8 100644
--- a/alib2data/src/grammar/xml/Unrestricted/ContextPreservingUnrestrictedGrammar.cpp
+++ b/alib2data/src/grammar/xml/Unrestricted/ContextPreservingUnrestrictedGrammar.cpp
@@ -16,7 +16,6 @@ namespace {
 static auto xmlWrite = registration::XmlWriterRegister < grammar::ContextPreservingUnrestrictedGrammar < > > ( );
 static auto xmlRead = registration::XmlReaderRegister < grammar::ContextPreservingUnrestrictedGrammar < > > ( );
 
-static auto xmlGroup1 = registration::XmlRegisterTypeInGroup < grammar::Grammar, grammar::ContextPreservingUnrestrictedGrammar < > > ( );
-static auto xmlGroup2 = registration::XmlRegisterTypeInGroup < object::Object, grammar::ContextPreservingUnrestrictedGrammar < > > ( );
+static auto xmlGroup = registration::XmlRegisterTypeInGroup < object::Object, grammar::ContextPreservingUnrestrictedGrammar < > > ( );
 
 } /* namespace */
diff --git a/alib2data/src/grammar/xml/Unrestricted/UnrestrictedGrammar.cpp b/alib2data/src/grammar/xml/Unrestricted/UnrestrictedGrammar.cpp
index 7cfa738e90..1a18af8ac6 100644
--- a/alib2data/src/grammar/xml/Unrestricted/UnrestrictedGrammar.cpp
+++ b/alib2data/src/grammar/xml/Unrestricted/UnrestrictedGrammar.cpp
@@ -16,7 +16,6 @@ namespace {
 static auto xmlWrite = registration::XmlWriterRegister < grammar::UnrestrictedGrammar < > > ( );
 static auto xmlRead = registration::XmlReaderRegister < grammar::UnrestrictedGrammar < > > ( );
 
-static auto xmlGroup1 = registration::XmlRegisterTypeInGroup < grammar::Grammar, grammar::UnrestrictedGrammar < > > ( );
-static auto xmlGroup2 = registration::XmlRegisterTypeInGroup < object::Object, grammar::UnrestrictedGrammar < > > ( );
+static auto xmlGroup = registration::XmlRegisterTypeInGroup < object::Object, grammar::UnrestrictedGrammar < > > ( );
 
 } /* namespace */
-- 
GitLab