IBM Support

How to reverse engineer an enumeration type in Rational Rhapsody

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":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General Information","Platform":[{"code":"PF033","label":"Windows"}],"Version":"8.0;8.0.1;8.0.2;8.0.3;8.0.4;8.0.5;8.0.6;8.1;8.1.1;8.1.2;8.1.2.1;8.1.3;8.1.4;8.1.5","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

swg21994362