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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2612, Wed May 7 02:58:55 2014 UTC revision 2615, Wed May 14 00:22:49 2014 UTC
# Line 9  Line 9 
9    
10      in      in
11    
 val testing=0  
   
 val bV= ref 0  
12    
13  fun toStringRHS x  = (case DstIL.Var.binding x  fun toStringRHS x  = (case DstIL.Var.binding x
14      of vb => String.concat[      of vb => String.concat[
# Line 19  Line 16 
16      (* end case *))      (* end case *))
17    
18    
19  fun toStringAssgn(DstIL.ASSGN (x, DstIL.OP(opss,args)))=  fun toStringAssgn(DstIL.ASSGN (x,  A))=(case A
20         String.concat [(Var.toString x),"==",DstOp.toString opss," : ",(String.concatWith "," (List.map Var.toString args))]          of  DstIL.OP(opss,args)=> String.concat [(Var.toString x),"==",DstOp.toString opss,
21      | toStringAssgn(DstIL.ASSGN(x,DstIL.LIT _))= String.concat[Var.toString  x,"==...Lit"]              " : ",(String.concatWith "," (List.map Var.toString args))]
22      | toStringAssgn(DstIL.ASSGN(x,DstIL.CONS (_, varl)))= let          | DstIL.LIT _=> String.concat[Var.toString  x,"==...Lit"]
23               val y= List.map (fn e1=> Var.toString e1) varl          | DstIL.CONS (_, varl)=>  String.concat[(Var.toString  x),"==",
24              in String.concat[(Var.toString  x),"==",(String.concatWith "," y)] end              (String.concatWith "," (List.map (fn e1=> Var.toString e1) varl))]
25      | toStringAssgn(DstIL.ASSGN (x, _))=String.concat[Var.toString  x,"==","CONS",toStringRHS x]          |  _ => String.concat[Var.toString  x,"==","Etc",toStringRHS x]
26            (*end case*))
27        | toStringAssgn _ = raise Fail "Non-assignment operator"
28    
29    
 fun toStringTy(DstTy.IntTy )= "int "  
     | toStringTy(DstTy.TensorTy [])= "Real "  
     | toStringTy(DstTy.TensorTy(dd))=String.concat[  
     "TensorTy[", String.concatWith "," (List.map Int.toString dd), "] "]  
30    
31  fun toStringAll(ty,rator)=  fun toStringAll(ty,rator)=
32      String.concat([toStringTy ty,"\n", toStringAssgn rator] )      String.concat(["\n",DstTy.toString ty,"--", toStringAssgn rator] )
33      end      end
34    
35  end  end

Legend:
Removed from v.2612  
changed lines
  Added in v.2615

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