let main () =

  let (program, compile_only, output_name) = parse_cmd_args () in

  let ast = CfParserUtil.parse_program program CfLexer.token CfParser.file in
  let task = CfCompiler.compileApplication ast in

  if not compile_only then begin
    CfTypes.readyTask task;
    CfTypes.executeTasks ();

    CfTypes.checkAllPortsDetermined ();

    if Report.errorReported () then Report.fatal "Errors reported.  Exiting.";

    let channel = open_out output_name in
    Cf_fnf.output_fnf channel;
    close_out channel
  end;

  exit 0