gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r23762 - gnunet/src/regex


From: gnunet
Subject: [GNUnet-SVN] r23762 - gnunet/src/regex
Date: Thu, 13 Sep 2012 11:25:56 +0200

Author: szengel
Date: 2012-09-13 11:25:55 +0200 (Thu, 13 Sep 2012)
New Revision: 23762

Modified:
   gnunet/src/regex/regex.c
   gnunet/src/regex/regex_internal.h
Log:
comments

Modified: gnunet/src/regex/regex.c
===================================================================
--- gnunet/src/regex/regex.c    2012-09-12 20:25:12 UTC (rev 23761)
+++ gnunet/src/regex/regex.c    2012-09-13 09:25:55 UTC (rev 23762)
@@ -644,7 +644,7 @@
   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.
@@ -660,6 +660,8 @@
     GNUNET_free_non_null (t->label);
     GNUNET_free (t);
   }
+
+  dfa->is_multistrided = GNUNET_YES;
 }
 
 
@@ -1383,7 +1385,7 @@
   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;
@@ -2255,11 +2257,15 @@
     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:
@@ -2367,6 +2373,7 @@
   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);

Modified: gnunet/src/regex/regex_internal.h
===================================================================
--- gnunet/src/regex/regex_internal.h   2012-09-12 20:25:12 UTC (rev 23761)
+++ gnunet/src/regex/regex_internal.h   2012-09-13 09:25:55 UTC (rev 23762)
@@ -253,6 +253,11 @@
    * Canonical regex (result of RX->NFA->DFA->RX)
    */
   char *canonical_regex;
+
+  /**
+   * GNUNET_YES, if multi strides have been added to the Automaton.
+   */
+  int is_multistrided;
 };
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]