def populate_state_register(all_seq: [list], sr: state.StateRegister) -> Edge:
<EOL>s0 = state.State(sr)<EOL>s0.matchDefault(s0)<EOL>sr.set_default_state(s0)<EOL>e0 = Edge(s0)<EOL>for seq in all_seq:<EOL><INDENT>r = ref(e0)<EOL>populate_from_sequence(seq, r, sr)<EOL><DEDENT>return e0<EOL>
function that create a state for all instance
        of MatchExpr in the given list and connect each others.