Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsState chart code generation walkthrough
https://www.eclipse.org/forums/index.php/mv/msg/1092959/1785983/#msg_1785983
Does anyone know If there is something similar for creating code from a state machine?
I see that there is an example project called SimpleSM but I need more to understand what it is doing.
Thanks,
Steve]]>Stephen Blackwell2018-04-23T19:37:40-00:00Re: State chart code generation walkthrough
https://www.eclipse.org/forums/index.php/mv/msg/1092959/1785989/#msg_1785989
Unfortunately I do not know of a "getting started" on that topic. Also, UML State machines can become rather complex (and tend to require a significant amount of knowledge.
Although not "pure" UML, the Papyrus for Real Time product does have a code generator for the UML-RT language (a superset of a subset of UML). This may not be exactly what you need, but it would probably provide some good information about how this was done int that context. You can look at its Transformation Architecture Detailed Description for some idea of what we did in that context.
Another potential open source project that is based on Eclipse and that may provide some insight could be Bridgepoint project on GitHub. I do believe they can generate code from state machine.
If you do create a UML-based state machine code generator on top of base Papyrus, I would invite you to consider placing it under open source.
Good luck!
]]>Charles Rivet2018-04-23T21:42:26-00:00Re: State chart code generation walkthrough
https://www.eclipse.org/forums/index.php/mv/msg/1092959/1786306/#msg_1786306
I don't think that state machines themselves are particularly complicated. Automatically generating code from them is another matter, particularly when you get into parallel and sub-state charts.
About a year ago it was announced that there was a Rhapsody to Papyrus import project that would be released "in a couple of days". That, and the fact that there was an example transformation program included in Papyrus gave me hope that we would have C++ code generated from state machine.
That all seems t have gone away.
Steve]]>Stephen Blackwell2018-04-30T13:50:09-00:00Re: State chart code generation walkthrough
https://www.eclipse.org/forums/index.php/mv/msg/1092959/1786309/#msg_1786309
Indeed state machines are not particularly complicated, but the event sources often are. A bespoke event dispatcher can be very efficient. A generic wrap-all-events-up-in-some-polymorphic-capability can be dreadful. For non-trivial state machines the size of the transition table can be unpleasant, but is often very amenable to compression. Once again bespoke approaches can be good, generic approaches horrible. IMHO it is the comparative ease and efficiency of a bespoke implementation compared to the size speed and complexity of a generic solution that explains why we are not all using a standard solution. Note that not even Java has a standard State machine class. In constrast LALR tooling such as lex/yacc have a very disciplined event source allowing their very effective auto-tooling for thousand state state machines.