public static void main(String args[]) {
    boolean debug = false;
    String programFile = null;
    if (args[0].charAt(0) == '-') {
      if (args[0].equals("-trace")) {
        debug = true;
      }
      programFile = args[1];
    }
    else {
      programFile = args[0];
    }
    FileInputStream in = null;
    try {
      File f = new File(programFile);
      if (f.exists()) {
        in = new FileInputStream(new File(programFile));
      }
      else {
        System.err.println("File does not exist!");
      }
    }
    catch (IOException e) {
      System.err.println("IO Exception reading source file");
      System.exit(1);
    }
    Engine engine = null;
    try {
      CruiseParser parser = new CruiseParser(in);
      engine = parser.program();
      engine.trace = debug;
    }
    catch (Exception e) {
      System.err.println("Parse error reading program: "+ e.getMessage());
      e.printStackTrace();
      System.exit(1);
    }

    try {
      engine.run();
    } catch (CruiseRuntimeException e) {
      System.err.println("Runtime error: "+ e);
    }

  }