      *>----------------------------------------------------------------
      *> This is a specialization of the dictionary class which maps
      *> pic x(32) items to object references.
      *>
      *>#See class "dictinry".
      *>
      *> Copyright (C) 1995-1999 Micro Focus International Ltd.
      *>
      *>----------------------------------------------------------------
       copy "symbtab.if".
       class-id. SymbolTable inherits from Dictionary.

       class-control.
           SymbolTable is class "symbtab"
           Association is class "associtn"
           Dictionary is class "dictinry"
           CobolPicX is class "picx"
           .
       working-storage section.
       01 wsTempClass              object reference value null.
       01 wsTempAssoc              object reference value null.

       class-object.
      *>----------------------------------------------------------------
      *> Return a new instance of a symbol table
      *>----------------------------------------------------------------
       method-id. "new".

       local-storage section.
       01 lsSize                   pic x(4) comp-5.
       01 lsNilReference           object reference.

       linkage section.
       01 lnkDictionary            object reference.

       procedure division returning lnkDictionary.


           move 32 to lsSize
           if wsTempClass = null
               invoke CobolPicX "newClass" using lsSize
                                       returning wsTempClass
           end-if
           set lsNilReference to null
           if wsTempAssoc = null
               invoke Association "newClass" using wsTempClass
                                                   lsNilReference
                                         returning wsTempAssoc
           end-if
           move 5 to lsSize
           invoke self "ofValues" using wsTempAssoc
                                        lsSize
                              returning lnkDictionary
           exit method.

       end method "new".
       end class-object.
       object.
      *>----------------------------------------------------------------
      *> Store the object reference in lnkParameter in the symbol table
      *> at position lnkKey. lnkKey is a null-terminated string which
      *> can be up to 32 characters long.
      *>----------------------------------------------------------------
       method-id. "atPut".

       local-storage section.
       01 lsCount                  pic x(4) comp-5.
       01 lsKey                    pic x(32).
       linkage section.
       01 lnkKey                   pic x(32).
       01 lnkParameter             object reference.

       procedure division using lnkKey lnkParameter.
           perform varying lsCount from 1 by 1
                                   until lnkKey(lsCount:1) = x"00"
                                      or lsCount = 32
           end-perform
           move spaces to lsKey
           move lnkKey(1:lsCount) to lsKey
           invoke super "atPut" using lsKey lnkParameter
           exit method.
       end method "atPut".

      *>----------------------------------------------------------------
      *> Return the object reference in the symbol table at position
      *> lnkKey into lnkParameter. lnkKey is a null-terminated string
      *> which can be up to 32 characters long. If the symbol table does
      *> not contain the key lnkKey, then null is returned in lnkParameter.
      *>----------------------------------------------------------------
       method-id. "atOrNil".

       local-storage section.
       01 lsCount                  pic x(4) comp-5.
       01 lsKey                    pic x(32).

       linkage section.
       01 lnkKey                   pic x(32).
       01 lnkParameter             object reference.
       procedure division using lnkKey returning lnkParameter.
           perform varying lsCount from 1 by 1
                                   until lnkKey(lsCount:1) = x"00"
                                      or lsCount = 32
           end-perform
           move spaces to lsKey
           move lnkKey(1:lsCount) to lsKey
           invoke super "atOrNil" using lsKey returning lnkParameter
           exit method.
       end method "atOrNil".
       end object.
       end class SymbolTable.
