![]() |
Section 6.1:
|
![]() |
A Sather program has one distinguished program class and, in that class, one method is the program method. The means by which this particular class and method are distinguished is not defined by the language (see, however, Section 4.5 for implementation requirements of the translator).
The entire program consists, in addition to the distinguished program class itself, of those classes which are used directly by it and, recursively, all of those other classes in turn which they use.
Five kinds of class are specified by the above rule -
NOTE | An implementation of Sather may permit this source text to be arranged in separate text files. The source text which defines a single class or partial class must not, however, be divided among multiple files. |
A complete program consists of the definition of the distinguished class which contains the method to be invoked by the external environment when executing the program, together with all of those classes on which it (recursively) depends.
For a particular program there shall be only one distinguished program class. The identifier of this class shall not identify any other class in the set of dependent classes. The program class shall be either a reference class or an immutable class. The program class shall have a feature which has the name of the distinguished method known to the translation mechanism.
In addition to the above, which are expressed by the invariant of the abstract type, each class shall itself be well-formed and the set of classes which make up the program shall have a conforming type graph (see section 6.5.2), thus
The program state shall first be initialized from the external state as it exists before the execution of the program. Initial protection from interrupts shall be implementation-defined.
The outermost environment for program execution shall be constructed from the environments defined by those classes which form part of the program - in particular constants and all initialised shared objects are to be initialised. This shall be combined with the environment defined by the pervasive classes forming part of the program. These actions are specified as the initialisation of the environment component of the program state (see Auxiliary vdm-sl in Section 6.9 of this specification).
Execution of the program shall then start with the distinguished method in the distinguished program class.
![]() |
Specification Index | ![]() |
Language Index | ![]() |
Program examples | ![]() |
Section 6 Index |
Comments
or enquiries should be made to Keith Hopper. Page last modified: Wednesday, 25 October 2000. |
![]() |