cpp2xmi
Goals
- Experiment with UML,MOF with the OMF
- Reverse engineer C++-Code to UML
- special: reverse-engineer c-language structs for Message formats
Parsing
With OCC-Core there is
a C++-Parser.
There are two possibilities to do the parsing:
- Use the Analyser-library and map this structure to OMF
- Only use the parser-library und use the OMF as internal structure
I decided to go the second way to make experience with the parser.
Experience
The used Version of Opencxx/occ-core has the following problems:
- In the declarations the pointer * belongs to the name and not to the type
- The comments are not related to the declarator, the comments of the class
are all comments in the class body.
- The syntax tree of the parser is still botton up.
The concrete Walker has to build up abstractions.
The opencxx - idea is to translate c++-source to c++-source, and do things.
For round-trip-engineering like IBM/Rational Rose does, this ideas suite together. But in this state, my cpp2xmi is far away form that.
Open questions
- How to map the C++-Constructs pointer and typedef ?
- The typedef is currently mapped to a class with a Stereotype typedef.
- How to find types (buildin and self defined) ?
- In the UML standard (2.0/2.1) there is no API defined how to search an
named element in a namespace. (May be I'm wrong ?)
Currently, nothing is done.
Download
- Please regard the copyrights of the opencxx/OCC and the OMF
- My work is under GPL
- Currently, the state is trying and experimental.
- cpp2xmi-0_1.tgz
Rudolf Weber Informatik- und Netzwerkverein Ravensburg e.V