Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-05 - decus/20-0141/daflag.for
There are 2 other files named daflag.for in the archive. Click here to see a list.
      SUBROUTINE DAFLAG(KONECT,LOWSTR,MAXSTR,MAXBFR,IBUFFR,
     1    LOWBFR,MANY  ,KIND  ,INILTR,KNTLTR,MAXDSK,MAXNAM,
     2    MAXNUM,MAXFLG,KONTNT,MINPRT,MAXPRT)
C     RENBR(/EVALUATE FORM DSK:NAME.EXT[NUMBER,NUMBER])
C
C     DONALD BARTH, HARVARD BUSINESS SCHOOL
C
C     ROUTINE TO LOCATE COMPONENTS OF FILE SPECIFICATION OF
C     FORM
C
C     DSK:NAME.EXT[12,34,56]/SWITCH:ARGUMENT/SWITCH:'TEXT'
C
C     ONLY  ONE  DEVICE  FIELD,  ONE  NAME  FIELD  AND  ONE
C     BRACKETED FIELD CAN APPEAR IN THE FILE SPECIFICATION.
C     THE DEVICE FIELD MUST APPEAR BEFORE THE  NAME  FIELD,
C     BUT  THE  BRACKETED  FIELD CAN BE BEFORE, BETWEEN, OR
C     AFTER THESE.  THE SWITCH  FIELDS  CAN  APPEAR  BEFORE
C     AND/OR AFTER THE REST OF THE FILE SPECIFICATION.
C
C     THE  COMPONENTS  OF  EACH  FIELD  WITHIN   THE   FILE
C     DESCRIPTION  ARE IDENTIFIED TO THE CALLING PROGRAM BY
C     LENGTH AND BY STARTING LOCATION  WITHIN  THE  BUFFER.
C     THIS  INFORMATION  IS  RETURNED  WITHIN  THE 2 ARRAYS
C     KNTLTR AND INILTR RESPECTIVELY.  SINCE EACH FIELD CAN
C     CONSIST  OF ANY NUMBER OF COMPONENTS CONNECTED BY THE
C     APPROPRIATE CHARACTER (COLON, COMMA OR  PERIOD),  AND
C     SINCE  FOR  SOME  APPLICATIONS  A  TERMINAL SEPARATOR
C     CHARACTER HAS SPECIAL MEANING, A ZERO CHARACTER COUNT
C     IS  RETURNED  IN  THE  KNTLTR  ARRAY  FOR  THE  FINAL
C     COMPONENT OF A FIELD IN WHICH  AN  OPTIONAL  TERMINAL
C     CONNECTING  CHARACTER IS FOUND.  SINCE THERE IS NEVER
C     ANY QUESTION ABOUT WHETHER  AN  ITEM  IN  THE  DEVICE
C     FIELD  WAS  FOLLOWED BY THE CONNECTING CHARACTER, THE
C     DESCRIPTION OF THE DEVICE FIELD DOES  NOT  INCLUDE  A
C     FINAL ZERO CHARACTER COUNT.
C
C     A TEXT STRING DELIMITED BY APOSTROPHES IS TREATED  AS
C     A  SWITCH  EVEN  IF  NOT  PRECEDED  BY  A SLASH.  THE
C     LOCATION OF A TEXT STRING  IS  THAT  OF  THE  INITIAL
C     APOSTROPHE,  AND THE LENGTH INCLUDES THE INITIAL, BUT
C     NOT THE FINAL, APOSTROPHE.  IF THE  FINAL  APOSTROPHE
C     IS MISSING, THEN THE TEXT STRING IS ASSUMED TO EXTEND
C     THROUGH  THE  RIGHTMOST  PRINTING  CHARACTER  IN  THE
C     BUFFER.    WITHIN   A   TEXT   STRING,  TWO  ADJACENT
C     APOSTROPHES INDICATE A SINGLE APOSTROPHE WHICH IS  TO
C     BE   INCLUDED  WITHIN  THE  STRING.   IF  2  ADJACENT
C     APOSTROPHES ARE ENCOUNTERED WITHIN THE  TEXT  STRING,
C     THEN THE REMAINDER OF THE STRING IS MOVED 1 CHARACTER
C     TO THE LEFT SO THAT  THE  RETURNED  CONTENTS  OF  THE
C     BUFFER AND THE RETURNED LENGTH IN THE KNTLTR ARRAY DO
C     NOT INCLUDE THE EXTRA APOSTROPHE.
C
C     AN  ASTERISK  WHICH  IS  FOLLOWED  IMMEDIATELY  BY  A
C     PRINTING  CHARACTER  OTHER THAN A PUNCTUATION MARK IS
C     TREATED  AS  THOUGH  SEPARATED  FROM  THIS  FOLLOWING
C     CHARACTER  BY  A  PERIOD  IF  IN THE NAME FIELD, BY A
C     COMMA IF IN THE BRACKETED FIELD OR BY A COLON  IF  IN
C     THE SWITCH FIELD.
C
C     FOR EXAMPLE, IF THE CONTENTS OF THE BUFFER ARE
C
C     DSK:DAFLAG.F4[6001,56,FASP]/LINE:60:/TITLE:'JAN 76'
C
C     THEN THE FOLLOWING INFORMATION WOULD BE RETURNED BY 3
C     CONSECUTIVE CALLS TO THIS ROUTINE
C
C     FIELD         KNTLTR CONTENTS      INILTR CONTENTS
C
C     BY THE FIRST CALL TO THIS ROUTINE
C
C     DEVICE              3                    1
C
C     NAME                6                    5
C                         2                   12
C
C     BRACKETED           4                   15
C                         2                   20
C                         4                   23
C
C     BY THE SECOND CALL TO THIS ROUTINE
C
C     SWITCH              4                   29
C                         2                   34
C                         0                UNDEFINED
C
C     BY THE THIRD CALL TO THIS ROUTINE
C
C     SWITCH              5                   38
C                         7                   44
C
C     THE FOLLOWING ARGUMENTS ARE USED ONLY FOR INPUT.
C
C     KONECT = -1, SPACES AND/OR TAB CHARACTERS CAN  APPEAR
C              BETWEEN  COMPONENTS  OF  ANY  FIELD, AND CAN
C              REPLACE SEPARATING PERIODS AND COMMAS IN THE
C              NAME   AND  BRACKETED  FIELDS  RESPECTIVELY.
C              SUCH  SPACES  AND/OR  TABS  MARK  END  OF  A
C              PARTICULAR  COMPONENT  OF  FIELD, BUT DO NOT
C              SIGNAL EITHER END OF FIELD OR  END  OF  FILE
C              SPECIFICATION.      COMPONENTS    OF    FILE
C              SPECIFICATION WILL BE LOCATED THROUGH END OF
C              BUFFER,   OR  UP  TO  FOLLOWING  EXCLAMATION
C              POINT, AMPERSAND  OR  SEMICOLON,  OR  UP  TO
C              FOLLOWING  COMMA  WHICH  IS NOT IN BRACKETED
C              FIELD.  SINGLE CALL  TO  THIS  ROUTINE  WILL
C              REPORT  EITHER  CONTENTS  OF  SINGLE  SWITCH
C              FIELD OR COMBINATION OF DEVICE  FIELD,  NAME
C              FIELD  AND  BRACKETED  FIELD  WHETHER OR NOT
C              THESE ARE SEPARATED BY SPACES AND/OR TABS.
C            = 0, SIMILAR TO KONECT=-1 EXCEPT  THAT  SPACES
C              AND  TAB  CHARACTERS  CANNOT  APPEAR BETWEEN
C              FIELDS AND CANNOT APPEAR BETWEEN  COMPONENTS
C              OF    DEVICE    AND   NAME   FIELDS.    FILE
C              SPECIFICATION WILL BEGIN WITH FIRST PRINTING
C              CHARACTER  OTHER THAN PUNCTUATION CHARACTERS
C              COMMA, AMPERSAND, EQUALS SIGN, SEMICOLON  OR
C              EXCLAMATION  POINT,  THEN EXTEND THROUGH END
C              OF BUFFER, OR  UP  TO  FIRST  SPACE  OR  TAB
C              CHARACTER  WHICH  WHICH  IS  NEITHER  WITHIN
C              BRACKETED FIELD NOR WITHIN SWITCH FIELD  NOR
C              WITHIN TEXT STRING DELIMITED BY APOSTROPHES,
C              OR  UP  TO  FOLLOWING   EXCLAMATION   POINT,
C              AMPERSAND  OR  SEMICOLON, OR UP TO FOLLOWING
C              COMMA  WHICH  IS  NOT  IN  BRACKETED  FIELD.
C              SINGLE  CALL  TO  THIS  ROUTINE  WILL REPORT
C              EITHER CONTENTS OF SINGLE  SWITCH  FIELD  OR
C              COMBINATION  OF DEVICE FIELD, NAME FIELD AND
C              BRACKETED   FIELD   PROVIDING   THESE    ARE
C              CONTIGUOUS.
C            = 1, SIMILAR TO KONECT=-1 EXCEPT  THAT  SPACES
C              AND  TAB  CHARACTERS  CANNOT  APPEAR BETWEEN
C              COMPONENTS OF DEVICE AND NAME FIELDS.
C     LOWSTR = SUBSCRIPT OF FIRST  LOCATION  WITHIN  INILTR
C              AND  KNTLTR ARRAYS WHICH CAN BE USED TO HOLD
C              DESCRIPTION   OF    COMPONENTS    OF    FILE
C              SPECIFICATION.
C     MAXSTR = SUBSCRIPT OF FINAL  LOCATION  WITHIN  INILTR
C              AND  KNTLTR ARRAYS WHICH CAN BE USED TO HOLD
C              DESCRIPTION   OF    COMPONENTS    OF    FILE
C              SPECIFICATION.
C     MAXBFR = SUBSCRIPT  OF  FINAL  (RIGHTMOST)   LOCATION
C              WITHIN IBUFFR ARRAY WHICH CONTAINS CHARACTER
C              WHICH CAN BE PART OF FILE SPECIFICATION.
C
C     FOLLOWING ARGUMENTS ARE USED FOR BOTH INPUT  TO,  AND
C     OUTPUT FROM THIS ROUTINE.
C
C     IBUFFR = ARRAY CONTAINING IN LOCATIONS IBUFFR(LOWBFR)
C              THROUGH  IBUFFR(MAXBFR)  CHARACTERS  READ BY
C              CALLING PROGRAM WITH MULTIPLE OF  A1  FORMAT
C              AND   WHICH  CAN  FORM  FILE  SPECIFICATION.
C              CONTENTS  OF  IBUFFR  ARRAY   ARE   RETURNED
C              UNCHANGED,  WITH  EXCEPTION  THAT PORTION OF
C              TEXT STRING TO RIGHT OF ADJACENT APOSTROPHES
C              IN  TEXT  STRING  IN SWITCH FIELD IS MOVED 1
C              CHARACTER TO LEFT.
C     LOWBFR = SUBSCRIPT  OF  FIRST   (LEFTMOST)   LOCATION
C              WITHIN IBUFFR ARRAY WHICH CONTAINS CHARACTER
C              WHICH CAN BE  PART  OF  FILE  SPECIFICATION.
C              LOWBFR   IS   RETURNED   POINTING  TO  FIRST
C              CHARACTER  WHICH  SHOULD  BE  EVALUATED   BY
C              SUBSEQUENT  CALL TO THIS ROUTINE, OR ELSE IS
C              RETURNED POINTING BEYOND END  OF  BUFFER  IF
C              BUFFER IS EMPTY OR IF BUFFER CONTAINS MERELY
C              COMMENT.
C     MANY   = SHOULD BE INPUT CONTAINING  ZERO  EACH  TIME
C              THIS  ROUTINE  IS CALLED TO BEGIN PROCESSING
C              OF A NEW LOGICAL SECTION  OF  TEXT,  AS  FOR
C              EXAMPLE  WHEN BEGINNING PROCESSING OF A LINE
C              OF TEXT NOT TIED TO THE PREVIOUS LINE BY  AN
C              AMPERSAND  AT  THE END OF THE PREVIOUS LINE,
C              OR WHEN PROCESSING THE TEXT TO THE RIGHT  OF
C              A  SEMICOLON  OR  TO  THE RIGHT OF AN EQUALS
C              SIGN.
C            = RETURNED CONTAINING  THE  VALUE  WHICH  MANY
C              SHOULD  HAVE  WHEN THIS ROUTINE OR ANY OTHER
C              IN  THE  FASP  PACKAGE  HAVING  MANY  AS  AN
C              ARGUMENT IS NEXT CALLED.  THE RETURNED VALUE
C              OF MANY SHOULD NOT BE CHANGED BY THE CALLING
C              PROGRAM  UNLESS  THE  INTERPRETATION  OF THE
C              CONTENTS OF THE BUFFER  IS  BEING  ABANDONED
C              PREMATURELY,  IN  WHICH  CASE MANY SHOULD BE
C              RESET TO HAVE A ZERO VALUE.
C            = -1, RETURNED IF A  MISSING  ITEM  IS  TO  BE
C              INDICATED  IF  THE NEXT ROUTINE ENCOUNTERS A
C              LEADING  COMMA  OR  FINDS  THAT  THE  BUFFER
C              CONTAINS   NOTHING  OTHER  THAN  A  POSSIBLE
C              COMMENT.  MANY IS RETURNED CONTAINING -1  IF
C              A  COMMA  PRECEDES  EITHER AN AMPERSAND OR A
C              SWITCH FIELD.
C            = 0, RETURNED IF  A  MISSING  ITEM  IS  TO  BE
C              INDICATED  IF  THE NEXT ROUTINE ENCOUNTERS A
C              LEADING COMMA, BUT A  MISSING  ITEM  IS  NOT
C              INDICATED  IF  THE  BUFFER  CONTAINS NOTHING
C              OTHER THAN  A  POSSIBLE  COMMENT.   MANY  IS
C              RETURNED  CONTAINING ZERO IF BUFFER IS FOUND
C              TO BE EMPTY, OR IF FIRST PRINTING  CHARACTER
C              AT OR TO RIGHT OF IBUFFR(LOWBFR) IS FOUND TO
C              BE EXCLAMATION POINT,  SEMICOLON  OR  EQUALS
C              SIGN.   THESE ARE ALL CONDITIONS UNDER WHICH
C              NEXT CALL TO  THIS  ROUTINE  WOULD  EVALUATE
C              START  OF  NEW GROUP OF FILE SPECIFICATIONS.
C              MANY IS RETURNED UNCHANGED IF A SWITCH FIELD
C              IS FOUND AT THE START OF THE CONTENTS OF THE
C              BUFFER.
C            = 1, RETURNED IF A MISSING ITEM IS NOT  TO  BE
C              INDICATED  IF  THE NEXT ROUTINE ENCOUNTERS A
C              LEADING  COMMA  OR  FINDS  THAT  THE  BUFFER
C              CONTAINS   NOTHING  OTHER  THAN  A  POSSIBLE
C              COMMENT.  MANY IS RETURNED CONTAINING ONE IF
C              A FILE SPECIFICATION CONSISTING OF MORE THAN
C              JUST A  SWITCH  FIELD  IS  FOUND,  OR  IF  A
C              MISSING ITEM IS BEING INDICATED.
C
C     FOLLOWING ARGUMENTS ARE USED ONLY FOR OUTPUT.   THEIR
C     INPUT VALUES ARE IGNORED.
C
C     KIND   = RETURNED    DESCRIBING    TYPE    OF    ITEM
C              ENCOUNTERED.
C            = 1,   NOTHING,   EXCEPT   POSSIBLY    COMMENT
C              INDICATED  BY LEADING EXCLAMATION POINT, WAS
C              FOUND AT  OR  TO  RIGHT  OF  IBUFFR(LOWBFR).
C              LOWBFR  IS  RETURNED  POINTING BEYOND END OF
C              BUFFER.
C            = 2, FIRST PRINTING CHARACTER AT OR  TO  RIGHT
C              OF  IBUFFR(LOWBFR)  IS SEMICOLON.  LOWBFR IS
C              RETURNED POINTING TO CHARACTER TO  RIGHT  OF
C              SEMICOLON.   IT  IS  SUGGESTED  THAT CALLING
C              PROGRAM TREAT THIS  AS  INDICATION  BY  USER
C              THAT  PRECEDING  COMMAND  HAS BEEN COMPLETED
C              AND THAT SUBSEQUENT COMMAND WILL  FOLLOW  ON
C              SAME LINE.
C            = 3, FIRST PRINTING CHARACTER AT OR  TO  RIGHT
C              OF IBUFFR(LOWBFR) IS EQUALS SIGN.  LOWBFR IS
C              RETURNED POINTING TO CHARACTER TO  RIGHT  OF
C              EQUALS SIGN.  ON PDP10 COMPUTER, EQUALS SIGN
C              IS USED TO SEPARATE DESTINATION  AND  SOURCE
C              FILE SPECIFICATIONS.
C            = 4, FIRST PRINTING CHARACTER AT OR  TO  RIGHT
C              OF  IBUFFR(LOWBFR) IS AMPERSAND.  CHARACTERS
C              TO  RIGHT  OF  AMPERSAND  ARE  TAKEN  TO  BE
C              COMMENT.  LOWBFR IS RETURNED POINTING BEYOND
C              END OF BUFFER.  IT IS SUGGESTED THAT CALLING
C              PROGRAM  TREAT  THIS AS REQUEST BY USER THAT
C              COMMAND  BE  CONTINUED  ON  FOLLOWING  LINE.
C              EFFECT  IS  NOT  QUITE  SAME  AS IF USER HAD
C              TYPED ALL OF FILE SPECIFICATIONS  ON  SINGLE
C              LINE  SINCE  FILE  SPECIFICATION  CANNOT  BE
C              SPLIT ACROSS LINE BOUNDARY.
C            = 5, MISSING FILE SPECIFICATION WAS  INDICATED
C              BY AN EXTRA COMMA.
C            = 6,  PARTIAL  FILE  SPECIFICATION  WAS  FOUND
C              WHICH  WILL  BE CONTINUED BY SUBSEQUENT CALL
C              TO  THIS  ROUTINE.    MANY   WILL   NOT   BE
C              INCREMENTED  UNTIL  FINAL  SECTION  OF  FILE
C              SPECIFICATION    (KIND    BEING     RETURNED
C              CONTAINING 7 OR 8) IS LOCATED.  IF FILE NAME
C              AND/OR DEVICE  AND/OR  BRACKETED  FIELD  HAS
C              BEEN  FOUND BY CURRENT CALL TO THIS ROUTINE,
C              THEN PORTION  TO  RIGHT  OF  THAT  EVALUATED
C              CONTAINS  SWITCH.   IF SWITCH HAS BEEN FOUND
C              BY  CURRENT  CALL  TO  THIS  ROUTINE,   THEN
C              PORTION   RIGHT   OF  THAT  EVALUATED  COULD
C              CONTAIN ANY ITEM.
C            = 7, FILE SPECIFICATION AND/OR  SWITCHES  WERE
C              FOUND.   IF  PREVIOUS  CALL  TO THIS ROUTINE
C              RETURNED    KIND=6    INDICATING     PARTIAL
C              SPECIFICATION,  THEN INFORMATION RETURNED BY
C              CURRENT CALL TO THIS ROUTINE COMPLETES  FILE
C              SPECIFICATION.
C            = 8, FILE SPECIFICATION AND/OR  SWITCHES  WERE
C              FOUND, BUT THESE WERE FOLLOWED BY UNEXPECTED
C              CHARACTER POINTED TO BY  RETURNED  VALUE  OF
C              LOWBFR.        FOR       EXAMPLE,       TEXT
C              DEVICE:NAME.EXTENSION:  WOULD  BE  EVALUATED
C              AS  THOUGH BUFFER TERMINATED PRIOR TO SECOND
C              COLON, AND LOWBFR WILL BE RETURNED  POINTING
C              TO      THIS     SECOND     COLON.      TEXT
C              DEVICE:NAME.EXTENSION[6001,56][22,56]  WOULD
C              BE  EVALUATED  AS  THOUGH  BUFFER TERMINATED
C              PRIOR TO SECOND BRACKETED FIELD, AND  LOWBFR
C              WOULD  BE  RETURNED  POINTING TO SECOND LEFT
C              BRACKET.
C     INILTR = ARRAY RETURNED CONTAINING SUBSCRIPTS  WITHIN
C              IBUFFR  ARRAY OF INITIAL CHARACTERS OF WORDS
C              FORMING   FILE   SPECIFICATION.    LOCATIONS
C              INILTR(LOWSTR)     THROUGH    INILTR(MAXDSK)
C              CONTAIN  LOCATIONS  IN  BUFFER  OF   INITIAL
C              CHARACTERS   OF   DEVICE  NAMES.   LOCATIONS
C              INILTR(MAXDSK+1)   THROUGH    INILTR(MAXNAM)
C              CONTAIN   LOCATIONS  IN  BUFFER  OF  INITIAL
C              CHARACTERS   OF   WORDS   IN   NAME   FIELD.
C              LOCATIONS      INITLR(MAXNAM+1)      THROUGH
C              INILTR(MAXNUM) CONTAIN LOCATIONS  IN  BUFFER
C              OF  INITIAL CHARACTERS OF WORDS IN BRACKETED
C              FIELD.    LOCATIONS  INILTR(LOWSTR)  THROUGH
C              INILTR(MAXFLG)  CONTAIN  LOCATIONS IN BUFFER
C              OF INITIAL  CHARACTERS  OF  WORDS  AND  TEXT
C              STRINGS APPEARING IN SWITCH FIELDS.  IF TEXT
C              STRING APPEARS IN SWITCH FIELD, LOCATION  IN
C              IBUFFR  ARRAY INDICATED BY INILTR ARRAY WILL
C              CONTAIN APOSTROPHE.
C     KNTLTR = ARRAY   RETURNED   CONTAINING   NUMBERS   OF
C              CHARACTERS  IN EACH OF WORDS FOR WHICH FIRST
C              CHARACTERS ARE IN BUFFER LOCATIONS INDICATED
C              BY  VALUES  IN  INILTR ARRAY.  SUBSCRIPTS OF
C              INILTR  ARRAY  AND  KNTLTR  ARRAY  LOCATIONS
C              DESCRIBING PARTICULAR WORD ARE IDENTICAL.
C     MAXDSK = RETURNED CONTAINING SUBSCRIPT OF INILTR  AND
C              KNTLTR  ARRAY LOCATIONS DESCRIBING RIGHTMOST
C              WORD IN DEVICE FIELD OF FILE  SPECIFICATION.
C              IF  DEVICE  FIELD  IS NOT FOUND, THEN MAXDSK
C              WILL BE RETURNED CONTAINING LOWSTR-1.
C     MAXNAM = RETURNED CONTAINING SUBSCRIPT OF INILTR  AND
C              KNTLTR  ARRAY LOCATIONS DESCRIBING RIGHTMOST
C              WORD IN NAME FIELD  OF  FILE  SPECIFICATION.
C              IF NAME FIELD IS NOT FOUND, THEN MAXNAM WILL
C              BE RETURNED EQUAL TO MAXDSK.
C     MAXNUM = RETURNED CONTAINING SUBSCRIPT OF INILTR  AND
C              KNTLTR  ARRAY LOCATIONS DESCRIBING RIGHTMOST
C              WORD   IN   BRACKETED    FIELD    OF    FILE
C              SPECIFICATION.   IF  BRACKETED  FIELD IS NOT
C              FOUND, THEN MAXNUM WILL BE RETURNED EQUAL TO
C              MAXNAM.
C     MAXFLG = RETURNED CONTAINING SUBSCRIPT OF INILTR  AND
C              KNTLTR  ARRAY LOCATIONS DESCRIBING RIGHTMOST
C              WORD  OF SWITCH FIELD.   IF SWITCH  FIELD IS
C              NOT FOUND,  THEN MAXFLG IS RETURNED EQUAL TO
C              LOWSTR-1.
C     KONTNT = BIT   CODED   NUMBER   RETURNED   DESCRIBING
C              LOCATION  OF  BRACKETED  FIELD  RELATIVE  TO
C              DEVICE AND NAME FIELDS.  RIGHT BIT IS ONE IF
C              AND ONLY IF NAME FIELD IS FOUND.  SECOND BIT
C              FROM RIGHT IS ONE  IF  AND  ONLY  IF  DEVICE
C              FIELD  IS FOUND.  FOURTH AND THIRD BITS FROM
C              RIGHT ARE 00 IF NO BRACKETED FIELD IS FOUND,
C              01  IF  BRACKETED FIELD APPEARS FIRST, 10 IF
C              BRACKETED FIELD FOLLOWS DEVICE FIELD, AND 11
C              IF BRACKETED FIELD FOLLOWS NAME FIELD.
C              FOLLOWING TABLE PRESENTS  VALUES  OF  KONTNT
C              RETURNED  FOR  ALL  POSSIBLE COMBINATIONS OF
C              DEVICE, NAME AND  BRACKETED  FIELDS.   MINUS
C              SIGNS   REPRESENT  VALUES  OF  KONTNT  WHICH
C              CANNOT BE RETURNED.   VALUE  ZERO  INDICATES
C              THAT  NEITHER DEVICE, NOR NAME NOR BRACKETED
C              FIELDS WERE FOUND,  BUT  DOES  NOT  INDICATE
C              WHETHER SWITCH FIELD WAS FOUND.
C
C              DECIMAL BINARY          DECIMAL BINARY
C              0   0  NOTHING         8 1000  ------
C              1   1  NAME            9 1001  ------
C              2  10  DEVICE:        10 1010  DEVICE:[]
C              3  11  DEVICE:NAME    11 1011  DEVICE:[]NAME
C              4 100  []             12 1100  ------
C              5 101  []NAME         13 1101  NAME[]
C              6 110  []DEVICE:      14 1110  ------
C              7 111  []DEVICE:NAME  15 1111  DEVICE:NAME[]
C
C              16 IS ADDED TO KONTNT IF AT  SIGN @ IS FOUND
C              ANYWHERE  IN FILE  SPECIFICATION OTHER  THAN
C              WITHIN A SWITCH FIELD.
C     MINPRT = SUBSCRIPT OF  IBUFFR  ARRAY  LOCATION  WHICH
C              CONTAINS    FIRST    CHARACTER    OF    FILE
C              SPECIFICATION OR SWITCH IF KIND IS  RETURNED
C              CONTAINING  VALUE  OF  6 OR GREATER.  MINPRT
C              AND MAXPRT CAN BE USED AS LIMITS  OF  IBUFFR
C              ARRAY  SUBSCRIPTS  IF TEXT MUST BE DISPLAYED
C              TO USER.  MINPRT  AND  MAXPRT  ARE  RETURNED
C              UNDEFINED  IF  KIND  IS  RETURNED CONTAINING
C              VALUE LESS THAN 6.
C     MAXPRT = SUBSCRIPT OF  IBUFFR  ARRAY  LOCATION  WHICH
C              CONTAINS    FINAL    CHARACTER    OF    FILE
C              SPECIFICATION OR SWITCH IF KIND IS  RETURNED
C              CONTAINING VALUE OF 6 OR GREATER.
C
      DIMENSION KNTLTR(MAXSTR),INILTR(MAXSTR),
     1IBUFFR(MAXBFR)
