Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-04 - 43,50322/scan.mac
Click 43,50322/scan.mac to see without markup as text/plain
There are 38 other files named scan.mac in the archive. Click here to see a list.
TITLE SCAN -- GENERAL PURPOSE ADAPTER FOR LISP SCANNER

A=1
B=2
C=3
R=13
T=6
P=14

CR=15
LF=12
TAB=11

IGCRLF=31	;^Y FOR UCI LISP

EXTERNAL CHRTAB,IGSTRT,RATOM,OLDCH,FIX1A,NOINFG,INUM0,SCNVAL

INTERNAL SCAN,SCANSET,SCANRESET,SCANINIT,LETTER,IGNORE

SCAN:	SETOM NOINFG
	PUSHJ P,RATOM
	SKIPA
	PUSHJ P,FIX1A
	MOVEM A,SCNVAL
	MOVEI A,INUM0(R)
	POPJ P,

OLDSCN:	IGCRLF	;IGSTRT
	LF	;IGEND
	POINT 4,CHRTAB(A),5	;RATFLD
	POINT 2,CHRTAB(A),10	;STRFLD
	POINT 3,CHRTAB(A),13	;IDFLD

IGST2:	0	;IGSTRT
IGEND2:	0	;IGEND
RATF2:	POINT 4,CHRTAB(A),29	;RATFLD
STRF2:	POINT 2,CHRTAB(A),31	;STRFLD
IDF2:	POINT 3,CHRTAB(A),34	;IDFLD

SCANSET:	SKIPA A,[XWD IGST2,IGSTRT]
SCANRESET:	MOVE A,[XWD OLDSCN,IGSTRT]
	BLT A,IGSTRT+4
FALSE:	MOVEI A,0
	POPJ P,

SCANINIT:	SUBI A,INUM0
	SUBI B,INUM0
	SUBI C,INUM0
	SUBI C+1,INUM0
	SUBI C+2,INUM0
	MOVEM A,IGST2	;IGSTRT
	MOVEM B,IGEND2	;IGEND
	PUSH P,C	;STRBEG
	PUSH P,C+1	;STREND
	PUSH P,C+2	;SLASHIFY
	MOVEI B,2
	MOVEI C,3
	MOVEI A,176
	DPB B,RATF2
	DPB C,STRF2
	DPB B,IDF2
	SOJG A,.-3
	MOVE A,[XWD "A"-"Z"-1,"A"]
	MOVEI B,5
	MOVEI C,4
	DPB B,RATF2
	DPB C,IDF2
	AOBJN A,.-2
	MOVE A,[XWD "a"-"z"-1,"a"]
	DPB B,RATF2
	DPB C,IDF2
	AOBJN A,.-2
	MOVE A,[XWD "0"-"9"-1,"0"]
	MOVEI B,8
	DPB B,RATF2
	DPB C,IDF2
	AOBJN A,.-2
	POP P,A	;SLASHIFY
	MOVEI B,3
	DPB B,IDF2
	DPB C,RATF2
	POP P,A	;STREND
	MOVEI B,2
	DPB B,STRF2
	POP P,A	;STRBEG
	MOVEI B,9
	DPB B,RATF2
	MOVE A,IGST2
	MOVEI B,0
	DPB B,RATF2
	DPB B,STRF2
	DPB B,IDF2
	MOVEI B,1
	MOVEI A,0	;NULL
	DPB B,RATF2
	DPB B,IDF2
	DPB B,STRF2
	MOVEI A,"."
	MOVEI B,7
	DPB B,RATF2
	JRST FALSE

LETTER:	SUBI A,INUM0
	MOVEI B,5
	MOVEI C,4
	DPB C,IDF2
LET2:	DPB B,RATF2
	JRST FALSE

IGNORE:	SUBI A,INUM0
	MOVEI B,3
	JRST LET2

END