Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » XBase operators marked as error in DomainModel example project
XBase operators marked as error in DomainModel example project [message #716244] Tue, 16 August 2011 18:46 Go to next message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
I'm trying to go through the DomainModel example included with XText 2.0.1 but the generated text editor marks operators other than assignments as errors in the model editor. The error is always a variant of "Couldn't resolve reference to JvmIdentifiableElement 'x'. where 'x' is replaced by the operator being used.

If you create the following dmodel file when running the example:

entity test {
public op anOp (int number) : int {
var temp = 100;
temp = number + temp;
temp += number;
return temp * number;
}
}

The initial assignment temp = 100 is accepted.

The '+' in number + temp, the '+=' in number += number, and the '*' in temp * number are marked with the red squiggle and hovering over them give you the "Couldn't resolve references to JvmIdentifiableElement" message.


[Updated on: Tue, 16 August 2011 18:47]

Report message to a moderator

Re: XBase operators marked as error in DomainModel example project [message #716248 is a reply to message #716244] Tue, 16 August 2011 18:59 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

add org.eclipse.xtext.xbase.lib to the path of your model project
+= (operator_add) is not an supported operator for ints

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: XBase operators marked as error in DomainModel example project [message #716282 is a reply to message #716248] Tue, 16 August 2011 21:40 Go to previous message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
That fixed it. It also appears to give me a clue how to deal with operators in a custom language.

Thanks.
Previous Topic:MWE2 workflow generated import: "import org.eclipse.xtext.parsetree.*"
Next Topic:java.lang.OutOfMemoryError: PermGen space
Goto Forum:
  


Current Time: Thu Mar 28 17:58:33 GMT 2024

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

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

Back to the top