twopre.pl
[-help
] [-verbose
]
[-strip
] [-DEFINE
macro] [-UNDEF
macro] [infile
[outfile
]]
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.
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
ortwo_undef
in the code.-U
|-UNDEF
- Undefine a macro. This will override any
two_define
ortwo_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
).
tlcpre
exits with one of the following values:
- Command was successfull.
- Couldn't open input file.
- Couldn't write to output file.
- Couldn't open a source'd file.
-strip
option if you really know what's going on.