      SUBROUTINE MAIN
      LOGICAL*1 LINE(402)
      INTEGER GETARG, OPEN
      INTEGER I, NFILES
      LOGICAL*1 FNAMES(36, 10)
      INTEGER LEVEL
      INTEGER NXTPTR
      INTEGER COUNT
      INTEGER TRMPTR
      INTEGER*4 LINADR
      LOGICAL*1 CHAR1
      LOGICAL*1 CHAR2
      LOGICAL*1 CURSTR
      LOGICAL*1 TRMSTR
      INTEGER MEM( 5000)
      LOGICAL*1 CMEM(10000)
      INTEGER PBP, PBSIZE
      LOGICAL*1 PBBUF(100)
      LOGICAL*1 USESTR(32)
      LOGICAL*1 ST001Z(20)
      COMMON /CFORM / LEVEL, NXTPTR, COUNT(5), TRMPTR(5), LINADR(5), CHA
     *R1, CHAR2, CURSTR(402), TRMSTR(2010)
      COMMON /CDSMEM/ MEM
      COMMON /CPBACK/ PBP, PBSIZE, PBBUF
      EQUIVALENCE (CMEM(1),MEM(1))
      DATA USESTR(1)/117/,USESTR(2)/115/,USESTR(3)/97/,USESTR(4)/103/,US
     *ESTR(5)/101/,USESTR(6)/58/,USESTR(7)/32/,USESTR(8)/32/,USESTR(9)/1
     *02/,USESTR(10)/111/,USESTR(11)/114/,USESTR(12)/109/,USESTR(13)/32/
     *,USESTR(14)/91/,USESTR(15)/45/,USESTR(16)/99/,USESTR(17)/93/,USEST
     *R(18)/32/,USESTR(19)/91/,USESTR(20)/43/,USESTR(21)/99/,USESTR(22)/
     *93/,USESTR(23)/32/,USESTR(24)/102/,USESTR(25)/105/,USESTR(26)/108/
     *,USESTR(27)/101/,USESTR(28)/32/,USESTR(29)/46/,USESTR(30)/46/,USES
     *TR(31)/46/,USESTR(32)/0/
      DATA CHAR1 /60/
      DATA CHAR2 /62/
      DATA ST001Z(1)/116/,ST001Z(2)/111/,ST001Z(3)/111/,ST001Z(4)/32/,ST
     *001Z(5)/109/,ST001Z(6)/97/,ST001Z(7)/110/,ST001Z(8)/121/,ST001Z(9)
     */32/,ST001Z(10)/102/,ST001Z(11)/105/,ST001Z(12)/108/,ST001Z(13)/10
     *1/,ST001Z(14)/32/,ST001Z(15)/110/,ST001Z(16)/97/,ST001Z(17)/109/,S
     *T001Z(18)/101/,ST001Z(19)/115/,ST001Z(20)/0/
      CALL QUERY(USESTR)
      CALL TBINIT(5000)
      CALL PBINIT(100)
      NFILES = 0
      I=1
23000 IF (.NOT.(GETARG(I, LINE, 402) .NE. -1))GOTO 23002
      IF (.NOT.(LINE(1) .EQ. 45 .AND. LINE(2) .NE. 0))GOTO 23003
      CHAR1 = LINE(2)
      GOTO 23004
23003 CONTINUE
      IF (.NOT.(LINE(1) .EQ. 43))GOTO 23005
      CHAR2 = LINE(2)
      GOTO 23006
23005 CONTINUE
      NFILES = NFILES + 1
      IF (.NOT.(NFILES .GT. 10))GOTO 23007
      CALL ERROR (ST001Z)
23007 CONTINUE
      CALL SCOPY(LINE, 1, FNAMES(1, NFILES), 1)
23006 CONTINUE
23004 CONTINUE
23001 I=I+1
      GOTO 23000
23002 CONTINUE
      I=1
23009 IF (.NOT.(I.LE.NFILES))GOTO 23011
      INT = OPEN(FNAMES(1,I), 1)
      IF (.NOT.(INT .EQ. -3))GOTO 23012
      CALL CANT(FNAMES(1,I))
23012 CONTINUE
      CALL FORML(INT)
      CALL CLOSE(INT)
23010 I=I+1
      GOTO 23009
23011 CONTINUE
      IF (.NOT.(I .EQ. 1))GOTO 23014
      CALL ERROR (USESTR)
