More cleanup ... dot and ruby file names.
authorthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Sat, 15 Nov 2008 03:43:38 +0000 (03:43 +0000)
committerthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Sat, 15 Nov 2008 03:43:38 +0000 (03:43 +0000)
git-svn-id: http://svn.complang.org/ragel/trunk@570 052ea7fc-9027-0410-9066-f65837a77df0

ragel/Makefile.in
ragel/dot-codegen.cpp [moved from ragel/dot-gvdotgen.cpp with 99% similarity]
ragel/dot-codegen.h [moved from ragel/dot-gvdotgen.h with 100% similarity]
ragel/rbx-gotocodegen.cpp [moved from ragel/ruby-rbx-gotocodegen.cpp with 99% similarity]
ragel/rbx-gotocodegen.h [moved from ragel/ruby-rbx-gotocodegen.h with 100% similarity]
ragel/ruby-codegen.cpp
ragel/ruby-flatcodegen.cpp
ragel/ruby-ftabcodegen.cpp
ragel/ruby-main.cpp [deleted file]
ragel/ruby-tabcodegen.cpp

index 9a19a3a..1e405ad 100644 (file)
@@ -34,12 +34,12 @@ CC_SRCS = \
        cd-fflatcodegen.cpp cd-gotocodegen.cpp cd-fgotocodegen.cpp \
        cd-ipgotocodegen.cpp cd-splitcodegen.cpp  \
        java-codegen.cpp \
-       ruby-main.cpp ruby-codegen.cpp ruby-tabcodegen.cpp ruby-ftabcodegen.cpp \
-       ruby-flatcodegen.cpp ruby-fflatcodegen.cpp ruby-rbx-gotocodegen.cpp \
+       ruby-codegen.cpp ruby-tabcodegen.cpp ruby-ftabcodegen.cpp \
+       ruby-flatcodegen.cpp ruby-fflatcodegen.cpp rbx-gotocodegen.cpp \
        cs-fsmcodegen.cpp cs-tabcodegen.cpp cs-ftabcodegen.cpp cs-flatcodegen.cpp \
        cs-fflatcodegen.cpp cs-gotocodegen.cpp cs-fgotocodegen.cpp \
        cs-ipgotocodegen.cpp cs-splitcodegen.cpp \
-       dot-gvdotgen.cpp 
+       dot-codegen.cpp 
 
 GEN_SRC = version.h rlscan.cpp rlparse.h rlparse.cpp \
        xmltags.cpp xmlscan.cpp xmlparse.cpp xmlparse.h
similarity index 99%
rename from ragel/dot-gvdotgen.cpp
rename to ragel/dot-codegen.cpp
index f6a86c5..2a3a991 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 #include "ragel.h"
-#include "dot-gvdotgen.h"
+#include "dot-codegen.h"
 #include "gendata.h"
 
 using std::istream;
similarity index 100%
rename from ragel/dot-gvdotgen.h
rename to ragel/dot-codegen.h
similarity index 99%
rename from ragel/ruby-rbx-gotocodegen.cpp
rename to ragel/rbx-gotocodegen.cpp
index 6aa42e2..fe86a9a 100644 (file)
@@ -22,8 +22,9 @@
 
 #include <stdio.h>
 #include <string>
-#include "ruby-rlgen-ruby.h"
-#include "ruby-rbx-gotocodegen.h"
+
+#include "rbx-gotocodegen.h"
+#include "ragel.h"
 #include "redfsm.h"
 #include "bstmap.h"
 #include "gendata.h"
index 8680387..4e8fab3 100644 (file)
 #include <sstream>
 #include "redfsm.h"
 #include "gendata.h"
-#include "ruby-rlgen-ruby.h"
+#include "ragel.h"
 #include "ruby-codegen.h"
+#include "xmlparse.h"
+#include "pcheck.h"
+#include "vector.h"
+#include "version.h"
+#include "common.h"
+
+#include "ragel.h"
+#include "ruby-tabcodegen.h"
+#include "ruby-ftabcodegen.h"
+#include "ruby-flatcodegen.h"
+#include "ruby-fflatcodegen.h"
+#include "rbx-gotocodegen.h"
 
 using std::ostream;
 using std::ostringstream;
 using std::string;
 using std::cerr;
 using std::endl;
