2 * 2005 Matthew
Fluet (mfluet@acm
.org
)
7 * Encoding C
's
type system
in SML
. This module provides the
"public"
8 * view
of the implementation
.
10 * DEBUG VERSION
with CHECKED POINTER DEREFERENCING
.
12 * (C
) 2002, Lucent Technologies
, Bell Laboratories
14 * author
: Matthias
Blume (blume@research
.bell
-labs
.com
)
16 structure C_Debug
: C_DEBUG
= struct
17 (* first
of all
, we look mostly like
structure C
... *)
20 (* ... but
then, we also check for NULL pointers
... *)
23 (* ... which means that we have to re
-implement some things
: *)
24 structure Ptr
= struct
26 val |
*! = fn p
=> if isNull
' p
then raise NullPointer
else |
*! p
27 val |
*|
= fn p
=> if isNull p
then raise NullPointer
else |
*| p