• Aucun résultat trouvé

BIRTH, 2 WOMAN, 3 NAME, 3 DATE, 2 COMPLEXION;

Elements are then referred to as:

MAN. NAME

or MARRIAGE.MAN.N1'>..ME MARRIAGE. WOMAN. NAME

BIRTH. NAME

or BIRTH. WOMAN. NAME COMPLEXION

and the minor structures referred to as:

MARRIAGE. WOMAN BIRTH. WOMAN SUBSCRIPTED QUALIFIED NAMES

The elements of an array contained in a structure and requiring name qualification for identification are referred to by sub-scripted qualified names. A subscripted qualified name is a sequence of names and subscripted names separated by periods.

T~e order of names is as given for any qualified name. The subscript list follow-ing each name refers to the dimensions associated with the name if the name is declared to be the name of an array in the structure description.

As long as the order of the subscripts remains unchangerl, subscripts may be moved to the right and attached to names at a deeper level. Unless all of the subscripts are moved to the deepest level, the quali-fied name is said to have interleaved subscripts.

Provided that sufficient structure names are used to make the name unique, as described for qualified narr.es, and that the total number of subscripts is the same as the total dimensionality of the array, unsubscripted structure names may be omit-ted in references. Ambiguity of names, however, cannot be resolved by subscript-ing. A subscripted qualified name takes the general form:

identifier (subscript [, subscript]

...

) ]

{. identifier [(subscript [, sub-script] ••• )] } •••

If any subscripts are given in a. ref-erence to a qualified name, all those subscripts which apply to dimensions of

The following subscripted qualified names refer to the same element, which is the seventh element of C contained in the fifth element of B contained in tenth row and twelfth column of A:

(1) (2) (3) (4) (5) (6) (7) (8) (9)

A ( 1 0, 1 2) B ( 5 ) A ( 1 O) B ( 1 2 , 5 )

A (10) B (12)

C (7) C (7) C (5, 7) C (7) C (5,7) A . B (10,12,5)

A. B (10, 12)

A . B (10) C (12,5,7)

A . B . C ( 1 0 , 1 2 , 5 , 7) A (10, 12) B . C (5,7) A (10) B . C (1 2 , 5, 7)

If structure B, but not structure A, is necessary for unique identification of this use of C, any of forms (4), (5), (6), or

(7) may be used without including the A.

If structure A, but not B, is necessary for identification of C, forms (7), (8), or

(9) may be used without including the B.

Except for form (7), all of the quali-fied names in the above example have inter-leaved subscripts.

STATEMENT LABELS

Statement-label data is used only in connection with statement labels.

Statement-label data may be a constant, a scalar variable, or an array.

CONSTANT

A statement-label constant is an iden-tifier that permits references to be made to statements.

Example:

ROUTINE1: IF X > 5 THEN GO TO EXIT;

containing structures must be given. GO TO ROUTINE1;

A subscripted qualified name must have at least one subscript.

Examples:

A is an array of structures with the following description:

DECLARE 3 D;

A (10, 12) 2 B (5), 3 C (7) ,

ROUTINE1 is a statement-label constant.

EXIT is also a statement-label.

VARIABLE

A label variable is a variable that has as values statement-label constants.

Example:

DECLARE X LABEL;

X POSROUTINE;

POSROUTINE:

X NEGROUTINE;

GO TO X;

NEGROUTI'NE:

The label variable X may have the values of' ei the:r POSROUTINE or NEGROUTINE, both labels :in the procedure. In the above example, GO TO X transf'ers control to NEGROUTIll'1E.

A statement--Iabel constant or a scalar label variable is called a statement-label designator.

ARRAY

A scalar label variable may be sub-scripted if i t refers to an element of an array declared t:o have the attribute LABEL.

A label array must be explicitly declared to have 1:he attribute LABEL (see Chapter 4) •

Example:

DECLARE CALCULATION (4) LABEL INITIAL (A, B, C, D) ;

