4.3 Modifying a Program

Consider the program of Fig. 22. We now want to add an enter part that should enter a text to be printed after the 'Hello world' string. To add an enter part you can either select for example the descriptor of the hello pattern and type the enter part using text editing.

Figure 28

[4kb 508x246 GIF]

Another technique is to select the whole pattern declaration and use the Show optionals command in the Edit menu. The latter has been done below:

Figure 29

[5kb 508x246 GIF]

We select the EnterPartOpt nonterminal and via the pop-up menu we choose 'EnterPart' which gives the result: enter <<Evaluation>>. Then we select <<Evaluation>> and 't' is typed. Likewise we select the AttributeDeclOpt nonterminal and type: t: @text. Now we want to add an imperative after the putline. To insert a new list element in a list element is selected and the Insert After or Insert Before command of the Edit menu is used. An alternative to Insert After is to press the <cr> key.

In Fig. 23 the imperative 'hello world'->putline is selected e.g. by clicking on the arrow (->). Then the <cr> key is pressed and the result is:

Figure 30

[5kb 508x246 GIF]

The final result is:

Figure 31

[5kb 508x246 GIF]


Mjolner Integrated Development Tool - Tutorial
© 1991-2004 Mjølner Informatics
[Modified: Monday March 11th 2002 at 16:16]