Google
 

Trailing-Edge - PDP-10 Archives - bb-bt99l-bb - lcptab.x18
There is 1 other file named lcptab.x18 in the archive. Click here to see a list.
	TITLE LCPTAB - LCP Command Parsing Tables
	SUBTTL	Copyright
;
;
;
;COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1984,1985,1986,1987. 
;ALL RIGHTS RESERVED.
; 
;
;     THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY  BE  USED
;     AND COPIED ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE
;     AND WITH THE INCLUSION OF THE ABOVE COPYRIGHT NOTICE.   THIS
;     SOFTWARE  OR ANY OTHER COPIES THEREOF MAY NOT BE PROVIDED OR
;     OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.  NO  TITLE  TO
;     AND OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
;
;     THE INFORMATION  IN  THIS  SOFTWARE  IS  SUBJECT  TO  CHANGE
;     WITHOUT  NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT
;     BY DIGITAL EQUIPMENT CORPORATION.
;
;     DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
;     OF  ITS  SOFTWARE  ON  EQUIPMENT  WHICH  IS  NOT SUPPLIED BY
;     DIGITAL.
	SEARCH MACSYM
	SEARCH GLXMAC
	SEARCH ORNMAC
	PROLOG LCPTAB
	.TEXT	"/LOCALS"

	.CLIST==0
TOPS10 <
;DEFINE BREAK MASKS

	BRINI.			;INITIALIZE BREAK MASK FOR STANDARD FIELD
	BRKCH. (0,37)		;ALL CONTROL CHARACTERS
	BRKCH. (40,54)		;SPACE THROUGH COMMA
	BRKCH. (56,57)		;DOT AND SLASH
	BRKCH. (72,77)		;COLON THROUGH QUESTION MARK
	BRKCH. (100)		;ATSIGN
	BRKCH. (133,140)	;OPEN BRACKET THROUGH ACCENT GRAVE
	BRKCH. (173,177)	;CLOSE BRACKET THROUGH TILDE

FLDB0.==W0.			;STANDARD FIELD BREAK MASK
FLDB1.==W1.
FLDB2.==W2.
FLDB3.==W3.
> ;END TOPS10

; LCPKEY (next-pdb,keyword,symbol-suffix [,flags]) - Make keyword table entry
;	for an LCP command and define a symbol to represent the keyword value

	..Z==0
	IF2 <PURGE ..Z>

