Question & Answer
Question
How do you reverse engineer C code which contains an enumeration type in Rational Rhapsody, to create a type of kind enumeration with literals?
Cause
In some cases the type which is created in Rhapsody is of kind "Language" and not of kind "Enumeration".
Answer
If the code has no has no identifier specified:
typedef enum !NO_IDENTIFIER! {RED,GREEN,BLUE} COLTYPE;
The identifier is optional in C, so there is nothing wrong with this code. However, it presents a problem to Rhapsody, which needs a name for the enum if it is to create an enum type element in the model.
Since the enum has no identifier to use as a name, rather than skipping the line altogether, Rhapsody reverse engineering preserves the code by adding it all to a language type element.
Solution: add an identifier to the enumeration type in C code source files.
Product Synonym
Rational Rhapsody
Was this topic helpful?
Document Information
Modified date:
27 May 2022
UID
swg21994362