1 Introduction
2 Macros
3 Typesetting
4 Example
5 Hints
6 Examples
7 Webmaking

FunnelWeb Tutorial Manual

5.3 FunnelWeb the Martinet

There are many ways in which a macro preprocessor can cause unexpected difficulties. FunnelWeb seeks to avoid many of these problems by performing a number of checks. This section describes some of the checks that FunnelWeb performs.

Trailing blanks in the input file: Trailing blanks are usually not dangerous, but FunnelWeb disallows them anyway. All trailing blanks in the input  (.fw file) are flagged as errors by FunnelWeb. FunnelWeb does not flag trailing blanks in any of its output files.

Input line length: FunnelWeb has a maximum input line length. If FunnelWeb reads an input line longer than this length, it flags the line with an error message. The maximum length can be changed using a pragma (see the FunnelWeb Reference Manual).

Product file line length: FunnelWeb watches the length of output lines and all output lines longer than the limit are flagged with error messages. The maximum length can be changed using a pragma. That FunnelWeb polices output lines is very important. Some programs can behave very strangely if they get an input line that is too long (e.g. Fortran compilers can simply ignore text past a certain column!) and once FunnelWeb starts expanding macros using indentation, it is sometimes not obvious how wide the product file will be.

Control characters: The presence of control characters in a text file can result in some confusing behaviour downstream when the file is presented to various programs. Unfortunately, some text editors allow control characters to be inserted into the text rather too easily, and it is all too easy to be tripped up. FunnelWeb prevents these problems by flagging with diagnostics all non-end-of-line control characters detected in the input (.fw) file (even TABs). The result is that the user is guaranteed that product files generated from FunnelWeb contain no unintentional control characters. This said, FunnelWeb does allow the insertion of control characters in the output file by explicitly specifying them in the text using a @^ control sequence.

Number of invocations: FunnelWeb checks the number of times that each macro is called and issues an error if the total is not one. The @Z (for zero) and @M (for many) macro attributes can be used to bypass these checks.

Recursion: Because FunnelWeb does not provide any conditional constructs, all recursively defined macros must, by definition, expand infinitely*, and are therefore unacceptable. FunnelWeb performs static  checks to detect recursion, detecting it before macro expansion commences. The user need not fear that FunnelWeb will lock up or spew forth if a recursive macro is accidentally specified. (* Note: A special case exists where there is recursion but no content. In this case, the expansion is finite (the empty string) even though the operation of expanding is infinite. FunnelWeb does not treat this case specially).

Prev Up Next

Webmaster    Copyright © Ross N. Williams 1992,1999. All rights reserved.