Google
 

Trailing-Edge - PDP-10 Archives - BB-W661B-BM_1984 - tools/txtunv.mac
There are no other files named txtunv.mac in the archive.
	UNIVERSAL	TXTUNV
;Macros to turn on and off listings with nesting and level control
;	LSTOF.			;TURNS OFF LISTINGS ONLY
;	LSTOF. XCREF		;TURNS OFF LISTINGS AND CREF
;	LSTON.			;RESTORES LISTINGS AND CREF AT TOP LEVEL
;IF LSTIN. IS DEFINED AS .MINFI THEN ALL LISTINGS ARE ON

REPEAT 0,<
	DEFINE LSTOF.(FOO),<
	LIST
>
	DEFINE LSTON.,<
	LIST
>
>	;END REPEAT

DEFINE	LSTOF.(FOO),<
	IFNDEF LSTIN.,LSTIN.==0		;;INITIALIZE LEVEL COUNTER
IFE LSTIN.,<
	IFIDN <XCREF><FOO>,<.XCREF>	;;CONDITIONALLY SUPPRESS CREF
		   XLIST>		;;TURN OFF LISTINGS
	LSTIN.==LSTIN.+1>		;;BUMP LIST LEVEL

DEFINE	LSTON.,<
	IFG LSTIN.,LSTIN.==LSTIN.-1	;;DECR LIST LEVEL
	IFLE LSTIN.,<.CREF		;;RESUME CREFS
		      LIST>>		;;RESUME LISTS

^LSUBTTL	Standard Constants

.INFIN==377777,,777777		;PLUS INFINITY
.MINFI==1B0			;MINUS INFINITY
LHMASK==777777B17		;LEFT HALF
RHMASK==777777			;RIGHT HALF
FWMASK==-1			;FULL WORD


; BYTE POINTER PARTS

	BP.POS==77B5			;POSITION (BITS TO THE RIGHT)
	BP.SIZ==77B11			;SIZE OF BYTE
	BP.ADR==Z -1			;ADDRESS PORTION
^LSUBTTL $TEXT - Interface to the T%TEXT routine

; The $TEXT macro is used to do all formatted ASCII output involving
;	strings and/or variables.  The macro takes two arguments.
;	The first argument is the address of a routine to call when T%TEXT
;	actually has a single right justified 7 bit ASCII character to output
;	from its arguments.  The specified routine will be called with the
;	character in S1 and should return TRUE or FALSE in S1.  A value of
;	FALSE will cause a STOP CODE to occur.
;	If the first argument is null, i.e. left blank, then a default
;	routine will be called, specified at initialization.
;	If the first argument is <-1,,ADDR>, it is a IDPB style byte pointer
;	for GLXTXT to store bytes into.

;	The second argument is a text string containing characters to output
;	and imbedded argument specifiers for substitutable parameters to be
;	merged with constant data.

;	If no specifier precedes a string in the second argument, it is
;	assumed to be straight string data to be passed to the output routine
;	directly.  On the other hand, substitutable parameters are described
;	by:	^<QUALIFIER>[OPT. SPACING]/<ADDRESS-OF-VARIABLE>[OPTIONAL <,MASK
>]/
;	Where the qualifier is one of the recognized single letter argument
;	types (See next page), and the address and optional mask are two
;	36 bit quantities, such as might be passed to LOAD/STORE. These
;	addresses can contain indexing and/or indirection ,may point to
;	the accumulators or the stack.

;	Each $TEXT instruction normally ends in a "free" carriage return
;	line feed sequence. That is, each $TEXT instruction produces one
;	line of output.  However, through use of the qualifiers 0,A,M,J,K and L,
;	output can be formatted to produce multiple lines via a single $TEXT
;	or one line via multiple $TEXTS. ^0 gives a null (0) terminator in place
 of CRLF.

; NOTE:	The $TEXT macro is a pseudo-instruction, and as such, it may be skipped
;	over to avoid its execution. Also, all accumulators are guaranteed
;	preserved .

