-
- fun pp_stm (Assign (id,e)) =
- pp_ident id ^ " = " ^ pp_exp e ^ ";"
+ | pp_exp (Member(e, i)) = pp_exp e ^ "." ^ pp_ident i
+ | pp_exp (DerefMember(e, i)) = pp_exp e ^ "->" ^ pp_ident i
+ | pp_exp (Dereference(e)) = "*(" ^ pp_exp e ^ ")"
+ | pp_exp (ArrIndex(e1, e2)) = pp_exp e1 ^ "[" ^pp_exp e2 ^ "]"
+ | pp_exp (New t) = "new(" ^ Type.Print.pp_type t ^ ")"
+ | pp_exp (NewArr (t, s)) = "new(" ^ Type.Print.pp_type t ^ "[" ^ pp_exp s ^ "])"
+ | pp_exp Null = "NULL"
+ | pp_exp (Conditional (q, e1, e2)) = "("^(pp_exp q)^"?"^(pp_exp e1)^":"^(pp_exp e2)^")"
+
+ and pp_expl nil = ""
+ | pp_expl (e::a::l) = (pp_exp e) ^ ", " ^ (pp_expl (a::l))
+ | pp_expl (e::l) = (pp_exp e) ^ (pp_expl l)
+
+ and pp_stm (Assign (e1,e2)) =
+ pp_exp e1 ^ " = " ^ pp_exp e2 ^ ";\n"
+ | pp_stm (AsnOp (oop, e1, e2)) =
+ pp_exp e1 ^ " " ^ pp_oper oop ^ "= " ^ pp_exp e2 ^ ";\n"
+ | pp_stm (Effect (e)) =
+ pp_exp e ^ ";\n"