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

aLib: RegExp - method to check if regexp describes empty language

parent 9ae327e9
No related branches found
No related tags found
No related merge requests found
......@@ -70,6 +70,10 @@ void RegExp::setRegExp(RegExpElement* regExp) {
this->regExp = regExp;
}
 
bool RegExp::isEmpty() const {
return regExp == NULL || dynamic_cast<const RegExpEmpty*>(regExp);
}
void RegExp::toXML(ostream& out) {
RegExpPrinter::toXML(*this, out);
}
......
......@@ -55,6 +55,11 @@ public:
*/
void setRegExp(RegExpElement* regExp);
 
/**
* @return true if regexp represents empty language
*/
bool isEmpty() const;
/**
* Prints XML representation of the RegExp to the output stream.
* @param out output stream to which print the RegExp
......
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