From f5e5aed1fe2e8e39b3107c7dc45777c81a1023c0 Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Tue, 6 Dec 2016 17:13:56 +0100 Subject: [PATCH] replace last occs of alphabet::Symbol with params --- alib2data/src/alphabet/SubtreeWildcardSymbol.h | 2 +- alib2data/src/alphabet/VariablesBarSymbol.h | 2 +- alib2data/src/alphabet/ranked_symbol.hpp | 6 +++--- alib2data/test-src/alphabet/SymbolTest.cpp | 6 ++++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/alib2data/src/alphabet/SubtreeWildcardSymbol.h b/alib2data/src/alphabet/SubtreeWildcardSymbol.h index 01d24677bd..6fcee7dadc 100644 --- a/alib2data/src/alphabet/SubtreeWildcardSymbol.h +++ b/alib2data/src/alphabet/SubtreeWildcardSymbol.h @@ -82,7 +82,7 @@ inline Symbol SubtreeWildcardSymbol::instance < Symbol > ( ) { // TODO make partially specialised when needed by classes or variables, functions can be partially specialsed template < > inline std::ranked_symbol < > SubtreeWildcardSymbol::instance < std::ranked_symbol < > > ( ) { - return std::ranked_symbol < > ( Symbol ( SubtreeWildcardSymbol ( ) ), 0); + return std::ranked_symbol < > ( DefaultSymbolType ( SubtreeWildcardSymbol ( ) ), 0); } template < > diff --git a/alib2data/src/alphabet/VariablesBarSymbol.h b/alib2data/src/alphabet/VariablesBarSymbol.h index 585b50c76c..78c82b8625 100644 --- a/alib2data/src/alphabet/VariablesBarSymbol.h +++ b/alib2data/src/alphabet/VariablesBarSymbol.h @@ -82,7 +82,7 @@ inline Symbol VariablesBarSymbol::instance < Symbol > ( ) { // TODO make partially specialised when needed by classes or variables, functions can be partially specialsed template < > inline std::ranked_symbol < > VariablesBarSymbol::instance < std::ranked_symbol < > > ( ) { - return std::ranked_symbol < > ( Symbol ( VariablesBarSymbol ( ) ), 0); + return std::ranked_symbol < > ( DefaultSymbolType ( VariablesBarSymbol ( ) ), 0); } template < > diff --git a/alib2data/src/alphabet/ranked_symbol.hpp b/alib2data/src/alphabet/ranked_symbol.hpp index cbed851100..02db0acde7 100644 --- a/alib2data/src/alphabet/ranked_symbol.hpp +++ b/alib2data/src/alphabet/ranked_symbol.hpp @@ -76,17 +76,17 @@ public: }; template < class SymbolType, class RankType > -ranked_symbol < SymbolType, RankType >::ranked_symbol(int number, unsigned rank) : m_symbol(alphabet::Symbol(number)), m_rank(RankType(rank)) { +ranked_symbol < SymbolType, RankType >::ranked_symbol(int number, unsigned rank) : m_symbol(SymbolType(number)), m_rank(RankType(rank)) { } template < class SymbolType, class RankType > -ranked_symbol < SymbolType, RankType >::ranked_symbol(char character, unsigned rank) : m_symbol(alphabet::Symbol(character)), m_rank(RankType(rank)) { +ranked_symbol < SymbolType, RankType >::ranked_symbol(char character, unsigned rank) : m_symbol(SymbolType(character)), m_rank(RankType(rank)) { } template < class SymbolType, class RankType > -ranked_symbol < SymbolType, RankType >::ranked_symbol(std::string symbol, unsigned rank) : m_symbol(alphabet::Symbol(std::move(symbol))), m_rank(RankType(rank)) { +ranked_symbol < SymbolType, RankType >::ranked_symbol(std::string symbol, unsigned rank) : m_symbol(SymbolType(std::move(symbol))), m_rank(RankType(rank)) { } diff --git a/alib2data/test-src/alphabet/SymbolTest.cpp b/alib2data/test-src/alphabet/SymbolTest.cpp index c5641a4a72..50b6209efe 100644 --- a/alib2data/test-src/alphabet/SymbolTest.cpp +++ b/alib2data/test-src/alphabet/SymbolTest.cpp @@ -12,6 +12,8 @@ #include "alphabet/RankedSymbol.h" #include "alphabet/BarSymbol.h" +#include <common/DefaultSymbolType.h> + #include "factory/XmlDataFactory.hpp" #define CPPUNIT_IMPLY( x, y ) CPPUNIT_ASSERT ( !( x ) || ( y ) ) @@ -67,8 +69,8 @@ void SymbolTest::testOrder ( ) { alphabet::StartSymbol ss; alphabet::EndSymbol es; - alphabet::RankedSymbol < > rs1 ( alphabet::Symbol ( alphabet::BarSymbol { } ), 0 ); - alphabet::RankedSymbol < > rs2 ( alphabet::Symbol ( alphabet::BarSymbol { } ), 0 ); + alphabet::RankedSymbol < > rs1 ( DefaultSymbolType ( alphabet::BarSymbol { } ), 0 ); + alphabet::RankedSymbol < > rs2 ( DefaultSymbolType ( alphabet::BarSymbol { } ), 0 ); CPPUNIT_EXCLUSIVE_OR ( bs < ls, ls < bs ); -- GitLab