Tutorial Developer Reference 1 Introduction 2 Interface 3 Scanner 4 Parser 5 Analyser 6 Tangle 7 Weave 8 Shell 9 Commands 10 Glossary 11 References SEARCH

3.6 Comments

When FunnelWeb encounters the `@!` sequence during its left-to-right scan of the line, it throws away the rest of the line (including the EOL) without analysing it further. Comments can appear in any line except "`@i`", "`@t`", and "`@p`" lines.

FunnelWeb comments can be used to insert comments into your input file that will neither appear in the product files nor in the documentation file, but will be solely for the benefit of those reading and editing the input file directly. Example:

    @! I have used a quick macro for this definition
    @! as it will be used often.
    @$@#C@{--@}

Because comments are defined to include the end-of-line marker, care must be taken when they are being added or removed within the text of macro bodies. For example the text fragment

    for (i=0;i<MAXVAL;i++) @! Print out a[0..MAXVAL-1].
       printf("%u\n",a[i]);

will expand to

    for (i=0;i<MAXVAL;i++) printf("%u\n",a[i]);

This problem really has no solution; if FunnelWeb comments were defined to omit the end of line marker, the expanded text would contain trailing blanks! As it is, FunnelWeb comments are designed to support single line comments which can be inserted and removed as a line without causing trouble. For example:

    @! Print out a[0..MAXVAL-1].
    for (i=0;i<MAXVAL;i++)
       printf("%u\n",a[i]);

If you want a comment construct that does not enclose the end of line marker, combine the insert end of line construct `@+` with the comment construct `@!` as in

    for (i=0;i<MAXVAL;i++)  @+@! Print out a[0..MAXVAL-1].
       printf("%u\n",a[i]);

FunnelWeb comments should really only be used to comment the FunnelWeb constructs being used in the input file. Comments on the target code are best placed in comments in the target language or in the documenting text surrounding the macro definitions. In the example above, a C comment would have been more appropriate.

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