Code Generator for Boost.MSM

304 views
Skip to first unread message

SpeedPat

unread,
Aug 4, 2014, 3:36:45 PM8/4/14
to yakind...@googlegroups.com
Hi all 

I saw in the https://code.google.com/a/eclipselabs.org/p/yakindu/wiki/GSoC#Ideas_List, that there is the Idea for a Code Generator for Boost.MSM.

Has anyone started with this and is there some code to start from?

cheers
SpeedPat

Axel Terfloth

unread,
Aug 4, 2014, 4:06:25 PM8/4/14
to yakind...@googlegroups.com
Hi SpeedPat,

no work has been done on that topic yet. So if you are interested working on that and contributing as open source we would support you with hints, answers, discussions, reviews etc.. 

Best regards,
Axel


--
You received this message because you are subscribed to the Google Groups "YAKINDU User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yakindu-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Patrick Heeb

unread,
Aug 18, 2014, 3:25:53 AM8/18/14
to yakind...@googlegroups.com
Hi Axel

I wrote a code generator for Boost.MSM.


It currently supports
  • Interfaces
  • Orthogonal States

If you find time, I'd appreciate feedback / review.

The generator inherits from the existing Cpp Generator. 

I've not yet figured out how to write tests for the generator. So far I just did some manual tests.
How do you test the other generators?

Best Regards
Patrick


--
You received this message because you are subscribed to a topic in the Google Groups "YAKINDU User" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/yakindu-user/89-iFyPWAQs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to yakindu-user...@googlegroups.com.

Axel Terfloth

unread,
Aug 19, 2014, 5:37:17 AM8/19/14
to yakind...@googlegroups.com, Patrick Heeb
Hi Patrick,

that sounds great - i will take a closer look on the generator and will provide feedback as soon as i have some time. :)

The SCT code generators are unit tested. Some of those tests are manually coded but most are generated from sctunit test specifications. SCTunit tests are unit tests that look like this:

testgroup GuardedExit for statechart GuardedExit {

 

test ExitTaken { 

enter

assert active(GuardedExit.main_region.A)
assert ! guard
raise e


cycle

assert active(GuardedExit.main_region.B)
assert ! done 


test ExitNotTaken {


enter 

assert active(GuardedExit.main_region.A)
guard = true
raise e


cycle

assert active(GuardedExit.main_region.B)
assert done 


}

These two tests refer to a statechart called GuardedExit and drive that state machine.. You will find some more information on that topic here: http://muelder.blogspot.de/2013/02/test-driven-statechart-development-with.html .

When you take a look at the project org.yakindu.sct.test.models then you will currently find about 50+ sct  test models and corresponding sctunit files. These are the tests and test models that we use to test our different generators (c, c++, java & javascript) and the interpreter, that is used for simulating the statecharts. The generated junit and gtest tests are located in the projects:

- org.yakindu.sct.generator.c.test
- org.yakindu.sct.generator.cpp.test
- org.yakindu.sct.generator.java.test
- org.yakindu.sct.simulation.core.sexec.test (for the interpreter)

So if you want to develop generator tests in the same fashion as we do and reuse the existing test cases than two things are important:

1. You’ll require the sctunit tooling. This is not open source but we can provide it to you.
2. Since the approach includes generating code from the sctunit test definitions you will likely have to implement a generator for gtests (or any other unit testing framework) that interfaces your Boost.MSM bases state machine implementations. Like the statechart generator you my derive that generator from the existing sctunit-c++ generator.

For guest the stunt framework also provides a junit-gtest integration that allows a better integration of gtests in a java & Eclipse based development environment.

So i would suggest that you could take a look at the projects i mentioned above. We then could go into more detail and provide the required infrastructure. Would that be appropriate for you?

Best regards,
Axel


Axel Terfloth

Leiter Forschung & Entwicklung Embedded Systems

itemis AG
Am Brambusch 15-24
44536 Lünen

Rechtlicher Hinweis:

Amtsgericht Dortmund, HRB 20621
Vorstand: Jens Wagener (Vors.), Wolfgang Neuhaus, Dr. Georg Pietrek, Jens Trompeter, Sebastian Neus
Aufsichtsrat: Dr. Burkhard Igel (Vors.), Stephan Grollmann, Michael Neuhaus



Axel Terfloth

unread,
Aug 19, 2014, 6:16:35 AM8/19/14
to yakind...@googlegroups.com, Patrick Heeb
Damn - after i upgraded my mail client it does some annoying ‚auto-corrections‘ on the fly and i missed to correct the corrections - so some sentences became nonsense ...

So if you read:
 
    ‚For guest the stunt framework also provides…‘ 

it was meant: 

    ‚For gtest the sctunit framework also provides …‘  ;)

Axel

Patrick Heeb

unread,
Aug 21, 2014, 7:10:17 AM8/21/14
to yakind...@googlegroups.com, Axel Terfloth
Hi Axel

That makes sense :-).  generating the tests.
I'll have a look at the existing test projects and test generators.

Reusing the existing tests and frameworks is a good thing.
So I'll try to integrate with what's already there.

regards
Patrick

Axel Terfloth

unread,
Aug 21, 2014, 10:14:29 AM8/21/14
to yakind...@googlegroups.com, Patrick Heeb
Hi Patrick,

ok - then we will provide you the sctunit plugins.

Best regards,
Axel
Message has been deleted

Daniel Berg

unread,
Nov 23, 2016, 10:13:42 AM11/23/16
to YAKINDU User, speed...@gmail.com
Hi!

I wonder about the status of the generator, is it finished/complete or is it more to do to it?

