Supplementing the Model with Handwritten Code

Supplementing the Model with Handwritten Code

This section explains how to supplement Rational Statemate simulation with handwritten code. Not only does this code become part of the simulation, but it is also included as part of generated code.

Rational Statemate enables you to extend the Rational Statemate model by supplementing the model with handwritten code. This means that you can implement those elements and aspects of the system’s behavior that have not been explicitly defined by the controlling Statecharts and mini-specs.

You may want to use this feature to:

There are several ways to supplement the generated code:

Attach existing code to the model through the Data Dictionary Editor and select one or more languages in which to implement it (K&R C, ANSI C, or Ada).

These methods enable you to add code that is used by both the Simulator and the Code Generator. Rational Statemate stores the code in the model’s database and automatically includes it when you run simulation or code generation.