Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Initialization of default values on parsing(Extending DefaultEcoreElementFactory to set default value to EObjects)
Initialization of default values on parsing [message #1785261] Wed, 11 April 2018 16:55 Go to next message
Krzysztof Drozd is currently offline Krzysztof DrozdFriend
Messages: 12
Registered: July 2017
Location: Amsterdam
Junior Member
Hi,

I have problems with my language; it's assumed that top level container name is equal to file name (resource) in which text of this model exist.

Model:
 class {Model} (name=ID)? {
    classElements+=ClassElement*
}


Some thing like this Model can be there but name is not mandatory. I come with extending DefaultEcoreElementFactory.set() to set default value to it... but I don't know how to get file/resource name as EObject?.eResource?.URI returns null .


Probably there is something that I can @Inject but what?

Thanks is advance.


Thanks
Krzysiek
Re: Initialization of default values on parsing [message #1785262 is a reply to message #1785261] Wed, 11 April 2018 17:02 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12243
Registered: July 2009
Senior Member
Am not sure if this is the correct extension point.
Maybe iderivedstatecomputer is better


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Initialization of default values on parsing [message #1785263 is a reply to message #1785262] Wed, 11 April 2018 17:03 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12243
Registered: July 2009
Senior Member
Or do nothing but use a custom qualified name provider

Or a custom eoperation


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Open remote file (on server) in Xtext DSL editor is read only
Next Topic:Issue with a keyword interfering in another rule
Goto Forum:
  


Current Time: Tue Sep 25 23:18:32 GMT 2018

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

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

Back to the top