Skip to main content



      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 12:55 Go to next message
Eclipse UserFriend
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.
Re: Initialization of default values on parsing [message #1785262 is a reply to message #1785261] Wed, 11 April 2018 13:02 Go to previous messageGo to next message
Eclipse UserFriend
Am not sure if this is the correct extension point.
Maybe iderivedstatecomputer is better
Re: Initialization of default values on parsing [message #1785263 is a reply to message #1785262] Wed, 11 April 2018 13:03 Go to previous message
Eclipse UserFriend
Or do nothing but use a custom qualified name provider

Or a custom eoperation
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 Jun 17 08:00:06 EDT 2025

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

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

Back to the top