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

Remove unnecessary tests

parent 82e04846
No related branches found
No related tags found
No related merge requests found
......@@ -33,9 +33,6 @@ GrammarBase* CFG::plunder() && {
 
bool CFG::removeTerminalSymbol(const alphabet::Symbol& symbol) {
for(const std::pair<alphabet::Symbol, std::set<std::vector<alphabet::Symbol>>>& rule : rules) {
if(rule.first == symbol)
throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
for(const std::vector<alphabet::Symbol>& rhs : rule.second)
if(std::find(rhs.begin(), rhs.end(), symbol) != rhs.end())
throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
......
......@@ -33,9 +33,6 @@ GrammarBase* EpsilonFreeCFG::plunder() && {
 
bool EpsilonFreeCFG::removeTerminalSymbol(const alphabet::Symbol& symbol) {
for(const std::pair<alphabet::Symbol, std::set<std::vector<alphabet::Symbol>>>& rule : rules) {
if(rule.first == symbol)
throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
for(const std::vector<alphabet::Symbol>& rhs : rule.second)
if(std::find(rhs.begin(), rhs.end(), symbol) != rhs.end())
throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
......
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