Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-04 - 43,50325/struct.beg
There are no other files named struct.beg in the archive.
! File:   STRUCT.BEG
!
!    This work was supported by the Advanced Research
!    Projects Agency of the Office of the Secretary of
!    Defense (F44620-73-C-0074) and is monitored by the
!    Air Force Office of Scientific Research.

!
!
!	THIS BEGIN FILE CONTAINS INFO FOR STRUCTURES AND MACROS
!
!
!
!-----------------------------------------------------------------
!17.  THERE ARE 4 MAJOR "STACKS" ASSOCIATED WITH THE MACRO/
!      STRUCTURE STREAM SYSTEM: INPUT (PREFIX INP), OUTPUT STREAM
!      PREFIX WST), ACTUAL PARAMETER LIST (PREFIX APL) AND THE
!     ACTUAL PARAMETER MECHANISM (PREFIX APM).  ALL STACKS ARE
!      HANDLED BY 2 ROUTINES -- STRMPUSH AND STRMPOP.  BOTH TAKE
!      AND ARGUMENT WHICH IS THE ADDRESS OF THE TOP OF A STACK.
!      THE TOP IS A BUFFER IN GLOBAL STORAGE-- THE REMAINDER IS
!      ALLOCATED FROM ST.  THE STACK FORMAT MUST BE:

  MACRO 
	STKLEN=0,0,18$,    ! LENGTH IN WORDS, INCLUDING THE 0TH
  	STKNEXT=0,18,18$;  ! LINK WORD, SET BY PUSH

!        TWO OF THE STACKS -- WST AND APL -- ARE ALSO USED AS
!      "STREAM MECHANISMS".  THE 2 FUNCTIONS STRMAPPEND AND
!      STRMQUIT ARE USED ON TOP OF THE STACK MECHANISM TO CREATE
!      STREAMS; THE STACK TOPS ACT AS BUFFERS IN THIS CASE,
!      PUSHING ON OVERFLOW WITH APPENDS.  WHEN WE QUIT, THE LINKS
!      IN THE STACK ARE REVERSED TO CREATE A STREAM.

!      GLOBAL DECLARATION: ROOM[INPMAX+APMMAX+FIXEDROOM]

  STRUCTURE FVEC[I,J,K]=(.FVEC+.I)<.J, IF .K EQL 0 THEN 36 ELSE .K>;
  STRUCTURE INDFVEC[I,J,K]=(@.INDFVEC+.I)<.J,IF .K EQL 0 THEN 36 ELSE .K>;
  STRUCTURE STREAMTOP[J,K]=(.STREAMTOP+.(.STREAMTOP)<0,18>)
         <.J, IF .K EQL 0 THEN 36 ELSE .K>;

  EXTERNAL FVEC ROOM;

!  A. FIXED FIELDS

  BIND
	STVEC STRUDVNME=ROOM[0,18,18],	! DEFAULT VECTOR NT INDEX
	STVEC STRUDEFV=ROOM[0,0,18],	! DEFAULT VECTOR STE INDEX
	ROOMTOBE0=1,		!ZEROED IN DRIVER FROM HERE UP
	      NINP=ROOM[1,0,18],	! NUMBER OF PARAMETERS THIS DEF
	      OLDDELI=ROOM[1,18,18],	! INDEX OF CURRENT DEL AFTER RUND
	      OLDDEL=ROOM[2,0,36],	! DEL BEFORE RUND
	      NATOM=ROOM[3,0,36],	! BUFFER POINTER NEXT ATOM
	      STRUCP=ROOM[4,0,1],	! COPYING STRUCTURE BODY
	      MACRCP=ROOM[4,3,1],	! COPYING MACRO BODY OR ACTUAL PARAMTER LIST
	      SIZEEXP=ROOM[4,6,1],		! SIZE EXPRESSION BEING DEFINED
	      NOIN=ROOM[4,12,1],
	      NOIT=ROOM[4,15,1],
	      NOCON=ROOM[4,18,1],
	      NOPAR=ROOM[4,21,1],
	      QUOTESYM=ROOM[4,24,1],	! SYMBOL IS QUOTED
	      QUOTEDEL=ROOM[4,27,1],	! DELIMITER IS QUOTED
	      QUOTED=ROOM[4,30,1],	! RUND HAS NOT DETERMINED WHAT
					!  IS QUOTED YET
	      EXPANDERR=ROOM[4,33,1],	! ERROR IN SCANNING MACRO ACTUAL PARAMS
	      RESWD=ROOM[4,35,1],	! CURRENT DELIMITER WAS RESERVED WORD

	STVEC STRUDEF:MACRDEF=ROOM[5],	! DEFINING THIS MACR OR STRU
	      MACRNUMBL=ROOM[6],	! NUM BLANKS PREFIX MACRO TRACE
	      FIXEDROOM=7;		! NUMBER OF CELLS IN FIXED AREA

