Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » how to enforce resource generation when having deep cross-reference over multiple resources
how to enforce resource generation when having deep cross-reference over multiple resources [message #1321797] Tue, 29 April 2014 14:04 Go to next message
Guy H is currently offline Guy HFriend
Messages: 3
Registered: April 2014
Junior Member
I just started using Xtext a couple of months ago. I have the following grammar:

grammar org.example.entities.Entities with org.eclipse.xtext.common.Terminals

generate entities "http: //www.example.org/entities/Entities"

import "http: //www.eclipse.org/emf/2002/Ecore" as ecore
import "http: //www. eclipse.org/xtext/common/JavaVMTypes"

Model: entities += Entity | Composite;

Entity:
  'entity' name = ID ('extends' superType=[Entity])? '{'
    attributes += Attribute*
    strings += StringAttr*
  '}'
;

StringAttr: 'string' name=ID;
Attribute:
  type=[Entity] array?=('[]')? name=ID ';';

EntityField:
    'field' field=[Entity];


Lets say I have 3 files:
file first.entities:
entity entity1 {
  string s
}


file second.entities:

entity entity2 extends entity1 {
  string s2
}


file third.entities:

entity entity3 extends entity2 {
  string s3
}


when I modify entity1, for example add string myString to it, then the doGenerate(..) method is invoked twice - for first.entities and for second.entities due to the cross reference between entity2 and entity1, but third.entity resouce is not passed to doGenerate(..).

how can I trigger a change event across the entire dependency tree?

Thanks
Re: how to enforce resource generation when having deep cross-reference over multiple resources [message #1321914 is a reply to message #1321797] Tue, 29 April 2014 15:31 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
hi what about the following hook org.eclipse.xtext.resource.IResourceDescription.Manager.isAffected(Collection<Delta>, IResourceDescription, IResourceDescriptions)
(i fear you have to dive yourself to see what todo)


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Read my DSL model "as a whole"
Next Topic:Accessing language preferences
Goto Forum:
  


Current Time: Fri Apr 26 05:38:28 GMT 2024

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

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

Back to the top