Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Scope Traversal
icon5.gif  Scope Traversal [message #827354] Fri, 23 March 2012 04:03
Eclipse UserFriend
Does it cost a lot of time to traverse the nested scopes to access every EObjectDescriptions?

I want to support function overloading. My way is to get the scope calculated by the method "getScope" of "DefaultLinkingService". And then, try to match the parameters' type and the formals' type. The formals can be getten by accessing the method object's EObjectDescription in the scope.

So I have to go through the nested scope before "getSingleElement" is called by the "getLinkedObjects".

I found it is inefficient.

Who can help me on this problem?

----------------------------------------------------
my idea of supporting overloading of function
public List<EObject> getLinkedObjects(EObject context, EReference ref,
INode node) throws IllegalNodeException {

final String crossRefString = getCrossRefNodeAsString(node);
IScope potentialScope = getScope(context, ref);
if(isFunctionCall(potentialScope)){
potentialScope = getOverloadedFScope(potentialScope,node);
//I will go through the scope "potentialScope" here
}
final IScope scope = potentialScope;
IEObjectDescription description = scope.getSingleElement(qualifiedLinkName);
//...
}

[Updated on: Fri, 23 March 2012 04:26] by Moderator

Previous Topic:[Xtext 2.2.1] Simple conditional formatting?
Next Topic:Wiki-like Syntax
Goto Forum:
  


Current Time: Fri Jul 04 16:18:56 EDT 2025

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

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

Back to the top