Best regards,
Daniel

andreas

unread,
Nov 23, 2016, 2:00:10 PM11/23/16
to yakind...@googlegroups.com
Hi Daniel,

the last update was in 2014 and we changed some code generator APIs in the meantime so it will not work with the current version of Statechart Tools. :-(

If you are interested in contributing let me know!

Best,

Andreas

 



Patrick Heeb

unread,
Nov 24, 2016, 3:28:08 AM11/24/16
to Daniel Berg, YAKINDU User
Hi Daniel

as far as I remember the generator was finished back in 2014.
I tried to use the unit tests but unfortunately was busy with other projects.

As Andreas wrote the API changed since then so an update will be required.

Best regards,
Patrick

Daniel Berg

unread,
Nov 24, 2016, 11:20:50 AM11/24/16
to YAKINDU User
Hi Andreas and SpeedPat!

Thanks for your quick response!
I have no knowledge about writing plugins (or what it is..) so I'm afraid I can't help.

I shall take a look at it this weekend just for fun but don't count on me to produce anything useful.

If Yakindu had brought this as a 'built-in' generator this had been a great solution for the project I'm working with.
Any plans to include it?

Best regards,
Daniel

Daniel Berg

unread,
Nov 26, 2016, 11:06:26 AM11/26/16
to YAKINDU User
Hi,

I have downloaded the boost generator code and got it compiled.
So the but.... it ends in a java.lang.NullPointerException as soon one of the rows 'flow.generate*' in BoostGenerator.java is called.

Don't know how to change it to correct it, do you have a clue?

Best regards,
Daniel

Daniel Berg

unread,
Nov 27, 2016, 8:01:43 AM11/27/16
to YAKINDU User
Hi,
Found that the injects isn't initialized when running the project in eclipse, have tried to solve it without success so leave it.
I am very interested to hear if someone does the job of upgrading this generator.

Best regards,
Daniel 

Patrick Heeb

unread,
Nov 29, 2016, 11:44:32 AM11/29/16
to YAKINDU User

Hi

I'll look into it

cheers
Patrick


--
You received this message because you are subscribed to a topic in the Google Groups "YAKINDU User" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/yakindu-user/89-iFyPWAQs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to yakindu-user+unsubscribe@googlegroups.com.

Andreas Mülder

unread,
Nov 29, 2016, 2:36:19 PM11/29/16
to YAKINDU User
Patrick,

would it be possible to contribute your code to a github repository?
This would make collaboration a bit easier for us. :-)

Best,

Andreas


Patrick Heeb

unread,
Nov 29, 2016, 4:42:35 PM11/29/16
to YAKINDU User

Hi Andreas

sure, i'll send a pull request when I'm done

cheers
Patrick


Daniel Berg

unread,
Nov 30, 2016, 2:21:38 PM11/30/16
to YAKINDU User
Hi SpeedPat,

Good to hear you are on it!
I look forward to hearing about your progress.

I have done some job on getting it to work in a branch but I haven't rights to push it to bitbucket if I am right.

I got it running without crashes on my computer but it seems to be some functionality missing like handing of guards for example.
With my changes I got some code produced that seemed to not have any target states assigned in the transition table, initial state was also missing from that definition.

Don't know if those changes could be any help for you if I could push it somewhere?

cheers,
Daniel




Den tisdag 29 november 2016 kl. 22:42:35 UTC+1 skrev SpeedPat:

Hi Andreas

sure, i'll send a pull request when I'm done

cheers
Patrick

On Nov 29, 2016 20:36, "'Andreas Mülder' via YAKINDU User" <yakind...@googlegroups.com> wrote:
Patrick,

would it be possible to contribute your code to a github repository?
This would make collaboration a bit easier for us. :-)

Best,

Andreas


--
You received this message because you are subscribed to a topic in the Google Groups "YAKINDU User" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/yakindu-user/89-iFyPWAQs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to yakindu-user...@googlegroups.com.

Patrick Heeb

unread,
Dec 10, 2016, 4:36:08 AM12/10/16
to YAKINDU User
Hi Daniel

sorry for not replying earlier. I was busy with work stuff.

I pushed the original code to github.

feel free to fork and send me a pull request. 
I will review your changes.

kind regards
Patrick

To unsubscribe from this group and all its topics, send an email to yakindu-user+unsubscribe@googlegroups.com.

Daniel Berg

unread,
Dec 15, 2016, 4:47:06 AM12/15/16
to YAKINDU User
Hi,

I doubt that you have any use for my changes, the only thing I did was to get it compiled so I could evaluate it.
Of what I found there is still a lot left to do and I'm not sure if I will be able to/have time for adding the functionality we need from it.
I have to wait for decisions about if we are going to use Yakindu or not.

Thanks alot for your help!
I will get back if we decide to go forward with this.

Regards,
Daniel

Axel Terfloth

unread,
Dec 15, 2016, 7:07:18 AM12/15/16
to Daniel Berg, yakind...@googlegroups.com
Hi,

just for your information - after our YSCT release tomorrow we will take a closer look at Boost-MSM and will decide how to continue with that topic.

Best regards,
Axel
You received this message because you are subscribed to the Google Groups "YAKINDU User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yakindu-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


Need professional support for Yakindu Statechart Tools?
Contact us: state...@itemis.de

Daniel Berg

unread,
Dec 15, 2016, 7:26:08 AM12/15/16
to YAKINDU User, drsnugg...@gmail.com
Hi Axel,

Great news!
Looking forward to hear more about it!

Thanks!

Best regards,
Daniel
Reply all
Reply to author
Forward
0 new messages