'Parse fact expression
@param fact: the fact expression'

@classmethod
def parse(cls, fact):

    if isinstance(fact, tuple):
        (label, fact) = fact
    else:
        label = None
    if isinstance(fact, list):
        facts = []
        for f in fact:
            facts.extend(cls.parse(f))
        if (not facts):
            raise SyntaxError(('Invalid    fact    expression:    %s' % fact))
        return facts
    other = None
    default_method = False
    if (not fact):
        (method, parameters) = ('count', 'id')
    else:
        match = FACT.match(fact)
        if match:
            (method, parameters, other) = match.groups()
            if other:
                other = cls.parse(((label, other) if label else other))
        elif SELECTOR.match(fact):
            (method, parameters, other) = ('count', fact, None)
            default_method = True
        else:
            raise SyntaxError(('Invalid    fact    expression:    %s' % fact))
    if (method not in cls.METHODS):
        raise SyntaxError(('Unsupported    aggregation    method:    %s' % method))
    parameters = parameters.split(',')
    selector = parameters[0]
    facts = [cls(method, selector, label=label, default_method=default_method)]
    if other:
        facts.extend(other)
    return facts