C
C     CCCC       AAA UU   UU TTTTTTTT IIII  OOOO   NN    NN
C   CC          AAAA UU   UU    TT     II  OO  OO  NNN   NN
C  CC          AA AA UU   UU    TT     II OO    OO NNNN  NN
C  CC         AA  AA UU   UU    TT     II OO    OO NN NN NN
C  CC        AAAAAAA UU   UU    TT     II OO    OO NN  NNNN
C   CC      AA    AA  UU UU     TT     II  OO  OO  NN   NNN
C     CCCC AA     AA   UUU      TT    IIII  OOOO   NN    NN
C
C     LEFT AND RIGHT SQUARE  BRACKETS MUST BE DEFINED USING
C     OCTAL NOTATION FOR PDP10 F40 COMPILER.  LET FOLLOWING
C     COMMENT BE THE COMPILED DATA STATEMENT IF F40 IS USED
C      DATA ILEFT,IRIGHT/"555004020100,"565004020100/
      DATA ILEFT,IRIGHT/1H[,1H]/
C
      DATA ISTAR,ICOLON,IDOT,ICOMMA,ISLASH,IQUOTE,IEND,
     1IAND,KOMENT,IEQUAL,KOMAND,IBLANK,ITAB/1H*,1H:,1H.,
     21H,,1H/,1H',1H;,1H&,1H!,1H=,1H@,1H ,1H	/
