}
}
+/* Send eof to all parsers. */
+void InputData::terminateAllParsers( )
+{
+ /* FIXME: a proper token is needed here. Suppose we should use the
+ * location of EOF in the last file that the parser was referenced in. */
+ InputLoc loc;
+ loc.fileName = "<EOF>";
+ loc.line = 0;
+ loc.col = 0;
+ for ( ParserDict::Iter pdel = parserDict; pdel.lte(); pdel++ )
+ pdel->value->token( loc, Parser_tk_eof, 0, 0 );
+}
+
+
void InputData::writeOutput()
{
if ( generateDot ) {
void openOutput();
void generateReduced();
void prepareMachineGen();
+ void terminateAllParsers();
void cdDefaultFileName( const char *inputFile );
void javaDefaultFileName( const char *inputFile );
/* Finished, final check for errors.. */
if ( gblErrorCount > 0 )
exit(1);
-
- /* Now send EOF to all parsers. */
- terminateAllParsers();
-
- /* Finished, final check for errors.. */
- if ( gblErrorCount > 0 )
- exit(1);
-
- /* Bail on above error. */
- if ( gblErrorCount > 0 )
- exit(1);
- /* Locate the backend program */
if ( generateDot ) {
wantComplete = false;
outputActive = false;
InputData inputData( inputFileName, outputActive, wantComplete );
+ /* Now send EOF to all parsers. */
+ inputData.terminateAllParsers();
+
+ /* Bail on above error. */
+ if ( gblErrorCount > 0 )
+ exit(1);
+
+ /* Locate the backend program */
/* Compiles machines. */
inputData.prepareMachineGen();
}
}
-/* Send eof to all parsers. */
-void terminateAllParsers( )
-{
- /* FIXME: a proper token is needed here. Suppose we should use the
- * location of EOF in the last file that the parser was referenced in. */
- InputLoc loc;
- loc.fileName = "<EOF>";
- loc.line = 0;
- loc.col = 0;
- for ( ParserDict::Iter pdel = parserDict; pdel.lte(); pdel++ )
- pdel->value->token( loc, Parser_tk_eof, 0, 0 );
-}
-
void writeLanguage( std::ostream &out )
{
out << " lang=\"";
struct XmlParser;
-void terminateAllParsers( );
void xmlEscapeHost( std::ostream &out, char *data, long len );
typedef Vector<const char *> ArgsVector;