Project

General

Profile

« Previous | Next » 

Revision 9d3bcc89

Added by Pierre-Loïc Garoche 3 months ago

Adapted json-parser from stateflow tool to the new signatures

View differences:

src/tools/stateflow/json-parser/main_parse_json_file.ml
104 104
let json_parse _ file pp =
105 105
  try
106 106
    let prog = JParse.parse_prog (Yojson.Basic.from_file file) in
107
    if pp then
107
    if pp then (
108 108
      SF.pp_prog Format.std_formatter prog;
109

  
109
      exit 0
110
    );    
110 111
    let module Model =
111 112
	struct
112 113
	  let model = prog
......
130 131
    let module Sem = CPS.Semantics (T) (Model) in
131 132
    let prog = Sem.code_gen modularmode in
132 133
    let header = List.map Corelang.mktop [
133
      (LustreSpec.Open (false,"lustrec_math"));
134
      (LustreSpec.Open (false,"conv"));
135
      (LustreSpec.Open (true,"locallib"));
134
      (Lustre_types.Open (false,"lustrec_math"));
135
      (Lustre_types.Open (false,"conv"));
136
      (Lustre_types.Open (true,"locallib"));
136 137
    ]
137 138
    in
138 139
    let prog =header@prog in
......
144 145
    let auto_fmt = Format.formatter_of_out_channel auto_out in
145 146
    Format.fprintf auto_fmt "%a@." Printers.pp_prog prog;
146 147
    Format.eprintf "Print initial lustre model with automaton in sf_gen_test_auto.lus@.";
147
    
148
    let prog, deps = Compiler_stages.stage1 prog "" "" in
148

  
149
    let params = Backends.get_normalization_params () in
150
    let prog, deps = Compiler_stages.stage1 params prog "" "" "lus" in
149 151

  
150 152
    (* Format.printf "%a@." Printers.pp_prog prog; *)
151 153
    let noauto_file = "sf_gen_test_noauto.lus" in (* Could be changed *)

Also available in: Unified diff