Question & Answer
Question
How do you force processing of symbol and macro definitions within "ignore" annotations in IBM Rational Rhapsody?
Cause
You have enclosed pre-processor symbol or macro definitions with ignore annotations to prevent the code from being round tripped into the model, but you still wish Rhapsody to parse the symbol or macro definition itself when round tripping code elsewhere in the model.
Answer
Consider the following example. You wish to enclose an operation with a "DEBUG" symbol:
#ifdef DEBUG
void MyClass_ TestOperation(MyClass* const me) {
}
#endif
However, you do not want the pre-processor directives to be round tripped into the model.
The solution would be to enclose each pre-processor directive in "ignore" annotations.
/*#[ ignore */
#ifdef DEBUG
/*#]*/
void MyClass_ TestOperation(MyClass* const me) {
}
/*#[ ignore */
#endif
/*#]*/
The code is retained but not round tripped into the model.
However, this has the unwanted side-effect of preventing round trip of any code placed within the body of the operation "MyClass_ TestOperation". This is because the symbol "DEBUG" has not been defined within the Rhapsody configuration. You must therefore add that symbol to the <Lang>_ReverseEngineering::Parser::Defined property at the configuration level:
![](/support/pages/system/files/support/swg/rattech.nsf/0/83f0cb1cce7803ca85257fa100352f51/Content/0.6E6.gif)
All source code and/or binaries attached to this document are referred to here as "the Program". IBM is not providing program services of any kind for the Program. IBM is providing the Program on an "AS IS" basis without warranty of any kind. IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. |
---|
Product Synonym
Rational Rhapsody
Was this topic helpful?
Document Information
Modified date:
27 May 2022
UID
swg21982063