pyrser/ast/match.py
def populate_state_register(all_seq: [list], sr: state.StateRegister) -> Edge:
    """ function that create a state for all instance
        of MatchExpr in the given list and connect each others.
    """
    # Basic State
    s0 = state.State(sr)
    # loop on himself
    s0.matchDefault(s0)
    # this is default
    sr.set_default_state(s0)
    # use Edge to store connection
    e0 = Edge(s0)
    for seq in all_seq:
        r = ref(e0)
        # merge all sequences into one tree automata
        populate_from_sequence(seq, r, sr)
    # return edge for debug purpose
    return e0
def populate_state_register(all_seq: [list], sr: state.StateRegister) -> Edge:
    # Basic State
    s0 = state.State(sr)
    # loop on himself
    s0.matchDefault(s0)
    # this is default
    sr.set_default_state(s0)
    # use Edge to store connection
    e0 = Edge(s0)
    for seq in all_seq:
        r = ref(e0)
        # merge all sequences into one tree automata
        populate_from_sequence(seq, r, sr)
    # return edge for debug purpose
    return e0
def populate_state_register ( all_seq : [ list ] , sr : state . StateRegister ) -> Edge : # Basic State s0 = state . State ( sr ) # loop on himself s0 . matchDefault ( s0 ) # this is default sr . set_default_state ( s0 ) # use Edge to store connection e0 = Edge ( s0 ) for seq in all_seq : r = ref ( e0 ) # merge all sequences into one tree automata populate_from_sequence ( seq , r , sr ) # return edge for debug purpose return e0
function that create a state for all instance
        of MatchExpr in the given list and connect each others.
function that create a state for all instance of MatchExpr in the given list and connect each others .