Skip to main content



      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 14:46 Go to next message
Eclipse UserFriend
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 14:47] by Moderator

Re: XBase operators marked as error in DomainModel example project [message #716248 is a reply to message #716244] Tue, 16 August 2011 14:59 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

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

~Christian
Re: XBase operators marked as error in DomainModel example project [message #716282 is a reply to message #716248] Tue, 16 August 2011 17:40 Go to previous message
Eclipse UserFriend
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: Wed Jul 23 22:02:50 EDT 2025

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

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

Back to the top