Go to the first, previous, next, last section, table of contents.


FILES

@FWEB{} works with a variety of files. File names have the form `[path]/root[.ext]', where the brackets denote optional. Here the slash is called the prefix end character. Since this character differs for various operating systems, it can be changed by system installers in `custom.h' (see section CUSTOMIZATION). The character that initiates the file-name extension (normally a period) can be changed with the `-E' command-line option (see section `-E': Change the delimiter of a file-name extension).

Input files

@FWEB{} reads files with a variety of default extensions.

`.fweb' -- Initialization file (optional; for setting up default options used for all runs). This file is always in the user's home directory. See section Initialization.

`fweb.sty' -- Style file (optional; for customizing the behavior of a particular web file or group of files). See section The Style file. This file is always in the directory of the web file that is being tangled unless that is changed by environment variable FWEB_STYLE_DIR. The basic name can be changed by the `-z' option (see section `-z': Change name of style file). A sample `fweb.sty' file is provided with the @FWEB{} distribution.

`name.web' -- Source file.

`name.ch' -- Change file (optional; for making incremental changes to a web source file). See section Change files.

`name.hweb' -- Code included into web file with `@i' (see section `@i': Include file (unconditional)). Include files are searched for in the path set by the environment variable FWEB_INCLUDES and/or the `-I' option (see section `-I': Append to search list for include files). If that path is empty, then the current directory is searched.

`name.hch' -- Optional change file for include file.

Automatic file-name completion

Automatic completion of input file names is turned on by the `-e' command-line option (see section `-e': Turn on automatic file-name completion). When this option is in effect, input file names that include no period (have no extension) are completed automatically according to the contents of the following style-file entries:

Type of file WEB file Change file Include file Change file for include file
Style-file entry Default
ext.web web
ext.ch ch
ext.hweb hweb
ext.hch hch

More than one extension may be specified, as a space-delimited list--e.g., `ext.web = "web wb"'; the first one that matches is used.

Output files

@FWEAVE{} writes a variety of output files.

`name.tex' -- Woven output to be processed with LaTeX.

`CONTENTS.tex' -- Temporary file that accumulates Table-of-Contents information. (For LaTeX, the `aux' file is used instead.)

`INDEX.tex' -- Temporary file that stores indexing information.

`MODULES.tex' -- Temporary files that stores module list.

The names of the three temporary files can be changed with style-file parameters (see section The Style file). Commonly, one may put into the style file `fweb.sty' commands such as

index.tex "#.ndx"
modules.tex "#.mds"
contents.tex "#.cts"

The `#' is replaced by the root name of the web file.

@FTANGLE{} writes files of the form

`name.ext' -- Compilable output file.

The extensions for the compilable output file(s) have certain defaults, but can be changed by style-file parameters according to the following table:

Language C C++ Fortran--77 Fortran--90 Ratfor--77 Ratfor--90 TeX VERBATIM
Style-file entry UNIX default non-UNIX default
suffix.C c c
suffix.Cpp C C
suffix.N f for
suffix.N90 f90 for90
suffix.R r rat
suffix.R90 r90 rat90
suffix.X sty sty
suffix.V mk mk

For example, to change the default extension for a C++ file from `C' to `c++', put into `fweb.sty' the line

suffix.C = "c++"

Change files

The primary input to the @FWEB{} processors is the `test.web' source file. However, a change file `test.ch' can also be specified. A change file consists of instances of the following structure:

@x
(One or more lines of text, EXACTLY as in the web file.  Copy these
lines with an editor; don't type them from scratch.)
@y
(Replacement text.)
@z

The change-file mechanism allows one to insert local changes or test new code without physically modifying the original web file.

To specify a change file, use its name as the second file name on the command line. The extension `.ch' is assumed by default. For example,

ftangle test test

processes `test.web' with the change file `test.ch'.

In addition to `@x', `@y', and `@z', the only `@' commands allowed in a change file are language-changing commands such as `@c' and the special commands `@[' and `@]'. The command `@[' is used for column-oriented languages such as FORTRAN--77 and means switch into code mode. Similarly, `@]' means switch out of code mode.

All `@' commands in a change file must begin in column 1. Lines not beginning with `@' are ignored, so may be used as comments. Comments may also be included on the `@x', `@y', and/or `@z' lines.


Go to the first, previous, next, last section, table of contents.