!  B. INPUT STACK FIELDS (INP)

  MACRO
	MARKL(L,O,PRE)=ID(PRE)LEN=L+O,ID(PRE)ROOM=FIXEDROOM+ID(PRE)LEN$;

  BIND
	FVEC  INPBUF=ROOM[FIXEDROOM],
    	      INPUTTYPE=ROOM[FIXEDROOM+1,0,18], ! DETERMINE TAKE IN RUND

	      ATOMISSYM=ROOM[FIXEDROOM+1,18,1],
	      STRMEOF=ROOM[FIXEDROOM+1,21,1],
	      STREAMIN=ROOM[FIXEDROOM+1,24,1],
	      PEEKBIT=ROOM[FIXEDROOM+1,27,1],
	      ACTUALEXP=ROOM[FIXEDROOM+1,30,1],
	      TRACEBIT=ROOM[FIXEDROOM+1,33,1],
	      STRUEXPAND=ROOM[FIXEDROOM+1,35,1],


	WINDOW FUTWINDOW=ROOM[FIXEDROOM+2],
	      ATOMCLASS=FUTWINDOW[LTYPF],
	      FUTRESWD=FUTWINDOW[30,1],
	      TMS=ROOM[FIXEDROOM+3,0,18],
	      ITMS=ROOM[FIXEDROOM+3,18,18],
	      MACRITCOUNT=ROOM[FIXEDROOM+4,0,18],
	      MACRLENGTH=ROOM[FIXEDROOM+4,18,18],

	MARKL(0,5,RUND),

	STVEC STRMTOP=ROOM[RUNDROOM,0,18],
	STVEC STRMBEG=ROOM[RUNDROOM,18,18],
	STVEC STRMPOS=ROOM[RUNDROOM+1,0,18],
	      MACRSUBTYPE=ROOM[RUNDROOM+1,18,18],

	MARKL(RUNDLEN,2,MACRF),

	STVEC STRUNAME:MACRNAME=ROOM[MACRFROOM,0,18],
	STVEC STRUACT=ROOM[MACRFROOM,18,18],

	MARKL(MACRFLEN,1,STRU),

	STVEC REMBEG=ROOM[MACRFROOM,18,18],
	STVEC REMTOP=ROOM[MACRFROOM+1,0,18],
	      REMLEN=ROOM[MACRFROOM+1,18,18],
	      REMPOS=ROOM[MACRFROOM+2,0,18],
	      MACRNACTS=ROOM[MACRFROOM+2,18,18],

	MARKL(MACRFLEN,3,MACRPA),

	STVEC MACRACT=ROOM[MACRPAROOM,0,18],

	MARKL(MACRPALEN,1,MACRRF),

	WINDOW MACRBSIND=ROOM[MACRRFROOM,0,36],
	        MACRLBR=MACRBSIND[24,12],
		MACRRBR=MACRBSIND[12,12],
		MACRSEP=MACRBSIND[0,12],
	       MACRNF=ROOM[MACRRFROOM+1,0,18],
	      MACRNI=ROOM[MACRRFROOM+1,18,18],

	MARKL(MACRRFLEN,2,MACR),

	INPMAX=MACRLEN, INPROOM=MACRROOM;


