using std::endl;
/* Invoked by the parser when a ragel definition is opened. */
-CodeGenData *dotMakeCodeGen( const char *sourceFileName, const char *fsmName,
- ostream &out, bool wantComplete )
+CodeGenData *dotMakeCodeGen( const char *sourceFileName, const char *fsmName, ostream &out )
{
CodeGenData *codeGen = new GraphvizDotGen(out);
codeGen->sourceFileName = sourceFileName;
codeGen->fsmName = fsmName;
- codeGen->wantComplete = wantComplete;
+
+ /* For normal code generation we want a transition on every character so we never
+ * end up in an undefined state. For graphviz this just clutters the
+ * drawing so we turn it off. */
+ codeGen->wantComplete = false;
return codeGen;
}
/* Invoked by the parser when a ragel definition is opened. */
-CodeGenData *cdMakeCodeGen( const char *sourceFileName, const char *fsmName,
- ostream &out, bool wantComplete )
+CodeGenData *cdMakeCodeGen( const char *sourceFileName, const char *fsmName, ostream &out )
{
CodeGenData *codeGen = 0;
switch ( hostLang->lang ) {
codeGen->sourceFileName = sourceFileName;
codeGen->fsmName = fsmName;
- codeGen->wantComplete = wantComplete;
return codeGen;
}
/* Invoked by the parser when a ragel definition is opened. */
-CodeGenData *javaMakeCodeGen( const char *sourceFileName, const char *fsmName,
- ostream &out, bool wantComplete )
+CodeGenData *javaMakeCodeGen( const char *sourceFileName, const char *fsmName, ostream &out )
{
CodeGenData *codeGen = new JavaTabCodeGen(out);
codeGen->sourceFileName = sourceFileName;
codeGen->fsmName = fsmName;
- codeGen->wantComplete = wantComplete;
return codeGen;
}
/* Invoked by the parser when a ragel definition is opened. */
-CodeGenData *rubyMakeCodeGen( const char *sourceFileName, const char *fsmName,
- ostream &out, bool wantComplete )
+CodeGenData *rubyMakeCodeGen( const char *sourceFileName, const char *fsmName, ostream &out )
{
CodeGenData *codeGen = 0;
switch ( codeStyle ) {
}
codeGen->sourceFileName = sourceFileName;
codeGen->fsmName = fsmName;
- codeGen->wantComplete = wantComplete;
return codeGen;
}
/* Invoked by the parser when a ragel definition is opened. */
-CodeGenData *csharpMakeCodeGen( const char *sourceFileName, const char *fsmName,
- ostream &out, bool wantComplete )
+CodeGenData *csharpMakeCodeGen( const char *sourceFileName, const char *fsmName, ostream &out )
{
CodeGenData *codeGen = 0;
codeGen->sourceFileName = sourceFileName;
codeGen->fsmName = fsmName;
- codeGen->wantComplete = wantComplete;
return codeGen;
}
-CodeGenData *makeCodeGen( const char *sourceFileName, const char *fsmName,
- ostream &out, bool wantComplete )
+CodeGenData *makeCodeGen( const char *sourceFileName, const char *fsmName, ostream &out )
{
CodeGenData *cgd = 0;
if ( generateDot )
- cgd = dotMakeCodeGen( sourceFileName, fsmName, out, wantComplete );
+ cgd = dotMakeCodeGen( sourceFileName, fsmName, out );
else if ( hostLang == &hostLangC )
- cgd = cdMakeCodeGen( sourceFileName, fsmName, out, wantComplete );
+ cgd = cdMakeCodeGen( sourceFileName, fsmName, out );
else if ( hostLang == &hostLangD )
- cgd = cdMakeCodeGen( sourceFileName, fsmName, out, wantComplete );
+ cgd = cdMakeCodeGen( sourceFileName, fsmName, out );
else if ( hostLang == &hostLangJava )
- cgd = javaMakeCodeGen( sourceFileName, fsmName, out, wantComplete );
+ cgd = javaMakeCodeGen( sourceFileName, fsmName, out );
else if ( hostLang == &hostLangRuby )
- cgd = rubyMakeCodeGen( sourceFileName, fsmName, out, wantComplete );
+ cgd = rubyMakeCodeGen( sourceFileName, fsmName, out );
else if ( hostLang == &hostLangCSharp )
- cgd = csharpMakeCodeGen( sourceFileName, fsmName, out, wantComplete );
+ cgd = csharpMakeCodeGen( sourceFileName, fsmName, out );
return cgd;
}
tokstartExpr(0),
tokendExpr(0),
dataExpr(0),
- wantComplete(0),
+ wantComplete(true),
hasLongestMatch(false),
noEnd(false),
noPrefix(false),
#include "vector.h"
#include "version.h"
#include "common.h"
-#include "xmlparse.h"
#include "inputdata.h"
using std::istream;
output_filter *outFilter = 0;
const char *outputFileName = 0;
+ParserDict parserDict;
+ParserList parserList;
+InputItemList inputItems;
+
/* Print a summary of the options. */
void usage()
{
void process( const char *inputFileName )
{
- bool wantComplete = true;
- bool outputActive = true;
-
/* Open the input file for reading. */
assert( inputFileName != 0 );
ifstream *inFile = new ifstream( inputFileName );
if ( ! inFile->is_open() )
error() << "could not open " << inputFileName << " for reading" << endp;
+ InputData inputData( inputFileName );
+
/* Used for just a few things. */
std::ostringstream hostData;
if ( gblErrorCount > 0 )
exit(1);
- if ( generateDot ) {
- wantComplete = false;
- outputActive = false;
- }
-
- InputData inputData( inputFileName, outputActive, wantComplete );
-
/* Now send EOF to all parsers. */
inputData.terminateAllParsers();
{
const char *inputFileName = 0;
processArgs( argc, argv, inputFileName );
-
/* If -M or -S are given and we're not generating a dot file then invoke
* the frontend. These options are not useful with code generators. */