Revision 9c654082
Added by Pierre-Loïc Garoche almost 7 years ago
src/tools/stateflow/json-parser/main_parse_json_file.ml | ||
---|---|---|
129 | 129 |
end) in |
130 | 130 |
let module Sem = CPS.Semantics (T) (Model) in |
131 | 131 |
let prog = Sem.code_gen modularmode in |
132 |
let header = List.map Corelang.mktop [ |
|
133 |
(LustreSpec.Open (false,"lustrec_math")); |
|
134 |
(LustreSpec.Open (false,"conv")); |
|
135 |
(LustreSpec.Open (true,"locallib")); |
|
136 |
] |
|
137 |
in |
|
138 |
let prog =header@prog in |
|
132 | 139 |
Options.print_dec_types := true; |
133 |
Format.printf "%a@." Printers.pp_prog prog;
|
|
140 |
(* Format.printf "%a@." Printers.pp_prog prog; *)
|
|
134 | 141 |
|
135 | 142 |
let auto_file = "sf_gen_test_auto.lus" in (* Could be changed *) |
136 | 143 |
let auto_out = open_out auto_file in |
137 | 144 |
let auto_fmt = Format.formatter_of_out_channel auto_out in |
138 | 145 |
Format.fprintf auto_fmt "%a@." Printers.pp_prog prog; |
139 |
|
|
140 |
let prog = (LustreSpec.Open ("math",false))::prog |
|
146 |
Format.eprintf "Print initial lustre model with automaton in sf_gen_test_auto.lus@."; |
|
147 |
|
|
141 | 148 |
let prog, deps = Compiler_stages.stage1 prog "" "" in |
142 | 149 |
|
143 |
Format.printf "%a@." Printers.pp_prog prog;
|
|
150 |
(* Format.printf "%a@." Printers.pp_prog prog; *)
|
|
144 | 151 |
let noauto_file = "sf_gen_test_noauto.lus" in (* Could be changed *) |
145 | 152 |
let noauto_out = open_out noauto_file in |
146 | 153 |
let noauto_fmt = Format.formatter_of_out_channel noauto_out in |
147 |
Format.fprintf noauto_fmt "%a@." Printers.pp_prog prog |
|
148 |
|
|
149 |
|
|
150 |
|
|
154 |
Format.fprintf noauto_fmt "%a@." Printers.pp_prog prog; |
|
155 |
Format.eprintf "Print expanded lustre model in sf_gen_test_noauto.lus@."; |
|
156 |
() |
|
151 | 157 |
|
152 | 158 |
with Parse.Error (l, err) -> Format.eprintf "Parse error at loc %a : %a@.@?" Location.pp_loc l Parse.pp_error err |
153 | 159 |
|
Also available in: Unified diff
[lustresf] work in progress. Added global env with initial values