!  C. ACTUAL PARAMETER MECHANISM (APM)

  BIND
	FVEC   APMBUF=ROOM[INPROOM];

!  D. ACTUAL PARAMETER LIST MECHANISM (APL)

  BIND
	STREAMTOP APLBUF=ROOM[INPROOM+1],
	       APLBASE=INPROOM+2,

	APLMAX=33+1, APLROOM=INPROOM+1+APLMAX;

!  E. STREAM CREATION MECHANISM (WST).

  BIND
	STREAMTOP WSTBUF=ROOM[APLROOM],
	WSTMAX=20+1,
	APMMAX=1+APLMAX+WSTMAX,

	MARKL(INPMAX,APMMAX,APM);
! E.1. TRACING STACK (MTBUF):

  BIND
	FVEC MTBUF=ROOM[APMROOM],
	MTMAX=10+1,

	MARKL(APMLEN,MTMAX,MT);

! ROOMSIZE IS ALSO DEFINED IN GLODEC.BEG;
  BIND ROOMSIZE=MTROOM;

!  F. DEFAULT VECTOR STACK MECHANISM

  MACRO
	STRUCF=STKNEXT$;

!  G. STATES OF THE MACRO SUBTYPE AND ASSOCIATED BINDS AND PREDICATES.

  BIND
	MACRRIND=1,	! [] SPECIFIED
	MACRIIND=2,	! [X,...] SPECIFIED
	MACRFIND=4,	! (X,...) SPECIFIED
	MACRSIND=8,	! STRUCTURE TYPE--ALLOWS COMMON "POPORIT"
	MACRSIMPLE=0,
	MACRPASSED=MACRRIND,
	MACRFIXED=MACRFIND,
	MACRRECUR=MACRFIND+MACRRIND;

  MACRO
	RECURSIVE=(.SUBTYPE EQL MACRRECUR)$,
	FIXED=(.SUBTYPE EQL MACRFIXED)$,
	PASSED=(.SUBTYPE EQL MACRPASSED)$,
	SIMPLE=(.SUBTYPE EQL MACRSIMPLE)$,
	ITERATED=((.SUBTYPE AND MACRIIND) NEQ 0)$,
	STRUCTURED=(.SUBTYPE EQL MACRSIND)$,
	MUSTSEEPARMS=(.SUBTYPE AND MACRRIND)$,
	REMREQ=((.SUBTYPE AND 7) NEQ 0)$,
	UNLESSQUOTED(SORD)=IF NOT .ID(QUOTE)SORD THEN$;


!  H. MACROS USEFUL FOR DEFINING STANDARD (ALLOCATED) SYMBOLS.

MACRO
	DEFEXT(STE)=(EXTERNAL DEFASYM,DEFMAP,PEXTERNAL;
		     DEFASYM(STE,2,0,16);
		     DEFMAP(STE);
		     ST[STE,LNKGNMF]_.DFLTLNKGLX;
		     PEXTERNAL(0,2,STE))$;


!------------------------------------------------------------
!18. LONG STRING AND PLIT ASSOCIATED FIELDS AND CONSTANTS

MACRO
	LEXEMEF=0,0,36$,	! NORMAL CELL HANGING FROM PLIT LIST
	 LBYTE =0,8,8$,
	 RBYTE =0,0,8$,
	DUPLENGTH=0,0,36$,	! NUMBER OF DUPLICATED SUBLISTS
	LSLENGTH=0,0,36$;	! LONG STRING LENGTH IN WORDS

BIND
	LONGESTPLI=200,		! MAX NUMBER OF WORDS IN PLIT
	CHTLEX=0,		! CELL CONTAINS A LEXEME
	CHTPLIT=0,		! CELL IS A PLIT HEADER
	CHTDUP=1,		! CELL IS A DUPLICATION HEADER
	CHTLONGS=0;		! CELL IS A LONG STRING HEADER