module X
uses Y, Z;
exports
var A: INTEGER;
type B: array (1..10) of REAL;
procedure C(D: in out B; E: in INTEGER; F: in REAL);
function F(G : INTEGER) : INTEGER
implementation
is composed of R, T
end X
module X
uses Y, Z;
exports
var A: INTEGER;
type B: array (1..10) of REAL;
procedure C(D: in out B; E: in INTEGER; F: in REAL);
implementation
is composed of R, T
end X
module R
uses Y;
exports
var A: INTEGER;
type B: array (1..10) of REAL;
implementation
...
end R
module T
uses Y, Z, R;
exports
procedure C(D: in out B; E: in INTEGER; F: in REAL);
implementation
...
end T
function sort (a: array of REAL) : array of REAL
module MathLib
exports
function square(value : REAL) : REAL;
function squareRoot(value : Real) : REAL;
...
implementation
...
function newtonsMethod(value : REAL) : REAL
end MathLib
module Datapool
exports
var maxNumberOfUsers : INTEGER;
var maxItemsPerUser : INTEGER;
...
end Datapool
Sollte in Praxis nicht verwendet werden!
- Datenzugriff muss gekapselt sein.
module Stack
exports
procedure push(VAL : in INTEGER);
procedure pop(VAL : out INTEGER);
...
implementation
var STACK : array of INTEGER;
var STACKPOINTER : INTEGER;
end Stack
module STACK_ADT
exports
type STACK = ? // typ implementation ist abstrakt
procedure push(S : in out STACK ; VAL: in INTEGER);
procedure pop(S : in out STACK; VAL: out INTEGER);
function empty (S: in STACK) : BOOLEAN;
...
implementation
end STACK_ADT
function create() : STACK
function create() : STACK
Liskov, B., & Zilles, S. (1974, March).
Programming with abstract data types.
module GENERIC_STACK(T)
exports
procedure push(VAL : in T);
procedure pop(VAL : out T);
...
implementation
var STACK : array of T;
var STACKPOINTER : INTEGER;
end GENERIC_STACK
module INTEGER_STACK is GENERIC_STACK(INTEGER);