Download Code Generation from Cinderella

Transcript
Code Generation from Cinderella-SDL to Embedded Platforms
5.4.3 Variable Declaration
The variable declaration includes two categories: variable definition and timer definition
Variable Definition:
A variable is defined by a variable definition. A number of variables may be declared in a single
variable-definition construct. The syntax diagram is shown in Figure 5-10
Figure 5-10 Variable Syntax Diagram
var_dcl
data-type-identifier variable-name=expression;
Timer Definition:
A timer-definition is the declaration of a timer instance in a process or service. In the
timer-definition the <timer-name> forms the defined timer. The syntax diagram is shown in Figure
5-11
Figure 5-11 Timer Syntax Diagram
var_dcl:
Timer timer-name=NEW_TIMER();
5.5 Behavior Elements Transformation
Behavior description provides all details of the behaviors of processes. As we mentioned before,
the behavior element can be classified into three groups: start, state—trigger and free actions. The
syntax diagram is shown in Figure 5-12. We will follow this structure to give instructions.
Figure 5-12 Behavior Element Syntax Diagram
5.5.1 Start
The start symbol can be found both in process and procedure units. Although the symbols between
them are a bit different, the principle and the internal syntax are the same. They can be
Leiming Chen
30
©May 2007