Update of /cvsroot/cpptool/rfta/src/astdumper
In directory sc8-pr-cvs1:/tmp/cvs-serv21655/src/astdumper
Modified Files:
ASTDumper.cpp ASTDumper.h Main.cpp
Log Message:
* fixed astdump, parser failure was not indicated by error code
* correctly define output html filename (was stripping .cpp/.h extension)
Index: ASTDumper.cpp
===================================================================
RCS file: /cvsroot/cpptool/rfta/src/astdumper/ASTDumper.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ASTDumper.cpp 30 Apr 2003 22:10:48 -0000 1.7
--- ASTDumper.cpp 1 May 2003 09:08:08 -0000 1.8
***************
*** 133,137 ****
! void
ASTDumper::dump( const std::string &source,
const boost::filesystem::path &filePath,
--- 133,137 ----
! bool
ASTDumper::dump( const std::string &source,
const boost::filesystem::path &filePath,
***************
*** 148,159 ****
writer.writeH2( "Abstract syntax tree:" );
! writeAST( source, writer );
writer.writeFooter();
stream.close();
}
! void
ASTDumper::writeAST( const std::string &source,
HTMLWriter &writer )
--- 148,160 ----
writer.writeH2( "Abstract syntax tree:" );
! bool succeed = writeAST( source, writer );
writer.writeFooter();
stream.close();
+ return succeed;
}
! bool
ASTDumper::writeAST( const std::string &source,
HTMLWriter &writer )
***************
*** 170,173 ****
--- 171,175 ----
sourceAST->getBlankedSourceEnd() );
+ bool succeed = true;
try
{
***************
*** 182,189 ****
--- 184,193 ----
writer.writeError( "Parsing failed:" );
writer.writePreformated( e.what() );
+ succeed = false;
}
ASTDumpVisitor visitor( writer, sourceAST );
visitor.visitNode( sourceAST );
+ return succeed;
}
Index: ASTDumper.h
===================================================================
RCS file: /cvsroot/cpptool/rfta/src/astdumper/ASTDumper.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ASTDumper.h 30 Apr 2003 22:10:49 -0000 1.2
--- ASTDumper.h 1 May 2003 09:08:09 -0000 1.3
***************
*** 27,36 ****
virtual ~ASTDumper();
! void dump( const std::string &source,
const boost::filesystem::path &logDir,
const std::string &title );
private:
! void writeAST( const std::string &source,
HTMLWriter &writer );
};
--- 27,36 ----
virtual ~ASTDumper();
! bool dump( const std::string &source,
const boost::filesystem::path &logDir,
const std::string &title );
private:
! bool writeAST( const std::string &source,
HTMLWriter &writer );
};
Index: Main.cpp
===================================================================
RCS file: /cvsroot/cpptool/rfta/src/astdumper/Main.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Main.cpp 30 Apr 2003 22:14:50 -0000 1.3
--- Main.cpp 1 May 2003 09:08:09 -0000 1.4
***************
*** 59,63 ****
Refactoring::ASTDumper dumper;
! dumper.dump( source, outputPath, path.string() );
}
catch ( std::exception &e )
--- 59,63 ----
Refactoring::ASTDumper dumper;
! return dumper.dump( source, outputPath, path.string() ) ? 0 : 2;
}
catch ( std::exception &e )
***************
*** 70,74 ****
}
}
-
- return 0;
}
--- 70,72 ----
|