otangle1
Translate a literate programming web to pascal
Part of tangle(1).
Usage
tangle [options]
webfile
[.web]
[{changefile
[.ch] | -}
[outfile
[.p]]]
Overview
The tangle program converts a WEB literate programming source document into a Pascal program. In addition to being processed with a Pascal compiler, nowadays, the Pascal output is often translated to C; this is how the TeX family of programs are compiled in TeX Live.
The WEB language allows you to prepare a single document containing all the information that is needed to produce both a compilable Pascal program and a well-formatted document describing the program in as much detail as the writer may desire. The user of WEB must be familiar with both TeX and Pascal. WEB also provides a relatively simple, although adequate, macro facility that permits a Pascal program to be written in small modules, written in an arbitrary order.
The command line should have one, two or three filenames on it. The first is taken as the WEB file; ".web" is added if there is no extension.
If a second filename is given, it is taken as a change file, and ".ch" is added if there is no extension. The change file overrides parts of the WEB file, as described in the WEB system documentation. If no second filename, there is no change file.
If a third filename is given, it is taken as the Pascal output file, and ".p" is added if there is no extension. To specify an output file with no change, you can use "-" for the second argument, meaning an empty change file (not stdin). If no third filename is given, the name of the Pascal file is formed by adding ".p" to the root of the WEB file name.
The output file is packed into lines of 72 characters or less, with the only concession to readability being the termination of lines at semicolons when this can be done conveniently.
If the WEB program uses the built-in string handling feature (double-quoted strings), a second output file is a string pool file, whose name is always formed by adding ".pool" to the root of the Pascal file name.
The otangle variant supports a larger character range. It was written for the Omega project, the first TeX supporting Unicode, now provided as the aleph(1) descendant program.
Options
See tex(1) for details of command-line parsing.
Some of these options may render the output unsuitable for processing by a Pascal compiler.
-
--help -
Print help message and exit.
--lengthnumber-
Compare only the first number characters of identifiers when checking for collisions. The default is 32; the original
tangleused 7.
-
--loose -
When checking for collisions between identifiers, honor the settings of the
--lowercase,--mixedcase,--uppercase, and--underlineoptions. This is the default.
-
--lowercase -
Convert all identifiers to lowercase.
-
--mixedcase -
Retain the case of identifiers. This is the default.
-
--strict -
When checking for collisions between identifiers, strip underlines and convert all identifiers to uppercase first.
-
--underline -
Retain underlines (also known as underscores) in identifiers.
-
--uppercase -
Convert all identifiers to uppercase. This is the behaviour of the original
tangle.
-
--version -
Print version information and exit.
otangle supports only the --help and --version options,
Environment
The programs look for the input files using the environment variable WEBINPUTS. If it is not set, it uses the system default. See the Kpathsea manual at https://tug.org/kpathsea for the details of the searching.
Releases
16 releases since Debian 2.0 (Hamm); the text changed 13 times.
--help since Debian 3.1 (Sarge);
--loose since Debian 7 (Wheezy);
--lowercase since Debian 7 (Wheezy);
--mixedcase since Debian 7 (Wheezy);
--strict since Debian 7 (Wheezy);
--underline since Debian 7 (Wheezy);
--uppercase since Debian 7 (Wheezy);
--version since Debian 3.1 (Sarge).