--| --|Item: Ada PCTE Binding --|$Revision: 0.2 $ --|$State: Prototype $ --| --|The Version Description Document (VDD) included with this release provides --|detailed information regarding the condition of the software. The "User --|Feedback" section of the VDD describes how to obtain additional information. --| --|Distribution Statement "A", per DoD Directive 5230.24 --|Authorized for public release; distribution is unlimited. --| --|Copyright (c) 1992, Paramax Systems Corporation, Reston, Virginia --|Copyright is assigned to the U.S. Government, upon delivery thereto, --|in accordance with the DFAR Special Works Clause. --| --|Developed by: Paramax Systems Corporation, --| --|This software, developed under the Software Technology for Adaptable, --|Reliable Systems (STARS) program, is approved for release under --|Distribution "A" of the Scientific and Technical Information Program --|Classification Scheme (DoD Directive 5230.24) unless otherwise indicated. --|Sponsored by the U.S. Defense Advanced Research Projects Agency (DARPA) --|under contract F19628-88-D-0031, the STARS program is supported by the --|military services, SEI, and MITRE, with the U.S. Air Force as the executive --|contracting agent. --| --|Permission to use, copy, modify, and comment on this software and its --|documentation for purposes stated under Distribution "A" and without fee --|is hereby granted, provided that this notice appears in each whole or --|partial copy. This software retains Contractor indemnification to --|the Government regarding copyrights pursuant to the above referenced --|STARS contract. The Government disclaims all responsibility against --|liability, including costs and expenses for violation of proprietary --|rights, or copyrights arising out of the creation or use of this --|software. --| --|In addition, the Government, Paramax, and its subcontractors disclaim all --|warranties with regard to this software, including all implied warranties --|of merchantability and fitness, and in no event shall the Government, --|Paramax, or its subcontractor(s) be liable for any special, indirect or --|consequential damages or any damages whatsoever resulting from the loss of --|use, data, or profits, whether in action of contract, negligence or other --|tortious action, arising in connection with the use or performance of this --|software. --| --|$Log $ --| -- Version Information -- ^^^^^^^^^^^^^^^^^^^ -- -- PCTE - Ada Language Interface. -- Version: 0.2. -- Release Date: November 30, 1992. -- Compiled under SUN OS 4.1.2 using SunAda 1.0 -- -- -- General Information -- ^^^^^^^^^^^^^^^^^^^ -- -- This is an alpha release of the Paramax STARS Ada binding to Emeraude's -- PCTE 1.5 using the ECMA PCTE Ada binding specifications. The binding -- is incomplete in this release. See the Version Description Document -- provided with this alpha release for information on which interfaces -- have been implemented. It is expected that future releases will -- expand the number of interfaces implemented. The interfaces defined -- herein are subject to change. -- -- For further information, contact the authors: -- -- -- Robert Smith -- Paramax Systems Corp. -- Valley Forge Labs -- 70 E. Swedesford Road -- Paoli, PA. 19301 -- smith@prc.unisys.com (current) -- smith@vfl.paramax.com (future) -- +1 215 648-2402 -- -- Michael Horton -- Paramax Systems Corp. -- Valley Forge Labs -- 70 E. Swedesford Road -- Paoli, PA. 19301 -- horton@prc.unisys.com (current) -- horton@vfl.paramax.com (future) -- +1 215 648-2527 -- -- --% NOTE: This package will be at least partially supported by Ada binding to --% PCTE 1.5 with Pcte_error, CALENDAR; package Pcte is use Pcte_error; --------------------------------- PCTE BASIC TYPES --------------------------------- subtype boolean is STANDARD.BOOLEAN; -- Pcte.boolean corresponds to the PCTE datatype Boolean. -- type integer is range implementation-defined ; type integer is range -2147483648 .. 2147483647; -- Pcte.integer corresponds to the PCTE datatype Integer. type natural is range 0 .. Pcte.integer'LAST; -- Pcte.natural corresponds to the PCTE datatype Natural. -- type float is digits implementation-defined range implementation-defined ; type float is digits 6 range -1.0E32 .. 1.0E32; -- Pcte.float corresponds to the PCTE datatype Float. subtype string is STANDARD.STRING; subtype string_length is STANDARD.NATURAL; -- Pcte.string corresponds to the PCTE datatype String. subtype positive is STANDARD.POSITIVE; -- Pcte.positive is used to define a character position within Pcte.string. --% NOTE: The following subpackage probably needs to be supported by --% Ada binding to PCTE 1.5 package calendar is type time is private ; -- Pcte.calendar.time corresponds to the PCTE datatype Time; -- it is an Ada private type defined with its associated subprograms -- in this package Pcte.calendar. -- The subtypes and subprograms have the same -- meanings as their namesakes in package CALENDAR. -- An exception ERROR_WITH_TIME is defined in the package Pcte_error -- with the same meaning as TIME_ERROR in the package CALENDAR, -- see 25. DEFAULT_TIME: constant time; -- Pcte.calendar.DEFAULT_TIME is the default value of time attributes. subtype year_number is STANDARD.CALENDAR.YEAR_NUMBER range 1980 .. 2044; subtype month_number is STANDARD.CALENDAR.MONTH_NUMBER; subtype day_number is STANDARD.CALENDAR.DAY_NUMBER; subtype duration is STANDARD.DURATION; function clock return Pcte.calendar.time; function year ( date : Pcte.calendar.time) return Pcte.calendar.year_number; function month ( date : Pcte.calendar.time) return Pcte.calendar.month_number; function day ( date : Pcte.calendar.time) return Pcte.calendar.day_number; function seconds ( date : Pcte.calendar.time) return Pcte.calendar.duration; procedure split ( date : in Pcte.calendar.time; year : out Pcte.calendar.year_number; month : out Pcte.calendar.month_number; day : out Pcte.calendar.day_number; seconds : out Pcte.calendar.duration); function time_of ( year : Pcte.calendar.year_number; month : Pcte.calendar.month_number; day : Pcte.calendar.day_number; seconds : Pcte.calendar.duration := 0.0) return Pcte.calendar.time; function "+" ( left : Pcte.calendar.time; right : Pcte.calendar.duration) return Pcte.calendar.time; function "+" ( left : Pcte.calendar.duration; right : Pcte.calendar.time) return Pcte.calendar.time; function "-" ( left : Pcte.calendar.time; right : Pcte.calendar.duration) return Pcte.calendar.time; function "-" ( left : Pcte.calendar.time; right : Pcte.calendar.time) return Pcte.calendar.duration; function "<" ( left : Pcte.calendar.time; right : Pcte.calendar.time) return Pcte.boolean; function "<=" ( left : Pcte.calendar.time; right : Pcte.calendar.time) return Pcte.boolean; function ">" ( left : Pcte.calendar.time; right : Pcte.calendar.time) return Pcte.boolean; function ">=" ( left : Pcte.calendar.time; right : Pcte.calendar.time) return Pcte.boolean; function extend ( date : Pcte.calendar.time) return CALENDAR.TIME; -- Pcte.calendar.extend converts the value of the parameter -- date to the type CALENDAR.TIME. function round ( date : CALENDAR.TIME) return Pcte.calendar.time; -- Pcte.calendar.round converts the value of the parameter -- date to the type Pcte.calendar.time. private -- implementation-defined type time is new STANDARD.NATURAL; DEFAULT_TIME: constant Pcte.calendar.time := 0; end calendar; ----------------------- PCTE SEQUENCES (See 8.2.7.) ----------------------- --% NOTE: The following subpackage will be at least partially supported by --% Ada binding to PCTE 1.5 generic --type element is limited private ; type element is private; package sequence is --type sequence is limited private ; type sequence is private; -- The initial value of an object of type sequence is an -- empty sequence, i.e. one of length 0. To discard a -- sequence so that the associated storage can be -- recovered, all the elements of the sequence are deleted -- by means of procedure delete. function get ( list : Pcte.sequence.sequence; index : Pcte.positive := Pcte.positive'FIRST) return Pcte.sequence.element; -- Pcte.sequence.get returns the element with the given index in the given sequence. -- If the index is greater than the number of elements -- of the sequence, the subprogram returns the last element. procedure put ( list : in out Pcte.sequence.sequence; item : in Pcte.sequence.element; index : in Pcte.positive := Pcte.positive'LAST); -- Pcte.sequence.put inserts the given element in the given sequence -- immediately before the element with the given index, -- or if the index is greater than the number of elements of the sequence, -- the given element is appended after the last element. procedure delete ( list : in out Pcte.sequence.sequence; index : in Pcte.positive := Pcte.positive'FIRST; count : in Pcte.positive := Pcte.positive'LAST); -- Pcte.sequence.delete deletes up to the given count elements from -- the element with the given index from the given sequence. -- The number of elements deleted is the lesser of count -- and the number of elements from the element of list with -- the given index to the end. procedure copy ( into_list : in out Pcte.sequence.sequence; from_list : in Pcte.sequence.sequence; into_index : in Pcte.positive := Pcte.positive'LAST; from_index : in Pcte.positive := Pcte.positive'FIRST; count : in Pcte.positive := Pcte.positive'LAST); -- Pcte.sequence.copy adds up to the given count elements from the -- element with index from_index of from_list to into_list. -- The elements are inserted immediately before the element -- of into_list with index into_index, or, if into_index is -- greater than the number of elements of into_list, are -- appended to the end of into_list. The number of -- elements added is the lesser of count and the number of -- elements from the element of from_list with index -- from_index to the end. function length_of ( list : Pcte.sequence.sequence) return Pcte.natural; -- Pcte.sequence.length_of returns the number of elements in the given sequence. function index_of ( list : Pcte.sequence.sequence; item : Pcte.sequence.element) return Pcte.natural; -- Pcte.sequence.index_of returns the index of the first occurrence of the given element -- in the given sequence if the element is a member of the sequence, -- and 0 otherwise. --function "=" ( function equal ( left : Pcte.sequence.sequence; right : Pcte.sequence.sequence) return Pcte.boolean; -- Pcte.sequence."=" returns TRUE if the two sequences left and right have -- the same number of elements and their corresponding elements are equal, -- and FALSE otherwise. procedure normalize ( list : in out Pcte.sequence.sequence); -- Pcte.sequence.normalize reorders the elements of -- the given sequence in an implementation-defined canonical -- order, and deletes any duplicate elements. private -- implementation-defined Sequence_Increment_Size : Pcte.natural := 16; --% This should be a constant but a SunAda internal compiler error --% prevents this being a constant. RCS type element_ptr is access element; type elements is array (Pcte.natural range <>) of element_ptr; type sequence_info (array_size : Pcte.natural := Sequence_Increment_Size) is record max_index : Pcte.natural := 0; element_array : elements (1 .. array_size); end record; type sequence is access sequence_info; --type sequence is access Pcte.integer; EMPTY_SEQUENCE: constant Pcte.sequence.sequence := Null; end sequence; -------------------------------- PCTE REFERENCES -------------------------------- type attribute_reference is new Pcte.string; package attribute_references is new Pcte.sequence (Pcte.attribute_reference); -- Pcte.attribute_reference corresponds to the PCTE datatype Attribute_reference. type link_reference is new Pcte.string; -- Pcte.link_reference corresponds to the PCTE datatype Link_reference. --% NOTE: The following subpackage will be at least partially supported by --% Ada binding to PCTE 1.5 package reference is --type object is limited private ; type object is private ; IN_WORKING_SCHEMA: constant Pcte.reference.object; CURRENT_PROCESS: constant Pcte.reference.object; LOCAL_WORKSTATION: constant Pcte.reference.object; LOCAL_EXECUTION_SITE: constant Pcte.reference.object; -- Pcte.reference.object corresponds to the PCTE datatype Object_reference -- with the associated operations defined in the package Pcte.reference. subtype pathname is Pcte.string; -- Pcte.reference.pathname corresponds to the PCTE datatype Pathname. type evaluation_point is (NOW, ON_FIRST_USE, ON_EVERY_USE); -- Pcte.reference.evaluation_point corresponds to the PCTE datatype Evaluation_point. type evaluation_status is (INTERNAL, EXTERNAL, UNDEFINED); -- Pcte.reference.evaluation_status corresponds to the PCTE datatype Evaluation_status. type equality is (TRUE, FALSE, UNEVALUATED); -- Pcte.reference.equality corresponds to the PCTE datatype Reference_equality. -- 23.2.1 REFERENCE_COPY procedure copy ( reference : in Pcte.reference.object; to : out Pcte.reference.object; evaluate : in Pcte.reference.evaluation_point; status : in Pcte_error.handle := EXCEPTION_ONLY); -- 23.2.2 REFERENCE_GET_EVALUATION_POINT function get_evaluation_point ( reference : Pcte.reference.object; status : Pcte_error.handle := EXCEPTION_ONLY) return Pcte.reference.evaluation_point; -- 23.2.3 REFERENCE_GET_PATH --% function get_path will be implemented for 1.5 function get_path ( reference : Pcte.reference.object; status : Pcte_error.handle := EXCEPTION_ONLY) return Pcte.reference.pathname; -- 23.2.4 REFERENCE_GET_STATUS function get_status ( reference : Pcte.reference.object; status : Pcte_error.handle := EXCEPTION_ONLY) return Pcte.reference.evaluation_status; -- 23.2.5 REFERENCE.SET_ABSOLUTE --% procedure set_absolute will be implemented for 1.5 procedure set_absolute ( new_reference : out Pcte.reference.object; evaluate : in Pcte.reference.evaluation_point; path : in Pcte.reference.pathname; status : in Pcte_error.handle := EXCEPTION_ONLY); -- 23.2.6 REFERENCE.SET_RELATIVE procedure set_relative ( new_reference : out Pcte.reference.object; reference : in Pcte.reference.object; evaluate : in Pcte.reference.evaluation_point; relative_path : in Pcte.reference.pathname; status : in Pcte_error.handle := EXCEPTION_ONLY); -- 23.2.7 REFERENCE_UNSET procedure unset ( reference : in out Pcte.reference.object; status : in Pcte_error.handle := EXCEPTION_ONLY); -- 23.2.8 REFERENCES_ARE_EQUAL function are_equal ( left_reference : Pcte.reference.object; right_reference : Pcte.reference.object; status : Pcte_error.handle := EXCEPTION_ONLY) return Pcte.reference.equality; -- added for pcte 1.5 binding procedure set_reference_id ( reference : in out Pcte.reference.object; id : in Pcte.integer); function get_reference_id (reference : in Pcte.reference.object) return Pcte.integer; private -- implementation-defined type pathname_ptr is access pathname; type object is record id : Pcte.integer; path : pathname_ptr; status : evaluation_status; eval_pt : evaluation_point; end record; IN_WORKING_SCHEMA : constant Pcte.reference.object := (-1, null, UNDEFINED, NOW); LOCAL_WORKSTATION : constant Pcte.reference.object := (-2, null, UNDEFINED, NOW); CURRENT_PROCESS : constant Pcte.reference.object := (-3, null, UNDEFINED, NOW); LOCAL_EXECUTION_SITE : constant Pcte.reference.object := (-4, null, UNDEFINED, NOW); end reference; subtype object_reference is Pcte.reference.object; -- Pcte.object_reference renames Pcte.reference.object in order to have -- homogeneous reference type declarations (i.e. Pcte.xxx_reference). package object_references is new Pcte.sequence (Pcte.object_reference); -- Pcte.object_references.sequence corresponds -- to the PCTE datatype set of Object_designator. type type_reference is new Pcte.string; package type_references is new Pcte.sequence (Pcte.type_reference); -- Pcte.type_reference corresponds to the PCTE datatype Type_reference. ---------------- PCTE TYPE NAMES and TYPE IDENTIFIERS ---------------- subtype type_name is Pcte.type_reference; -- Pcte.type_name corresponds to the PCTE datatype Type_name. subtype type_identifier is Pcte.type_reference; -- Pcte.type_identifier corresponds to the PCTE datatype Type_identifier. -- 23.3.1 TYPE_NAME_CONVERT_TO_IDENTIFIER function convert ( name : Pcte.type_name; status : Pcte_error.handle := EXCEPTION_ONLY) return Pcte.type_identifier; -- 23.3.2 TYPE_IDENTIFIER_CONVERT_TO_NAME function convert ( sds : Pcte.reference.object; identifier : Pcte.type_identifier; status : Pcte_error.handle := EXCEPTION_ONLY) return Pcte.type_name; -------------------- PCTE TYPES Related to ATTRIBUTES -------------------- subtype enumeration_item is Pcte.type_reference; -- Pcte.enumeration_item corresponds to the PCTE datatype Enumeration_item_type. type value_type_identifier is ( UNTYPED, INTEGER_TYPE, NATURAL_TYPE, BOOLEAN_TYPE, TIME_TYPE, FLOAT_TYPE, STRING_TYPE, ENUMERATION_TYPE); -- Pcte.value_type_identifier corresponds to the PCTE datatype Value_type_identifier; -- On input, UNTYPED is used to indicate absence of -- an attribute value (to set the corresponding attribute to its -- initial value). -- On output, UNTYPED does not appear; -- ENUMERATION_TYPE indicates an enumeration item type, -- defined by a value of type Pcte.enumeration_item -- corresponding to a type reference. type attribute_value ( type_is : Pcte.value_type_identifier := UNTYPED; string_length : Pcte.string_length := 0) is record case type_is is when UNTYPED => null ; when BOOLEAN_TYPE => boolean_value : Pcte.boolean; when NATURAL_TYPE => natural_value : Pcte.natural; when INTEGER_TYPE => integer_value : Pcte.integer; when FLOAT_TYPE => float_value : Pcte.float; when TIME_TYPE => time_value : Pcte.calendar.time; when STRING_TYPE => string_value : Pcte.string (1..string_length); when ENUMERATION_TYPE => enumeration_value : Pcte.enumeration_item (1..string_length); end case ; end record ; type attribute_assignment ( attribute_length : Pcte.string_length := 0; type_is : Pcte.value_type_identifier := UNTYPED; string_length : Pcte.string_length := 0) is record attribute : Pcte.type_reference(1..attribute_length); value : Pcte.attribute_value(type_is, string_length); end record ; -- Pcte.attribute_assignment corresponds to the PCTE datatype -- Attribute_assignment. Pcte.attribute_value is the type of the -- value field, and is discriminated by the type of the attribute value. package attribute_assignments is new Pcte.sequence (attribute_assignment); -- Pcte.objects.attribute_assignments corresponds to the PCTE -- datatype seq of Attribute-assignment. ---------------------- PCTE TYPES Related to LINKS ---------------------- type category is ( COMPOSITION_LINK, EXISTENCE_LINK, REFERENCE_LINK, DESIGNATION_LINK, IMPLICIT_LINK); -- Pcte.category corresponds to the PCTE datatype Category. type set_of_categories is array (Pcte.category) of Pcte.boolean; -- Pcte.set_of_categories corresponds to the PCTE datatype set of Category. subtype key is Pcte.string; -- Pcte.key corresponds to the PCTE datatype Key. type object_scope is (ATOMIC, COMPOSITE); -- Pcte.object_scope corresponds to the PCTE enumeration datatype ATOMIC | COMPOSITE. ---------------------- PCTE TYPES Related to OBJECTS ---------------------- -- subtype exact_identifier is Pcte.string(1 .. implementation-defined ); subtype exact_identifier is Pcte.string(1 .. 32); -- Pcte.exact_identifier corresponds to the PCTE datatype Exact_identifier. end Pcte;