C
C     MAJOR  = -1, PROCESSING NAME SECTION
C            = 0, PROCESSING CONTENTS OF BRACKETS
C            = 1, PROCESSING SWITCH
C            = 2, IN TEXT STRING
C
      NEWSPC=1
      MAXDSK=LOWSTR-1
      MAXNAM=MAXDSK
      MAXNUM=MAXDSK
      MAXFLG=MAXDSK
      NONDSK=0
      NONNAM=0
      NONNUM=0
      KONTNT=0
      LOCATN=4
      KIND=1
      LOWBFR=LOWBFR-1
      MIDPRT=LOWBFR
      IF(MANY.GE.0)GO TO 46
      KIND=5
      MANY=1
      GO TO 46
    1 LOWBFR=LOWBFR+1
      MAXPRT=MIDPRT
      IF(LOWBFR.GT.MAXBFR)GO TO 32
      LETTER=IBUFFR(LOWBFR)
      IF(LETTER.EQ.IBLANK)GO TO 24
      IF(LETTER.EQ.ITAB)GO TO 24
      IF(KIND.NE.7)MINPRT=LOWBFR
      MIDPRT=LOWBFR
      LSTSPC=NEWSPC
      NEWSPC=0
C
C     CHECK FOR GENERAL PUNCTUATION CHARACTERS
      IF(LETTER.EQ.IEND)GO TO 26
      IF(LETTER.EQ.IAND)GO TO 20
      IF(LETTER.EQ.KOMENT)GO TO 21
      IF(LETTER.EQ.IEQUAL)GO TO 27
      IF(LETTER.EQ.ISLASH)GO TO 10
      IF(LETTER.EQ.IQUOTE)GO TO 11
      IF(LETTER.EQ.ICOMMA)GO TO 22
      IF(MAJOR.GT.0)GO TO 3
      IF(LETTER.EQ.KOMAND)GO TO 19
      IF(MAJOR.EQ.0)GO TO 4
