2. Input classes

The rest of this paper is concerned with the form required of the input text file. The input can be divided into eight classes.

Delimiters

The characters ( and ) are used as delimiters to impose a syntactic structure on the input.

White space

White space comprises sequences of space, tab and newline characters, together with comments (see below). It is not significant to the output (TDF notation is completely free-form), and serves only to separate syntactic units. Every identifier, number etc. must be terminated by a white space or a delimiter.

Comments

Comments may be inserted in the input at any point. They begin with a # character and run to the end of the line.

Identifiers

An identifier consists of any sequence of characters drawn from the following set: upper case letters, lower case letters, decimal digits, underscore (_), dot (.), and tilde (~), which does not begin with a decimal digit. tnc generates names beginning with double tilde (~~) for unnamed objects when in decode mode, so the use of such identifiers is not recommended.

Numbers

Numbers can be given in octal (prefixed by 0), decimal, or hexadecimal (prefixed by 0x or 0X). Both upper and lower case letters can be used for hex digits. A number can be preceded by any number of + or - signs.

Strings

A string consists of a sequence of characters enclosed in double quotes ("). The following escape sequences are recognised:

EscapeValue
\nNewline
\tTab
\xxxThe character with ASCII code xxx in octal.

Newlines are not allowed in strings unless they are escaped. For all other escaped characters, \x represents x.

Blanks

A single minus character (-) has a special meaning. It may be used to indicate the absence of an optional argument or optional group of arguments.

Bars

A single vertical bar (|) has a special meaning. It may be used to indicate the end of a sequence of repeated arguments.