| # Section 8.10.2.3: CONDITIONALS |

###### class CONDITIONALS < $ENUMS{CONDITIONALS}

#### Formal Types

types
SAME = CONDITIONALS ;

This class implements program values for the set of keywords used in specifying culture description files, but which may also be used for some form of simple conditional compilation, etc in association with the class SOURCE(qv)

The corresponding names in the culture-dependent resources file are, for the purposes of handling cultural descriptions, required to be in Latin-1 encoding and to consist of the exact character sequence given against each of the defined values (see also ISO/IEC 14652 - section 4.3).

#### External specifications

The following feature is required to be implemented for this class in accordance with the specification given in $IS_EQ :-

- is_eq(other : SAME) : BOOL

The following feature is required to be implemented for this class in accordance with the specification given in $HASH :-

- hash : CARD

The following features are required to be implemented for this class in accordance with the specifications given in $BINARY :-

- create(storage : BINSTR) : SAME
- build(cursor : BIN_CURSOR) : SAME
- read(cursor : BIN_CURSOR) : SAME
- binstr : BINSTR
- write(fyle : BIN_FILE)

The following features are required to be implemented for this class in accordance with the specifications given in $STR :-

- str(lib : LIBCHARS) : STR
- str : STR

The following features are required to be implemented for this class in accordance with the specification given in $INSTR :-

- build(str : STR_CURSOR) : SAME
- build(str : STR_CURSOR, lib : LIBCHARS) : SAME

The following features are required to be implemented for this class in accordance with the specifications given in $ANCHORED_FMT :-

- fmt(descr : ANCHORED_DESCR, lib : LIBCHARS) : STR
- fmt(descr : ANCHORED_DESCR) : STR

The following features are required to be implemented for this class in accordance with the specifications given in $ENUMS{T} :-

- create(val : CARD) : SAME
- offset : CARD
- cardinality : CARD
- enum : CARD
- card : CARD
- is_enum(str : STR) : CONVERSION_RESULTS

#### Enumeration Values

This enumeration provides the values corresponding to the required (in ISO/IEC 14652) keywords given against each value in the following list. The description indicates the expected behaviour of a program reading source text containing the keywords - which are required to be at the beginning of a line (with no preceding white-space)and associated tags. The conditional inclusion may be nested to any depth :-

- Define - ("define") This keyword introduces a definition for a user-specified tag which may be tested in the clauses introduced by the conditional keywords which follow.
- Undefine - ("undef") This keyword deletes the given tag from those currently known to the program. Note that it is not an error if the associated tag is not defined - it will not be defined after the associated operation!
- If_Defined - ("ifdef") This keyword is expected to be followed by a tag. If the tag exists then the text on following lines will be included in the source, otherwise it will not be included.
- If_Not_Defined - ("ifndef")This keyword is expected to be followed by a tag. If the tag does not exist then the text on following lines will be included in the source, otherwise it will not be included.
- Else_If - ("elif") This keyword is expected to be followed by a tag. If the tag exists then the text on following lines will be included in the source, otherwise it will not be included.
- Else - ("else") This keyword is only valid on a line following an occurrence of any of the above three keywords. If source was included by the previous conditional then source following this keyword will not be included - and vice versa.
- End_If - ("endif") This keyword must only occur after one of the above four keywords. It terminates the conditional inclusion (or not) of source text.

| Language Index |  | Library Index |  | Input/Output Index

Comments or enquiries should be made to Keith Hopper. Page last modified: Monday, 17 July 2000. |