Google
 

Trailing-Edge - PDP-10 Archives - bb-4157j-bm_fortran20_v11_16mt9 - fortran-compiler/lexaid.bli
There are 12 other files named lexaid.bli in the archive. Click here to see a list.
!COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1974, 1987
!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.

!AUTHOR: D. B. TOLMAN/PLB/TFV/AlB/CDM/MEM

! LEXAID.BLI   

GLOBAL BIND LEXAIV = #11^24 + 0^18 + #4530;  ! Version Date: 17-Feb-86

%(

***** Begin Revision History *****

***** Begin Version 7 *****

1563	PLB	18-Jun-82
	Change OUTTYx macros for TOPS-20 native execution,
	and REQUIRE FTTENX.


***** Begin Version 10 *****

2265	TFV	12-Jan-84
	Increase POOLSIZE to 6000 words so we can compile programs  with
	large blocks of  comment lines.  The  standard allows  unlimited
	numbers of comment lines between initial and continuation lines.

2474	TFV	21-Sep-84,	AlB	30-Oct-84
	Fix continuation processing to handle unlimited numbers of blank
	and comment  lines between  continuation lines.   The lines  are
	recorded in a linked  list of four  word entries, defined  here.
	If there are too many blank  and comment lines, the buffer  will
	get an overflow.   When this  happens, the  buffer is  compacted
	using the information in the linked list.  The info is also used
	to speed up continuation processing in the lexeme scan.  Also
	decrease POOLSIZE to 1000 so it can handle 5000 characters.

2477	AlB	13-nov-84
	Change poolsize to 2000 words.

2500	AlB	14-Nov-84
	Change the list of entries for source lines from a linked list
	in dynamic memory to a fixed-length list in static memory.

2501	AlB	20-Nov-84
	Special handling of errors found in comment lines.  Since these
	errors can be detected while scanning unprinted comment lines, they
	cannot go through the normal error queueing process.

***** End V10 Development *****

***** End Revision History *****

***** Begin Version 11 *****

4527	CDM	1-Jan-86
	VMS Long symbols phase II.  Convert all internal symbols from
	one word of Sixbit to [length,,pointer].  The lengths will be one
	(word) until a later edit, which will store and use long symbols.

4530	MEM	17-Feb-86
	Add long symbol support: Add UNDRLIN "_".

ENDV11
)%

REQUIRE 'FTTENX.REQ';		![1563] NEEDED FOR OUTTYx MACROS

! MACROS WHICH DEFINE THE RELATIONAL LEXEME CODES  

MACRO
	REL(N) = RELATIONLOP^18+N$,
	DOTNE = REL(6)$,
	DOTEQ = REL(2)$,
	DOTGT = REL(7)$,
	DOTLT = REL(1)$,
	DOTGE = REL(5)$,
	DOTLE = REL(3)$;

! THIS FILE CONTAINS THE BINDS FOR THE CHARACTER CASSIFICATION
! CODES AND THEIR NAMES, USED BY ROUTINE LEXICAL.  NOTE THAT THE
! CODE NAMES AND LEXEME NAMES HAVE BEEN OVERLAYED AS MUCH AS
! POSSIBLE SO AS TO MAINTAIN A MINIMUM OF CONFUSION.

