39
39
**
40
40
****************************************************************************/
41
41
42
+ #include < cstdio>
43
+
42
44
#include " main.h"
43
45
#include " asttoxml.h"
44
46
#include " reporthandler.h"
@@ -53,6 +55,8 @@ void displayHelp(GeneratorSet *generatorSet);
53
55
#include < QDebug>
54
56
int main (int argc, char *argv[])
55
57
{
58
+ ReportHandler::setContext (" Arguments" );
59
+
56
60
QScopedPointer<GeneratorSet> gs (GeneratorSet::getInstance ());
57
61
58
62
QString default_file = " :/trolltech/generator/qtscript_masterinclude.h" ;
@@ -135,11 +139,13 @@ int main(int argc, char *argv[])
135
139
printf (" Please wait while source files are being generated...\n " );
136
140
137
141
printf (" Parsing typesystem file [%s]\n " , qPrintable (typesystemFileName));
142
+ ReportHandler::setContext (" Typesystem" );
138
143
if (!TypeDatabase::instance ()->parseFile (typesystemFileName))
139
144
qFatal (" Cannot parse file: '%s'" , qPrintable (typesystemFileName));
140
145
141
146
printf (" PreProcessing - Generate [%s] using [%s] and include-paths [%s]\n " ,
142
147
qPrintable (pp_file), qPrintable (fileName), qPrintable (args.value (" include-paths" )));
148
+ ReportHandler::setContext (" Preprocess" );
143
149
if (!Preprocess::preprocess (fileName, pp_file, args.value (" include-paths" ))) {
144
150
fprintf (stderr, " Preprocessor failed on file: '%s'\n " , qPrintable (fileName));
145
151
return 1 ;
@@ -148,16 +154,19 @@ int main(int argc, char *argv[])
148
154
if (args.contains (" ast-to-xml" )) {
149
155
printf (" Running ast-to-xml on file [%s] using pp_file [%s] and include-paths [%s]\n " ,
150
156
qPrintable (fileName), qPrintable (pp_file), qPrintable (args.value (" include-paths" )));
157
+ ReportHandler::setContext (QString (" AST-to-XML" ));
151
158
astToXML (pp_file);
152
159
return 0 ;
153
160
}
154
161
155
162
printf (" Building model using [%s]\n " , qPrintable (pp_file));
163
+ ReportHandler::setContext (" Build" );
156
164
gs->buildModel (pp_file);
157
165
if (args.contains (" dump-object-tree" )) {
158
166
gs->dumpObjectTree ();
159
167
return 0 ;
160
168
}
169
+ ReportHandler::setContext (" Generate" );
161
170
printf (" %s\n " , qPrintable (gs->generate ()));
162
171
163
172
printf (" Done, %d warnings (%d known issues)\n " , ReportHandler::warningCount (),
0 commit comments