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

SCM Repository

[diderot] Diff of /branches/charisee_dev/src/compiler/high-to-mid/handleEin.sml
ViewVC logotype

Diff of /branches/charisee_dev/src/compiler/high-to-mid/handleEin.sml

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

revision 3324, Tue Oct 20 05:22:52 2015 UTC revision 3355, Thu Oct 29 22:08:40 2015 UTC
# Line 1  Line 1 
1  (* Expands probe ein  (* Expands probe ein
2   *   *
3   * COPYRIGHT (c) 2012 The Diderot Project (http://diderot-language.cs.uchicago.edu)   * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
4     *
5     * COPYRIGHT (c) 2015 The University of Chicago
6   * All rights reserved.   * All rights reserved.
7   *)   *)
8    
# Line 12  Line 14 
14      structure DstIL = MidIL      structure DstIL = MidIL
15      structure P=Printer      structure P=Printer
16      structure MidToS=MidToString      structure MidToS=MidToString
17        structure L=LiftEin
18      in      in
19    
20      val testinitial=0      val testinitial=0
# Line 26  Line 29 
29      fun toStringBind e= MidToS.toStringBind e      fun toStringBind e= MidToS.toStringBind e
30      fun useCount (HighIL.V{useCnt, ...}) = !useCnt      fun useCount (HighIL.V{useCnt, ...}) = !useCnt
31      fun expandEinOp (srcy,bind00)=let      fun expandEinOp (srcy,bind00)=let
32          (*val _ = Lift.testLeft 1*)          (*val _=raise Fail"development branch- do not use"*)
   
33          val star="************"          val star="************"
34            val _=("\n Start"^star)
35          val _ =test0[star,"\n Original EinApp",star,"\n\n","start get test",toStringBind bind00]          val _ =test0[star,"\n Original EinApp",star,"\n\n","start get test",toStringBind bind00]
36          val (y,einapp as DstIL.EINAPP(Ein.EIN{params, index, body},args))=bind00          val (y,einapp as DstIL.EINAPP(Ein.EIN{params, index, body},args))=bind00
37    
# Line 43  Line 46 
46          val bind3 = (y,DstIL.EINAPP(SummationEin.main ein1,args))          val bind3 = (y,DstIL.EINAPP(SummationEin.main ein1,args))
47          val _ =testp["\n\n summation \n\n =>", toStringBind bind3]          val _ =testp["\n\n summation \n\n =>", toStringBind bind3]
48    
49    (*
50        (* **************** lift field phase ************* *)
51    
52             val (einapp1,e2)=L.testLift  bind3
53            val newbies5=  Split.iterAll2(einapp1,e2)
54            val n =length(newbies5)
55            val _ = if (n > 10) then print("\n **** SPLIT Length"^(Int.toString(n))) else print ""
56    
57    *)
58    
59          (* **************** split phase ************* *)          (* **************** split phase ************* *)
60          val (newbies5)= Split.splitEinApp bind3  
61            val (newbies5)= Split.splitEinApp(bind3,9)
62          val _ =test0["\n\n Returning \n\n =>",          val _ =test0["\n\n Returning \n\n =>",
63              String.concatWith",\n\t"(List.map toStringBind newbies5)]              String.concatWith",\n\t"(List.map toStringBind newbies5)]
64    
65    
66           (* ************** ProbeEIN *********** *)           (* ************** ProbeEIN *********** *)
         (*val code=List.map (fn e=>ProbeEin.expandEinOp e) (newbies5)*)  
   
67          (*gives probeEIN the set. Could split into a sepearate step*)          (*gives probeEIN the set. Could split into a sepearate step*)
68          val fieldset= einSet.EinSet.empty          val fieldset= einSet.EinSet.empty
69          val isField = ref 0          val isField = ref 0
# Line 80  Line 92 
92    
93          val flatcode= List.foldr op@ [] code          val flatcode= List.foldr op@ [] code
94          (*val _=List.map (fn(_,DstIL.EINAPP(e,_))=>checkEin.checkEIN e | _=> 1) flatcode*)          (*val _=List.map (fn(_,DstIL.EINAPP(e,_))=>checkEin.checkEIN e | _=> 1) flatcode*)
95            val _=(star^"end")
96          in          in
97              List.map (fn (y,rator)=> DstIL.ASSGN(y,rator)) flatcode              List.map (fn (y,rator)=> DstIL.ASSGN(y,rator)) flatcode
98          end          end

Legend:
Removed from v.3324  
changed lines
  Added in v.3355

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