Skip to content
Snippets Groups Projects
Commit b8f495d5 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

cast PostfixRankedTree to LinearString

parent f2e650c5
No related branches found
No related tags found
No related merge requests found
...@@ -19,6 +19,9 @@ auto linearStringType = registration::TypeRegister < string::String, string::Lin ...@@ -19,6 +19,9 @@ auto linearStringType = registration::TypeRegister < string::String, string::Lin
auto linearStringType2 = registration::TypeRegister < alib::Object, string::LinearString < > > ( ); auto linearStringType2 = registration::TypeRegister < alib::Object, string::LinearString < > > ( );
   
auto LinearStringFromEpsilon = registration::CastRegister < string::LinearString < >, string::Epsilon < > > ( ); auto LinearStringFromEpsilon = registration::CastRegister < string::LinearString < >, string::Epsilon < > > ( );
auto LinearStringFromPostfixRankedTree = registration::CastRegister < string::LinearString < common::ranked_symbol < DefaultSymbolType, DefaultRankType > >, tree::PostfixRankedTree < > > ( );
auto LinearStringFromPrefixBarTree = registration::CastRegister < string::LinearString < >, tree::PrefixBarTree < > > ( ); auto LinearStringFromPrefixBarTree = registration::CastRegister < string::LinearString < >, tree::PrefixBarTree < > > ( );
   
auto LinearStringFromPrefixRankedTree = registration::CastRegister < string::LinearString < common::ranked_symbol < DefaultSymbolType, DefaultRankType > >, tree::PrefixRankedTree < > > ( ); auto LinearStringFromPrefixRankedTree = registration::CastRegister < string::LinearString < common::ranked_symbol < DefaultSymbolType, DefaultRankType > >, tree::PrefixRankedTree < > > ( );
......
...@@ -40,6 +40,7 @@ class LinearString final : public StringBase, public alib::Components < LinearSt ...@@ -40,6 +40,7 @@ class LinearString final : public StringBase, public alib::Components < LinearSt
   
public: public:
explicit LinearString ( ); explicit LinearString ( );
template < class TreeSymbolType, class TreeRankType > template < class TreeSymbolType, class TreeRankType >
explicit LinearString ( const tree::PrefixRankedTree < TreeSymbolType, TreeRankType > & tree ); explicit LinearString ( const tree::PrefixRankedTree < TreeSymbolType, TreeRankType > & tree );
template < class TreeSymbolType, class TreeRankType > template < class TreeSymbolType, class TreeRankType >
...@@ -52,7 +53,12 @@ public: ...@@ -52,7 +53,12 @@ public:
explicit LinearString ( const tree::PrefixRankedBarPattern < TreeSymbolType, TreeRankType > & tree ); explicit LinearString ( const tree::PrefixRankedBarPattern < TreeSymbolType, TreeRankType > & tree );
template < class TreeSymbolType, class TreeRankType > template < class TreeSymbolType, class TreeRankType >
explicit LinearString ( const tree::PrefixRankedBarNonlinearPattern < TreeSymbolType, TreeRankType > & tree ); explicit LinearString ( const tree::PrefixRankedBarNonlinearPattern < TreeSymbolType, TreeRankType > & tree );
explicit LinearString ( const tree::PrefixBarTree < SymbolType > & tree ); explicit LinearString ( const tree::PrefixBarTree < SymbolType > & tree );
template < class TreeSymbolType, class TreeRankType >
explicit LinearString ( const tree::PostfixRankedTree < TreeSymbolType, TreeRankType > & tree );
explicit LinearString ( ext::set < SymbolType > alphabet, ext::vector < SymbolType > str ); explicit LinearString ( ext::set < SymbolType > alphabet, ext::vector < SymbolType > str );
explicit LinearString ( ext::vector < SymbolType > str ); explicit LinearString ( ext::vector < SymbolType > str );
explicit LinearString ( const std::string & str ); explicit LinearString ( const std::string & str );
...@@ -132,7 +138,11 @@ public: ...@@ -132,7 +138,11 @@ public:
#include "../tree/ranked/PrefixRankedBarTree.h" #include "../tree/ranked/PrefixRankedBarTree.h"
#include "../tree/ranked/PrefixRankedBarPattern.h" #include "../tree/ranked/PrefixRankedBarPattern.h"
#include "../tree/ranked/PrefixRankedBarNonlinearPattern.h" #include "../tree/ranked/PrefixRankedBarNonlinearPattern.h"
#include "../tree/unranked/PrefixBarTree.h" #include "../tree/unranked/PrefixBarTree.h"
#include "../tree/ranked/PostfixRankedTree.h"
#include "../tree/common/TreeAuxiliary.h" #include "../tree/common/TreeAuxiliary.h"
   
namespace string { namespace string {
...@@ -196,6 +206,11 @@ template < class SymbolType > ...@@ -196,6 +206,11 @@ template < class SymbolType >
LinearString < SymbolType >::LinearString ( const tree::PrefixBarTree < SymbolType > & tree ) : LinearString ( tree.getAlphabet ( ), tree.getContent ( ) ) { LinearString < SymbolType >::LinearString ( const tree::PrefixBarTree < SymbolType > & tree ) : LinearString ( tree.getAlphabet ( ), tree.getContent ( ) ) {
} }
   
template < class SymbolType >
template < class TreeSymbolType, class TreeRankType >
LinearString < SymbolType >::LinearString ( const tree::PostfixRankedTree < TreeSymbolType, TreeRankType > & tree ) : LinearString ( tree.getAlphabet ( ), tree.getContent ( ) ) {
}
template < class SymbolType > template < class SymbolType >
StringBase * LinearString < SymbolType >::clone ( ) const { StringBase * LinearString < SymbolType >::clone ( ) const {
return new LinearString ( * this ); return new LinearString ( * this );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment