MWEB User’s Guide

E. W. (Wayne) Sewell Software Engineering Specialist E-Systems, Garland Division Mail Stop 53730, P. O. Box 660023 Dallas, Texas 75266–0023

August 5, 1987

1 Introduction

This document describes the use of the MWEB (Modula-2 WEB) system. It does not describe MWEB in general, because the TUGboat article does that. Ready-to-run versions are provided for the VAX and for the IBM PC. Instructions to port MWEB to other systems are also provided. In general, if you have the regular WEB system running, you can run MWEB.

The following files should be present for all distributions of MWEB:

MANGLE.CH  generic change file for MANGLE (only MWEB changes)
MANGLE.TEX  generic TEX listing file for MANGLE
MANGLE.DVI  DVI file for generic listing file of MANGLE
MANGLESH.TEX shortened generic listing file for MANGLE
MANGLESH.DVI DVI file for shortened generic listing of MANGLE
MWEAVE.CH  generic change file for MWEAVE (only MWEB changes)
MWEAVE.TEX  generic TEX listing file for MWEAVE
MWEAVE.DVI  DVI file for generic listing file of MWEAVE
MWEAVESH.TEX shortened generic listing for MWEAVE
MWEAVESH.DVI DVI file for shortened generic listing of MWEAVE
MWEB.TEX  LaTEX file for TUGboat article about MWEB
MWEB.DVI  DVI file for TUGboat article

MWEBMAC.TEX   MWEB extensions to WEB macros

MWEBUSER.TEX LaTEX file for MWEB user guide (this document)
MWEBUSER.DVI DVI file for MWEB user guide (this document)
TABLEDEF.WEB sample MWEB definition module
TABLEHAN.DEF definition module source file
TABLEDEF.TEX definition module TEX file
TABLEHAN.DVI definition module DVI file
TABLEHAN.WEB sample MWEB implementation module
TABLEHAN.MOD implementation module source file
TABLEHAN.TEX implementation module TEX file
TABLEHAN.DVI implementation module DVI file
TABLETES.WEB sample client of MWEB library module
TABLETES.MOD source file of client module
TABLETES.TEX TEX file of client module
TABLETES.DVI DVI file of client module

The full listings of MWEAVE and MANGLE may not be present on floppy disk versions, since they take up a lot of space. The shortened versions generated by SCANTEX, which contain only the MWEB modifications, are present on all systems. The full listings can be generated with WEAVE, if desired.

The sample library module table handler consists of a definition module and an implementation module. Since there are two separate sources for the same module, they cannot both be called TABLEHAN.WEB. However, to be able to work with most implementations of Modula-2, the names of the source files are derived from the name of the module (TABLEHAN.DEF & TABLEHAN.MOD). In this sample, I get around this by naming the WEB file for definition module TABLEDEF.WEB and then renaming it to TABLEHAN.DEF as it goes through MANGLE. Admittedly, this is awkward, but I will work on a better approach.

2 VAX/VMS

The following additional files should be present in the VAX distributions of

MWEB:

MWEB.CLD  Command Language Definition file for MWEB
MWEBKANDS.COM Command procedure to build K & S version of MWEB
MWEBSTAN.COM Command procedure to build Stanford version of MWEB

    MWEAVE.OBJ  VMS object file for MWEAVE

MWEAVE.PAS  VAX Pascal source file for MWEAVE
MWEAVE.EXE  VMS executable file for MWEAVE
MWEAVE.MVH  VAX/VMS change header file for MWEAVE
MWEAVE.VAX  VAX/VMS change file for MWEAVE
MANGLE.MVH  VAX Pascal header change file for MANGLE
MANGLE.VAX  VAX/VMS change file for MANGLE

    MANGLE.OBJ  VMS object file for MANGLE

MANGLE.PAS  VAX Pascal source file for MANGLE

    MANGLE.EXE  VMS executable for MANGLE

Note: the VAX/VMS implementation of MANGLE is untested in a sense. No program generated by VAX MANGLE has been compiled and run, because my VAX system does not have a Modula-2 compiler. However, the output of VAX MANGLE has been verified to be identical with that of MS-DOS MANGLE, which has been fully tested with the Logitech Modula-2 compiler.

Since MANGLE and MWEAVE utilize the same change files as the regular TANGLE and WEAVE, the operation of the two WEB systems is almost identical.

First, MWEBMAC.TEX should be copied to TEX INPUTS or whatever directory contains the regular WEBMAC.TEX macro definition file. MWEAVE.EXE and MANGLE.EXE should be copied to whatever directory contains TANGLE

and WEAVE.

2.1 Kellerman & Smith

If this is the Kellerman & Smith system, then SYS$SYSTEM is the location of the TEX-related executable images. If the executable images are not in SYS$SYSTEM, the command language definition file (MWEB.CLD) must be modified to reflect this.

The commands to run the MWEB processors must be loaded into the DCL tables. To do this on a process-local basis use

     $ set command mweb

If the command is defined process-local this way, the definition will go away upon logout. Therefore, this command must be placed into the login command procedure so that it is always available.

To permanently install the commands system wide:

     $ set command/replace/table=sys$library:dcltables -
            /output=sys$library:dcltables  mweb

To run MANGLE, type :

     $ mangle webfile

Optional command qualifiers:

     /nochange_file
     /change_file=changefile
     /modula_file=modulafile
     /pool_file=poolfile

To run MWEAVE, type

     $ mweave webfile

Optional command qualifiers:

     /nochange_file
     /change_file=changefile
     /tex_file=TEXfile

