During reverse engineering, a comment that comes immediately
before the code for an element is considered a comment for that element,
and the comment text will be brought into IBM® Rational® Rhapsody® as
the description for that element.
You can use the <lang>_ReverseEngineering::ImplementationTrait::PreCommentSensibility property
to specify the maximum number of lines by which a comment can precede
the code for an element and still be considered a comment for that
element. Any comment that precedes an element by more than the number
of lines specified will be considered a floating comment. For example,
a value of 1 means that a comment must appear on
the line before the code for an element to be considered a comment
for that element. The default is 2.
If a C or C++ project has been reverse engineered,
the comments are imported as text elements in the relevant SourceArtifacts
and are read in as whole blocks. (The comments that are not became
a description of some element that is imported.) Then when the code
is generated or roundtripped, the comment/text element is placed in
its correct place based on its original location.
The following properties are set by default for
this feature:
- <lang>_ReverseEngineering::ImplementationTrait::RespectCodeLayout property
is set to Ordering.
- <lang>_CG::Configuration:CodeGeneratorTool property
is set to Advanced.
- <lang>_Roundtrip::General::RoundtripScheme property
is set to Respect.
For information about code preserving and SourceArtifacts,
see Reverse engineering SourceArtifacts.
Note the following information:
- If a function has one comment in a .h file and
another comment in a .cpp file then the comment in
the .cpp file is imported as a floating comment.
- When any reversed engineered file has a comment
as its first element, then any file header comment is turned off.
The same is true for any file footer comment.
- Reverse engineering imports the first/last comment
of the file as a regular comment (as a text fragment). Reverse engineering
disables generation of the auto-generated header/footer by setting
these properties to empty string values.
- <lang>_CG::File::ImplementationHeader
- <lang>_CG::File::SpecificationHeader
- <lang>_CG::File::ImplementationFooter
- <lang>_CG::File::SpecificationFooter