!
! --------------------------------------------------
! CHARACTER CODE CLASSIFICATIONS, USED BY ROUTINE LEXICAL
! THE "SMALL" STATES USE ONLY THE FIRST 11 CODES.
! THE "BIG" STATES USE THE ENTIRE 32 CODES.
!
! CHARACTER CODES 11 THROUGH 21 ARE THE SAME NAME AND ASSOCIATED 
! NUMBER AS THE LEXEME NAMES.
!
! --------------------------------------------------
BIND

	ILL	= 1,	% ILLEGAL CHARACTER%
	TAB	= 2,
	LT	= 3,	% <CR>, <LF>, <VT>, AND <FF> %
	BLANK	= 4,
	SPEC	= 5,	% FORTRAN-10 RECOGNIZED SPECIAL CHARACTERS%
	DIGIT	= 6,	% 0,1,...,9 %
	UPPER	= 7,	% UPPER CASE ALPHABETIC %
	LOWER	= 8,	% LOWER CASE ALPHABETIC %
	FOS	= 9,	% END OF FILE OR END OF STATEMENT %
	EOB	= 10,	% POSSIBLE END OF INTERNAL STATEMENT BUFFER OR END OF FILE
				CONTROL-Z AND DELETE (177) ARE CLASSIFIED AS THIS
				CNTROL-Z AND INPUT FROM TTY: IMPILES EOF
				A FULL WORD OF 1'S IMPLIES END OF INTERNAL STATEMENT BUFFER %
	REMARK	= 11,	% ! %

	LASTSMALCODE= REMARK  ,	% LAST SMALL STATE CHARACTER CODE %

% THE FOLLOWING 11 ARE IDENTICAL TO THE LEXEME NAMES 

	ANDSGN	= 12,
	LPAREN	= 13,
	RPAREN	= 14,
	COLON	= 15,
	COMMA	= 16,
	DOLLAR	= 17,
	MINUS	= 18,
	SLASH	= 19,
	PLUS	= 20,
	ASTERISK	= 21,
	EQUAL	= 22,
%
	LTSGN	= 23,	% < %
	GTSGN	= 24,	% > %
	NEQSGN	= 25,	% # %
	DOT	= 26,	% . %
	SEMICOL	= 27,	% ; %
	LITSGN	= 28,	% ' %
	OCTSGN	= 29,	% " %
	COMNTSGN= 30,	% UPPER AND LOWER CASE C %
	DEBUGSGN= 31,	% UPPER AND LOWER CASE D %
	UPAROW	= 32,	% ^ %
%4530%	UNDRLIN = 33,	% _ %

%4530%	LASTBIGCODE	= UNDRLIN  ;	% LAST BIG STATE CHARACTER CODE %

! SOME BINDS ONTO THE END OF THE CHARACTER SET

BIND	EOF	=	#200 ,	! END OF FILE ON INPUT
	OVRFLO	=	#201 ,	! INTERNAL STATEMENT BUFFER OVERFOW
	EOS	=	#202 ;	! END OF STATEMENT INDICATOR

EXTERNAL	ENDOFILE;! END OF FILE INDICATOR RETURNED BY LEXICAL

! END OF INTERNAL STATEMENT BUFFER INDICATOR.  A WORD
! THAT EQUALS THIS IN THE INTERNAL STATEMENT BUFFER INDICATES
! THAT THIS IS THE END.
BIND
	ENDBUFLAG	=	#777777777776  ;

MACRO  LEFT =  18,18  $,
	ADRS = 0,0  $,
       RIGHT  =  0,18  $,
%2474%	FULL = 0,36$;

EXTERNAL POOL;		! INTERNAL STATEMENT BUFFER
EXTERNAL CURPTR ;	! POINTER TO CURRENT CHARACTER IN POOL

	! The POOL is 10000 characters to allow for  LSN's and nulls  in
	! the  buffer.   The  standard  permits  lines  of  up  to  1320
	! characters of code.

%2477%	BIND	POOLSIZE = 2000; ! **** Same definition as in GLOBAL.BLI ****

BIND POOLEND  = POOL[POOLSIZE-1]<0,0>;

MACRO CURWORD  =  .CURPTR<RIGHT>  $;

EXTERNAL  CURPOOLEND  ;
BIND POOLBEGIN  =  POOL[0]<0,0>  ;

EXTERNAL  EOPSAVE ;
BIND  SAVESIZE  =  EOPSAVE<LEFT>  ,
      SAVESTART =  EOPSAVE<RIGHT> ;

MACRO	FIRSTCHAR = 29,7  $;
MACRO	LASTCHAR	= 1,7 $;

BIND	LF	=	#12,
	VT	=	#13,
	FF	=	#14,
	CR	=	#15;


! LINE PROCESSING GLOBALS

