Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Scope method not execute?
Scope method not execute? [message #991272] Tue, 18 December 2012 09:40 Go to next message
Tommaso De Sica is currently offline Tommaso De SicaFriend
Messages: 131
Registered: March 2012
Location: Italy
Senior Member

I've got this IScope method:
        IScope scope_Assignment(AssignmentOrFBCall a, EReference ref){
		System.out.println(a.toString());
		return IScope.NULLSCOPE;
	}


but it doesn't produce any results. Nothing in output with println and content assistant does not change. So I thought it hasn't be executed, but if I try to add a breakpoint, it will be crossed.

So, where is the problem?

Grammar rule is this:
AssignmentOrFBCall:
	(((variable=[VariableDefinition]) |
	((variableArray=[ArrayDefinition]'['index=ExpressionIndex']')('.'internalVariable=InternalRecursive)?) | 
	(variableStructOrFB=[VariableDefinition]'.')(internalVariable=InternalRecursive))
	((':='expression=Expression)|('('(parameter=FBParameter | ')'))))
;
Re: Scope method not execute? [message #991283 is a reply to message #991272] Tue, 18 December 2012 10:37 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi Xtext creates objects lazy so the context may be a parent. Use a
parent as context or try an unassigned action

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Scope method not execute? [message #991288 is a reply to message #991272] Tue, 18 December 2012 11:06 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

the name of the scope method must be correct as well. Debug the getPredicate method in AbstractDeclarativeScopeProvider to see the "expected" method name.

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Re: Scope method not execute? [message #991462 is a reply to message #991288] Wed, 19 December 2012 10:43 Go to previous message
Tommaso De Sica is currently offline Tommaso De SicaFriend
Messages: 131
Registered: March 2012
Location: Italy
Senior Member

Alexander Nittka wrote on Tue, 18 December 2012 12:06
Hi,

the name of the scope method must be correct as well. Debug the getPredicate method in AbstractDeclarativeScopeProvider to see the "expected" method name.

Alex


Ok,
I'll try it.

Very thank you.
Previous Topic:[M4 Release] The new type system
Next Topic:Question about "Couldn't resolve reference to JvmIdentifiableElement"
Goto Forum:
  


Current Time: Thu Mar 28 19:30:11 GMT 2024

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

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

Back to the top