next up previous contents index
Next: JZ91 Services Up: The JZ91 Package---Principles Previous: The JZ91 Package---Principles

Purpose

The MZ package of ZEBRA helps the user to organize his data. The purpose of the present JZ91 package is to assist him in structuring his program. It allows to formalize the concept of ``program module'' beyond the mere subroutine and it provides the back-up service for these modules.

It is at the design stage of a program, rather than later, that the advantage of the JZ91 package will be most strongly felt, since it provides a frame-work for the design; again just like with the data structures of ZEBRA.

The program we are talking about will be designed as a collection of modules called ``processors''. The art consists in designing processors with interfaces as simple and logical as possible, and entirely documentable.

A given processor has a given task which formalizes into a transformation of the input data structure or rather sub-structure. The result may be a modification of the input structure, or a new output structure, or just printed output and the like.

The processor is controlled by what is essentially a parameter list. Normally this list contains pointers to the sub-structure the processor is to work with. Since links have to be held on relocatable memory the parameter list is passed in a special purpose bank, the ``call bank'', containing reference links and data words. This call bank is filled with the input parameters by the higher level code which calls the processor. The processor takes them from there and also places back into the same call bank any output parameters, in particular links to the output data structure, if any has been lifted. Clearly the content of the call bank is part of the specification of the processor.

A processor may call other processors. This is not to say that a good design should aim at having processors at several levels. On the contrary, the fewer levels one can do with the better, of course. Also, one should not write trivial processors where simple subroutines will do.

By convention, every processor is entitled to have the ZEBRA working space near the beginning of Q freely to itself. As a result a processor calling another processor looses at that moment the content of its working space. Its dimensions are saved by JZ91, and they are automatically restored when control comes back to the calling processor, ie. it does not have to call MZWORK again. As an extra facility, JZ91 may be asked to save and restore also the contents of the first so many links and of the first so many data words of the working space.



next up previous contents index
Next: JZ91 Services Up: The JZ91 Package---Principles Previous: The JZ91 Package---Principles


Janne Saarela
Mon May 15 08:34:47 METDST 1995