twopre.tcl(1) manual page

Back to the Index
Table of Contents

Name

twopre - Precompiler for TCL

Synopsis

twopre.tcl [-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.

The parser tries to recognize TCL syntax properly, but there are always ways to fool it. There is no way to reliably tell TCL code from data without really evaluating a file. So what the parser actually does is it looks for any occurence of two_ifdef, two_ifndef, two_define or two_undef, considers them to be TCL commands and retrieves their parameters.

See two_pre(n) for details on the commands.

Options

twopre.tcl 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).

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