23014 CONTINUE
      RETURN
      END
      SUBROUTINE FORML(INT)
      INTEGER INT, TOG, I, JUNK
      INTEGER FTOK, GUSER, TBLOOK, EQUAL, INDEXS, INDEXC, NOTE, CTOI
      LOGICAL*1 TOKEN(402), DEFN(5000)
      INTEGER LEVEL
      INTEGER NXTPTR
      INTEGER COUNT
      INTEGER TRMPTR
      INTEGER*4 LINADR
      LOGICAL*1 CHAR1
      LOGICAL*1 CHAR2
      LOGICAL*1 CURSTR
      LOGICAL*1 TRMSTR
      LOGICAL*1 ST002Z(8)
      LOGICAL*1 ST003Z(31)
      LOGICAL*1 ST004Z(18)
      COMMON /CFORM / LEVEL, NXTPTR, COUNT(5), TRMPTR(5), LINADR(5), CHA
     *R1, CHAR2, CURSTR(402), TRMSTR(2010)
      DATA ST002Z(1)/82/,ST002Z(2)/69/,ST002Z(3)/80/,ST002Z(4)/69/,ST002
     *Z(5)/65/,ST002Z(6)/84/,ST002Z(7)/32/,ST002Z(8)/0/
      DATA ST003Z(1)/82/,ST003Z(2)/69/,ST003Z(3)/80/,ST003Z(4)/69/,ST003
     *Z(5)/65/,ST003Z(6)/84/,ST003Z(7)/32/,ST003Z(8)/108/,ST003Z(9)/111/
     *,ST003Z(10)/111/,ST003Z(11)/112/,ST003Z(12)/115/,ST003Z(13)/32/,ST
     *003Z(14)/110/,ST003Z(15)/101/,ST003Z(16)/115/,ST003Z(17)/116/,ST00
     *3Z(18)/101/,ST003Z(19)/100/,ST003Z(20)/32/,ST003Z(21)/116/,ST003Z(
     *22)/111/,ST003Z(23)/111/,ST003Z(24)/32/,ST003Z(25)/100/,ST003Z(26)
     */101/,ST003Z(27)/101/,ST003Z(28)/112/,ST003Z(29)/108/,ST003Z(30)/1
     *21/,ST003Z(31)/0/
      DATA ST004Z(1)/67/,ST004Z(2)/111/,ST004Z(3)/117/,ST004Z(4)/110/,ST
     *004Z(5)/116/,ST004Z(6)/32/,ST004Z(7)/102/,ST004Z(8)/111/,ST004Z(9)
     */114/,ST004Z(10)/32/,ST004Z(11)/82/,ST004Z(12)/69/,ST004Z(13)/80/,
     *ST004Z(14)/69/,ST004Z(15)/65/,ST004Z(16)/84/,ST004Z(17)/32/,ST004Z
     *(18)/0/
      TOG = 0
      LEVEL = 0
      NXTPTR = 1
      CURSTR(1) = 0
23016 IF (.NOT.(FTOK(TOKEN, INT, TOG) .NE. -1))GOTO 23017
      IF (.NOT.(TOG .EQ. 1))GOTO 23018
      IF (.NOT.(TOKEN(1) .EQ. CHAR2))GOTO 23020
      TOG = 0
      GOTO 23016
23020 CONTINUE
      IF (.NOT.(LEVEL .GT. 0 .AND. EQUAL(TOKEN, CURSTR) .EQ. 1))GOTO 230
     *22
      COUNT(LEVEL) = COUNT(LEVEL) - 1
      IF (.NOT.(COUNT(LEVEL) .LE. 0))GOTO 23024
      NXTPTR = TRMPTR(LEVEL)
      LEVEL = LEVEL - 1
      IF (.NOT.(LEVEL .GT. 0))GOTO 23026
      CALL SCOPY(TRMSTR, TRMPTR(LEVEL), CURSTR, 1)
      GOTO 23027
23026 CONTINUE
      CURSTR(1) = 0
23027 CONTINUE
      GOTO 23025
23024 CONTINUE
      CALL SEEK(LINADR(LEVEL), INT)
23025 CONTINUE
23028 IF (.NOT.(FTOK(TOKEN, INT, 0) .NE. 10))GOTO 23029
      GOTO 23028
23029 CONTINUE
      TOG = 0
      GOTO 23016
23022 CONTINUE
      IF (.NOT.(INDEXS(TOKEN, ST002Z) .EQ. 1))GOTO 23030
      IF (.NOT.(LEVEL .GE. 5))GOTO 23032
      CALL REMARK(ST003Z)
      GOTO 23033
23032 CONTINUE
      LEVEL = LEVEL + 1
      I = INDEXC(TOKEN, 32)
      CALL SKIPBL(TOKEN, I)
      TRMPTR(LEVEL) = NXTPTR