C
C     CHECK FOR KEY CHARACTERS IN NAME FIELD
      IF(KIND.EQ.7)GO TO 2
      INDRCT=MANY
      IF(KIND.EQ.5)INDRCT=-1
      MANY=1
      KIND=7
    2 IF(LETTER.EQ.ICOLON)GO TO 30
      IF(LETTER.EQ.ILEFT)GO TO 9
      IF(NONNAM.GT.0)GO TO 31
      IF(LETTER.EQ.IDOT)GO TO 23
      GO TO 5
C
C     CHECK FOR KEY CHARACTERS IN SWITCH SECTION
    3 IF(KOUNT.LT.0)GO TO 29
      I=MAJOR
      MAJOR=1
      IF(LETTER.EQ.ICOLON)GO TO 23
      IF(I.NE.2)GO TO 5
      GO TO 29
C
C     CHECK FOR KEY CHARACTERS IN BRACKET FIELD
    4 IF(LETTER.EQ.ILEFT)GO TO 31
      IF(LETTER.EQ.IRIGHT)GO TO 25
      IF(LETTER.EQ.IDOT)GO TO 23
      IF(LETTER.EQ.ICOLON)GO TO 23
C
C     EXTEND NAME OR NUMBER OR SWITCH
    5 IF(KOUNT.GT.0)GO TO 6
      LTRLFT=LOWBFR
      KOUNT=1
      GO TO 1
    6 IF(LSTSPC.NE.0)GO TO 7
      IF(IBUFFR(MAXPRT).EQ.ISTAR)GO TO 8
      KOUNT=KOUNT+1
      GO TO 1
    7 IF(MAJOR.GT.0)GO TO 29
    8 LOWBFR=LOWBFR-1
      GO TO 23
