Xpand/Xtend editor errors [message #717164] |
Fri, 19 August 2011 09:40  |
Eclipse User |
|
|
|
Hi,
I know this has been discussed already (e.g. http://www.eclipse.org/forums/index.php/m/662163/?srch=xpand+editor+property#msg_662163), but sorry, I cannot really figure out the solution.
Here is a simple grammar
grammar dsl.Crapdsl with org.eclipse.xtext.common.Terminals
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
generate crapdsl "dsl.Crapdsl"
Point:
name = ID
coordinate = Coordinate
;
Coordinate:
x = FLOAT
y = ID
z = ID
;
terminal FLOAT returns ecore::EFloat : ('+'?|'-')('0'..'9')*'.'('0'..'9')+;
Why does the Xpand/Xtend editor underline with red 'coordinate.x', complaining that it cannot find such property? y and z are fine, I assume because their type is not EFLoat.
The code generation works perfectly, so it is really an issue with the editor.
In the preferences, I have already selected 'JavaBeans metamodel' and 'EMF metamodel', with no success.
I am using Eclipse Helios, Xtext 1.0.2
Thank you
B
|
|
|
|
|
|
|
|
|
Re: Xpand/Xtend editor errors [message #718079 is a reply to message #717252] |
Tue, 23 August 2011 03:50  |
Eclipse User |
|
|
|
I see. Thanks for the explanation.
Unfortunately the problem persists, even if I avoid completely custom terminal rules:
Coordinate:
x = Float
y = ID
z = ID
;
Float returns ecore::EFloat :
('+'?|'-')(Digit)*'.'(Digit)+;
Digit:
('0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9');
(I also had to provide a custom ValueConverter to transform a string like -13.093 to a Float)
I'm sure this is not the best neither most elegant way to do what I want; anyway, even though there are no terminal rules, the xpand editor still complains about the property coordinate.x. Looks like the problem is with ecore types.
B
[Updated on: Tue, 23 August 2011 04:52] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04901 seconds