Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec / src / backends / Ada / ada_backend.ml @ 48a6309c

History | View | Annotate | Download (1.59 KB)

1
(********************************************************************)
2
(*                                                                  *)
3
(*  The LustreC compiler toolset   /  The LustreC Development Team  *)
4
(*  Copyright 2012 -    --   ONERA - CNRS - INPT - ISAE-SUPAERO     *)
5
(*                                                                  *)
6
(*  LustreC is free software, distributed WITHOUT ANY WARRANTY      *)
7
(*  under the terms of the GNU Lesser General Public License        *)
8
(*  version 2.1.                                                    *)
9
(*                                                                  *)
10
(********************************************************************)
11

    
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)
22

    
23
let translate_to_ada basename prog machines dependencies =
24
  let module Ads = Ada_backend_ads.Main in
25
  let module Adb = Ada_backend_adb.Main in
26
  let module Wrapper = Ada_backend_wrapper.Main in
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
37

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