

                          Fortran Tools
                     for VAX/VMS and MS-DOS

This archive contains all of the source code from the book "Fortran Tools
for VAX/VMS and MS-DOS" by Russ Jones and Tracy Crabtree, John Wiley and 
Sons (1989).  These tools provide a comprehensive selection of 
text-oriented functions in Fortran, including:

    *  A buffered stream I/O package

    *  A translator from VAX free-form source format to Fortran 77 format

    *  A collection of string manipulation functions

    *  A hash table generator and supporting symbol table manager routines

    *  A macro preprocessor similar to that provided by C, with #define,
       #include, #if..#endif commands

    *  A lexical analyzer generator for creation of compact and efficient 
       table-driven lexical analyzers

    *  A simple compiler system with arithmetic expression evaluation and
       built-in functions

    *  A unix-like shell for use on VAX/VMS systems

The documentation included with this archive consists of this file and 
the file TOOLS.DOC, which has a brief user manual for all of the complete 
programs in the archive and an alphabetical list of all ruotines with a
one-line description of each one.

The best documentation is the book itself.  It describes every routine in 
detail, explains how it interacts with other routines, and provides 
listings of each.  This book is for serious Fortran programmers, and 
can provide new design ideas and new insights into the nuances of Fortran 
even for very experienced programmers.

Is this Stuff Free?
-------------------
Yes.  You are free to use any part of this code in your own programs without
any payment to anybody.  It is, however, copyrighted material, and this fact
must be articulated in the source code or any accompanying documentation 
for any distributed source code via the following statement:

    The [fill in details] routine(s) are from the book:
    "Fortran Tools for VAX/VMS and MS-DOS", by Russ Jones and Tracy Crabtree
    John Wiley and Sons, Inc. 1989, ISBN 0-471-61976-0, QA76.73.F25J66.
    Copyright (C) 1989 Russ Jones and Tracy Crabtree. Used with permission.

If you find this code useful, please send a postcard to

    Tools Source Code Media
    P.O. Box 1294
    Manhattan Beach, CA 90266

You can also reach Russ Jones by e-mail on 

    TheSource BBS 
    Torrance, California
    (310) 371-3737

We are interested in hearing from you!  A financial contribution of any 
amount will be appreciated ($10 suggested), but just a postcard is 
gratifying.  A contribution of $25 or more will get you a copy of the 
book sent to you ($30 outside U.S.A.). 

Roadmap to Files in This Archive:
---------------------------------
readme             this file.
tools.doc          user's guide for the complete programs herein.
index.doc          list of all routines with one-line description of each.
v77.exe            source form converter to make Fortran 77 files from
                   the source code herein.
*.fil              lists of files for each major program to use in file
                   management.
.\source\*.*       main source library for all programs.
.\lahey\*.*        I/O primitives for Lahey compiler.
.\msdos\*.*        I/O primitives based on DOS interrupt calls (also
                   using Lahey compiler).
.\bigspl\*.*       larger version of spl compiler supporting user-written
                   functions and in-line assembly.
.\test\*.*         test files for major code sections.

IBM PC Installation:
--------------------
1.  Create a directory for the tools on your hard disk, i.e. C:\TOOLS

2.  Several of the programs are supplied in PC executable form, already
    compiled and linked.  These will be copied to the TOOLS directory, so
    you should either put the TOOLS directory on your DOS command path or
    move them to another directory that is on the path after the 
    installation is complete.

3.  There is a file herein called LOGIN.BAT which contains DOS SET 
    commands.  These commands set environment variables for locating the
    Fortran compiler run-time library and the tools library.  Add these 
    SET commands to your AUTOEXEC file, modifying them as necessary to 
    reflect your software configuration.  A ``starter'' tools library 
    TOOLSLIB.LIB containing the primitives and string handling routines 
    will be copied to the TOOLS directory, and the SET TOOLSLIB command 
    should point to it.

4.  Put yourself in the TOOLS directory, i.e. CD \TOOLS.  Unzip the archive 
    using the command

    pkunzip -d fortools *.*

    The -d flag causes the directory structure preserved in the archive to
    be reconstructed during unpacking.  It is essential that the directories
    be preserved, because there are three different versions of the 
    primitives all with the same file names.

5.  Create a library using Microsoft LIB with the command

    lib libname

6.  Install appropriate tools in the SOURCE directory into the library and 
    link the programs.  It is recommended that you have separate libraries 
    for each program to keep the library size manageable; note that the 
    image command links the main routine to the library specified on the 
    command line, the library pointed to by the TOOLSLIB environment 
    symbol, and the Lahey F77L library.  Remember that Microsoft LIB cannot
    handle main programs in the library, so the main program should just be
    compiled with the ``f'' command and then linked to the appropriate 
    library with the ``image'' command.

    The LAHEY and MSDOS directories have PC versions of the I/O primitives.
    Most of these files are written in Lahey free source format with no 
    preprocessing necessary.  These can be installed in the library with
    the command

    update libname filename -n

    The -n suppresses processing by v77.

    Note that SPL files must be preprocessed with PREP before compiling,
    and that the VAX ``system'' tools will not work on the PC.  You will
    need to make minor changes to LEXGEN and SPL to get them running 
    (see Appendix B).


VAX Installation
----------------

1.  Follow step 4 for the IBM PC

2.  Transfer all files to the VAX.  You will need to have some file transfer 
    program capable of transferring ASCII files from the PC to the VAX.  
    The following is a directory tree of the files showing where they are 
    on the PC and where they should be on the VAX, assuming the root 
    directory for the tools on the VAX is DUA1:[TOOLS] and the root 
    directory on the PC is C:\TOOLS

                             DUA1:[TOOLS]
                              C:\TOOLS
                                 |
      ------------------------------------------------------------
     |            |        |              |         |             |
DUA1:[TOOLS.CMD]  |  DUA1:[TOOLS.SOURCE]  |  DUA1:[TOOLS.TEST]    |
 C:\TOOLS\CMD     |   C:\TOOLS\SOURCE     |   C:\TOOLS\TEST       |
                  |                       |                       |
          DUA1:[TOOLS.LAHEY]      DUA1:[TOOLS.MSDOS]     DUA1:[TOOLS.BIGSPL]
            C:\TOOLS\LAHEY          C:\TOOLS\MSDOS         C:\TOOLS\BIGSPL

    The DUA1:[TOOLS.LAHEY] and DUA1:[TOOLS.MSDOS] directories are for
    PC source code and are not needed on the VAX, but it's a good idea to 
    keep them on a VAX anyway.

3.  Note that the file ``CMD.DCL'' in the \TOOLS directory is a DCL 
    command procedure and should be renamed ``CMD.COM'' on the VAX (its 
    name extension was changed so that DOS will not try to execute it).
    Edit the file CMD.COM in the root directory and change the logical name
    assignments as appropriate for your installation.  For example, if you 
    have installed the tools with the root directory DUA2:[JOEUSER.TOOLS], 
    then change the DEFINE statement for TOOLSCMD to

    $ define  toolscmd   dua2:[joeuser.tools.cmd]

4.  Execute the command procedure CMD.COM and put it in your LOGIN.COM so
    it gets executed each time you log in.

5.  Create the tools library (in the source directory) with the command

    $ lib/create tools

6.  Install all source files into library with the command

    $ update tools filename

    Note that SPL files must be preprocessed first, so you need to link 
    PREP before compiling SPL files.