+using std::istream;
+using std::ifstream;
+using std::ostream;
+using std::ios;
+using std::cin;
+using std::cout;
+using std::cerr;
+using std::endl;
+
+/* Target ruby impl */
+extern RubyImplEnum rubyImpl;
+
+/* Target language and output style. */
+extern CodeStyleEnum codeStyle;
+
+/* Io globals. */
+extern istream *inStream;
+extern ostream *outStream;
+extern output_filter *outFilter;
+extern const char *outputFileName;
+
+/* Graphviz dot file generation. */
+extern bool graphvizDone;
+
+extern int numSplitPartitions;
+
+/*
+ * Callbacks invoked by the XML data parser.
+ */
+
+/* Invoked by the parser when the root element is opened. */
+ostream *rubyOpenOutput( const char *inputFile )
+{
+       if ( hostLang->lang != HostLang::Ruby ) {
+               error() << "this code generator is for Ruby only" << endl;
+               exit(1);
+       }
+
+       /* If the output format is code and no output file name is given, then
+        * make a default. */
+       if ( outputFileName == 0 ) {
+               const char *ext = findFileExtension( inputFile );
+               if ( ext != 0 && strcmp( ext, ".rh" ) == 0 )
+                       outputFileName = fileNameFromStem( inputFile, ".h" );
+               else
+                       outputFileName = fileNameFromStem( inputFile, ".rb" );
+       }
+
+       /* Make sure we are not writing to the same file as the input file. */
+       if ( outputFileName != 0 && strcmp( inputFile, outputFileName  ) == 0 ) {
+               error() << "output file \"" << outputFileName  << 
+                               "\" is the same as the input file" << endl;
+       }
+
+       if ( outputFileName != 0 ) {
+               /* Create the filter on the output and open it. */
+               outFilter = new output_filter( outputFileName );
+               outFilter->open( outputFileName, ios::out|ios::trunc );
+               if ( !outFilter->is_open() ) {
+                       error() << "error opening " << outputFileName << " for writing" << endl;
+                       exit(1);
+               }
+
+               /* Open the output stream, attaching it to the filter. */
+               outStream = new ostream( outFilter );
+       }
+       else {
+               /* Writing out ot std out. */
+               outStream = &cout;
+       }
+       return outStream;
+}
+
+/* Invoked by the parser when a ragel definition is opened. */
+CodeGenData *rubyMakeCodeGen( const char *sourceFileName, const char *fsmName, 
+               ostream &out, bool wantComplete )
+{
+       CodeGenData *codeGen = 0;
+       switch ( codeStyle ) {
+               case GenTables: 
+                       codeGen = new RubyTabCodeGen(out);
+                       break;
+               case GenFTables:
+                       codeGen = new RubyFTabCodeGen(out);
+                       break;
+               case GenFlat:
+                       codeGen = new RubyFlatCodeGen(out);
+                       break;
+               case GenFFlat:
+                       codeGen = new RubyFFlatCodeGen(out);
+                       break;
+               case GenGoto:
+                       if ( rubyImpl == Rubinius ) {
+                               codeGen = new RbxGotoCodeGen(out);
+                       } else {
+                               cout << "Goto style is still _very_ experimental " 
+                                       "and only supported using Rubinius.\n"
+                                       "You may want to enable the --rbx flag "
+                                       " to give it a try.\n";
+                               exit(1);
+                       }
+                       break;
+               default:
+                       cout << "Invalid code style\n";
+                       exit(1);
+                       break;
+       }
+       codeGen->sourceFileName = sourceFileName;
+       codeGen->fsmName = fsmName;
+       codeGen->wantComplete = wantComplete;
+
+       return codeGen;
+}
 
 
 void rubyLineDirective( ostream &out, const char *fileName, int line )
index 8925aae..3265baa 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #include "ruby-flatcodegen.h"
-#include "ruby-rlgen-ruby.h"
+#include "ragel.h"
 #include "redfsm.h"
 #include "gendata.h"
 
index a1dd613..d5bce48 100644 (file)
@@ -24,7 +24,7 @@
 #include <sstream>
 #include "redfsm.h"
 #include "gendata.h"
-#include "ruby-rlgen-ruby.h"
+#include "ragel.h"
 #include "ruby-ftabcodegen.h"
 
 using std::ostream;
