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

remove double dispatch from Objects compare

parent c7d4c99d
No related branches found
No related tags found
No related merge requests found
Showing
with 20 additions and 20 deletions
......@@ -27,7 +27,7 @@ public:
virtual SymbolBase* plunder() &&;
 
virtual int compare(const ObjectBase& other) const {
return -other.compare(*this);
return ObjectBase::compare(*this, other);
}
 
virtual int compare(const BarSymbol& other) const;
......
......@@ -27,7 +27,7 @@ public:
virtual SymbolBase* plunder() &&;
 
virtual int compare(const ObjectBase& other) const {
return -other.compare(*this);
return ObjectBase::compare(*this, other);
}
 
virtual int compare(const BlankSymbol& other) const;
......
......@@ -27,7 +27,7 @@ public:
virtual SymbolBase* plunder() &&;
 
virtual int compare(const ObjectBase& other) const {
return -other.compare(*this);
return ObjectBase::compare(*this, other);
}
 
virtual int compare(const BottomOfTheStackSymbol& other) const;
......
......@@ -27,7 +27,7 @@ public:
virtual SymbolBase* plunder() &&;
 
virtual int compare(const ObjectBase& other) const {
return -other.compare(*this);
return ObjectBase::compare(*this, other);
}
 
virtual int compare(const EndSymbol& other) const;
......
......@@ -42,7 +42,7 @@ public:
label::Label& getLabel();
 
virtual int compare(const ObjectBase& other) const {
return -other.compare(*this);
return ObjectBase::compare(*this, other);
}
 
virtual int compare(const LabeledSymbol& other) const;
......
......@@ -48,7 +48,7 @@ public:
const primitive::Unsigned& getRank() const;
 
virtual int compare(const ObjectBase& other) const {
return -other.compare(*this);
return ObjectBase::compare(*this, other);
}
 
virtual int compare(const RankedSymbol& other) const;
......
......@@ -27,7 +27,7 @@ public:
virtual SymbolBase* plunder() &&;
 
virtual int compare(const ObjectBase& other) const {
return -other.compare(*this);
return ObjectBase::compare(*this, other);
}
 
virtual int compare(const StartSymbol& other) const;
......
......@@ -27,7 +27,7 @@ public:
virtual SymbolBase* plunder() &&;
 
virtual int compare(const ObjectBase& other) const {
return -other.compare(*this);
return ObjectBase::compare(*this, other);
}
 
virtual int compare(const SubtreeWildcardSymbol& other) const;
......
......@@ -37,7 +37,7 @@ public:
const std::pair<Symbol, Symbol>& getData() const;
 
virtual int compare(const ObjectBase& other) const {
return -other.compare(*this);
return ObjectBase::compare(*this, other);
}
 
virtual int compare(const SymbolPairSymbol& other) const;
......
......@@ -37,7 +37,7 @@ public:
const std::set<Symbol>& getData() const;
 
virtual int compare(const ObjectBase& other) const {
return -other.compare(*this);
return ObjectBase::compare(*this, other);
}
 
virtual int compare(const SymbolSetSymbol& other) const;
......
......@@ -42,7 +42,7 @@ public:
primitive::Integer& getId();
 
virtual int compare(const ObjectBase& other) const {
return -other.compare(*this);
return ObjectBase::compare(*this, other);
}
 
virtual int compare(const UniqueSymbol& other) const;
......
......@@ -27,7 +27,7 @@ public:
virtual SymbolBase* plunder() &&;
 
virtual int compare(const ObjectBase& other) const {
return -other.compare(*this);
return ObjectBase::compare(*this, other);
}
 
virtual int compare(const VariablesBarSymbol& other) const;
......
......@@ -80,7 +80,7 @@ public:
std::map<std::pair<State, string::LinearString>, std::set<State>> getTransitionsToState(const State& from) const;
 
virtual int compare(const ObjectBase& other) const {
return -other.compare(*this);
return ObjectBase::compare(*this, other);
}
 
virtual int compare(const CompactNFA& other) const;
......
......@@ -81,7 +81,7 @@ public:
bool isTotal() const;
 
virtual int compare(const ObjectBase& other) const {
return -other.compare(*this);
return ObjectBase::compare(*this, other);
}
 
virtual int compare(const DFA& other) const;
......
......@@ -159,7 +159,7 @@ public:
bool isTotal() const;
 
virtual int compare(const ObjectBase& other) const {
return -other.compare(*this);
return ObjectBase::compare(*this, other);
}
 
virtual int compare(const EpsilonNFA& other) const;
......
......@@ -82,7 +82,7 @@ public:
std::map<std::pair<State, regexp::RegExp>, std::set<State> > getTransitionsToState(const State& from) const;
 
virtual int compare(const ObjectBase& other) const {
return -other.compare(*this);
return ObjectBase::compare(*this, other);
}
 
virtual int compare(const ExtendedNFA& other) const;
......
......@@ -97,7 +97,7 @@ public:
unsigned transitionsSize() const;
 
virtual int compare(const ObjectBase& other) const {
return -other.compare(*this);
return ObjectBase::compare(*this, other);
}
 
virtual int compare(const MultiInitialStateNFA& other) const;
......
......@@ -95,7 +95,7 @@ public:
unsigned transitionsSize() const;
 
virtual int compare(const ObjectBase& other) const {
return -other.compare(*this);
return ObjectBase::compare(*this, other);
}
 
virtual int compare(const NFA& other) const;
......
......@@ -92,7 +92,7 @@ public:
std::map<std::tuple<State, std::variant<string::Epsilon, alphabet::Symbol>, std::vector<alphabet::Symbol> >, std::pair<State, std::vector<alphabet::Symbol> > > getTransitionsToState(const State& from) const;
 
virtual int compare(const ObjectBase& other) const {
return -other.compare(*this);
return ObjectBase::compare(*this, other);
}
 
virtual int compare(const DPDA& other) const;
......
......@@ -94,7 +94,7 @@ public:
bool isDeterministic() const;
 
virtual int compare(const ObjectBase& other) const {
return -other.compare(*this);
return ObjectBase::compare(*this, other);
}
 
virtual int compare(const InputDrivenDPDA& other) const;
......
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