|
Low-level Syntax |
Top Previous Next |
|
The low-level syntax of the configuration language deals with the way in which multiple input files are handled, with comments, and with line continuation. This topic is treated informally below. Constants and Identifiers and Statements cover the higher-level syntax, which deals with how the tokens and statements of the language are built up. To help with this, we shall use the standard syntactic metalanguage, but with an extra simplification to make the syntax more readable. To show this, consider the following syntax rule written in the BS6154 metalanguage:
first example rule = "first", "second";
Interpreted strictly, this rule would be satisfied only by an input text that read firstsecond . In the syntax presented here, you should understand it to match first followed by second , but in such a way that the two items are distinguishable. For example, a space character in the input file might separate the two words here. When the two items are distinguishable in the input file without a space between them, then they may be abutted, as in the following example:
second example rule = "first", "=";
Valid input text for this rule could be, for example, first= or first = .
The general form of a configuration file is designed to be as simple as possible. The following example shows the ways in which the formatting, commenting and continuation facilities available in the configuration language can be used:
! this is an example of a comment ! a blank line follows...
! next, a statement continuation... PROCESSOR - root MyType ! now, both features in combination... PROCESSOR - ! comment AND continuation Node MyType
The above sequence is, to the configurer, exactly equivalent to the following:
PROCESSOR ROOT MYTYPE PROCESSOR NODE MYTYPE
The various facilities used above can be summarized as follows:
Certain statement types (TASK, PROCEDURE, and PROCTYPE, for example) often have several attributes. The complete list of attributes may be enclosed in braces, in which case newlines are ignored and no continuations are needed. For example, the following two ways of writing a TASK statement are equivalent:
TASK Fred ins=1 - outs=2 - data=16K
TASK Fred { ins=1 outs=2 data=16K }
In addition to these line formatting considerations, note that the configurer can accept any number of input files rather than simply one. This facility is designed to allow different parts of the description of an application to be held in separate files. For example, the description of the physical network might be held in one file and the description of your application in another. The configurer simply treats each input file in order as part of one long input stream. |