23034 IF (.NOT.(TOKEN(I) .NE. 0))GOTO 23035
      TRMSTR(NXTPTR) = TOKEN(I)
      I = I + 1
      NXTPTR = NXTPTR + 1
      GOTO 23034
23035 CONTINUE
      TRMSTR(NXTPTR) = 0
      NXTPTR = NXTPTR + 1
      CALL SCOPY(TRMSTR, TRMPTR(LEVEL), CURSTR, 1)
23036 IF (.NOT.(FTOK(TOKEN, INT, 0) .NE. 10))GOTO 23037
      GOTO 23036
23037 CONTINUE
      JUNK = NOTE(LINADR(LEVEL), INT)
      TOG = 0
      CALL CONCAT(ST004Z, CURSTR, TOKEN)
      IF (.NOT.(GUSER(TOKEN, DEFN) .EQ. -1))GOTO 23038
      GOTO 23017
23038 CONTINUE
      I = 1
      COUNT(LEVEL) = CTOI(DEFN, I)
      GOTO 23016
23033 CONTINUE
23030 CONTINUE
      IF (.NOT.(TOKEN(1) .EQ. 92))GOTO 23040
      CALL SCOPY(TOKEN, 2, TOKEN, 1)
23040 CONTINUE
      IF (.NOT.(LEVEL .GT. 0 .OR. TBLOOK(TOKEN, DEFN) .EQ. 0))GOTO 23042
      IF (.NOT.(GUSER(TOKEN, DEFN) .EQ. -1))GOTO 23044
      GOTO 23017
23044 CONTINUE
      CALL TBINST(TOKEN, DEFN)
23042 CONTINUE
      CALL PUTLIN(DEFN, 2)
      GOTO 23016
23018 CONTINUE
      IF (.NOT.(TOKEN(1) .EQ. CHAR1))GOTO 23046
      TOG = 1
      GOTO 23016
23046 CONTINUE
23019 CONTINUE
      CALL PUTLIN(TOKEN, 2)
      GOTO 23016
23017 CONTINUE
      RETURN
      END
      INTEGER FUNCTION FTOK(TOKEN, INT, PRFLAG)
      LOGICAL*1 TOKEN(100)
      INTEGER INT, PRFLAG
      LOGICAL*1 NGETCH
      INTEGER LEVEL
      INTEGER NXTPTR
      INTEGER COUNT
      INTEGER TRMPTR
      INTEGER*4 LINADR
      LOGICAL*1 CHAR1
      LOGICAL*1 CHAR2
      LOGICAL*1 CURSTR
      LOGICAL*1 TRMSTR
      LOGICAL*1 ST005Z(15)
      COMMON /CFORM / LEVEL, NXTPTR, COUNT(5), TRMPTR(5), LINADR(5), CHA
     *R1, CHAR2, CURSTR(402), TRMSTR(2010)
      DATA ST005Z(1)/116/,ST005Z(2)/111/,ST005Z(3)/107/,ST005Z(4)/101/,S
     *T005Z(5)/110/,ST005Z(6)/32/,ST005Z(7)/116/,ST005Z(8)/111/,ST005Z(9
     *)/111/,ST005Z(10)/32/,ST005Z(11)/108/,ST005Z(12)/111/,ST005Z(13)/1
     *10/,ST005Z(14)/103/,ST005Z(15)/0/
      I=1
23048 IF (.NOT.(I.LT. 5000))GOTO 23050
      FTOK = NGETCH(TOKEN(I), INT)
      IF (.NOT.(FTOK .EQ. -1 .OR. (PRFLAG .EQ. 0 .AND. FTOK .EQ. 10) .OR
     *. (I .EQ. 1 .AND. FTOK .EQ. CHAR1) .OR. (I .EQ. 1 .AND. FTOK .EQ. 
     *CHAR2) ))GOTO 23051
      GOTO 23050
23051 CONTINUE
      IF (.NOT.(FTOK .EQ. CHAR1 .OR. FTOK .EQ. CHAR2))GOTO 23053
      CALL PUTBAK(FTOK)
      IF (.NOT.(FTOK .EQ. CHAR2 .AND. PRFLAG .EQ. 1))GOTO 23055
      TOKEN(I) = 32
      GOTO 23056
23055 CONTINUE
      I = I - 1
23056 CONTINUE
      GOTO 23050
23053 CONTINUE
23049 I=I+1
      GOTO 23048
23050 CONTINUE
      IF (.NOT.(I .GE.5000))GOTO 23057
      CALL ERROR (ST005Z)
