An understanding of the internals of FunnelWeb assists with understanding its operation ().executionphases
During a single run, FunnelWeb reads and processes a single input file called the input file or the FunnelWeb file. The file is processed by passing it through a series of stages called phases. The result is that some output files are generated. A journal file is generated containing a copy of the messages that appear on the console during the FunnelWeb run. A listing file is created containing a summary of the run, including any error messages. A documentation file is generated containing typesetter commands that when fed into a typesetter program will result in printed documentation. Finally, one or more product files are generated containing the result of unscrambling the macro definitions of the input file.
These files need not all be generated on any particular FunnelWeb run. Whether each output file appears is controlled by command line options.
The phases are briefly described below.
The Scannerreadsscanner the input file, expands and reads in include files, scans the input stream, processes pragmas and typesetter directives, and parses all the FunnelWeb special sequences. The result is a list of tokens that is handed to the parser.
The Parserreadsparser the scanner's token list and parses it, constructing a document listdocumentlist and a macro table.macrotable which are passed to later phases.
The Analyserexaminesanalyser the macro table generated by the parser and performs a number of checks of the macro structures that the parser could not make on its single pass. For example, the analyser detects and flags unused macros and recursive macros. The analyser forms the final stage of FunnelWeb's front-end processing.
Tangleexpands certain macros in the macro table to generatetangle one or more product files.
Weaveuses the document list to generateweave a documentation file.
A single run through these phases constitutes a single invocation of FunnelWeb proper. Most invocations of the FunnelWeb program will consist only of a single execution of FunnelWeb proper. However, FunnelWeb also provides a command shell that provides many useful commands, including a command to invoke FunnelWeb proper. Discussion of the command shell is deferred until Section .