Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Couldn´t find definition for
Couldn´t find definition for [message #528312] Tue, 20 April 2010 07:07 Go to next message
Daniel Stieger is currently offline Daniel StiegerFriend
Messages: 24
Registered: April 2010
Junior Member
Hello,

i have error bullet points in the problem window of eclispe, when i edit xpand files. Obviously the problem has to do something with polymorphism.

I have the following inheritance hierarchie defined in xtext:

DAField:
DAElementaryInt | DAElementaryFloat;


Now in xpand i wrote

«EXPAND dotfieldsyntax FOREACH fields SEPARATOR "|"-»

and i implemented two defines :
«DEFINE dotfieldsyntax FOR DAElementaryInt»<«objectFieldRefName()»>(Int) «this.name»«ENDDEFINE»
«DEFINE dotfieldsyntax FOR DAElementaryFloat»<«objectFieldRefName()»>(Float) «this.name»«ENDDEFINE»


but i receive a error message in the editor:
"Couldn't find definition dotfieldsyntax for type mState::DAField"

However, the template works! But the whole editor is completle red....

How could i solve this probleme?
Best,
Daniel
Re: Couldn´t find definition for [message #528316 is a reply to message #528312] Tue, 20 April 2010 07:22 Go to previous messageGo to next message
MaximeLecourt  is currently offline MaximeLecourt Friend
Messages: 108
Registered: February 2010
Location: France
Senior Member
I have been having the same problem, in my case DAField is even defined as abstract.

You have to create a Define for DAField.
Mine sends an error message, as it should never be used.


One day I shall master M2T, but that day has yet to come...
Re: Couldn´t find definition for [message #528335 is a reply to message #528316] Tue, 20 April 2010 08:14 Go to previous messageGo to next message
Daniel Stieger is currently offline Daniel StiegerFriend
Messages: 24
Registered: April 2010
Junior Member
Hi,

thanks for the answer. I defined DAField now directly -> What doesn´t make sense

«DEFINE dotfieldsyntax FOR DAField» --- ERROR2 --- «ENDDEFINE»

But there error bullets will leave. Is there no other solution?

Dan
Re: Couldn´t find definition for [message #528371 is a reply to message #528335] Tue, 20 April 2010 09:52 Go to previous messageGo to next message
Darius Jockel is currently offline Darius JockelFriend
Messages: 63
Registered: July 2009
Member
Hello,

the xpand editor expect also a DEFINE for the most common type of an collection. This is because Xpand do not know about the constraints in your DSL. What about if you define a DSL wihout the concept 'abstract'?
So every MetaModelAdapter should have to tell the editor about this concept and how it is realized?
Also it is convenience-feature for you ( Smile ) :
* If you add another subtype of DAElementary, your templats will work. So the templates are more robust.
Re: Couldn´t find definition for [message #528383 is a reply to message #528371] Tue, 20 April 2010 10:44 Go to previous message
Daniel Stieger is currently offline Daniel StiegerFriend
Messages: 24
Registered: April 2010
Junior Member
Yes i see. This is correct. If i ll define another Type in the DSL, but i do not update the template, i ll get my --- ERROR --- notification in the generated artifact.

Thanks a lot for your comments,
Dan
Previous Topic:Using the xpand collection utilities from java
Next Topic:[Acceleo/MoDisco] Problem generating Java source code
Goto Forum:
  


Current Time: Wed Apr 24 23:22:21 GMT 2024

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

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

Back to the top