Google
 

Trailing-Edge - PDP-10 Archives - BB-L054E-RK - blspar.r36
There are no other files named blspar.r36 in the archive.
!
!		      COPYRIGHT (c) 1979,1980 BY
!	      DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
!
! 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.
!

!++
! FACILITY: BLISS Interface to TOPS-10/20 GALAXY OPERATOR command parser
!
! ABSTRACT:
!
!	This module provides a set of BLISS macros which will generate
!	the data structures necessary to be used to interface with the
!	GALAXY OPERATOR command parser (OPRPAR). This routine provides
!	an easy to use and self documenting way to make use of the
!	COMND JSYS functionality. The user is only required to define
!	his command syntax in terms of the macros provided here and
!	then call the common parser routine OPRPAR. This routine will
!	parse the command from the users terminal and return only when
!	either the command has been completely parsed successfully or
!	the parse has detected an invalid syntax on input. Additional
!	routines are provided to allow the user to obtain the values
!	that were parsed by the parser in a structured manner.
!
!	The macros defined here are similar in appearance to the 
!	MACRO-20 macros which are defined in PS:<ORION>PARUNV.UNV
!
!
! ENVIRONMENT: TOPS-20 with GALAXY R4 GLXLIB
!  
! AUTHOR: Dale C. Gunn, CREATION DATE: 29 January 1979 
!
!
! MODIFIED BY:
!
!	Donald R. Brandt, 26-MAR-80: VERSION 02
!
! 01	- Updated to support released version of GALAXY
!
!	Dale C. Gunn, 27-MAR-80: VERSION 02
!
! 02	- Remove definition of CM_BRK which is defined in MONSYM
!
!	Dale C. Gunn, 28-MAR-80: VERSION 02
!
! 03	- Remove CM_SDH from PDB_INIT Macro definition
!
!	Donald R. Brandt, 24-Apr-80: VERSION 02
!
! 04	- Add symbol definition for $KYTAK
!	  Change + to logical OR in PDB_INIT macro
!
!--
!
! TABLE OF CONTENTS
!


!
! INCLUDE FILES:
!


!
! MACROS:
!

LITERAL $KYTAK	=	%O'100042';	!A04 (symbol from ORNMAC)

LITERAL	PB$PDB	=	%O'777777000000';
LITERAL	PB$FDB	=	%O'000000777777';

!
!   Parser Flag values
!
FIELD	FLAG_FIELDS =
	SET
	FLG_TAKE = [35],	!TAKE command processed
	FLG_CTAK = [34],	!Command from a TAKE command
	FLG_ACTE = [33],	!Action routine error
	FLG_NPRO = [32],	!No processing for command
	FLG_ERRO = [31],	!Error flag; error occurred
	FLG_REPA = [30],	!Reparse required
	FLG_INTE = [29],	!Interrupt exit flag
	FLG_DSPT = [28],	!Display this TAKE command
	FLG_ENDT = [27],	!End of TAKE file
	FLG_DERR = [26],	!Default routine error
	FLG_CEOF = [25]		!Core parse end of file
	TES;

MACRO	PAR_FLAG = BITVECTOR[36] FIELD(FLAG_FIELDS) % ;

!
! PDB field definitions
!
FIELD	PDB_FIELDS =
	SET
	PDB_HDR = [0,0,36,0],	!header word
				!COMND defined FDB fields
	PDB_ALT = [1,0,18,0],	!alternate PDB to parse
	PDB_FLG = [1,18,9,0],	!function flags
	PDB_TYP = [1,27,9,0],	!function code of field type
	PDB_DAT = [2,0,36,0],	!function specific data
	PDB_HLP = [3,0,36,0],	!pointer to help text
	PDB_DEF = [4,0,36,0],	!pointer to default string
	PDB_BRK = [5,0,36,0],	!break field
				!OPRPAR defined extension
	PDB_NXT = [6,0,36,0],	!next PDB address
	PDB_ACT = [7,0,36,0],	!action routine address
	PDB_ERR = [8,0,36,0],	!error routine address
	PDB_PRE = [9,0,36,0]	!pre-parse default routine address
	TES;

LITERAL	PDB$SZ = 10;	!SIZE OF PDB STRUCTURE
LITERAL	FDB$SZ = 6;	!Size of FDB (offset to OPRPAR extension)

