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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3291 - (view) (download)

1 : jhr 1115 (* target-ty.sml
2 :     *
3 : jhr 3291 * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
4 :     *
5 :     * COPYRIGHT (c) 2015 The University of Chicago
6 : jhr 1115 * All rights reserved.
7 :     *)
8 :    
9 :     structure TargetTy =
10 :     struct
11 :    
12 :     datatype ty
13 :     = T_Bool
14 :     | T_String
15 :     | T_Int (* default int type *)
16 :     | T_Real (* default real type *)
17 :     | T_Vec of int
18 :     | T_IVec of int
19 :     | T_Mat of int * int (* matrix type *)
20 :     | T_Image of int * RawTypes.ty (* n-dimensional image data *)
21 :     | T_Ptr of RawTypes.ty (* pointer type *)
22 :    
23 :     (* string representation of types (for debugging *)
24 :     fun toString ty = (case ty
25 :     of T_Bool => "T_Bool"
26 :     | T_String => "T_String"
27 :     | T_Int => "T_Int"
28 :     | T_Real => "T_Real"
29 :     | T_Vec n => concat["T_Vec(", Int.toString n, ")"]
30 :     | T_IVec n => concat["T_IVec(", Int.toString n, ")"]
31 :     | T_Mat(n,m) => concat["T_Mat(", Int.toString n, "x", Int.toString m, ")"]
32 :     | T_Image(n, ty) => concat[
33 :     "T_Image", Int.toString n, "D(", RawTypes.toString ty, ")"
34 :     ]
35 :     | T_Ptr ty => concat["T_Ptr(", RawTypes.toString ty, ")"]
36 :     (* end case *))
37 :    
38 :     end

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