DEFINITION MODULE SACSYM2;

(* SAC Symbol 2 Definition Module. *)


FROM MASSTOR IMPORT LIST;


PROCEDURE STBAL(L,n: LIST): LIST;
(*Symbol tree balance. L is an alphabetical list of n symbol-tree 
nodes (n gt 0), out of which a balanced binary tree S is constructed. *)


PROCEDURE STBALS(VAR A: ARRAY OF LIST; l, r: INTEGER): INTEGER;
(*Symbol tree balance subroutine. The array A contains symbol-tree
nodes in alphabetical order. The binary tree of the symbols in
A[l..r] is constructed and A[m] is its root. *)


PROCEDURE STNLST(T: LIST; VAR L,n: LIST);
(*Symbol tree nodes list. T is a non-empty symbol tree.
L is the list of its nodes in alphabetical order of the 
corresponding symbols and n the number of nodes. This algorithm
is normally used for creating the data as required for STBAL. *)


PROCEDURE SSYTBAL;
(*System symbol tree balance. SYMTB is balanced. *)


END SACSYM2.