MACRO	PDB_BLOCK = BLOCK[PDB$SZ] FIELD(PDB_FIELDS) % ;

!
! PDB initialization macro
!

!
! MACRO TO INITIALIZE THE PDB
!

MACRO PDB_INIT (TYP,FLG,ALT,DAT,HLP,DEF,BRK,NXT,ACT,ERR,PRE) =
	PDB_BLOCK
	INITIAL (FLD(PDB$SZ,PB$PDB) OR FLD(FDB$SZ,PB$FDB),
		FLD(TYP,CM_FNC)
		%IF NOT %NULL(FLG) %THEN OR FLG %FI
		%IF NOT %NULL(DEF) %THEN OR CM_DPP %FI
		%IF NOT %NULL(HLP) %THEN OR CM_HPP %FI
		%IF NOT %NULL(BRK) %THEN OR CM_BRK %FI
		%IF NOT %NULL(ALT) %THEN OR FLD(ALT,CM_LST)+1 %FI,
		%IF %NULL(DAT) %THEN 0 %ELSE DAT %FI,
		%IF %NULL(HLP) %THEN 0 %ELSE CH$ASCIZ(HLP) %FI,
		%IF %NULL(DEF) %THEN 0 %ELSE CH$ASCIZ(DEF) %FI,
		%IF %NULL(BRK) %THEN 0 %ELSE BRK %FI,
		%IF %NULL(NXT) %THEN 0 %ELSE NXT %FI,
		%IF %NULL(ACT) %THEN 0 %ELSE ACT %FI,
		%IF %NULL(ERR) %THEN 0 %ELSE ERR %FI,
		%IF %NULL(PRE) %THEN 0 %ELSE PRE %FI) %;


!
! MACROS TO GENERATE THE SYNTAX TABLES
!

!
! MACRO TO GENERATE STANDARD ARGUMENT LIST
!

MACRO ARGS (D) = 
	FLAGS=D,
	ALTERNATE=,
	DATA=D,
	HELP=,
	DEFAULT=,
	BREAK=,
	NEXT=D,
	ACTION=D,
	ERROR=D,
	PREFILL=D %;

KEYWORDMACRO $INIT (ARGS(0)) =
	
	PDB_INIT ($CMINI,FLAGS,ALTERNATE,DATA,HELP,DEFAULT,BREAK,NEXT,ACTION,ERROR,PREFILL) %;

KEYWORDMACRO $KEY (TABLE=,ARGS(0)) = 
	
	PDB_INIT ($CMKEY,FLAGS,ALTERNATE,TABLE,HELP,DEFAULT,BREAK,NEXT,ACTION,ERROR,PREFILL) %;

KEYWORDMACRO $KEYDSP (TABLE=,ARGS(0)) = 
	
	PDB_INIT ($CMKEY,FLAGS,ALTERNATE,TABLE,HELP,DEFAULT,BREAK,NEXT,ACTION,ERROR,PREFILL) %;

KEYWORDMACRO $NUMBER (RADIX=,ARGS(0)) = 
	
	PDB_INIT ($CMNUM,FLAGS,ALTERNATE,RADIX,HELP,DEFAULT,BREAK,NEXT,ACTION,ERROR,PREFILL) %;

KEYWORDMACRO $DIGIT (RADIX=,ARGS(0)) = 
	
	PDB_INIT ($CMNUX,FLAGS,ALTERNATE,RADIX,HELP,DEFAULT,BREAK,NEXT,ACTION,ERROR,PREFILL) %;

KEYWORDMACRO $SWITCH (TABLE=,ARGS(0)) = 
	
	PDB_INIT ($CMSWI,FLAGS,ALTERNATE,TABLE,HELP,DEFAULT,BREAK,NEXT,ACTION,ERROR,PREFILL) %;

KEYWORDMACRO $NOISE (TEXT=,ARGS(0)) = 
	
	PDB_INIT ($CMNOI,FLAGS,ALTERNATE,CH$ASCIZ(TEXT),HELP,DEFAULT,BREAK,NEXT,ACTION,ERROR,PREFILL) %;

KEYWORDMACRO $IFILE (ARGS(0)) = 
	
	PDB_INIT ($CMIFI,FLAGS,ALTERNATE,DATA,HELP,DEFAULT,BREAK,NEXT,ACTION,ERROR,0) %;

