      subroutine parser(nwords,ncharacters,parsed_word,char_string)

c  this subroutine written by alain st-amant of the department of
c  pharmaceutical chemistry, university of california, san francisco.
c  all rights reserved.  this is part of the DeFT project.

      character char_string*79

      character*32 parsed_word(*)

      dimension ncharacters(*)

      nwords=0

      n=1

      read(5,1001) char_string
 1001 format(a78)

      char_string(79:79)=' '

      do 1002 i=1,40
      do 1002 j=1,32
 1002 parsed_word(i)(j:j)=' '

 1003 if(char_string(n:n).eq.' ') then
                                        n=n+1
                                        goto 1003
                                  endif

      if(n.gt.78) return

      nwords=nwords+1

      nn=n

 1004 if(char_string(n:n).ne.' ') then

          n=n+1
          goto 1004

                                  else

          ncharacters(nwords)=n-nn
          parsed_word(nwords)(1:ncharacters(nwords))=char_string(nn:n-1)
          call makeuppercase(parsed_word(nwords),ncharacters(nwords))

                                  endif

      if(n.gt.78) return

      goto 1003

      end