23057 CONTINUE
      TOKEN(I+1) = 0
      RETURN
      END
      INTEGER FUNCTION GUSER(PSTR, REPL)
      LOGICAL*1 REPL(100), PSTR(100), PBUF(402), BUF(402)
      INTEGER GETLIN, PROMPT, EQUAL
      INTEGER LTH
      LOGICAL*1 EXTPMT(36)
      LOGICAL*1 DOTNLN(3)
      LOGICAL*1 ST006Z(20)
      DATA EXTPMT(1)/40/,EXTPMT(2)/116/,EXTPMT(3)/101/,EXTPMT(4)/114/,EX
     *TPMT(5)/109/,EXTPMT(6)/105/,EXTPMT(7)/110/,EXTPMT(8)/97/,EXTPMT(9)
     */116/,EXTPMT(10)/101/,EXTPMT(11)/32/,EXTPMT(12)/97/,EXTPMT(13)/110
     */,EXTPMT(14)/115/,EXTPMT(15)/119/,EXTPMT(16)/101/,EXTPMT(17)/114/,
     *EXTPMT(18)/32/,EXTPMT(19)/119/,EXTPMT(20)/105/,EXTPMT(21)/116/,EXT
     *PMT(22)/104/,EXTPMT(23)/32/,EXTPMT(24)/97/,EXTPMT(25)/32/,EXTPMT(2
     *6)/100/,EXTPMT(27)/111/,EXTPMT(28)/116/,EXTPMT(29)/32/,EXTPMT(30)/
     *108/,EXTPMT(31)/105/,EXTPMT(32)/110/,EXTPMT(33)/101/,EXTPMT(34)/41
     */,EXTPMT(35)/10/,EXTPMT(36)/0/
      DATA DOTNLN(1)/46/,DOTNLN(2)/10/,DOTNLN(3)/0/
      DATA ST006Z(1)/116/,ST006Z(2)/114/,ST006Z(3)/117/,ST006Z(4)/110/,S
     *T006Z(5)/99/,ST006Z(6)/97/,ST006Z(7)/116/,ST006Z(8)/105/,ST006Z(9)
     */110/,ST006Z(10)/103/,ST006Z(11)/32/,ST006Z(12)/114/,ST006Z(13)/10
     *1/,ST006Z(14)/115/,ST006Z(15)/112/,ST006Z(16)/111/,ST006Z(17)/110/
     *,ST006Z(18)/115/,ST006Z(19)/101/,ST006Z(20)/0/
      LTH = 1
      REPL(1) = 0
      IF (.NOT.(PSTR(1) .EQ. 45))GOTO 23059
      CALL CONCAT(PSTR(2), EXTPMT, PBUF)
      GOTO 23060
23059 CONTINUE
      CALL STRCPY(PSTR, PBUF)
23060 CONTINUE
23061 CONTINUE
      IF (.NOT.(LTH .EQ. 1))GOTO 23064
      I = PROMPT(PBUF, BUF, 1)
      GOTO 23065
23064 CONTINUE
      I = GETLIN(BUF, 1)
23065 CONTINUE
      IF (.NOT.(I .EQ. -1))GOTO 23066
      GOTO 23063
23066 CONTINUE
      IF (.NOT.((PSTR(1) .EQ. 45) .AND. EQUAL(BUF, DOTNLN) .EQ. 1))GOTO 
     *23068
      GOTO 23063
23068 CONTINUE
      IF (.NOT.(LTH + I .GT. 5000))GOTO 23070
      CALL REMARK (ST006Z)
      GOTO 23063
23070 CONTINUE
      CALL STCOPY(BUF, 1, REPL, LTH)
      IF (.NOT.(PSTR(1) .NE. 45))GOTO 23072
      IF (.NOT.(I .EQ. 1))GOTO 23074
      GOTO 23063
23074 CONTINUE
      IF (.NOT.(BUF(I-1) .NE. 45))GOTO 23076
      GOTO 23063
23076 CONTINUE
      LTH = LTH - 2
      CALL CHCOPY(10, REPL, LTH)
23077 CONTINUE
23075 CONTINUE
23072 CONTINUE
23062 GOTO 23061
23063 CONTINUE
      IF (.NOT.(REPL(LTH-1) .EQ. 10))GOTO 23078
      LTH = LTH - 1
23078 CONTINUE
      REPL(LTH) = 0
      IF (.NOT.(I .EQ. -1))GOTO 23080
      GUSER = -1
      GOTO 23081
23080 CONTINUE
      GUSER = LTH - 1
23081 CONTINUE
      RETURN
      END
