package fortran2c; import java.io.*; import java.util.HashSet; public class CWriter { private String filePath; private File theFile; private FileWriter theFileWriter; private HashSet functions; public CWriter(String filePath) throws IOException { this.filePath = filePath; File theFile = new File(filePath); if (theFile.createNewFile()) { FileWriter theFileWriter = new FileWriter(filePath); theFileWriter.write("#include \n#include \n\nint main(int argc, char** argv) {\n}"); theFileWriter.close(); functions.add("main"); } else { throw new IOException("The file already exists"); } } }