Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtext/Xtend is not resolving binary operations properly
Xtext/Xtend is not resolving binary operations properly [message #1006824] Sat, 02 February 2013 13:28 Go to next message
Nicolas  Lalevée is currently offline Nicolas LalevéeFriend
Messages: 14
Registered: July 2009
Junior Member
When I put thing like this in my editor: "var test2 = 1 + 1 ;"
I have an error saying: "Couldn't resolve reference to JvmIdentifiableElement '+'."

I tried to look up into the code, but I don't understand what is going on.

I ended up in org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(String), and it fails getting the "linked object".

As far I could see, the "first" of the "triple" is ok. It is an XBinaryOperationImplCustom, in which there are two XNumberLiteralImpl operands.

But I don't understand what the "reference" (second of the triple) should be. Neither what it actually is. The debugger says it has the name "feature".

Here is my Xtext file: https://github.com/nlalevee/jst/blob/master/org.hibnet.jst/src/org/hibnet/jst/Jst.xtext
Propably I am not doing stuff properly in the JVM Model inferer, I don't understand that part well.
https://github.com/nlalevee/jst/blob/master/org.hibnet.jst/src/org/hibnet/jst/jvmmodel/JstJvmModelInferrer.java

[Updated on: Sat, 02 February 2013 13:29]

Report message to a moderator

Re: Xtext/Xtend is not resolving binary operations properly [message #1006825 is a reply to message #1006824] Sat, 02 February 2013 13:29 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 6552
Registered: July 2009
Senior Member
hi did you add xbase lib to the classpath of the project the model file resides in?
Re: Xtext/Xtend is not resolving binary operations properly [message #1007012 is a reply to message #1006824] Sun, 03 February 2013 21:58 Go to previous messageGo to next message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 658
Registered: July 2009
Senior Member
Do you have the org.eclipse.xtext.xbase.lib on your classpath? The
implementation for the basic operations is contained therein, e.g. in
the class IntegerExtensions.

Am 02.02.13 14:28, schrieb Nicolas Lalevée:
> When I put thing like this in my editor: "var test2 = 1 + 1 ;"
> I have an error saying: "Couldn't resolve reference to
> JvmIdentifiableElement '+'."
> I tried to look up into the code, but I don't understand what is going on.
>
> I ended up in
> org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(String),
> and it fails getting the "linked object".
>
> As far I could see, the "first" of the "triple" is ok. It is an
> XBinaryOperationImplCustom, in which there are two XNumberLiteralImpl
> operands.
>
> But I don't understand what the "reference" (second of the triple)
> should be. Neither what it actually is. The debugger says it has the
> name "feature".
>
> Here here is Xtext file:
> https://github.com/nlalevee/jst/blob/master/org.hibnet.jst/src/org/hibnet/jst/Jst.xtext
>
> Propably I am not doing stuff properly in the JVM Model inferer, I don't
> understand that part well.
> https://github.com/nlalevee/jst/blob/master/org.hibnet.jst/src/org/hibnet/jst/jvmmodel/JstJvmModelInferrer.java
>
>


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: Xtext/Xtend is not resolving binary operations properly [message #1008085 is a reply to message #1007012] Fri, 08 February 2013 20:37 Go to previous messageGo to next message
Nicolas  Lalevée is currently offline Nicolas LalevéeFriend
Messages: 14
Registered: July 2009
Junior Member
Yes, I have org.eclipse.xtext.xbase.lib_2.3.1.v201208210947.jar listed in the plugin dependencies, it is listed in the launch configuration, and I can see it listed in installed plugins in the Eclipse launched for debug.
Re: Xtext/Xtend is not resolving binary operations properly [message #1008097 is a reply to message #1008085] Fri, 08 February 2013 22:37 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 6552
Registered: July 2009
Senior Member
Hi,

note: you have to add it to the project your my.myxbasedsl file resides in.


On 2013-02-08 20:37:36 +0000, Nicolas Lalevée said:

> Yes, I have org.eclipse.xtext.xbase.lib_2.3.1.v201208210947.jar listed
> in the plugin dependencies, it is listed in the launch configuration,
> and I can see it listed in installed plugins in the Eclipse launched
> for debug.


--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
Re: Xtext/Xtend is not resolving binary operations properly [message #1008099 is a reply to message #1008097] Fri, 08 February 2013 22:53 Go to previous messageGo to next message
Nicolas  Lalevée is currently offline Nicolas LalevéeFriend
Messages: 14
Registered: July 2009
Junior Member
Thanks, that was it.

And if I am understanding it well, it is only need on the java generation phase (the sort of compilation of my template phase), not the java compilation one neither the runtime. Right ?
Re: Xtext/Xtend is not resolving binary operations properly [message #1008101 is a reply to message #1008099] Sat, 09 February 2013 00:25 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 6552
Registered: July 2009
Senior Member
no it is used at runtime too
Previous Topic:SMI (ASN1) grammar
Next Topic:Using multiple OutputConfigurations with an JvmModelInferrer
Goto Forum:
  


Current Time: Tue Dec 23 03:57:32 GMT 2014

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

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