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

SCM Repository

[diderot] Diff of /branches/charisee/src/compiler/high-il/normalize.sml
ViewVC logotype

Diff of /branches/charisee/src/compiler/high-il/normalize.sml

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

revision 2514, Thu Nov 21 16:27:12 2013 UTC revision 2515, Mon Dec 2 03:42:14 2013 UTC
# Line 18  Line 18 
18      structure ST = Stats      structure ST = Stats
19      structure NE = NormalizeEin      structure NE = NormalizeEin
20      structure P=Printer      structure P=Printer
21        structure Order=OrderEin
22    structure mk=mkOperators    structure mk=mkOperators
23      structure App=App      structure App=App
24    
# Line 94  Line 95 
95    
96    
97  fun doNormalize e=(let  fun doNormalize e=(let
98        val ordered=Order.orderfn(e)
99      val (n,change)=NE.normalize(e)      val (n,change)=NE.normalize(ordered)
100      in (case change      in (case change
101          of 0 =>e          of 0 =>e
102          | _ => let          | _ => let
103              val str=String.concat ["\n =>",P.printerE(n)]              val str=String.concat ["\n Ordered:\n",P.printerE(ordered),"\n =>",P.printerE(n)]
104              val p=print str              val p=print str
105              in  n              in  n
106              end              end
# Line 126  Line 127 
127                  | SOME(IL.EINAPP (e2,arg1))=>let                  | SOME(IL.EINAPP (e2,arg1))=>let
128                      val m= print(String.concat["\n Apply at ", Int.toString(place),":--",P.printerE(e2),                      val m= print(String.concat["\n Apply at ", Int.toString(place),":--",P.printerE(e2),
129                          "\n"])                          "\n"])
130                      val orig'=App.app(orig,place,e2)                      val (c,subst)=App.app(orig,place,e2)
131                      val m= print(String.concat["\n","Subst Result:\t", P.printerE(orig'), "\n"])                      val m= print(String.concat["\n","Subst Result:\t", P.printerE(subst), "\n"])
132    
133  in ( incUse lhs;decUse e;rewrite(1,orig', place+length(arg1), es,done@arg1)) end                      in (case c
134                            of 0 =>
135                               rewrite(1,subst, place+length(arg1), es,done@arg1)
136                           |_=> (incUse lhs;decUse e;rewrite(1,subst, place+length(arg1), es,done@arg1))) end
137              end              end
138    
139      val m= rewrite(0,ein, 0,args,[])      val m= rewrite(0,ein, 0,args,[])

Legend:
Removed from v.2514  
changed lines
  Added in v.2515

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