Mapping Rational Statemate Types into C
The following table shows how Rational Statemate maps primitive types into corresponding C types:
Rational Statemate Types Note: All Rational Statemate elements of type string are translated into allocated C elements.
Records become C constructs. For example, a recordINVOICE_TYPE
might become a structure defined as:Note that the nameINVOICE_TYPE
is normally named the same as the User-Defined Type name. If, however, the Rational Statemate model contains multiple textual elements with the same name, the C code names will be modified to make all the names unique. This name mapping information is listed in the .info file. Unions become C unions with a declaration that is similar to the construct definition for records. Elements of all arrays in C are enumerated starting from 0. In Rational Statemate, there is no such restriction. 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.Enumerated range and indices of arrays are not supported in C. The C code generator shall approximate this capability in the generated code. Parameters to these constant operators are user-defined types that were defined as enumerated types. Parameters to these operators are either enumerated values (literals) or variables. The T’VAL notation is used for non-unique literals. Bit-arrays are stored in unsigned ints. Since unsigned ints can hold a maximum of 32 bits, bit-arrays larger than 32 bits are stored in arrays of unsigned ints. Arrays of bit-arrays are stored in two dimensional arrays of unsigned ints. Notice that multiple bit-arrays smaller than 32 bits are NOT packed into the unsigned int.
Results in these structures