;	Example:
;	   $TEXT(PUTCHR,<This is your PPN: ^P/MYPPN/ for today.>)
;		1. Prints (using the routine PUTCHR for output) the string,
;		    "This is your PPN: "
;		2. Prints the contents of location MYPPN as a TOPS-10 PPN.
;		3. Prints the string " for today."
;		4. Prints a <CRLF> to produce the end of the line.
;	Example:
;	   $TEXT(<-1,,LINBUF>,<File ^D/FB%STS(P1),FBS%FN/ is named ^F/@S1/^A>)
;		1. Prints the string "File ", depositing chars into the user buf
fer LINBUF
;		2. Prints the "loaded" contents of FB%STS(P1),FBS%FN as
;		    a decimal number
;		3. Prints the string " is named "
;		4. Prints the contents of the FD pointed to by AC S1 as
;		    a file specification.
;		5. Does not produce a <CRLF> sequence, since the ^A qualifier
;		    specifies that we supress it.
^L;	Optionally, any output field may be right or left justified or
;	centered.  The information used to do this appears between the
;	qualifier symbol and the slash which starts the address of the
;	field to be output.  The justification information consists of
;	three parts, two of which are optional.  The first piece of the
;	justification information is the width of the field. This is given
;	in Radix 10. and can be any number greater than zero.  The second
;	piece is a one letter code telling the Text processor which type
;	of justification to use. This can be "L" for left justification,
;	"R" for right justification or "C" for centering.  If this field
;	is omitted, the default is right justification for numeric items
;	(I.E. ^O and ^D), and left justification for all other types.
;	The third, optional, part is a single character which will be the
;	character used to do any padding necessary for the justification.
;	If the character is given, the justification code must be given also.
;	If the padding character is omitted, it defaults to blanks.

;	Example:
;	  $TEXT(PUTCHR,<^D10L*/S1/  ^F30/@FILSPC/  ^T40C/FOO(S2)>)
;		1. Prints the decimal number in S1, in a field of 10. characters
.
;		   The number will be left justified, the remainder of the
;		   field will be filled with the character "*".
;		2. After printing one space, the file specification pointed
;		   to by location FILSPC will be printed in a 30 character
;		   field.  The justification defaults to left justification,
;		   and the fill character is a space.
;		3. After printing another space, the ASCIZ string starting
;		   at location FOO(S2) will be printed in a 40 character
;		   field. The resulting output will be centered in the field
;		   and filled with blanks as necessary.
;
;	NOTE: If output overflows a field, then no justification is done.
;
^L; The actual $TEXT macro

DEFINE	$TEXT	(ADR,STRING) <
	CALL	T%TEXT##
	LSTOF.	XCREF
	JUMP	[XWD 2,0
		 EVL (ADR)
		 ITEXT(<STRING>)]	;;Parse the string
	LSTON.>

DEFINE	EVL (A,B,C) <
	IFIDN <B'C><>,<EXP <A>>
	IFDIF <B'C><>,<
	 IFE <A+1>,<<POINT 7,'C>>
	 IFN <A+1>,<
	   IFIDN <C><>,<EXP <A,B>>
	   IFDIF <C><>,<EXP <A,B,C>>
	>>>


DEFINE	ITEXT	(STRING) <
	LSTOF.	XCREF
	..TEXT<STRING>		;;EXPAND IT
	  EXP	0		;;TERMINATE WITH A ZERO WORD
	LSTON.
> ;;End DEFINE ITEXT


^L; Define legal qualifers for argument types
;
;  CHR	This is the character which will invoke the function
;	when seen in a text string

;  TYPE	This is the type used in the $TQ macro to invoke the
;	function

;  ARGS	This field identifies which arguments are valid for
;	the function.  The following values may be specified:

;	0	Function accepts no arguments
;	1	Function accepts only address and field mask
;	2	Function accepts all arguments

;  PROC	This is the name of the macro processor which will be called
;	when the qualifier is encountered.


