      SUBROUTINE SYMBL
C 
C 
C     THIS SUBROUTINE IS USED TO FORM A SYMBOL AND ITS INDEX
C     INTO THE SYMBOL TABLE 
C 
C   
      DIMENSION ITERM(4)
      INTEGER FTYPE
      REAL ITABV(249)
      COMMON ICRD,IPRT,MCFLE,IDFLE,MCREC,IDREC,IFORM,ITRUN,ILOUT,IXCOL
      COMMON MLAB,MOPC,IBIT,ICCNT,IWORD,IERRL,IERRI,IEND,IFRMC
      COMMON LSOR,LIF,LSYM,LREF,LDEF,LOCT,ITRMI,ITRMO
      COMMON ILEN,KLEN,LLEN,KWORD,IFLD(2400),IYFLD,IZFLD
      COMMON IFBIT,ZVAL,CVAL,JREAD,IN(80),INB(80),LINE,IPAGE,LISN 
      COMMON IALPH(37),IAST,IDOLR,ISHRP 
      COMMON ICOLN,IBLNK,ICTAB,ISEMI,ICOMM,IPLUS,IMIN,IMULT,IDIV
      COMMON IRPAR,ILPAR,IATT(9),JATT(5),LATT(9),IFPAR(16),NBASE,JBASE
      COMMON ICOL,IFCOL,MCOL,MLCOL,IOLIN,ICNT,LTITL(50),IADDR(4,12) 
      COMMON ITYPE,JTYPE,FTYPE,IERR,IERRS,IOPVA,JCOL,IBUG 
      COMMON ITAB(4,249),ITABS(249),ITABV,NAME(4),INDEX,INDET,ISYM,LTAB 
      COMMON IXTAB(256),MXREF,IXT,IXPNT,IXCNT,IXPAG,MCORE(128) 
C INCLUDE(:F1:METAD.COM)
      EQUIVALENCE (ITERM(1),IBLNK)
      EQUIVALENCE (ICHR0,IALPH(1)),(ICHR9,IALPH(10))
      EQUIVALENCE (IPERD,IALPH(37))
      EQUIVALENCE (ICHRA,IALPH(11)),(ICHRZ,IALPH(36))
C 
C     ENTRY PARAMETERS
C        ICOL - STARTING COLUMN OF SCAN
C    EXIT PARAMETERS
C        NAME - CONTAINS NUMERIC EQUIVALENT OF SYMBOL
C        ICOL - COLUMN FOLLOWING SYMBOL
C        IERR - ERROR STATUS
C           1 = SYMBOL ENDS WITH A BLANK, COMMA, OR SEMICOLON 
C           2 = SYMBOL ENDS WITH OTHER THAN BLANK,COMMA,SEMICOLON 
C           3 = SYMBOL ERROR
C 
      LABCT = 0 
      DO 10 J=1,IWORD 
      NAME(J) = 0 
10    CONTINUE
      IC1 = 1 
      IC2 = 1 
C     CHECK FOR VALID CHARACTER 
100   ICHAR = IN(ICOL)
      J = 37
      IF(ICHAR .EQ. IPERD) GO TO 130
      IF(ICHAR .LT. ICHR0) GO TO 112
      IF(ICHAR .GT. ICHRZ) GO TO 112
      J = (ICHAR.AND.255)-54
      IF(ICHAR .GE. ICHRA) GO TO 130
      J = (ICHAR.AND.255)-47
      IF(ICHAR .LE. ICHR9) GO TO 130
C     END OF SCAN IF FOUND INVALID CHARACTER
112   IF(LABCT) 115,930,115 
115   IF(IC2-ICCNT) 116,116,120 
116   DO 117 J=IC2,ICCNT
      NAME(IC1) = NAME(IC1)*256 
117   CONTINUE
C     CHECK FOR BLANK OR COMMA
120   DO 122 I=1,4
      IF(IN(ICOL)-ITERM(I)) 122,900,122 
122   CONTINUE
      GO TO 920 
C     CHECK IF MORE CHARACTER THAN WILL FIT IN TABLE
130   IF(LABCT-MLAB) 132,160,160
132   IF(LABCT) 134,134,140 
134   IF(ICHAR .EQ. IPERD) GO TO 140
      IF(J .LE. 10) GO TO 930
140   LABCT = LABCT+1 
      IF(IC2-ICCNT) 150,150,142 
142   IC1 = IC1+1 
      IC2 = 1 
150   IC2 = IC2+1 
C     FORM SYMBOL FOR PLACEMENT IN TABLE
      NAME(IC1) = NAME(IC1)*256+J 
160   IF(ICOL-MCOL) 162,930,930 
162   ICOL = ICOL+1 
      GO TO 100 
C     SYMBOL ENDS WITH A BLANK, COMMA, OR SEMICOLON 
900   IERR = 1
      RETURN
C     SYMBOL ENDS WITH OTHER THAN A BLANK, COMMA, OR SEMICOLON
920   IERR = 2
      RETURN
C     SYMBOL ERROR
930   IERR = 3
      RETURN
      END 
SYMBOL ERROR
930   IERR = 3
      RETURN
      END 
