Hi Rishab,
> Hi,
>
> I was trying to write the custom code generator for AVR AT90CAN128 microcontroller and needed some documentation on sexec metamodel elements. I wanted to access the variables, events, entry actions, exit actions, states, transitions for the Xpand template that I want to write.
Yes - there is currently no publicly available documentation. That is an open issue for some time and we will provide documentation on how to build custom code generators. We will do that as soon as we have finished our built in generators. This is currently not the case as we are still working on these topics. As an example we are currently reimplementing the C code generator using Xtend2.
One goal is to make the built in code generators reusable and customizable since implementing a generator from scratch is a big bunch of work. The sexec meta model plays an important role in this context. An sexec model will be created from the original statechart model and captures the execution semantics using an imperative / control flow based paradigm. It is still target language independent and we use it in all our code generators. Each code generator in turn consists of two main parts. First the part that generates the target language or platform specific code and the second that generates the behavioral parts (function implementations). The generators will be build in a way that it is possible to derive a more specific code generator based on our base implementation.
> If there is no documentation, how can I access these properties?
Currently the best approach is to take a look at the sources. Check out the project 'org.yakindu.sct.generator.c' from our subversion. The subversion repository can be found at:
http://svn.codespot.com/a/eclipselabs.org/yakindu/
You will find the plugin project in 'SCT2/trunk/plugins'. See also the checkout instructions at:
http://code.google.com/a/eclipselabs.org/p/yakindu/source/checkout .
Within the project take a look at the xpand templates in the package 'org.yakindu.sct.generator.c.templates'. The main templates is in Main.xpt . When you define a plugin dependency to this plugin, then you should be able to reuse Xpand templates and Xtend(1) extension functions.
But please be aware, that this generator will be deprecated as soon as the new version is available.
Best regards,
Axel