c.sa
Generated by gen_html_sa_files from ICSI. Contact gomes@icsi.berkeley.edu for details
-------------------------> GNU Sather - sourcefile <-------------------------
-- Copyright (C) 2000 by K Hopper, University of Waikato, New Zealand --
-- This file is part of the GNU Sather library. It is free software; you may --
-- redistribute and/or modify it under the terms of the GNU Library General --
-- Public License (LGPL) as published by the Free Software Foundation; --
-- either version 2 of the license, or (at your option) any later version. --
-- This library is distributed in the hope that it will be useful, but --
-- WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See Doc/LGPL for more details. --
-- The license text is also available from: Free Software Foundation, Inc., --
-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --
--------------> Please email comments to <bug-sather@gnu.org> <--------------
immutable class C_CHAR
immutable class C_CHAR is
-- This class provides the semantics of the C language built-in type
-- char. Note that this is NOT the same as a Sather character which is
-- more liek something that a C library might call a w_char!!
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
include COMPARABLE ;
create(
ch : CHAR
) : SAME is
-- This routine creates a single 8-bit character code from ch,
-- providing that it contains a single encoding the value of which may be
-- unambiguously converted into the C language 8-bit quantity.
builtin C_CHAR_CREATE_CHAR
end ;
char : CHAR is
-- This routine returns the Sather character containing a single
-- encoding which contains in its least eight significant bits a copy of
-- the encoding of self, all other bits (if any) being unset!
builtin C_CHAR_CHAR
end ;
zero : SAME is
-- This routine returns the nul character.
builtin C_CHAR_ZERO
end ;
is_eq(
other : SAME
) : BOOL is
-- This routine returns true if and only if the two 'characters' have
-- the same encoding. This is not the same as Sather character equality!
builtin C_CHAR_IS_EQ
end ;
is_lt(
other : SAME
) : BOOL is
-- This routine returns true if and only if the encoding of self,
-- treated as an unsigned number, is numerically less than the similarly
-- treated encoding of other. This is NOT the same as the less-than
-- ordering of Sather characters.
builtin C_CHAR_IS_LT
end ;
-- THE FOLLOWING FOUR ARITHMETIC OPERATIONS ARE MEANINGLESS AND IGNORED!
-- plus(other : SAME) : SAME is builtin C_CHAR_PLUS end ;
-- minus(other : SAME) : SAME is builtin C_CHAR_MINUS end ;
-- times(other : SAME) : SAME is builtin C_CHAR_TIMES end ;
-- div(other : SAME) : SAME is builtin C_CHAR_DIV end ;
str : STR is
-- This routine returns a character string representation of self in
-- the current repertoire and encoding.
return char.str
end ;
end ; -- C_CHAR
immutable class C_UNSIGNED_CHAR
immutable class C_UNSIGNED_CHAR is
-- This class implements the C language unsigned char type.
-- ANSI C ``unsigned char'' (built in type)
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
include COMPARABLE ;
create(
ch : CHAR
) : SAME is
-- This routine creates a single 8-bit character code from ch,
-- providing that it contains a single encoding the value of which may be
-- unambiguously converted into the C language 8-bit quantity.
builtin C_UNSIGNED_CHAR_CREATE_CHAR
end ;
char : CHAR is
-- This rroutine returns the Sather character containing a single
-- encoding which contains in its least eight significant bits a copy of
-- the encoding of self, all other bits (if any) being unset!
builtin C_UNSIGNED_CHAR_CHAR
end ;
zero : SAME is
-- This routine returns the nul character.
builtin C_UNSIGNED_CHAR_ZERO
end ;
is_eq(
other : SAME
) : BOOL is
-- This routine returns true if and only if the two 'characters' have
-- the same encoding. This is not the same as Sather character equality!
builtin C_UNSIGNED_CHAR_IS_EQ
end ;
is_lt(
other : SAME
) : BOOL is
-- This routine returns true if and only if the encoding of self,
-- treated as an unsigned number, is numerically less than the similarly
-- treated encoding of other. This is NOT the same as the less-than
-- ordering of Sather characters.
builtin C_UNSIGNED_CHAR_IS_LT
end ;
-- THE FOLLOWING FOUR ARITHMETIC OPERATIONS ARE MEANINGLESS AND IGNORED!
-- plus(other : SAME) : SAME is builtin C_UNSIGNED_CHAR_PLUS end ;
-- minus(other : SAME) : SAME is builtin C_UNSIGNED_CHAR_MINUS end ;
-- times(other : SAME) : SAME is builtin C_UNSIGNED_CHAR_TIMES end ;
-- div(other : SAME) : SAME is builtin C_UNSIGNED_CHAR_DIV end ;
str : STR is
-- This routine returns a character string representation of self in
-- the current repertoire and encoding.
return char.str
end ;
end ; -- C_UNSIGNED_CHAR
immutable class C_SIGNED_CHAR
immutable class C_SIGNED_CHAR is
-- This class implements the C language signed char type.
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
include COMPARABLE ;
create(
ch : CHAR
) : SAME is
-- This routine creates a single 8-bit character code from ch,
-- providing that it contains a single encoding the value of which may be
-- unambiguously converted into the C language 8-bit quantity.
builtin C_SIGNED_CHAR_CREATE_CHAR
end ;
char : CHAR is
-- This routine returns the Sather character containing a single
-- encoding which contains in its least eight significant bits a copy of
-- the encoding of self, all other bits (if any) being unset!
builtin C_SIGNED_CHAR_CHAR
end ;
zero : SAME is
-- This routine returns the nul character.
builtin C_SIGNED_CHAR_ZERO
end ;
is_eq(
other : SAME
) : BOOL is
-- This routine returns true if and only if the two 'characters' have
-- the same encoding. This is not the same as Sather character equality!
builtin C_SIGNED_CHAR_IS_EQ
end ;
is_lt(
other : SAME
) : BOOL is
-- This routine returns true if and only if the encoding of self,
-- treated as a signed number, is numerically less than the similarly
-- treated encoding of other. This is NOT the same as the less-than
-- ordering of Sather characters.
builtin C_SIGNED_CHAR_IS_LT
end ;
-- THE FOLLOWING FOUR ARITHMETIC OPERATIONS ARE MEANINGLESS AND IGNORED!
-- plus(other : SAME) : SAME is builtin C_SIGNED_CHAR_PLUS end ;
-- minus(other : SAME) : SAME is builtin C_SIGNED_CHAR_MINUS end ;
-- times(other : SAME) : SAME is builtin C_SIGNED_CHAR_TIMES end ;
-- div(other : SAME) : SAME is builtin C_SIGNED_CHAR_DIV end ;
str : STR is
-- This routine returns a character string representation of self in
-- the current repertoire and encoding.
return char.str
end ;
end ; -- C_SIGNED_CHAR
immutable class C_SHORT
immutable class C_SHORT is
-- This class implements the C language integer type short.
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
include COMPARABLE ;
create(
val : INT
) : SAME is
-- This routine returns a new value which contains the given value
-- provided that that is representable in this class.
builtin C_SHORT_CREATE_INT
end ;
int : INT is
-- This routine returns the Sather integer version of self.
builtin C_SHORT_INT
end ;
zero : SAME is
-- This routine returns the value zero as a value of this class.
builtin C_SHORT_ZERO
end ;
nil : SAME is
-- This routine returns the nil value for objects of this class. This
-- is derived from the Sather class INT.
return create(INT::nil)
end ;
is_nil : BOOL is
-- This routine returns true if and only if the value of self is nil.
return int.is_nil
end ;
is_eq(
other : SAME
) : BOOL is
-- This routine returns true if and only if self and other have the same
-- value.
builtin C_SHORT_IS_EQ
end ;
is_lt(
other : SAME
) : BOOL is
-- This routine returns true if and only if self is less than other when
-- compared as signed numbers.
builtin C_SHORT_IS_LT
end ;
-- Note that the following arithmetic operations are very
-- similar to field arithmetic, operations being carried out modulo
-- the largest number representable in the size of objects of this
-- class!
plus(
other : SAME
) : SAME is
-- This routine implements arithmetic addition of signed numbers.
builtin C_SHORT_PLUS
end ;
minus(
other : SAME
) : SAME is
-- This routine implements signed subtraction of other from self.
builtin C_SHORT_MINUS
end ;
times(
other : SAME
) : SAME is
-- This routne returns the result of the signed multiplication of self
-- by other.
builtin C_SHORT_TIMES
end ;
div(
other : SAME
) : SAME is
-- This routine returns the result of carrying out signed integer
-- division of self by other. The result is an integer number.
builtin C_SHORT_DIV
end ;
str : STR is
-- This routine returns the string representation of self in the current
-- repertoire and encoding.
return int.str
end ;
end ; -- C_SHORT
immutable class C_INT
immutable class C_INT is
-- This class implements the C language type int.
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
include COMPARABLE ;
create(
val : INT
) : SAME is
-- This routine returns a new value which contains the given value
-- provided that that is representable in this class.
builtin C_INT_CREATE_INT
end ;
int : INT is
-- This routine returns the Sather integer version of self.
builtin C_INT_INT
end ;
zero : SAME is
-- This routine returns the value zero as a value of this class.
builtin C_INT_ZERO
end ;
nil : SAME is
-- This routine returns the nil value for objects of this class. This
-- is derived from the Sather class INT.
return create(INT::nil)
end ;
is_nil : BOOL is
-- This routine returns true if and only if the value of self is nil.
return int.is_nil
end ;
is_eq(
other : SAME
) : BOOL is
-- This routine returns true if and only if self and other have the same
-- value.
builtin C_INT_IS_EQ
end ;
is_lt(
other : SAME
) : BOOL is
-- This routine returns true if and only if self is less than other when
-- compared as signed numbers.
builtin C_INT_IS_LT
end ;
-- Note that the following arithmetic operations are very
-- similar to field arithmetic, operations being carried out modulo
-- the largest number representable in the size of objects of this
-- class!
plus(
other : SAME
) : SAME is
-- This routine returns the result of the arithmetic addition of self
-- and other.
builtin C_INT_PLUS
end ;
minus(
other : SAME
) : SAME is
-- This routine returns the arithmetic result of subtracting other
-- from self.
builtin C_INT_MINUS
end ;
times(
other : SAME
) : SAME is
-- This routine returns the arithmetic product of self and other.
builtin C_INT_TIMES
end ;
div(
other : SAME
) : SAME is
-- This routine returns the result of the arithmetic division of self
-- by other.
builtin C_INT_DIV
end ;
str : STR is
-- This routine returns the string representation of self in the current
-- repertoire and encoding.
return int.str
end ;
end ; -- C_INT
immutable class C_LONG
immutable class C_LONG is
-- This class implements the C language type long.
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
include COMPARABLE ;
create(
val : INT
) : SAME is
-- This routine returns a new value which contains the given value
-- provided that that is representable in this class.
builtin C_LONG_CREATE_INT
end ;
int : INT is
-- This routine returns the Sather integer version of self.
builtin C_LONG_INT
end ;
zero : SAME is
-- This routine returns the value zero as a value of this class.
builtin C_LONG_ZERO
end ;
nil : SAME is
-- This routine returns the nil value for objects of this class. This
-- is derived from the Sather class INT.
return create(INT::nil)
end ;
is_nil : BOOL is
-- This routine returns true if and only if the value of self is nil.
return int.is_nil
end ;
is_eq(
other : SAME
) : BOOL is
-- This routine returns true if and only if self and other have the same
-- value.
builtin C_LONG_IS_EQ
end ;
is_lt(
other : SAME
) : BOOL is
-- This routine returns true if and only if self is less than other.
builtin C_LONG_IS_LT
end ;
-- Note that the following arithmetic operations are very
-- similar to field arithmetic, operations being carried out modulo
-- the largest number representable in the size of objects of this
-- class!
plus(
other : SAME
) : SAME is
-- This routine returns the sum of self and other.
builtin C_LONG_PLUS
end ;
minus(
other : SAME
) : SAME is
-- This routine returns the arithmetic result of subtracting other
-- from self.
builtin C_LONG_MINUS
end ;
times(
other : SAME
) : SAME is
-- This routne returns the arithmetic product of self and other.
builtin C_LONG_TIMES
end ;
div(
other : SAME
) : SAME is
-- This routine returns the result of carrying out integer division of
-- self by other. The result is an integer value.
builtin C_LONG_DIV
end ;
str : STR is
-- This routine returns the string representation of self in the current
-- repertoire and encoding.
return int.str
end ;
end ; -- C_LONG
immutable class C_UNSIGNED_SHORT
immutable class C_UNSIGNED_SHORT is
-- This class implements the C language type unsigned short.
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
include COMPARABLE ;
create(
val : CARD
) : SAME is
-- This routine returns a new value which contains the given value
-- provided that that is representable in this class.
builtin C_UNSIGNED_SHORT_CREATE_CARD
end ;
card : CARD is
-- This routine returns the Sather integer version of self.
builtin C_UNSIGNED_SHORT_CARD
end ;
zero : SAME is
-- This routine returns the value zero as a value of this class.
builtin C_UNSIGNED_SHORT_ZERO
end ;
nil : SAME is
-- This routine returns the nil value for objects of this class. This
-- is derived from the Sather class CARD.
return create(CARD::nil)
end ;
is_nil : BOOL is
-- This routine returns true if and only if the value of self is nil.
return card.is_nil
end ;
is_eq(
other : SAME
) : BOOL is
-- This routine returns true if and only if self and other have the same
-- value.
builtin C_UNSIGNED_SHORT_IS_EQ
end ;
is_lt(
other : SAME
) : BOOL is
-- This routine returns true if and only if self is less than other.
builtin C_UNSIGNED_SHORT_IS_LT
end ;
-- Note that the following arithmetic operations are very
-- similar to field arithmetic, operations being carried out modulo
-- the largest number representable in the size of objects of this
-- class!
plus(
other : SAME
) : SAME is
-- This routine returns the arithmetic sum of self and other.
builtin C_UNSIGNED_SHORT_PLUS
end ;
minus(
other : SAME
) : SAME is
-- This routine returns the arithmetic result of subtracting other from
-- self. If other is greater than self then the result is undefined.
builtin C_UNSIGNED_SHORT_MINUS
end ;
times(
other : SAME
) : SAME is
-- This routine returns the arithmetic product of self and other.
builtin C_UNSIGNED_SHORT_TIMES
end ;
div(
other : SAME
) : SAME is
-- This routine returns the arithmetic result of dividing self by other.
builtin C_UNSIGNED_SHORT_DIV
end ;
str : STR is
-- This routine returns the string representation of self in the current
-- repertoire and encoding.
return card.str
end ;
end ; -- C_UNSIGNED_SHORT
immutable class C_UNSIGNED_INT
immutable class C_UNSIGNED_INT is
-- This class implements the C language type unsigned int.
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
include COMPARABLE ;
create(
val : CARD
) : SAME is
-- This routine returns a new value which contains the given value
-- provided that that is representable in this class.
builtin C_UNSIGNED_INT_CREATE_CARD
end ;
card : CARD is
-- This routine returns the Sather integer version of self.
builtin C_UNSIGNED_INT_CARD
end ;
zero : SAME is
-- This routine returns the value zero as a value of this class.
builtin C_UNSIGNED_INT_ZERO
end ;
nil : SAME is
-- This routine returns the nil value for objects of this class. This is derived from the Sather class CARD.
return create(CARD::nil)
end ;
is_nil : BOOL is
-- This routine returns true if and only if the value of self is nil.
return card.is_nil
end ;
is_eq(
other : SAME
) : BOOL is
-- This routine returns true if and only if self and other have the same
-- value.
builtin C_UNSIGNED_INT_IS_EQ
end ;
is_lt(
other : SAME
) : BOOL is
-- This routine returns true if and only if self is less than other.
builtin C_UNSIGNED_INT_IS_LT
end ;
-- Note that the following arithmetic operations are very
-- similar to field arithmetic, operations being carried out modulo
-- the largest number representable in the size of objects of this
-- class!
plus(
other : SAME
) : SAME is
-- This routine returns the arithmetic sume of self and other.
builtin C_UNSIGNED_INT_PLUS
end ;
minus(
other : SAME
) : SAME is
-- This routine returns the arithmetic reult of subtracting other from
-- self. If other is greater than self then the result is undefined.
builtin C_UNSIGNED_INT_MINUS
end ;
times(
other : SAME
) : SAME is
-- This routine returns the arithmetic productof self by other.
builtin C_UNSIGNED_INT_TIMES
end ;
div(
other : SAME
) : SAME is
-- This routine returns the result of carrying out integer division
-- of self by other. This result is an integer value.
builtin C_UNSIGNED_INT_DIV
end ;
str : STR is
-- This routine returns the string representation of self in the current
-- repertoire and encoding.
return card.str
end ;
end ; -- C_UNSIGNED_INT
immutable class C_UNSIGNED_LONG
immutable class C_UNSIGNED_LONG is
-- This class implements the C language type unisgned long.
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
include COMPARABLE ;
create(
val : CARD
) : SAME is
-- This routine returns a new value which contains the given value
-- provided that that is representable in this class.
builtin C_UNSIGNED_LONG_CREATE_CARD
end ;
card : CARD is
-- This routine returns the Sather integer version of self.
builtin C_UNSIGNED_LONG_CARD
end ;
zero : SAME is
-- This routine returns the value zero as a value of this class.
builtin C_UNSIGNED_LONG_ZERO
end ;
nil : SAME is
-- This routine returns the nil value for objects of this class. This
-- is derived from the Sather class CARD.
return create(CARD::nil)
end ;
is_nil : BOOL is
-- This routine returns true if and only if the value of self is nil.
return card.is_nil
end ;
is_eq(
other : SAME
) : BOOL is
-- This routine returns true if and only if self and other have the same
-- value.
builtin C_UNSIGNED_LONG_IS_EQ
end ;
is_lt(
other : SAME
) : BOOL is
-- This routine returns true if and only if self is less than other when
-- compared as signed numbers.
builtin C_UNSIGNED_LONG_IS_LT
end ;
-- Note that the following arithmetic operations are very
-- similar to field arithmetic, operations being carried out modulo
-- the largest number representable in the size of objects of this
-- class!
plus(
other : SAME
) : SAME is
-- This routine returns the arithmetic sum of self and other.
builtin C_UNSIGNED_LONG_PLUS
end ;
minus(
other : SAME
) : SAME is
-- This routine returns the arithmetic result of subtracting other from
-- self. If other is greater than self then the result is undefined.
builtin C_UNSIGNED_LONG_MINUS
end ;
times(
other : SAME
) : SAME is
-- This routne returns the arithmetic product of self and other.
builtin C_UNSIGNED_LONG_TIMES
end ;
div(
other : SAME
) : SAME is
-- This routine returns the result of the integer division of self by
-- other. The result is an integer value.
builtin C_UNSIGNED_LONG_DIV
end ;
str : STR is
-- This routine returns the string representation of self in the current
-- repertoire and encoding.
return card.str
end ;
end ; -- C_UNSIGNED_LONG
immutable class C_FLOAT
immutable class C_FLOAT is
-- This class implements the C language float type.
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
include COMPARABLE ;
create(
val : FLT
) : C_FLOAT is
-- This routine returns a floating point number of the value of val.
builtin C_FLOAT_CREATE_FLT
end ;
flt : FLT is
-- This routine returns the Sather floating point number equal in value
-- to self.
builtin C_FLOAT_FLT
end ;
zero : SAME is
-- This routine returns the value zero in floating poont form.
builtin C_FLOAT_ZERO
end ;
nil : SAME is
-- This routine returns the nil value of this class, which is equal to
-- he Sather FLT nil.
return create(FLT::nil)
end ;
is_nil : BOOL is
-- This routine returns true if and only if self is the nil value.
return flt.is_nil
end ;
is_eq(
other : SAME
) : BOOL is
-- This routine returns true if and only if self and other have the same
-- value.
builtin C_FLOAT_IS_EQ
end ;
is_lt(
other : SAME
) : BOOL is
-- This routine returns true if and only if the value of self is
-- arithmetically less than the value of other.
builtin C_FLOAT_IS_LT
end ;
plus(
other : SAME
) : SAME is
-- This routine returns the arithmetic sum of self and other as the
-- nearest representable value.
builtin C_FLOAT_PLUS
end ;
minus(
other : SAME
) : SAME is
-- This routine returns the arithmetic result of subtracting other from
-- self to the nearest representable value.
builtin C_FLOAT_MINUS
end ;
times(
other : SAME
) : SAME is
-- This routine returns the result of multiplying self by other as the
-- nearest representable value.
builtin C_FLOAT_TIMES
end ;
div(
other : SAME
) : SAME is
-- This routine returns the result of dividing self by other as its
-- nearest representable value.
builtin C_FLOAT_DIV
end ;
str : STR is
-- This routine returns the string representation of self in the current
-- repertoire and encoding.
return flt.str
end ;
end ; -- C_FLOAT
immutable class C_DOUBLE
immutable class C_DOUBLE is
-- This class implements the C language double type.
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
include COMPARABLE ;
create(
val : FLTD
) : C_DOUBLE is
-- This routine returns a floating point number of the value of val.
builtin C_DOUBLE_CREATE_FLT
end ;
fltd : FLTD is
-- This routine returns the Sather floating point number equal in value
-- to self.
builtin C_DOUBLE_FLT
end ;
zero : SAME is
-- This routine returns the value zero in floating poont form.
builtin C_DOUBLE_ZERO
end ;
nil : SAME is
-- This routine returns the nil value of this class, which is equal to
-- he Sather FLT nil.
return create(FLTD::nil)
end ;
is_nil : BOOL is
-- This routine returns true if and only if self is the nil value.
return fltd.is_nil
end ;
is_eq(
other : SAME
) : BOOL is
-- This routine returns true if and only if self and other have the same
-- value.
builtin C_DOUBLE_IS_EQ
end ;
is_lt(
other : SAME
) : BOOL is
-- This routine returns true if and only if the value of self is
-- arithmetically less than the value of other.
builtin C_DOUBLE_IS_LT
end ;
plus(
other : SAME
) : SAME is
-- This routine returns the arithmetic sum of self and other as the
-- nearest representable value.
builtin C_DOUBLE_PLUS
end ;
minus(
other : SAME
) : SAME is
-- This routine returns the arithmetic result of subtracting other from
-- self to the nearest representable value.
builtin C_DOUBLE_MINUS
end ;
times(
other : SAME
) : SAME is
-- This routine returns the result of multiplying self by other as the
-- nearest representable value.
builtin C_DOUBLE_TIMES
end ;
div(
other : SAME
) : SAME is
-- This routine returns the result of dividing self by other as its
-- nearest representable value.
builtin C_DOUBLE_DIV
end ;
str : STR is
-- This routine returns the string representation of self in the current
-- repertoire and encoding.
return fltd.str
end ;
end ; -- C_DOUBLE
immutable class C_LONG_DOUBLE
immutable class C_LONG_DOUBLE is
-- ANSI C ``long double'' type (built in type)
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
include COMPARABLE ;
create(
val : FLTD
) : C_LONG_DOUBLE is
-- This routine returns a floating point number of the value of val.
builtin C_LONG_DOUBLE_CREATE_FLT
end ;
fltd : FLTD is
-- This routine returns the Sather floating point number equal in value
-- to self.
builtin C_LONG_DOUBLE_FLT
end ;
zero : SAME is
-- This routine returns the value zero in floating poont form.
builtin C_LONG_DOUBLE_ZERO
end ;
nil : SAME is
-- This routine returns the nil value of this class, which is equal to
-- he Sather FLT nil.
return create(FLTD::nil)
end ;
is_nil : BOOL is
-- This routine returns true if and only if self is the nil value.
return fltd.is_nil
end ;
is_eq(
other : SAME
) : BOOL is
-- This routine returns true if and only if self and other have the same
-- value.
builtin C_LONG_DOUBLE_IS_EQ
end ;
is_lt(
other : SAME
) : BOOL is
-- This routine returns true if and only if the value of self is
-- arithmetically less than the value of other.
builtin C_LONG_DOUBLE_IS_LT
end ;
plus(
other : SAME
) : SAME is
-- This routine returns the arithmetic sum of self and other as the
-- nearest representable value.
builtin C_LONG_DOUBLE_PLUS
end ;
minus(
other : SAME
) : SAME is
-- This routine returns the arithmetic result of subtracting other from
-- self to the nearest representable value.
builtin C_LONG_DOUBLE_MINUS
end ;
times(
other : SAME
) : SAME is
-- This routine returns the result of multiplying self by other as the
-- nearest representable value.
builtin C_LONG_DOUBLE_TIMES
end ;
div(
other : SAME
) : SAME is
-- This routine returns the result of dividing self by other as its
-- nearest representable value.
builtin C_LONG_DOUBLE_DIV
end ;
str : STR is
-- This routine returns the string representation of self in the current
-- repertoire and encoding.
return fltd.str
end ;
end ; -- C_LONG_DOUBLE
immutable class C_PTR
immutable class C_PTR is
-- This class implements the 'generic' C language pointer to void!
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
include COMPARABLE ;
-- All of the creation routines in this class convert from
-- specific pointers to the generic one.
create(
ptr : C_CHAR_PTR
) : SAME is
builtin C_PTR_CREATE_C_CHAR_PTR
end ;
create(
ptr :C_UNSIGNED_CHAR_PTR
) : SAME is
builtin C_PTR_CREATE_C_UNSIGNED_CHAR_PTR
end ;
create(
ptr : C_SIGNED_CHAR_PTR
) : SAME is
builtin C_PTR_CREATE_C_SIGNED_CHAR_PTR
end ;
create(
ptr : C_SHORT_PTR
) : SAME is
builtin C_PTR_CREATE_C_SHORT_PTR
end ;
create(
ptr : C_INT_PTR
) : SAME is
builtin C_PTR_CREATE_C_INT_PTR
end ;
create(
ptr : C_LONG_PTR
) : SAME is
builtin C_PTR_CREATE_C_LONG_PTR
end ;
create(
ptr : C_UNSIGNED_SHORT_PTR
) : SAME is
builtin C_PTR_CREATE_C_UNSIGNED_SHORT_PTR
end ;
create(
ptr : C_UNSIGNED_INT_PTR
) : SAME is
builtin C_PTR_CREATE_C_UNSIGNED_INT_PTR
end ;
create(
ptr : C_UNSIGNED_LONG_PTR
) : SAME is
builtin C_PTR_CREATE_C_UNSIGNED_LONG_PTR
end ;
create(
ptr : C_FLOAT_PTR
) : SAME is
builtin C_PTR_CREATE_C_FLOAT_PTR
end ;
create(
ptr : C_DOUBLE_PTR
) : SAME is
builtin C_PTR_CREATE_C_DOUBLE_PTR
end ;
create(
ptr : C_LONG_DOUBLE_PTR
) : SAME is
builtin C_PTR_CREATE_C_LONG_DOUBLE_PTR
end ;
zero : SAME is
-- This routine returns a NIL pointer.
builtin C_PTR_ZERO
end ;
is_eq(
other : SAME
) : BOOL is
-- This routine returns true if and only if self and other point to
-- the same object.
builtin C_PTR_IS_EQ
end ;
end ; -- C_PTR
immutable class C_CHAR_PTR
immutable class C_CHAR_PTR is
-- This class implements the C language type char *.
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
include COMPARABLE ;
include CONVERT_FROM_C_PTR ;
include CREATE_C_PTR{CHAR} ;
zero : SAME is
-- This routine returns a NIL pointer of this class.
builtin C_CHAR_PTR_ZERO
end ;
is_eq(
other : SAME
) : BOOL is
-- This routine returns true if and only if self and other point to
-- the same object.
builtin C_CHAR_PTR_IS_EQ
end ;
end ; -- C_CHAR_PTR
immutable class C_UNSIGNED_CHAR_PTR
immutable class C_UNSIGNED_CHAR_PTR is
-- This class implements the C language unsigned char * type.
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
include COMPARABLE ;
include CONVERT_FROM_C_PTR ;
include CREATE_C_PTR{CHAR} ;
zero : SAME is
-- This routine returns a NIL pointer of this class.
builtin C_UNSIGNED_CHAR_PTR_ZERO
end ;
is_eq(
other : SAME
) : BOOL is
-- This routine returns true if and only if self and other point to
-- the same object.
builtin C_UNSIGNED_CHAR_PTR_IS_EQ
end ;
end ; -- C_UNSIGNED_CHAR_PTR
immutable class C_SIGNED_CHAR_PTR
immutable class C_SIGNED_CHAR_PTR is
-- This class implements the C language type signed char *.
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
include COMPARABLE ;
include CONVERT_FROM_C_PTR ;
include CREATE_C_PTR{CHAR} ;
zero : SAME is
-- This routine returns a Nil pointer of this class.
builtin C_SIGNED_CHAR_PTR_ZERO
end ;
is_eq(
other : SAME
) : BOOL is
-- This routine returns true if and only if self and other point to
-- the same object.
builtin C_SIGNED_CHAR_PTR_IS_EQ
end ;
end ; -- C_SIGNED_CHAR_PTR
immutable class C_SHORT_PTR
immutable class C_SHORT_PTR is
-- This class implements the C language type short *.
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
include COMPARABLE ;
include CONVERT_FROM_C_PTR ;
zero : SAME is
-- This routine returns a NIL pointer of this class.
builtin C_SHORT_PTR_ZERO
end ;
is_eq(
ptr : SAME
) : BOOL is
-- This routine returns true if and only if self and other point to
-- the same object.
builtin C_SHORT_PTR_IS_EQ
end ;
end ; -- C_SHORT_PTR
immutable class C_INT_PTR
immutable class C_INT_PTR is
-- This class implements the C language type int *.
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
include COMPARABLE ;
include CONVERT_FROM_C_PTR ;
include CREATE_C_PTR{INT} ;
zero : SAME is
-- This routine returns the NIL pointer for this class.
builtin C_INT_PTR_ZERO
end ;
is_eq(
other : SAME
) : BOOL is
-- This routine returns true if and only if self and other point to
-- the same object.
builtin C_INT_PTR_IS_EQ
end ;
end ; -- C_INT_PTR
immutable class C_LONG_PTR
immutable class C_LONG_PTR is
-- This class implements the C language long * type.
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
include COMPARABLE ;
include CONVERT_FROM_C_PTR ;
zero : SAME is
-- This routine returns a NIL pointer of this class.
builtin C_LONG_PTR_ZERO
end ;
is_eq(
other : SAME
) : BOOL is
-- This routine returns true if and only if self and other point to the same object.
builtin C_LONG_PTR_IS_EQ
end ;
end ; -- C_LONG_PTR
immutable class C_UNSIGNED_SHORT_PTR
immutable class C_UNSIGNED_SHORT_PTR is
-- This class implements the C language unsigned short * type.
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
include COMPARABLE ;
include CONVERT_FROM_C_PTR ;
zero : SAME is
-- This routine returns a NIL pointer value of this class.
builtin C_UNSIGNED_SHORT_PTR_ZERO
end ;
is_eq(
other : SAME
) : BOOL is
-- This routine returns true if and only if self and other point to
-- the same object.
builtin C_UNSIGNED_SHORT_PTR_IS_EQ
end ;
end ; -- C_UNSIGNED_SHORT_PTR
immutable class C_UNSIGNED_INT_PTR
immutable class C_UNSIGNED_INT_PTR is
-- This class implements the C language unsigned int * type.
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
include COMPARABLE ;
include CONVERT_FROM_C_PTR ;
include CREATE_C_PTR{INT} ;
zero : SAME is
-- This routine returns the NIL pointer value for this class.
builtin C_UNSIGNED_INT_PTR_ZERO
end ;
is_eq(
other : SAME
) : BOOL is
-- This routine returns true if and only if self and other point to
-- the same object.
builtin C_UNSIGNED_INT_PTR_IS_EQ
end ;
end ; -- C_UNSIGNED_INT_PTR
immutable class C_UNSIGNED_LONG_PTR
immutable class C_UNSIGNED_LONG_PTR is
-- This class implements the C language unsigned long * type.
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
include COMPARABLE ;
include CONVERT_FROM_C_PTR ;
zero : SAME is
-- This routine returns the NIL pointer value for this class.
builtin C_UNSIGNED_LONG_PTR_ZERO
end ;
is_eq(
other : SAME
) : BOOL is
-- This routine returns true if and only if self and other point to
-- the same object.
builtin C_UNSIGNED_LONG_PTR_IS_EQ
end ;
end ; -- C_UNSIGNED_LONG_PTR
immutable class C_FLOAT_PTR
immutable class C_FLOAT_PTR is
-- This class implements the C language float * type.
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
include COMPARABLE ;
include CONVERT_FROM_C_PTR ;
include CREATE_C_PTR{C_FLOAT} ;
zero : SAME is
-- This routine returns the NIL pointer value of this class.
builtin C_FLOAT_PTR_ZERO
end ;
is_eq(
other : SAME
) : BOOL is
-- This routine returns true if and only if self and ohther point to
-- the same object.
builtin C_FLOAT_PTR_IS_EQ
end ;
end ; -- C_FLOAT_PTR
immutable class C_DOUBLE_PTR
immutable class C_DOUBLE_PTR is
-- This class implements the C language double * type.
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
include COMPARABLE ;
include CONVERT_FROM_C_PTR ;
include CREATE_C_PTR{FLTD} ;
zero : SAME is
-- This routine returns the NIL pointer value of this class.
builtin C_DOUBLE_PTR_ZERO
end ;
is_eq(
other : SAME
) : BOOL is
-- This routine returns true if and only if self and other point to
-- the same object.
builtin C_DOUBLE_PTR_IS_EQ
end ;
end ; -- C_DOUBLE_PTR
immutable class C_LONG_DOUBLE_PTR
immutable class C_LONG_DOUBLE_PTR is
-- This class implements the C language long double * type.
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
include COMPARABLE ;
include CONVERT_FROM_C_PTR ;
zero : SAME is
-- This routine returns the NIL pointer value of this class.
builtin C_LONG_DOUBLE_PTR_ZERO
end ;
is_eq(
other : SAME
) : BOOL is
-- This routine returns true if and only if self and other point to
-- the same object.
builtin C_LONG_DOUBLE_PTR_IS_EQ
end ;
end ; -- C_LONG_DOUBLE_PTR
partial class CONVERT_FROM_C_PTR
partial class CONVERT_FROM_C_PTR is
-- This partial class contains the routine for pointer creation
-- from void *.
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
create(
vptr : C_PTR
) : SAME is
builtin CONVERT_FROM_C_PTR_CREATE_C_PTR
end ;
end ; -- CONVERT_FROM_C_PTR
partial class CREATE_C_PTR{T<$OB}
partial class CREATE_C_PTR{T<$OB} is
-- This class contains the routines for creating C language pointer
-- types.
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
create(
arr : ARRAY{T}
) : SAME is
return create(arr.array_ptr)
end ;
create(
arr : ARRAY2{T}
) : SAME is
return create(arr.array_ptr)
end ;
create(
arr:ARRAY3{T}
) : SAME is
return create(arr.array_ptr)
end ;
-- other constructors should be added here when needed
end ; -- CREATE_C_PTR{T}
immutable class C_SIZE_T
immutable class C_SIZE_T is
-- This empty class implements the C language library class size_t.
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
end ; -- C_SIZE_T
immutable class C_PTRDIFF_T
immutable class C_PTRDIFF_T is
-- This class implements the C language library class ptrdiff_t.
-- Version 1.1 Apr 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 6 Jun 96 bv Original interface class
-- 27 Apr 97 kh Modified to conform to library revision
end ; -- C_PTRDIFF_T