A bit more cleanup.
[external/ragel.git] / ragel / inputdata.h
1 /*
2  *  Copyright 2008 Adrian Thurston <thurston@complang.org>
3  */
4
5 /*  This file is part of Ragel.
6  *
7  *  Ragel is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2 of the License, or
10  *  (at your option) any later version.
11  * 
12  *  Ragel is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *  GNU General Public License for more details.
16  * 
17  *  You should have received a copy of the GNU General Public License
18  *  along with Ragel; if not, write to the Free Software
19  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
20  */
21
22 #ifndef _INPUT_DATA
23 #define _INPUT_DATA
24
25 #include "gendata.h"
26
27 struct InputData
28 {
29         InputData( const char *inputFileName, bool outputActive, bool wantComplete ) : 
30                 inputFileName(inputFileName),
31                 outStream(0),
32                 outputActive(outputActive),
33                 wantComplete(wantComplete)
34         {}
35
36         /* The name of the root section, this does not change during an include. */
37         const char *inputFileName;
38         ostream *outStream;
39         bool outputActive;
40         bool wantComplete;
41
42         CodeGenMap codeGenMap;
43
44         void writeOutput();
45         void generateSpecificReduced();
46         void openOutput();
47         void openOutput2();
48         void generateReduced();
49         void prepareMachineGen();
50
51         void cdDefaultFileName( const char *inputFile );
52         void javaDefaultFileName( const char *inputFile );
53         void rubyDefaultFileName( const char *inputFile );
54         void csharpDefaultFileName( const char *inputFile );
55 };
56
57 #endif