Added a flag -d for turning off the removal of duplicate actions from actions
authorthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Thu, 20 Mar 2008 02:24:59 +0000 (02:24 +0000)
committerthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Thu, 20 Mar 2008 02:24:59 +0000 (02:24 +0000)
lists.

git-svn-id: http://svn.complang.org/ragel/trunk@416 052ea7fc-9027-0410-9066-f65837a77df0

ragel/main.cpp
ragel/parsedata.cpp
ragel/ragel.h

index 75bddc9..a610056 100644 (file)
@@ -67,6 +67,7 @@ MinimizeOpt minimizeOpt = MinimizeMostOps;
 /* Graphviz dot file generation. */
 char *machineSpec = 0, *machineName = 0;
 bool machineSpecFound = false;
+bool wantDupsRemoved = true;
 
 bool printStatistics = false;
 bool frontendOnly = false;
@@ -164,7 +165,7 @@ void escapeLineDirectivePath( std::ostream &out, char *path )
 
 void processArgs( int argc, char **argv, char *&inputFileName, char *&outputFileName )
 {
-       ParamCheck pc("xo:nmleabjkS:M:CDJRvHh?-:sT:F:G:P:LpV", argc, argv);
+       ParamCheck pc("xo:dnmleabjkS:M:CDJRvHh?-:sT:F:G:P:LpV", argc, argv);
 
        while ( pc.check() ) {
                switch ( pc.state ) {
@@ -191,6 +192,12 @@ void processArgs( int argc, char **argv, char *&inputFileName, char *&outputFile
                                break;
 
                        /* Minimization, mostly hidden options. */
+                       case 'd':
+                               wantDupsRemoved = false;
+                               frontendArgs.append( "-d" );
+                               break;
+
+                       /* Minimization, mostly hidden options. */
                        case 'n':
                                minimizeOpt = MinimizeNone;
                                frontendArgs.append( "-n" );
index 225dbea..7954fea 100644 (file)
@@ -1072,7 +1072,8 @@ FsmAp *ParseData::makeInstance( GraphDictEl *gdNode )
        for ( StateList::Iter state = graph->stateList; state.lte(); state++ )
                graph->transferErrorActions( state, 0 );
        
-       removeActionDups( graph );
+       if ( ::wantDupsRemoved )
+               removeActionDups( graph );
 
        /* Remove unreachable states. There should be no dead end states. The
         * subtract and intersection operators are the only places where they may
index 53baa0e..2484773 100644 (file)
@@ -50,6 +50,7 @@ extern MinimizeLevel minimizeLevel;
 extern MinimizeOpt minimizeOpt;
 extern char *machineSpec, *machineName;
 extern bool printStatistics;
+extern bool wantDupsRemoved;
 
 extern int gblErrorCount;
 extern char mainMachine[];