{
if (output.isDirectory())
{
output = new File(output, source.getName());
}
BaseNode ast = parse(source);
if (ast == null)
{
return;
}
PrintStream out = new PrintStream(new FileOutputStream(output));
try
{
final Convert8To7Visitor converter = new Convert8To7Visitor();
if (_classpath != null)
{
converter.setClassPath(new ClassPath(_classpath));
}
ast.jjtAccept(converter, null);
ast.jjtAccept(new PrintSourceVisitor(), out);
}
finally
{
out.close();
}