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

fix computation of raw rules in EpsilonFreeCFG

parent 272458e9
No related branches found
No related tags found
No related merge requests found
...@@ -71,8 +71,7 @@ grammar::CNF < > convertInternal( const T & origGrammar ) { ...@@ -71,8 +71,7 @@ grammar::CNF < > convertInternal( const T & origGrammar ) {
else if(origRhs.size() > 2) { else if(origRhs.size() > 2) {
auto second = splitToPairs(grammarTmp, origRhs, 0, origRhs.size(), createdSymbols); auto second = splitToPairs(grammarTmp, origRhs, 0, origRhs.size(), createdSymbols);
grammarTmp.addRawRule(origRule.first, {std::move(second.first), std::move(second.second)}); grammarTmp.addRawRule(origRule.first, {std::move(second.first), std::move(second.second)});
} else }
throw exception::CommonException("Invalid rule in grammar");
} }
} }
   
......
...@@ -409,7 +409,7 @@ ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > EpsilonFreeCFG ...@@ -409,7 +409,7 @@ ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > EpsilonFreeCFG
if ( getGeneratesEpsilon ( ) ) if ( getGeneratesEpsilon ( ) )
res [ getInitialSymbol ( ) ].insert ( ext::vector < SymbolType > { } ); res [ getInitialSymbol ( ) ].insert ( ext::vector < SymbolType > { } );
   
return rules; return res;
} }
   
template < class SymbolType > template < class SymbolType >
......
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