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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/tree-ir/tree-pp.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/tree-ir/tree-pp.sml

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

revision 3754, Thu Apr 14 22:45:39 2016 UTC revision 3767, Mon Apr 18 18:42:10 2016 UTC
# Line 52  Line 52 
52                  "<" :: Ty.toString ty :: ">" :: argsToS ("[", args, "]", l)                  "<" :: Ty.toString ty :: ">" :: argsToS ("[", args, "]", l)
53              | toS (IR.E_Seq(args, ty), l) =              | toS (IR.E_Seq(args, ty), l) =
54                  "<" :: Ty.toString ty :: ">" :: argsToS ("{", args, "}", l)                  "<" :: Ty.toString ty :: ">" :: argsToS ("{", args, "}", l)
55                | toS (IR.E_Pack es, l) = "PACK" :: argsToS ("(", es, ")", l)
56            in            in
57              String.concat (toS (e, []))              String.concat (toS (e, []))
58            end            end
# Line 113  Line 114 
114                  in                  in
115                    List.app (fn s => prln(out, ["// ", s, "\n"])) text                    List.app (fn s => prln(out, ["// ", s, "\n"])) text
116                  end                  end
117              | IR.S_Assign([], e) => prln(out, [expToString e, ";\n"])              | IR.S_Unpack([], e) => raise Fail "empty lhs for Unpack"
118              | IR.S_Assign([x], e) => prln(out, [Var.name x, " = ", expToString e, ";\n"])              | IR.S_Unpack(x::xs, e) => (
             | IR.S_Assign(x::xs, e) => (  
119                  prln(out, ["(", Var.name x]);                  prln(out, ["(", Var.name x]);
120                  List.app (fn x => prl(out, [",", Var.name x])) xs;                  List.app (fn x => prl(out, [",", Var.name x])) xs;
121                  prl (out, [") = ", expToString e, ";\n"]))                  prl (out, [") = UNPACK(", expToString e, ");\n"]))
122                | IR.S_Assign(x, e) => prln(out, [Var.name x, " = ", expToString e, ";\n"])
123              | IR.S_GAssign(x, e) => prln(out, [IR.GlobalVar.name x, " = ", expToString e, ";\n"])              | IR.S_GAssign(x, e) => prln(out, [IR.GlobalVar.name x, " = ", expToString e, ";\n"])
124              | IR.S_IfThen(cond, blk) => (              | IR.S_IfThen(cond, blk) => (
125                  prln (out, ["if (", expToString cond, ") "]);                  prln (out, ["if (", expToString cond, ") "]);
# Line 165  Line 166 
166                    ])                    ])
167              | IR.S_New(strand, args) =>              | IR.S_New(strand, args) =>
168                  prln (out, [argsToString("new "^Atom.toString strand, args), ";\n"])                  prln (out, [argsToString("new "^Atom.toString strand, args), ";\n"])
169              | IR.S_Save([], _) => raise Fail "bogus Save statement"              | IR.S_Save(x, rhs) =>
             | IR.S_Save([x], rhs) =>  
170                  prln (out, [IR.StateVar.toString x, " = ", expToString rhs, ";\n"])                  prln (out, [IR.StateVar.toString x, " = ", expToString rhs, ";\n"])
             | IR.S_Save(x::xs, e) => (  
                 prln(out, ["(", IR.StateVar.toString x]);  
                 List.app (fn x => prl(out, [",", IR.StateVar.toString x])) xs;  
                 prl (out, [") = ", expToString e, ";\n"]))  
171              | IR.S_Exit es => prln (out, [argsToString("exit", es), ";\n"])              | IR.S_Exit es => prln (out, [argsToString("exit", es), ";\n"])
172            (* return functions for methods *)            (* return functions for methods *)
173              | IR.S_Active => prln (out, ["active;\n"])              | IR.S_Active => prln (out, ["active;\n"])

Legend:
Removed from v.3754  
changed lines
  Added in v.3767

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