Skip to content
Snippets Groups Projects
Commit 8de633d1 authored by Tomáš Pecka's avatar Tomáš Pecka
Browse files

Merge branch 'conversions' of gitlab.fit.cvut.cz:travnja3/automata-library into conversions

parents 763e52c0 ef0058cc
No related branches found
No related tags found
No related merge requests found
......@@ -41,7 +41,7 @@ FSM Brzozowski::convert( void )
 
for( const auto & symbol : alphabet )
{
RegExpElement* dSymbol = new RegExpSymbol( symbol.getSymbol( ). getSymbol( ) );
RegExpElement* dSymbol = new RegExpSymbol( symbol.getSymbol( ) );
RegExp derived = deriv.derivation( vector<RegExpElement*>( 1, dSymbol ) );
derived = opt.optimize( derived );
 
......
......@@ -69,7 +69,7 @@ void RegExpPrinter::printIteration(regexp::Iteration* iteration) {
}
 
void RegExpPrinter::printSymbol(regexp::RegExpSymbol* symbol) {
m_Out << symbol->getSymbol().getSymbol();
m_Out << symbol->getSymbol();
}
 
void RegExpPrinter::printEpsilon(regexp::RegExpEpsilon* symbol) {
......
......@@ -83,7 +83,7 @@ void RegExpPrinter::printIteration(Iteration* iteration, ostream& out, string pr
 
void RegExpPrinter::printSymbol(RegExpSymbol* symbol, ostream& out, string prefix) {
out << prefix << "<symbol>";
out << symbol->getSymbol().getSymbol();
out << symbol->getSymbol();
out << "</symbol>\n";
}
 
......
......@@ -18,7 +18,7 @@ RegExpSymbol::RegExpSymbol(const string& symbol) :
}
 
RegExpElement* RegExpSymbol::clone() const {
return new RegExpSymbol(this->symbol.getSymbol());
return new RegExpSymbol(this->symbol);
}
 
bool RegExpSymbol::operator<(const RegExpElement& other) const {
......@@ -58,7 +58,7 @@ bool RegExpSymbol::containsEmptyString() const {
return false;
}
 
const Symbol& RegExpSymbol::getSymbol() const {
const string& RegExpSymbol::getSymbol() const {
return this->symbol;
}
 
......
......@@ -21,7 +21,7 @@ using namespace alphabet;
* Represents symbol in the regular expression. Contains name of the symbol.
*/
class RegExpSymbol: public RegExpElement {
Symbol symbol;
string symbol;
public:
RegExpSymbol();
RegExpSymbol(const string& symbol);
......@@ -47,7 +47,7 @@ public:
*/
bool containsEmptyString() const;
const Symbol& getSymbol() const;
const string& getSymbol() const;
};
 
} /* namespace regexp */
......
......@@ -109,7 +109,7 @@ RegExpElement * RegExpDerivation::derivation( const Iteration * element, const R
 
RegExpElement * RegExpDerivation::derivation( const RegExpSymbol * element, const RegExpSymbol & dSymbol ) const
{
if( dSymbol == element->getSymbol( ).getSymbol( ) )
if( dSymbol == element->getSymbol( ) )
return new RegExpEpsilon( );
else
return new RegExpEmpty( );
......
......@@ -10,7 +10,7 @@ set<RegExpSymbol> RegExpAlphabet::getSymbols( const RegExp & re )
set<RegExpSymbol> alphabet;
 
for( const auto & symbol : getSymbolsListInOrder( re ) )
alphabet.insert( RegExpSymbol( symbol->getSymbol( ).getSymbol( ) ) );
alphabet.insert( RegExpSymbol( symbol->getSymbol( ) ) );
 
return alphabet;
}
......
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