Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Resolve JvmOperation
Resolve JvmOperation [message #897199] Mon, 23 July 2012 06:51
Goran M. is currently offline Goran M.Friend
Messages: 12
Registered: April 2012
Junior Member
Hi all,

I got a question regarding scoping and resolving proxies. In my grammer I use java objects. Here is a snippet:

Import:
	'import' importedNamespace=QualifiedNameWithWildCard 'as' name=ValidID;

Create:
	'create' importAlias=[Import] '.' javaType=[jvmTypes::JvmType|QualifiedName] 'as' name=Variable;
Call:
	'call' name=[Create|Variable] '.' method=MethodCall;

MethodCall:
	{MethodCall} method=[jvmTypes::JvmOperation|ValidID] '(' (params+=ExtParameterList)* (',' (params+=ExtParameterList))*
	')'
	('.' => nextCall=MethodCall)?;


With this grammar a syntax like the following is possible:

import org.servic.* as service
create service.Customers as $customers
call $customers.getAllCustomers().get(0).getName()



getAllCustomers returns a List<Customer>. I wrote a custom scope provider and I managed to get all JvmOperations when hitting CTRL+SPACE after $customers. Works fine! But somehow the other proposals after getAllCustomers() or after get() don't work. After debuggung I can see, that the method in MethodCall is always a proxy like.


org.eclipse.xtext.common.types.impl.JvmOperationImpl@21967775 (eProxyURI: platform:/resource/AXA/Tarif/PHV/Service/GetQuote/request.bsf#xtextLink_::0.0.36.1.2::0::/1)


But how can I resolve such a proxy? I even got problems to get the proxy-uri out of the object as I cannot find an appropriate method.

Can anybody help me out?

Regards
Goran


P.S.: Besides the question above. I realized that in the scope provider the objects are slightly different when hitting CTRL+SPACE compared to the objects after changing the script and saving it. Can anybody explain me why?

[Updated on: Mon, 23 July 2012 07:23]

Report message to a moderator

Previous Topic:XText Developer Documentation
Next Topic:manage the String type and what is generated from my dsl Grammar
Goto Forum:
  


Current Time: Mon Feb 24 09:21:32 GMT 2020

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

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

Back to the top