SCM Repository
Diff of /trunk/src/compiler/mid-il/mid-il.sml
Parent Directory
|
Revision Log
|
Patch
revision 390, Wed Oct 13 19:56:41 2010 UTC | revision 391, Thu Oct 14 13:18:24 2010 UTC | |
---|---|---|
# | Line 11 | Line 11 |
11 | structure MidOps = | structure MidOps = |
12 | struct | struct |
13 | ||
14 | datatype ty = BoolTy | StringTy | IntTy | VecTy of int | type ty = MidILTypes.ty |
15 | ||
16 | val realTy = VecTy 0 | val samety = MidILTypes.same |
17 | val hashty = MidILTypes.hash | |
18 | fun samety (ty1 : ty, ty2) = (ty1 = ty2) | val tyToString = MidILTypes.toString |
fun hashty BoolTy = 0w1 | ||
| hashty StringTy = 0w2 | ||
| hashty IntTy = 0w3 | ||
| hashty (VecTy d) = Word.fromInt d + 0w4 | ||
fun tyToString BoolTy = "bool" | ||
| tyToString StringTy = "string" | ||
| tyToString IntTy = "int" | ||
| tyToString (VecTy 0) = "real" | ||
| tyToString (VecTy d) = "vec" ^ Int.toString d | ||
19 | ||
20 | fun sameint (i1 : int, i2) = (i1 = i2) | fun sameint (i1 : int, i2) = (i1 = i2) |
21 | fun hashint i = Word.fromInt i | fun hashint i = Word.fromInt i |
|
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |