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

aconversion: Special case in FA -> RRG conversion

parent 5c800b1b
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,13 @@ RightRegularGrammar FAtoRRGConverter::convert( void )
list<Symbol> leftSide, rightSide;
leftSide.push_back( symbolMap.getNonTerminal( transition.getFrom( ) ) );
rightSide.push_back( transition.getInput( ) );
m_grammar.addRule( Rule( leftSide, rightSide ) );
/*
* Rule might already in - consider case:
* \delta(A,a) = F and \delta(B,a) = G, where both F and G are final states
*/
if( ! isInSet( Rule( leftSide, rightSide), m_grammar.getRules( ) ) )
m_grammar.addRule( Rule( leftSide, rightSide ) );
}
}
 
......
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