Project

General

Profile

Revision 1411704e

View differences:

src/backends/EMF/EMF_backend.ml
26 26
    | Expr_access (a, d) -> fprintf fmt "%a[%a]" pp_expr a Dimension.pp_dimension d
27 27
    | Expr_power (a, d) -> fprintf fmt "(%a^%a)" pp_expr a Dimension.pp_dimension d
28 28
    | Expr_tuple el -> fprintf fmt "(%a)" pp_tuple el
29
    | Expr_ite (c, t, e) -> fprintf fmt "if %a; y=(%a); else y=(%a); end" pp_expr c pp_expr t pp_expr e
29
    | Expr_ite (c, t, e) -> fprintf fmt "if %a; %a; else %a; end" pp_expr c pp_expr t pp_expr e
30 30
    | Expr_arrow (e1, e2) ->(
31 31
      match e1.expr_desc, e2.expr_desc with
32 32
      | Expr_const c1, Expr_const c2 -> if c1 = Corelang.const_of_bool true && c2 = Corelang.const_of_bool false then fprintf fmt "STEP" else assert false (* only handle true -> false *)
......
62 62
    | "<=", Expr_tuple([e1;e2]) -> fprintf fmt "(%a <= %a)" pp_expr e1 pp_expr e2
63 63
    | ">", Expr_tuple([e1;e2]) -> fprintf fmt "(%a > %a)" pp_expr e1 pp_expr e2
64 64
    | ">=", Expr_tuple([e1;e2]) -> fprintf fmt "(%a >= %a)" pp_expr e1 pp_expr e2
65
    | "!=", Expr_tuple([e1;e2]) -> fprintf fmt "(%a ~= %a)" pp_expr e1 pp_expr e2
66
    | "=", Expr_tuple([e1;e2]) -> fprintf fmt "(%a == %a)" pp_expr e1 pp_expr e2
65
    | "!=", Expr_tuple([e1;e2]) -> fprintf fmt "(%a != %a)" pp_expr e1 pp_expr e2
66
    | "=", Expr_tuple([e1;e2]) -> fprintf fmt "(%a = %a)" pp_expr e1 pp_expr e2
67 67
    | "not", _ -> fprintf fmt "(~%a)" pp_expr e
68 68
    | _, Expr_tuple _ -> fprintf fmt "%s %a" id pp_expr e
69 69
    | _ -> fprintf fmt "%s (%a)" id pp_expr e
......
98 98
      [var] -> (
99 99
     (* first, we extract the expression and associated variables *)
100 100
	let vars = Utils.ISet.elements (Corelang.get_expr_vars eq.eq_rhs) in
101

  
101
	
102 102
	fprintf fmt "\"%s\": @[<v 2>{ \"expr\": \"%a\",@ \"vars\": [%a] @]}"
103 103
	  var
104 104
	  (pp_expr vars) eq.eq_rhs (* todo_pp_expr expr *)

Also available in: Unified diff