/*
* Created on 2005/05/18
*
* For WitMate project
*/
package witmate.tools;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import witmate.slcompiler.Compiler;
/**
* A tool translate SLML file to wit stream file.
*
* @author Witmate
*
*/
public class SL2SLML extends EndUserTool{
public static void main(String[] args) {
initLog4j();
if(2>args.length){
System.out.println("Usage: " +
"java -cp .\\sl2slml.jar;..\\WitCore\\wittools.jar;..\\WitCore\\witcore-all.jar;.\\lib\\log4j-1.2.9.jar witmate.tools.SL2SLML <input SL file name> <output SLML file name>");
//A test usage: java -cp .\\sl2slml.jar;..\\WitCore\\wittools.jar;..\\WitCore\\witcore-all.jar;.\\lib\\log4j-1.2.9.jar witmate.tools.SLML2WS test-data\simple.slml c:\temp\simple.ws
}else{
try {
FileReader fr=new FileReader(args[0]);
File f=new File(args[1]);
if(!f.exists()){
f.createNewFile();
}else{
f.delete();
}
FileWriter fw=new FileWriter(args[1]);
/*
witmate.kernel.Logger.openProcLog();
witmate.kernel.Logger.openCompareLog();
witmate.kernel.Logger.openComputeLog();
*/
Compiler compiler=new Compiler();
compiler.compile(fr, fw, null);
fw.flush();
fw.close();
System.out.println("Finished.");
} catch (Exception e) {
e.printStackTrace();
}
}
}
}