Skip to main content



      Home
Home » Modeling » TMF (Xtext) » LWC11 XText Submission(quite a few problems ...)
LWC11 XText Submission [message #728628] Fri, 23 September 2011 10:57 Go to next message
Eclipse UserFriend
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 13:10 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: LWC11 XText Submission [message #728890 is a reply to message #728699] Sat, 24 September 2011 04:25 Go to previous message
Eclipse UserFriend
Thanks Christian, that will keep me going.
MS
Previous Topic:Crossreferences & XText 2
Next Topic:ImportURIScopingFragment vs. ImportNamespacesScopingFragment
Goto Forum:
  


Current Time: Fri Jul 04 16:19:55 EDT 2025

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

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

Back to the top