C
C     LEFT BRACKET OTHER THAN IN SWITCH FIELD
    9 IF(NONNUM.NE.0)GO TO 31
      NEXT=4
      GO TO 33
C
C     INITIAL SLASH FOUND
   10 IF(KIND.EQ.7)GO TO 29
      IF(KIND.EQ.5)MANY=-1
      KIND=7
      MAJOR=1
      GO TO 44
C
C     APOSTROPHE STARTS TEXT STRING
   11 IF(MAJOR.LE.0)GO TO 12
      IF(KOUNT.EQ.0)GO TO 13
      IF(KOUNT.NE.1)GO TO 29
      IF(LSTSPC.NE.0)GO TO 29
      IF(IBUFFR(MAXPRT).EQ.ISTAR)GO TO 8
      GO TO 29
   12 IF(KIND.EQ.7)GO TO 29
      IF(KIND.EQ.5)MANY=-1
      KIND=7
      MAJOR=2
   13 LTRLFT=LOWBFR
      I=LOWBFR
      MIDPRT=LOWBFR
   14 IF(I.GE.MAXBFR)GO TO 16
      I=I+1
      LOWBFR=LOWBFR+1
      IBUFFR(LOWBFR)=IBUFFR(I)
      IF(IBUFFR(I).EQ.IBLANK)GO TO 14
      IF(IBUFFR(I).EQ.ITAB)GO TO 14
      MIDPRT=LOWBFR
      IF(IBUFFR(I).NE.IQUOTE)GO TO 14
      IF(I.GE.MAXBFR)GO TO 15
      IF(IBUFFR(I+1).NE.IQUOTE)GO TO 15
      I=I+1
      GO TO 14
   15 MIDPRT=MIDPRT-1
   16 KOUNT=MIDPRT-LTRLFT+1
   17 IF(LOWBFR.EQ.I)GO TO 18
      LOWBFR=LOWBFR+1
      IBUFFR(LOWBFR)=IBLANK
      GO TO 17
   18 IF(MAJOR.EQ.2)GO TO 25
      MAJOR=2
      GO TO 1
