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 2669 - (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 :    
13 :     fun toStringRHS x = (case DstIL.Var.binding x
14 :     of vb => String.concat[
15 :     "\n Found ", DstIL.vbToString vb,"\n"]
16 :     (* end case *))
17 :    
18 :    
19 : cchiw 2615 fun toStringAssgn(DstIL.ASSGN (x, A))=(case A
20 :     of DstIL.OP(opss,args)=> String.concat [(Var.toString x),"==",DstOp.toString opss,
21 :     " : ",(String.concatWith "," (List.map Var.toString args))]
22 : cchiw 2669 | DstIL.LIT(Literal.Int d)=> String.concat[Var.toString x,"==...Literal",IntInf.toString( d)]
23 : cchiw 2624 | DstIL.CONS (ty, vars)=> String.concat[(Var.toString x),"== Type:",DstTy.toString ty,"--",
24 :     (String.concatWith "," (List.map (fn e1=> Var.toString e1) vars))]
25 : cchiw 2615 | _ => String.concat[Var.toString x,"==","Etc",toStringRHS x]
26 :     (*end case*))
27 :     | toStringAssgn _ = raise Fail "Non-assignment operator"
28 :    
29 : cchiw 2612
30 :    
31 :     fun toStringAll(ty,rator)=
32 : cchiw 2615 String.concat(["\n",DstTy.toString ty,"--", toStringAssgn rator] )
33 : cchiw 2612 end
34 :    
35 :     end

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