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

SCM Repository

[diderot] Diff of /branches/pure-cfg/src/compiler/c-target/c-target.sml
ViewVC logotype

Diff of /branches/pure-cfg/src/compiler/c-target/c-target.sml

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

revision 526, Sat Feb 12 23:17:46 2011 UTC revision 527, Sun Feb 13 02:08:31 2011 UTC
# Line 20  Line 20 
20        | T_Image of int          (* n-dimensional image data *)        | T_Image of int          (* n-dimensional image data *)
21        | T_Data                  (* pointer to image data *)        | T_Data                  (* pointer to image data *)
22    
     type program = CL.decl list  
   
23      type strand = unit (* FIXME *)      type strand = unit (* FIXME *)
24    
25      type var = (ty * string) (* FIXME *)      type var = (ty * string) (* FIXME *)
# Line 32  Line 30 
30    
31      type method = unit (* FIXME *)      type method = unit (* FIXME *)
32    
33        datatype program = Prog of {
34            globals : CL.decl list ref,
35            strands : strand list ref
36          }
37    
38        fun newProgram () = Prog{
39                globals = ref [],
40                strands = ref []
41              }
42    
43    (* globals that specify the target characteristics.  These should be initialized    (* globals that specify the target characteristics.  These should be initialized
44     * when the program object is created.     * when the program object is created.
45     *)     *)
# Line 242  Line 250 
250          fun stabilize () = raise Fail "FIXME: Stmt.die"          fun stabilize () = raise Fail "FIXME: Stmt.die"
251        end        end
252    
253        fun generate (baseName, Prog{globals, strands}) = let
254              val fileName = OS.Path.joinBaseExt{base=baseName, ext=SOME "c"}
255              val outS = TextIO.openOut fileName
256              val ppStrm = PrintAsC.new outS
257              in
258                List.app (fn dcl => PrintAsC.output(ppStrm, dcl)) (!globals);
259    (* what about the strands, etc? *)
260                PrintAsC.close ppStrm;
261                TextIO.closeOut outS
262              end
263    
264    end    end
265    
266  structure CBackEnd = CodeGenFn(CTarget)  structure CBackEnd = CodeGenFn(CTarget)

Legend:
Removed from v.526  
changed lines
  Added in v.527

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