Skip to main content



      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 08:40 Go to next message
Eclipse UserFriend
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.
Re: Xbase customization - Problem introducing support for IN construct in my language [message #1839777 is a reply to message #1839776] Sun, 28 March 2021 09:05 Go to previous messageGo to next message
Eclipse UserFriend
hi, i cannot reproduce. sure you added mydsl.libs to the cp of the model/example project?

index.php/fa/40235/0/
Re: Xbase customization - Problem introducing support for IN construct in my language [message #1839785 is a reply to message #1839777] Sun, 28 March 2021 15:20 Go to previous message
Eclipse UserFriend
Hi Christian,

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

Thanks for your time.



Previous Topic:Inheritance in XText
Next Topic:Xtext + OCL
Goto Forum:
  


Current Time: Wed Jul 23 16:36:34 EDT 2025

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

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

Back to the top