forked from jasder/antlr
Compare contents in ATNConfig::operator==
This commit is contained in:
parent
d089c8d864
commit
a025c9eefc
|
@ -101,14 +101,17 @@ void ATNConfig::setPrecedenceFilterSuppressed(bool value) {
|
|||
}
|
||||
}
|
||||
|
||||
bool ATNConfig::operator == (const ATNConfig &other) const
|
||||
{
|
||||
bool ATNConfig::operator == (const ATNConfig &other) const {
|
||||
return state->stateNumber == other.state->stateNumber && alt == other.alt &&
|
||||
(context == other.context || (context != nullptr && context == other.context)) &&
|
||||
semanticContext == other.semanticContext &&
|
||||
(context == other.context || (context != nullptr && *context == *(other.context))) &&
|
||||
(semanticContext == other.semanticContext || (semanticContext != nullptr && *semanticContext == *(other.semanticContext))) &&
|
||||
isPrecedenceFilterSuppressed() == other.isPrecedenceFilterSuppressed();
|
||||
}
|
||||
|
||||
bool ATNConfig::operator != (const ATNConfig &other) const {
|
||||
return !operator==(other);
|
||||
}
|
||||
|
||||
std::string ATNConfig::toString() {
|
||||
return toString(true);
|
||||
}
|
||||
|
|
|
@ -129,6 +129,7 @@ namespace atn {
|
|||
/// the same state, they predict the same alternative, and
|
||||
/// syntactic/semantic contexts are the same.
|
||||
bool operator == (const ATNConfig &other) const;
|
||||
bool operator != (const ATNConfig &other) const;
|
||||
|
||||
virtual std::string toString();
|
||||
std::string toString(bool showAlt);
|
||||
|
|
Loading…
Reference in New Issue