Build machine from list of lines.

def build_machine(lines):
    """Build machine from list of lines."""
    if lines == []:
        raise SyntaxError('Empty file')
    else:
        machine = Machine(lines[0].split())
        for line in lines[1:]:
            if line.strip() != '':
                machine.add_state(line)
    machine.check()
    return machine