Hi,
this should be 100% straight forward...
first your grammar makes no sense. i start with the following
Model:
entities+=Entity*
mappings+=Mapping*
;
Feature:
name = ID
;
Entity:
'entity' name = ID ('extends' superType = [Entity])? '{'
(features += Feature)*
'}'
;
Mapping:
'from' source=[Entity] '{'
(generated+=EntityMapping
)*
'}'
;
EntityMapping:
target=[Entity] '{'
(mappings+=FeatureMap)*
'}'
;
FeatureMap:
target=[Feature|ID] '=' value=[Feature|ID]
;
then the scopeprovider should look like
class MyDslScopeProvider extends AbstractDeclarativeScopeProvider {
def IScope scope_FeatureMap_target(EntityMapping ctx, EReference ref) {
Scopes.scopeFor(ctx.target.features)
}
def IScope scope_FeatureMap_value(Mapping ctx, EReference ref) {
Scopes.scopeFor(ctx.source.features)
}
}