Google
 

Trailing-Edge - PDP-10 Archives - DEC_CMS-20_V1.0_SRC - cms/sources/spells.bli
There are no other files named spells.bli in the archive.
module spells (	! Spellings for keywords, qualifiers, and syntactic constructs.
		ident = '1',
		%if
		    %bliss(bliss32)
		%then
		    language(bliss32),
		    addressing_mode(external=long_relative,
				    nonexternal=long_relative)
		%else
		    language(bliss36)
		%fi
		) =
begin

!
!			  COPYRIGHT (C) 1982 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:  CMS Library Processor
!
! Abstract:
!
!	This module declares a vector that relates the spellings of
!	keywords, qualifiers, and syntactic constructs to their integer
!	codes.  Routines for accessing this table are also declared.
!
! Environment:  Transportable
!
! Author:  Earl Van Horn	Creation Date:  April, 1979
!
! Modified By:
!
! 	, : Version
! 01	- 
!--
!
! Table of Contents:
!
forward routine
    codspl ;			! Return the spelling for a given code.

!
! Include Files:
!
%if %bliss(bliss32) %then
    library 'sys$library:starlet';
%else
    require 'jsys:';
%fi
library 'XPORT:' ;
require 'BLISSX:' ;
require 'COMUSR:' ;		! Declarations for the user of the STEP
				! command language processor.

!
! Macros:
!
! The following macro is used to build the SPLTAB table.
!
macro
    spltab_entries(a, b) [] =
	%if (a) leq (b)
	%then a , lit(spelling(a))
	%fi
	%if (a) lss (b)
	%then , spltab_entries((a) + 1, b)
	%fi
	% ;



!
! Equated Symbols:
!

!
! Own and PLIT Storage:
!
! The SPLTAB table is used for run-time translation between
! integer codes and spellings.  It is assumed that each call to SPLTAB_ENTRIES
! generates at least one entry.
!
bind
    spltab = uplit(
	spltab_entries(k_command_1, k_command_n),
	spltab_entries(k_sub_command_1, k_sub_command_n),
	spltab_entries(k_qualifier_1, k_qualifier_n),
	spltab_entries(k_syntactic_1, k_syntactic_n),
	0, k_null) : vector ;



!
! External References:
!
external routine
    bug ;			! Report a bug.
global routine codspl(key_code) =

!++
! Functional Description:
!
!	This routine returns the address of a descriptor for the spelling
!	of the command, sub-command, qualifier, or syntactic construct
!	denoted by the code supplied.
!
! Formal Parameters:
!
!	key_code:	The integer code whose spelling
!			is desired.
!
! Implicit Inputs:
!
!	The SPLTAB vector which is a UPLIT declared in this module.
!
! Implicit Outputs:
!
!	None
!
! Routine Value:
! Completion Codes:
!
!	The address of a descriptor of the desired spelling.
!
! Side Effects:
!
!	None
!
!--

    begin	! CODSPL
    local
	i ;			! Index into the SPLTAB vector.

    i = 0 ;
    while .spltab[.i] neq .key_code do
	begin	! Get next entry.
	if .spltab[.i] eql 0
	then
	    bug(lit('Key code not found in spelling table.')) ;
	i = .i + 2 ;
	end ;	! Get next entry.

    .spltab[.i + 1]
    end ;	! CODSPL
end				! Module SPELLS
eludom