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

add missing methods

parent 6165f6fc
No related branches found
No related tags found
No related merge requests found
...@@ -97,6 +97,16 @@ bool LeftRG::removeRule(const alphabet::Symbol& leftHandSide, const std::variant ...@@ -97,6 +97,16 @@ bool LeftRG::removeRule(const alphabet::Symbol& leftHandSide, const std::variant
return rules[leftHandSide].erase(rightHandSide); return rules[leftHandSide].erase(rightHandSide);
} }
   
bool LeftRG::removeRule(const alphabet::Symbol& leftHandSide, const alphabet::Symbol& rightHandSide) {
std::variant<alphabet::Symbol, std::pair<alphabet::Symbol, alphabet::Symbol>> rhs(rightHandSide);
return removeRule(leftHandSide, rhs);
}
bool LeftRG::removeRule(const alphabet::Symbol& leftHandSide, const std::pair<alphabet::Symbol, alphabet::Symbol>& rightHandSide) {
std::variant<alphabet::Symbol, std::pair<alphabet::Symbol, alphabet::Symbol>> rhs(rightHandSide);
return removeRule(leftHandSide, rhs);
}
void LeftRG::setGeneratesEpsilon(bool genEps) { void LeftRG::setGeneratesEpsilon(bool genEps) {
generatesEpsilon = genEps; generatesEpsilon = genEps;
} }
......
...@@ -97,6 +97,16 @@ bool RightRG::removeRule(const alphabet::Symbol& leftHandSide, const std::varian ...@@ -97,6 +97,16 @@ bool RightRG::removeRule(const alphabet::Symbol& leftHandSide, const std::varian
return rules[leftHandSide].erase(rightHandSide); return rules[leftHandSide].erase(rightHandSide);
} }
   
bool RightRG::removeRule(const alphabet::Symbol& leftHandSide, const alphabet::Symbol& rightHandSide) {
std::variant<alphabet::Symbol, std::pair<alphabet::Symbol, alphabet::Symbol>> rhs(rightHandSide);
return removeRule(leftHandSide, rhs);
}
bool RightRG::removeRule(const alphabet::Symbol& leftHandSide, const std::pair<alphabet::Symbol, alphabet::Symbol>& rightHandSide) {
std::variant<alphabet::Symbol, std::pair<alphabet::Symbol, alphabet::Symbol>> rhs(rightHandSide);
return removeRule(leftHandSide, rhs);
}
void RightRG::setGeneratesEpsilon(bool genEps) { void RightRG::setGeneratesEpsilon(bool genEps) {
generatesEpsilon = genEps; generatesEpsilon = genEps;
} }
......
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