![]() |
![]() |
![]() |
General Information
Tutorials
Reference Manuals
Libraries
Translation Tasks
Tools
Administration
![]() |
![]() |
FunnelWebInput Processing
Special SequencesThe scanner scans the input file from top to bottom, left to right, treating the input as ordinary text (to be handed directly to the parser as a text token) unless it encounters the special character which introduces a special sequence. Thus, the scanner partitions the input file into ordinary text and special sequences. (The control character is often referred to as the escape character or the control character in other systems. However, as there is great potential to confuse these names with the escape character (ASCII 27) and ASCII control characters, the term special has been chosen instead. This results in the terms special character and special sequence.)
input_file ::= {ordinary_text / special_sequence} .
Upon startup, the special character
is An occurrence of the special character in the input file introduces a special sequence. The kind of special sequence is determined by the character following the special character. Only printable characters can follow the special character.
The following table gives all the possible characters that can follow
the special character, and the legality of each sequence. The item
headings give the ASCII number of each ASCII character and the special
sequence for that character. The descriptions start with one of three
characters:
The most important thing to remember about the scanner is that nothing happens unless the special character is seen. There are no funny sequences that will cause strange things to happen. The best way to view a FunnelWeb document at the scanner level is as a body of text punctuated by special sequences that serve to structure the text at a higher level. The remaining description of the scanner consists of a detailed description of the effect of each complex special sequence. Setting the Special Character
The special character can be set using the sequence
<special>
The special sequence <special>
While FunnelWeb does not tolerate unprintable characters in the input
file (except for the end of line character and the tabs that Eli expands
into spaces), it does allow the user to specify that unprintable
characters appear in the product file. The
Example:
Note that the decimal
FunnelWeb treats the character resulting from a
Warning: If you insert a Unix
newline character (decimal 10) into the text, FunnelWeb will treat this
as an end of line sequence regardless of what the character sequence for
end of line is on the machine upon which it is running. Unix EOL is
FunnelWeb's internal representation for end of line. Thus, in the
current version of FunnelWeb, inserting character 10 into the text is
impossible unless this also happens to be the character used by the
operating system to mark the end of line.
When FunnelWeb encounters the
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:
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
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:
If you want a comment construct that does not enclose the end of line
marker, combine the insert end of line construct
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.
FunnelWeb provides a quick name syntax as an alternative, for
macros whose name consists of a single character, to the angle bracket
syntax usually used (eg.
The result is identical to the
equivalent ordinary name syntax, but is
shorter. For example,
The calls can be shortened using the alternative syntax.
An end of line marker/character can be inserted into the text using the
End of line markers can be suppressed by the
The comment construct (
FunnelWeb provides an include file facility with a maximum depth of 10.
When FunnelWeb sees a line of the form
The
As a point of terminology, FunnelWeb calls the original input file the
input file and calls include files and their included files
include files.
The include file construct operates at a very low level. An include line
can appear anywhere in the input file regardless of the context of the
surrounding lines.
FunnelWeb sets the special character to the default (
FunnelWeb generates an error for each input line that exceeds a certain
maximum number of characters. At the start of the processing of each
input file and each include file, this maximum is set to a default value
of 80. However, the maximum can be changed using a maximum input line
length pragma.
The maximum input line length can be varied dynamically
throughout the input file. Each maximum input line length pragma's scope
covers the line following the pragma through to and including the next
maximum input line length pragma, but not covering any intervening
include files. At the start of an include file, FunnelWeb resets the
maximum input line length to the default value. It restores it to its
previous value at the end of the include file.
This pragma is useful for detecting text that has strayed off the right
side of the screen when editing. If you use FunnelWeb, and set the
maximum input line length to be the width of your editing window, you
will never be caught by, for example, off-screen opening comment
symbols. You can also be sure that your source text can be printed raw,
if necessary, without lines wrapping around.
|