Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » 'Cannot find type' error
'Cannot find type' error [message #692418] Mon, 04 July 2011 11:59 Go to next message
john doe is currently offline john doeFriend
Messages: 74
Registered: June 2011
Member
Hi

I have an error in my grammar and I'm not sure why I'm getting this.
The error is
Cannot find type for 'INT | DOUBLE'


My grammar looks like this:

Condition :
	property=[PropertyDefinition] operator=ComparisonOperation value=(INT | DOUBLE)
;

terminal DOUBLE :
	INT '.' (INT)+
;


The error is thrown within my 'Condition' grammar rule.
Why am I getting this error?
Thanks

Re: 'Cannot find type' error [message #692425 is a reply to message #692418] Mon, 04 July 2011 12:18 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13614
Registered: July 2009
Senior Member
Hi,

DOUBLE is an acore::EString
INT an ecore::EInt

this does not fit together. which type should value be of?

~Christian


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: 'Cannot find type' error [message #692429 is a reply to message #692425] Mon, 04 July 2011 12:26 Go to previous messageGo to next message
john doe is currently offline john doeFriend
Messages: 74
Registered: June 2011
Member
Should I thus create a rule that wraps the two types like so?

Condition :
	property=[PropertyDefinition] operator=ComparisonOperation value=ConditionValue
;

ConditionValue :
	DOUBLE | INT
;

terminal DOUBLE :
	INT '.' (INT)+
;


Regards
Re: 'Cannot find type' error [message #692430 is a reply to message #692429] Mon, 04 July 2011 12:28 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13614
Registered: July 2009
Senior Member
if you can live with ConditionValue being probably a estring. btw doesn't you double rule hide the int rule and should
be replaced with a datatype rule too?

~Christian


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: 'Cannot find type' error [message #692431 is a reply to message #692430] Mon, 04 July 2011 12:29 Go to previous messageGo to next message
john doe is currently offline john doeFriend
Messages: 74
Registered: June 2011
Member
Hi Christian. I'm not sure what you mean here by 'hiding'. Could you elaborate on this?

Thanks
Re: 'Cannot find type' error [message #692436 is a reply to message #692431] Mon, 04 July 2011 12:36 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13614
Registered: July 2009
Senior Member
Hi,

forget about this - in this case it will work

~Christian


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Synchronize Xtext and GMF editors
Next Topic:Supertype from referenced ecore model
Goto Forum:
  


Current Time: Tue Sep 29 21:30:09 GMT 2020

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

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

Back to the top