Author Topic: How to generate visual depictions from c program ?  (Read 2364 times)

bagyavinoth

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
How to generate visual depictions from c program ?
« on: October 07, 2020, 07:08:20 pm »
Hello,
In the past, i remember generating visual depictions from raw c programs using enterprise architect. Even without the real documentation, we can use this visual depictions to reduce code browsing time drastically. But i'm not sure whether this feature is still available. Could someone confirm whether this feature is still supported & if yes, help me with relevant documentation ? Thanks a lot !

Regards,
Bivin

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: How to generate visual depictions from c program ?
« Reply #1 on: October 07, 2020, 08:07:09 pm »
EA never supported to document C programs graphically since C is not OO. Only if you're dealing with Cxx (the OO variants) you can use EA to automatically create class diagrams. For pure C you are on your own to manually create any sort of model if you happen to find some structure. Possible, but most C sources are just straight code for special purpose and don't make use of any OO concept.

q.
« Last Edit: October 08, 2020, 08:34:20 pm by qwerty »

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: How to generate visual depictions from c program ?
« Reply #2 on: October 08, 2020, 04:23:09 pm »
Hello Bivin,


Importing source code does support C, but as Q alludes to the result might not be all that useful. You might also have to do a lot of tweaking to get EA to parse the preprocessor directives in your code.

Have a look at https://sparxsystems.com/enterprise_architect_user_guide/15.2/model_domains/revengtree.html.

Generating diagrams from code is an option during import ("Create Diagram for each Package"). If you don't do it then, you can create them manually after the fact.

And be careful because EA retains a reference back to each source file and if you make changes in the model and hit Synchronize those changes get written back -- but EA doesn't understand the source languages it supports, and in particular struggles with the C preprocessor, so you might end up with screwed up code. I also think there's an autho-synchronize mode so make sure you're not in that.

HTH,


/Uffe
My theories are always correct, just apply them to the right reality.