diff --git a/ragel/ruby-main.cpp b/ragel/ruby-main.cpp
deleted file mode 100644 (file)
index a7272c0..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- *  Copyright 2007 Victor Hugo Borja <vic@rubyforge.org>
- *  Copyright 2001-2007 Adrian Thurston <thurston@complang.org>
- */
-
-/*  This file is part of Ragel.
- *
- *  Ragel is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- * 
- *  Ragel is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- * 
- *  You should have received a copy of the GNU General Public License
- *  along with Ragel; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <iostream>
-#include <fstream>
-#include <unistd.h>
-
-#include "xmlparse.h"
-#include "pcheck.h"
-#include "vector.h"
-#include "version.h"
-#include "common.h"
-#include "ruby-rlgen-ruby.h"
-#include "ruby-tabcodegen.h"
-#include "ruby-ftabcodegen.h"
-#include "ruby-flatcodegen.h"
-#include "ruby-fflatcodegen.h"
-#include "ruby-rbx-gotocodegen.h"
-
-using std::istream;
-using std::ifstream;
-using std::ostream;
-using std::ios;
-using std::cin;
-using std::cout;
-using std::cerr;
-using std::endl;
-
-/* Target ruby impl */
-extern RubyImplEnum rubyImpl;
-
-/* Target language and output style. */
-extern CodeStyleEnum codeStyle;
-
-/* Io globals. */
-extern istream *inStream;
-extern ostream *outStream;
-extern output_filter *outFilter;
-extern const char *outputFileName;
-
-/* Graphviz dot file generation. */
-extern bool graphvizDone;
-
-extern int numSplitPartitions;
-
-/*
- * Callbacks invoked by the XML data parser.
- */
-
-/* Invoked by the parser when the root element is opened. */
-ostream *rubyOpenOutput( const char *inputFile )
-{
-       if ( hostLang->lang != HostLang::Ruby ) {
-               error() << "this code generator is for Ruby only" << endl;
-               exit(1);
-       }
-
-       /* If the output format is code and no output file name is given, then
-        * make a default. */
-       if ( outputFileName == 0 ) {
-               const char *ext = findFileExtension( inputFile );
-               if ( ext != 0 && strcmp( ext, ".rh" ) == 0 )
-                       outputFileName = fileNameFromStem( inputFile, ".h" );
-               else
-                       outputFileName = fileNameFromStem( inputFile, ".rb" );
-       }
-
-       /* Make sure we are not writing to the same file as the input file. */
-       if ( outputFileName != 0 && strcmp( inputFile, outputFileName  ) == 0 ) {
-               error() << "output file \"" << outputFileName  << 
-                               "\" is the same as the input file" << endl;
-       }
-
-       if ( outputFileName != 0 ) {
-               /* Create the filter on the output and open it. */
-               outFilter = new output_filter( outputFileName );
-               outFilter->open( outputFileName, ios::out|ios::trunc );
-               if ( !outFilter->is_open() ) {
-                       error() << "error opening " << outputFileName << " for writing" << endl;
-                       exit(1);
-               }
-
-               /* Open the output stream, attaching it to the filter. */
-               outStream = new ostream( outFilter );
-       }
-       else {
-               /* Writing out ot std out. */
-               outStream = &cout;
-       }
-       return outStream;
-}
-
-/* Invoked by the parser when a ragel definition is opened. */
-CodeGenData *rubyMakeCodeGen( const char *sourceFileName, const char *fsmName, 
-               ostream &out, bool wantComplete )
-{
-       CodeGenData *codeGen = 0;
-       switch ( codeStyle ) {
-               case GenTables: 
-                       codeGen = new RubyTabCodeGen(out);
-                       break;
-               case GenFTables:
-                       codeGen = new RubyFTabCodeGen(out);
-                       break;
-               case GenFlat:
-                       codeGen = new RubyFlatCodeGen(out);
-                       break;
-               case GenFFlat:
-                       codeGen = new RubyFFlatCodeGen(out);
-                       break;
-               case GenGoto:
-                       if ( rubyImpl == Rubinius ) {
-                               codeGen = new RbxGotoCodeGen(out);
-                       } else {
-                               cout << "Goto style is still _very_ experimental " 
-                                       "and only supported using Rubinius.\n"
-                                       "You may want to enable the --rbx flag "
-                                       " to give it a try.\n";
-                               exit(1);
-                       }
-                       break;
-               default:
-                       cout << "Invalid code style\n";
-                       exit(1);
-                       break;
-       }
-       codeGen->sourceFileName = sourceFileName;
-       codeGen->fsmName = fsmName;
-       codeGen->wantComplete = wantComplete;
-
-       return codeGen;
-}
-
-/*
- * Local Variables:
- * mode: c++
- * indent-tabs-mode: 1
- * c-file-style: "bsd"
- * End:
- */
index af50841..ed43e69 100644 (file)
@@ -24,7 +24,7 @@
 #include <sstream>
 #include "redfsm.h"
 #include "gendata.h"
-#include "ruby-rlgen-ruby.h"
+#include "ragel.h"
 #include "ruby-tabcodegen.h"
 
 using std::ostream;