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

SCM Repository

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

View of /trunk/src/typechecker/typechecker.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 69 - (download) (annotate)
Tue May 18 21:23:53 2010 UTC (9 years, 4 months ago) by jhr
File size: 709 byte(s)
  Starting to write a typechecker
(* typechecker.sml
 *
 * COPYRIGHT (c) 2010 The Diderot Project (http://diderot.cs.uchicago.edu)
 * All rights reserved.
 *)

structure Typechecker : sig

    val check : ParseTree.program -> AST.program

  end = struct

    structure Ty = Types

  (* check the well-formedness of a type and translate it to an AST type *)
    fun checkTy ty = (case ty
	   of PT.T_Mark of ty mark
	    | PT.T_Bool => 
	    | PT.T_Int
	    | PT.T_Real
	    | PT.T_String
	    | PT.T_Vec of dim
	    | PT.T_Kernel of dim
	    | PT.T_Field of {diff : dim, order : dim list, dim : dim}
	    | PT.T_Tensor of dim list
	    | PT.T_Image of {order : dim list, dim : dim}
	    | PT.T_Array of ty * dim list
	  (* end case *))

  end

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