Sather Home Page

Section 8.3.2.5:
CONTROL_CODES

immutable class CONTROL_CODES

Formal Types

types

SAME = CONTROL_CODES ;
CONTROL_CODES = token ;

This class implements ISO 6429 control code names and properties.

Reader Routines

The names of the codes are specified in the following table - all routines return a control code.

NUL START_OF_HEADING START_OF_TEXT
END_OF_TEXT END_OF_TRANSMISSION ENQUIRY
ACKNOWLEDGE ALERT BACKSPACE
HORIZONTAL_TAB LINE_FEED VERTICAL_TAB
FORM_FEED CARRIAGE_RETURN SHIFT_OUT
SHIFT_IN DATA_LINK_ESCAPE DC1
DC2 DC3 DC4
NEGATIVE_ACKNOWLEDGE SYNCHRONOUS_IDLE END_OF_TRANSMISSION_BLOCK
CANCEL END_OF_MEDIUM SUBSTITUTE
ESCAPE FILE_SEPARATOR GROUP_SEPARATOR
RECORD_SEPARATOR UNIT_SEPARATOR DELETE
PADDING_CHARACTER HIGH_OCTET_PRESET BREAK_PERMITTED_HERE
NO_BREAK_HERE INDEX NEXT_LINE
START_OF_SELECTED_AREA END_OF_SELECTED_AREA CHARACTER_TABULATION_SET
CHARACTER_TABULATION_WITH_JUSTIFICATION LINE_TABULATION_SET
PARTIAL_LINE_FORWARD PARTIAL_LINE_BACKWARD REVERSE_LINE_FEED
SINGLE_SHIFT_TWO SINGLE_SHIFT_THREE DEVICE_CONTROL_STRING
PRIVATE_USE_ONE PRIVATE_USE_TWO SET_TRANSMIT_STATE
CANCEL_CHARACTER MESSAGE_WAITING START_OF_GUARDED_AREA
END_OF_GUARDED_AREA START_OF_STRING SINGLE_GRAPHIC_CHAR_INTRODUCER
SINGLE_CHARACTER_INTRODUCER CONTROL_SEQUENCE_INTRODUCER STRING_TERMINATOR
OPERATING_SYSTEM_COMMAND PRIVACY_MESSAGE APPLICATION_PROGRAM_COMMAND


is_valid

This predicate returns true if and only if the given numeric argument is a valid bit-pattern for representation of a control code.

is_valid (
val : CARD
) : BOOL
Formal Signature
is_valid(val : CARD) res : SAME
Pre-condition

Since this operation is a predicate then this pre-condition is vacuously true.

Post-condition

Note that this post-condition performs an abstract character code creation in order to determine if the result is in the domain of the character repertoire. Such an operation could not be performed in general with executable code. It is used solely for specification purposes.

post let val_set : set of SAME = (NUL, ..., APPLICATION_PROGRAM_COMMAND) in
      create(val) in set val_set

This predicate returns true if and only if the bit-pattern of the numeric argument is a valid control code representation.


create

This feature creates a control code from the given numeric value, used as a bit-pattern.

create (
val : CARD
) : SAME
Formal Signature
create(val : CARD) res : SAME
Pre-condition
pre is_valid(val)
Post-condition
post let loc_res : seq of OCTET be st loc_res = res in
      loc_res = [OCTET.create(val)]

This feature creates a new control code which has the bit-pattern representation which is the same as the value given.


is_space

This predicate returns true only if self is an encoding for a control function which occupies space on a presentation medium.

is_space : BOOL
Formal Signature
is_space(self : SAME) res : BOOL
Pre-condition

Since this feature is a predicate and the argument is not optional then this pre-condition is vacuously true.

Post-condition
post let loc_sp : set of SAME = (BACKSPACE, ..., CARRIAGE_RETURN) in
      self in set loc_sp

This predicate returns true if and only if self is an encoding for a control function which produces unmarked space on a presentation medium.


card

This feature returns the numeric value of the bit-pattern of self as a cardinal number.

card : CARD
Formal Signature
card(self : SAME) res : CARD
Pre-condition

Since the argument is not optional then this pre-condition is vacuously true.

Post-condition
post create(res) = self

This feature returns the cardinal number corresponding to the code value (as a bit-pattern) of self.


Language Index Library Index Codes Index
Comments or enquiries should be made toKeith Hopper.
Page last modified: Tuesday, 24 April 2001.
Produced with Amaya