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

SCM Repository

[diderot] View of /branches/vis15/src/compiler/translate/translate-ty.sml
ViewVC logotype

View of /branches/vis15/src/compiler/translate/translate-ty.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4193 - (download) (annotate)
Wed Jul 13 02:54:21 2016 UTC (3 years, 2 months ago) by jhr
File size: 987 byte(s)
  Working on merge: add sample type of proxy images to image template type.
(* translate-ty.sml
 *
 * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
 *
 * COPYRIGHT (c) 2015 The University of Chicago
 * All rights reserved.
 *)

structure TranslateTy : sig

    val tr : SimpleTypes.ty -> HighTypes.ty

  end = struct

    structure Ty = SimpleTypes
    structure DstTy = HighTypes

    fun tr ty = (case ty
           of Ty.T_Bool => DstTy.BoolTy
            | Ty.T_Int => DstTy.IntTy
            | Ty.T_String => DstTy.StringTy
            | Ty.T_Sequence(ty, optDim) => DstTy.SeqTy(tr ty, optDim)
	    | Ty.T_Strand n => DstTy.StrandTy n
            | Ty.T_Tensor dd => let
                fun cvtDim 1 = NONE
                  | cvtDim d = SOME d
                in
                  DstTy.TensorTy(List.mapPartial cvtDim dd)
                end
            | Ty.T_Image info => DstTy.ImageTy info
            | Ty.T_Field fld => DstTy.FieldTy
            | Ty.T_Kernel _ => DstTy.KernelTy
          (* end case *))

  end

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