Technical data

2
Working with the Target Language
2-20
identifier variable. %break and %continue are optional directives that you can
include in the
%foreach directive:
%break can be used to exit the nearest enclosing %for, %foreach, or %switch
statement.
%continue can be used to begin the next iteration of a loop.
%for
The syntax of the
%for
multiple inclusion directive is:
%for ident1 = const-exp1, const-exp2, ident2 = const-exp3
%body
%break
%continue
%endbody
%endfor
The first portion of the %for directive is identical to the %foreach statement in
that it causes a loop to execute from
0 to N–1 times over the body of the loop. In
the normal case, it only includes the lines between
%body and %endbody, and
the lines between the
%for and %body, and ignores the lines between the
%endbody and %endfor.
The
%break and %continue directives act the same as they do in the %foreach
directive.
const-exp2 is a Boolean expression that indicates whether the loop should be
rolled. If
const-exp2 is true, identifier1 receives the value of const-exp3,
otherwise it receives the null string. When the loop is rolled, all of the lines
between the
%for and the %endfor are included in the output exactly one time.