MODULE************************************************************************* Copyright (C) Olivetti 1989 All Rights reserved Use and copy of this software and preparation of derivative works based upon this software are permitted to any person, provided this same copyright notice and the following Olivetti warranty disclaimer are included in any copy of the software or any modification thereof or derivative work therefrom made by any person. This software is made available AS IS and Olivetti disclaims all warranties with respect to this software, whether expressed or implied under any law, including all implied warranties of merchantibility and fitness for any purpose. In no event shall Olivetti be liable for any damages whatsoever resulting from loss of use, data or profits or otherwise arising out of or in connection with the use or performance of this software. *************************************************************************; M3CStdTypes
return (shared) instances of standard predefined TYPE_SPECs.
IMPORT M3AST_AS, M3AST_SM; IMPORT M3AST_LX_F, M3AST_AS_F; IMPORT M3CSrcPos; VAR integer: M3AST_AS.Integer_type; longint: M3AST_AS.Longint_type; real: M3AST_AS.Real_type; longReal: M3AST_AS.LongReal_type; extended: M3AST_AS.Extended_type; char: M3AST_AS.TYPE_SPEC; widechar: M3AST_AS.WideChar_type; text: M3AST_AS.TYPE_SPEC; null: M3AST_AS.Null_type; boolean: M3AST_AS.TYPE_SPEC; cardinal: M3AST_AS.TYPE_SPEC; longcard: M3AST_AS.TYPE_SPEC; refany: M3AST_AS.RefAny_type; address: M3AST_AS.Address_type; root: M3AST_AS.Root_type; untracedRoot: M3AST_AS.Root_type; mutex: M3AST_AS.TYPE_SPEC; any: M3AST_SM.Any_type; type: M3AST_SM.Type_type; void: M3AST_SM.Void_type; charpos: CARDINAL; (* each node gets a unique lx_srcpos *) PROCEDUREInteger (): M3AST_AS.Integer_type RAISES {}= BEGIN RETURN integer; END Integer; PROCEDURELongint (): M3AST_AS.Longint_type RAISES {}= BEGIN RETURN longint; END Longint; PROCEDUREReal (): M3AST_AS.Real_type RAISES {}= BEGIN RETURN real; END Real; PROCEDURELongReal (): M3AST_AS.LongReal_type RAISES {}= BEGIN RETURN longReal; END LongReal; PROCEDUREExtended (): M3AST_AS.Extended_type RAISES {}= BEGIN RETURN extended; END Extended; PROCEDUREChar (): M3AST_AS.TYPE_SPEC RAISES {}= BEGIN RETURN char; END Char; PROCEDUREWideChar (): M3AST_AS.WideChar_type RAISES {}= BEGIN RETURN widechar; END WideChar; PROCEDUREText (): M3AST_AS.TYPE_SPEC RAISES {}= BEGIN RETURN text; END Text; PROCEDUREBoolean (): M3AST_AS.TYPE_SPEC RAISES {}= BEGIN RETURN boolean; END Boolean; PROCEDURECardinal (): M3AST_AS.TYPE_SPEC RAISES {}= BEGIN RETURN cardinal; END Cardinal; PROCEDURELongcard (): M3AST_AS.TYPE_SPEC RAISES {}= BEGIN RETURN longcard; END Longcard; PROCEDURERefAny (): M3AST_AS.RefAny_type RAISES {}= BEGIN RETURN refany; END RefAny; PROCEDUREAddress (): M3AST_AS.Address_type RAISES {}= BEGIN RETURN address; END Address; PROCEDURERoot (): M3AST_AS.Root_type RAISES {}= BEGIN RETURN root; END Root; PROCEDUREUntraced_Root (): M3AST_AS.Root_type RAISES {}= BEGIN RETURN untracedRoot; END Untraced_Root; PROCEDUREMutex (): M3AST_AS.TYPE_SPEC RAISES {}= BEGIN RETURN mutex; END Mutex; PROCEDURENull (): M3AST_AS.Null_type RAISES {}= BEGIN RETURN null; END Null; PROCEDUREAny (): M3AST_SM.Any_type RAISES {}= BEGIN RETURN any; END Any; PROCEDUREType (): M3AST_SM.Type_type RAISES {}= BEGIN RETURN type; END Type; PROCEDUREVoid (): M3AST_SM.Void_type RAISES {}= BEGIN RETURN void; END Void; PROCEDURERegisterChar (ts: M3AST_AS.TYPE_SPEC) RAISES {}= BEGIN char := ts; END RegisterChar; PROCEDURERegisterText (ts: M3AST_AS.TYPE_SPEC) RAISES {}= BEGIN text := ts; END RegisterText; PROCEDURERegisterBoolean (ts: M3AST_AS.TYPE_SPEC) RAISES {}= BEGIN boolean := ts; END RegisterBoolean; PROCEDURERegisterCardinal (ts: M3AST_AS.TYPE_SPEC) RAISES {}= BEGIN cardinal := ts; END RegisterCardinal; PROCEDURERegisterLongcard (ts: M3AST_AS.TYPE_SPEC) RAISES {}= BEGIN longcard := ts; END RegisterLongcard; PROCEDURERegisterMutex (ts: M3AST_AS.TYPE_SPEC) RAISES {}= BEGIN mutex := ts; END RegisterMutex; PROCEDUREInit (n: M3AST_AS.SRC_NODE) RAISES {}= BEGIN INC(charpos); n.lx_srcpos := M3CSrcPos.Pack(0, charpos); END Init; BEGIN charpos := 0; integer := NEW(M3AST_AS.Integer_type).init(); Init(integer); longint := NEW(M3AST_AS.Longint_type).init(); Init(longint); widechar := NEW(M3AST_AS.WideChar_type).init(); Init(widechar); real := NEW(M3AST_AS.Real_type).init(); Init(real); longReal := NEW(M3AST_AS.LongReal_type).init(); Init(longReal); extended := NEW(M3AST_AS.Extended_type).init(); Init(extended); null := NEW(M3AST_AS.Null_type).init(); Init(null); any := NEW(M3AST_SM.Any_type).init(); Init(any); type := NEW(M3AST_SM.Type_type).init(); Init(type); void := NEW(M3AST_SM.Void_type).init(); Init(void); refany := NEW(M3AST_AS.RefAny_type).init(); Init(refany); address := NEW(M3AST_AS.Address_type).init(); Init(address); root := NEW(M3AST_AS.Root_type).init(); Init(root); untracedRoot := NEW(M3AST_AS.Root_type).init(); untracedRoot.as_trace_mode := NEW(M3AST_AS.Untraced).init(); Init(untracedRoot); END M3CStdTypes.