8.6) and then for cases when a choice does not
guide navigation but is used for getting user input for later use (like the list for
selecting a payment method in Fig. 8.6).
Listing 8.2 Code generator for _next choiced element.
Line 3 follows the navigation ?¬‚ow from Pop-up (or List) based on the choice roles
leaving it. If a Choice value is speci?¬?ed on the navigation arrow, the generator produces
code for the selected choice (lines 5 and 6). Line 23 analyzes only cases where no
choice is speci?¬?ed on the arrow: it creates a single choice with the Python else
construct. It should be noted that multiple unde?¬?ned choices or several identical
choices are already checked from models: an application developer is informed about
Pop-up and List elements, that have several choices with empty or identical values.
Although such checking could be performed at code generation time, it was considered
much better to inform the developer as early as possible about errors and con?¬‚icts.
Generator Module for Accessing Phone Services On the phone service
side, Listing 8.3 describes a code generator de?¬?nition for producing code for sending
text messages. After creating a function de?¬?nition and a comment (lines 3??“4),
message elements sent (which can also include delimiters) are declared as globals, so
they can be referred to from inside the text message sending function (lines 5??“9).
Pages:
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335