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: 14665
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


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: 14665
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


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: 14665
Registered: July 2009
Senior Member
Hi,

forget about this - in this case it will work

~Christian


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: Wed Apr 24 14:53:53 GMT 2024

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

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

Back to the top