Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » how to link new xpand project to existing xtext model
how to link new xpand project to existing xtext model [message #1729370] Wed, 13 April 2016 12:56 Go to next message
AYMEN SALMAN is currently offline AYMEN SALMANFriend
Messages: 18
Registered: October 2015
Location: England
Junior Member
Hi

I have already had an existing xtext project where I defined my metamodel and grammar, and it works fine.
now I need to develop xpand project for code generation, so who I can pass the AST (Abstract Syntax Tree) that generated when using Xtext DSL editor and my DSL to the new xpand code generator project.

I am using Eclipse Mars 2 (4.5.2)
Xtext 2.9.2
Xpand 2.1.0
MWE 1.3.13


BR
AYMEN
Re: how to link new xpand project to existing xtext model [message #1729371 is a reply to message #1729370] Wed, 13 April 2016 13:07 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 712
Registered: July 2009
Location: Dortmund, Germany
Senior Member

You should consider to use Xtend for code generation.

In the case you really want to use Xpand, you have to invoke the Xpand generator from within the IGenerator. There, create an XpandExecutionContextImpl with an EmfRegistryMetaModel and create a XpandExecutionContextImpl.

The IGenerator gets an EMF Resource, which contains the AST.

HTH,
~Karsten


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: how to link new xpand project to existing xtext model [message #1729563 is a reply to message #1729371] Fri, 15 April 2016 14:01 Go to previous message
AYMEN SALMAN is currently offline AYMEN SALMANFriend
Messages: 18
Registered: October 2015
Location: England
Junior Member
Thanks Karsten, I will try looking Xtend, and thanks for your kind advice

BR
AYMEN
Previous Topic:Ambiguous binary operator in a PLSQL grammar
Next Topic:How to exclude certain Xtext files from the indexing process
Goto Forum:
  


Current Time: Thu Nov 21 11:09:24 GMT 2019

Powered by FUDForum. Page generated in 0.01806 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top