Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /branches/charisee/src/compiler/mid-to-low/toString.sml
ViewVC logotype

View of /branches/charisee/src/compiler/mid-to-low/toString.sml

Parent Directory Parent Directory | Revision Log Revision Log

Revision 2624 - (download) (annotate)
Fri May 16 17:53:41 2014 UTC (6 years, 9 months ago) by cchiw
File size: 1073 byte(s)
moved target functions
structure toStringEin = struct

    structure DstIL = LowIL
    structure DstTy = LowILTypes
    structure DstOp = LowOps
    structure Var = LowIL.Var
    structure E = Ein


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 _=> String.concat[Var.toString  x,"==...Literal"]
        | 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] )


ViewVC Help
Powered by ViewVC 1.0.0