EXTERNAL
	LINELINE,	! CURRENT LINE NUMBER
	LASTLINE,	! LAST LINE NUMBER
	CHARPOS,	! CHARACTER POS ON PRINT LINE
	ISN,		! STATEMENT LINE NUMBER
	STPTR,		! CHARACTER POINTER TO BEGINNING-1 OF STATEMENT
	STLPTR,		! CHARACTER POINTER TO BEGINNING-1 OF LINE CONTAINING CURRENT STATEMENT
	STPOS,		! CHARACTER POS ON LINE OF BEGINNING OF STATEMENT
			! WILL BE 72 IF BEGINNING OF LINE
	ERRFLAG,	! IF 1 INDICATES THAT THERE HAVE ALREADY BEEN
			! ERRORS IN THIS STATEMENT
	LINEPTR,	! CHARACTER POINTER TO BEGINNING CHARACTER-1 OF LINE
	SEQLAST,	! IF 1 INDICATES THAT THE LINE BEGINNING THIS PROGRAM
			! UNIT HAS A LINE SEQUENCE NUMBER IN LINELINE
	CLASPTR,	! CHARACTER POINTER FOR CLASSIFICATION BACKUP
	CLASLPT,	! BEGINNING OF LINE POINTER FOR CLASSIFICATION BACKUP
%2500%	CLASLCUR,	! Source list entry for classification backup
	CONTPTR,	! CHARACTER POINTER FOR CONTINUATION BACKUP
%2474%	CONTLCUR,	! Source list entry for continuation backup
	NOCR,		! IF 1 INDICATES THAT THIS LINE WAS MISSING A <CR>
	LEXLINE,	! LINE NUMBER ASSOCIATED WITH THE CURRENT LEXEME
			! USED FOR ERROR REPORTING
	LINENO,		! AREA FOR BUILDING LINE NUMBER
	PAGELINE,	! CURRENT LINE ON PAGE
%2500%	LINLLIST,	! Start of list of source line entries
%2500%	LINLEND,	! End of list of source line entries
%2474%	FCHARPOS,	! CHARPOS for first entry in pool source list
%2474%	LASTCODELINE,	! Pointer to last pool source entry containing code
%2474%	LINLCURR,	! Current entry in source list
%2474%	LINLLAST,	! Pointer to last non-deleted entry in source list
%2474%	LINLPREV,	! Pointer to latest non-comment entry in source list
%2474%	NOLTLINE;	! Flag for last line in pool has no line terminator

	BIND LINESPERPAGE = 59;

BIND ALLCHAR = 0,  LINESONLY  = 1;	! PARAMETERS TO BACKTYPE

MACRO  INTERR (STRNG ) =
BEGIN
	EXTERNAL FATLERR,E61;

	FATLERR ( PLIT ( STRNG ), .ISN , E61<0,0> )
END $;

MACRO PFLD = 30,6 $,  SFLD = 24,6 $;



	MACRO
ISCAN ( REG,PTR ) =
	BEGIN
		MACHOP ILDB = #134;
		ILDB ( REG,PTR )
	END
$;
	MACRO
NSCAN ( REG,PTR ) =
	BEGIN
		MACHOP LDB = #135;
		LDB ( REG,PTR )
	END
$;

%2474%	! Macros to access fields source list of lines in the POOL.
%2474%	! 
%2474%	!	--------------------------------------------
%2501%	!	|   LINENUM         |   LFLAGS  | ERRCOMNT |
%2474%	!	--------------------------------------------
%2474%	! 	|	        FIRSTBP			   |
%2474%	!	--------------------------------------------
%2474%	!	|	        LASTBP	 		   |
%2474%	!	--------------------------------------------

BIND
%2500%	LINLSENT = 3;				! Length of each entry
%2500%						! **** Also defined in GLOBAL

