Google
 

Trailing-Edge - PDP-10 Archives - bb-r775c-bm_tops20_ks_upd_3 - sources/ldefm.bli
There are 10 other files named ldefm.bli in the archive. Click here to see a list.
 %TITLE 'LDEFM - DEFINE MACRO line-mode command'
MODULE LDEFM (				! DEFINE MACRO line-mode command
		IDENT = '1-005'			! File: LDEFM.BLI Edit: JBS1005
		) =
BEGIN
!
!			  COPYRIGHT (c) 1981, 1985 BY
!	      DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
!		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.
!

!++
! FACILITY:	EDT -- The DEC Standard Editor
!
! ABSTRACT:
!
!	This module executes the line mode DEFINE MACRO command.
!
! ENVIRONMENT:	Runs at any access mode - AST reentrant
!
! AUTHOR: Bob Kushlis, CREATION DATE: February 3, 1978
!
! MODIFIED BY:
!
! 1-001	- Original.  DJS 30-JAN-1981.  This module was created by
!	extracting the routine EDT$$DEFM_CMD  from the module EXEC.BLI.
! 1-002	- Regularize headers.  JBS 19-Mar-1981
! 1-003 - Implement virtual memory deallocation ,and remove the separate
! 	  macro description block. Add a field to the TBCB whic will point
!	  to the buffer containing the next macro . TMV 6-Aug-81
! 1-004	- Use the new message codes.  JBS 06-Aug-1981
! 1-005	- Regularize format.  JBS 04-May-1982
!--

%SBTTL 'Declarations'
!
! TABLE OF CONTENTS:
!

REQUIRE 'EDTSRC:TRAROUNAM';

FORWARD ROUTINE
    EDT$$DEFM_CMD : NOVALUE;			! Process the DEFINE MACRO command

!
! INCLUDE FILES:
!

REQUIRE 'EDTSRC:EDTREQ';

!
! MACROS:
!
!	NONE
!
! EQUATED SYMBOLS:
!
!	NONE
!
! OWN STORAGE:
!
!	NONE
!
! EXTERNAL REFERENCES:
!
!	In the routine
%SBTTL 'EDT$$DEFM_CMD  - DEFINE MACRO line-mode command'

GLOBAL ROUTINE EDT$$DEFM_CMD 			! DEFINE MACRO line-mode command
    : NOVALUE =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Command processing routine for DEFINE MACRO.  A new text buffer
!	is created if it did not already exist, and it is added to the
!	list of macros.  Each macro is described by a control block
!	called a MAC_DESC which has a pointer to the TBCB for the macro
!	and the address of the next MAC_DESC.
!
! FORMAL PARAMETERS:
!
!	NONE
!
! IMPLICIT INPUTS:
!
!	EXE_CURCMD
!
! IMPLICIT OUTPUTS:
!
!	NONE
!
! ROUTINE VALUE:
!
!	NONE
!
! SIDE EFFECTS:
!
!	NONE
!
!--

    BEGIN

    EXTERNAL ROUTINE
	EDT$$FMT_MSG,
	EDT$$FND_BUF,
	EDT$$RD_CURLN;

    EXTERNAL
	BUF_LST : REF TBCB_BLOCK,
	CUR_BUF : REF TBCB_BLOCK,
	EXE_CURCMD : REF NODE_BLOCK;	! Pointer to the current command.

    MESSAGES ((INSMEM));

    LOCAL
	SAVE_TBCB,
	RANGE : REF NODE_BLOCK;

!+
! Save current TBCB so we can get back,
!-
    SAVE_TBCB = .CUR_BUF;
    RANGE = .EXE_CURCMD [RANGE1];
!+
! Find or create the buffer to be defined.
!-

    IF EDT$$FND_BUF (.RANGE [BUF_NAME], .RANGE [BUF_LEN])
    THEN
!+
! Designate the buffer as a macro.
!-
	CUR_BUF [TBCB_IS_MAC] = 1
    ELSE
!+
! Memory allocation failed.  Put out a message.
!-
	EDT$$FMT_MSG (EDT$_INSMEM);

!+
! Position back to the original text buffer.
!-
    CUR_BUF = .SAVE_TBCB;
    EDT$$RD_CURLN ();
    END;					! of routine EDT$$DEFM_CMD


END
ELUDOM