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

Fix generation of epsilon rules.

parent 6fe44886
No related branches found
No related tags found
No related merge requests found
......@@ -44,14 +44,11 @@ RightRegularGrammar FA2RGconvert::convert( const FSM & automaton )
// step 4
if ( isInSet( State( grammar.getStartSymbol().getSymbol() ), automaton.getFinalStates() ) )
{
grammar.addTerminalSymbol( Symbol( "" ) ); //FIXME no need for this! (alib problem)
// 4a
if ( ! GrammarUtils::isNonterminalOnRightSide( grammar.getStartSymbol(), grammar.getRules() ) )
{
list<Symbol> leftSide, rightSide;
leftSide.push_back( grammar.getStartSymbol() );
rightSide.push_back( Symbol( "" ) );
Rule r( leftSide, rightSide );
grammar.addRule(r);
}
......@@ -74,7 +71,6 @@ RightRegularGrammar FA2RGconvert::convert( const FSM & automaton )
 
list<Symbol> leftSide, rightSide;
leftSide.push_back( newStart );
rightSide.push_back( Symbol( "" ) );
Rule rr( leftSide, rightSide );
grammar.addRule(rr);
}
......
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