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