1. Introduction
The TDF notation compiler, tnc
, is a tool for translating TDF capsules to and from text. This paper gives a brief introduction to how to use this utility and the syntax of the textual form of TDF. The version here described is that supporting version 3.1 of the TDF specification.
tnc
has four modes, two input modes and three output modes. These are as follows:
Mode | Description |
---|---|
decode | Translate an input TDF capsule into the tnc internal representation. |
read | Translate an input text file into the internal representation. |
encode | Translate the internal representation into an output TDF capsule. |
write | Translate the internal representation into an output text file. |
dot | Translate the internal representation into an output Dot format graph, suitable for processing with Graphviz tools. |
Due to the modular nature of the program it is possible to form versions of tnc
in which not all the modes are available. Passing the -version
flag to tnc
causes it to report which modes it has implemented.
Any application of tnc
consists of the composite of an input mode and an output mode. The default action is read
-encode
, i.e. translate an input test file into an output TDF capsule. Other modes may be specified by passing the following command line options to tnc
:
-decode
or-d
-read
or-r
-encode
or-e
-write
or-w
The only other really useful action is decode
-write
, i.e. translate an input TDF capsule into an output text file. This may also be specified by the -print
or -p
option. The actions decode
-encode
and read
-write
are not precise identities, they do however give equivalent input and output files.
In addition, the decode
mode may be modified to accept a TDF library as input rather than a TDF capsule by passing the additional flag:
-lib
or-l
to tnc
.
The overall syntax for tnc
is as follows:
% tnc [ options ... ] input_file [ output_file ]
If the output file is not specified, the standard output is used.