Project

General

Profile

« Previous | Next » 

Revision 90cc3b8e

Added by LĂ©lio Brun over 3 years ago

some rewriting in C backend pretty-printer

View differences:

src/backends/C/c_backend_lusic.ml
1 1
open Lusic
2
open Utils.Format
2 3

  
3 4
let print_lusic_to_h basename extension =
4
let module HeaderMod = C_backend_header.EmptyMod in
5
let module Header = C_backend_header.Main (HeaderMod) in
5
  let module HeaderMod = C_backend_header.EmptyMod in
6
  let module Header = C_backend_header.Main (HeaderMod) in
6 7
  let lusic = read_lusic basename extension in
7 8
  let header_name = basename ^ ".h" in
8
  let h_out = open_out header_name in
9
  let h_fmt = Format.formatter_of_out_channel h_out in
10
  begin
11
    assert (not lusic.obsolete);
12
    (*Format.eprintf "lusic to h: %i items.@." (List.length lusic.contents);*)
13
    (* Typing.uneval_prog_generics lusic.contents;
9
  with_out_file header_name @@ fun h_fmt ->
10
  assert (not lusic.obsolete);
11
  (*Format.eprintf "lusic to h: %i items.@." (List.length lusic.contents);*)
12
  (* Typing.uneval_prog_generics lusic.contents;
14 13
     * Clock_calculus.uneval_prog_generics lusic.contents; *)
15
    Header.print_header_from_header h_fmt (Filename.basename basename) lusic.contents;
16
    close_out h_out
17
  end
18

  
14
  Header.print_header_from_header
15
    h_fmt
16
    (Filename.basename basename)
17
    lusic.contents

Also available in: Unified diff