The
name of the generator to call is formed from the output between the subreport
and run keywords, that is, _do followed by the name of the object??™s type, for
example, _doIf.
Listing 7.4 ???_followFrom??? generator de?¬?nition.
Report '_followFlow'
do ~From>(Flow|False)~To.()
{
subreport '_do' type run
}
endreport
The generator begins from the Start object and calls _followFlow from it.
Each object type??™s generator handles its own line or lines of output and then
calls _followFlow again, making a simple recursion step through the model. The
generator for the Stop object does not recurse, and thus the generation ?¬?nishes
there.
The _doIf generator handles the FALSE path as normal sequential ?¬‚ow with the
_followFlow generator. The TRUE path, however, is handled by outputting an
assembly language test statement followed by a conditional jump to the label speci?¬?ed
by the GotoPoint, without any recursion to follow the code on from the label. This
avoids the problem of an in?¬?nite cycle or duplicate code (see Section 11.3.5 for more
on this issue in general).
Text and SystemCall objects may contain several TextFragment or Command
objects, leading to several lines of output, for example, the ?¬?rst ?¬?ve lines of Listing
7.3. These are handled simply by iterating over the contained objects as shown
in Listing 7.
Pages:
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298