Trailing-Edge
-
PDP-10 Archives
-
integ_tools_tops20_v7_30-apr-86_dumper
-
tools/dumper2/command.for
There are 2 other files named command.for in the archive. Click here to see a list.
SUBROUTINE COMMAND(COMLINE,STATE,KEY,STATUS)
C
C This subroutine processes a command line by calling
C the LIB$TPARSE run-time library routines. It will
C create a "standard" parameter block for LIB$TPARSE,
C and then call it. Any status code returned by
C LIB$TPARSE will be returned as STATUS.
C
C This version uses the following LIB$TPARSE options:
C TPA$M_BLANKS = off, treat blanks as separators
C TPA$M_ABBRFM = off, abbreviations must be unique
C TPA$M_ABBREV = on, abbreviations are allowed
C
C COMLINE -- Command line to parse
C STATE -- State table address
C KEY -- Keyword table address
C STATUS -- Integer status of command
C
IMPLICIT COMPLEX (A-Z)
C
CHARACTER COMLINE*(*)
INTEGER*4 STATE,KEY
INTEGER*4 STATUS
C
INTEGER*4 LIB$TPARSE
C
C The parameter block for LIB$TPARSE
C
INTEGER*4 TPBLOK(0:8)
EXTERNAL TPA$L_COUNT,TPA$L_OPTIONS,TPA$L_STRINGCNT
EXTERNAL TPA$L_STRINGPTR,TPA$L_TOKENCNT,TPA$L_TOKENPTR
EXTERNAL TPA$B_CHAR,TPA$L_NUMBER,TPA$L_PARAM
EXTERNAL TPA$M_BLANKS,TPA$M_ABBRFM,TPA$M_ABBREV
EXTERNAL TPA$M_AMBIG,TPA$K_COUNT0
C
C Initialize the LIB$TPARSE parameter block
C
TPBLOK(%LOC(TPA$L_COUNT)/4) = %LOC(TPA$K_COUNT0)
TPBLOK(%LOC(TPA$L_OPTIONS)/4) = %LOC(TPA$M_ABBREV)
TPBLOK(%LOC(TPA$L_STRINGCNT)/4) = LEN(COMLINE)
TPBLOK(%LOC(TPA$L_STRINGPTR)/4) = %LOC(COMLINE)
STATUS = LIB$TPARSE(TPBLOK,STATE,KEY)
IF (.NOT.STATUS) THEN
CALL ERRORM(STATUS)
WRITE(6,100) COMLINE
100 FORMAT(1X,A)
WRITE(6,110)
110 FORMAT(<TPBLOK(%LOC(TPA$L_STRINGPTR)/4)-%LOC(COMLINE)+1>X,'^')
ENDIF
RETURN
END