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 2669 - (download) (annotate)
Fri Jun 13 02:08:31 2014 UTC (6 years, 5 months ago) by cchiw
File size: 1106 byte(s)
represent tensors with arrays
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

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0