Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [Xtext] Problem with basic XBase tutorial
[Xtext] Problem with basic XBase tutorial [message #1049308] Thu, 25 April 2013 17:14 Go to next message
Alan DW is currently offline Alan DWFriend
Messages: 119
Registered: March 2012
Senior Member
Hello everyone,
I've heard awesome news about the new possibilities of Xtext 2.4, and so I set out to find a tutorial. I've ended up with the "5 simple steps to your JVM language", which can be found here:

http://git.eclipse.org/c/tmf/org.eclipse.xtext.git/plain/plugins/org.eclipse.xtext.doc/contents/035-domainmodel-java.html

I installed Xtext 2.4 and closely followed the steps, however, I run into compile errors when writing the DomainmodelJvmModelInferrer. The grammar (*.xtext) compiles fine and the MWE2 workflow is running without errors, but Xtend complains about the fields "element.superType" and "element.features" being undefined. I've tried to do the tutorial two times from scratch now, unfortunately without success.

Also, I get a whole flurry of compile warnings in the Xtend file complaining about "discouraged access" due to some project restrictions - but I never specified any restrictions at all!

Is the tutorial up-to-date or did Google mislead me to an outdated page here? Any known errors? Or is it just my plain old foolishness that struck once again? ^_^


Thanks,


Alan
Re: [Xtext] Problem with basic XBase tutorial [message #1049316 is a reply to message #1049308] Thu, 25 April 2013 17:25 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi i actually cannot reproduce This. Can you share your projects
(exported as archive)

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [Xtext] Problem with basic XBase tutorial [message #1049319 is a reply to message #1049316] Thu, 25 April 2013 17:32 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
btw the restrictions warning only imply that the api use are using can change with upcoming Xtext releases

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [Xtext] Problem with basic XBase tutorial [message #1049357 is a reply to message #1049319] Thu, 25 April 2013 18:52 Go to previous messageGo to next message
Alan DW is currently offline Alan DWFriend
Messages: 119
Registered: March 2012
Senior Member
Thank you for your help, I'll post my files tomorrow when I get back to my PC.
Thanks,

Alan
Re: [Xtext] Problem with basic XBase tutorial [message #1049370 is a reply to message #1049357] Thu, 25 April 2013 19:19 Go to previous messageGo to next message
Alan DW is currently offline Alan DWFriend
Messages: 119
Registered: March 2012
Senior Member
Hi,

I've managed to get my hands on my files via Dropbox. I've attached the project as a zip file to this post (exported through the eclipse project exporter). I also just tried to copy-paste the grammar again into the *.xtext file and re-generate the language environment, but the error still remains. I also checked the import statements in the xtend file and they seem to be alright (i.e. they match those of the tutorial).

Somehow I've got a distinct feeling that this is going to end up embarassing for me because I made a tiny mistake somewhere ^_^'

[Updated on: Thu, 25 April 2013 19:21]

Report message to a moderator

Re: [Xtext] Problem with basic XBase tutorial [message #1049375 is a reply to message #1049370] Thu, 25 April 2013 19:24 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Domainmodel element != Entity element ;D

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [Xtext] Problem with basic XBase tutorial [message #1049378 is a reply to message #1049375] Thu, 25 April 2013 19:27 Go to previous message
Alan DW is currently offline Alan DWFriend
Messages: 119
Registered: March 2012
Senior Member
... and that's what you get if you don't copy-paste the code but write it on your own to get a better grasp of how it works ^_^' Thanks Christian, I'm really sorry for the trouble. Don't ask me how that "Domainmodel" identifier got there, I have no idea. Works perfectly now, thanks again!

(Note: the irony here is that most methods actually worked on the Domainmodel instance as well xD I would have realized sooner that I'm using the wrong type if it failed somewhere else as well...)

[Updated on: Thu, 25 April 2013 19:29]

Report message to a moderator

Previous Topic:[Xtext typesystem] Avoid type checking of unresolved references
Next Topic:XText 2.4.1 DomainmodelJvmModelInferrer
Goto Forum:
  


Current Time: Fri Mar 29 04:38:40 GMT 2024

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

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

Back to the top