Book a Demo

Author Topic: Forward and Reverse Engineering of State Machines  (Read 5210 times)

avantol13

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Forward and Reverse Engineering of State Machines
« on: May 30, 2014, 01:39:47 am »
In the near future I will be working on a project to convert our existing state machine models in EA to C code. I am currently researching and checking some background information to judge what I will have to do to ensure that this is possible.

What's the best way to approach this problem? I've come across some frameworks for EA plug-ins, and I know EA has the capability to generate source code but I haven't been able to successfully generate code from a state machine, the option is grayed out in EA.

Eventually, I'd also like to find a way to convert source code to a state machine model in EA but I've seen on the FAQs for EA that this isn't possible? If that's true, is there a work around? I'd like to keep the source code and EA synchronized for the state machines.

Any information anyone can provide on the subject would be more than appreciated. Like I said, this is the initial research that I’m conducting, so I apologize for not having more technical knowledge of EA or its capabilities.

Thank you very much for your time,
Alex

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Forward and Reverse Engineering of State Machi
« Reply #1 on: May 30, 2014, 08:52:54 am »
The problem of the disabled option is easy to solve.

You generate a state machine by generating the class that contains it.

Reverse engineering a state machine would be an exceptionally difficult (if possible at all) thing to do. In code a state machine is not directly reflected, it would need to be derived from analyzing the entire source base. Even for generated code that has not been modified I'm not sure it would be feasible.

You would be better off demanding that future modifications have to be made in the EA model and regenerated.