':see: AbstractExpression.get_refs()'

def get_refs(self, recursive=False):

    refs = (self.first.get_refs(recursive) + self.second.get_refs(recursive))
    if (self.consequent and recursive):
        refs.extend(self.consequent.get_refs(True))
    return refs
