Xbase customization - Problem introducing support for IN construct in my language [message #1839776] |
Sun, 28 March 2021 12:40  |
Neeraj Bhusare 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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01801 seconds