6.3.2 Foreach loop
The main control structure of a generator loop is the foreach
loop. In a typical generator the foreach clause selects all elements of the
specified type to be operated on. A foreach loop can only be used when the
element stack contains a graph, most often as the outermost loop at the top
level of a generator. The element type to be looped over cannot be a property or
port: only objects, roles and relationships are appropriate. The operations that
will be performed on the retrieved elements are written within the curly
brackets, {}.
foreach .objType
{ /* Operations for the elements */ }