C
C     AT SIGN
   19 IF(KONTNT.GT.15)GO TO 31
      IF(KIND.EQ.7)MANY=INDRCT
      IF(KIND.EQ.5)MANY=-1
      KIND=7
      KONTNT=KONTNT+16
      GO TO 25
C
C     AMPERSAND FOUND
   20 IF(KIND.EQ.7)GO TO 32
      IF(KIND.EQ.5)MANY=-1
      KIND=4
C
C     EXCLAMATION POINT FOUND
   21 LOWBFR=MAXBFR+1
      GO TO 32
C
C     COMMA FOUND OTHER THAN IN NUMBER SECTION
   22 IF(MAJOR.EQ.0)GO TO 23
      IF(KIND.NE.1)GO TO 32
      KIND=5
      IF(MANY.GT.0)GO TO 1
      GO TO 32
C
C     COMMA IN BRACKET SECTION OR COLON IN SWITCH SECTION
   23 NEXT=3
      IF(KOUNT.LT.0)KOUNT=0
      GO TO 33
C
C     SPACE OR TAB FOUND
   24 IF(NEWSPC.NE.0)GO TO 1
      NEWSPC=1
      IF(KONECT.LT.0)GO TO 1
      IF(MAJOR.GE.0)GO TO 1
      IF(KIND.NE.7)GO TO 1
      IF(KONECT.EQ.0)GO TO 32
   25 NEXT=5
      GO TO 33
