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

SCM Repository

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

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

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

revision 4195, Wed Jul 13 03:26:15 2016 UTC revision 4196, Wed Jul 13 03:36:42 2016 UTC
# Line 80  Line 80 
80      * Orders EIN, normalizes it, then cleans the summation      * Orders EIN, normalizes it, then cleans the summation
81      *)      *)
82      fun doNormalize(e,args)=let      fun doNormalize(e,args)=let
83            val _ = print(String.concat["\n\n**do normalize:", P.printerE(e)])           (* val _ = print(String.concat["\n\n**do normalize:", P.printerE(e)])*)
84            val ordered = Order.orderfn e            val ordered = Order.orderfn e
85    
86            val (n, change) = NE.normalize(ordered,args)            val (n, change) = NE.normalize(ordered,args)
# Line 121  Line 121 
121     * Keeps track of the place of the argument in substitution.     * Keeps track of the place of the argument in substitution.
122     *)     *)
123      fun doRHS (lhs, IL.EINAPP (ein, args))=let      fun doRHS (lhs, IL.EINAPP (ein, args))=let
124            val _ = print(String.concat["\n\n**dorhs:", P.printerE(ein)])             (* val _ = print(String.concat["\n\n**dorhs:", P.printerE(ein)]) *)
125            fun rewrite(0,_,_, [], _)= NONE            fun rewrite(0,_,_, [], _)= NONE
126              | rewrite(_,orig,_, [], args')= SOME[(lhs,IL.EINAPP(doNormalize(orig,args'), args'))]              | rewrite(_,orig,_, [], args')= SOME[(lhs,IL.EINAPP(doNormalize(orig,args'), args'))]
127              | rewrite(change,orig, place, e::es,args')=(("\ncnt:";Int.toString(length(e::es)));(case (isEin e)              | rewrite(change,orig, place, e::es,args')=(("\ncnt:";Int.toString(length(e::es)));(case (isEin e)
128                   of NONE => rewrite(change,orig, place+1, es, args'@[e])                   of NONE => rewrite(change,orig, place+1, es, args'@[e])
129                    | SOME(IL.EINAPP (newE,newA)) => let                    | SOME(IL.EINAPP (newE,newA)) => let
130                      val _ = print(String.concat["\n\n**found newE:", P.printerE(newE)])                      (* val _ = print(String.concat["\n\n**found newE:", P.printerE(newE)])*)
131                        val Ein.EIN{params, index, body}=orig                        val Ein.EIN{params, index, body}=orig
132                        val (change',e',place',done')=foundEin(params,place,change,newE,newA,args',e,orig,lhs)                        val (change',e',place',done')=foundEin(params,place,change,newE,newA,args',e,orig,lhs)
133                        in rewrite(change',e',place',es,done')                        in rewrite(change',e',place',es,done')

Legend:
Removed from v.4195  
changed lines
  Added in v.4196

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