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 1115 - (view) (download)
Original Path: trunk/src/compiler/c-target/target-ty.sml

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

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