structure toStringEin = struct local structure DstIL = LowIL structure DstTy = LowILTypes structure DstOp = LowOps structure Var = LowIL.Var structure E = Ein in fun toStringRHS x = (case DstIL.Var.binding x of vb => String.concat[ "\n Found ", DstIL.vbToString vb,"\n"] (* end case *)) fun toStringAssgn(DstIL.ASSGN (x, A))=(case A of DstIL.OP(opss,args)=> String.concat [(Var.toString x),"==",DstOp.toString opss, " : ",(String.concatWith "," (List.map Var.toString args))] | DstIL.LIT(Literal.Int d)=> String.concat[Var.toString x,"==...Literal",IntInf.toString( d)] | DstIL.CONS (ty, vars)=> String.concat[(Var.toString x),"== Type:",DstTy.toString ty,"--", (String.concatWith "," (List.map (fn e1=> Var.toString e1) vars))] | _ => String.concat[Var.toString x,"==","Etc",toStringRHS x] (*end case*)) | toStringAssgn _ = raise Fail "Non-assignment operator" fun toStringAll(ty,rator)= String.concat(["\n",DstTy.toString ty,"--", toStringAssgn rator] ) end end