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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2612 - (view) (download)

1 : cchiw 2612 structure toStringEin = struct
2 :     local
3 :    
4 :     structure DstIL = LowIL
5 :     structure DstTy = LowILTypes
6 :     structure DstOp = LowOps
7 :     structure Var = LowIL.Var
8 :     structure E = Ein
9 :    
10 :     in
11 :    
12 :     val testing=0
13 :    
14 :     val bV= ref 0
15 :    
16 :     fun toStringRHS x = (case DstIL.Var.binding x
17 :     of vb => String.concat[
18 :     "\n Found ", DstIL.vbToString vb,"\n"]
19 :     (* end case *))
20 :    
21 :    
22 :     fun toStringAssgn(DstIL.ASSGN (x, DstIL.OP(opss,args)))=
23 :     String.concat [(Var.toString x),"==",DstOp.toString opss," : ",(String.concatWith "," (List.map Var.toString args))]
24 :     | toStringAssgn(DstIL.ASSGN(x,DstIL.LIT _))= String.concat[Var.toString x,"==...Lit"]
25 :     | toStringAssgn(DstIL.ASSGN(x,DstIL.CONS (_, varl)))= let
26 :     val y= List.map (fn e1=> Var.toString e1) varl
27 :     in String.concat[(Var.toString x),"==",(String.concatWith "," y)] end
28 :     | toStringAssgn(DstIL.ASSGN (x, _))=String.concat[Var.toString x,"==","CONS",toStringRHS x]
29 :    
30 :    
31 :     fun toStringTy(DstTy.IntTy )= "int "
32 :     | toStringTy(DstTy.TensorTy [])= "Real "
33 :     | toStringTy(DstTy.TensorTy(dd))=String.concat[
34 :     "TensorTy[", String.concatWith "," (List.map Int.toString dd), "] "]
35 :    
36 :     fun toStringAll(ty,rator)=
37 :     String.concat([toStringTy ty,"\n", toStringAssgn rator] )
38 :     end
39 :    
40 :     end

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