PowerAda 21

From OC Systems Wiki!
< PowerAda:APPENDIX C. Implementation Characteristics‎ | Annex M
Revision as of 09:48, 24 April 2019 by imported>WikiVisor
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

(21) Implementation-defined attributes.

See 4.1.4(12).

The following attributes that were part of the Ada83 standard are provided as implementation-defined attributes to maintain compatibility.

  • S'EPSILON
  • S'MANTISSA
  • S'EMAX
  • S'SMALL
  • S'LARGE
  • S'SAFE_EMAX
  • S'SAFE_SMALL
  • S'SAFE_LARGE

The following additional implementation-defined attributes are provided.

T'EXTENDED_BASE

For a type T returns the base type of T. This attribute is allowed only as the prefix of the name of another attribute. (This is the old Ada83 'BASE attribute.)

T'EXTENDED_IMAGE(Item, Width, Base, Based, Space_If_Positive)

Returns the image of type STRING associated with a specified item as defined for the PUT procedure in TEXT_IO generic package appropriate for type T (e.g., TEXT_IO.INTEGER_IO(T) if T is an integer type). T may denote an integer, enumeration, floating point or fixed point type name. Named parameter notation may not be used. The parameters are:

Item : T
the item for which you want the image. Required.
Width : Field := 0
the minimum number of characters to be in the string that is returned.
Base : Number_Base := 10
the base in which the image is to be displayed.
Based : Boolean := FALSE
if TRUE, return the string in based format (e.g., 10#99#).
Space_If_Positive : Boolean := FALSE
if TRUE, a positive integer will be preceded by a blank in the string returned.
T'EXTENDED_VALUE(Item)

Returns the value of type T associated with Item as defined for the GET procedure in the TEXT_IO generic package appropriate for type T (e.g., TEXT_IO.INTEGER_IO(T) if T is an integer type). T may denote an integer, enumeration, floating point, or fixed point type.

Item
is the STRING for which you want the value.
T'EXTENDED_WIDTH(Base, Based, Space_If_Positive)

Returns the width for (sub)type T. T may be integer or enumeration type. All the parameters are optional. They are:

Base : Number_Base := 10
the base for which the width will be calculated.
Based : Boolean := FALSE
if TRUE, compute the width of the based format (e.g., 10#99#).
Space_If_Positive : BOOLEAN := FALSE
if TRUE, compute the width assuming that a positive integer will be preceded by a blank.
T'EXTENDED_WIDE_IMAGE(Item, Width, Base, Based, Space_If_Positive)

Returns the image of type WIDE_STRING associated with a specified item as defined for the PUT procedure in TEXT_IO generic package appropriate for type T (e.g., TEXT_IO.INTEGER_IO(T) if T is an integer type). T may denote an integer, enumeration, floating point or fixed point type name. Named parameter notation may not be used. The parameters are:

Item : T
the item for which you want the image. Required.
Width : Field := 0
the minimum number of characters to be in the string that is returned.
Base : Number_Base := 10
the base in which the image is to be displayed.
Based : Boolean := FALSE
if TRUE, return the string in based format (e.g., 10#99#).
Space_If_Positive : Boolean := FALSE
if TRUE, a positive integer will be preceded by a blank in the string returned.
T'EXTENDED_WIDE_VALUE(Item)

Returns the value of type T associated with Item as defined for the GET procedure in the TEXT_IO generic package appropriate for type T (e.g., TEXT_IO.INTEGER_IO(T) if T is an integer type). T may denote an integer, enumeration, floating point, or fixed point type.

Item
is the WIDE_STRING for which you want the value.
T'EXTENDED_WIDE_WIDTH(Base, Based, Space_If_Positive)

Returns the width for (sub)type T. T may be integer or enumeration type. All the parameters are optional. They are:

Base : Number_Base := 10
the base for which the width will be calculated.
Based : Boolean := FALSE
if TRUE, compute the width of the based format (e.g., 10#99#).
Space_If_Positive : BOOLEAN := FALSE
if TRUE, compute the width assuming that a positive integer will be preceded by a blank.
T'EXTENDED_DIGITS(Base)

Returns the number of digits using Base in the mantissa of model numbers in the floating point subtype T. The optional parameter is:

Base : Number_Base := 10
the base that the subtype is defined in
T'EXTENDED_FORE(Base, Based)

Returns the minimum number of characters required for the integer part of the representation of the fixed point subtype T. All parameters are optional. They are:

Base : Number_Base := 10
the base in which the digits will be represented.
Based : Boolean := FALSE
if TRUE, compute the width of the based format (e.g., 10#99.0#).
T'EXTENDED_AFT(Base, Based)

Returns the minimum number of characters required for the fractional part of the representation of the fixed point subtype T. All parameters are optional. They are:

Base : Number_Base := 10
the base in which the digits will be represented.
Based : Boolean := FALSE
if TRUE, compute the width of the based format (e.g.,10#99.0#).