A: X

x *

Y + Z;

B: IF X > Y THEN GO TO EXIT;

GO TO CALCULATION (2);

The GO TO statement t.ransfers control to label B by means of referring to the proper element of the CALCULATION label array, provided the variable CALCULATION (2) has not changed in value.

Initial Values for Label Arrays

Although the INITIAL attribute may be used to initialize label arrays, there is an alternate method of doing this.

If a label array element appears in a block, followed by a colon, subscripts must

be optionally Signed decimal integer con-stants.

The eff'ect of preceding a statement with a subscripted reference is as follows:

1. An INITIAL attribute is constructed for the label array and added to the declaration.

2. A label constant is constructed for the statement carrying the subscripted reference. This label constant is appropriately placed, with respect to the specified subscripts, in the INI-TIAL attribute.

A label array may not be initialized by using both this form of initialization and the INITIAL attribute in the declaration of the label array in the DECLARE statement.

Also, this form of initialization can not be used for STATIC label arrays.

Example:

DECLARE Z (3) LABEL;

Z (1) : IF X > Y THEN GO TO EXIT;

Z (2) : A A + B + C

*

D;

Z (3) : A A + 10;

GO TO Z (I) ;

Statements are given subscripted ref-erences (Z (1t, Z (2) , and Z (3) ) . Transfer 1S made to a particular Z by means of giving I the value of 1, 2, or 3.

TASK NAMES

Task namES are used only in connection with tasks (see "Asynchronous Operations and Tasks," in Chapter 6 and "The TASK Attribute, n in Chapter 4). 'Iask names may have the dimension attribute or may be elements of structures. A task name has an associated priority number which may be assigned in the CALL statement (see Chapter 8) or in an assignment statement using the PRIORITY pseudo-variable (see Chapter 8) •

EVENT NAMES

Event names are used only in connection with events (see "Asynchronous Operations and Tasks, " in Chapter 6 and liThe EVENT Attribute," in Chapter 4). EVent names may have the dimension attribute or may be elements of structures. A simple event name has an associated completion status.

This status is denoted by the value 'O'B

for "not completed" and '1'B for

"completed". If the event name has been associated with a given task through the use of an EVENT option in a CALL statement (see Chapter 8), the completion status of the event name will reflect the cOIfipletion status of trle task itself. The completion status of an event name may also be set explicitly by the execution of an assign-ment statement using the EVENT pseudo-variable (see Chapter 8) •

EXPRESSIONS

An expression is an algorithm used for computing a value. Expressions are of the three types: scalar, array, and structure, depending upon the types of the operands involved. The type of the result is also the same as that of the operands. An array (or structure) expression is simply an array (or structure) evaluated by expansion of the expression into a collection of scalar expressions (see nArray Expressions"

and "Structure Expressions") • Syntactically, a scalar expression consists of a constant, a scalar variable, a func-tion reference, a scalar expression enclosed in parentheses, a scalar expres-sion preceded by a prefix operator, or two scalar expressions connected by an infix operator. Operands in a scalar expression need not have the same data attributes. If they differ, conversion will be performed before the operation.

SCALAR EXPRESSIONS

A scalar expression returns a scalar value. The type of the value is the type of the expression. The type of the expres-sion is dependent upon the class of opera-tors -- arithmetic, comparison, bit string., and concatenation (see "Operators") • Statement label disignators are not allowed in scalar exp:cessions except as function arguments.

If A and B a.re expressions, then the operators + and - used in expressions of the for.m +A or -A, are called prefix operators. When these operators are used in expressions of the form A+B or A-B they are called infi,! operators.

Arithmetic Opera.tions

An arithmetic expression of any complex-i ty complex-is composc~d of a set of elementary arithmetic operations.

An el1ementary arithmetic operation has the general form:

{{+ I-} op~~rand} i {operand {+I - , * , / I **} operand}