|
5 Analyser The effect of the parser is to construct a macro table containing a representation of all the macros defined within the document, and a document list which contains a complete representation of the entire document. If there are no error diagnostics (or worse) at the end of the parser run, FunnelWeb invokes the analyser which tests for the following conditions and flags them with errors if they arise.
FunnelWeb performs a static analysis to detect recursion. Unfortunately, the recursion detection algorithm flags all macros that have an infinite expansion rather than just all macros with a recursive definition. If A calls B, and B calls C, and C calls B, then FunnelWeb will flag A as well as B and C. It is hoped that this problem will be fixed in a later version. Because FunnelWeb does not provide any kind of conditional feature, the prevention of recursion does not represent a curtailment of expressive power. Macros may be invoked recursively, but may not be recursive. Thus:
@! LEGAL recursive invocation. @<Sloth@>@(@<Sloth@>@(Walrus@)@) @! ILLEGAL recursive definition. @$@<Teapot@>==@{@<Teapot@>@}
Webmaster Copyright © Ross N. Williams 1992,1999. All rights reserved. |