twopre.pl(1) manual page

Back to the Index
Table of Contents

Name

twopre - Precompiler for TCL

Synopsis

twopre.pl [-help] [-verbose] [-strip] [-DEFINE macro] [-UNDEF macro] [infile [outfile]]

Description

twopre is used to precompile a tcl file. It does inlining of TCL source commands (with proper nesting) and inlining of TK image create bitmap and image create photo commands (i.e. replace the option -file with -data).

Comments can be removed and the additional two_{define|undef|ifdef|ifndef|else|endif} commands are processed.

If no outfile is given, twopre will write to stdout. Without an infile, twopre will use stdin.

Note that only one command per source code line is accepted! This parser does not try to parse the TCL syntax itself, which would be hardly possible as TCL code is often created on-the-fly at runtime. It only processes plaintext files, much like the C preprocessor. However, to make it compatible with the TCL-only implementation, it does recognise the string delimiters that might follow a command.

See two_pre(n) for the commands.

Options

twopre.pl recognizes the following options:
-h|-help
Display a short help message.
-v|-verbose
Be more verbose, i.e. report (on stderr) which files are currently beeing source'd.
-s|-strip
Remove comments and empty lines. However, this is done whithout respecting the context (just using a simple regular expression), so it may well break things!
-D|-DEFINE
Define a macro (well, macros should better be called flags here, but the C Preprocessor always refers to them as macros as well...). This will override any two_define or two_undef in the code.
-U|-UNDEF
Undefine a macro. This will override any two_define or two_undef in the code.

You can use any abbreviation of the above listed options, but you can't use the SysV-style concatenation of options (thus -v -s is not equal to -vs).

Return Value

tlcpre exits with one of the following values:
  1. Command was successfull.
  2. Couldn't open input file.
  3. Couldn't write to output file.
  4. Couldn't open a source'd file.

Warnings

Only use the -strip option if you really know what's going on.

Author

Frank J. Leitner
frank@fjl.de

See Also

two_pre(n) .


Table of Contents


Back to the Index