Project

General

Profile

« Previous | Next » 

Revision d1b9423d

Added by David Doose almost 5 years ago

mauve generator: first shot

View differences:

src/backends/C/c_backend.ml
10 10
(********************************************************************)
11 11

  
12 12
open Format
13
open C_backend_mauve
13 14
(********************************************************************************************)
14 15
(*                         Translation function                                             *)
15 16
(********************************************************************************************)
......
65 66
    end
66 67
  ));
67 68

  
69
  (match !Options.mauve with
70
  | "" ->  ()
71
  | mauve -> (
72
    (* looking for the main node *)
73
    match Machine_code.get_machine_opt mauve machines with
74
    | None -> begin
75
      Global.main_node := mauve;
76
      Format.eprintf "Code generation error: %a@." Corelang.pp_error LustreSpec.Main_not_found;
77
      raise (Corelang.Error (Location.dummy_loc, LustreSpec.Main_not_found))
78
    end
79
    | Some m -> begin
80
      let source_mauve_file = destname ^ "_mauve.hpp" in
81
      let source_mauve_out = open_out source_mauve_file in
82
      let source_mauve_fmt = formatter_of_out_channel source_mauve_out in
83
      (* Header *)
84
      print_mauve_header source_mauve_fmt m basename prog machines dependencies;
85
      (* Shell *)
86
      print_mauve_shell source_mauve_fmt m basename prog machines dependencies;
87
      (* Core *)
88
      print_mauve_core source_mauve_fmt m basename prog machines dependencies;
89
      (* FSM *)
90
      print_mauve_fsm source_mauve_fmt m basename prog machines dependencies;
91

  
92
      close_out source_mauve_out;
93
    end
94
  ));
95

  
68 96

  
69 97
  (* Makefiles:
70 98
     - for the moment two cases

Also available in: Unified diff