':see: AbstractExpression.get_refs()'

def get_refs(self, recursive=False):

    if recursive:
        conds_refs = (self.refs + list(chain(*(c.get_refs(True) for c in self.conds))))
        if self.consequent:
            conds_refs.extend(self.consequent.get_refs(True))
        return conds_refs
    else:
        return self.refs
