]> granicus.if.org Git - flex/commitdiff
Wilhems bug fixes.
authorVern Paxson <vern@ee.lbl.gov>
Mon, 5 Jul 1993 21:32:22 +0000 (21:32 +0000)
committerVern Paxson <vern@ee.lbl.gov>
Mon, 5 Jul 1993 21:32:22 +0000 (21:32 +0000)
dfa.c

diff --git a/dfa.c b/dfa.c
index c2c98cccda4073bf7e15f2a286870a56455864bd..7ffe263bba663a996a954747e7ff612b9387321a 100644 (file)
--- a/dfa.c
+++ b/dfa.c
@@ -55,7 +55,8 @@ void check_for_backtracking( ds, state )
 int ds;
 int state[];
        {
-       if ( (reject && ! dfaacc[ds].dfaacc_set) || ! dfaacc[ds].dfaacc_state )
+       if ( (reject && ! dfaacc[ds].dfaacc_set) ||
+            (! reject && ! dfaacc[ds].dfaacc_state) )
                { /* state is non-accepting */
                ++num_backtracking;
 
@@ -290,7 +291,7 @@ MARK_STATE(state) \
 if ( ++numstates >= current_max_dfa_size ) \
 DO_REALLOCATION \
 t[numstates] = state; \
-hashval = hashval + state; \
+hashval += state; \
 }
 
 #define STACK_STATE(state) \
@@ -318,10 +319,11 @@ ADD_STATE(state) \
                 * the stack.
                 */
                if ( ! IS_MARKED(ns) )
+                       {
                        PUT_ON_STACK(ns)
-
-               CHECK_ACCEPT(ns)
-               hashval = hashval + ns;
+                       CHECK_ACCEPT(ns)
+                       hashval += ns;
+                       }
                }
 
        for ( stkpos = 1; stkpos <= stkend; ++stkpos )
@@ -413,12 +415,6 @@ void ntod()
        int duplist[CSIZE + 1], state[CSIZE + 1];
        int targfreq[CSIZE + 1], targstate[CSIZE + 1];
 
-       /* This is so find_table_space(...) will know where to start looking
-        * in chk/nxt for unused records for space to put in the state
-        */
-       if ( fullspd )
-               firstfree = 0;
-
        accset = allocate_integer_array( num_rules + 1 );
        nset = allocate_integer_array( current_max_dfa_size );
 
@@ -1031,11 +1027,7 @@ int symlist[], duplist[];
                        {
                        if ( tch < -lastccl || tch >= csize )
                                {
-                               if ( tch >= csize && tch <= CSIZE )
-                                       flexerror( "scanner requires -8 flag" );
-
-                               else
-                                       flexfatal(
+                               flexfatal(
                        "bad transition character detected in sympartition()" );
                                }