MACRO
%2501%	LINENUM(X) = (.(X))<LEFT>$,		! Line number for source line
%2501%	LFLAGERR(X) = (.(X))<RIGHT>$,		! Flags and error code
%2501%	HASCODE(X) = (.(X))<16,1>$,		! Line has code
%2501%	NOCONTINUE(X) = (.(X))<15,1>$,		! Line is not continuation one
%2501%	PRINTED(X) = (.(X))<14,1>$,		! Line was printed
%2501%	ERRCOMNT(X) = (.(X))<0,3>$,		! Code for comment error
%2501%	FIRSTBP(X) = (.(X) + 1)<FULL>$,		! BP to start of line
%2501%	LASTBP(X) = (.(X) + 2)<FULL>$;		! BP to end of line

%2501%	! Definition of code values for ERRCOMNT
%2501%	! WARNCOMT contains a case statement which uses these values

BIND
%2501%	ERRCMT1 = 1,		! ANSI Improper character in column 1
%2501%	ERRCMT2 = 2,		! VMS  Improper character in column 1
%2501%	ERRCMT3 = 3,		! BOTH Improper character in column 1
%2501%	ERRCMT4 = 4,		! ANSI Comment on statement
%2501%	ERRCMT5 = 5;		! ANSI DEBUG lines invalid

% DESCRIPTION OF THE ERROR MESSAGE QUEUE BLOCK  %
MACRO
	EMSGNUM(X) = (.X)<18,16>  $,	!ERROR MESSAGE NUMBER
	ENODLINK(X) = (.X)<RIGHT>  $,	!LINK TO NEXT ENTRY IN LIST
					! 0 IF NONE LEFT
	ERRTYPD(X) = (.X)<34,1>  $,	! IF 1 INDICATES THAT THE MESSAGE
					! HAS ALREADY BEEN TYPED ON THE TTY
	ERRLINE(X) = (.X+1)<FULL> $,	! LINE NUMBER ASSOCIATED
	ERRENT1(X) = (.X+2)<FULL> $,	! MESSAGE PARAMETER 1
	ERRENT2(X) = (.X+3)<FULL>  $,	! MESSAGER PARAMETER 2
	ENODSIZ = 4   $  ;		! SIZE OF THE NODE



	MACRO
OUTTY ( PTR )  =
%1563%	IF NOT FTTENEX
%1563%	THEN
	BEGIN
	% DIRECT OUTSTRING %
		MACHOP  OUTSTR = #051 ;
		OUTSTR (3,PTR)
	END
%1563%	ELSE
%1563%	BEGIN
%1563%		EXTERNAL TTYSTR;
%1563%		TTYSTR(PTR<0,0>)
%1563%	END
$;
	MACRO
OUTTYI ( PTR )  =
%1563%	IF NOT FTTENEX
%1563%	THEN
	BEGIN
	% INDIRECT OUTSTRING %
		MACHOP  OUTSTR = #051 ;
		OUTSTR (3,PTR,0,1)
	END
%1563%	ELSE
%1563%	BEGIN
%1563%		EXTERNAL TTYSTR;
%1563%		TTYSTR(\PTR)
%1563%	END
$;
	MACRO
OUTTYX ( PTR )  =
%1563%	IF NOT FTTENEX
%1563%	THEN
	BEGIN
	% INDEXED OUTSTRING %
		MACHOP  OUTSTR = #051 ;
		OUTSTR (3,0,PTR)
	END
%1563%	ELSE
%1563%	BEGIN
%1563%		EXTERNAL TTYSTR;
%1563%		TTYSTR(@PTR)
%1563%	END
$;

BIND	! ALSO DEFINED IN TABLES.BLI.  Beware of skews

%4527%	CHARSPERWORD = 5,	! Number of characters per word
%4527%	SIXBCHARSPERWORD = 6,	! Number of Sixbit characters per word
%4530%	MAXSYMCHARS = 31,	! Maximum number of characters in a symbol
%4530%	MAXSYMWORDS = (MAXSYMCHARS+SIXBCHARSPERWORD-1)/SIXBCHARSPERWORD;
%4530%				! Maximun number of sixbit words in a symbol


%ENDLEXBND%