      SUBROUTINE MAIN
      LOGICAL*1 LINE(400), STR(400)
      INTEGER EQUAL, GETLIN, GETWRD, OPEN
      INTEGER INFILE(3), LEN, LEVEL, LOC
      INTEGER GETARG, I
      LOGICAL*1 INCLD(8)
      DATA INCLD(1) /105/
      DATA INCLD(2) /110/
      DATA INCLD(3) /99/
      DATA INCLD(4) /108/
      DATA INCLD(5) /117/
      DATA INCLD(6) /100/
      DATA INCLD(7) /101/
      DATA INCLD(8) /0/
      I=1
23000 CONTINUE
      IF(.NOT.(GETARG(I, LINE, 400) .EQ. -1))GOTO 23003
      IF(.NOT.(I.NE. 1))GOTO 23005
      GOTO 23002
23005 CONTINUE
      INFILE(1) = 1
      GOTO 23004
23003 CONTINUE
      IF(.NOT.(LINE(1) .EQ. 45 .AND. LINE(2) .EQ. 0))GOTO 23007
      INFILE(1) = 1
      GOTO 23008
23007 CONTINUE
      IF(.NOT.(LINE(1) .EQ. 63 .AND. LINE(2) .EQ. 0))GOTO 23009
      CALL ERROR (24Husage:  incl [file ...].)
      GOTO 23010
23009 CONTINUE
      INFILE(1) = OPEN(LINE,1)
      IF(.NOT.(INFILE(1) .EQ. -3))GOTO 23011
      CALL CANT (LINE)
23011 CONTINUE
23010 CONTINUE
23008 CONTINUE
23004 CONTINUE
      LEVEL=1
23013 IF(.NOT.(LEVEL .GT. 0))GOTO 23015
23016 IF(.NOT.(GETLIN(LINE, INFILE(LEVEL)) .NE. -1))GOTO 23017
      LOC = 1
      LEN = GETWRD(LINE, LOC, STR)
      CALL FOLD(STR)
      IF(.NOT.(EQUAL(STR,INCLD) .EQ. 0))GOTO 23018
      CALL PUTLIN (LINE, 2)
      GOTO 23019
23018 CONTINUE
      LEVEL = LEVEL + 1
      IF(.NOT.(LEVEL .GT. 3))GOTO 23020
      CALL ERROR (27Hincludes nested too deeply.)
23020 CONTINUE
      LEN = GETWRD(LINE, LOC,STR)
      INFILE(LEVEL) = OPEN(STR,1)
      IF(.NOT.(INFILE(LEVEL) .EQ. -3))GOTO 23022
      CALL CANT (STR)
23022 CONTINUE
23019 CONTINUE
      GOTO 23016
23017 CONTINUE
      IF(.NOT.(INFILE(LEVEL) .NE. 1))GOTO 23024
      CALL CLOSE (INFILE(LEVEL))
23024 CONTINUE
23014 LEVEL = LEVEL - 1
      GOTO 23013
23015 CONTINUE
      IF(.NOT.(INFILE(1) .NE. 1))GOTO 23026
      CALL CLOSE (INFILE(1))
23026 CONTINUE
23001 I=I+1
      GOTO 23000
23002 CONTINUE
      RETURN
      END
