.TITLE PARSVXLZT PARSE SVXLIST PARAMS .SBTTL DATA AREAS ; this version of parsvxlst parses a file name .PSECT PSVLSTDAT,WRT,NOEXE $TPADEF ;PARSING MACROS TPARSE_BLOCK: ;PARSER CONTROL BLOCK .LONG TPA$K_COUNT0 .LONG TPA$M_ABBREV ;ALLOW ABBREV .BLKL TPA$K_LENGTH0-8 ADSCOM: .BLKA 1 ;ADDR SVXCOM CONTROL BLOCK ADLCTRL:.BLKA 1 ;ADDR LIST CONTROL BLOCK SAVLOW: .BLKL 1 ;LOW RANGE SAVE AREA FNLENG: .LONG 0 ;LENGTH OF FILE SPEC BLMASK: .LONG TPA$M_BLANKS ;BLANK MASK UPMASK: .BYTE ^X01 ;MASK FOR UPPER OPTION .PSECT PSVLSTCOD,EXE,NOWRT PARSVXLZT:: .WORD ^M ;ENTRY POINT MASK MOVL 4(AP),R2 ;ADDR DESCRIPTOR OF COMMAND LINE MOVZWL (R2),TPARSE_BLOCK+TPA$L_STRINGCNT ;LENGTH COMMAND LINE MOVL 4(R2),TPARSE_BLOCK+TPA$L_STRINGPTR ;ADDR COMMAND LINE MOVL @8(AP),ADSCOM ;2ND ARG MOVL @12(AP),ADLCTRL ;3RD ARG PUSHAL UED_KEY ;SET UP ARG LIST FOR LIB$TPARSE PUSHAL UED_STATE PUSHAL TPARSE_BLOCK CALLS #3,LIB$TPARSE ;GO PARSE IT RET ;(NO SYNTAX ERR MSG) .SBTTL PARSER STATE TABLES $INIT_STATE UED_STATE,UED_KEY $STATE START $TRAN '/',OPTS ;PARSE OPTION $TRAN TPA$_EOS,TPA$_EXIT ;NO MORE TO PARSE $TRAN TPA$_ANY,FILESP,STFILE ; FILE SPEC $STATE OPTS $TRAN 'FOLDSIZE',FOLD $TRAN 'LOWER',START,A_LOWR $TRAN 'LRECL',RECS $TRAN 'RANGE',RANG $TRAN 'RECSIZE',RECS $TRAN 'UPPER',START,A_UPPR $STATE RANG $TRAN '=' $TRAN ':' $STATE $TRAN TPA$_DECIMAL,LORA,A_LORNG $STATE LORA ;SINGLE RANGE OR START OF TWORANGE $TRAN ':',TWOR ;RANGE OF TWO $TRAN TPA$_LAMBDA,START,A_SINRG ;SINGLE RANGE $STATE TWOR $TRAN TPA$_DECIMAL,START,A_TWORG ;RANGE OF TWO $STATE FOLD $TRAN ':' $TRAN '=' ;EITHER : OR = ANNOUNCES PARM $STATE $TRAN TPA$_DECIMAL,START,A_FOLD $STATE RECS $TRAN ':' $TRAN '=' $STATE $TRAN TPA$_DECIMAL,START,A_RECS $STATE FILESP BLANK = 32 $TRAN BLANK,START,ENFILE ;END OF FILESPEC $TRAN '/',OPTS,ENFILE ;DITTO, BUT SEE OPTIONS $TRAN TPA$_EOS,TPA$_EXIT,ENFILE ;ALSO DONE $TRAN TPA$_ANY,FILESP,CTFILE ;CONTINUE, GO COUNT LENGTH $END_STATE ;END OF PARSING TABLE A_UPPR: .WORD 0 ;R2-R11 NOT USED MOVL ADSCOM,R1 ;ADDR SVXCOM BISB2 UPMASK,12(R1) ;SET UPPER OPTION BIT ON RET A_LOWR: .WORD 0 MOVL ADSCOM,R1 BICB2 UPMASK,12(R1) RET A_FOLD: .WORD 0 MOVL ADSCOM,R1 MOVL TPA$L_NUMBER(AP),8(R1) ;STASH FOLDSIZE RET A_RECS: .WORD 0 MOVL TPA$L_NUMBER(AP),@ADLCTRL ;STASH LRECL RET A_LORNG: .WORD 0 MOVL TPA$L_NUMBER(AP),SAVLOW ;SAVE FIRST NUMBER,BEFORE KNOWING ;IF SINGLE OR PART OF RANGE RET A_SINRG: .WORD 0 MOVL ADLCTRL,R1 MOVL SAVLOW,8(R1) ;SET SINGLE AS BOTH LO & HI RANGE MOVL SAVLOW,12(R1) RET A_TWORG: .WORD 0 MOVL ADLCTRL,R1 MOVL SAVLOW,8(R1) MOVL TPA$L_NUMBER(AP),12(R1) ;FOUND HI END OF RANGE RET STFILE: .WORD 0 MOVL ADLCTRL,R1 MOVL TPA$L_TOKENPTR(AP),16(R1) ;ADDR FILESPEC BISL2 BLMASK,TPA$L_OPTIONS(AP) ;DURING THIS, BLANKS ARE SIGNF MOVL #1,FNLENG ;INIT LENGTH OF FILESPEC STR RET CTFILE: .WORD 0 ;ACCUM COUNT OF FILESPEC ADDL2 #1,FNLENG RET ENFILE: .WORD 0 ;END OF FILESPEC MOVL ADLCTRL,R1 MOVL FNLENG,20(R1) ;STASH LENGTH BICL2 BLMASK,TPA$L_OPTIONS(AP) ;BLANKS NO LONGER SIGNIF RET .END