Project

General

Profile

« Previous | Next » 

Revision a7062da6

Added by LĂ©lio Brun over 3 years ago

another step towards refactoring

View differences:

src/backends/Ada/ada_backend.ml
114 114
    @param basename name of the lustre file @param prog list of machines to
115 115
    translate **)
116 116
let translate_to_ada basename machines =
117
  let module Ads = Ada_backend_ads.Main in
118
  let module Adb = Ada_backend_adb.Main in
119
  let module Wrapper = Ada_backend_wrapper.Main in
117
  (* let module Ads = Ada_backend_ads.Main in
118
   * let module Adb = Ada_backend_adb.Main in
119
   * let module Wrapper = Ada_backend_wrapper.Main in *)
120 120
  let is_real_machine m =
121 121
    match m.mspec.mnode_spec with Some (Contract _) -> false | _ -> true
122 122
  in
......
145 145
    | main_node -> (
146 146
      match Machine_code_common.get_machine_opt filtered_machines main_node with
147 147
      | None ->
148
        Format.eprintf "Ada Code generation error: %a@." Error.pp_error_msg
148
        Format.eprintf "Ada Code generation error: %a@." Error.pp
149 149
          Error.Main_not_found;
150
        raise (Error.Error (Location.dummy_loc, Error.Main_not_found))
150
        raise (Error.Error (Location.dummy, Error.Main_not_found))
151 151
      | Some m ->
152 152
        Some m)
153 153
  in
......
158 158
  List.iter check machines;
159 159

  
160 160
  log_str_level_two 1 "Generating ads";
161
  List.iter (write_file destname (_pp_filename "ads") Ads.pp_file) _machines;
161
  List.iter (write_file destname (_pp_filename "ads") Ada_backend_ads.pp_file) _machines;
162 162

  
163 163
  log_str_level_two 1 "Generating adb";
164
  List.iter (write_file destname (_pp_filename "adb") Adb.pp_file) _machines;
164
  List.iter (write_file destname (_pp_filename "adb") Ada_backend_adb.pp_file) _machines;
165 165

  
166 166
  (* If a main node is given we generate a main adb file and a project file *)
167 167
  log_str_level_two 1 "Generating wrapper files";
......
169 169
  | None ->
170 170
    ()
171 171
  | Some machine ->
172
    write_file destname pp_main_filename Wrapper.pp_main_adb
172
    write_file destname pp_main_filename Ada_backend_wrapper.pp_main_adb
173 173
      (*get_typed_submachines filtered_machines machine*)
174 174
      machine;
175 175
    write_file destname
176
      (fun fmt _ -> Wrapper.pp_project_name (basename ^ "_exe") fmt)
177
      (Wrapper.pp_project_file filtered_machines basename)
176
      (fun fmt _ -> Ada_backend_wrapper.pp_project_name (basename ^ "_exe") fmt)
177
      (Ada_backend_wrapper.pp_project_file filtered_machines basename)
178 178
      main_machine);
179
  write_file destname Wrapper.pp_project_configuration_name
180
    (fun fmt _ -> Wrapper.pp_project_configuration_file fmt)
179
  write_file destname Ada_backend_wrapper.pp_project_configuration_name
180
    (fun fmt _ -> Ada_backend_wrapper.pp_project_configuration_file fmt)
181 181
    basename;
182 182
  write_file destname
183
    (fun fmt _ -> Wrapper.pp_project_name (basename ^ "_lib") fmt)
184
    (Wrapper.pp_project_file filtered_machines basename)
183
    (fun fmt _ -> Ada_backend_wrapper.pp_project_name (basename ^ "_lib") fmt)
184
    (Ada_backend_wrapper.pp_project_file filtered_machines basename)
185 185
    None
186 186

  
187 187
(* Local Variables: *)

Also available in: Unified diff