KEYWORDMACRO $OFILE (ARGS(0)) = 
	
	PDB_INIT ($CMOFI,FLAGS,ALTERNATE,DATA,HELP,DEFAULT,BREAK,NEXT,ACTION,ERROR,0) %;

KEYWORDMACRO $FILE (ARGS(0)) = 
	
	PDB_INIT ($CMFIL,FLAGS,ALTERNATE,DATA,HELP,DEFAULT,BREAK,NEXT,ACTION,ERROR,PREFILL) %;

KEYWORDMACRO $FIELD (ARGS(0)) = 
	
	PDB_INIT ($CMFLD,FLAGS,ALTERNATE,DATA,HELP,DEFAULT,BREAK,NEXT,ACTION,ERROR,PREFILL) %;

KEYWORDMACRO $CONFIRM (ARGS(0)) = 
	
	PDB_INIT ($CMCFM,FLAGS,ALTERNATE,DATA,HELP,DEFAULT,BREAK,NEXT,ACTION,ERROR,PREFILL) %;

KEYWORDMACRO $DIR (ARGS(0)) = 
	
	PDB_INIT ($CMDIR,FLAGS,ALTERNATE,DATA,HELP,DEFAULT,BREAK,NEXT,ACTION,ERROR,PREFILL) %;

KEYWORDMACRO $USER (ARGS(0)) = 
	
	PDB_INIT ($CMUSR,FLAGS,ALTERNATE,DATA,HELP,DEFAULT,BREAK,NEXT,ACTION,ERROR,PREFILL) %;

KEYWORDMACRO $COMMA (ARGS(0)) = 
	
	PDB_INIT ($CMCMA,FLAGS,ALTERNATE,DATA,HELP,DEFAULT,BREAK,NEXT,ACTION,ERROR,PREFILL) %;

KEYWORDMACRO $FLOAT (ARGS(0)) = 
	
	PDB_INIT ($CMFLT,FLAGS,ALTERNATE,DATA,HELP,DEFAULT,BREAK,NEXT,ACTION,ERROR,PREFILL) %;

KEYWORDMACRO $DEV (ARGS(0)) = 
	
	PDB_INIT ($CMDEV,FLAGS,ALTERNATE,DATA,HELP,DEFAULT,BREAK,NEXT,ACTION,ERROR,PREFILL) %;

KEYWORDMACRO $TEXT (ARGS(0)) = 
	
	PDB_INIT ($CMTXT,FLAGS,ALTERNATE,DATA,HELP,DEFAULT,BREAK,NEXT,ACTION,ERROR,PREFILL) %;

KEYWORDMACRO $DATE (ARGS(0)) = 
	
	PDB_INIT ($CMTAD,FLAGS,ALTERNATE,CM_IDA,HELP,DEFAULT,BREAK,NEXT,ACTION,ERROR,PREFILL) %;

KEYWORDMACRO $TIME (ARGS(0)) = 
	
	PDB_INIT ($CMTAD,FLAGS,ALTERNATE,CM_ITM,HELP,DEFAULT,BREAK,NEXT,ACTION,ERROR,PREFILL) %;

KEYWORDMACRO $TAD (ARGS(0)) = 
	
	PDB_INIT ($CMTAD,FLAGS,ALTERNATE,HELP,CM_ITM+CM_IDA,DEFAULT,NEXT,ACTION,ERROR,PREFILL) %;

KEYWORDMACRO $QUOTE (ARGS(0)) = 
	
	PDB_INIT ($CMQST,FLAGS,ALTERNATE,DATA,HELP,DEFAULT,BREAK,NEXT,ACTION,ERROR,PREFILL) %;

KEYWORDMACRO $UNQUOTE (ARGS(0)) = 
	
	PDB_INIT ($CMUQS,FLAGS,ALTERNATE,DATA,HELP,DEFAULT,BREAK,NEXT,ACTION,ERROR,PREFILL) %;

KEYWORDMACRO $TOKEN (CHAR=,ARGS(0)) = 
	
	PDB_INIT ($CMTOK,FLAGS,ALTERNATE,CH$ASCIZ(CHAR),HELP,DEFAULT,BREAK,NEXT,ACTION,ERROR,PREFILL) %;

