Project

General

Profile

Revision 3e1d20e0 src/corelang.ml

View differences:

src/corelang.ml
894 894
	  ed
895 895

  
896 896
  }
897
(* FAUT IL RETIRER ?
898 897
  
899 898
 let rec expr_to_eexpr  expr =
900 899
   { eexpr_tag = expr.expr_tag;
901
     eexpr_desc = expr_desc_to_eexpr_desc expr.expr_desc;
900
     eexpr_qfexpr = expr;
901
     eexpr_quantifiers = [];
902 902
     eexpr_type = expr.expr_type;
903 903
     eexpr_clock = expr.expr_clock;
904
     eexpr_loc = expr.expr_loc
904
     eexpr_loc = expr.expr_loc;
905
     eexpr_normalized = None
905 906
   }
906
 and expr_desc_to_eexpr_desc expr_desc =
907
   let conv = expr_to_eexpr in
908
   match expr_desc with
909
   | Expr_const c -> EExpr_const (match c with
910
     | Const_int x -> EConst_int x 
911
     | Const_real x -> EConst_real x 
912
     | Const_float x -> EConst_float x 
913
     | Const_tag x -> EConst_tag x 
914
     | _ -> assert false
915

  
916
   )
917
   | Expr_ident i -> EExpr_ident i
918
   | Expr_tuple el -> EExpr_tuple (List.map conv el)
919

  
920
   | Expr_arrow (e1, e2)-> EExpr_arrow (conv e1, conv e2) 
921
   | Expr_fby (e1, e2) -> EExpr_fby (conv e1, conv e2)
922
   | Expr_pre e' -> EExpr_pre (conv e')
923
   | Expr_appl (i, e', i') -> 
924
     EExpr_appl 
925
       (i, conv e', match i' with None -> None | Some(id, _) -> Some id)
926

  
927
   | Expr_when _
928
   | Expr_merge _ -> assert false
929
   | Expr_array _ 
930
   | Expr_access _ 
931
   | Expr_power _  -> assert false
932
   | Expr_ite (c, t, e) -> assert false 
933
   | _ -> assert false
934

  
935
     *)
907
 (* and expr_desc_to_eexpr_desc expr_desc = *)
908
 (*   let conv = expr_to_eexpr in *)
909
 (*   match expr_desc with *)
910
 (*   | Expr_const c -> EExpr_const (match c with *)
911
 (*     | Const_int x -> EConst_int x  *)
912
 (*     | Const_real x -> EConst_real x  *)
913
 (*     | Const_float x -> EConst_float x  *)
914
 (*     | Const_tag x -> EConst_tag x  *)
915
 (*     | _ -> assert false *)
916

  
917
 (*   ) *)
918
 (*   | Expr_ident i -> EExpr_ident i *)
919
 (*   | Expr_tuple el -> EExpr_tuple (List.map conv el) *)
920

  
921
 (*   | Expr_arrow (e1, e2)-> EExpr_arrow (conv e1, conv e2)  *)
922
 (*   | Expr_fby (e1, e2) -> EExpr_fby (conv e1, conv e2) *)
923
 (*   | Expr_pre e' -> EExpr_pre (conv e') *)
924
 (*   | Expr_appl (i, e', i') ->  *)
925
 (*     EExpr_appl  *)
926
 (*       (i, conv e', match i' with None -> None | Some(id, _) -> Some id) *)
927

  
928
 (*   | Expr_when _ *)
929
 (*   | Expr_merge _ -> assert false *)
930
 (*   | Expr_array _  *)
931
 (*   | Expr_access _  *)
932
 (*   | Expr_power _  -> assert false *)
933
 (*   | Expr_ite (c, t, e) -> assert false  *)
934
 (*   | _ -> assert false *)
935
      
936
     
936 937
let rec get_expr_calls nodes e =
937 938
  let get_calls = get_expr_calls nodes in
938 939
  match e.expr_desc with

Also available in: Unified diff