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

SCM Repository

[diderot] Diff of /branches/charisee/src/compiler/ein/printer.sml
ViewVC logotype

Diff of /branches/charisee/src/compiler/ein/printer.sml

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

revision 2844, Tue Dec 9 18:05:29 2014 UTC revision 2845, Fri Dec 12 06:46:23 2014 UTC
# Line 1  Line 1 
   
1  (*printer Function returns String*)  (*printer Function returns String*)
2  structure Printer = struct  structure Printer = struct
3    
# Line 10  Line 9 
9    
10      fun iTos e=Int.toString e      fun iTos e=Int.toString e
11      fun intList l = String.concatWith "," (List.map iTos l)      fun intList l = String.concatWith "," (List.map iTos l)
   
12      fun handleIndex e= (case e      fun handleIndex e= (case e
13          of E.C(cx)=> String.concat["'",iTos(cx),"'"]          of E.C(cx)=> String.concat["'",iTos(cx),"'"]
14          |  E.V(ix)=> iTos(ix)          |  E.V(ix)=> iTos(ix)
15      (*end case*))      (*end case*))
   
16      fun handleAlpha alpha= String.concat[String.concatWith "," (List.map handleIndex alpha)]      fun handleAlpha alpha= String.concat[String.concatWith "," (List.map handleIndex alpha)]
17      fun handleBeta(a,b)=String.concat["δ_(",handleIndex a, ",", handleIndex b,")"]      fun handleBeta(a,b)=String.concat["δ_(",handleIndex a, ",", handleIndex b,")"]
18      fun handleSumRange (mu,lb,ub)= String.concat[(handleIndex mu),"[",iTos(lb),"-",iTos(ub),"]"]      fun handleSumRange (mu,lb,ub)= String.concat[(handleIndex mu),"[",iTos(lb),"-",iTos(ub),"]"]
# Line 55  Line 52 
52                  " DIM:", iTos dim, ")", Index(i,count+1)]                  " DIM:", iTos dim, ")", Index(i,count+1)]
53              | Index (_, count) = ""              | Index (_, count) = ""
54          fun Param(E.TEN(t,shape)::param, i)=          fun Param(E.TEN(t,shape)::param, i)=
55                  String.concat[iTos(i), ":TEN", iTos t," ", intList shape," --",Param(param, i+1)]                  String.concat[iTos(i), ":TEN "(*, iTos t*),"<", intList shape,">, ",Param(param, i+1)]
56              | Param(E.FLD(d)::param, i)= String.concat[iTos(i), ":FLD-", iTos d," ",Param(param, i+1)]              | Param(E.FLD(d)::param, i)= String.concat[iTos(i), ":FLD(", iTos d,"), ",Param(param, i+1)]
57               | Param(E.IMG(d,shape)::param, i)= String.concat[iTos(i), ":IMG-Dimension", iTos d,"< ",              | Param(E.IMG(d,shape)::param, i)= String.concat[iTos(i), ":IMG(", iTos d,")< ",
58                          (intList shape),  ">",Param(param, i+1)]                          (intList shape),  ">, ",Param(param, i+1)]
59              | Param(E.KRN::param, i)= String.concat[iTos(i), ":KRN ",Param(param, i+1)]              | Param(E.KRN::param, i)= String.concat[iTos(i), ":KRN ",Param(param, i+1)]
60              | Param(_,_)=""              | Param(_,_)=""
61    

Legend:
Removed from v.2844  
changed lines
  Added in v.2845

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