Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xbase customization - Problem introducing support for IN construct in my language(UnresolvableFeatureCall with the class to state.getLinkingCandidates(featureCall))
Xbase customization - Problem introducing support for IN construct in my language [message #1839776] Sun, 28 March 2021 12:40 Go to next message
Neeraj Bhusare is currently offline Neeraj BhusareFriend
Messages: 177
Registered: July 2009
Location: Canada
Senior Member
Hi,

In the DSL based on Xbase [0], I am trying to introduce the "IN" keyword as an alternative to Iterables.contains(). Provided below is the link to the OperatorMapping [1], ImplicitlyImportedFeatures [2], Extension class [3], TypeComputer [4], and the Compiler [5] classes.

While debugging, I noticed that the call to `state.getLinkingCandidates(featureCall)` in the method XbaseTypeComputer#_computeTypes(XAbstractFeatureCall, ITypeComputationState) [6] returns an UnresolvableFeatureCall.

The below is what I have tried so far.

1) Debugged the source code to understand why a correct FeatureLinkingCandidate is returned in cases like - is, ==, etc
2) Looked at multiple Xtext based DSLs (ones that use Xbase) on Github [7]
3) Studied - https://www.slideshare.net/szarnekow/extending-the-xbase-typesystem

I haven't had much luck so far. It will be a great help if I could get some guidance/pointers.

[0] https://github.com/nbhusare/Xbase-sandbox/blob/master/org.xtext.example.mydsl/src/org/xtext/example/mydsl/MyDsl.xtext
[1] https://github.com/nbhusare/Xbase-sandbox/blob/master/org.xtext.example.mydsl/src/org/xtext/example/mydsl/scoping/MyDslOperatorMapping.java
[2] https://github.com/nbhusare/Xbase-sandbox/blob/master/org.xtext.example.mydsl/src/org/xtext/example/mydsl/scoping/MyDslImplicitlyImportedFeatures.java
[3] https://github.com/nbhusare/Xbase-sandbox/blob/master/org.xtext.example.mydsl.libs/src/org/xtext/example/mydsl/libs/MyDslExtensions.java
[4] https://github.com/nbhusare/Xbase-sandbox/blob/master/org.xtext.example.mydsl/src/org/xtext/example/mydsl/compiler/MyDslTypeComputer.java
[5] https://github.com/nbhusare/Xbase-sandbox/blob/master/org.xtext.example.mydsl/src/org/xtext/example/mydsl/compiler/MyDslCompiler.java
[6] https://github.com/eclipse/xtext-extras/blob/17db13e7f756fb8191785af9b1aca370f9add04b/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/computation/XbaseTypeComputer.java#L1220
[7] https://gist.github.com/nbhusare/17f4c024b050f24cd367c8b1cb5b0743

Tx in advance.


Twitter : @NeerajBhusare
Blog : https://nbhusare.github.io/
Best regards, Neeraj
Re: Xbase customization - Problem introducing support for IN construct in my language [message #1839777 is a reply to message #1839776] Sun, 28 March 2021 13:05 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
hi, i cannot reproduce. sure you added mydsl.libs to the cp of the model/example project?

index.php/fa/40235/0/


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Xbase customization - Problem introducing support for IN construct in my language [message #1839785 is a reply to message #1839777] Sun, 28 March 2021 19:20 Go to previous message
Neeraj Bhusare is currently offline Neeraj BhusareFriend
Messages: 177
Registered: July 2009
Location: Canada
Senior Member
Hi Christian,

My bad, I was missing the mydsl.lib project in CP :(

Thanks for your time.





Twitter : @NeerajBhusare
Blog : https://nbhusare.github.io/
Best regards, Neeraj
Previous Topic:Inheritance in XText
Next Topic:Xtext + OCL
Goto Forum:
  


Current Time: Fri Apr 19 04:12:40 GMT 2024

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

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

Back to the top