CC_SRCS = \
main.cpp parsetree.cpp parsedata.cpp fsmstate.cpp fsmbase.cpp \
- fsmattach.cpp fsmmin.cpp fsmgraph.cpp fsmap.cpp xmlcodegen.cpp \
+ fsmattach.cpp fsmmin.cpp fsmgraph.cpp fsmap.cpp \
rlscan.cpp rlparse.cpp inputdata.cpp common.cpp \
- redfsm.cpp gendata.cpp xmltags.cpp xmlscan.cpp xmlparse.cpp \
- cd-fsmcodegen.cpp \
- cd-tabcodegen.cpp cd-ftabcodegen.cpp cd-flatcodegen.cpp \
- cd-fflatcodegen.cpp cd-gotocodegen.cpp cd-fgotocodegen.cpp \
- cd-ipgotocodegen.cpp cd-splitcodegen.cpp \
+ redfsm.cpp gendata.cpp \
+ cd-codegen.cpp \
+ cd-table.cpp cd-ftable.cpp cd-flat.cpp \
+ cd-fflat.cpp cd-goto.cpp cd-fgoto.cpp \
+ cd-ipgoto.cpp cd-split.cpp \
java-codegen.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-codegen.cpp
+ ruby-codegen.cpp ruby-table.cpp ruby-ftable.cpp \
+ ruby-flat.cpp ruby-fflat.cpp rbx-goto.cpp \
+ cs-codegen.cpp cs-table.cpp cs-ftable.cpp cs-flat.cpp \
+ cs-fflat.cpp cs-goto.cpp cs-fgoto.cpp \
+ cs-ipgoto.cpp cs-split.cpp \
+ dot-codegen.cpp \
+ xml-codegen.cpp \
GEN_SRC = version.h rlscan.cpp rlparse.h rlparse.cpp \
- xmltags.cpp xmlscan.cpp xmlparse.cpp xmlparse.h
+ xmltags.cpp xmlscan.cpp xmlparse.h
LIBS =
MINGW_LIBS = -lpsapi
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include "cd-codegen.h"
#include "ragel.h"
-#include "cd-fsmcodegen.h"
#include "redfsm.h"
#include "gendata.h"
#include <sstream>
#include <assert.h>
/* Code generators. */
-#include "cd-tabcodegen.h"
-#include "cd-ftabcodegen.h"
-#include "cd-flatcodegen.h"
-#include "cd-fflatcodegen.h"
-#include "cd-gotocodegen.h"
-#include "cd-fgotocodegen.h"
-#include "cd-ipgotocodegen.h"
-#include "cd-splitcodegen.h"
+#include "cd-table.h"
+#include "cd-ftable.h"
+#include "cd-flat.h"
+#include "cd-fflat.h"
+#include "cd-goto.h"
+#include "cd-fgoto.h"
+#include "cd-ipgoto.h"
+#include "cd-split.h"
using std::ostream;
using std::ostringstream;
*/
#include "ragel.h"
-#include "cd-fflatcodegen.h"
+#include "cd-fflat.h"
#include "redfsm.h"
#include "gendata.h"
#define _FFLATCODEGEN_H
#include <iostream>
-#include "cd-flatcodegen.h"
+#include "cd-flat.h"
/* Forwards. */
struct CodeGenData;
*/
#include "ragel.h"
-#include "cd-fgotocodegen.h"
+#include "cd-fgoto.h"
#include "redfsm.h"
#include "gendata.h"
#include "bstmap.h"
#define _FGOTOCODEGEN_H
#include <iostream>
-#include "cd-gotocodegen.h"
+#include "cd-goto.h"
/* Forwards. */
struct CodeGenData;
*/
#include "ragel.h"
-#include "cd-flatcodegen.h"
+#include "cd-flat.h"
#include "redfsm.h"
#include "gendata.h"
#define _FLATCODEGEN_H
#include <iostream>
-#include "cd-fsmcodegen.h"
+#include "cd-codegen.h"
/* Forwards. */
struct CodeGenData;
*/
#include "ragel.h"
-#include "cd-ftabcodegen.h"
+#include "cd-ftable.h"
#include "redfsm.h"
#include "gendata.h"
#define _FTABCODEGEN_H
#include <iostream>
-#include "cd-tabcodegen.h"
+#include "cd-table.h"
/* Forwards. */
struct CodeGenData;
*/
#include "ragel.h"
-#include "cd-gotocodegen.h"
+#include "cd-goto.h"
#include "redfsm.h"
#include "bstmap.h"
#include "gendata.h"
#define _GOTOCODEGEN_H
#include <iostream>
-#include "cd-fsmcodegen.h"
+#include "cd-codegen.h"
/* Forwards. */
struct CodeGenData;
*/
#include "ragel.h"
-#include "cd-ipgotocodegen.h"
+#include "cd-ipgoto.h"
#include "redfsm.h"
#include "gendata.h"
#include "bstmap.h"
#define _IPGCODEGEN_H
#include <iostream>
-#include "cd-gotocodegen.h"
+#include "cd-goto.h"
/* Forwards. */
struct CodeGenData;
#include "ragel.h"
-#include "cd-splitcodegen.h"
+#include "cd-split.h"
#include "gendata.h"
#include <assert.h>
#ifndef _SPLITCODEGEN_H
#define _SPLITCODEGEN_H
-#include "cd-ipgotocodegen.h"
+#include "cd-ipgoto.h"
class SplitCodeGen : public IpGotoCodeGen
{
*/
#include "ragel.h"
-#include "cd-tabcodegen.h"
+#include "cd-table.h"
#include "redfsm.h"
#include "gendata.h"
#define _TABCODEGEN_H
#include <iostream>
-#include "cd-fsmcodegen.h"
+#include "cd-codegen.h"
/* Forwards. */
struct CodeGenData;
*/
#include "ragel.h"
-#include "cs-fsmcodegen.h"
+#include "cs-codegen.h"
#include "redfsm.h"
#include "gendata.h"
#include <sstream>
#include <assert.h>
/* Code generators. */
-#include "cs-tabcodegen.h"
-#include "cs-ftabcodegen.h"
-#include "cs-flatcodegen.h"
-#include "cs-fflatcodegen.h"
-#include "cs-gotocodegen.h"
-#include "cs-fgotocodegen.h"
-#include "cs-ipgotocodegen.h"
-#include "cs-splitcodegen.h"
+#include "cs-table.h"
+#include "cs-ftable.h"
+#include "cs-flat.h"
+#include "cs-fflat.h"
+#include "cs-goto.h"
+#include "cs-fgoto.h"
+#include "cs-ipgoto.h"
+#include "cs-split.h"
using std::ostream;
using std::ostringstream;
*/
#include "ragel.h"
-#include "cs-fflatcodegen.h"
+#include "cs-fflat.h"
#include "redfsm.h"
#include "gendata.h"
#define _FFLATCODEGEN_H
#include <iostream>
-#include "cs-flatcodegen.h"
+#include "cs-flat.h"
/* Forwards. */
struct CodeGenData;
*/
#include "ragel.h"
-#include "cs-fgotocodegen.h"
+#include "cs-fgoto.h"
#include "redfsm.h"
#include "gendata.h"
#include "bstmap.h"
#define _FGOTOCODEGEN_H
#include <iostream>
-#include "cs-gotocodegen.h"
+#include "cs-goto.h"
/* Forwards. */
struct CodeGenData;
*/
#include "ragel.h"
-#include "cs-flatcodegen.h"
+#include "cs-flat.h"
#include "redfsm.h"
#include "gendata.h"
#define _FLATCODEGEN_H
#include <iostream>
-#include "cs-fsmcodegen.h"
+#include "cs-codegen.h"
/* Forwards. */
struct CodeGenData;
*/
#include "ragel.h"
-#include "cs-ftabcodegen.h"
+#include "cs-ftable.h"
#include "redfsm.h"
#include "gendata.h"
#define _FTABCODEGEN_H
#include <iostream>
-#include "cs-tabcodegen.h"
+#include "cs-table.h"
/* Forwards. */
struct CodeGenData;
*/
#include "ragel.h"
-#include "cs-gotocodegen.h"
+#include "cs-goto.h"
#include "redfsm.h"
#include "bstmap.h"
#include "gendata.h"
#define _GOTOCODEGEN_H
#include <iostream>
-#include "cs-fsmcodegen.h"
+#include "cs-codegen.h"
/* Forwards. */
struct CodeGenData;
*/
#include "ragel.h"
-#include "cs-ipgotocodegen.h"
+#include "cs-ipgoto.h"
#include "redfsm.h"
#include "gendata.h"
#include "bstmap.h"
#define _IPGCODEGEN_H
#include <iostream>
-#include "cs-gotocodegen.h"
+#include "cs-goto.h"
/* Forwards. */
struct CodeGenData;
#include "ragel.h"
-#include "cs-splitcodegen.h"
+#include "cs-split.h"
#include "gendata.h"
#include <assert.h>
#ifndef _SPLITCODEGEN_H
#define _SPLITCODEGEN_H
-#include "cs-ipgotocodegen.h"
+#include "cs-ipgoto.h"
class CSharpSplitCodeGen : public CSharpIpGotoCodeGen
{
*/
#include "ragel.h"
-#include "cs-tabcodegen.h"
+#include "cs-table.h"
#include "redfsm.h"
#include "gendata.h"
#define _TABCODEGEN_H
#include <iostream>
-#include "cs-fsmcodegen.h"
+#include "cs-codegen.h"
/* Forwards. */
struct CodeGenData;
using std::cerr;
using std::endl;
+CodeGenData *makeCodeGen( const char *sourceFileName, const char *fsmName,
+ ostream &out, bool wantComplete )
+{
+ CodeGenData *cgd = 0;
+ if ( generateDot )
+ cgd = dotMakeCodeGen( sourceFileName, fsmName, out, wantComplete );
+ else if ( hostLang == &hostLangC )
+ cgd = cdMakeCodeGen( sourceFileName, fsmName, out, wantComplete );
+ else if ( hostLang == &hostLangD )
+ cgd = cdMakeCodeGen( sourceFileName, fsmName, out, wantComplete );
+ else if ( hostLang == &hostLangJava )
+ cgd = javaMakeCodeGen( sourceFileName, fsmName, out, wantComplete );
+ else if ( hostLang == &hostLangRuby )
+ cgd = rubyMakeCodeGen( sourceFileName, fsmName, out, wantComplete );
+ else if ( hostLang == &hostLangCSharp )
+ cgd = csharpMakeCodeGen( sourceFileName, fsmName, out, wantComplete );
+ return cgd;
+}
+
+void lineDirective( ostream &out, const char *fileName, int line )
+{
+ if ( !generateDot ) {
+ if ( hostLang == &hostLangC )
+ cdLineDirective( out, fileName, line );
+ else if ( hostLang == &hostLangD )
+ cdLineDirective( out, fileName, line );
+ else if ( hostLang == &hostLangJava )
+ javaLineDirective( out, fileName, line );
+ else if ( hostLang == &hostLangRuby )
+ rubyLineDirective( out, fileName, line );
+ else if ( hostLang == &hostLangCSharp )
+ csharpLineDirective( out, fileName, line );
+ }
+}
+
+void genLineDirective( ostream &out )
+{
+ std::streambuf *sbuf = out.rdbuf();
+ output_filter *filter = static_cast<output_filter*>(sbuf);
+ lineDirective( out, filter->fileName, filter->line + 1 );
+}
+
+
/* Total error count. */
/* int gblErrorCount = 0; */
#include "parsedata.h"
#include "parsetree.h"
#include "mergesort.h"
-#include "xmlcodegen.h"
+#include "xml-codegen.h"
#include "version.h"
#include "xmlparse.h"
#include "inputdata.h"
#include <stdio.h>
#include <string>
-#include "rbx-gotocodegen.h"
+#include "rbx-goto.h"
#include "ragel.h"
#include "redfsm.h"
#include "bstmap.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"
+#include "ruby-table.h"
+#include "ruby-ftable.h"
+#include "ruby-flat.h"
+#include "ruby-fflat.h"
+#include "rbx-goto.h"
using std::ostream;
using std::ostringstream;
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "ruby-fflatcodegen.h"
+#include "ruby-fflat.h"
void RubyFFlatCodeGen::GOTO( ostream &out, int gotoDest, bool inFinish )
{
#define _RUBY_FFLATCODEGEN_H
#include <iostream>
-#include "ruby-flatcodegen.h"
+#include "ruby-flat.h"
class RubyFFlatCodeGen : public RubyFlatCodeGen
{
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "ruby-flatcodegen.h"
+#include "ruby-flat.h"
#include "ragel.h"
#include "redfsm.h"
#include "gendata.h"
#include "redfsm.h"
#include "gendata.h"
#include "ragel.h"
-#include "ruby-ftabcodegen.h"
+#include "ruby-ftable.h"
using std::ostream;
using std::ostringstream;
#ifndef _RUBY_FTABCODEGEN_H
#define _RUBY_FTABCODEGEN_H
-#include "ruby-tabcodegen.h"
+#include "ruby-table.h"
class RubyFTabCodeGen : public RubyTabCodeGen
{
+++ /dev/null
-/*
- * 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
- */
-
-#ifndef _RLGEN_RUBY_H
-#define _RLGEN_RUBY_H
-
-#include <iostream>
-#include "config.h"
-#include "common.h"
-
-extern RubyImplEnum rubyImpl;
-extern CodeStyleEnum codeStyle;
-
-extern int gblErrorCount;
-extern char machineMain[];
-
-/* Options. */
-extern int numSplitPartitions;
-extern bool noLineDirectives;
-
-std::ostream &error();
-
-/*
- * Local Variables:
- * mode: c++
- * indent-tabs-mode: 1
- * c-file-style: "bsd"
- * End:
- */
-
-#endif /* _RLGEN_RUBY_H */
#include "redfsm.h"
#include "gendata.h"
#include "ragel.h"
-#include "ruby-tabcodegen.h"
+#include "ruby-table.h"
using std::ostream;
using std::ostringstream;
#include "ragel.h"
-#include "xmlcodegen.h"
+#include "xml-codegen.h"
#include "xmlparse.h"
#include "parsedata.h"
#include "fsmgraph.h"
InputLoc loc;
};
-CodeGenData *makeCodeGen( const char *sourceFileName, const char *fsmName,
- ostream &out, bool wantComplete )
-{
- CodeGenData *cgd = 0;
- if ( generateDot )
- cgd = dotMakeCodeGen( sourceFileName, fsmName, out, wantComplete );
- else if ( hostLang == &hostLangC )
- cgd = cdMakeCodeGen( sourceFileName, fsmName, out, wantComplete );
- else if ( hostLang == &hostLangD )
- cgd = cdMakeCodeGen( sourceFileName, fsmName, out, wantComplete );
- else if ( hostLang == &hostLangJava )
- cgd = javaMakeCodeGen( sourceFileName, fsmName, out, wantComplete );
- else if ( hostLang == &hostLangRuby )
- cgd = rubyMakeCodeGen( sourceFileName, fsmName, out, wantComplete );
- else if ( hostLang == &hostLangCSharp )
- cgd = csharpMakeCodeGen( sourceFileName, fsmName, out, wantComplete );
- return cgd;
-}
-
-void lineDirective( ostream &out, const char *fileName, int line )
-{
- if ( !generateDot ) {
- if ( hostLang == &hostLangC )
- cdLineDirective( out, fileName, line );
- else if ( hostLang == &hostLangD )
- cdLineDirective( out, fileName, line );
- else if ( hostLang == &hostLangJava )
- javaLineDirective( out, fileName, line );
- else if ( hostLang == &hostLangRuby )
- rubyLineDirective( out, fileName, line );
- else if ( hostLang == &hostLangCSharp )
- csharpLineDirective( out, fileName, line );
- }
-}
-
-void genLineDirective( ostream &out )
-{
- std::streambuf *sbuf = out.rdbuf();
- output_filter *filter = static_cast<output_filter*>(sbuf);
- lineDirective( out, filter->fileName, filter->line + 1 );
-}
-
%%{
parser XmlParser;