sys.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>  <--------------


class SYS

class SYS is -- This class contains data/routines/iters which are related to the -- Sather compiler implementation system. -- Version 1.2 Oct 98. Copyright K Hopper, U of Waikato -- Development History -- ------------------- -- Date Who By Detail -- ---- ------ ------ -- 7 Nov 96 kh Original from Sather distribution -- 5 Mar 97 kh Added rune name and int/card changes. -- 14 Oct 98 kh Removed IEEE routines to partial class -- include IEEE_SYS ; -- Optional inclusion! destroy( obj : $OB ) pre ~void(obj) post true is -- This very special built-in routine is for use on those rare -- occasions when explicit object destruction is appropriate. Built-in to -- this implementation. builtin SYS_DESTROY end ; is_eq( ob1, ob2 : $OB ) : BOOL is -- This predicate returns true if and only if ob1 and ob2 are the same -- object, otherwise false. return ob_eq(ob1,ob2) end ; is_lt( ob1, ob2 : $OB ) : BOOL is -- This predicate returns true if and only if ob1 is less than ob2, -- otherwise false. return id(ob1) < id(ob2) end ; hash( ob1 : $OB ) : CARD pre true -- whatever the initial state post true -- whatever the result is -- This routine returns the implementation defined identity as a numeric -- value which is then hashed. return id(ob1).hash end ; id( obj : $OB ) : CARD pre ~void(obj) post true -- implementation-defined value is -- This routine returns the implementation defined identity for the -- object indicated. Built-in to this implementation. builtin SYS_ID end ; tp( obj : $OB ) : CARD pre true -- immutable or ~void(obj) post true -- implementation-defined tag is -- This routine returns the implementation defined type tag for the -- object indicated. Built-in to this implementation. builtin SYS_TP end ; str_for_tp( type_code : CARD ) : STR pre ~void(type_code) post true -- implementation-defined tag is -- This routine returns the programmer-defined class name for an -- object of the indicated class. Built-in to this implementation. builtin SYS_STR_FOR_TP end ; rune_name( obj : $OB ) : RUNES pre true -- ~void(obj) for mutables!! post true -- programmer defined class name is -- This routine returns the programmer-defined class name for the given -- object in the form of runes (encoded in ISO/IEC 10646-1 encoding). -- builtin after bootstrap !!! ??? -- builtin SYS_RUNES_FOR_GIVEN_TP return RUNES::create(str_for_tp(tp(obj))) ; end ; ob_eq( obj1, obj2 : $OB ) : BOOL is -- This predicate returns true if and only if ob1 and ob2 are the same -- object, otherwise false. Built-in to this implementation. builtin SYS_OB_EQ end ; -- The following routines are special to the parallel pSather -- runtime engine. Refer to the language definition or manual for -- full details of their semantics. defer is builtin SYS_DEFER end ; import is builtin SYS_IMPORT end ; export is builtin SYS_EXPORT end ; builtin_clusters! : CARD is -- This iter is invoked when a call to the builtin iter clusters! -- is made. loop yield clusters.times! end end ; -- The last two routines which follow are provided to make -- use of special debugging facilities which may be needed -- when developing a concurrent program!! stats( on_off : BOOL ) is -- This routine turns the concurrency engine collection of run-time -- statistics on or off as desired for post-execution analysis. Built-in -- to this implementation. builtin SYS_PSATHER_STATISTICS end ; trace( on_off : BOOL ) is -- This routine turns on or off the concutrent execution trace -- facilities of the pSather engine - as desired for post-execution -- analysis. Built-in to this implementation. builtin SYS_PSATHER_TRACE end ; inlined_C( str : STR ) is -- This routine is a place-holder for some system magic done under the -- covers by the current compiler. If this exception is ever raised then -- the compiler has generated bad code! SYS_ERROR::create.error(self,SYS_EXCEPT::Bad_Value,str) end ; end ; -- SYS

external class SATHER_ENGINE

external class SATHER_ENGINE is -- This external class describes the interface between th sather language and it slow-level implementing facilities. -- Version 1.0 Apr 97. Copyright K Hopper, U of Waikato -- Development History -- ------------------- -- Date Who By Detail -- ---- ------ ------ -- 23 Apr 97 kh Original from Sather distribution memcpy( destination : REFERENCE, source : REFERENCE, count : CARD ) : REFERENCE ; -- This routine is a blind bit copying operation which returns -- a reference to the string destination if successful. strlen( terminated_string : REFERENCE ) : CARD ; -- This routine is provided to determine the length of a text string -- which is terminated by an externally defined null character. rt_create_astr( count : CARD, buffer : STR ) : REFERENCE ; -- This routine splits strings separated by an externally defined null -- character into a single array of strings. end ; -- SATHER_ENGINE