Project

General

Profile

Revision 3de9f6e4 src/backends/Ada/ada_backend.ml

View differences:

src/backends/Ada/ada_backend.ml
71 71
let pp_project_name fmt main_machine =
72 72
  fprintf fmt "%a.gpr" pp_package_name main_machine
73 73

  
74

  
75
let get_typed_instances machines m =
76
  let submachines = List.map (get_machine machines) m.minstances in
77
  List.map2
78
    (fun instance submachine ->
79
      let ident = (fst instance) in
80
      ident, (get_substitution m ident submachine, submachine))
81
    m.minstances submachines
82

  
74 83
(** Main function of the Ada backend. It calls all the subfunction creating all
75 84
the file and fill them with Ada code representing the machines list given.
76 85
   @param basename useless
......
83 92
  let module Adb = Ada_backend_adb.Main in
84 93
  let module Wrapper = Ada_backend_wrapper.Main in
85 94

  
95
  let typed_instances_machines =
96
    List.map (get_typed_instances machines) machines in
97

  
98
  let _machines = List.combine typed_instances_machines machines in
99

  
100
  let _pp_filename ext fmt (typed_instances, machine) =
101
    pp_machine_filename ext fmt machine in
102

  
86 103
  (* Extract the main machine if there is one *)
87 104
  let main_machine = (match !Options.main_node with
88 105
  | "" -> None
......
101 118
  List.iter check machines;
102 119

  
103 120
  log_str_level_two 1 "Generating ads";
104
  List.iter (write_file destname (pp_machine_filename "ads") (Ads.pp_file machines) ) machines;
121
  List.iter (write_file destname (_pp_filename "ads") Ads.pp_file) _machines;
105 122

  
106 123
  log_str_level_two 1 "Generating adb";
107
  List.iter (write_file destname (pp_machine_filename "adb") (Adb.pp_file machines)) machines;
124
  List.iter (write_file destname (_pp_filename "adb") Adb.pp_file) _machines;
108 125

  
109 126
  (* If a main node is given we generate a main adb file and a project file *)
110 127
  log_str_level_two 1 "Generating wrapper files";

Also available in: Unified diff