Project

General

Profile

« Previous | Next » 

Revision 69c96b6c

Added by Pierre-Loïc Garoche about 6 years ago

lustresf: Better construction of lustre ast. Still more work to be done.

View differences:

src/tools/stateflow/sf_sem.ml
3 3
type backend = GenLus | GenImp
4 4

  
5 5
(* Model choice *)
6
let model_name = ref "stopwatch" (*"simple"*)
6
let model_name = ref "simple"
7 7

  
8 8
let models = [(module Model_simple : Datatype.MODEL_T);
9 9
	      (module Model_stopwatch : Datatype.MODEL_T);
10
	      (module Model_medium : Datatype.MODEL_T)
10
	     (*  (module Model_medium : Datatype.MODEL_T)*)
11 11
	     ]
12 12
let get_model_name m = let module M = (val m : Datatype.MODEL_T) in M.name
13 13
let set_model name = 
......
56 56
    let module Model = (val model) in
57 57
    let module T = CPS_ccode_generator.CodeGenerator in
58 58
    let module Sem = CPS.Semantics (T) (Model) in
59
    Sem.code_gen Format.std_formatter modularmode
59
    let _ = Sem.code_gen modularmode in
60
    ()
60 61
  )				     
61 62
  | GenLus ->
62 63
     let module Model = (val model) in
......
68 69
       let global_vars = global_vars 
69 70
     end) in
70 71
     let module Sem = CPS.Semantics (T) (Model) in
71
     Sem.code_gen Format.std_formatter modularmode
72
     let prog = Sem.code_gen modularmode in
73

  
74
     Format.printf "%a@." Printers.pp_prog prog;
75

  
76
     let prog, deps = Main_lustre_compiler.stage1 prog "" "" in
77

  
78
     
79
     (* (\* Importing source *\) *)
80
     (* let _ = Modules.load_program Utils.ISet.empty prog in *)
81

  
82
     (* (\* Extracting dependencies *\) *)
83
     (* let dependencies, type_env, clock_env = Compiler_common.import_dependencies prog in *)
84

  
85

  
86
     (* (\* Typing *\) *)
87
     (* let computed_types_env = Compiler_common.type_decls type_env prog in *)
88
     
89
     (* (\* Clock calculus *\) *)
90
     (* let computed_clocks_env = Compiler_common.clock_decls clock_env prog in *)
91

  
92
     Format.printf "%a@." Printers.pp_prog prog
72 93

  
73 94

  
74 95
  

Also available in: Unified diff