Project

General

Profile

Revision 5c1184ad src/printers.ml

View differences:

src/printers.ml
185 185
      (fprintf_list ~sep:"@ " (fun fmt cdecl ->
186 186
	fprintf fmt "%s = %a;"
187 187
	  cdecl.const_id pp_const cdecl.const_value)) clist)
188
  | Include s -> fprintf fmt "include %s" s
188
  | Open s -> fprintf fmt "open \"%s\"" s
189 189

  
190 190

  
191 191
let pp_prog fmt prog = 
......
200 200
    fprintf fmt "const %a@ " 
201 201
      (fprintf_list ~sep:"@ " (fun fmt cdecl ->
202 202
	pp_print_string fmt cdecl.const_id)) clist)
203
  | Include s -> fprintf fmt "include %s" s
204

  
203
  | Open s -> fprintf fmt "open \"%s\"" s
205 204

  
205
let pp_lusi fmt decl = 
206
  match decl.top_decl_desc with
207
  | Node nd ->  
208
    fprintf fmt 
209
      "@[<v>node %s (%a) returns (%a);@ @]@ "
210
      nd.node_id
211
      pp_node_args nd.node_inputs
212
      pp_node_args nd.node_outputs
213
  | ImportedNode _ | ImportedFun _ | Consts _ | Open _ -> ()
206 214

  
207 215
let pp_econst fmt c = 
208 216
  match c with
......
287 295
  ) fmt spec.behaviors;
288 296
  fprintf fmt "@]@ */@.";
289 297
  ()
298

  
299

  
300
let pp_lusi_header fmt filename prog =
301
  fprintf fmt "(* Generated Lustre Interface file from %s *)@." filename;
302
  fprintf fmt "(* generated by Lustre-C compiler version %s, %a *)@." Version.number pp_date (Unix.gmtime (Unix.time ()));
303
  fprintf fmt "(* feel free to mask some of the nodes by removing them from this file. *)@.@.";
304
  List.iter (fprintf fmt "%a@." pp_lusi) prog    
305
  
290 306
(* Local Variables: *)
291 307
(* compile-command:"make -C .." *)
292 308
(* End: *)

Also available in: Unified diff