[gme-users] Transforming models into source code (e.g. C)

Jeff Gray gray at cis.uab.edu
Mon Jan 30 08:44:51 CST 2006


Hi Jesper-

Perhaps your interpreter can mark the visited states during traversal
(through a hash table indexed by a unique id of the model element) and
then check for this before processing each node.

I have a very simple FSM metamodel and interpreter (generates Java, with
the same kind of guard transitions you mention) that I can send to you
(off list) in case you are intetested (just contact me privately - not
sure others are interested in that).

Jeff

----------------------------------------------------
Jeff Gray, Ph.D.
Department of Computer and Information Sciences
University of Alabama at Birmingham
gray at cis.uab.edu
http://www.gray-area.org


On Mon, January 30, 2006 4:48 am, Jesper Berthing said:
> Hi,
>
>
>
>
> I have made a paradigm where I can represent the behaviour as a state
> diagram.
>
>
>
> Please see attached meta-file that represents the behaviour of a function
> where guards are used to represent "if" like statements.
>
> My problem is to due the transversal of the model, because the model can
> contain two or more paths and this has to be handled in the
> transformation, in order not to transform states multiple times.
>
>
>
> Therefore do I need to create a new graph inside the transformation (e.g.
> Interpreter) that contains information about visited states (atoms) in
> the model? Or how should I handle this?
>
>
>
> I expect the source code to look something like, if I can do
> optimisation:
>
>
> Foo()
>
>
> {
>
>
> disable_interrupt();
>
> hp = find_hp();
>
> if(PTV[HP] == 1)
>
> {
>
>
> restore();
>
> }
>
>
> else
>
> {
>
>
> startup();
>
> }
>
>
> JUMP_TO_TASK
>
>
> }
>
>
>
>
> In relation to the above.
>
>
> What is the best approach in order to transform a model (e.g. state
> diagram) into source code (e.g. C, not BDD implementations)?
>
>
>
> GME Interpreter (BON), GReAT or another approach.
>
>
>
>
> Thanks,
>
>
> Jesper
>
>
> _______________________________________________
> gme-users mailing list gme-users at list.isis.vanderbilt.edu
> http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users
>
>




More information about the gme-users mailing list