1 2 package SOFA.SOFAnode.Made.CDL; 3 import java.io.File ; 4 5 6 public class Main { 7 8 static class GCThread extends Thread { 9 public void run() { 10 System.gc(); 11 try { 12 Thread.sleep(1000); 13 } catch (Exception e) {;} 14 } 15 } 16 17 private static File [] testArgv(String [] argv) { 18 int i, n = 0; 19 File [] f = new File [argv.length]; 20 for(i=0; i<argv.length; i++) { 21 f[n] = new File (argv[i]); 22 if (f[n].exists()) 23 n++; 24 else 25 Output.out.println("File "+argv[i]+" doesn't exist."); 26 } 27 File [] ret = new File [n]; 28 for (i=0; i<n; i++) { 29 ret[i] = f[i]; 30 } 31 return ret; 32 } 33 34 public static void main(String [] argv) { 35 try { 36 41 Output.setOut(new ConsoleLogger()); 42 System.setSecurityManager(new java.rmi.RMISecurityManager ()); 43 44 File [] f = testArgv(argv); 45 if (f.length == 0) { 46 Output.out.println("No file to compile"); 47 System.exit(1); 48 } 49 parser.run(f); 50 } catch (Exception e) { 51 Output.out.println("Exception: "+e.getMessage()); 52 e.printStackTrace(); 53 } catch (Error e) { 54 Output.out.println("Error: "+e.getMessage()); 55 e.printStackTrace(); 56 } 57 } 58 } 59 | Popular Tags |