; Remember to add new qualifiers to the end, in order to keep older
; programs working.

	DEFINE TQUALS,<
	LSTOF.
	TQ(T,2,ASCIZ)			;;ASCIZ STRING
	TQ(O,2,OCTAL)			;;UNSIGNED OCTAL NUMBER
	TQ(D,2,DECIMAL)			;;DECIMAL NUMBER
	TQ(F,2,FILE)			;;FILE SPECIFICATION
	TQ(7,2,CSEVEN)			;;ONE RIGHT JUSTIFIED 7 BIT CHARACTER
	TQ(6,2,CSIXBIT)			;;ONE RIGHT JUSTIFIED 6 BIT, CHARACTER
	TQ(W,2,SIXBIT)			;;SIXBIT WORD
	TQ(5,2,SVNBIT)			;;ASCIZ, ONLY 1 WORD
	TQ(P,2,USER)			;;PPN OR DIRECTORY NUMBER
	TQ(U,2,DIRECTORY)			;;PPN OR USER NUMBER
	TQ(H,2,DAYTIME)			;;UDT TO BE TYPED AS DD-MON-YY HH:MM:SS
	TQ(C,2,TIME)			;;TIME FROM UDT TO BE TYPED AS HH:MM:SS
	TQ(E,2,ERROR)			;;TYPE OUT STRING FOR ERxxx$ ERROR CODE
	TQ(I,1,INDIRECT)		;;POINTER TO ITEXT (INDIRECT  TEXT) BLOC
