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

use generic getTransitions

parent 6cc9b545
No related branches found
No related tags found
No related merge requests found
......@@ -40,10 +40,11 @@ std::set<automaton::State> EpsilonClosure::epsilonClosure( const automaton::Epsi
visited[ p ] = true;
closure.insert( p );
 
for( const auto & transition : fsm.getEpsilonTransitionsFromState( p ) )
for (const auto & to : transition.second )
if( visited [ to ] == false )
queue.push( to );
for( const auto & transition : fsm.getTransitions( ) )
if( transition.first.second.is<string::Epsilon>() && transition.first.first == p)
for (const auto & to : transition.second )
if( visited [ to ] == false )
queue.push( to );
}
 
return closure;
......@@ -83,8 +84,8 @@ std::set<automaton::State> EpsilonClosure::epsilonClosure( const automaton::Exte
visited[ p ] = true;
closure.insert( p );
 
for( const auto & transition : fsm.getTransitionsFromState( p ) )
if( regexp::RegExpEpsilon::languageContainsEpsilon( transition.first.second ) )
for( const auto & transition : fsm.getTransitions( ) )
if( transition.first.first == p && regexp::RegExpEpsilon::languageContainsEpsilon( transition.first.second ) )
for (const auto & to : transition.second )
if( visited [ to ] == false )
queue.push( to );
......@@ -111,8 +112,8 @@ std::set<automaton::State> EpsilonClosure::epsilonClosure( const automaton::Comp
visited[ p ] = true;
closure.insert( p );
 
for( const auto & transition : fsm.getTransitionsFromState( p ) )
if( transition.first.second.getContent().size() != 0 )
for( const auto & transition : fsm.getTransitions( ) )
if( transition.first.first == p && transition.first.second.getContent().size() == 0 )
for (const auto & to : transition.second )
if( visited [ to ] == false )
queue.push( to );
......
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