.; [202,1]FLE.CMD MAO 13-MAY-80 .; .; INDIRECT MCR FILE TO TRANSLATE AND COMPILE FLECS MODULES .; .; CALLING SEQUENCE: @[202,1]FLE NAME F4PSW FLESW .; WHERE NAME=FILE NAME (WITHOUT EXTENSION) FOR FLECS INPUT FILE. .; F4PSW=ANY F4P SWITCHES TO BE USED (MAY BE BLANK). .; IF FLECS SWITCHES ARE TO BE GIVEN WITHOUT ANY .; F4P SWITCHES, PUT A POUND SIGN (#) HERE. .; FLESW=ANY FLECS SWITCHES TO BE USED (MAY BE BLANK). .; .; IF NAME IS NOT GIVEN (EG. @FLE), INFORMATION IS PROMPTED FOR .; UNTIL A ^Z IS GIVEN OR A FATAL ERROR OCCURS. .; IF NAME IS GIVEN, THE GIVEN MODULE IS PROCESSED AND FLE.CMD EXITS. .; .; REVISIONS .; 20-MAY-80 (MAO) CHECK SW FOR VALIDITY; FIX SYNTAX ERROR FOR ERROR EXITS. .; 04-MAR-83 (MAO) ALLOW FLECS SWITCHES; USE # FOR MISSING F4P SWITCHES. .; 07-MAR-84 (MAO) DELETE .FID (FLECS INTERNAL DECLARATION) FILES. .; 13-AUG-84 (MAO) PURGE .OBJ AND .FLL FILES INSTEAD OF DELETING. .; PUT /NOI4 IN F4P COMMAND LINE. .; .; .ENABLE SUBSTITUTION .SETS POUND "#" .SETS BLANK "" .SETS SLASH "/" .SETS FU "FU" ;FLECS /FU .SETS MFU "-FU" .SETS SP "SP" ;FLECS /SP .SETS MSP "-SP" .SETS CO "CO" ;FLECS /CO .SETS MCO "-CO" .; .IF P1 EQ BLANK .GOTO 10$ ;MUST PROMPT FOR INPUT .; .SETT WASCMD ;INPUT WAS IN COMMAND LINE .SETS NAM P1 .SETS F4PSW P2 .SETS FLESW P3 .GOTO TSTF4P .; .10$: .SETF WASCMD ;NO COMMAND LINE GIVEN, PROMPT .; .QUERY: .; .ASKS NAM GIVE FLE FILE NAME (^Z TO EXIT) .ASKS F4PSW GIVE F4P SWITCHES .ASKS FLESW GIVE FLE SWITCHES .; .TSTF4P: .IF POUND EQ F4PSW .SETS F4PSW BLANK ;Just a space holder .; .IF BLANK EQ F4PSW .OR .IF SLASH EQ F4PSW[1:1] .GOTO TSTFLE .; ; FIRST CHARACTER OF F4P SWITCH NOT A "/" .EXIT 4 .; .TSTFLE: .SETS INPFU BLANK ;Assume no /FU given .SETS INPSP BLANK ;Assume no /SP given .SETS INPCO BLANK ;Assume no /CO given .; .IF BLANK EQ FLESW .GOTO ACT ;Nothing to parse .; .PARSE FLESW "/" S1 S2 S3 S4 .; .IF BLANK EQ S1 .GOTO 20$ .; .; The way PARSE works, S1 will be blank if first char is a slash ; First character of FLE switch not a "/" .EXIT 4 .20$: .; Evaluate each switch .GOSUB EVSW 'S2' .GOSUB EVSW 'S3' .GOSUB EVSW 'S4' .; .ACT: FLE 'NAM''INPFU','NAM'/-SP'INPSP'='NAM''INPCO' .IF GT 1 .EXIT .; F4P 'NAM','NAM'='NAM'/NOI4'F4PSW'/-SP .IF GT 1 .EXIT .; AFF 'NAM' .IF GT 1 .EXIT .; PIP 'NAM'.OBJ,'NAM'.FLL/PU PIP 'NAM'.LST;*,'NAM'.FTN;*/DE .; .; To avoid error messages, find out if any .FID files exist. .TESTFILE 32766.FID .IF EQ 1 PIP *.FID;*/DE .; .IFF WASCMD .GOTO QUERY ;IF WAS NO CMD LINE, PROMPT FOR MORE .EXIT 1 .; .EVSW: .; .; SUBROUTINE EVSW (SWITCH STRING) .; .; Evaluate which FLECS/ALECS switch was given. .; The argument is passed in local symbol COMMAN without the leading slash. .; .IF FU NE COMMAN[1:2] .AND .IF MFU NE COMMAN[1:3] .GOTO 30$ .SETS INPFU "/"+COMMAN ;Some form of /FU given .GOTO 60$ .30$: .IF SP NE COMMAN[1:2] .AND .IF MSP NE COMMAN[1:3] .GOTO 40$ .SETS INPSP "/"+COMMAN ;Some form of /SP given .GOTO 60$ .40$: .IF CO NE COMMAN[1:2] .AND .IF MCO NE COMMAN[1:3] .GOTO 50$ .SETS INPCO "/"+COMMAN ;Some form of /CO given .GOTO 60$ .50$: .IF BLANK EQ COMMAN .GOTO 60$ ; Unknown FLECS switch /'COMMAN' .EXIT 4 .; .60$: .RETURN .; .; END OF FILE FLE.CMD