Project

General

Profile

Revision 48a6309c src/backends/Ada/ada_backend.ml

View differences:

src/backends/Ada/ada_backend.ml
10 10
(********************************************************************)
11 11

  
12 12
open Format
13
open Machine_code_types
14

  
15
let gen_ada destname print suffix machine =
16
  let path = destname ^ machine.mname.node_id ^ suffix in
17
  let out = open_out path in
18
  let fmt = formatter_of_out_channel out in
19
  print fmt machine;
20
  close_out out;
21
  Log.report ~level:2 (fun fmt -> fprintf fmt "    .. %s generated @." path)
13 22

  
14 23
let translate_to_ada basename prog machines dependencies =
15 24
  let module Ads = Ada_backend_ads.Main in
16 25
  let module Adb = Ada_backend_adb.Main in
17 26
  let module Wrapper = Ada_backend_wrapper.Main in
18
  print_endline "Ada code generated!"
27

  
28
  let destname = !Options.dest_dir ^ "/" ^ basename in
29

  
30
  Log.report ~level:2 (fun fmt -> fprintf fmt "  .. Generating ads@,");
31

  
32
  List.iter (gen_ada destname Ads.print ".ads") machines;
33

  
34
  Log.report ~level:2 (fun fmt -> fprintf fmt "  .. Generating adb@,");
35

  
36
  List.iter (gen_ada destname Adb.print ".adb") machines
19 37

  
20 38
(* Local Variables: *)
21 39
(* compile-command:"make -C ../../.." *)

Also available in: Unified diff