Supplementing the Model with Handwritten Code : Mapping Rational Statemate Types into C : Enumerated Types

Enumerated Types

An Enumerated Type is a user-defined type with a finite number of values. The Simulation monitor allows you to select an enumerated-value from a list of possible values. Enumerated types with a large number of possible values are supported.

Enumerated values and other textual items cannot have the same name within the same scope. For example, data-item SUN cannot be declared in the same chart where an enumerated value SUN is declared.

Note: Enumerated range and indices of arrays are not supported in C. The C code generator shall approximate this capability in the generated code.

There are two constant operators and five general operators for enumerated types: