Next:
Interpretation of Element Up: The FORALL Statement Previous: The FORALL Statement


General Form of Element Array Assignment

Rule R215 in the Fortran 90 standard for executable-construct is extended to include the forall-stmt.

XBNF forall-stmt -to -rule to to is FORALL forall-header forall-assignment

forall-header -to -rule to to is ( forall-triplet-spec-list [ , scalar-mask-expr ] ) XBNF

XBNF forall-triplet-spec -to -rule to to is index-name = subscript : subscript [ : stride ] XBNF

XBNF forall-assignment -to -rule to to is assignment-stmt -to or pointer-assignment-stmt XBNF

To determine the set of permitted values for each index-name in the forall-header, we introduce some simplifying notation. In the forall-triplet-spec, let

  • be first subscript (``lower bound'');
  • be second subscript (``upper bound'');
  • be the stride; and
  • be .

If stride is missing, it is as if it were present with the value 1. Stride must not have the value 0. The set of permitted values is determined on entry to the statement and is , . If for some index-name, the forall-assignment is not executed.

A FORALL statement assigns to memory locations specified by the forall-assignment for permitted values of the index-name variables. A program that causes multiple values to be assigned to the same location is not HPF-conforming and therefore has no defined meaning. This is a semantic constraint rather than a syntactic constraint, however; in general, it cannot be checked during compilation.



Next:
Interpretation of Element Up: The FORALL Statement Previous: The FORALL Statement

paula@erc.msstate.edu
Thu Jul 21 17:05:43 CDT 1994