Ignore:
Timestamp:
Mar 2, 2011, 3:27:41 PM (9 years ago)
Author:
ayache
Message:

Update of D2.2 from Paris.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D2.2/8051/src/acc.ml

    r486 r619  
    2222*)
    2323let process filename =
    24   let _ = Printf.eprintf "Processing %s :\n" filename in
    25   let src_language = Options.get_source_language () in
    26   let tgt_language = Options.get_target_language () in
    27   let input_ast    = Languages.parse src_language filename in
    28   let input_ast    = Languages.labelize input_ast in
     24  let _ = Printf.eprintf "Processing %s.\n%!" filename in
     25  let src_language    = Options.get_source_language () in
     26  let tgt_language    = Options.get_target_language () in
     27  let input_ast       = Languages.parse src_language filename in
     28  let input_ast       = Languages.labelize input_ast in
     29  let (exact_output, output_filename) = match Options.get_output_files () with
     30    | None -> (false, filename)
     31    | Some filename' -> (true, filename') in
     32  let save = Languages.save exact_output output_filename in
    2933  let target_asts =
    3034    (** If debugging is enabled, the compilation function returns all
     
    3438  in
    3539  let final_ast, intermediate_asts = Misc.ListExt.cut_last target_asts in
    36     Languages.save filename final_ast;
     40    save final_ast;
    3741    (if Options.annotation_requested () then
    38        let annotated_input_ast = Languages.annotate input_ast final_ast in
    39        Languages.save filename annotated_input_ast);
     42       let (annotated_input_ast, cost_incr) =
     43         Languages.annotate input_ast final_ast in
     44       save annotated_input_ast;
     45       Languages.save_cost_incr output_filename cost_incr);
    4046    (if Options.is_debug_enabled () then
    41       List.iter (Languages.save filename) intermediate_asts);
     47      List.iter save intermediate_asts);
    4248    if Options.interpretation_requested () || Options.is_debug_enabled () then
    4349      begin
    4450        let asts = input_ast :: target_asts in
    45         let label_traces = List.map Languages.interpret asts in
    46           Printf.eprintf "Checking execution traces...";
    47           Checker.same_traces (List.combine asts label_traces);
    48           Printf.eprintf "OK.\n%!";
     51        let print_result = Options.is_print_result_enabled () in
     52        let label_traces = List.map (Languages.interpret print_result) asts in
     53        Printf.eprintf "Checking execution traces...%!";
     54        Checker.same_traces (List.combine asts label_traces);
     55        Printf.eprintf "OK.\n%!";
    4956      end
    5057
    5158let _ =
    5259  if Options.is_dev_test_enabled () then Dev_test.do_dev_test input_files
    53   else List.iter process input_files
     60  else List.iter process input_files 
Note: See TracChangeset for help on using the changeset viewer.