From 5ab1bb2721c9fdf77e6fa530523f5044b8445880 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Tue, 8 Sep 2009 13:16:28 +0000 Subject: * boot/ast.boot: Support "pointer" as simple datatype. * interp/compiler.boot (getBasicFFIType): SystemPointer is an FFI type. * algebra/data.spad.pamphlet (SystemPointer): New. * algebra/Makefile.pamphlet (axiom_algebra_layer_0): Include SYSPTR. --- src/interp/compiler.boot | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/interp/compiler.boot') diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot index f2ced87a..8666c1ff 100644 --- a/src/interp/compiler.boot +++ b/src/interp/compiler.boot @@ -1340,12 +1340,23 @@ getBasicFFIType t == t = $SingleFloat => bootDenotation "float" t = $DoubleFloat => bootDenotation "double" t = $String => bootDenotation "string" + t = $SystemPointer => bootDenotation "pointer" nil ++ List of admissible type modifiers in an FFI import declaration. $FFITypeModifier == '(ReadOnly WriteOnly ReadWrite) +++ List of admissible element types of contiguously stored +++ homogeneous FFI aggregate types. +$FFIAggregableDataType == + [$Byte, + $Int16,$UInt16, + $Int32,$UInt32, + $Int64, $UInt64, + $SingleFloat, + $DoubleFloat] + ++ Return the Boot denotation of an FFI datatype. This is either ++ a basic VM type, or a simple array of sized integer or floating ++ point type. @@ -1353,7 +1364,7 @@ getFFIDatatype: %Mode -> %Form getFFIDatatype t == x := getBasicFFIType t => x t is [m,["PrimitiveArray",t']] and m in $FFITypeModifier and - member(t',[$Byte,$Int16,$Int32,$SingleFloat,$DoubleFloat]) => + member(t',$FFIAggregableDataType) => m' := m = "ReadOnly" => bootDenotation "readonly" m = "WriteOnly" => bootDenotation "writeonly" -- cgit v1.2.3