@classmethod
def parse(cls, as_string):
    """Parse the filter from a requirement line.

        ANDs are implicit between operands, OR are not and have lower
        precedence.
        >>> vf = VersionFilter.parse(
        ...     'postgresql <= 9.2 > 8.4 OR == 8.4-patched')
        >>> vf == VersionFilter(
        ...           'postgresql',
        ...           ('OR',
        ...            ('AND', ('<=', Version(9, 2)), ('>', Version(8, 4))),
        ...            ('==', Version(8, 4, suffix='patched'))))
        True
        """
    split = as_string.split(' ', 1)
    cap = split[0]
    if len(split) == 1:
        return cls(split[0], ())
    return cls(cap, cls.boolean_parse(split[1]))
