struct GNUNET_REGEX_Transition *t;
struct GNUNET_REGEX_Transition *t_next;
- if (1 > stride_len)
+ if (1 > stride_len || GNUNET_YES == dfa->is_multistrided)
return;
// Compute the new transitions.
GNUNET_free_non_null (t->label);
GNUNET_free (t);
}
+
+ dfa->is_multistrided = GNUNET_YES;
}
if (nfa_states->len < 1)
return s;
- // Create a name based on 'sset'
+ // Create a name based on 'nfa_states'
s->name = GNUNET_malloc (sizeof (char) * 2);
strcat (s->name, "{");
name = NULL;
goto error;
}
+ /* Remember the regex that was used to generate this NFA */
nfa->regex = GNUNET_strdup (regex);
/* create depth-first numbering of the states for pretty printing */
GNUNET_REGEX_automaton_traverse (nfa, NULL, NULL, NULL, &number_states, NULL);
+ /* No multistriding added so far */
+ nfa->is_multistrided = GNUNET_NO;
+
return nfa;
error:
dfa->states_head = NULL;
dfa->states_tail = NULL;
dfa->regex = GNUNET_strdup (regex);
+ dfa->is_multistrided = GNUNET_NO;
// Create DFA start state from epsilon closure
nfa_start_eps_cls = nfa_closure_create (nfa, nfa->start, 0);