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

SCM Repository

[diderot] View of /trunk/src/compiler/translate/translate.sml
ViewVC logotype

View of /trunk/src/compiler/translate/translate.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 168 - (download) (annotate)
Wed Jul 21 20:58:37 2010 UTC (9 years, 1 month ago) by jhr
File size: 914 byte(s)
  Working on translation to HighIL
(* translate.sml
 *
 * COPYRIGHT (c) 2010 The Diderot Project (http://diderot.cs.uchicago.edu)
 * All rights reserved.
 *
 * Translate AST code into the IL representation.
 *)

structure Translate : sig

    val translate : AST.program -> ??

  end = struct

    structure VMap = Var.Map
    structure IL = HighIL

  (* expression translation *)
    fun cvtExpr (env, exp, kont) = let
	  fun cvt e = (case e
		 of AST.E_Var(x, tyArgs, ty) =>
		  | AST.E_Lit lit =>
		  | AST.E_Tuple es =>
		  | AST.E_Apply(f, tyArgs, args, ty) =>
		  | AST.E_Cons of expr list
		  | AST.E_Cond(e1, e2, e3) =>
		(* end case *))
	  in
	  end

    and cvtStmt (env, stm) = (case stm
	   of AST.S_Block of stmt list
	    | AST.S_Decl of var_decl
	    | AST.S_IfThenElse of expr * stmt * stmt
	    | AST.S_Assign of var * expr
	    | AST.S_New of Atom.atom * expr list
	    | AST.S_Die
	    | AST.S_Stabilize
	  (* end case *))

  end

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