Project

General

Profile

Revision cda2fcc8

View differences:

src/main_lustre_testgen.ml
45 45

  
46 46
  (* Parsing source *)
47 47
  let prog = parse_source source_name in
48

  
49 48
  let prog, dependencies = Compiler_stages.stage1 prog dirname basename in
50 49

  
51 50
  (* Two cases
......
55 54
  
56 55
  if !Options.gen_mcdc then (
57 56
    let prog_mcdc = PathConditions.mcdc prog in
57
    (* We re-type the fresh equations *)
58 58
    let _, type_env, _ = import_dependencies prog_mcdc in
59

  
60 59
    let _ = type_decls type_env prog_mcdc in
61 60

  
62 61
    let destname = !Options.dest_dir ^ "/" ^ basename in
63
    let source_file = destname ^ ".mcdc.lus" in (* Could be changed *)
64
    let source_out = open_out source_file in
62
    let source_file = destname ^ ".mcdc" in (* Could be changed *)
63

  
64
    (* Modified Lustre is produced in fresh .lus file *)
65
    let source_lus = source_file ^ ".lus" in
66
    let source_out = open_out source_lus in
65 67
    let fmt = formatter_of_out_channel source_out in
66 68
    Printers.pp_prog fmt prog_mcdc;
67 69
    Format.fprintf fmt "@.@?";
70

  
71
    (* Prog is 
72
       (1) cleaned from initial equations TODO
73
       (2) produced as EMF
74
    *)
75
    Options.output := "emf";
76
    let prog_mcdc = Normalization.normalize_prog ~backend:"emf" prog_mcdc in
77
    let machine_code = Compiler_stages.stage2 prog_mcdc in
78
    let source_emf = source_file ^ ".emf" in 
79
    let source_out = open_out source_emf in
80
    let fmt = formatter_of_out_channel source_out in
81
    EMF_backend.translate fmt basename prog_mcdc machine_code;
82

  
68 83
    exit 0
69 84
  ) ;
70 85

  

Also available in: Unified diff