.ENABLE QUIET ! .ENABLE TRACE !******************************** FLECS.IND ********************************* .DISABLE LOWERCASE .TEST P1 .IF EQ 0 .ASKS P1 Input file .IF P1 = "" .GOTO HELPME .IF P1 = "?" .GOTO HELPME .IF P1 = "HELP" .GOTO HELPME .SETS NP1 P1 .SETS SP1 P1[1:1] .IF SP1 = "/" .SETS NP1 P2+P1 .PARSE NP1 "/" SPEC S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11 S12 S13 S14 S15 ! After any parse STRLEN holds the number of parses .SETN SWINUM (-1) .; SWINUM is the number of switches .IF SPEC = "HELP" .GOTO HELPME ! Extract the extension off of the filename (.FLX is default) .PARSE SPEC "." NAME EXT .TEST EXT .IF EQ 0 .SETS EXT ".FLX" ; if EXT empty then set to .PAS .IF <> 0 .SETS EXT "."+EXT ; if not then add a "." .GOSUB DEFALT .; do this once to init all defaults .SETN INDEX 1. .; init index to 1 .LOOP: .IF INDEX > SWINUM .GOTO COMPLE ! substitution mode is default that is why the next line works so good ! it will set the whole switch in succesion = to Sn .SETS Sn S'INDEX' .;Set Sn equal to switch S(n) .SETS CH1 Sn[1.:1.] .;Set CH1 equal to the first char of Sn ! Call the proper string handling subroutine. ! Sn and SWITCH are the parameters to be passed to ! and from the subroutine. .GOSUB 'CH1' .INC INDEX .; add one to the index which will go to the next switch .GOTO LOOP ! ***** DEFAULT SUBROUTINE ***** .DEFALT: .SETS SWITCH "" .SETS DBSW "" .SETS FLL "" .SETS FTXDEV "WF:" .SETS FIN "" .SETS IDXSW "" .SETS bounds "" .; ONLY IN F77 .SETS Ftrace "" .; ONLY IN F77 .SETF LPFLAG .SETF LNFLAG .SETF F7FLAG .SETF RPFLAG .SETS RECLEN "132" .SETS PDEV "NL:" .SETS SHTYPE "2" .RETURN .B: .sets bounds "/B" .; Bounds always checked in F4 not F77 .RETURN .C: .TEST Sn "CO" .; is it Comments or Cross switch .if > 0 .GOTO CO .I: .SETS IDXSW "INDEX" .; Creates a DK:filename.IDX cross listing file .RETURN .CO: .SETS SWITCH SWITCH+"/C" .; include comment lines in generated fortran .SETS FTXDEV "DK:" .RETURN .D: .TEST Sn "DK" .; is it Debug or DK switch .if > 0 .GOTO DK .SETS SWITCH SWITCH+"/D" .; Debug switch .RETURN .DK: .SETS PDEV "DK:" .RETURN .F: .TEST Sn "F7" .; find out if F77 .if > 0 .GOTO F7 .TEST Sn "FT" .; do you want a .FTX file .if > 0 .GOTO FT .SETS FLL ",DK:"+NAME+".FLL" .TEST Sn "FI" .; find out if FLL or FIN .IF <> 0 .SETS FIN ",DK:"+NAME+".FIN" .RETURN .FT: .SETS FTXDEV "DK:" .RETURN .F7: .SETT F7FLAG .RETURN .H: .GOTO HELPME .RETURN .L: .TEST Sn "LI" .; is it Ln03 or Lines switch .if > 0 .GOTO LI .TEST Sn "LS" .; is it Ln03 switch or LSt switch .if > 0 .GOTO S .SETT LNFLAG .; send output to LN: .RETURN .LI: .TEST Sn "LIS" .; is it Lines switch or List switch .if > 0 .GOTO S .SETS SWITCH SWITCH+"/L" .; Lines switch .RETURN .N: .SETS SWITCH SWITCH+"/N" .; Generate a new indented source file .RETURN .S: .SETS PDEV "DK:" .SETS SHTYPE "3" .RETURN .P: .SETT LPFLAG .RETURN .R: .TEST Sn "REPLACE" .; is it RECord switch or Replace switch .if > 0 .GOTO REPLA .; Extract RECLEN from /recordlength:n .PARSE Sn ":" Sn RECLEN .RETURN .T: .SETS FTRACE "/F" .; F77 ONLY .RETURN .REPLA: .SETS SWITCH SWITCH+"/D" .; Debug switch .SETS SWITCH SWITCH+"/N" .; Generate a new indented source file .SETT RPFLAG .RETURN .A: .E: .G: .H: .J: .K: .M: .N: .O: .Q: .U: .V: .W: .X: .Y: .Z: @sy:Displa.Ind *** SWITCH ERROR *** no 'Sn' switch available .RETURN .COMPLE: .IFT LNFLAG .SETS PDEV "LN:" .IFT LPFLAG .SETS PDEV "LP:" .Disable quiet ! ! 'Name''EXT' .Enable Quiet .OPEN #1 wf:'NAME'.TMP .DATA #1 R FLECS.AL .DATA #1 'FTXDEV''NAME'.FTX'FLL''FIN'='NAME''EXT''SWITCH' .DATA #1 ^C .IFT RPFLAG .DATA #1 RENAME 'NAME''EXT' 'NAME'.RPL .IFT RPFLAG .DATA #1 RENAME 'NAME'.FIN 'NAME''EXT' .IF IDXSW = "" .GOTO COMPIL .DATA #1 R INDEX .DATA #1 DK:'NAME'.IDX='FTXDEV''NAME'.FTX/A/O/L/N .DATA #1 ^C .COMPIL: .ift f7flag .goto f7cmp .if FTRACE <> "" @sy:Displa.Ind ** FLECS-E, No F4 TRACE switch available .if Bounds <> "" @sy:Displa.Ind ** FLECS-E, No F4 BOUNDS switch available. .IFF F7FLAG .DATA #1 COM/dia/LIST:'PDEV'/NOWARN/SHOW:'SHTYPE'/HEAD/NOOPT:SPD/CODE:EIS/RECORD:'RECLEN' 'FTXDEV''NAME'.FTX .Goto Clean .f7cmp: ! Close file #1 and invoke it - return and invoke Sy:f77.Ind (if specified) .CLOSE #1 $@WF:'NAME'.TMP @SY:F77.IND 'FTXDEV''NAME'.FTX/OBJ=DK:'NAME'/LIST='PDEV''NAME'.LST/STAT/RECORD='RECLEN''bounds''Ftrace' ! Open data file again, and generate commands to cleanup. .OPEN #1 wf:'NAME'.TMP .Clean: .IF FTXDEV = "WF:" .DATA #1 DELETE/NOQUERY 'FTXDEV''NAME'.FTX .DATA #1 DELETE/NOQUERY WF:'NAME'.TMP ! Delete the temp file from WF: .CLOSE #1 $@WF:'NAME'.TMP .EXIT ! END OF !******************************** Flecs.IND *********************************! ! Start of Flecs.IND online help Documentation .HELPME: .DISABLE QUIET .SETN INDEX 1. .HLOOP: .GOSUB PAGE'INDEX' .INC INDEX .IF INDEX > 5. .SETN INDEX 1. .ASK [] CONTIN Continue .IFF CONTIN .EXIT .GOTO HLOOP .PAGE1: !***************************** FLECS.IND ************************************! ! FLECS IND indirect command procedure to run the FLECS extended language ! ! ! ! Version 1.4 by Ed Hendrickson 6-May-1987 Help screen #1 ! ! ! ! the available switches are: ! ! ! ! /B*ounds check to see if arrays are out of bounds ( F77 only ) ! ! /CO*mment include comment lines in generated .FTX fortran file on DK: ! ! /CR*oss create .IDX cross reference file by running SY:INDEX, same as /I ! ! /D*ebug allows flecs to translate lines with "D" in column 1 ! ! /DK sends all output to DK: unless /Ln03 or /Print switch used ! ! /F7*7 use the F77 compiler. Must have F77.IND and F77DEF.SAV on SY: ! ! /FI*n generate a .FIN and .FLL file. same as /NEW/FLL ! ! /FL*l flecs listing copied to DK: ! ! /FT*x generate a .FTX file on DK: ! ! /H*elp Display online help ! ! /I*dx create .IDX cross listing file by running SY:INDEX, same as /CR ! ! ! !****************************************************************************! ! ! ! .RETURN .PAGE2: !***************************** FLECS.IND ************************************! ! FLECS.IND Version 1.4 by Ed Hendrickson 6-May-1987 Help screen #2 ! ! ! ! flecs switches continued: ! ! ! ! /LI*nes include FLECS line # s in col 75-80 of generated fortran file ! ! /LIS generate a fortran listing .LST, same as /S ! ! /L*n03 sends fortran listing to the laser printer ! ! /LS*t generate a fortran listing .LST, same as /S ! ! /N*ewfin generate a new indented source file .FIN ! ! /P*rint sends fortran listing to the line printer ! ! /REPLACE CAUTION swaps Flecs source with .FIN, source renamed to .RPL file! ! /RE*cor:n max record length, in bytes, for run time I/O (4 < n < 4095) ! ! /S*ource generate a Fortran listing .LST, same as /LIS or /LST ! ! /T*race generate extra F77 code to do a full traceback (F77 only) ! ! ! !****************************************************************************! ! ! ! ! ! ! .RETURN .PAGE3: !***************************** FLECS.IND ************************************! ! FLECS.IND Version 1.4 by Ed Hendrickson 6-May-1987 Help screen #3 ! ! ! ! The switches can always go after the filename or may (for some UCLs) go ! ! after the command name. Usually only one letter is needed for each switch. ! ! The order of the switches does not matter, and they can be in either upper ! ! case or lower case. The .FTX scratch file is built on WF:. If the /comm ! ! switch is used then the .FTX file is built on DK:. ! ! ! ! EIS code is the default FORTRAN code produced ! ! ! ! Examples: Flecs test/lines/fin/fll/debug ! ! FLECS/PRINT/SOURCE Test.FLX ! ! FLECS TEST/Lines/FIN ! ! Flecs/p/s test ! ! Flecs test/S/p ! ! flecs test/F77/LIS/bounds/trace ! ! flecs test ! ! ! ! Any of the extension names (except .FLX) can be used as a switch: ! ! FLECS/IDX/FIN/FLL/FTX test.flx ! ! ! !****************************************************************************! .RETURN .PAGE4: !***************************** FLECS.IND ************************************! ! FLECS.IND Version 1.4 by Ed Hendrickson 6-May-1987 Help screen #4 ! ! ! ! The Flecs source default file extension is .FLX. When a .FLX file is input ! ! to the Flecs translator it will output a .FTX ( Fortran ) file. If the ! ! /FLL switch is used then Flecs will also generate a .FLL file, which is a ! ! listing of the Flecs source including Flecs diagnostics and line numbers. ! ! If the /FIN switch is used then both a .FLL and a .FIN file will be ! ! created. The .FIN file is an indented version of the .FLX file and can be ! ! edited and used as your new source file. ! ! ! ! Flecs file extensions: ! ! ! ! .FLX Flecs source (input to the Flecs translator) ! ! .FTX Fortran source, generated from flecs (Flecs output) ! ! .FLL Flecs listing with line numbers (Flecs output) ! ! .FIN Flecs indented source with no line numbers (Flecs output) ! ! .IDX Not a Flecs file but an INDEX cross reference file ! ! ! !****************************************************************************! ! ! ! .RETURN .PAGE5: !***************************** FLECS.IND ************************************! ! FLECS.IND Version 1.4 by Ed Hendrickson 6-May-1987 Help screen #5 ! ! ! ! ! ! .FLE*cs :== Ind Sy:FLECS.Ind ^ - should be defined for TSX+ & some RT UCLs ! ! .F77 :== Ind Sy:F77.Ind ^ - should be defined for TSX+ & some RT UCLs ! ! .FLECS - will then invoke the compiler. ! ! ! ! Or if your UCL will not support the above method, ! ! ! ! .COPY Sy:FLECS.Ind DK:FLECS.COM - put FLECS.Com in your default disk. ! ! .@FLECS - for any user with SET KMON IND or ! ! .IND FLECS - for any user with SET KMON NOIND . ! ! ! ! ! !****************************************************************************! ! ! ! ! ! ! ! .RETURN