|
Re: Cross Linking Complex Types [message #825838 is a reply to message #825832] |
Wed, 21 March 2012 10:17 |
|
Hi Malinda,
the normal way is to deal with qualifiedNames. So the Registry Rule should look like this:
Registry:
'Registry' name=ID '{' (ref+=[Student|QualifiedName])* '}'
;
QualifiedName:
ID ('.' ID)*;
The default QualifiedNameprovider will scope a Student with the name of the group followed by a point and then the name of the student. A DataTypeRule named QualifiedName enables you to crossreferenz such names.
Cheers,
Holger
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
|
|
|
|
Re: Cross Linking Complex Types [message #869470 is a reply to message #826305] |
Thu, 03 May 2012 12:51 |
|
There are several solutions for that problem.
1. Ask the eContainer of a Student for its name. Voila the groups name.
2. Let the grammar as it was and create a custom scoping method for scope_Reference_Studentid(Reference ref,EReference x)
Where you could ask for the group and just make the students that are contained visible.
public IScope scope_Reference_Studentid(Reference ref,EReference x){
return Scopes.scopeFor(x.getGroupId().getSudents());
}
Cheers,
Holger
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
|
|
|
Powered by
FUDForum. Page generated in 0.03854 seconds