def test(state):
    # (*) compute the trigger map
    tm = TransitionMap.from_TargetMap(state.target_map)
    # (*) print the trigger map entries
    for trigger_interval, target_index in tm:
        if target_index is None or target_index == E_StateIndices.DROP_OUT:
            print trigger_interval.gnuplot_string(-1) + "\n"
        else:   
            print trigger_interval.gnuplot_string(target_index) + "\n"
Esempio n. 2
0
def test(state):
    # (*) compute the trigger map
    tm = TransitionMap.from_TargetMap(state.target_map)
    # (*) print the trigger map entries
    for trigger_interval, target_index in tm:
        if target_index is None or target_index == E_StateIndices.DROP_OUT:
            print trigger_interval.gnuplot_string(-1) + "\n"
        else:   
            print trigger_interval.gnuplot_string(target_index) + "\n"
Esempio n. 3
0
    def from_State(SM_State, StateIndex, EngineType):
        assert isinstance(SM_State, State)
        assert SM_State.target_map.is_DFA_compliant()
        assert isinstance(StateIndex, (int, long))

        x = AnalyzerState(StateIndex, TransitionMap.from_TargetMap(SM_State.target_map))

        # (*) Transition
        # Currently, the following is only used for path compression. If the alternative
        # is implemented, then the following is no longer necessary.
        x.map_target_index_to_character_set = SM_State.target_map.get_map()

        return x
Esempio n. 4
0
def test(state):
    print "\n## Map: Target Index --> Trigger Set\n"
    # (*) compute the trigger map
    for key, trigger_set in state.target_map.get_map().items():
        print "    %3i <--- %s" % (int(key), repr(trigger_set))

    print "\n## Map: Trigger Intervals (sorted) --> Target Index\n"
    tm = TransitionMap.from_TargetMap(state.target_map)
    # (*) print the trigger map entries
    prev_end = None
    for trigger_interval, target_index in tm:
        print "    %s \t---> %s" % (repr(trigger_interval), repr(target_index))
        if prev_end is not None and trigger_interval.begin != prev_end:
            print "    <ERROR !>"
Esempio n. 5
0
def test(state):
    print "\n## Map: Target Index --> Trigger Set\n"
    # (*) compute the trigger map
    for key, trigger_set in state.target_map.get_map().items():
        print "    %3i <--- %s" % (int(key), repr(trigger_set))

    print "\n## Map: Trigger Intervals (sorted) --> Target Index\n"
    tm = TransitionMap.from_TargetMap(state.target_map)
    # (*) print the trigger map entries
    prev_end = None
    for trigger_interval, target_index in tm:
        print "    %s \t---> %s" % (repr(trigger_interval), repr(target_index))
        if prev_end is not None and trigger_interval.begin != prev_end:
            print "    <ERROR !>"