Download Untitled - Web del Profesor

Transcript
Chapter 5
NETWORK
The NETWORK section of a GLIDER program describes the relationships among the subsystems and the
code that simulates their behavior. In what follows the general rules to write this section and the way in
which it is processed are described.
5.1 Dening a node
The node has two parts, a heading part and a code part. The structure is:
<heading> :: <code>
5.1.1 Heading
This part declares the name, the type , the successors and the local variables. The heading has the following
structure:
<name> / <type> / <index range> / <list of successors>
/ <LABEL: <list of labels>> / <VAR <declarations of local variables>> /
Items between // may be omitted
<name> is an identier ( see Chapter 2) that indicates the name of the node. It is also the declaration
of the node.
<type> is a letter that designs the type of the node (See Chapter 1 and Chapter 4). If omitted the
rst letter of the name is assumed to describe the type.
<index range> is a range indicator of the form: 1 .. <positive integer>]. If omitted the node
is assumed simple.
<list of successors> is a list of node names. They are the nodes to which messages may be sent.
Multiple nodes must have an index. If the list is omitted and the node needs a successor, the system
tries to see if the following node is a feasible successor. If so, it will be the successor. Otherwise, an
error condition occurs.
<LABEL : <list of labels>>. If labels are used in the code, they must be declared here the list is
formed by numbers or identiers separated by commas. The labels are local to the node and all must
be used.
<VAR <list of declarations of local variables>>. This is to declare local variables as in the
VAR part of the section DECL (see 2.3).
49