Author Topic: Can Enterprise Architect generate state machine diagrams from source code?  (Read 2563 times)

Yuki

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
I'm new to Enterprise Architect. I would like to generate state machine diagrams from C source code, but I can't find any tutorial on this. Does EA have such functionality? If not, what would be the best work around?

Thank you very much in advance!

qwerty

  • EA Guru
  • *****
  • Posts: 10622
  • Karma: +233/-194
  • I'm no guru at all
    • View Profile
Same answer here as on SO: not possible. Only the other way around.

q.

Sunshine

  • EA User
  • **
  • Posts: 867
  • Karma: +67/-5
  • Its the results that count
    • View Profile
... If not, what would be the best work around? ...
Depends on specifics like did the code follow the state pattern described in GoF book by Gamma, Helm et al.
Other options to consider are;
a) Elbow grease and do it manually
b) Write a Sparx EA plug-in that parses the code and creates the diagram
c) if using State pattern the could import the code and write script to create the diagram from classes and operations.

Option a) is the easiest for the novice but if you have like 1000 diagrams to create you may want to think about doing option b) or c) depending on how the code is structured.
Happy to help
:)

qwerty

  • EA Guru
  • *****
  • Posts: 10622
  • Karma: +233/-194
  • I'm no guru at all
    • View Profile
I wouldn't recommend c) since writing a (simplified) compiler for importing a state machine is by far not worth it. And for sure, you don't have a 1000 state machines. Option b) is just futile, but have fun: there's a Feature Request link below right of this page.

q.