KEYWORDMACRO $ACCOUNT (ARGS(0)) = 
	
	PDB_INIT ($CMACT,FLAGS,ALTERNATE,DATA,HELP,DEFAULT,BREAK,NEXT,ACTION,ERROR,PREFILL) %;

KEYWORDMACRO $NODE (ARGS(0)) = 
	
	PDB_INIT ($CMNOD,FLAGS,ALTERNATE,DATA,HELP,DEFAULT,BREAK,NEXT,ACTION,ERROR,PREFILL) %;

MACRO	!To make forward references to PDB's
	$PDB [NAME] =
	FORWARD NAME:BLOCK[PDB$SZ] % ;

MACRO

    CMD_DATA_STRING (STRING) =
	CH$ASCIZ(STRING) %,

    $DSPTAB (TABLE) =
	VECTOR [TBL_SIZ(%REMOVE(TABLE))]
	INITIAL ( KEY_COUNT(%REMOVE(TABLE)), DSP_STR_SET(%REMOVE(TABLE)) ) %,

    $KEYTAB (TABLE) =
	VECTOR [TBL_SIZ(%REMOVE(TABLE))]
	INITIAL ( KEY_COUNT(%REMOVE(TABLE)), KEY_STR_SET(%REMOVE(TABLE)) ) %,

    $KEYKEY (TABLE) =
	VECTOR [TBL_SIZ(%REMOVE(TABLE))]
	INITIAL ( KEY_COUNT(%REMOVE(TABLE)), KEY_KEY_SET(%REMOVE(TABLE)) ) %,

    TBL_SIZ (TBL) = 
	%LENGTH+1 %,

    KEY_COUNT (TBL) =
	(%LENGTH)^18+%LENGTH %,

    KEY_STR_SET [PAIR] =
	KEY( %REMOVE(PAIR) ) %,

    KEY_KEY_SET [TEXT] =
	K( %REMOVE(TEXT) ) %,

    DSP_STR_SET [PAIR] =
	KEYDSP( %REMOVE(PAIR) ) %,

    KEY (TEXT) [VALUE] =
	UPLIT(%ASCIZ %STRING(TEXT))^18+VALUE %,

    K(TEXT) [] =
	UPLIT(%ASCIZ %STRING(TEXT))^18 + UPLIT(%ASCIZ %STRING(TEXT)) %,

    KEYDSP (NEXT,TEXT) [VALUE] =
	UPLIT(%ASCIZ %STRING(TEXT))^18+UPLIT((VALUE)^18+NEXT) %,

    CMD_DATA_MASK (CHARS) =
	UPLIT(MASK_WORD(0, 31, %REMOVE(CHARS)) + 0,
	    MASK_WORD(32, 63, %REMOVE(CHARS)) + 0,
	    MASK_WORD(64, 95, %REMOVE(CHARS)) + 0,
	    MASK_WORD(96, 127, %REMOVE(CHARS)) + 0) %,

    MASK_WORD (LOW_CHAR, HIGH_CHAR) [CHAR] =
	%IF ((CHAR GEQ LOW_CHAR) AND (CHAR LEQ HIGH_CHAR))
	    %THEN 1^(35+LOW_CHAR-CHAR)
	    %FI %;


!
! EQUATED SYMBOLS:
!

!
! OWN STORAGE:
!

!
! EXTERNAL REFERENCES:
!

!
! LINKAGES:
!

LINKAGE GALAXY = PUSHJ(REGISTER=1,REGISTER=2):
			LINKAGE_REGS (15,14,0)
			NOPRESERVE(0,3,4)
			PRESERVE(5,6,7,8,9,10,11,12,13);


! GALAXY exit routine parameter block

FIELD
     CR_FIELDS =                        !Command Reply fields
     SET
     CR$ADR = [0,0,18,0],               !Offset to CMDBLK address
     CR$FLG = [0,18,18,0],              !Offset to flag word 
     CR$RES = [1,0,36,0],               !Offset to result word
     CR$PDB = [2,0,36,0],               !Given PDB,,used PDB
     CR$COD = [3,0,36,0]                !Code type of processed field
     TES;

LITERAL
       CR$SIZ = 4 ;                     !Size of command reply block

MACRO
     CR_BLOCK = BLOCK[CR$SIZ] FIELD(CR_FIELDS) %;