If users specify predicates that refer to fields of list-functor
type, special order indicators can be used to find out certain
special elements of the list. The order indicators generate an access
to specific list elements. There are the following types,
exemplified by a relation Stmts, the statements of a block:
Stmts[first](Block,S1) generates an access to the
first element S1 in the Stmts of Block.
Stmts[last](Block,S1) generates an access to the
last element S1 in the Stmts of Block.
Stmts[any](Block,S1) generates an access to an arbitrary
element S1 in the Stmts of Block. For
lists the head of the list is taken. This indicator can also be
applied to set functors. Then
it emits a call to the choose-function of the set functor.
Stmts[after in Block](S1,S2) generates a loop over all
successors S2 of S1 in the Stmts of Block.
Stmts[before in Block](S1,S2) generates a loop over all
predecessors S2 of S1 in the Stmts of Block.
Stmts[next in Block](S1,S2) generates an access to the
successor S2 of S1 in the Stmts of Block.
Stmts[prev in Block](S1,S2) generates an access to the
predecessor S2 of S1 in the Stmts of Block.
Block must be defined earlier in the
specification.
The distribution contains a demo file autotest/examples/test-list-add.ox for order indicators.