aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2009-03-26 14:06:40 +0000
committerdos-reis <gdr@axiomatics.org>2009-03-26 14:06:40 +0000
commit6cb0dc4a2050e8191f61e42a365ec77dd9a3e051 (patch)
treea0f34f766daad36295110038a91b5acdb0a2bdfd /src/interp
parentbec1b2699335ba5795cfe36de4f899c8d9567d6d (diff)
downloadopen-axiom-6cb0dc4a2050e8191f61e42a365ec77dd9a3e051.tar.gz
* boot/ast.boot (nativeType): Accept int16 and int32.
(getFFIDatatype): Accept ReadWrite modifier. * algebra/data.spad.pamphlet (Int32): New. (UInt64): Likewise. * algebra/Makefile.pamphlet (axiom_algebra_layer_7): Include INT64 and UINT64.
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/compiler.boot16
-rw-r--r--src/interp/sys-constants.boot1
2 files changed, 12 insertions, 5 deletions
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index 399e6a5e..f567db1f 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -1271,25 +1271,31 @@ bootDenotation s ==
getBasicFFIType: %Mode -> %Symbol
getBasicFFIType t ==
t = $Byte => bootDenotation "byte"
+ t = $Int16 => bootDenotation "int16"
t = $Int32 => bootDenotation "int32"
- t = $Int64 => bootDenotation "int64"
+-- t = $Int64 => bootDenotation "int64"
t = $SingleInteger => bootDenotation "int"
t = $SingleFloat => bootDenotation "float"
t = $DoubleFloat => bootDenotation "double"
t = $String => bootDenotation "string"
nil
+
+++ List of admissible type modifiers in an FFI import declaration.
+$FFITypeModifier == '(ReadOnly WriteOnly ReadWrite)
+
++ 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.
getFFIDatatype: %Mode -> %Form
getFFIDatatype t ==
x := getBasicFFIType t => x
- t is [m,["PrimitiveArray",t']] and m in '(ReadOnly WriteOnly) and
- member(t',[$Byte,$Int32,$Int64,$SingleFloat,$DoubleFloat]) =>
+ t is [m,["PrimitiveArray",t']] and m in $FFITypeModifier and
+ member(t',[$Byte,$Int16,$Int32,$SingleFloat,$DoubleFloat]) =>
m' :=
m = "ReadOnly" => bootDenotation "readonly"
- bootDenotation "writeonly"
+ m = "WriteOnly" => bootDenotation "writeonly"
+ bootDenotation "readwrite"
[m',[bootDenotation "buffer",getBasicFFIType t']]
nil
@@ -1342,7 +1348,7 @@ checkExternalEntity(id,type,lang,e) ==
++ Remove possible modifiers in the FFI type expression `t'.
removeModifiers t ==
for (ts := [x,:.]) in tails t repeat
- x is [m,t'] and m in '(ReadOnly WriteOnly) =>
+ x is [m,t'] and m in $FFITypeModifier =>
rplac(first ts,t')
t
diff --git a/src/interp/sys-constants.boot b/src/interp/sys-constants.boot
index 1277504e..51bdfea0 100644
--- a/src/interp/sys-constants.boot
+++ b/src/interp/sys-constants.boot
@@ -364,6 +364,7 @@ $Boolean ==
'(Boolean)
$Byte == '(Byte)
+$Int16 == '(Int16)
$Int32 == '(Int32)
$Int64 == '(Int64)