import java.io.*;
public class TestaGerador {
	public static void main(String[] args) throws Exception {
		Generator gerador = (Generator)Class.forName(args[0]).newInstance();
		PrintWriter out = new PrintWriter(new FileWriter(args[1]));
		gerador.template(out);
		out.close();
		compile(new String[] {args[1]});
	}
	
	public static void compile(String[] programas) {
		com.sun.tools.javac.Main.compile(programas);
	}
}
