SUBROUTINE CMLSTN(MAXLST,LINE,SCANPT,KWDNDX *, SCNTRM,TRMTYP,NLIST) NOLINEUP C SCAN A COMMAND ARGUMENT NAME LIST C C INPUTS-- C . MAXLST - IABS(MAXLST) IS MAXIMUM NUMBER OF ITEMS ALLOWED IN C . THE LIST. THE LIST IS POSITIONAL IF MAXLST LT 0 C . LINE() - LINE OF CHARACTERS TO BE SCANNED - CHAR*1(N) C . SCANPT - INDEX OF CHARACTER IN LINE() TO START SCANNING C . KWDNDX - INDEX OF KEYWORD TO PROVIDE SEARCH CONTEXT C . (IF ZERO, SEARCH WHOLE TABLE) C OUTPUTS-- C . SCNTRM - INDEX OF CHARACTER IN LINE() WHICH STOPPED SCAN C . TRMTYP - PUNCTUATION TYPE CODE FOR LINE(SCNTRM) C . NLIST()- DESTINATION FOR LIST VALUES C INCLUDE (SCANLIB.PARAMS) INCLUDE (SCANLIB.CMTABL) C CHARACTER*1 LINE(1) INTEGER MAXLST,SCANPT, SCNTRM,TRMTYP,NLIST(IABS(MAXLST)) CHARACTER*1 TOKEN(TOKNSZ) INTEGER SCAN,NCHARS C SCAN = SCANPT TRMTYP = 0 LINDEX = 1 DO WHILE (LINDEX.LE.IABS(MAXLST) .AND. TRMTYP.LE.LSTSEP) IF (MAXLST.LT.0) THEN CALL CMPOSL(LINE,SCAN, SCNTRM,TOKEN,NCHARS,TRMTYP) ELSE CALL CMTOKN(LINE,SCAN, SCNTRM,TOKEN,NCHARS,TRMTYP) ENDIF IF (KWDNDX.GT.0) THEN CALL CMLKUP(TOKEN,NCHARS,NAMTBL,NMSTRT(KWDNDX),NMSTOP(KWDNDX) *, NINDEX) ELSE CALL CMLKUP(TOKEN,NCHARS,NAMTBL,1,NMTBSZ, NINDEX) ENDIF IF (NINDEX.GT.0 .OR. (NCHARS.EQ.0 .AND. MAXLST.LT.0)) THEN C NAME FOUND, OR NULL ITEM IN POSITIONAL LIST NLIST(LINDEX) = NINDEX ELSEIF (NCHARS.GT.0) THEN C *** ERROR 3 - UNRECOGNIZED NAME CALL CMERMS(3,TOKEN,NCHARS) IF (MAXLST.LT.0) NLIST(LINDEX) = 0 ENDIF SCAN = SCNTRM + 1 LINDEX = LINDEX + 1 END WHILE C C IN CASE MAXLST WAS HIT BEFORE LIST EXHAUSTED, KEEP SCANNING -- C DO WHILE (TRMTYP.LE.LSTSEP) CALL CMTOKN(LINE,SCAN, SCNTRM,TOKEN,NCHARS,TRMTYP) C *** ERROR 6 - TOO MANY LIST ITEMS CALL CMERMS(6,TOKEN,NCHARS) SCAN = SCNTRM + 1 END WHILE RETURN END