DEFINE	LCPKEY (NXT,CODE,KEY,FLAGS), <
	IFNDEF $KL'CODE,<
		$KL'CODE==:..Z	; Assign value to global symbol
		..Z==..Z+1>    ; Bump keyword code counter

	IFN .CLIST, <PRINTX <$KL'CODE	= 'KEY>>
	IFB <FLAGS>, <DSPTAB (NXT,$KL'CODE,KEY)>
	IFNB <FLAGS>, <DSPTAB (NXT,$KL'CODE,KEY,FLAGS)>
	>		      ; End of LCPKEY Macro Definition


DEFINE	GROUPS (NEXT,%A,%B,%C,%D), <
%A:	$DIGIT (%B,<^D10>,<List Of Group Ranges "n:m" or Single Groups>,<$ACTION(CHKGRP)>)
%B:	$TOKEN (%C,<:>,<$HELP(<":" To Specify Group Range>),$ALTERNATE(%D)>)
%C:	$NUMBER (%D,<^D10>,<Ending Group Range>,<$ACTION(CHKGRP)>)
%D:	$COMMA (%A,<$HELP(<"," To Specify Additional Group>),$ALTERNATE(NEXT)>)
	IF2 <PURGE %A,%B,%C,%D>
	>		      ; End of GROUPS Definition


NAMBM:	BRMSK. (FLDB0.,FLDB1.,FLDB2.,FLDB3.,< $,_,.>)
STRBM:	BRMSK. (FLDB0.,<FLDB1.&<^-<1_^D35!1_^D33!1_^D23>>>,FLDB2.,FLDB3.,!#$%&'()*+-./:;<=>@[\]^_`{|}~)

CHKL16:	$SAVE <T1,T2,T3>
	MOVEI T1,^D16		;Check for max length of 16
	JRST CHKLNG

CHKL64:	$SAVE <T1,T2,T3>
	MOVEI T1,^D64		;Check for max length of 64

CHKLNG:	MOVE S1,CR.COD(S2)	;Function type
	CAIE S1,.CMFLD		;Must be field
	$RETF			;Isn't
	MOVE S1,CR.FLG(S2)	;Get pointer to the field
	MOVE S1,.CMABP(S1)	; text.
	SETZ T3,0		;Zero character count
CHKNM0:	ILDB T2,S1
	SKIPE T2		;End of the string found
	AOJA T3,CHKNM0		;Count the character
	CAIE T3,0		;Null name not permitted.
	JRST CHKNM1
	$TEXT ,<Name too short^A>
	$RETF
CHKNM1:	CAMG T3,T1
	$RETT
	$TEXT ,<Name too long^A>
	$RETF

CHKGRP:	MOVE S1,CR.RES(S2)
	CAIG S1,^D255
	SKIPGE S1
	JRST	CHKGRF
	$RETT

CHKGRF:	PUSHJ	P,FIXIT
	MOVEI	S2,[ASCIZ /Group number must be between 0 and 255/]
	$RETF

FIXIT:	HRRZ	T4,CR.FLG(S2)	;GET ADR OF CMDBLK
	MOVE	T1,.CMPTR(T4)	;GET COMMAND POINTER
	MOVE	T2,.CMABP(T4)	;GET BP TO ATOM BUFFER
FIXI.1:	ILDB	T3,T2
	JUMPE	T3,FIXI.2	;DONE.. ALL FIXED UP
	PUSHJ	P,DBP		;DECREMENT THE BP
	AOS	.CMCNT(T4)
	JRST	FIXI.1		;TRY NEXT CHARACTER
FIXI.2:	MOVEM	T1,.CMPTR(T4)	;STORE ADJUSTED BP
	POPJ	P,0

;
; Routine to decrement a "normal" 7 bit byte pointer in T1
;
DBP:	ADD	T1,[070000,,0]	;BACK UP A BYTE
	SKIPGE	T1		;IF WE NEED TO,
	SUB	T1,[430000,,1]	; THEN BACK UP A WORD
	$RET
	SUBTTL Parsing Tree

LCPTAB::
	EXP	2			;Lenght of the table
	EXP	INIPDB			;Address of initial PDB
	EXP	TOPPDB			;Top level keyword PDB

INIPDB:	$INIT (TOPPDB)
TOPPDB:	$KEYDSP (LCPTBL)
LCPTBL:	$STAB
	LCPKEY (CLRPDB,CLR,<CLEAR>)
	LCPKEY (SETPDB,SET,<SET>)
	LCPKEY (SHWPDB,SHW,<SHOW>)
	LCPKEY (PLSPDB,STA,<START>)
	LCPKEY (PLSPDB,STP,<STOP>)
	LCPKEY (ZROPDB,ZRO,<ZERO>)
	$ETAB
CRLF:	$CRLF		;Commands end with CR/LF

PLSPDB:	$NOISE	(CRLF,<Processing LAT sessions>)


CLRPDB:	$KEYDSP (CLR000)
CLR000:	$STAB
	DSPTAB (SET700,.LPCOD,<GROUPS>)
	DSPTAB (CRLF,.LPNID,<IDENTIFICATION>)
	DSPTAB	(CLR002,777777,<MAXIMUM>)
	DSPTAB (CRLF,.LPMTI,<MULTICAST-TIMER>)
	DSPTAB (CRLF,.LPNUM,<NUMBER>)
	DSPTAB (CLR001,777777,<RETRANSMIT>)
	DSPTAB (CLR100,.LPSRV,<SERVICE-NAME>)
	$ETAB

CLR001:	$KEY	(CRLF,CLR011)
CLR011:	$STAB
	KEYTAB	(.LPRLI,<LIMIT>)
	KEYTAB	(.LPTIM,<TIMER>)
	$ETAB

CLR002:	$KEY	(CRLF,CLR012)
CLR012:	$STAB
	KEYTAB (.LPMAC,<ACTIVE-CIRCUITS>)
	KEYTAB (.LPMCO,<SESSIONS>)
	$ETAB

CLR100:	$FIELD(CRLF,<Service name, 1 to 16 characters>,<$FLAGS(CM%BRK),$BREAK(NAMBM),$ACTION(CHKL16)>)



SETPDB:	$KEYDSP (SET000)
SET000:	$STAB
	DSPTAB (SET700,.LPCOD,<GROUPS>)
	DSPTAB (SET900,.LPNID,<IDENTIFICATION>)
	DSPTAB	(SET002,777777,<MAXIMUM>)
	DSPTAB (SET600,.LPMTI,<MULTICAST-TIMER>)
;	DSPTAB (SET800,.LPNNM,<NODE-NAME>)
	DSPTAB (SET300,.LPNUM,<NUMBER>)
	DSPTAB	(SET001,777777,<RETRANSMIT>)
	DSPTAB (SE1000,.LPSRV,<SERVICE-NAME>)
	$ETAB

SET001:	$KEYDSP	(SET011)
SET011:	$STAB
	DSPTAB (SE2000,.LPRLI,<LIMIT>)
	DSPTAB (SET500,.LPTIM,<TIMER>)
	$ETAB

SET002:	$KEYDSP	(SET012)
SET012:	$STAB
	DSPTAB (SET100,.LPMAC,<ACTIVE-CIRCUITS>)
	DSPTAB (SET200,.LPMCO,<SESSIONS>)
	$ETAB

SET100:	$NUMBER (CRLF,^D10,<Number of simultaneous servers allowed>)

SET200:	$NUMBER (CRLF,^D10,<Number of LAT terminals>)
SET300:	$NUMBER (CRLF,^D10,<Unique host id>)


SET500:	$NUMBER (CRLF,^D10,<Timer value in milliseconds>)

SET600:	$NUMBER (CRLF,^D10,<Timer value in seconds>)

SET700:	GROUPS (CRLF)

SET800:	$CTEXT (CRLF,<Text, 1 to 6 characters>)

SET900:	$FIELD (CRLF,<Text, 1 to 64 characters>,<$FLAGS(CM%BRK),$BREAK(STRBM),$ACTION(CHKL64)>)

SE1000:	$FIELD(SE1001,<Service name, 1 to 16 characters>,<$FLAGS(CM%BRK),$BREAK(NAMBM),$ACTION(CHKL16)>)
SE1001:	$SWITCH (SE1020,SE1010,$ALTERNATE(SE1200))
SE1010:	$STAB
	KEYTAB (0,<RATING:>)
	$ETAB
SE1020:	$KEYDSP (SE1022,$ALTERNATE(SE1024))
SE1022:	$STAB
	DSPTAB (SE1100,0,<DYNAMIC>)
	$ETAB
SE1024:	$NUMBER (SE1100,^D10,<Rating value in range 0-255>)
SE1100:	$SWITCH (SE1120,SE1110,$ALTERNAT(CRLF))
SE1110:	$STAB
	KEYTAB (1,<IDENTIFICATION:>)
	$ETAB
SE1120:	$QUOTE (CRLF,<Quoted string, 1 to 64 characters>)


SE1200: $SWITCH (SE1220,SE1210,$ALTERNATE(CRLF))
SE1210:	$STAB
	KEYTAB (1,<IDENTIFICATION:>)
	$ETAB
SE1220:	$QUOTE (SE1230,<Quoted string, 1 to 64 characters>)
SE1230:	$SWITCH (SE1320,SE1310,$ALTERNATE(CRLF))
SE1310:	$STAB
	KEYTAB (0,<RATING:>)	
	$ETAB
SE1320:	$KEYDSP (SE1322,$ALTERNATE(SE1324))
SE1322:	$STAB
	DSPTAB (CRLF,0,<DYNAMIC>)
	$ETAB
SE1324:	$NUMBER (CRLF,^D10,<Rating value in range 0-255>)

SE2000:	$NUMBER (CRLF,^D10,<Number of times to retransmit before killing circuit>)



SHWPDB:	$KEYDSP (SHW000)
SHW000:	$STAB
	DSPTAB (CRLF,0,<CHARACTERISTICS>)
	DSPTAB (ZRO100,2,<COUNTERS>)
	DSPTAB (CRLF,5,<HOST-INITIATED-REQUESTS>)
	DSPTAB (CRLF,4,<PENDING-REQUESTS>)
	DSPTAB (SHW200,3,<SERVER>)
	DSPTAB (CRLF,1,<SESSIONS>)
	$ETAB


SHW200:
TOPS20 <
	$SWITCH (CRLF,SHW220,<$DEFAULT(/ALL),$ALTERNATE(SHW325)>)
>
TOPS10 <
	$SWITCH (CRLF,SHW220,<$DEFAULT(ALL),$ALTERNATE(SHW325)>)
>

SHW220:	$STAB
	KEYTAB (0,<ALL>)
	$ETAB

SHW325:	$FIELD(CRLF,<Server name, 1 to 16 characters>,<$FLAGS(CM%BRK),$BREAK(NAMBM),$ACTION(CHKL16)>)

ZROPDB:	$KEYDSP (ZRO000,$DEFAULT(COUNTERS))
ZRO000:	$STAB
	DSPTAB (ZRO100,0,<COUNTERS>)
	$ETAB

ZRO100:	$SWITCH (SHW325,ZRO120,$ALTERNATE(CRLF))
ZRO120:	$STAB
	KEYTAB (1,<SERVER:>)
	$ETAB

	END		;End  of LCPTAB.MAC