Looking for Freeware UML tool that will import C++ code - Page 1
Forum section: electronics / general

author: perdrix
author_rank: Frequent Contributor
timestamp: August 21, 2022, 02:16:56 pm
content: I found Umbrello, but sadly that doesn't "grok" C++17 or even some parts of C++14.Does anyone know a free UML tool that will import C++17/C++20 cope (including templates) and is even half way decent?For bonus points, one that will round trip from source to UML and back to source without losing code would be even better.ThanksDavid

author: golden_labels
author_rank: Super Contributor
timestamp: August 21, 2022, 04:21:27 pm
content: Must it be freeware?You already mentioned Umbrello, which is not freeware, so I will let myself to drop that restriction. You did not mention the operating system, so I will assume the ones on which Umbrello could run. And offerDoxygen. It can generate UML diagrams for classes. Seediagrams documentation in Doxygenfor details on how to enable that in the doxyfile.The C++ support for Doxygen was pretty good the last time I checked. At least as far as it can be, considering that the task is provably impossible for the general case. and even in practical cases presenting C++ sources as UML diagrams is troublesome thanks to mix of paradigms, two separate levels of polymorphism, and generally poor correspondence between source and semantics it represents.

author: perdrix
author_rank: Frequent Contributor
timestamp: August 22, 2022, 08:39:30 am
content: Quote from: golden_labels on August 21, 2022, 04:21:27 pmUmbrello.kde.org seems to think it is

author: perdrix
author_rank: Frequent Contributor
timestamp: August 22, 2022, 08:42:53 am
content: Quote from: evb149 on August 22, 2022, 01:10:42 amYes, class diagrams for documentation is what I'm after in the first instance (plus anything else to aid understanding/refactoring).D.

author: tggzzz
author_rank: Super Contributor
timestamp: August 22, 2022, 09:05:22 am
content: Quote from: perdrix on August 21, 2022, 02:16:56 pmDon't forget the interactions between C++ "features". In this case I wouldstartby looking for interactions between the internal Turing-complete language and macros.Class diagrams are the least interesting UML diagrams, IMHO. Much more interesting are the FSM diagrams and object collaboration diagrams. (I have, mercifully, forgotten the correct name for the latter). C++ templates, of course. Use them inlegalC++ programs to cause the compiler to emit the infinite sequence of prime numbersduring compilation. Infamously the C++ committee refused to believe they had accidentally created a Turing complete language, until Erwin Unruh rubbed their noses in it.https://en.wikibooks.org/wiki/C%2B%2B_Programming/Templates/Template_Meta-Programming#History_of_TMP

author: perdrix
author_rank: Frequent Contributor
timestamp: August 22, 2022, 01:21:48 pm
content: Quote from: tggzzz on August 22, 2022, 09:05:22 amYou'll get no argument from me on that score ...D.

author: tggzzz
author_rank: Super Contributor
timestamp: August 22, 2022, 02:33:09 pm
content: Quote from: perdrix on August 22, 2022, 01:21:48 pmCome to think of it, I don't think I've ever needed a UML class diagram when spelunking into other people's code.I've always found a text-based tree structure to be compact, complete, and easy to use when browsing and debugging. See example attached, where indentation indicates a subclass.The pre-requisites are a language based on the experiences learned in the 70s and early 80s, and a decent IDE. Don't such IDE's exist?