The input file: KEYWORD and DATA

A module with name MODULE describes a particular kind of data or collection of data, and also the operations that can be performed on this data. An allowed sequence of operations on this data can be performed by writing and compiling a program which uses the data and routines in that module.

Alternatively, a program can be written for every module which reads instructions and data from a text file called an input file. Desired operations on the data described by the module are then carried out by specifying appropriate instructions in the input file. [1]

The input file required by any module MODULE is an alternating sequence of valid keywords for that module, followed by valid data, if data is required. This is alternating keyword-data pattern is represented by the grammar element KEYWORD-DATA(MODULE):

KEYWORD-DATA(MODULE) -> { KEYWORD(MODULE,1) DATA(MODULE,1) 
                          KEYWORD(MODULE,2) DATA(MODULE,2) ... }

KEYWORD(MODULE,K) -> TASK-KEYWORD(MODULE)|DATA-KEYWORD(MODULE)
DATA(MODULE,K)    -> DATA|NULL

K -> POSITIVE-INTEGER

TASK-KEYWORD(MODULE) -> STR
DATA-KEYWORD(MODULE) -> STR

POSITIVE-INTEGER -> POSITIVE-DIGIT{DIGIT}*
POSITIVE-DIGIT   -> 1|...|9
DIGIT            -> 0|...|9
A DATA-KEYWORD(MODULE) for a particular MODULE is used to input data into a particular type for later tasks or calculations. A DATA-KEYWORD(MODULE) is always followed by DATA.

A TASK-KEYWORD(MODULE) is used to invoke a specific task or calculation. The TASK-KEYWORD(MODULE) will usually corresponds to a routine in the module with the exactly the same name. The documentation for this routine will also be the documentation for the corresponding TASK-KEYWORD. A TASK-KEYWORD(MODULE) may be followed by DATA(MODULE), or nothing, NULL. If followed by DATA, the DATA will be used to perform the particular task, or routine in question.

A KEYWORD(MODULE) is always a string, STR, whose definition appears below. The list of allowed DATA-KEYWORD(MODULE)'s and TASK-KEYWORD's for any module can be found in the documentation for that module.

On the other hand, there are kinds of DATA:

DATA -> SIMPLE-DATA|SIMPLE-ARRAY-DATA|DERIVED-DATA

Notes

[1]

The input file is therefore a simple kind of program to use the module. Ideally, there would be no difference between a program which uses a module, and the input file which uses the module, but this is not possible, but it is something which we have tried to achieve, since it is an important part of the goal to make TONTO simple to use.