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

SCM Repository

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

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

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

revision 2506, Fri Nov 8 00:05:57 2013 UTC revision 2518, Tue Dec 17 00:04:37 2013 UTC
# Line 18  Line 18 
18  fun handleAlpha alpha= String.concat[String.concatWith "," (List.map handleIndex alpha)]  fun handleAlpha alpha= String.concat[String.concatWith "," (List.map handleIndex alpha)]
19    
20    
21  fun handleBeta(a,b)=String.concat["Delta_(",handleIndex a, ",", handleIndex b,")"]  fun handleBeta(a,b)=String.concat["δ_(",handleIndex a, ",", handleIndex b,")"]
22    
23  fun handleSumRange (mu,lb,ub)= String.concat[(handleIndex mu),"[",Int.toString(lb),"-",Int.toString(ub),"]"]  fun handleSumRange (mu,lb,ub)= String.concat[(handleIndex mu),"[",Int.toString(lb),"-",Int.toString(ub),"]"]
24    
# Line 33  Line 33 
33      | E.Delta(ix) =>  handleBeta ix      | E.Delta(ix) =>  handleBeta ix
34      | E.Value(ix)=> String.concat["_",Int.toString(ix),"_"]      | E.Value(ix)=> String.concat["_",Int.toString(ix),"_"]
35      | E.Epsilon(ix, jx, kx) => String.concat["E_",Int.toString(ix), Int.toString(jx), Int.toString(kx)]      | E.Epsilon(ix, jx, kx) => String.concat["E_",Int.toString(ix), Int.toString(jx), Int.toString(kx)]
36      | E.Sum (sumindex,e1)=>String.concat["Σ_",String.concatWith ","(List.map handleSumRange sumindex)," (", printbody e1,")"]      | E.Sum (sumindex,e1)=>String.concat["\n Σ_",String.concatWith ","(List.map handleSumRange sumindex)," (", printbody e1,")"]
37      | E.Neg e1 => String.concat["-", printbody e1]      | E.Neg e1 => String.concat["-", printbody e1]
38      | E.Add el => String.concat["(",String.concatWith "+" (List.map printbody el),")"]      | E.Add el => String.concat["(",String.concatWith "+" (List.map printbody el),")"]
39      | E.Sub(e1, e2) => String.concat ["(",printbody(e1),"- ",printbody(e2), ")"]      | E.Sub(e1, e2) => String.concat ["(",printbody(e1),"- ",printbody(e2), ")"]
# Line 44  Line 44 
44      | E.Conv(fid,alpha, tid ,[])=> String.concat["|V",Int.toString(fid),"_{",handleAlpha alpha, "}★h",Int.toString(tid),"|"]      | E.Conv(fid,alpha, tid ,[])=> String.concat["|V",Int.toString(fid),"_{",handleAlpha alpha, "}★h",Int.toString(tid),"|"]
45      | E.Conv(fid,alpha, tid, beta)=> String.concat["|V",Int.toString(fid),"_{",handleAlpha alpha, "}★d/dx_{",handleAlpha beta,"}h",Int.toString(tid),"|"]      | E.Conv(fid,alpha, tid, beta)=> String.concat["|V",Int.toString(fid),"_{",handleAlpha alpha, "}★d/dx_{",handleAlpha beta,"}h",Int.toString(tid),"|"]
46      | E.Probe (e1,e2)=> String.concat ["",printbody(e1), "","[", printbody(e2),"]"]      | E.Probe (e1,e2)=> String.concat ["",printbody(e1), "","[", printbody(e2),"]"]
47      | E.Img (fid,alpha,pos)=> String.concat ["V", Int.toString(fid),"_",handleAlpha alpha,"[",      | E.Img (fid,alpha,pos)=> String.concat ["\n V", Int.toString(fid),"_",handleAlpha alpha,"[",
48                  (String.concatWith "," (List.map printbody pos)),"]"]                  (String.concatWith "," (List.map printbody pos)),"]\n"]
49    
50    
51    
# Line 56  Line 56 
56              | Index (_, count) = ""              | Index (_, count) = ""
57          fun Param(E.TEN::param, i)=String.concat[Int.toString(i), ":TEN ", Param(param, i+1)]          fun Param(E.TEN::param, i)=String.concat[Int.toString(i), ":TEN ", Param(param, i+1)]
58              | Param(E.FLD(d)::param, i)= String.concat[Int.toString(i), ":FLD-", Int.toString d," ",Param(param, i+1)]              | Param(E.FLD(d)::param, i)= String.concat[Int.toString(i), ":FLD-", Int.toString d," ",Param(param, i+1)]
59                   | Param(E.IMG(d)::param, i)= String.concat[Int.toString(i), ":IMG-", Int.toString d," ",Param(param, i+1)]
60                   | Param(E.KRN::param, i)= String.concat[Int.toString(i), ":KRN ",Param(param, i+1)]
61              | Param(_,_)=""              | Param(_,_)=""
62    
63          val str=String.concat ["\n\t" ,Param(params, 0)," <",printbody(body),">"," _{",Index(index,0),"}  "]          val str=String.concat ["" ,Param(params, 0)," <",printbody(body),">"," _{",Index(index,0),"}  "]
64          in          in
65              str              str
66          end          end

Legend:
Removed from v.2506  
changed lines
  Added in v.2518

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