def parse (line):
    """Parses a rule line and returns `(rule, subrules)`."""
    rule, rhs = (s.strip() for s in line.split(':'))

    if rhs.count('"') == 2:
        subrules = rhs.replace('"', '')
    elif rhs.count('|') == 0:
        subrules = rhs.split()
    else:
        subrules = [ s.split() for s in rhs.split('|') ]

    return rule, subrules