Project

General

Profile

Revision 70e1006b src/clock_calculus.ml

View differences:

src/clock_calculus.ml
832 832
  nd.nodei_clock <- ck_node;
833 833
  Env.add_value env nd.nodei_id ck_node
834 834

  
835
let clock_top_consts env clist =
836
  List.fold_left (fun env cdecl ->
837
    let ck = new_var false in
838
    try_generalize ck cdecl.const_loc;
839
    Env.add_value env cdecl.const_id ck) env clist
835
let clock_top_const env cdecl=
836
  let ck = new_var false in
837
  try_generalize ck cdecl.const_loc;
838
  Env.add_value env cdecl.const_id ck
840 839

  
841
let clock_top_decl env decl =
840
let clock_top_consts env clist =
841
  List.fold_left clock_top_const env clist
842
 
843
let rec clock_top_decl env decl =
842 844
  match decl.top_decl_desc with
843 845
  | Node nd ->
844 846
    clock_node env decl.top_decl_loc nd
845 847
  | ImportedNode nd ->
846 848
    clock_imported_node env decl.top_decl_loc nd
847
  | Consts clist ->
848
    clock_top_consts env clist
849
  | Open _
850
  | Type _ -> env
849
  | Const c ->
850
    clock_top_const env c
851
  | TypeDef _ -> List.fold_left clock_top_decl env (consts_of_enum_type decl)
852
  | Open _    -> env
851 853

  
852 854
let clock_prog env decls =
853
  List.fold_left (fun e decl -> clock_top_decl e decl) env decls
855
  List.fold_left clock_top_decl env decls
854 856

  
855 857
(* Once the Lustre program is fully clocked,
856 858
   we must get back to the original description of clocks,
......
878 880
      uneval_node_generics (nd.node_inputs @ nd.node_locals @ nd.node_outputs)
879 881
  | ImportedNode nd ->
880 882
      uneval_node_generics (nd.nodei_inputs @ nd.nodei_outputs)
881
  | Consts _
883
  | Const _
882 884
  | Open _
883
  | Type _   -> ()
885
  | TypeDef _ -> ()
884 886

  
885 887
let uneval_prog_generics prog =
886 888
 List.iter uneval_top_generics prog

Also available in: Unified diff