Overview of tang
tang now reads its parameters as though they were a call to an
Algol 68 program. The simplest call of the program is
tang ("filename")
If you are using the bash shell, remember to quote the
parentheses like this:-
tang '("filename")'
Alternatively, you can specify the filename as a straight path without
the string quotes provided that you enclose it in parentheses and
precede it with the `f' option:-
tang (f(filename))
Other options are:-
- d
- Output debugging information to tang.dbg.
- f
- Specify the input filename. The `f' should be
followed by the filename, either enclosed in parentheses, or enclosed
both by parentheses and by string quotes. For example:-
tang (f("filename"))
- h
- Display a usage message only.
- v
- Display the version of the program only.
- w
- Specify directories to search for Web 68 include
files. The `w' should be followed by a parenthesised list of
directories. For example:-
tang (w(dir1,dir2),f(filename))
The author's program development system uses ~/lib
as the
directory for included Web 68 files (see that system for details).
See section 3.1 for details of input
and output
filenames.
tang works roughly as follows:-
- It reads the Web 68 source file, skipping the HTML part of
each section, but tokenising the macro definitions and all the
Algol 68 code in the modules. Wherever Algol 68 code is specified as
being in an already existing module, whether tagged or untagged, it is
simply tacked onto the end of that module, together with the section
number in which the code appears.
- The untagged module is then output, token by token.
- Wherever a token is a module tag, the tag is replaced by the
text in that module.
- Wherever a token is a macro, the macro is replaced by the body
of the macro. If the macro has parameters, the actual parameters are
scanned and used to replace the formal parameters in the macro body.
- The process of expanding macros and modules bodies continues
until the output text consists of plain tokens.
- The output lines are filled to 80 characters as much as
possible, although string denotations are not split across line
boundaries.
- The output text contains comments which specify the section in
which each piece of code occurs:-
- Starting comment
- #section.subsection.subsubsection.paragraph:#
- Finishing comment
- #:section.subsection.subsubsection.paragraph#
- Finishing and starting comment
- Instead of outputting a finishing comment followed by a starting
comment, the two comments are concatenated to form a single comment of
the form #:1.1.2.1 3.1.4.2:#.
Sian Mountbatten
2012-01-05