Google
 

Trailing-Edge - PDP-10 Archives - AP-D471B-SB_1978 - mcsrep.bli
There are no other files named mcsrep.bli in the archive.
!***COPYRIGHT (C) 1974, 1975, 1976, 1977 DIGITAL EQUIPMENT CORP., MAYNARD, MASS.***
%%
%
	THIS IS THE MAIN MODULE FOR THE MCS JOURNAL TAPE
	REPORT GENERATOR. IT HAS BUT THREE FUNCTIONS:

		1) INITIALIZES EVERYTHING THAT MUST BE INITIALIZED.
		2) ENTERS A COMMAND LOOP THAT
			A) LOOKS FOR A COMMAND FROM THE TTY, AND
			B) CALLS THE APPROPRIATE COMMAND MODULE.
		3) SPECIAL CASES THE "EXIT" COMMAND AND PERFORMS
		   ANY CLEANUP ACTIONS NECESSARY SUCH AS
		   DELETING TEMPORARY FILES, CLOSING PERMENANT
		   FILES, ECT. BEFORE RETURN TO THE MONITOR.


	LAST MODIFIED ON 20 AUG 74 BY JG.
%
%%

MODULE MCSREP (STACK,MLIST,FSAVE,TIMER=EXTERNAL(SIX12)) =
BEGIN
	LOCAL COMMAND,INDEX;
	LABEL COMMANDLOOP,ERROR;
	REQUIRE COMMON.BLI;
	REQUIRE ENTRY.BLI;
! DEFINE CALL TRANSFER VECTOR FOR COMMAND MODULES.
NOTE THAT TRANSFERVECTOR MUST AGREE IN ORDER WITH THE DEFINED KEYWORD NUMBERS AND THE GLOBAL PLIT WEYWRD.

	EXTERNAL
		GO,
		MPPS,
		SORT,
		CODES,
		DATES,
		INPUT,
		PRINT,
		TALLY,
		TIMES,
		OUTPUT,
		REPORT,
		CLASES,
		SORCES,
		SEQNCE,
		DESTIN;

	BIND	TRANSFERVECTOR = PLIT(
		  0, %BY%
		GO,
		  0, %ALL%
		  0, %AND%
		  0, %BOTH%
		  0, %EXIT IS SPECIAL CASED%
		MPPS,
		SORT,
		  0, %AFTER%
		CODES,
		DATES,
		INPUT,
		PRINT,
		TALLY,
		  0, %TEXTS%
		TIMES,
		  0, %BEFORE%
		OUTPUT,
		REPORT,
		  0, %BETWEEN%
		CLASES,
		SORCES,
		SEQNCE,
		DESTIN);

	MAP VARYINGCHAR COMMAND;
%%%%%%%%%%% EXECUTION BEGINS HERE %%%%%%%%%%%

	! INITIALIZE GLOBAL VARIABLES AND I/O.

	INIT(CLEAR);				! INITIALIZE THINGS AND DO RESET UUO;
	TTYOTC("*");				! PRINT FIRST PROMPT CHARACTER


	! NOW LOOP, READING COMMANDS, AND CALL COMMAND MODULES.

	IF ALLOC(0) NEQ NULL THEN		! GET FIRST ALLOCATION AREA
COMMANDLOOP:
	REPEAT BEGIN
		COMMAND _ TTYINT();		! GET COMMAND FROM TTY
		IF KEYCHK(.COMMAND,INDEX)	! IS IT REALLY A COMMAND?
		THEN IF .INDEX EQL XEXIT	! YES, CHECK IF EXIT
			THEN LEAVE COMMANDLOOP	! ALL DONE
			ELSE (.TRANSFERVECTOR[.INDEX-1])()  ! CALL THE RIGHT COMMAND MODULE
		ELSE  ERROR: BEGIN		! NO, NOT A COMMAND
			IF .COMMAND[LANGTH] EQL -1 THEN LEAVE ERROR;! IGNORE PUNCTUATION
			IF .INDEX IS -1		! AMBIGUOUS COMMAND
			THEN BEGIN
				TTYOVR(.COMMAND);
				ERTEXT(39);
				LEAVE ERROR
			END;
			ERTEXT(1);		! COMMAND NOT RECOGNIZED
			TTYOTN(ABS(.COMMAND[LANGTH]),COMMAND[STRING]);
			IF SEMI() THEN ERTEXT(4) ! SCAN FOR ";"
		END
	END;


	! PERFORM CLEANUP FUNCTIONS HERE.

	TTYCLR();				! CLEAR TTY INPUT BUFFER

%%%%%%%%%%% EXECUTION ENDS HERE %%%%%%%%%%%

END ELUDOM; ! END OF MAIN MODULE OF MCS REPORT GENERATOR...