SYNTAX - Thinkage standard command syntax.

Description:

In this file, we describe the command line syntax for TSS commands written by Thinkage Ltd. The principles underlying our chosen syntax are explained in "expl syntax principles".

There are one or two special commands that do not conform to this syntax, but these exceptions are few and far between. Exceptions are only allowed when a command is used so frequently that

One example of a command that is allowed a non-standard command line syntax is MAIL.

Bull commands do NOT conform to this standard. The Bull command standard is not the same as the Thinkage standard.

If you are ever in doubt as to whether a command obeys this standard, you should be able to tell quite easily just by looking at the style of the options shown in the command's explain file.

A command consists of a command name, possibly followed by one or more arguments separated by blanks. An argument is basically a string of text, taking one of the following forms:

A quoted string is a string delimited entirely by single (') or double (") quote characters. Quoted strings are useful when the argument may contain blanks or tab characters. A quote character is included in a string if it is used twice in succession or if it is not followed by a blank or tab. (It is only necessary to double quote characters if they are of the same type as is being used to delimit the string.)

Examples:

ftn source -warn
b source stack=700 -tables +respectcase
p text pageskip=3
slist banner="list 4 files" file1 file1 file1 file1
ftn source hstar=fred l=/library l=lib2 -go
mail to user m="string with quotes("") and blanks(' ')"
mail to user <from.file

Keyword Options:

A keyword is an unquoted string which is a mnemonic for an option to a command. It may take one of the following forms:

 keyword
-keyword
+keyword
 keyword=string

The first three forms have more or less the same function: to turn a particular option on or off or to override defaults. The convention is that a "+keyword" turns an option on, while "-keyword" turns the same option off.

"keyword=string" is used to associate a particular numeric value or text string with an option. For example, you could use this kind of keyword option to specify the length of a vector or the name of a load module. The argument to the right of the equals sign may be any one of the following: a string, in which case the keyword is a "string valued keyword"; a signed integer number, in which case the keyword is a "numeric valued keyword"; or a set of signed integers separated by commas, in which case the keyword is a "multiple numeric valued keyword".

A determined attempt has been made to use identical keywords for identical functions. When two commands have options that are similar but not identical, they often use the same keyword too. For example, specifying "+Verbose" tells most commands to give you more output than usual; however, the type of additional output that is given depends on the individual command. Different shades of meaning in a given keyword should be clear from the context of the command. In any case, the meanings can be looked up in the appropriate explain file.

An argument may be positional, but the policy is to avoid this as much as possible. A positional argument is one which must appear in a certain position relative to other options or the command name. Positional options appearing after the last file name should generate errors.

Abbreviation of Keywords:

Keywords may be abbreviated to a certain degree. The amount of abbreviation is determined to a great extent by the other options for the command -- minimal abbreviations are chosen to be as short as they can be without risking confusion with other abbreviations. Valid abbreviations for an option may be determined from the way the keyword is shown in the explain file. An option will be listed with a number of capitalized letters and possibly some lower case letters. The capital letters must be given in any abbreviation of an option; small letters may also be given, but in all cases the letters must appear in the order given as spelled out in full. The minimal abbreviation consists only of the capital letters; this minimal abbreviation should always be unambiguous.

Option           Some abbreviations
------           ------------------
Hstar=           h=, hs=, hstar=
Forward          f, for, forward
ForwardRegister  fr, for, foreg

The user is warned to be wary however, as the "Forward" and "ForwardRegister" examples above show; "for" is a valid abbreviation for both options, but will be interpreted as "ForwardRegister". Note that the abbreviation "f" is always interpreted as "forward".

Redirection of I/O:

Another useful convention is that of I/O redirection. By default, Thinkage commands use the terminal as the standard input unit and the standard output unit; however, you can change the standard input or standard output unit by using one or more of the following constructions on the command line.

<input
instructs the command to take its input from the file "input" rather than the terminal.
>output
instructs the command to write its output to the file "output" rather than the terminal.
>>output
instructs the command to append its output to the file "output" rather than writing to the terminal.

File concatenation:

An input file name may be given as a single name or as a sequence of names separated by "+" signs (no blanks in the string). In this way, commands which normally take only one input file name at a time can be coaxed into accepting several. For example, the command

B file1+file2

would cause the B compiler to process "file1" and "file2" together as if they were one file. This may result in strange effects for commands which do accept more than one file name. For example,

P file1+file2

would cause P to regard file1 and file2 as one file. Thus it would not print out the file name for each new file it begins to print, as would normally be the case.

Technical note:

All commands which use the above conventions are written in B or C. For a more detailed discussion on the implementation of these conventions, see "expl b lib .bset".

Pascal programs support only redirection of I/O.

Copyright © 1996, Thinkage Ltd.