Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [xtend] Ecore post processing(Syntax errors)
[xtend] Ecore post processing [message #698770] Wed, 20 July 2011 07:53 Go to next message
Balazs Varnai is currently offline Balazs VarnaiFriend
Messages: 21
Registered: June 2011
Junior Member
Hi,

Consider the following '.ext' file for my xtxt


process(xtext::GeneratedMetamodel this) :
  process(ePackage)
;
 
process(ecore::EPackage this) :
    {
	var i = 100
	}
;


The problem is that language constructs like var/for/if etc., are underlined as syntax errors. I tried to use java 'println' but 'import' also fails. Xtend project nature was added.

Thanks!

Re: [xtend] Ecore post processing [message #698782 is a reply to message #698770] Wed, 20 July 2011 08:20 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

note that ".ext" files are not Xtend2-Files. It is the "old" Xtend. The eclipse help also contains the language definitions for Xpand/Xtend/Check.

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Re: [xtend] Ecore post processing [message #698783 is a reply to message #698770] Wed, 20 July 2011 08:20 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

if you write invalid syntax you of course get syntax errors:
.ext is Xpand/Xtend(1)
.xtend is Xtend(2)

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [xtend] Ecore post processing [message #698788 is a reply to message #698783] Wed, 20 July 2011 08:26 Go to previous messageGo to next message
Balazs Varnai is currently offline Balazs VarnaiFriend
Messages: 21
Registered: June 2011
Junior Member
Let me quote the xtext2 reference section Customized Post Processing

Quote:

As a last step, the generator invokes the post processor for every generated Ecore model. The post processor expects an Xtend1 file with name MyDslPostProcessor.ext (if the name of the grammar file is MyDsl.xtext) in the same folder as the grammar file.


So I can use xtend2 files in post processing? Thanks!

By the way Eclipse help contains Xtend content, no mention of xtend1/xtend2 which is kind of misleading.

[Updated on: Wed, 20 July 2011 08:29]

Report message to a moderator

Re: [xtend] Ecore post processing [message #698791 is a reply to message #698788] Wed, 20 July 2011 08:30 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Well, what does the quote say?
Quote:
The post processor expects an Xtend1 file


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Re: [xtend] Ecore post processing [message #717876 is a reply to message #698791] Mon, 22 August 2011 15:44 Go to previous messageGo to next message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 392
Registered: July 2015
Senior Member
You can use Xtend2 files if you are not afraid to some customization to the generator process: see http://christiandietrich.wordpress.com/2011/07/22/customizing-xtext-metamodel-inference-using-xtend2/ for details.
Re: [xtend] Ecore post processing [message #717878 is a reply to message #717876] Mon, 22 August 2011 15:49 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi Zoltan,

this thread was the inspiration for my blogpost Wink

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:While ,Run As -> Generate Xtext Artifacts
Next Topic:Generating multiple files with xtend
Goto Forum:
  


Current Time: Tue Mar 19 10:54:45 GMT 2024

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

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

Back to the top