Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » LWC11 XText Submission(quite a few problems ...)
LWC11 XText Submission [message #728628] Fri, 23 September 2011 14:57 Go to next message
Michel Simeon is currently offline Michel SimeonFriend
Messages: 130
Registered: December 2009
Senior Member
I find the LWC11 XText submission a very good tutorial to learn some of the most advanced features of Xtext and am trying to follow it step by step.

There is a warning that XText 2.0 was not fully stabilized when this was written, and indeed this is creating some problems when trying to run it using Eclipse 3.7 and XText 2.0.1.

I have reached the last section of Phase 1.1, Implementing the Scope Provider.

The paper gives:

public class InstancesScopeProvider extends XbaseScopeProvider {

@Override
public IScope createLocalVarScopeForBlock(final XBlockExpression block, final int indexOfContextExpressionInBlock,
final IScope parentScope) {
...
}

The @Override triggers an error because now XbaseScopeProvider.createLocalVarScopeForBlock has one more parameter (Boolean referredFromClosure). Should I add the parameter to the method then ?

There is a similar problem with the next method:

public IScope createLocalVarScope(final EObject context, final EReference reference, final IScope parentScope,
final boolean includeCurrentBlock, final int idx) {
if (context instanceof Instance) {
...
return MapBasedScope.createScope(parentScope, Scopes.scopedElementsFor(localVars));
} else {
return super.createLocalVarScope(context, reference, parentScope, includeCurrentBlock, idx);
}
}

The parameter list of super.createLocalVarScope is now quite different:
protected IScope createLocalVarScope(IScope parentScope, LocalVariableScopeContext scopeContext) {

How should that be handled ?

Thanks for help
MS


Re: LWC11 XText Submission [message #728699 is a reply to message #728628] Fri, 23 September 2011 17:10 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

(1) yes why not adding the param
(2) have a look at the domain model example shipped with xtext (signature of createLocalVarScope has changed to - there should be a @override too)

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: LWC11 XText Submission [message #728890 is a reply to message #728699] Sat, 24 September 2011 08:25 Go to previous message
Michel Simeon is currently offline Michel SimeonFriend
Messages: 130
Registered: December 2009
Senior Member
Thanks Christian, that will keep me going.
MS
Previous Topic:Crossreferences & XText 2
Next Topic:ImportURIScopingFragment vs. ImportNamespacesScopingFragment
Goto Forum:
  


Current Time: Fri Apr 26 00:23:29 GMT 2024

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

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

Back to the top