예제 #1
0
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;
}
예제 #2
0
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;
}
예제 #3
0
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);
}
예제 #4
0
파일: Names.cpp 프로젝트: halsten/beaverdbg
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;
}
예제 #5
0
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;
}