Download 58 Building an Application

Transcript
Chapter
58
Building an Application
cal PId component. Note that the global node number should be greater
than zero in all PId values except SDL_NULL.
The Symbol Table
The symbol table is a tree built up during the initialization phase in the
execution of the generated program and contains information about the
static structure of the SDL system. The symbol table contains, for example, nodes which represent signal types, blocks, channels, process
types, and procedures. The C type that are used to represent for example
signals in the symbol table is given below.
typedef struct xSignalIdStruct *xSignalIdNode;
typedef struct xSignalIdStruct {
/* components */
} xSignalIdRec;
It is the nodes that represent the signal types, for signals sent to and from
the environment of the SDL system, that are of major interest in connection with the environment functions. For each signal type there will be
a symbol table node. That node may be referenced using the name
ySigN_ followed by the signal name with prefix. Such references may
be used in, for example, xOutEnv to find the signal type of the signal
passed as parameter.
In some cases the symbol table nodes for channels from the environment to a block in the system are of interest to refer to. In a similar way
as for signals such nodes may be referenced using the name yChaN_ followed by the channel name with prefix.
The Environment Functions
An SDL system communicates with its environment by sending signals
to the environment and by receiving signals from the environment. As
no information about the environment is given in the SDL system, the
Cadvanced SDL to C Compiler cannot generate the actions that should
be performed when, for instance, a signal is sent to the environment. Instead you have to provide a function that performs this mapping between a signal sent to the environment and the actions that then should
be performed. Examples of such actions are writing a bit pattern on a
port, sending information over a network to another computer and sending information to another OS process using some OS primitive.
2702
,um-st1
Telelogic Tau 4.5 User’s Manual
July 2003