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

SCM Repository

[diderot] View of /branches/vis12/src/compiler/c-target/target-ty.sml
ViewVC logotype

View of /branches/vis12/src/compiler/c-target/target-ty.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1685 - (download) (annotate)
Sun Jan 22 15:23:36 2012 UTC (7 years, 10 months ago) by jhr
File size: 1075 byte(s)
  Create a branch to implement things that we need for the Vis 2012 paper
(* target-ty.sml
 *
 * COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu)
 * All rights reserved.
 *)

structure TargetTy =
  struct

    datatype ty
      = T_Bool
      | T_String
      | T_Int				(* default int type *)
      | T_Real				(* default real type *)
      | T_Vec of int
      | T_IVec of int
      | T_Mat of int * int		(* matrix type *)
      | T_Image of int * RawTypes.ty	(* n-dimensional image data *)
      | T_Ptr of RawTypes.ty		(* pointer type *)

  (* string representation of types (for debugging *)
    fun toString ty = (case ty
	   of T_Bool => "T_Bool"
	    | T_String => "T_String"
	    | T_Int => "T_Int"
	    | T_Real => "T_Real"
	    | T_Vec n => concat["T_Vec(", Int.toString n, ")"]
	    | T_IVec n => concat["T_IVec(", Int.toString n, ")"]
	    | T_Mat(n,m) => concat["T_Mat(", Int.toString n, "x", Int.toString m, ")"]
	    | T_Image(n, ty) => concat[
		  "T_Image", Int.toString n, "D(", RawTypes.toString ty, ")"
		]
	    | T_Ptr ty => concat["T_Ptr(", RawTypes.toString ty, ")"]
	  (* end case *))

  end

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