Tonto | ||
---|---|---|
<< Previous | Next >> |
DERIVED-DATA are used to represent a collected group of DATA as a single entity. As with any data, the full description DERIVED-DATA , and the allowed operations on this data appears in a module with name DERIVED.
There are two types of DERIVED-DATA:
DERIVED-DATA -> KEYWORD-DATA(DERIVED)|VECTOR-DATA(DERIVED)
KEYWORD-DATA(DERIVED) applies when module DERIVED does not describe a list of derived data type, whereas VECTOR-DATA(DERIVED) applies when module DERIVED does describe a list of derived data type. In the latter case, the module name DERIVED will always end in the suffix "REALVEC", while the prefix will be the name of the data type of each element of the list. For example, a list of derived ATOM data would have the name ATOMVEC. In general, the grammar element which represents the name of the data type of each element of the list is DERIVED-ELEMENT. Thus, if ATOMVEC is the DERIVED type, then ATOM is the DERIVED-ELEMENT.
The most important thing to note is that the input for DERIVED-DATA may be just a valid input file for this type of data. Thus, we have ended where we began, by defining KEYWORD-DATA(DERIVED).
VECTOR-DATA(DERIVED) is defined as follows:
VECTOR-DATA(DERIVED) -> { [list_order= { PLAIN-DATA-ORDER } ] [list= {] {PLAIN-DATA(DERIVED)}* [}] } PLAIN-DATA-ORDER -> ORDERED-KEYWORD(DERIVED,1) ... ORDERED-KEYWORD(DERIVED,NC) PLAIN-DATA(DERIVED) -> ORDERED-DATA(DERIVED,1) ... ORDERED-DATA(DERIVED,NC) ORDERED-KEYWORD(DERIVED,C) -> TASK-KEYWORD(DERIVED)|DATA-KEYWORD(DERIVED)| "KEYWORD-DATA(DERIVED)"|DERIVED-ELEMENT ORDERED-DATA(DERIVED,C) -> DATA|NULL|KEYWORD-DATA(DERIVED) NC -> POSITIVE-INT C -> POSITIVE-INT |
If the optional list_order= keyword is present in the definition of VECTOR-DATA(DERIVED), the ordering of this PLAIN-DATA(DERIVED) is exactly equivalent in effect to the following KEYWORD-DATA(DERIVED) for each element of the list:
ORDERED-KEYWORD(DERIVED,1) ORDERED-DATA(DERIVED,1) ... ORDERED-KEYWORD(DERIVED,NC) ORDERED-DATA(DERIVED,NC) |
Note that the PLAIN-DATA(DERIVED) may be enclosed by an optional list= { ... } block. For clarity it is a good idea to use the list= { ... } block whenever the list_order= sequence has been used.
What if the list_order= keyword is missing? In this case, the order of the ORDERED-DATA which defines PLAIN-DATA(DERIVED) is inferred from a default ordering, which is set when the program is compiled. This default order is defined by a variable called the module INPUT_DATA_ORDER variable, defined in the macros file, and it may be changed. For example, the default order for the ATOM module is set in the ATOM_INPUT_DATA_ORDER variable. Thus, the data keyword is used to reset the default input data order used for PLAIN-DATA. Because the default orderings may change, this is another good reason to use the list_order= keyword.
One special possibility for ORDERED-KEYWORD is a quoted keyword-data sequence, "KEYWORD-DATA(DERIVED)". In this case, the corresponding ORDERED-DATA must be NULL, and the effect of this possibility is as if the quoted keyword-data sequence were had been placed in the plain data list. One often uses this mechanism to change the units system, by including the sequence "{ units angstrom }". Note that curly brackets must enclose the keywords, because KEYWORD-DATA(DERIVED) is essentially an input file by itself.