#17 Restricting Scope
Learn how to explicitly and implicitly restrict a scope of an object for a single reference. We will override AbstractDeclarativeScopeProvider reducing the default scope explicitly. Then we will revert changes, add validator and modify content assistant to achieve even better results reducing the default scope implicitly.
- Download:
- source code
- mp4
- m4v
- webm
- ogv
Congratulations for putting this series of screencasts about Xtext.
I jumped straight on episode 17, since I am currently implementing scoping in a DSL, and I am a beginner with Xtext.
Some comments on the episode:
I'm happy you like XtextCasts!
Also thank you for the advice with the version information. I already put the versions of the used software at the bottom on the show notes of the episode 17. I will do it for all other episodes soon.
And here again:
There shouldn't be so much differences between Xtext 2.3 and 2.4 considering episode 17. What problems do you have exactly?
Operators:
def
keyword. For example, see definition of the compile methoddef compile(Entity e)
(page 28).The extended scoping tutorial is planed, but the topic is pretty complicated and because of this very time consuming :-(
Awesome, really helpful!
Had to bring this together with an ImportedNamespaceAwareScopeProvider (INASP). Just learned that, by default, the AbstractDeclarativeScopeProvider (ADSP) delegates to INASP when it cannot find a scope itself.
So, when you have a specialization of INASP and one for ADSP, you are fine by just binding them like this in the RuntimeModule of your language:
@Override
public Class<? extends IScopeProvider> bindIScopeProvider() {
return YourADSP.class;
}
public Class<? extends ImportedNamespaceAwareLocalScopeProvider> bindImportScopeProvider() {
return YourINASP.class;
}
Will have a look at the other casts.
Thank you for the contribution. Scope is a complex topic, that will be often misunderstood. I will definitely make more episodes about it in the future.
this is an example to limit scope to the active DSL file only
(based on the standard XTEXT project)
with a lot of help from the forum:
"reducing cross reference to current DSL file" http://www.eclipse.org/forums/index.php/t/635607/
Greetings from Frankfurt/Germany
Uli
P.S. @Boris: your screencasts are a great support for XTEXT newbies like me
Thank you very much for your contribution!
First sign in through GitHub to post a comment.