From 1ccd8158fff4e9fbcaa27791d06455d4ecc09a7d Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Fri, 21 Feb 2014 19:29:39 +0100 Subject: [PATCH] fix comparator --- alib/src/regexp/Alternation.cpp | 6 +++--- alib/src/regexp/Concatenation.cpp | 6 +++--- alib/src/regexp/RegExp.cpp | 6 +++--- makefile | 8 +++++++- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/alib/src/regexp/Alternation.cpp b/alib/src/regexp/Alternation.cpp index 2b72bf0cd9..125fc0b5c0 100644 --- a/alib/src/regexp/Alternation.cpp +++ b/alib/src/regexp/Alternation.cpp @@ -75,7 +75,7 @@ bool Alternation::operator<(const Alternation& other) const { auto thisIter = this->elements.begin(); auto otherIter = other.elements.begin(); - for(; thisIter != this->elements.end(); thisIter++) { + for(; thisIter != this->elements.end(); thisIter++, otherIter++) { if(**thisIter < **otherIter) return true; } @@ -87,7 +87,7 @@ bool Alternation::operator==(const Alternation& other) const { auto thisIter = this->elements.begin(); auto otherIter = other.elements.begin(); - for(; thisIter != this->elements.end(); thisIter++) { + for(; thisIter != this->elements.end(); thisIter++, otherIter++) { if(**thisIter != **otherIter) return false; } @@ -102,7 +102,7 @@ bool Alternation::operator>(const Alternation& other) const { auto thisIter = this->elements.begin(); auto otherIter = other.elements.begin(); - for(; thisIter != this->elements.end(); thisIter++) { + for(; thisIter != this->elements.end(); thisIter++, otherIter++) { if(**thisIter > **otherIter) return true; } diff --git a/alib/src/regexp/Concatenation.cpp b/alib/src/regexp/Concatenation.cpp index c09e901827..adadd7b1e1 100644 --- a/alib/src/regexp/Concatenation.cpp +++ b/alib/src/regexp/Concatenation.cpp @@ -71,7 +71,7 @@ bool Concatenation::operator<(const Concatenation& other) const { auto thisIter = this->elements.begin(); auto otherIter = other.elements.begin(); - for(; thisIter != this->elements.end(); thisIter++) { + for(; thisIter != this->elements.end(); thisIter++, otherIter++) { if(**thisIter < **otherIter) return true; } @@ -83,7 +83,7 @@ bool Concatenation::operator==(const Concatenation& other) const { auto thisIter = this->elements.begin(); auto otherIter = other.elements.begin(); - for(; thisIter != this->elements.end(); thisIter++) { + for(; thisIter != this->elements.end(); thisIter++, otherIter++) { if(**thisIter != **otherIter) return false; } @@ -98,7 +98,7 @@ bool Concatenation::operator>(const Concatenation& other) const { auto thisIter = this->elements.begin(); auto otherIter = other.elements.begin(); - for(; thisIter != this->elements.end(); thisIter++) { + for(; thisIter != this->elements.end(); thisIter++, otherIter++) { if(**thisIter > **otherIter) return true; } diff --git a/alib/src/regexp/RegExp.cpp b/alib/src/regexp/RegExp.cpp index bd65c9a8da..e8eb6ed7c8 100644 --- a/alib/src/regexp/RegExp.cpp +++ b/alib/src/regexp/RegExp.cpp @@ -76,15 +76,15 @@ ostream& operator <<(ostream& out, RegExp& regexp) { } bool RegExp::operator<(const RegExp& other) const { - return this->regExp < other.regExp; + return *(this->regExp) < *(other.regExp); } bool RegExp::operator==(const RegExp& other) const { - return this->regExp == other.regExp; + return *(this->regExp) == *(other.regExp); } bool RegExp::operator>(const RegExp& other) const { - return this->regExp > other.regExp; + return *(this->regExp) > *(other.regExp); } } /* namespace regexp */ diff --git a/makefile b/makefile index 861018a33a..8e287aac5f 100644 --- a/makefile +++ b/makefile @@ -3,7 +3,13 @@ LIBPATH = /usr/lib/ BINFOLDER = bin SUBDIRS_LIBS = alib adeterminize -SUBDIRS_BINS = acat aconvert aconvert.dot aconvert.gastex aconvert.regexp aconvert.automaton aconvert.grammar aminimize adeterminize.fsm adeterminize.idpda adeterminize.vpa adeterminize.vpa2 adeterminize.vpa3 adiff adiff.automaton adiff.grammar aepsilon atrim +SUBDIRS_BINS = acat \ + aconvert aconvert.dot aconvert.gastex aconvert.regexp aconvert.automaton aconvert.grammar \ + aminimize \ + adeterminize.fsm adeterminize.idpda adeterminize.vpa adeterminize.vpa2 adeterminize.vpa3 \ + adiff adiff.automaton adiff.grammar \ + aepsilon \ + atrim SUBDIRS_WITH_MAKE = $(dir $(wildcard */makefile)) -- GitLab