As
the metamodel is made so that message elements are actually return variables given in
01 Report '_next choiced element'
02 /* Reports next choiced element for lists and popups */
03 do ~From choice {
04 /* If there is specified value in Choice property */
05 if :Choice <>'' then
06 ' elif choices' oid;1 '[index] == u"' :Choice '":'
newline
...
22 /* If Choice property is not specified */
23 if :Choice ='' then
24 do >Flow~To.() {
25 ' else:' newline
26 ' return (' subreport '_Internal name' run', '
27 subreport '_non-stack elements' run')' newline
28 }
29 endif
30 }
31 endreport
GENERATOR FOR PYTHON 179
design models, this allows access to data given elsewhere in the application. Lines 10??“
19 create the message content as a string that is then used as a parameter when calling
the Python for S60 API in line 21. Finally, line 22 calls a commonly used generator
module to create a navigation call to the next function.
Listing 8.3 Code generator for sending text messages.
As can be seen for the generator de?¬?nition, Python also sets layout requirements for
the code generation de?¬?nition: indentation is used to express nesting. This Python
feature made generator de?¬?nition a little more tedious but also required creating nearduplicate
generator modules. For example, the only generator difference between a
normal function de?¬?nition and the Listbox content creation function is that the latter is
indented to be part of the Listbox function.
Pages:
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336