C
C     SEMICOLON FOUND
   26 IF(KIND.NE.1)GO TO 32
      KIND=2
      GO TO 28
C
C     EQUALS SIGN FOUND
   27 IF(KIND.NE.1)GO TO 32
      KIND=3
   28 LOWBFR=LOWBFR+1
      GO TO 32
C
C     CURRENT CALL CANNOT RETURN ALL INFORMATION
   29 KIND=6
      GO TO 32
C
C     COLON FOUND IN NAME FIELD
   30 IF(NONDSK.LE.0)GO TO 35
C
C     ILLEGAL CHARACTER, BUT MUST CLEAN UP BEFORE EXIT
   31 KIND=8
C
C     PREPARE TO EXIT TO CALLING PROGRAM
   32 NEXT=1
C
C     TERMINATE GROUP OF NAMES OR NUMBERS
   33 IF(KOUNT.LT.0)GO TO 42
      IF(MAJOR.GT.0)GO TO 40
      IF(MAJOR.EQ.0)GO TO 34
      LOCAL=MAXNAM
      IF(NONNAM.EQ.0)KONTNT=KONTNT+1
      LOCATN=12
      NONNAM=-1
      NONDSK=1
      GO TO 36
   34 LOCAL=MAXNUM
      IF(NONNUM.EQ.0)KONTNT=KONTNT+LOCATN
      NONNUM=-1
      GO TO 37
   35 IF(KOUNT.LT.0)KOUNT=0
      NEXT=2
      LOCAL=MAXDSK
      IF(NONDSK.EQ.0)KONTNT=KONTNT+2
      LOCATN=8
      NONDSK=-1
      IF(MAXDSK.LT.MAXSTR)MAXDSK=MAXDSK+1
   36 IF(MAXNAM.LT.MAXSTR)MAXNAM=MAXNAM+1
   37 IF(MAXNUM.LT.MAXSTR)MAXNUM=MAXNUM+1
      INDEX=MAXNUM
      LOCAL=LOCAL+1
   38 IF(INDEX.LE.LOCAL)GO TO 41
      IF(INDEX.GT.MAXSTR)GO TO 39
      INILTR(INDEX)=INILTR(INDEX-1)
      KNTLTR(INDEX)=KNTLTR(INDEX-1)
   39 INDEX=INDEX-1
      GO TO 38
   40 IF(MAXFLG.GE.MAXSTR)GO TO 42
      MAXFLG=MAXFLG+1
      LOCAL=MAXFLG
   41 IF(LOCAL.GT.MAXSTR)GO TO 42
      KNTLTR(LOCAL)=KOUNT
      INILTR(LOCAL)=LTRLFT
