DEFINITION MODULE SymbolTable;
(* Initializes symbol table.  Maintains list of all labels, *)
(* along with their values.  Provides access to the list.   *)

   FROM LongNumbers IMPORT
      LONG;

   FROM Parser IMPORT
      TOKEN;


   EXPORT QUALIFIED
      FillSymTab, SortSymTab, ReadSymTab, ListSymTab;


   PROCEDURE FillSymTab (Label : TOKEN; Value : LONG; VAR Full : BOOLEAN);
   (* Add a symbol to the table *)

   PROCEDURE SortSymTab (VAR NumSyms : CARDINAL);
   (* Sort symbols into alphabetical order *)

   PROCEDURE ReadSymTab (Label : ARRAY OF CHAR; 
                         VAR Value : LONG; VAR Duplicate : BOOLEAN) : BOOLEAN;
   (* Passes Value of Label to calling program -- returns FALSE if the *)
   (* Label is not defined.  Also checks for Multiply Defined Symbols  *)

   PROCEDURE ListSymTab (i : CARDINAL; VAR Label : TOKEN; VAR Value : LONG);
   (* Returns the i-th item in the symbol table *)

END SymbolTable.
