bool Namespace::isEqualTo(const Type *other) const { const Namespace *o = other->asNamespace(); if (! o) return false; Name *l = identity(); Name *r = o->identity(); if (l == r || (l && l->isEqualTo(r))) return true; return false; }
bool Class::isEqualTo(const Type *other) const { const Class *o = other->asClass(); if (! o) return false; Name *l = identity(); Name *r = o->identity(); if (l == r || (l && l->isEqualTo(r))) return true; else return false; }
bool Enum::isEqualTo(const Type *other) const { const Enum *o = other->asEnum(); if (! o) return false; Name *l = identity(); Name *r = o->identity(); if (l == r) return true; else if (! l) return false; return l->isEqualTo(r); }
bool QualifiedNameId::isEqualTo(const Name *other) const { const QualifiedNameId *q = other->asQualifiedNameId(); if (! q) return false; else if (isGlobal() != q->isGlobal()) return false; else { const unsigned count = nameCount(); if (count != q->nameCount()) return false; for (unsigned i = 0; i < count; ++i) { Name *l = nameAt(i); Name *r = q->nameAt(i); if (! l->isEqualTo(r)) return false; } } return true; }
bool Function::isEqualTo(const Type *other) const { const Function *o = other->asFunction(); if (! o) return false; Name *l = identity(); Name *r = o->identity(); if (l == r || (l && l->isEqualTo(r))) { if (_arguments->symbolCount() != o->_arguments->symbolCount()) return false; else if (! _returnType.isEqualTo(o->_returnType)) return false; for (unsigned i = 0; i < _arguments->symbolCount(); ++i) { Symbol *l = _arguments->symbolAt(i); Symbol *r = o->_arguments->symbolAt(i); if (! l->type().isEqualTo(r->type())) return false; } return true; } return false; }