C
C     NEXT   = 1, EXIT
C            = 2, AFTER COLON OF DEVICE FIELD
C            = 3, AFTER PERIOD IN NAME OR COMMA IN
C              BRACKETED SECTION OR COLON IN SWITCH SECTION
C            = 4, MARK THAT ARE IN BRACKETED SECTION
C            = 5, TERMINATE CURRENT SECTION SO ITS TYPE
C              WILL NOT BE PERMITTED
   42 GO TO(49,47,44,43,45),NEXT
C
C     MARK THAT ARE IN BRACKET SECTION
   43 MAJOR=0
   44 KOUNT=0
      GO TO 48
C
C     TERMINATE CURRENT SECTION
   45 IF(MAJOR.GT.0)GO TO 47
      IF(NONDSK.LT.0)NONDSK=1
      IF(NONNAM.LT.0)NONNAM=1
      IF(NONNUM.LT.0)NONNUM=1
   46 MAJOR=-1
C
C     PREPARE FOR NEXT ITEM IN LIST
   47 KOUNT=-1
   48 LTRLFT=LOWBFR+1
      GO TO 1
C
C     RETURN TO CALLING PROGRAM
   49 IF(KIND.EQ.5)MANY=1
      IF(KIND.LT.4)MANY=0
      RETURN
C264038073645[]:';&!@
      END