def check_can_be_matched_by_single_character(SM):
    bad_f = False
    init_state = SM.get_init_state()
    if SM.get_init_state().is_acceptance():
        bad_f = True
    elif (len(SM.states) != 2):
        bad_f = True
    elif (len(init_state.target_map.get_target_state_index_list()) != 1):
        bad_f = True
    else:
        tmp = set(SM.states.keys())
        tmp.remove(SM.init_state_index)
        other_state_index = next(iter(tmp))
        if (len(SM.states[other_state_index].target_map.get_target_state_index_list()) != 0):
            bad_f = True
    if bad_f:
        error.log((("For '%s' only patterns are addmissible which\n" % Keyword) + 'can be matched by a single character, e.g. " " or [a-z].'), sr)
def check_can_be_matched_by_single_character(SM):
    bad_f = False
    init_state = SM.get_init_state()
    if SM.get_init_state().is_acceptance():
        bad_f = True
    elif (len(SM.states) != 2):
        bad_f = True
    elif (len(init_state.target_map.get_target_state_index_list()) != 1):
        bad_f = True
    else:
        tmp = set(SM.states.keys())
        tmp.remove(SM.init_state_index)
        other_state_index = next(iter(tmp))
        if (len(SM.states[other_state_index].target_map.get_target_state_index_list()) != 0):
            bad_f = True
    if bad_f:
        error.log((("For '%s' only patterns are addmissible which\n" % Keyword) + 'can be matched by a single character, e.g. " " or [a-z].'), sr)