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

SCM Repository

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

Diff of /branches/pure-cfg/src/compiler/codegen/codegen-fn.sml

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

revision 544, Wed Feb 16 23:14:14 2011 UTC revision 547, Thu Feb 17 14:57:07 2011 UTC
# Line 89  Line 89 
89                    | (Op.PosToImgSpace d, [v, x]) => T.Expr.intLit 0 (* FIXME *)                    | (Op.PosToImgSpace d, [v, x]) => T.Expr.intLit 0 (* FIXME *)
90                    | (Op.GradToWorldSpace d, [v, x]) => T.Expr.intLit 0 (* FIXME *)                    | (Op.GradToWorldSpace d, [v, x]) => T.Expr.intLit 0 (* FIXME *)
91                    | (Op.LoadImage info, [a]) => raise Fail "impossible"                    | (Op.LoadImage info, [a]) => raise Fail "impossible"
92                    | (Op.Inside d, [v, x]) => raise Fail "impossible"                    | (Op.Inside(d, s), [x, v])   => T.Expr.inside(d, x, v, s)
93                    | (Op.Input(ty, name), []) => raise Fail "impossible"                    | (Op.Input(ty, name), []) => raise Fail "impossible"
94                    | (Op.InputWithDefault(ty, name), [a]) => T.Expr.intLit 0 (* FIXME *)                    | (Op.InputWithDefault(ty, name), [a]) => T.Expr.intLit 0 (* FIXME *)
95                    | _ => raise Fail(concat[                    | _ => raise Fail(concat[
# Line 133  Line 133 
133              T.Stmt.block(List.foldr (fn (stm, stms) => trStmt(env, stm)@stms) [] body)              T.Stmt.block(List.foldr (fn (stm, stms) => trStmt(env, stm)@stms) [] body)
134            end            end
135    
136        fun trMethod (strand, env) (IL.Method{name, body}) =
137              T.Strand.method (strand, Atom.toString name, trBlock (env, body))
138    
139      fun trStrand (prog, env) (IL.Strand{name, params, state, stateInit, methods}) = let      fun trStrand (prog, env) (IL.Strand{name, params, state, stateInit, methods}) = let
140            val strand = T.Strand.define(prog, Atom.toString name)            val strand = T.Strand.define(prog, Atom.toString name)
141            val state' =            val state' =
# Line 143  Line 146 
146            val env = addBindings (env, params, params')            val env = addBindings (env, params, params')
147            in            in
148              T.Strand.init (strand, params', trBlock (env, stateInit));              T.Strand.init (strand, params', trBlock (env, stateInit));
149              ()              List.app (trMethod (strand, env)) methods
150            end            end
151    
152      fun generate (fileStem, srcProg) = let      fun generate (fileStem, srcProg) = let

Legend:
Removed from v.544  
changed lines
  Added in v.547

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