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

+ alphabet manipulator bin for strings and trees

parent e49292ea
No related branches found
No related tags found
No related merge requests found
Showing
with 62 additions and 0 deletions
......@@ -41,6 +41,10 @@ public:
return StringAlphabet::getAlphabet ( );
}
 
void extendAlphabet ( const std::set < alphabet::Symbol > & symbols ) {
addSymbolsToAlphabet ( symbols );
}
virtual bool removeSymbolFromAlphabet ( const alphabet::Symbol & symbol );
 
/**
......
......@@ -35,6 +35,10 @@ public:
return StringAlphabet::getAlphabet ( );
}
 
void extendAlphabet ( const std::set < alphabet::Symbol > & symbols ) {
addSymbolsToAlphabet ( symbols );
}
virtual bool removeSymbolFromAlphabet ( const alphabet::Symbol & symbol );
 
/**
......
......@@ -50,6 +50,10 @@ public:
return StringAlphabet::getAlphabet ( );
}
 
void extendAlphabet ( const std::set < alphabet::Symbol > & symbols ) {
addSymbolsToAlphabet ( symbols );
}
virtual bool removeSymbolFromAlphabet ( const alphabet::Symbol & symbol );
 
/**
......
......@@ -40,6 +40,10 @@ public:
return TerminatingSymbolStringAlphabet::getAlphabet ( );
}
 
void extendAlphabet ( const std::set < alphabet::Symbol > & symbols ) {
addSymbolsToAlphabet ( symbols );
}
virtual bool removeSymbolFromAlphabet ( const alphabet::Symbol & symbol );
 
/**
......
......@@ -16,6 +16,10 @@ const std::set<alphabet::Symbol>& String::getAlphabet() const {
return this->getData().getAlphabet();
}
 
void String::extendAlphabet(const std::set < alphabet::Symbol > & symbols ) {
this->getData().extendAlphabet(symbols);
}
string::String stringFrom( const alphabet::Symbol& symbol ) {
return string::String { string::LinearString { std::vector<alphabet::Symbol> { symbol } } };
}
......
......@@ -23,6 +23,7 @@ class String : public alib::wrapper<StringBase>, public alib::WrapperBase {
using alib::wrapper<StringBase>::wrapper;
public:
const std::set<alphabet::Symbol>& getAlphabet() const;
void extendAlphabet(const std::set < alphabet::Symbol > & symbols );
};
 
string::String stringFrom(const alphabet::Symbol& symbol);
......
......@@ -23,6 +23,7 @@ public:
virtual StringBase* plunder() && = 0;
 
virtual const std::set<alphabet::Symbol>& getAlphabet() const = 0;
virtual void extendAlphabet(const std::set<alphabet::Symbol>& symbols) = 0;
};
 
} /* namespace string */
......
......@@ -23,6 +23,7 @@ public:
virtual RankedTreeBase * plunder ( ) && = 0;
 
virtual const std::set < alphabet::RankedSymbol > & getAlphabet ( ) const = 0;
virtual void extendAlphabet ( const std::set < alphabet::RankedSymbol > & symbols ) = 0;
};
 
} /* namespace tree */
......
......@@ -13,4 +13,8 @@ const std::set < alphabet::RankedSymbol > & RankedTreeWrapper::getAlphabet ( ) c
return this->getData ( ).getAlphabet ( );
}
 
void RankedTreeWrapper::extendAlphabet ( const std::set < alphabet::RankedSymbol > & symbols ) {
this->getData ( ).extendAlphabet ( symbols );
}
} /* namespace tree */
......@@ -22,6 +22,7 @@ class RankedTreeWrapper : public alib::wrapper < RankedTreeBase >, public alib::
 
public:
const std::set < alphabet::RankedSymbol > & getAlphabet ( ) const;
void extendAlphabet ( const std::set < alphabet::RankedSymbol > & symbols );
};
 
} /* namespace tree */
......
......@@ -23,6 +23,7 @@ public:
virtual UnrankedTreeBase * plunder ( ) && = 0;
 
virtual const std::set < alphabet::Symbol > & getAlphabet ( ) const = 0;
virtual void extendAlphabet ( const std::set < alphabet::Symbol > & symbols ) = 0;
};
 
} /* namespace tree */
......
......@@ -13,4 +13,8 @@ const std::set < alphabet::Symbol > & UnrankedTreeWrapper::getAlphabet ( ) const
return this->getData ( ).getAlphabet ( );
}
 
void UnrankedTreeWrapper::extendAlphabet ( const std::set < alphabet::Symbol > & symbols ) {
this->getData ( ).extendAlphabet ( symbols );
}
} /* namespace tree */
......@@ -22,6 +22,7 @@ class UnrankedTreeWrapper : public alib::wrapper < UnrankedTreeBase >, public al
 
public:
const std::set < alphabet::Symbol > & getAlphabet ( ) const;
void extendAlphabet ( const std::set < alphabet::Symbol > & symbols );
};
 
} /* namespace tree */
......
......@@ -54,6 +54,10 @@ public:
return RankedPatternAlphabet::getAlphabet ( );
}
 
void extendAlphabet ( const std::set < alphabet::RankedSymbol > & symbols ) {
addSymbolsToAlphabet ( symbols );
}
void setContent ( std::vector < alphabet::RankedSymbol > data );
 
const alphabet::Symbol & getBarSymbol ( ) const;
......
......@@ -51,6 +51,10 @@ public:
return RankedAlphabet::getAlphabet ( );
}
 
void extendAlphabet ( const std::set < alphabet::RankedSymbol > & symbols ) {
addSymbolsToAlphabet ( symbols );
}
const alphabet::Symbol & getBarSymbol ( ) const;
 
void setContent ( std::vector < alphabet::RankedSymbol > data );
......
......@@ -45,6 +45,10 @@ public:
return RankedPatternAlphabet::getAlphabet ( );
}
 
void extendAlphabet ( const std::set < alphabet::RankedSymbol > & symbols ) {
addSymbolsToAlphabet ( symbols );
}
void setContent ( std::vector < alphabet::RankedSymbol > data );
 
void arityChecksum ( const std::vector < alphabet::RankedSymbol > & data );
......
......@@ -45,6 +45,10 @@ public:
return RankedAlphabet::getAlphabet ( );
}
 
void extendAlphabet ( const std::set < alphabet::RankedSymbol > & symbols ) {
addSymbolsToAlphabet ( symbols );
}
void setContent ( std::vector < alphabet::RankedSymbol > data );
 
void arityChecksum ( const std::vector < alphabet::RankedSymbol > & data );
......
......@@ -63,6 +63,10 @@ public:
return RankedPatternAlphabet::getAlphabet ( );
}
 
void extendAlphabet ( const std::set < alphabet::RankedSymbol > & symbols ) {
addSymbolsToAlphabet ( symbols );
}
/**
* @return Root node of the regular expression pattern
*/
......
......@@ -63,6 +63,10 @@ public:
return RankedAlphabet::getAlphabet ( );
}
 
void extendAlphabet ( const std::set < alphabet::RankedSymbol > & symbols ) {
addSymbolsToAlphabet ( symbols );
}
/**
* @return Root node of the regular expression tree
*/
......
......@@ -63,6 +63,10 @@ public:
return UnrankedPatternAlphabet::getAlphabet ( );
}
 
void extendAlphabet ( const std::set < alphabet::Symbol > & symbols ) {
addSymbolsToAlphabet ( symbols );
}
/**
* @return Root node of the regular expression pattern
*/
......
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