.ENABLE SUBSTITUTION
.; LEX build command file for native RSX-11M.
.; By
.;      Volker C. Huck
.;      13-Oct-88
.;
; MLEX.CMD
;
; Compile LEX -- RSX-11M
;
.SETS SYSTYP "RSX-11M"
.IF <SYTYP> EQ "RSX-11M" .GOTO SYSOK
.IF <SYTYP> EQ "RSX-11M-PLUS" .GOTO SYSOK
.IF <SYTYP> EQ "MICRO-RSX" .GOTO SYSOK
;
;	You may not use SYSTEM '<SYTYP>' to build DECUS-C lexical
;	scanner for native RSX. If you want to build DECUS-C LEX under
;	VAX-11 RSX, use VLEX.COM instead.
;
.EXIT -1
;
.SYSOK:
.SETS MCR ""
.IF <CLI> EQ "MCR" .GOTO 90
.IF <CLI> EQ "DCL" .SETS MCR "MCR "
.IF <CLI> EQ "DCL" .GOTO 90
;
; This command file must be run under MCR.  Since "AT" will give
; confusing restart instructions (as will be for '<CLI>'), MLEX will
; now exit.  Type "@MLEX" when you have changed CLI's to MCR.
;
.EXIT -1
.90:
;
; You must override the assignments in this file if you want the following
; logical devices to be assigned to other than SY:
;
;	SR:	Source and command files must be on this device.
;	LS:	Listings go to this device.
;	OB:	Objects go to this device.
;	MP:	Maps go to this device.
;	OU:	Task images go to this device.
;
.TRANSLATE SR
.IF <EXSTRI> EQ "" 'mcr'ASN SY:=SR:
.TRANSLATE LS
.IF <EXSTRI> EQ "" 'mcr'ASN NL:=LS:
.TRANSLATE OB
.IF <EXSTRI> EQ "" 'mcr'ASN SY:=OB:
.TRANSLATE MP
.IF <EXSTRI> EQ "" 'mcr'ASN SY:=MP:
.TRANSLATE OU
.IF <EXSTRI> EQ "" 'mcr'ASN SY:=OU:
;
;Take a break.
;
'mcr'TIM
; Compile LEX
;
	.IFNINS ...XCC 	INS $CC
	.IF	<EXSTAT> NE <SUCCES>	.GOTO 1000
	.IFNINS ...XAS	INS $AS
	.IF	<EXSTAT> NE <SUCCES>	.GOTO 1000
	.IFNINS ...PIP	INS $PIP
	.IF	<EXSTAT> NE <SUCCES>	.GOTO 1000
.;
	'mcr'pip	LEXLEX.H=sr:LEXLEX.H
	'mcr'pip	YTAB.H=sr:YTAB.H
	'mcr'xcc	sr:BASE.C -a 
	.IF	<EXSTAT> NE <SUCCES>	.GOTO 1000
	'mcr'xcc	sr:DFA.C -a 
	.IF	<EXSTAT> NE <SUCCES>	.GOTO 1000
	'mcr'xcc	sr:ECLOSU.C -a 
	.IF	<EXSTAT> NE <SUCCES>	.GOTO 1000
	'mcr'xcc	sr:LEX.C -a 
	.IF	<EXSTAT> NE <SUCCES>	.GOTO 1000
	'mcr'xcc	sr:IMPURE.C -a 
	.IF	<EXSTAT> NE <SUCCES>	.GOTO 1000
	'mcr'xcc	sr:MIN.C -a 
	.IF	<EXSTAT> NE <SUCCES>	.GOTO 1000
	'mcr'xcc	sr:OUT1.C -a 
	.IF	<EXSTAT> NE <SUCCES>	.GOTO 1000
	'mcr'xcc	sr:OUT2.C -a 
	.IF	<EXSTAT> NE <SUCCES>	.GOTO 1000
	'mcr'xcc	sr:LEXSRT.C -a 
	.IF	<EXSTAT> NE <SUCCES>	.GOTO 1000
	'mcr'xcc	sr:YTAB.C -a 
	.IF	<EXSTAT> NE <SUCCES>	.GOTO 1000
.;
	.OPEN	LEX.TMP
.ENABLE DATA
;
; ODL FOR BUILDING LEX ON RSX11M.
; BOB DENNY  29-MAY-81
; BOB DENNY  19-MAR-82
; BOB DENNY  03-MAY-82
; BOB DENNY  30-OCT-82   PUT SOME FCS JUNK IN OVERLAY. REORGANIZE FOR
;			 SIMPLICITY.
;
.NAME	OVR1
.NAME   FCSJNK
.NAME	LXPROC
.NAME	PARSER
.ROOT	L0,L1
;
L0:	.FCTR	LEX-IMPURE-OUT2-LB:[1,1]C/LB
;
L1:	.FCTR	OVR1-*(FCS,STAT,PARS)
;
FCS:	.FCTR	FCSJNK-(F1,F2)
;
F1:	.FCTR	LB:[1,1]SYSLIB/LB:.CSI1:.CSI2
F2:	.FCTR	LB:[1,1]SYSLIB/LB:OPEN-(OP1,OP2)
;
OP1:	.FCTR	LB:[1,1]SYSLIB/LB:CREATE:CLOSE:DEL:FINIT:MKDL:OPFNB:RQLCB
OP2:	.FCTR	LB:[1,1]SYSLIB/LB:PARSE
;
STAT:	.FCTR	LXPROC-LEXSRT-DFA-BASE-ECLOSU-MIN-OUT1-LB:[1,1]C/LB/LB
;
PARS:	.FCTR	PARSER-YTAB-LB:[1,1]C/LB/LB
;
.END

.DISABLE DATA
.CLOSE
.;
.;
	.OPEN	LEX.TKB
.ENABLE DATA
LEX/CP=LEX.TMP/MP
STACK = 3000
TASK  = ...LEX
;DON'T TRY TO USE FCSRES (RBD)
//
.DISABLE DATA
.CLOSE
.;
.;
	'mcr'tkb	@LEX.TKB
	.IF	<EXSTAT> NE <SUCCES>	.GOTO 1000
;
; Cleanup now
;
	'mcr'pip	LEX.TKB;/de
	'mcr'pip	LEX.TSK;/pr/wo:r
	'mcr'pip	LEX.TMP;/de
	'mcr'pip	BASE.OBJ;/de
	'mcr'pip	DFA.OBJ;/de
	'mcr'pip	ECLOSU.OBJ;/de
	'mcr'pip	LEX.OBJ;/de
	'mcr'pip	IMPURE.OBJ;/de
	'mcr'pip	MIN.OBJ;/de
	'mcr'pip	OUT1.OBJ;/de
	'mcr'pip	OUT2.OBJ;/de
	'mcr'pip	LEXSRT.OBJ;/de
	'mcr'pip	YTAB.OBJ;/de
;
'mcr'TIM
; LEX built successfully.
;
;
.EXIT <SUCCES>
.1000:
;
; There has been an error. Please re-read the build instructions in
; the manual.
;
.EXIT -1
