Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Generating code for NesC language
Generating code for NesC language [message #1131085] Thu, 10 October 2013 03:11 Go to next message
Aditya Pavan Devisetty is currently offline Aditya Pavan Devisetty
Messages: 13
Registered: August 2013
Junior Member
Hi,

I want to develop an Eclipse graphical Editor Application for NesC programming language(for more about NesC go to URL: en.wikipedia.org/wiki/NesC) . NesC (network embedded systems C), pronounced "NES-see", is a component-based, event-driven programming language used to build applications for the TinyOS platform. TinyOS is an operating environment designed to run on embedded devices used in distributed wireless sensor networks. nesC is built as an extension to the C programming language with components "wired" together to run applications on TinyOS.

NesC contains Components and interfaces , these components are wired to other components based on the interfaces. I want to show these components and interfaces in a Palette, So that the user can easily drag and drop the components and wired the components based on interfaces on design tab of multipage editor ; Nesc code will be genarated on source tab, which is like a Eclipse Window Builder.

Would you please suggest me, how to generate code in source tab based on the components in design page of multipage editor. I have a NesC parser which parses the NesC code and constructs AST. And I want to develop this application using GEF,EMF and GMF.

Thanks & Regards,
Venkata Aditya Pavan D.
Re: Generating code for NesC language [message #1131719 is a reply to message #1131085] Thu, 10 October 2013 15:07 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25919
Registered: July 2009
Senior Member
Aditya,

Comments below.

On 10/10/2013 9:11 AM, Aditya Pavan Devisetty wrote:
> Hi,
>
> I want to develop an Eclipse graphical Editor Application for NesC
> programming language(for more about NesC go to URL:
> en.wikipedia.org/wiki/NesC) . NesC (network embedded systems C),
> pronounced "NES-see", is a component-based, event-driven programming
> language used to build applications for the TinyOS platform. TinyOS is
> an operating environment designed to run on embedded devices used in
> distributed wireless sensor networks. nesC is built as an extension to
> the C programming language with components "wired" together to run
> applications on TinyOS.
>
> NesC contains Components and interfaces , these components
> are wired to other components based on the interfaces. I want to show
> these components and interfaces in a Palette, So that the user can
> easily drag and drop the components and wired the components based on
> interfaces on design tab of multipage editor ; Nesc code will be
> genarated on source tab, which is like a Eclipse Window Builder.
>
> Would you please suggest me, how to generate code in source tab
> based on the components in design page of multipage editor.
That's not a trivial answer... The Xtend language might be a nice fit
if you want to generate text. Otherwise you might want to do some kind
of model to NesC AST transformation, but I know nothing of the NesC AST
or of the model from which you're generating...
> I have a NesC parser which parses the NesC code and constructs AST.
> And I want to develop this application using GEF,EMF and GMF.
>
> Thanks & Regards,
> Venkata Aditya Pavan D.
Re: Generating code for NesC language [message #1131752 is a reply to message #1131719] Thu, 10 October 2013 15:35 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4003
Registered: July 2009
Senior Member
On 10/10/2013 20:07, Ed Merks wrote:
> Would you please suggest me, how to generate code in source tab based
> on the components in design page of multipage editor.
> That's not a trivial answer... The Xtend language might be a nice fit
> if you want to generate text. Otherwise you might want to do some
> kind of model to NesC AST transformation, but I know nothing of the
> NesC AST or of the model from which you're generating...
>> I have a NesC parser which parses the NesC code and constructs AST.
>> And I want to develop this application using GEF,EMF and GMF.
Embedded systems can be quite challenging because they have many concerns.

Using GEF and GMF seems mis-guided for CG. Who wants to stop a Java
compilation halfway through to visualize the intermediate models?

I recommend that you aim to provide a cascade of MtoM transformations
culminating in an MtoT. One MtoM per concern.

Use as few different intermediate meta-models as possible so that most
of the MtoMs are homogeneous.

MWE/Java is good for orchestrating the cascade.

ATL/Epsilon/Henshin/QVTo/Viatra2 can do a modelled MtoM. Xtend/Java can
do a more programmatic MtoM.

Xtend is good for the final MtoT that should be designed to be very simple.

If you're interested in optimizations such as Common Subexpression
Elimination, Inlining and Constant Folding you might want to look at
GIT\org.eclipse.ocl\examples\org.eclipse.ocl.examples.codegen, where you
will find the OCL AS model transformed to a CG model that undergoes
multiple optimization passes before an all-Java MtoT to Java.

Regards

Ed Willink
Previous Topic:Re: [CDO] Code Review for a faster Horizontal Mapping
Next Topic:[Texo] getReferringObjects triggers exception
Goto Forum:
  


Current Time: Sat Jul 26 03:07:08 EDT 2014

Powered by FUDForum. Page generated in 0.01746 seconds