Note: because the VAX-specific code of MANGLE is really that of TANGLE, the default file type of modulafile is actually ‘.pas’ rather than the ‘.mod’ extension one would expect. For this reason, modulafile is not really optional if you want the file created to have the correct extension. The default extensions for the others are ‘.web’, ‘.ch’, and ‘.pol’ for MANGLE and ‘.web’,

‘.ch’, and ‘.tex’ for MWEAVE.

If the executable images must be rebuilt, because of a new release of VMS, VAX Pascal, WEB, or MWEB itself, the EXEs can be rebuilt from the sources using MWEBKANDS.COM. This command procedure assumes a Kellerman & Smith configuration—i. e. TANGLE.CH in [TEX.WEB], etc. It also assumes that WEBMERGE has previously been installed. If this is not the case, then it should be installed before running the procedure. If WEBMERGE is not available, the merge must be done manually; if either TANGLE.CH or MANGLE.CH has been changed, then they must be remerged by hand to become a new MANGLE.VAX. Similarly, changes to WEAVE.CH or MWEAVE.CH require a new MWEAVE.VAX. None of this is necessary if WEBMERGE is present, since the command procedure will run WEBMERGE with the proper parameters. To actually do the build, set the default directory to be that of MWEB and enter

     $ @mwebkands

2.2 Stanford

In the Stanford implementation, MANGLE and MWEAVE are set up as foreign commands, just like TANGLE and WEAVE. To define them enter:

     $ mangle :== $webdisk:[webdirectory]mangle
     $ mweave :== $webdisk:[webdirectory]mweave

To run MANGLE, type :

     $ mangle webfile

To run MWEAVE, type

     $ mweave webfile

The default extension for the modula output file is ‘.pas’ rather than ‘.mod’ for the same reason described in the Kellerman & Smith section above. The default extensions for the others are ‘.web’, ‘.ch’, and ‘.pol’ for MANGLE and ‘.web’, ‘.ch’, and ‘.tex’ for MWEAVE. To specify a file name for any parameter other than webfile, enter “mangle” or “mweave” without a filename and reply to the prompts. If there is no change file, the null device (NL:) can be used. The null device can also be used for the output files.

To rebuild the Stanford MWEB system, set the default directory to be that of MWEB and enter

 $ @mwebstan

3 MS-DOS

The following additional files should be present in the MS-DOS distributions of MWEB:

MWEB.BAT  batch file to build MWEB
MWEAVE.MMH Microsoft header file for MWEAVE
MWEAVE.MSP Microsoft Pascal change file for MWEAVE
MWEAVE.PAS Microsoft Pascal source file for MWEAVE
MWEAVE.EXE MS-DOS executable file for MWEAVE
MANGLE.MMH Microsoft Pascal header change file for MANGLE
MANGLE.MSP change file for Microsoft Pascal
MANGLE.PAS Microsoft Pascal source file for MANGLE
MANGLE.EXE MS-DOS executable for MANGLE
MSPSUPP.WEB Microsoft Pascal support module
MSPSUPP.PAS source file of Microsoft Pascal support module
MSPSUPP.TEX TEX file of Microsoft Pascal support module
MSPSUPP.DVI DVI file of Microsoft Pascal support module

To run MANGLE, type

mangle webfile changefile modulafile poolfile

To run MWEAVE, type

mweave webfile changefile TEXfile

In both cases, all parameters are required. If there is no change file, the null device (NUL:) can be used. The null device can also be used for the output files. Note: The default extension for modulafile is ‘.pas’ rather than ‘.mod’ for the same reason described in the VMS section above. The default extensions for the others are ‘.web’, ‘.ch’, and ‘.pol’ for MANGLE and ‘.web’, ‘.ch’, and ‘.tex’ for MWEAVE. For any parameter except webfile, using asterisk (*) for a parameter means to use the same base file name as webfile and replace ‘.web’ with the extension for that parameter. For example:

     mweave junk * *

would read from ‘junk.web’ and ‘junk.ch’, and would create ‘junk.tex’.

To rebuild MANGLE and MWEAVE, the procedure is the same as for VMS, except that the changefiles to be merged with MANGLE.CH and MWEAVE.CH are the ‘.MSP’ versions rather than the ‘.VAX’ versions. The ‘mangle.bat’ and ‘mweave.bat’ batch files can be used for this purpose. Because of the wide variations in PC configurations (hard disk, RAM disk, floppy), the batch files assume that everything (TEX, Pascal, WEBMERGE) is in the default directory. They should be modified to match your actual configuration and directory structure (or the DOS “path” facility should be used).

4 Other implementations

It is fairly simple to install MWEB on a new computer type if the regular WEB system (WEAVE and TANGLE) is already running. The only hard part of porting a WEB program to another computer system is coming up with the change file to adapt the program to the target environment, and if WEAVE and TANGLE are running this has already been done. MANGLE.CH contains the modifications to adapt TANGLE to Modula-2, and MWEAVE.CH does the same for MWEAVE.

Let’s say TANGLE.WIZ and WEAVE.WIZ are the change files for the Whiz-Bang 5000 computer. Merging TANGLE.WIZ and MANGLE.CH together, either manually or via WEBMERGE, would produce change file MANGLE.WIZ, which would contain both MWEB and Whiz-Bang 5000 changes. Running TANGLE on its own WEB file with this combined change file would produce MANGLE.PAS, which would produce the executable program MANGLE for the Whiz-Bang. The same procedure would be followed for MWEAVE.