K
	TQ(M,0,CR,..TXC0(\".CHCRT))	;;TYPE ^M (CARRIAGE RETURN)
	TQ(J,0,LF,..TXC0(\".CHLFD))	;;TYPE ^J (LINE-FEED)
	TQ(L,0,FF,..TXC0(\".CHFFD))	;;TYPE ^L (FORM FEED)
	TQ(K,0,VT,..TXC0(\".CHVTB))	;;TYPE ^K (VERTICAL TAB)
	TQ(A,0,NOCRLF,..TXA(.TQCHA))	;;(APPEND) SUPPRRESS FREE CRLF
	TQ(0,0,NULL,..TXA(.TQCH0))	;;NUL CHAR INSTEAD OF CR-LF AT END
	TQ(3,0,STRING,..TXER(IQU))	;;INTERNAL STRING
	TQ(V,2,VERSION)			;;PROGRAM VERSION NUMBER
	TQ(2,0,CARET,..TXER(IQU))	;;INTERNAL UP-ARROR
	TQ(Q,2,POINTER)			;;BYTE POINTER TO ASCIZ STRING
	TQ(B,2,ROB)			;;OBJECT BLOCK
	TQ(1,2,OBJECT)			;;OBJECT TYPE
	TQ(N,2,NODE)			;;TYPE A NODE NAME/NUMBER
	TQ(R,2,JIB)			;;TYPE OUT JOB INFO BLOCK (JIB)
	LSTON.
> ;END OF TQUALS DEFINITION

^L;DEFINE TWO SYMBOLS OF THE FORM .TQxxx AND .TQCHx WHICH
;IDENTIFY THE VALID QUALIFIERS AND THE ARGUMENTS WHICH ARE
;VALID FOR EACH.  THE RIGHT HALF OF THE SYMBOL IS THE QUALIFIER
;INDEX AND THE LEFT HALF WILL CONTAIN A 0,1 OR 2 TO INDICATE WHICH
;ARGUMENTS ARE ALLOWED.



DEFINE	TQ(CHR,ARGS,TYP,PROC) <

  IFNB	<CHR>,<.TQCH'CHR==^D<ARGS>B17+ZZ>
  IFNB 	<PROC>,<DEFINE ..TQM'CHR<PROC>>
  IFNB	<TYP>,<.TQ'TYP==^D<ARGS>B17+ZZ>
	 ZZ==ZZ+1>

	ZZ==1			;FIRST QUALIFIER IS 1
	TQUALS			;DEFINE THE CODES

^L;DEFINE THE FIELDS IN THE TEXT ARGUMENT BLOCK USED FOR EACH ARG

	.TXTFL==0			;TEXT ARGUMENT FLAG WORD
	  TXT.NA==1B0			;FUNCTION HAS NO ARGUMENTS
	  TXT.FN==77B8			;TEXT FUNCTION CODE
	  TXT.AD==1B9			;ADDRESS WORD IS PRESENT
	  TXT.IM==1B10			;ADDRESS IS THE ARGUMENT (RESERVED)
	  TXT.JU==3B12			;ARGUMENT JUSTIFICATION CODE
	    .TXTJL==1			;JUSTIFY LEFT
	    .TXTJR==2			;JUSTIFY RIGHT
	    .TXTJC==3			;JUSTIFY CENTER
	  TXT.WD==377B23		;WIDTH OF FIELD
	  TXT.FC==377B35		;FILL CHARACTER

	.TXTAD==1			;TEXT ARGUMENT ADDRESS WORD
	  TXT.PT==7777B11		;POINTER PORTION OF ADDRESS
	  TXT.XA==1B12			;EXTENDED ADDRESS (RESERVED)
	  TXT.EA==37777777B35		;ADDRESS PORTION

;OBSOLETE DEFINITIONS FOR FLAG WORD

	  TXT.P==1B1			;POINTER WORD IS PRESENT (OBSOLETE)
	  TXT.S==1B2			;SPACING WORD IS PRESENT (OBSOLETE)
	  TXT.M==77B8			;MASK TO QUALIFIER PART

;OBSOLETE DEFINITIONS FOR OPTIONAL SPACING WORD

	  TXT.SC==177B6			;MASK TO GET CHARACTER FOR SPACING
	  TXT.SS==3B17			;MASK TO GET SIDE FOR SPACING
	    TXT.SL==1			;CODE TO SPACE LEFT
	    TXT.SR==2			;CODE TO SPACE RIGHT
	    TXT.SM==3			;CODE TO SPACE MIDDLE (CENTER)
	  TXT.SP==777777		;MASK TO GET POSITIONS FOR SPACING
^LSUBTTL	$TQ MACRO DEFINITION

;THE $TQ MACRO ALLOWS TEXT ARGUMENT BLOCKS TO BE BUILD WITHOUT
;REQUIRING CHARACTER BY CHARACTER PARSING OF THE TEXT STRING

DEFINE	$TQ(TYP,ADR,WID,JUS,FIL) <

  ..TXA(.TQ'TYP,WID,JUS,FIL,ADR)	;;CALL THE WORK MACRO
      IFN ..TXEF,<			;;REPORT ANY ERRORS
	..TERR<$TQ(TYP,ADR,WID,JUS,FIL)>>

> ;END OF $TQ DEFINITION


;THE ..TXA MACRO BUILDS A STANDARD ITEXT ARGUMENT BLOCK AND
;ESTABLISHES THE DEFAULT JUSTIFICATION AND FILL IF NONE WAS
;SPECIFIED.  THIS MACRO IS CALLED BY THE $TQ MACRO AND BY THE
;TEXT PARSING MACROS WHEN AN ARGUMENT HAS BEEN ASSEMBLED

DEFINE	..TXA(TYP,WID,JUS,FIL,ADR,STR) <

	..TXEF==0			;;CLEAR THE ERROR FLAGS

IFNDEF TYP,<..TXER(UQU)>		;;QUALIFIER MUST BE DEFINED
IFDIF <WID><>,<IRPC WID,<.IFN <WID>,NUMERIC,..TXER(IWA)>>
IFNB <JUS>,<IFNDEF .TXTJ'JUS,<..TXER(IJA)>>
IFDEF  TYP,<
  IFE <TYP_-^D18>,<IFDIF <ADR'STR'WID'JUS'FIL><>,<..TXER(ANA)>>
  IFE <1-<TYP_-^D18>>,<IFDIF <WID'JUS'FIL><>,<..TXER(JNA)>>
  IFE <2-<TYP_-^D18>>,<IFIDN <ADR'STR><>,<..TXER(ADS)>>>

      IFE ..TXEF,<
	IFIDN <WID><>,<..TXWD==<..TXJU==<..TXFC==0>>>
	IFDIF <WID><>,<
	  IFE <^D<WID>>,<..TXWD==<..TXJU==<..TXFC==0>>>
	  IFN <^D<WID>>,<..TXWD==^D<WID>
	    IFNB <JUS>,<..TXJU==.TXTJ'JUS>
	    IFB  <JUS>,<..TXJU==.TXTJL
	      IFE <TYP-.TQOCT>,<..TXJU==.TXTJR>
	      IFE <TYP-.TQDEC>,<..TXJU==.TXTJR>>
	    IFB  <FIL>,<..TXFC==" ">
	    IFNB <FIL>,<..TXFC=="FIL">>>

	IFB  <ADR'STR>,<..TXPT==0>
	IFNB <ADR'STR>,<..TXPT==1>
	IFE <..TXWD+..TXPT>,<
	    EXP FLD(TYP,TXT.FN)>
	IFN <..TXWD+..TXPT>,<
	    EXP FLD(TYP,TXT.FN)+FLD(..TXJU,TXT.JU)+FLD(..TXWD,TXT.WD)+FLD(..TXFC
,TXT.FC)+TXT.AD
	    PNTR(ADR,STR)>>

> ;END OF ..TXA MACRO DEFINITION
^L;THE PNTR MACRO ACCEPTS A STRUCTURE OR ADDRESS MASK DEFINITION
;AND CREATES A BYTE POINTER TO THEARGUMENT.
;IF THE ARGUMENT IS A FULLWORD, THE POINTER POSITION IS 0.

DEFINE	PNTR(Y,STR) <
	 IFB  <STR>,<..STR0(..PNT,,<FWMASK>,Y)>
	 IFNB <STR>,<..STR0(..PNT,,<STR>,Y)>>

   DEFINE ..PNT(AC,LOC,MSK)<
	..PST==MSK-FWMASK
	.IF0 ..PST,<
		POINT 0,LOC,35>,<
		POINTR (LOC,MSK)>>
^LSUBTTL	Error processing and messages

DEFINE	$TX$ERR,<
	LSTOF.
	X(UQU,Unknown qualifier)
	X(IQU,Invalid qualifier)
	X(IJA,Invalid justification argument)
	X(IWA,Invalid width argument)
	X(PEA,Premature end of argument)
	X(JNA,Justification is not allowed)
	X(ANA,Arguments are not allowed)
	X(ADS,Address must be specified)
	LSTON.
> ;End of $TX$ERR definition

;Assign a bit symbol for each error

DEFINE	X(NAM,STRING) <
	..X'NAM==1B<ZZ>
	 ZZ==ZZ+1>

	 ZZ==0
	$TX$ERR		;;EQUATE THE SYMBOLS

;DEFINE A MACRO TO DISPLAY THE COMPILE TIME DIAGNOSTIC FOR ERRORS

DEFINE ..TERR(TEXT) <
  IF1,<
    PRINTX ? Error in "TEXT"
    DEFINE X(NAM,ERR) <IFN ..X'NAM&..TXEF,<PRINTX ? ERR>>
    $TX$ERR>
> ;End ..TERR definition

;HERE WHEN AN ERROR IS DETECTED.  THIS ROUTINE REMEMBERS THE
;ERROR IN THE ERROR REGISTER ..TXF AND CAUSES RETURN TO TOP
;THE TOP LEVEL PARSING ROUTINES.

  DEFINE ..TXER(E) <
    ..TXEF==..TXEF!..X'E		;;SET THE ERROR FLAG
    ..TXF==0				;;BACK TO TOP LEVEL
    ..TXB=="^">				;;ESTABLISH BREAK

^LSUBTTL	..TEXT PARSING MACRO DEFINITION

DEFINE ..TEXT (C) <

    ..TXF==0				;;SET TOP PROCESSING LEVEL
    ..TXB==0				;;CLEAR THE BREAK CHARACTER
    ..TXP==0				;;CLEAR TEXT PROCESSING FLAG
    ..TXEG==<..TXEF==0>			;;CLEAR ERROR REGISTERS
    IRPC C,<				;;PARSE THE STRING
	..TXC==ASCII\C\_-35		;;GET CHARACTER VALUE
	IFN ..TXB,<IFN ..TXB-..TXC,..CNS(<C>)
		   IFE ..TXB-..TXC,..TXB==0>
	IFE ..TXB,<..TXQ(<C>,\..TXF)>>	;;CALL PROPER PROCESSOR
    ..TXC1				;;TERMINATE TEXT IF ANY
    IFN ..TXB,<IFN <..TXB-"^">,<..TXER(PEA)>>
    ..TXEF==..TXEF!..TXEG		;;GET ANY ERRORS
    IFN ..TXEF,<..TERR<C>>
> ;END OF ..TEXT


;;HERE WHEN BREAK CHARACTER IS NOT SET TO DISPATCH TO
;APPROPRIATE PROCESSOR

DEFINE ..TXQ(C,P) <..TXQ'P(<C>)>


;HERE FOR THE VERY FIRST CHARACTER AND FOR EACH CHARACTER
;FOLLOWING THE COLLECTION OF A VALID ARGUMENT

DEFINE ..TXQ0(C) <

    IFN ..TXC-"^",<..TXC0(<C>)>		;;STORE AND INIT TEXT
    IFE ..TXC-"^",<..TXF==1>>		;;UNLESS WE HAVE "^"


;;HERE TO PROCESS THE QUALIFIER

;;MAKE SURE WE HAVE A VALID QUALIFER AND DO SPECIAL CASE
;;CHECK TO ALLOW A QUOTED "^".
;;SETS THE NEXT FUNCTION TO PROCESS WIDTH IF QUALIFIER
;;ACCEPTS ANY ARGUMENTS ELSE FORCES RETURN TO TOP LEVEL.

DEFINE ..TXQ1(C) <

    IFE ..TXC-"^",<..TXC0(<C>)>	;;STORE IF SPECIAL CHARACTER
    IFN ..TXF,<			;;ELSE
	..TXF==0		;;ASSUME TOP LEVEL
	IFDEF .TQCH'C,<		;;IF QUALIFIER IS VALID
	    IFDEF ..TQM'C,..TQM'C ;;EXECUTE MACRO IF DEFINED
	    IFN <.TQCH'C_-^D18>,<..TXF==2>>>
    IFE ..TXF-2,<..TXC1(<C>)	;;CLOSE CURRENT TEXT STRING
	..ICNS			;;CLEAR ACCUMULATED TEXT
	..CNS<..TXA(.TQCH'C,>>	;;SET STRING TO CALL ..TXA MACRO
    ..TXEG==..TXEG!..TXEF>	;;REMEMBER ANY ERRORS

^L;HERE TO PROCESS WIDTH

;THIS MACRO APPENDS ALL NUMERIC CHARACTERS TO THE STRING WHICH
;IS BEING ACCUMULATED.  WHEN THE FIRST NON NUMERIC IS ENCOUNTERED
;THE JUSTIFICATION PROCESSOR IS CALLED.

DEFINE ..TXQ2(C) <
    ..TXF==3				;;ASSUME JUSTIFICATION
    IFGE ..TXC-"0",IFLE ..TXC-"9",<..TXF==2>;;UNLESS ARGUMENT IS NUMERIC
    IFE ..TXF-2,<..CNS(C)>		;;APPEND NUMERIC ARGUMENT
    IFE ..TXF-3,<..CNS<,>		;;ELSE CLOSE WIDTH
		 ..TXQ3(C)>>		;;AND PROCESS JUSTIFICATION


;HERE TO PROCESS JUSTIFICATION

;STORE JUSTIFICATION ARGUMENT AND SETUP TO PROCESS FILL CHARACTER
;OR PROCESS FIRST ADDRESS DELIMITER

DEFINE	..TXQ3(C) <
    ..TXF==4				;;ASSUME NEXT ARG IS FILL
    IFE ..TXC-"/",<..TXF==5>		;;UNLESS FIRST SLASH
    IFE ..TXC-"[",<..TXF==5>		;;OR ADDRESS DELIMITER
    IFE ..TXF-4,<..CNS<C,>>		;;STORE JUSTIFICATION ARG
    IFE ..TXF-5,<..CNS<,,>		;;OR CLOSE JUSTIF AND FILL
		 ..TXQ5(C)>>		;;AND PROCESS DELIMITER


;HERE TO PROCESS FILL CHARACTER

;IF CHARACTER IS NOT ADDRESS DELIMITER WE STORE IT AS THE FILL
;CHARACTER AND SETUP TO PROCESS A SLASH.  IF THE ARGUMENT IS
;A DELIMITER WE CLOSE THE FILL CHARACTER ARGUMENT AND PROCESS
;IT.

DEFINE ..TXQ4(C) <
    ..TXF==4				;;ASSUME WE HAVE FILL CHARACTER
    IFE ..TXC-"/",..TXF==5		;;UNLESS IT IS ADDRESS
    IFE ..TXC-"[",..TXF==5		;;DELIMITER
    IFE ..TXF-5,<..CNS<,>		;;ELSE CLOSE FILL ARGUMENT
		 ..TXQ5<C>>		;;AND PROCESS DELIMITER
    IFE ..TXF-4,<..CNS<C,>		;;STORE FILL CHARACTER
		 ..TXF==5>>		;;SET TO PROCESS DELIMITER


^L;HERE TO PROCESS FIRST ADDRESS DELIMITER

;HERE WE SET OUR NEXT FUNCTION TO PROCESS FINAL DELIMITER

DEFINE ..TXQ5(C) <
    ..TXF==6				;;SET NEXT FUNCTION
    IFE ..TXC-"/",..TXB=="/"		;;SET FINAL BREAK CHARACTER
    IFE ..TXC-"[",..TXB=="]"
    IFE ..TXB-"]",..CNS<[>		;;STORE START OF LITERAL
    IFE ..TXB,..TXF==5>			;;IGNORE ANY JUNK


;HERE TO PROCSS FINAL DELIMITER AND BUILD AN ARGUMENT BLOCK

DEFINE ..TXQ6(C) <
    ..TXF==0			;;BACK TO TOP LEVEL
    IFE ..TXC-"]",..CNS<]>	;;STORE END OF LITERAL
    ..CNS<)>			;;TERMINATE ARGUMENT LIST
    ..GCNS			;;DO THE ..TXA MACRO
    ..TXEG==..TXEG!..TXEF>	;;REMEMBER ANY ERRORS


SUBTTL	ASCII TEXT STRING STORAGE MACRO DEFINITIONS

;HERE TO STORE A CHARACTER IN AN ASCII STRING.  A CHECK IS MADE
;TO ENSURE THAT WE ARE PROCESSING ASCII TEXT.

DEFINE ..TXC0(C) <
    IFE ..TXP,<			;;INITIALIZE TEXT PARSING
	..ICNS			;;CLEAR ACCUMULATED STRING
	..CNS<ASCIZ\>		;;START ASCIZ LITERAL
	..TXP==1>		;;REMEMBER WE ARE DOING TEXT
    ..CNS<C>			;;APPEND THE CHARACTER
    ..TXF==0			;;BACK TO TOP LEVEL
    ..TXB=="^">			;;SET TOP LEVEL BREAK


;HERE TO TERMINATE TEXT PROCESSING AND BUILD TEXT ARGUMENT

DEFINE ..TXC1(C) <

    IFN ..TXP,<			;;IGNORE IF NOT DOING TEXT
	..CNS<\>		;;CLOSE ASCIZ LITERAL
	EXP <FLD(.TQCHT,TXT.FN)+[..GCNS]>>;;BUILD THE ARGUMENT
    ..TXP==0>			;;CLEAR TEXT PROCESSING FLAG

	END