SCM Repository
[diderot] Diff of /trunk/src/compiler/translate/translate.sml
Diff of /trunk/src/compiler/translate/translate.sml
Parent Directory
|
Revision Log
|
Patch
13 |
end = struct |
end = struct |
14 |
|
|
15 |
structure VMap = Var.Map |
structure VMap = Var.Map |
16 |
|
structure IL = HighIL |
17 |
|
|
18 |
|
(* expression translation *) |
19 |
|
fun cvtExpr (env, exp, kont) = let |
20 |
|
fun cvt e = (case e |
21 |
|
of AST.E_Var(x, tyArgs, ty) => |
22 |
|
| AST.E_Lit lit => |
23 |
|
| AST.E_Tuple es => |
24 |
|
| AST.E_Apply(f, tyArgs, args, ty) => |
25 |
|
| AST.E_Cons of expr list |
26 |
|
| AST.E_Cond(e1, e2, e3) => |
27 |
|
(* end case *)) |
28 |
|
in |
29 |
|
end |
30 |
|
|
31 |
|
and cvtStmt (env, stm) = (case stm |
32 |
|
of AST.S_Block of stmt list |
33 |
|
| AST.S_Decl of var_decl |
34 |
|
| AST.S_IfThenElse of expr * stmt * stmt |
35 |
|
| AST.S_Assign of var * expr |
36 |
|
| AST.S_New of Atom.atom * expr list |
37 |
|
| AST.S_Die |
38 |
|
| AST.S_Stabilize |
39 |
|
(* end case *)) |
40 |
|
|
41 |
end |
end |
|
Legend:
Removed from v.137 |
|
changed lines |
|
Added in v.168 |
|
|